From 6bf195150bbda3410efa46e680ed6301be1ff245 Mon Sep 17 00:00:00 2001 From: dapplion <35266934+dapplion@users.noreply.github.com> Date: Sat, 6 Jun 2026 12:19:19 +0200 Subject: [PATCH] Fix continue children logic --- .../network/src/sync/block_lookups/mod.rs | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/beacon_node/network/src/sync/block_lookups/mod.rs b/beacon_node/network/src/sync/block_lookups/mod.rs index e025be580f..61b2cfef32 100644 --- a/beacon_node/network/src/sync/block_lookups/mod.rs +++ b/beacon_node/network/src/sync/block_lookups/mod.rs @@ -512,7 +512,7 @@ impl BlockLookups { }; match &result { - BlockProcessingResult::Imported(fully_imported, _) => { + BlockProcessingResult::Imported(..) => { // Some component got imported potentially continue if lookup.is_complete() { if self.single_block_lookups.remove(&id).is_some() { @@ -525,19 +525,17 @@ impl BlockLookups { } else { debug!(id, "Attempting to drop non-existent lookup"); } - } else if *fully_imported - && matches!(process_type, BlockProcessType::SingleBlock { .. }) + } else if matches!(process_type, BlockProcessType::SingleBlock { .. }) + && let Some(bid_block_hash) = lookup.peek_downloaded_bid_block_hash() { - // The block imported into fork choice but the lookup is not `is_complete`: its - // data may have become available via the da_checker (so the lookup's own - // request never completed), or it is a Gloas block whose payload arrives - // separately. Unblock the appropriate children, and complete the lookup unless - // a FULL Gloas child still awaits the payload. - let import_action = match lookup.peek_downloaded_bid_block_hash() { - Some(bid_block_hash) => ImportedAction::GloasBlockComplete(bid_block_hash), - None => ImportedAction::LookupComplete, - }; - self.continue_child_lookups(block_root, import_action, cx); + // For post-Gloas blocks, if the block just became imported attempt to make + // progress on its EMPTY children. Then, if there are no FULL children, remove + // the lookup. + self.continue_child_lookups( + block_root, + ImportedAction::GloasBlockComplete(bid_block_hash), + cx, + ); if !self.has_any_awaiting_children(block_root) { self.single_block_lookups.remove(&id); metrics::inc_counter(&metrics::SYNC_LOOKUP_COMPLETED);