Skip to content

Commit ba706ce

Browse files
authored
Revise logging in BlobsByRoot requests (#8296)
#7756 introduces a logging issue, where the relevant log: https://github.com/sigp/lighthouse/blob/da5b2317205efc72b98cdc922289acefe3f76a13/beacon_node/network/src/network_beacon_processor/rpc_methods.rs#L380-L385 obtains the `block_root` from `slots_by_block_root.keys()`. If the `block_root` is empty (block not found in the data availability checker), then the log will not show any block root: `DEBUG BlobsByRoot outgoing response processed peer_id: 16Uiu2HAmCBxs1ZFfsbAfhSA98rUUL8Q1egLPb6WpGdKZxX6HqQYX, block_root: [], returned: 4` This PR revises to return the `block_root` in the request as a vector of block root Co-Authored-By: Tan Chee Keong <[email protected]>
1 parent da5b231 commit ba706ce

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

beacon_node/network/src/network_beacon_processor/rpc_methods.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use lighthouse_tracing::{
1919
};
2020
use methods::LightClientUpdatesByRangeRequest;
2121
use slot_clock::SlotClock;
22-
use std::collections::{HashMap, hash_map::Entry};
22+
use std::collections::{HashMap, HashSet, hash_map::Entry};
2323
use std::sync::Arc;
2424
use tokio_stream::StreamExt;
2525
use tracing::{Span, debug, error, field, instrument, warn};
@@ -293,6 +293,9 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
293293
inbound_request_id: InboundRequestId,
294294
request: BlobsByRootRequest,
295295
) -> Result<(), (RpcErrorResponse, &'static str)> {
296+
let requested_roots: HashSet<Hash256> =
297+
request.blob_ids.iter().map(|id| id.block_root).collect();
298+
296299
let mut send_blob_count = 0;
297300

298301
let fulu_start_slot = self
@@ -379,7 +382,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
379382

380383
debug!(
381384
%peer_id,
382-
block_root = ?slots_by_block_root.keys(),
385+
?requested_roots,
383386
returned = send_blob_count,
384387
"BlobsByRoot outgoing response processed"
385388
);

0 commit comments

Comments
 (0)