mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 09:16:00 +00:00
Report sync of block import via blob import (#5836)
* Report sync of block import via blob import
This commit is contained in:
@@ -753,7 +753,9 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
|||||||
let blob_slot = verified_blob.slot();
|
let blob_slot = verified_blob.slot();
|
||||||
let blob_index = verified_blob.id().index;
|
let blob_index = verified_blob.id().index;
|
||||||
|
|
||||||
match self.chain.process_gossip_blob(verified_blob).await {
|
let result = self.chain.process_gossip_blob(verified_blob).await;
|
||||||
|
|
||||||
|
match &result {
|
||||||
Ok(AvailabilityProcessingStatus::Imported(block_root)) => {
|
Ok(AvailabilityProcessingStatus::Imported(block_root)) => {
|
||||||
// Note: Reusing block imported metric here
|
// Note: Reusing block imported metric here
|
||||||
metrics::inc_counter(&metrics::BEACON_PROCESSOR_GOSSIP_BLOCK_IMPORTED_TOTAL);
|
metrics::inc_counter(&metrics::BEACON_PROCESSOR_GOSSIP_BLOCK_IMPORTED_TOTAL);
|
||||||
@@ -802,6 +804,16 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If a block is in the da_checker, sync maybe awaiting for an event when block is finally
|
||||||
|
// imported. A block can become imported both after processing a block or blob. If a
|
||||||
|
// importing a block results in `Imported`, notify. Do not notify of blob errors.
|
||||||
|
if matches!(result, Ok(AvailabilityProcessingStatus::Imported(_))) {
|
||||||
|
self.send_sync_message(SyncMessage::GossipBlockProcessResult {
|
||||||
|
block_root,
|
||||||
|
imported: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Process the beacon block received from the gossip network and:
|
/// Process the beacon block received from the gossip network and:
|
||||||
|
|||||||
Reference in New Issue
Block a user