Prevent dropping large binary data to logs (#8290)

Testing non finalized checkpoint sync noticed this log that dumps blob data in Debug format to the logs.


  Log only block root and commitment of each blob


Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
This commit is contained in:
Lion - dapplion
2025-10-27 00:47:25 +01:00
committed by GitHub
parent 4b522d760b
commit da5b231720

View File

@@ -8,7 +8,7 @@ use lighthouse_network::{
}, },
}; };
use std::{collections::HashMap, sync::Arc}; use std::{collections::HashMap, sync::Arc};
use tracing::Span; use tracing::{Span, debug};
use types::{ use types::{
BlobSidecar, ChainSpec, ColumnIndex, DataColumnSidecar, DataColumnSidecarList, EthSpec, BlobSidecar, ChainSpec, ColumnIndex, DataColumnSidecar, DataColumnSidecarList, EthSpec,
Hash256, RuntimeVariableList, SignedBeaconBlock, Hash256, RuntimeVariableList, SignedBeaconBlock,
@@ -323,10 +323,10 @@ impl<E: EthSpec> RangeBlockComponentsRequest<E> {
// if accumulated sidecars is not empty, log an error but return the responses // if accumulated sidecars is not empty, log an error but return the responses
// as we can still make progress. // as we can still make progress.
if blob_iter.next().is_some() { if blob_iter.next().is_some() {
tracing::debug!( let remaining_blobs = blob_iter
remaining_blobs=?blob_iter.collect::<Vec<_>>(), .map(|b| (b.index, b.block_root()))
"Received sidecars that don't pair well", .collect::<Vec<_>>();
); debug!(?remaining_blobs, "Received sidecars that don't pair well",);
} }
Ok(responses) Ok(responses)