Skip to content

Commit 22449a7

Browse files
committed
improve Rpc response logging
1 parent 3fefda6 commit 22449a7

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

beacon_node/lighthouse_network/src/rpc/handler.rs

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -577,28 +577,15 @@ where
577577
self.inbound_substreams_delay.remove(delay_key);
578578
}
579579

580-
// BlocksByRange is the one that typically consumes the most time.
581-
// Its useful to log when the request was completed.
582-
if matches!(info.protocol, Protocol::BlocksByRange) {
583-
debug!(
584-
peer_id = %self.peer_id,
585-
connection_id = %self.connection_id,
586-
duration = Instant::now()
587-
.duration_since(info.request_start_time)
588-
.as_secs(),
589-
"BlocksByRange Response sent"
590-
);
591-
}
592-
if matches!(info.protocol, Protocol::BlobsByRange) {
593-
debug!(
594-
peer_id = %self.peer_id,
595-
connection_id = %self.connection_id,
596-
duration = Instant::now()
597-
.duration_since(info.request_start_time)
598-
.as_secs(),
599-
"BlobsByRange Response sent"
600-
);
601-
}
580+
debug!(
581+
peer_id = %self.peer_id,
582+
connection_id = %self.connection_id,
583+
duration = Instant::now()
584+
.duration_since(info.request_start_time)
585+
.as_secs(),
586+
response = %info.protocol,
587+
"Response sent"
588+
);
602589

603590
// There is nothing more to process on this substream as it has
604591
// been closed. Move on to the next one.

beacon_node/lighthouse_network/src/rpc/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ impl<Id: ReqId, E: EthSpec> RPC<Id, E> {
251251
}
252252
}
253253

254+
debug!(%peer_id, ?request_id, %response, "Dispatching response to connection handler");
254255
self.events.push(ToSwarm::NotifyHandler {
255256
peer_id,
256257
handler: NotifyHandler::One(request_id.connection_id),

0 commit comments

Comments
 (0)