reth_exex_types/finished_height.rs
1use alloy_primitives::BlockNumber;
2
3/// The finished height of all `ExEx`'s.
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub enum FinishedExExHeight {
6 /// No `ExEx`'s are installed, so there is no finished height.
7 NoExExs,
8 /// Not all `ExExs` have emitted a `FinishedHeight` event yet.
9 NotReady,
10 /// The finished height of all `ExEx`'s.
11 ///
12 /// This is the lowest common denominator between all `ExEx`'s.
13 ///
14 /// This block is used to (amongst other things) determine what blocks are safe to prune.
15 ///
16 /// The number is inclusive, i.e. all blocks `<= finished_height` are safe to prune.
17 Height(BlockNumber),
18}
19
20impl FinishedExExHeight {
21 /// Returns `true` if not all `ExExs` have emitted a `FinishedHeight` event yet.
22 pub const fn is_not_ready(&self) -> bool {
23 matches!(self, Self::NotReady)
24 }
25}