Skip to content

Commit

Permalink
Fetch blobs from EL prior to block verification (#6600)
Browse files Browse the repository at this point in the history
* Fetch blobs from EL prior to block verification

* Run fetch blobs in parallel with block import

* Merge branch 'unstable' into fetch-blobs-earlier

* Merge branch 'unstable' into fetch-blobs-earlier
  • Loading branch information
michaelsproul authored Nov 29, 2024
1 parent fa6c4c0 commit 1c8161f
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions beacon_node/network/src/network_beacon_processor/gossip_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1444,6 +1444,20 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
}
}

// Block is gossip valid. Attempt to fetch blobs from the EL using versioned hashes derived
// from kzg commitments, without having to wait for all blobs to be sent from the peers.
let publish_blobs = true;
let self_clone = self.clone();
let block_clone = block.clone();
self.executor.spawn(
async move {
self_clone
.fetch_engine_blobs_and_publish(block_clone, block_root, publish_blobs)
.await
},
"fetch_blobs_gossip",
);

let result = self
.chain
.process_block_with_early_caching(
Expand Down Expand Up @@ -1494,13 +1508,6 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
"slot" => slot,
"block_root" => %block_root,
);

// Block is valid, we can now attempt fetching blobs from EL using version hashes
// derived from kzg commitments from the block, without having to wait for all blobs
// to be sent from the peers if we already have them.
let publish_blobs = true;
self.fetch_engine_blobs_and_publish(block.clone(), *block_root, publish_blobs)
.await;
}
Err(BlockError::ParentUnknown { .. }) => {
// This should not occur. It should be checked by `should_forward_block`.
Expand Down

0 comments on commit 1c8161f

Please sign in to comment.