chore(engine): track elapsed on fork block added (#10710)

This commit is contained in:
Roman Krasiuk
2024-09-05 17:25:38 +02:00
committed by GitHub
parent ba3fc6a9a9
commit c267c1caf7
4 changed files with 9 additions and 7 deletions

View File

@ -8,14 +8,14 @@ use std::{sync::Arc, time::Duration};
pub enum BeaconConsensusEngineEvent {
/// The fork choice state was updated, and the current fork choice status
ForkchoiceUpdated(ForkchoiceState, ForkchoiceStatus),
/// A block was added to the fork chain.
ForkBlockAdded(Arc<SealedBlock>, Duration),
/// A block was added to the canonical chain, and the elapsed time validating the block
CanonicalBlockAdded(Arc<SealedBlock>, Duration),
/// A canonical chain was committed, and the elapsed time committing the data
CanonicalChainCommitted(Box<SealedHeader>, Duration),
/// The consensus engine is involved in live sync, and has specific progress
LiveSyncProgress(ConsensusEngineLiveSyncProgress),
/// A block was added to the fork chain.
ForkBlockAdded(Arc<SealedBlock>),
}
impl BeaconConsensusEngineEvent {

View File

@ -1244,7 +1244,7 @@ where
let event = if attachment.is_canonical() {
BeaconConsensusEngineEvent::CanonicalBlockAdded(block, elapsed)
} else {
BeaconConsensusEngineEvent::ForkBlockAdded(block)
BeaconConsensusEngineEvent::ForkBlockAdded(block, elapsed)
};
self.event_sender.notify(event);
PayloadStatusEnum::Valid