Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Apr 16, 2024
1 parent 71cceee commit 5dfbb31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions beacon_node/network/src/sync/block_lookups/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,12 +606,9 @@ impl<T: BeaconChainTypes> BlockLookups<T> {

pub fn peer_disconnected(&mut self, peer_id: &PeerId, cx: &mut SyncNetworkContext<T>) {
/* 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
});
Expand Down Expand Up @@ -695,7 +692,8 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
"error" => ?e,
"block_root" => ?block_root,
);
self.single_block_lookups.remove(&id);
} else {
self.single_block_lookups.insert(id, lookup);
}

metrics::set_gauge(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -221,7 +221,7 @@ impl<L: Lookup, T: BeaconChainTypes> SingleBlockLookup<L, T> {

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;
}
}
Expand Down

0 comments on commit 5dfbb31

Please sign in to comment.