From fdf2fd22673f08fda47b5eb96932eb462c3c6381 Mon Sep 17 00:00:00 2001 From: dapplion <35266934+dapplion@users.noreply.github.com> Date: Wed, 25 Mar 2026 18:38:48 -0500 Subject: [PATCH] Simplify reorg weight logic, TODO(gloas) for payload-aware version Remove V17/V29 branching in beacon_chain reorg weight computation. Use total weight for both pre and post-GLOAS, which is correct for pre-GLOAS and conservative for post-GLOAS. The payload-aware version will be needed when reorg logic is enabled for GLOAS. --- beacon_node/beacon_chain/src/beacon_chain.rs | 25 +++----------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/beacon_node/beacon_chain/src/beacon_chain.rs b/beacon_node/beacon_chain/src/beacon_chain.rs index 60cb9c8dea..c4cc6925ba 100644 --- a/beacon_node/beacon_chain/src/beacon_chain.rs +++ b/beacon_node/beacon_chain/src/beacon_chain.rs @@ -4854,29 +4854,10 @@ impl BeaconChain { return Err(Box::new(DoNotReOrg::NotProposing.into())); } - // If the current slot is already equal to the proposal slot (or we are in the tail end of - // the prior slot), then check the actual weight of the head against the head re-org threshold - // and the actual weight of the parent against the parent re-org threshold. - // Per spec `is_head_weak`: uses get_attestation_score(head, PENDING) which is - // the total weight. Per spec `is_parent_strong`: uses - // get_attestation_score(parent, parent_payload_status) where parent_payload_status - // is determined by the head block's relationship to its parent. + // TODO(gloas): reorg weight logic needs updating for GLOAS. For now use + // total weight which is correct for pre-GLOAS and conservative for post-GLOAS. let head_weight = info.head_node.weight(); - let parent_weight = if let (Ok(head_payload_status), Ok(parent_v29)) = ( - info.head_node.parent_payload_status(), - info.parent_node.as_v29(), - ) { - // Post-GLOAS: use the payload-filtered weight matching how the head - // extends from its parent. - match head_payload_status { - proto_array::PayloadStatus::Full => parent_v29.full_payload_weight, - proto_array::PayloadStatus::Empty => parent_v29.empty_payload_weight, - proto_array::PayloadStatus::Pending => info.parent_node.weight(), - } - } else { - // Pre-GLOAS or fork boundary: use total weight. - info.parent_node.weight() - }; + let parent_weight = info.parent_node.weight(); let (head_weak, parent_strong) = if fork_choice_slot == re_org_block_slot { (