Breakup RPCBlock into LookupBlock & RangeSyncBlock (#8860)

Co-Authored-By: Mark Mackey <mark@sigmaprime.io>
This commit is contained in:
ethDreamer
2026-03-13 14:22:29 -05:00
committed by GitHub
parent 02137492f3
commit 6ca610d918
25 changed files with 505 additions and 669 deletions

View File

@@ -2,7 +2,7 @@ use crate::metrics;
use std::future::Future;
use beacon_chain::blob_verification::{GossipBlobError, GossipVerifiedBlob};
use beacon_chain::block_verification_types::{AsBlock, RpcBlock};
use beacon_chain::block_verification_types::{AsBlock, LookupBlock};
use beacon_chain::data_column_verification::GossipVerifiedDataColumn;
use beacon_chain::validator_monitor::{get_block_delay_ms, timestamp_now};
use beacon_chain::{
@@ -311,19 +311,11 @@ pub async fn publish_block<T: BeaconChainTypes, B: IntoGossipVerifiedBlock<T>>(
slot = %block.slot(),
"Block previously seen"
);
let Ok(rpc_block) = RpcBlock::new(
block.clone(),
None,
&chain.data_availability_checker,
chain.spec.clone(),
) else {
return Err(warp_utils::reject::custom_bad_request(
"Unable to construct rpc block".to_string(),
));
};
// try to reprocess as a lookup (single) block and let sync take care of missing components
let lookup_block = LookupBlock::new(block.clone());
let import_result = Box::pin(chain.process_block(
block_root,
rpc_block,
lookup_block,
NotifyExecutionLayer::Yes,
BlockImportSource::HttpApi,
publish_fn,