From eaee177d5052c583fd87725c465adf3833874813 Mon Sep 17 00:00:00 2001 From: dapplion <35266934+dapplion@users.noreply.github.com> Date: Fri, 24 May 2024 17:24:23 +0200 Subject: [PATCH 1/3] Report sync of block import via blob import --- .../src/network_beacon_processor/gossip_methods.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/beacon_node/network/src/network_beacon_processor/gossip_methods.rs b/beacon_node/network/src/network_beacon_processor/gossip_methods.rs index ac5d8b1c370..374dca2a5ab 100644 --- a/beacon_node/network/src/network_beacon_processor/gossip_methods.rs +++ b/beacon_node/network/src/network_beacon_processor/gossip_methods.rs @@ -753,7 +753,9 @@ impl NetworkBeaconProcessor { let blob_slot = verified_blob.slot(); let blob_index = verified_blob.id().index; - match self.chain.process_gossip_blob(verified_blob).await { + let result = self.chain.process_gossip_blob(verified_blob).await; + + match &result { Ok(AvailabilityProcessingStatus::Imported(block_root)) => { // Note: Reusing block imported metric here metrics::inc_counter(&metrics::BEACON_PROCESSOR_GOSSIP_BLOCK_IMPORTED_TOTAL); @@ -802,6 +804,16 @@ impl NetworkBeaconProcessor { ); } } + + // If a block is in the da_checker, sync maybe awaiting for an event when block is finally + // imported. A block can become imported both after processing a block or blob. If a + // importing a block results in `Imported`, notify. Do not notify of blob errors. + if matches!(result, Ok(AvailabilityProcessingStatus::Imported(_))) { + self.send_sync_message(SyncMessage::GossipBlockProcessResult { + block_root, + imported: true, + }); + } } /// Process the beacon block received from the gossip network and: From ef886024d1a135a0041f9f2611c56c1aca5ef7b9 Mon Sep 17 00:00:00 2001 From: dapplion <35266934+dapplion@users.noreply.github.com> Date: Fri, 24 May 2024 17:26:25 +0200 Subject: [PATCH 2/3] Do not double log uknown lookup --- beacon_node/network/src/sync/block_lookups/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/beacon_node/network/src/sync/block_lookups/mod.rs b/beacon_node/network/src/sync/block_lookups/mod.rs index 94645197c99..c96086b2c9e 100644 --- a/beacon_node/network/src/sync/block_lookups/mod.rs +++ b/beacon_node/network/src/sync/block_lookups/mod.rs @@ -663,6 +663,9 @@ impl BlockLookups { } false } + // If UnknownLookup do not log the request error. No need to drop child lookups nor + // update metrics because the lookup does not exist. + Err(LookupRequestError::UnknownLookup) => false, Err(error) => { debug!(self.log, "Dropping lookup on request error"; "id" => id, "source" => source, "error" => ?error); metrics::inc_counter_vec(&metrics::SYNC_LOOKUP_DROPPED, &[error.into()]); From 5b5266ced3b6bf89e9f6466248828857d564da9a Mon Sep 17 00:00:00 2001 From: dapplion <35266934+dapplion@users.noreply.github.com> Date: Fri, 24 May 2024 19:05:22 +0200 Subject: [PATCH 3/3] Fix log text, not necessarily a child lookup --- beacon_node/network/src/sync/block_lookups/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/beacon_node/network/src/sync/block_lookups/mod.rs b/beacon_node/network/src/sync/block_lookups/mod.rs index c96086b2c9e..fb9de90e516 100644 --- a/beacon_node/network/src/sync/block_lookups/mod.rs +++ b/beacon_node/network/src/sync/block_lookups/mod.rs @@ -625,7 +625,11 @@ impl BlockLookups { /// dropped. pub fn drop_lookup_and_children(&mut self, dropped_id: SingleLookupId) { if let Some(dropped_lookup) = self.single_block_lookups.remove(&dropped_id) { - debug!(self.log, "Dropping child lookup"; "id" => ?dropped_id, "block_root" => ?dropped_lookup.block_root()); + debug!(self.log, "Dropping lookup"; + "id" => ?dropped_id, + "block_root" => ?dropped_lookup.block_root(), + "awaiting_parent" => ?dropped_lookup.awaiting_parent(), + ); let child_lookups = self .single_block_lookups