From d8e359a7b652ccb68f3316ec2d9dac1fd9016e80 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Thu, 7 May 2026 12:37:03 +0300 Subject: [PATCH] Prevent chain stall --- beacon_node/beacon_chain/src/block_verification.rs | 10 ++++++---- beacon_node/network/src/sync/block_lookups/mod.rs | 7 +------ 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/beacon_node/beacon_chain/src/block_verification.rs b/beacon_node/beacon_chain/src/block_verification.rs index 84df30e75f..24aae7b999 100644 --- a/beacon_node/beacon_chain/src/block_verification.rs +++ b/beacon_node/beacon_chain/src/block_verification.rs @@ -930,16 +930,17 @@ impl GossipVerifiedBlock { let (parent_block, block) = verify_parent_block_is_known::(&fork_choice_read_lock, block)?; + let Ok(bid) = block.message().body().signed_execution_payload_bid() else { + return Err(BlockError::InternalError("Invalid variant".to_string())); + }; + // [New in Gloas]: Verify bid.parent_block_root matches block.parent_root. - if let Ok(bid) = block.message().body().signed_execution_payload_bid() - && bid.message.parent_block_root != block.message().parent_root() - { + if bid.message.parent_block_root != block.message().parent_root() { return Err(BlockError::BidParentRootMismatch { bid_parent_root: bid.message.parent_block_root, block_parent_root: block.message().parent_root(), }); } - // Check that we've received the parent envelope. If not, issue a single envelope // lookup for the parent and queue this block in the reprocess queue. // @@ -955,6 +956,7 @@ impl GossipVerifiedBlock { if parent_is_gloas && !parent_is_anchor && !fork_choice_read_lock.is_payload_received(&block.message().parent_root()) + && Some(bid.message.parent_block_hash) != parent_block.execution_payload_block_hash { return Err(BlockError::ParentEnvelopeUnknown { parent_root: block.message().parent_root(), diff --git a/beacon_node/network/src/sync/block_lookups/mod.rs b/beacon_node/network/src/sync/block_lookups/mod.rs index bb003dc222..a9d08c30a4 100644 --- a/beacon_node/network/src/sync/block_lookups/mod.rs +++ b/beacon_node/network/src/sync/block_lookups/mod.rs @@ -662,12 +662,7 @@ impl BlockLookups { "Envelope processed, transitioning to custody column lookup" ); let lookup_result = lookup.continue_requests(cx); - self.on_lookup_result( - id, - lookup_result, - "envelope_to_custody_transition", - cx, - ); + self.on_lookup_result(id, lookup_result, "envelope_to_custody_transition", cx); return; }