From 5dfbb3125dbea6fbd8911934a6fe6f71f0fcb4aa Mon Sep 17 00:00:00 2001 From: dapplion <35266934+dapplion@users.noreply.github.com> Date: Tue, 16 Apr 2024 14:23:57 +0900 Subject: [PATCH] Fix tests --- beacon_node/network/src/sync/block_lookups/mod.rs | 8 +++----- .../network/src/sync/block_lookups/single_block_lookup.rs | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/beacon_node/network/src/sync/block_lookups/mod.rs b/beacon_node/network/src/sync/block_lookups/mod.rs index 703c2af5d6d..86109a38ac2 100644 --- a/beacon_node/network/src/sync/block_lookups/mod.rs +++ b/beacon_node/network/src/sync/block_lookups/mod.rs @@ -606,12 +606,9 @@ impl BlockLookups { pub fn peer_disconnected(&mut self, peer_id: &PeerId, cx: &mut SyncNetworkContext) { /* Check disconnection for single lookups */ - self.single_block_lookups.retain(|id, req| { + self.single_block_lookups.retain(|_, req| { let should_drop_lookup = req.should_drop_lookup_on_disconnected_peer(peer_id, cx, &self.log); - if should_drop_lookup { - debug!(self.log, "Dropping lookup after peer disconnected"; "id" => id, "block_root" => %req.block_root()); - } !should_drop_lookup }); @@ -695,7 +692,8 @@ impl BlockLookups { "error" => ?e, "block_root" => ?block_root, ); - self.single_block_lookups.remove(&id); + } else { + self.single_block_lookups.insert(id, lookup); } metrics::set_gauge( diff --git a/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs b/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs index 5b1edd71a29..5bb663967d7 100644 --- a/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs +++ b/beacon_node/network/src/sync/block_lookups/single_block_lookup.rs @@ -11,7 +11,7 @@ use beacon_chain::BeaconChainTypes; use itertools::Itertools; use lighthouse_network::PeerAction; use rand::seq::IteratorRandom; -use slog::{trace, Logger}; +use slog::{debug, Logger}; use std::collections::HashSet; use std::fmt::Debug; use std::marker::PhantomData; @@ -221,7 +221,7 @@ impl SingleBlockLookup { if block_peer_disconnected || blob_peer_disconnected { if let Err(e) = self.request_block_and_blobs(cx) { - trace!(log, "Single lookup failed on peer disconnection"; "block_root" => ?block_root, "error" => ?e); + debug!(log, "Single lookup failed on peer disconnection"; "block_root" => ?block_root, "error" => ?e); return true; } }