Fix wrong custody column count for lookup blocks (#7281)

Fixes
- https://github.com/sigp/lighthouse/issues/7278


  Don't assume 0 columns for `RpcBlockInner::Block`
This commit is contained in:
Lion - dapplion
2025-04-11 19:00:57 -03:00
committed by GitHub
parent 70f8ab9a6f
commit be68dd24d0
13 changed files with 98 additions and 76 deletions

View File

@@ -6,7 +6,6 @@ use crate::sync::block_lookups::{
};
use crate::sync::manager::BlockProcessType;
use crate::sync::network_context::{LookupRequestResult, SyncNetworkContext};
use beacon_chain::block_verification_types::RpcBlock;
use beacon_chain::BeaconChainTypes;
use lighthouse_network::service::api_types::Id;
use parking_lot::RwLock;
@@ -97,13 +96,8 @@ impl<T: BeaconChainTypes> RequestState<T> for BlockRequestState<T::EthSpec> {
seen_timestamp,
..
} = download_result;
cx.send_block_for_processing(
id,
block_root,
RpcBlock::new_without_blobs(Some(block_root), value),
seen_timestamp,
)
.map_err(LookupRequestError::SendFailedProcessor)
cx.send_block_for_processing(id, block_root, value, seen_timestamp)
.map_err(LookupRequestError::SendFailedProcessor)
}
fn response_type() -> ResponseType {

View File

@@ -266,7 +266,8 @@ impl<E: EthSpec> RangeBlockComponentsRequest<E> {
)
.map_err(|e| format!("{e:?}"))?
} else {
RpcBlock::new_without_blobs(Some(block_root), block)
// Block has no data, expects zero columns
RpcBlock::new_without_blobs(Some(block_root), block, 0)
});
}

View File

@@ -1308,7 +1308,7 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
&self,
id: Id,
block_root: Hash256,
block: RpcBlock<T::EthSpec>,
block: Arc<SignedBeaconBlock<T::EthSpec>>,
seen_timestamp: Duration,
) -> Result<(), SendErrorProcessor> {
let span = span!(
@@ -1322,6 +1322,12 @@ impl<T: BeaconChainTypes> SyncNetworkContext<T> {
.beacon_processor_if_enabled()
.ok_or(SendErrorProcessor::ProcessorNotAvailable)?;
let block = RpcBlock::new_without_blobs(
Some(block_root),
block,
self.network_globals().custody_columns_count() as usize,
);
debug!(block = ?block_root, id, "Sending block for processing");
// Lookup sync event safety: If `beacon_processor.send_rpc_beacon_block` returns Ok() sync
// must receive a single `SyncMessage::BlockComponentProcessed` with this process type

View File

@@ -459,7 +459,8 @@ fn build_rpc_block(
)
.unwrap()
}
None => RpcBlock::new_without_blobs(None, block),
// Block has no data, expects zero columns
None => RpcBlock::new_without_blobs(None, block, 0),
}
}