mirror of
https://github.com/sigp/lighthouse.git
synced 2026-06-15 17:58:23 +00:00
Gloas data column reprocess queue (#9339)
When debugging ePBS with columns, we noticed that columns arriving before their block dont pass gossip verification checks and are dropped. This PR ensures that columns arriving before the block are sent to the reprocess queue. Once their block arrives, they are reprocessed. This isn't an issue pre-gloas because we don't make block root checks for fulu data columns. This allows us to gossip verify the column and send it to the DA cache before the block arrives. I think we also need to handle this edge case for partial data columns. Theres an existing TODO for that already. Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
This commit is contained in:
@@ -61,8 +61,8 @@ use beacon_processor::work_reprocessing_queue::QueuedColumnReconstruction;
|
||||
use beacon_processor::{
|
||||
DuplicateCache, GossipAggregatePackage, GossipAttestationBatch,
|
||||
work_reprocessing_queue::{
|
||||
QueuedAggregate, QueuedGossipBlock, QueuedGossipEnvelope, QueuedLightClientUpdate,
|
||||
QueuedUnaggregate, ReprocessQueueMessage,
|
||||
QueuedAggregate, QueuedGossipBlock, QueuedGossipDataColumn, QueuedGossipEnvelope,
|
||||
QueuedLightClientUpdate, QueuedUnaggregate, ReprocessQueueMessage,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -657,6 +657,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
subnet_id: DataColumnSubnetId,
|
||||
column_sidecar: Arc<DataColumnSidecar<T::EthSpec>>,
|
||||
seen_duration: Duration,
|
||||
allow_reprocess: bool,
|
||||
) {
|
||||
let slot = column_sidecar.slot();
|
||||
let block_root = column_sidecar.block_root();
|
||||
@@ -738,19 +739,48 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
..
|
||||
} => {
|
||||
debug!(
|
||||
action = "ignoring",
|
||||
action = "queuing for reprocessing",
|
||||
%unknown_block_root,
|
||||
"Unknown block root for column"
|
||||
);
|
||||
// TODO(gloas): wire this into proper lookup sync. Sending
|
||||
// `UnknownBlockHashFromAttestation` here is a Fulu-shaped fallback that
|
||||
// mixes column processing with the attestation lookup path and is not
|
||||
// the right primitive for Gloas column lookups.
|
||||
self.propagate_validation_result(
|
||||
message_id,
|
||||
message_id.clone(),
|
||||
peer_id,
|
||||
MessageAcceptance::Ignore,
|
||||
);
|
||||
|
||||
if allow_reprocess {
|
||||
// Queue the column for reprocessing when the block arrives.
|
||||
let processor = self.clone();
|
||||
let reprocess_msg = ReprocessQueueMessage::UnknownBlockDataColumn(
|
||||
QueuedGossipDataColumn {
|
||||
beacon_block_root: unknown_block_root,
|
||||
process_fn: Box::new(move || {
|
||||
let _ = processor.send_gossip_data_column_sidecar(
|
||||
message_id,
|
||||
peer_id,
|
||||
subnet_id,
|
||||
column_sidecar,
|
||||
seen_duration,
|
||||
false, // Do not reprocess this message again.
|
||||
);
|
||||
}),
|
||||
},
|
||||
);
|
||||
if self
|
||||
.beacon_processor_send
|
||||
.try_send(WorkEvent {
|
||||
drop_during_sync: false,
|
||||
work: Work::Reprocess(reprocess_msg),
|
||||
})
|
||||
.is_err()
|
||||
{
|
||||
debug!(
|
||||
%unknown_block_root,
|
||||
"Failed to queue data column for reprocessing"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
GossipDataColumnError::InvalidVariant
|
||||
| GossipDataColumnError::PubkeyCacheTimeout
|
||||
|
||||
@@ -201,6 +201,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
subnet_id: DataColumnSubnetId,
|
||||
column_sidecar: Arc<DataColumnSidecar<T::EthSpec>>,
|
||||
seen_timestamp: Duration,
|
||||
allow_reprocess: bool,
|
||||
) -> Result<(), Error<T::EthSpec>> {
|
||||
let processor = self.clone();
|
||||
let process_fn = async move {
|
||||
@@ -211,6 +212,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
||||
subnet_id,
|
||||
column_sidecar,
|
||||
seen_timestamp,
|
||||
allow_reprocess,
|
||||
)
|
||||
.await
|
||||
};
|
||||
|
||||
@@ -412,6 +412,7 @@ impl TestRig {
|
||||
DataColumnSubnetId::from_column_index(*data_column.index(), &self.chain.spec),
|
||||
data_column.clone(),
|
||||
Duration::from_secs(0),
|
||||
true,
|
||||
)
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
@@ -422,6 +422,7 @@ impl<T: BeaconChainTypes> Router<T> {
|
||||
subnet_id,
|
||||
column_sidecar,
|
||||
seen_timestamp,
|
||||
true,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user