Lookup log improvements (#5491)

* log improvements
This commit is contained in:
realbigsean 2024-03-27 09:24:04 -04:00 committed by GitHub
parent 334aa2eabd
commit 9d24844f50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 38 additions and 49 deletions

View File

@ -152,7 +152,6 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
if let Some(components) = child_components { if let Some(components) = child_components {
lookup.add_child_components(components); lookup.add_child_components(components);
} }
debug!(self.log, "Already searching for block"; "block_root" => ?block_root);
return; return;
} }
@ -163,7 +162,7 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
// If the block was already downloaded, or is being downloaded in this moment, do not // If the block was already downloaded, or is being downloaded in this moment, do not
// request it. // request it.
debug!(self.log, "Already searching for block in a parent lookup request"; "block_root" => ?block_root); trace!(self.log, "Already searching for block in a parent lookup request"; "block_root" => ?block_root);
return; return;
} }
@ -173,7 +172,7 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
.any(|(hashes, _last_parent_request)| hashes.contains(&block_root)) .any(|(hashes, _last_parent_request)| hashes.contains(&block_root))
{ {
// we are already processing this block, ignore it. // we are already processing this block, ignore it.
debug!(self.log, "Already processing block in a parent request"; "block_root" => ?block_root); trace!(self.log, "Already processing block in a parent request"; "block_root" => ?block_root);
return; return;
} }
@ -309,12 +308,15 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
}; };
let expected_block_root = lookup.block_root(); let expected_block_root = lookup.block_root();
debug!(self.log, if response.is_some() {
"Peer returned block for single lookup"; debug!(self.log,
"peer_id" => %peer_id , "Peer returned response for single lookup";
"id" => ?id, "peer_id" => %peer_id ,
"block_root" => ?expected_block_root, "id" => ?id,
); "block_root" => ?expected_block_root,
"response_type" => ?response_type,
);
}
match self.single_lookup_response_inner::<R>(peer_id, response, seen_timestamp, cx, lookup) match self.single_lookup_response_inner::<R>(peer_id, response, seen_timestamp, cx, lookup)
{ {
@ -495,12 +497,15 @@ impl<T: BeaconChainTypes> BlockLookups<T> {
return; return;
}; };
debug!(self.log, if response.is_some() {
"Peer returned block for parent lookup"; debug!(self.log,
"peer_id" => %peer_id , "Peer returned response for parent lookup";
"id" => ?id, "peer_id" => %peer_id ,
"block_root" => ?parent_lookup.current_parent_request.block_request_state.requested_block_root, "id" => ?id,
); "block_root" => ?parent_lookup.current_parent_request.block_request_state.requested_block_root,
"response_type" => ?R::response_type(),
);
}
match self.parent_lookup_response_inner::<R>( match self.parent_lookup_response_inner::<R>(
peer_id, peer_id,

View File

@ -915,44 +915,28 @@ impl<T: BeaconChainTypes> SyncManager<T> {
RequestId::SingleBlock { .. } => { RequestId::SingleBlock { .. } => {
crit!(self.log, "Single blob received during block request"; "peer_id" => %peer_id ); crit!(self.log, "Single blob received during block request"; "peer_id" => %peer_id );
} }
RequestId::SingleBlob { id } => { RequestId::SingleBlob { id } => self
if let Some(blob) = blob.as_ref() { .block_lookups
debug!(self.log, .single_lookup_response::<BlobRequestState<Current, T::EthSpec>>(
"Peer returned blob for single lookup"; id,
"peer_id" => %peer_id , peer_id,
"blob_id" =>?blob.id() blob,
); seen_timestamp,
} &self.network,
self.block_lookups ),
.single_lookup_response::<BlobRequestState<Current, T::EthSpec>>(
id,
peer_id,
blob,
seen_timestamp,
&self.network,
)
}
RequestId::ParentLookup { id: _ } => { RequestId::ParentLookup { id: _ } => {
crit!(self.log, "Single blob received during parent block request"; "peer_id" => %peer_id ); crit!(self.log, "Single blob received during parent block request"; "peer_id" => %peer_id );
} }
RequestId::ParentLookupBlob { id } => { RequestId::ParentLookupBlob { id } => self
if let Some(blob) = blob.as_ref() { .block_lookups
debug!(self.log, .parent_lookup_response::<BlobRequestState<Parent, T::EthSpec>>(
"Peer returned blob for parent lookup"; id,
"peer_id" => %peer_id , peer_id,
"blob_id" =>?blob.id() blob,
); seen_timestamp,
} &self.network,
self.block_lookups ),
.parent_lookup_response::<BlobRequestState<Parent, T::EthSpec>>(
id,
peer_id,
blob,
seen_timestamp,
&self.network,
)
}
RequestId::BackFillBlocks { id: _ } => { RequestId::BackFillBlocks { id: _ } => {
crit!(self.log, "Blob received during backfill block request"; "peer_id" => %peer_id ); crit!(self.log, "Blob received during backfill block request"; "peer_id" => %peer_id );
} }