From ba706ce3bfbae506a90adc897052d70c1f8cdb39 Mon Sep 17 00:00:00 2001 From: chonghe <44791194+chong-he@users.noreply.github.com> Date: Mon, 27 Oct 2025 16:48:10 +0800 Subject: [PATCH] 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 --- .../network/src/network_beacon_processor/rpc_methods.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/beacon_node/network/src/network_beacon_processor/rpc_methods.rs b/beacon_node/network/src/network_beacon_processor/rpc_methods.rs index a81595322b..ac24b648e0 100644 --- a/beacon_node/network/src/network_beacon_processor/rpc_methods.rs +++ b/beacon_node/network/src/network_beacon_processor/rpc_methods.rs @@ -19,7 +19,7 @@ use lighthouse_tracing::{ }; use methods::LightClientUpdatesByRangeRequest; use slot_clock::SlotClock; -use std::collections::{HashMap, hash_map::Entry}; +use std::collections::{HashMap, HashSet, hash_map::Entry}; use std::sync::Arc; use tokio_stream::StreamExt; use tracing::{Span, debug, error, field, instrument, warn}; @@ -293,6 +293,9 @@ impl NetworkBeaconProcessor { inbound_request_id: InboundRequestId, request: BlobsByRootRequest, ) -> Result<(), (RpcErrorResponse, &'static str)> { + let requested_roots: HashSet = + request.blob_ids.iter().map(|id| id.block_root).collect(); + let mut send_blob_count = 0; let fulu_start_slot = self @@ -379,7 +382,7 @@ impl NetworkBeaconProcessor { debug!( %peer_id, - block_root = ?slots_by_block_root.keys(), + ?requested_roots, returned = send_blob_count, "BlobsByRoot outgoing response processed" );