Skip to content

Commit 4c26ba3

Browse files
committed
refactor(network): enhance block response logging in NetworkActor
Updated logging in the NetworkActor to differentiate between block response types. The logging now includes the count of blocks received when the response is of the Blocks variant, and provides a distinct log message for other response types.
1 parent adca36c commit 4c26ba3

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

app/src/actors_v2/network/network_actor.rs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -964,12 +964,23 @@ impl NetworkActor {
964964
request_id,
965965
response,
966966
} => {
967-
tracing::info!(
968-
peer_id = %peer_id,
969-
request_id = ?request_id,
970-
response = ?response,
971-
"Received block response from peer"
972-
);
967+
match &response {
968+
BlockResponse::Blocks(blocks_response) => {
969+
tracing::info!(
970+
peer_id = %peer_id,
971+
request_id = ?request_id,
972+
block_count = blocks_response.blocks.len(),
973+
"Received block response from peer with blocks"
974+
);
975+
}
976+
_ => {
977+
tracing::info!(
978+
peer_id = %peer_id,
979+
request_id = ?request_id,
980+
"Received block response from peer (not Blocks variant)"
981+
);
982+
}
983+
}
973984

974985
self.metrics.record_message_received(0); // Size would be calculated
975986

0 commit comments

Comments
 (0)