mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Notify lookup sync of gossip processing results (#5722)
* Notify lookup sync of gossip processing results * Add tests * Add GossipBlockProcessResult event * Re-add dropped comments * Update beacon_node/network/src/network_beacon_processor/sync_methods.rs * update test_lookup_disconnection_peer_left
This commit is contained in:
@@ -144,6 +144,9 @@ pub enum SyncMessage<E: EthSpec> {
|
||||
process_type: BlockProcessType,
|
||||
result: BlockProcessingResult<E>,
|
||||
},
|
||||
|
||||
/// A block from gossip has completed processing,
|
||||
GossipBlockProcessResult { block_root: Hash256, imported: bool },
|
||||
}
|
||||
|
||||
/// The type of processing specified for a received block.
|
||||
@@ -153,14 +156,6 @@ pub enum BlockProcessType {
|
||||
SingleBlob { id: Id },
|
||||
}
|
||||
|
||||
impl BlockProcessType {
|
||||
pub fn id(&self) -> Id {
|
||||
match self {
|
||||
BlockProcessType::SingleBlock { id } | BlockProcessType::SingleBlob { id } => *id,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum BlockProcessingResult<E: EthSpec> {
|
||||
Ok(AvailabilityProcessingStatus),
|
||||
@@ -637,6 +632,14 @@ impl<T: BeaconChainTypes> SyncManager<T> {
|
||||
} => self
|
||||
.block_lookups
|
||||
.on_processing_result(process_type, result, &mut self.network),
|
||||
SyncMessage::GossipBlockProcessResult {
|
||||
block_root,
|
||||
imported,
|
||||
} => self.block_lookups.on_external_processing_result(
|
||||
block_root,
|
||||
imported,
|
||||
&mut self.network,
|
||||
),
|
||||
SyncMessage::BatchProcessed { sync_type, result } => match sync_type {
|
||||
ChainSegmentProcessId::RangeBatchId(chain_id, epoch) => {
|
||||
self.range_sync.handle_block_process_result(
|
||||
|
||||
Reference in New Issue
Block a user