Remove KZG verification on blobs fetched from the EL (#7771)

Continuation of #7713, addresses comment about skipping KZG verification on EL fetched blobs:

https://github.com/sigp/lighthouse/pull/7713#discussion_r2198542501
This commit is contained in:
Jimmy Chen
2025-07-25 16:49:50 +10:00
committed by GitHub
parent 6a52454647
commit 2aae08a8aa
7 changed files with 119 additions and 99 deletions

View File

@@ -1,12 +1,11 @@
use crate::sync::manager::BlockProcessType;
use crate::{service::NetworkMessage, sync::manager::SyncMessage};
use beacon_chain::blob_verification::{GossipBlobError, GossipVerifiedBlob};
use beacon_chain::blob_verification::{observe_gossip_blob, GossipBlobError};
use beacon_chain::block_verification_types::RpcBlock;
use beacon_chain::data_column_verification::{observe_gossip_data_column, GossipDataColumnError};
use beacon_chain::fetch_blobs::{
fetch_and_process_engine_blobs, EngineGetBlobsOutput, FetchEngineBlobError,
};
use beacon_chain::observed_data_sidecars::DoNotObserve;
use beacon_chain::{
AvailabilityProcessingStatus, BeaconChain, BeaconChainTypes, BlockError, NotifyExecutionLayer,
};
@@ -760,7 +759,10 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
if publish_blobs {
match blobs_or_data_column {
EngineGetBlobsOutput::Blobs(blobs) => {
self_cloned.publish_blobs_gradually(blobs, block_root);
self_cloned.publish_blobs_gradually(
blobs.into_iter().map(|b| b.to_blob()).collect(),
block_root,
);
}
EngineGetBlobsOutput::CustodyColumns(columns) => {
self_cloned.publish_data_columns_gradually(
@@ -903,7 +905,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
/// publisher exists for a blob, it will eventually get published here.
fn publish_blobs_gradually(
self: &Arc<Self>,
mut blobs: Vec<GossipVerifiedBlob<T, DoNotObserve>>,
mut blobs: Vec<Arc<BlobSidecar<T::EthSpec>>>,
block_root: Hash256,
) {
let self_clone = self.clone();
@@ -934,8 +936,8 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
while blobs_iter.peek().is_some() {
let batch = blobs_iter.by_ref().take(batch_size);
let publishable = batch
.filter_map(|unobserved| match unobserved.observe(&chain) {
Ok(observed) => Some(observed.clone_blob()),
.filter_map(|blob| match observe_gossip_blob(&blob, &chain) {
Ok(()) => Some(blob),
Err(GossipBlobError::RepeatBlob { .. }) => None,
Err(e) => {
warn!(