Report sync of block import via blob import (#5836)

* Report sync of block import via blob import
This commit is contained in:
Lion - dapplion
2024-05-24 21:45:04 +02:00
committed by GitHub
parent f1f1250784
commit 7fda18bf49

View File

@@ -753,7 +753,9 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
let blob_slot = verified_blob.slot();
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)) => {
// Note: Reusing block imported metric here
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: