From 064bf64dff86b3229316aeed0431c3f4251571a5 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Thu, 3 Aug 2023 09:50:52 -0400 Subject: [PATCH] update unreachables to crits --- beacon_node/network/src/router.rs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/beacon_node/network/src/router.rs b/beacon_node/network/src/router.rs index 927229e7b7..3b7431822e 100644 --- a/beacon_node/network/src/router.rs +++ b/beacon_node/network/src/router.rs @@ -21,7 +21,7 @@ use lighthouse_network::{ MessageId, NetworkGlobals, PeerId, PeerRequestId, PubsubMessage, Request, Response, }; use logging::TimeLatch; -use slog::{debug, o, trace}; +use slog::{crit, debug, o, trace}; use slog::{error, warn}; use std::sync::Arc; use std::time::{Duration, SystemTime, UNIX_EPOCH}; @@ -486,14 +486,16 @@ impl Router { | SyncId::SingleBlob { .. } | SyncId::ParentLookup { .. } | SyncId::ParentLookupBlob { .. } => { - unreachable!("Block lookups do not request BBRange requests") + crit!(self.log, "Block lookups do not request BBRange requests"; "peer_id" => %peer_id); } id @ (SyncId::BackFillBlocks { .. } | SyncId::RangeBlocks { .. } | SyncId::BackFillBlockAndBlobs { .. } | SyncId::RangeBlockAndBlobs { .. }) => id, }, - RequestId::Router => unreachable!("All BBRange requests belong to sync"), + RequestId::Router => { + crit!(self.log, "All BBRange requests belong to sync"; "peer_id" => %peer_id) + } }; trace!( @@ -551,13 +553,15 @@ impl Router { | SyncId::RangeBlocks { .. } | SyncId::RangeBlockAndBlobs { .. } | SyncId::BackFillBlockAndBlobs { .. } => { - unreachable!("Batch syncing do not request BBRoot requests") + crit!(self.log, "Batch syncing do not request BBRoot requests"; "peer_id" => %peer_id) } SyncId::SingleBlob { .. } | SyncId::ParentLookupBlob { .. } => { - unreachable!("Blob response to block by roots request") + crit!(self.log, "Blob response to block by roots request"; "peer_id" => %peer_id) } }, - RequestId::Router => unreachable!("All BBRoot requests belong to sync"), + RequestId::Router => { + crit!(self.log, "All BBRoot requests belong to sync"; "peer_id" => %peer_id) + } }; trace!( @@ -584,16 +588,18 @@ impl Router { RequestId::Sync(sync_id) => match sync_id { id @ (SyncId::SingleBlob { .. } | SyncId::ParentLookupBlob { .. }) => id, SyncId::SingleBlock { .. } | SyncId::ParentLookup { .. } => { - unreachable!("Block response to blobs by roots request") + crit!(self.log, "Block response to blobs by roots request"; "peer_id" => %peer_id) } SyncId::BackFillBlocks { .. } | SyncId::RangeBlocks { .. } | SyncId::RangeBlockAndBlobs { .. } | SyncId::BackFillBlockAndBlobs { .. } => { - unreachable!("Batch syncing does not request BBRoot requests") + crit!(self.log, "Batch syncing does not request BBRoot requests"; "peer_id" => %peer_id) } }, - RequestId::Router => unreachable!("All BlobsByRoot requests belong to sync"), + RequestId::Router => { + crit!(self.log, "All BlobsByRoot requests belong to sync"; "peer_id" => %peer_id) + } }; trace!(