Improve single block/blob logging (#4579)

* remove closure from `check_availability_mayb_import`

* impove logging, add wrapper struct to requested ids

* improve logging

* only log if we're in deneb. Only delay lookup if we're in deneb

* fix bug in missing components check
This commit is contained in:
realbigsean
2023-08-08 18:45:11 -04:00
committed by GitHub
parent efbf906094
commit 02c7a2eaf5
11 changed files with 240 additions and 86 deletions

View File

@@ -418,11 +418,11 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
};
let request_id = RequestId::Sync(sync_id);
trace!(
debug!(
self.log,
"Sending BlocksByRoot Request";
"method" => "BlocksByRoot",
"count" => request.block_roots().len(),
"block_roots" => ?request.block_roots().to_vec(),
"peer" => %peer_id,
"lookup_type" => ?lookup_type
);
@@ -448,12 +448,18 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
};
let request_id = RequestId::Sync(sync_id);
if !blob_request.blob_ids.is_empty() {
trace!(
if let Some(block_root) = blob_request.blob_ids.first().map(|id| id.block_root) {
let indices = blob_request
.blob_ids
.iter()
.map(|id| id.index)
.collect::<Vec<_>>();
debug!(
self.log,
"Sending BlobsByRoot Request";
"method" => "BlobsByRoot",
"count" => blob_request.blob_ids.len(),
"block_root" => ?block_root,
"blob_indices" => ?indices,
"peer" => %blob_peer_id,
"lookup_type" => ?lookup_type
);