From 53c0356f8d34a7c17294482e6551476b9d4dbcaa Mon Sep 17 00:00:00 2001 From: realbigsean Date: Mon, 24 Apr 2023 21:10:52 -0400 Subject: [PATCH] smol bugfix --- beacon_node/network/src/sync/block_lookups/mod.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/beacon_node/network/src/sync/block_lookups/mod.rs b/beacon_node/network/src/sync/block_lookups/mod.rs index e8d6e9cb83..8f7efd0354 100644 --- a/beacon_node/network/src/sync/block_lookups/mod.rs +++ b/beacon_node/network/src/sync/block_lookups/mod.rs @@ -824,7 +824,7 @@ impl BlockLookups { let should_remove_lookup = match result { BlockPartProcessingResult::Ok(status) => match status { - AvailabilityProcessingStatus::Imported(hash) => { + AvailabilityProcessingStatus::Imported(root) => { trace!(self.log, "Single block processing succeeded"; "block" => %root); ShouldRemoveLookup::True } @@ -931,11 +931,11 @@ impl BlockLookups { match &result { BlockPartProcessingResult::Ok(status) => match status { - AvailabilityProcessingStatus::Imported(hash) => { - trace!(self.log, "Parent block processing succeeded"; &parent_lookup) + AvailabilityProcessingStatus::Imported(block_root) => { + trace!(self.log, "Parent block processing succeeded"; &parent_lookup, "block_root" => ?block_root) } AvailabilityProcessingStatus::MissingComponents(_, block_root) => { - trace!(self.log, "Parent missing parts, triggering single block lookup "; &parent_lookup) + trace!(self.log, "Parent missing parts, triggering single block lookup "; &parent_lookup,"block_root" => ?block_root) } }, BlockPartProcessingResult::Err(e) => { @@ -1066,11 +1066,11 @@ impl BlockLookups { debug!(self.log, "Parent chain processed"; "chain_hash" => %chain_hash, "result" => ?result); match result { BatchProcessResult::Success { .. } => { - if let Some((index, (_, _, req))) = self + if let Some((index, (_, _, _))) = self .single_block_lookups .iter() .enumerate() - .find(|(index, (_, _, req))| req.requested_block_root == chain_hash) + .find(|(_, (_, _, req))| req.requested_block_root == chain_hash) { if let Some((block_id, blob_id, block_wrapper)) = self .single_block_lookups @@ -1107,9 +1107,8 @@ impl BlockLookups { imported_blocks: _, penalty, } => { - //TODO(sean) improve peer scoring to block or blob granularity self.failed_chains.insert(chain_hash); - let mut all_peers = request.blob_request_state.used_peers.clone(); + let mut all_peers = request.block_request_state.used_peers.clone(); all_peers.extend(request.blob_request_state.used_peers); for peer_id in all_peers { cx.report_peer(peer_id, penalty, "parent_chain_failure")