1use alloy_rpc_types_engine::ForkchoiceState;
2use reth_primitives_traits::SealedHeader;
34/// A type that can track updates related to fork choice updates.
5pub trait CanonChainTracker: Send + Sync {
6/// The header type.
7type Header: Send + Sync;
89/// Notify the tracker about a received fork choice update.
10fn on_forkchoice_update_received(&self, update: &ForkchoiceState);
1112/// Returns the last time a fork choice update was received from the CL
13 /// ([`CanonChainTracker::on_forkchoice_update_received`])
14#[cfg(feature = "std")]
15fn last_received_update_timestamp(&self) -> Option<std::time::Instant>;
1617/// Notify the tracker about a transition configuration exchange.
18fn on_transition_configuration_exchanged(&self);
1920/// Returns the last time a transition configuration was exchanged with the CL
21 /// ([`CanonChainTracker::on_transition_configuration_exchanged`])
22#[cfg(feature = "std")]
23fn last_exchanged_transition_configuration_timestamp(&self) -> Option<std::time::Instant>;
2425/// Sets the canonical head of the chain.
26fn set_canonical_head(&self, header: SealedHeader<Self::Header>);
2728/// Sets the safe block of the chain.
29fn set_safe(&self, header: SealedHeader<Self::Header>);
3031/// Sets the finalized block of the chain.
32fn set_finalized(&self, header: SealedHeader<Self::Header>);
33}