mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-31 05:07:12 +00:00
Add allow reprocess flag
This commit is contained in:
@@ -649,6 +649,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
|||||||
subnet_id: DataColumnSubnetId,
|
subnet_id: DataColumnSubnetId,
|
||||||
column_sidecar: Arc<DataColumnSidecar<T::EthSpec>>,
|
column_sidecar: Arc<DataColumnSidecar<T::EthSpec>>,
|
||||||
seen_duration: Duration,
|
seen_duration: Duration,
|
||||||
|
allow_reprocess: bool,
|
||||||
) {
|
) {
|
||||||
let slot = column_sidecar.slot();
|
let slot = column_sidecar.slot();
|
||||||
let block_root = column_sidecar.block_root();
|
let block_root = column_sidecar.block_root();
|
||||||
@@ -738,10 +739,11 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
|||||||
MessageAcceptance::Ignore,
|
MessageAcceptance::Ignore,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if allow_reprocess {
|
||||||
// Queue the column for reprocessing when the block arrives.
|
// Queue the column for reprocessing when the block arrives.
|
||||||
let processor = self.clone();
|
let processor = self.clone();
|
||||||
let reprocess_msg =
|
let reprocess_msg = ReprocessQueueMessage::UnknownBlockDataColumn(
|
||||||
ReprocessQueueMessage::UnknownBlockDataColumn(QueuedGossipDataColumn {
|
QueuedGossipDataColumn {
|
||||||
beacon_block_root: unknown_block_root,
|
beacon_block_root: unknown_block_root,
|
||||||
process_fn: Box::new(move || {
|
process_fn: Box::new(move || {
|
||||||
let _ = processor.send_gossip_data_column_sidecar(
|
let _ = processor.send_gossip_data_column_sidecar(
|
||||||
@@ -750,9 +752,11 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
|||||||
subnet_id,
|
subnet_id,
|
||||||
column_sidecar,
|
column_sidecar,
|
||||||
seen_duration,
|
seen_duration,
|
||||||
|
false, // Do not reprocess this message again.
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
});
|
},
|
||||||
|
);
|
||||||
if self
|
if self
|
||||||
.beacon_processor_send
|
.beacon_processor_send
|
||||||
.try_send(WorkEvent {
|
.try_send(WorkEvent {
|
||||||
@@ -767,6 +771,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
GossipDataColumnError::InvalidVariant
|
GossipDataColumnError::InvalidVariant
|
||||||
| GossipDataColumnError::PubkeyCacheTimeout
|
| GossipDataColumnError::PubkeyCacheTimeout
|
||||||
| GossipDataColumnError::BeaconChainError(_) => {
|
| GossipDataColumnError::BeaconChainError(_) => {
|
||||||
|
|||||||
@@ -231,6 +231,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
|||||||
subnet_id: DataColumnSubnetId,
|
subnet_id: DataColumnSubnetId,
|
||||||
column_sidecar: Arc<DataColumnSidecar<T::EthSpec>>,
|
column_sidecar: Arc<DataColumnSidecar<T::EthSpec>>,
|
||||||
seen_timestamp: Duration,
|
seen_timestamp: Duration,
|
||||||
|
allow_reprocess: bool,
|
||||||
) -> Result<(), Error<T::EthSpec>> {
|
) -> Result<(), Error<T::EthSpec>> {
|
||||||
let processor = self.clone();
|
let processor = self.clone();
|
||||||
let process_fn = async move {
|
let process_fn = async move {
|
||||||
@@ -241,6 +242,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
|||||||
subnet_id,
|
subnet_id,
|
||||||
column_sidecar,
|
column_sidecar,
|
||||||
seen_timestamp,
|
seen_timestamp,
|
||||||
|
allow_reprocess,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -435,6 +435,7 @@ impl TestRig {
|
|||||||
DataColumnSubnetId::from_column_index(*data_column.index(), &self.chain.spec),
|
DataColumnSubnetId::from_column_index(*data_column.index(), &self.chain.spec),
|
||||||
data_column.clone(),
|
data_column.clone(),
|
||||||
Duration::from_secs(0),
|
Duration::from_secs(0),
|
||||||
|
true,
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -435,6 +435,7 @@ impl<T: BeaconChainTypes> Router<T> {
|
|||||||
subnet_id,
|
subnet_id,
|
||||||
column_sidecar,
|
column_sidecar,
|
||||||
seen_timestamp,
|
seen_timestamp,
|
||||||
|
true,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user