Skip to main content

reth_prune_types/
checkpoint.rs

1use crate::PruneMode;
2#[cfg(any(test, feature = "reth-codec"))]
3use alloy_primitives::bytes;
4use alloy_primitives::{BlockNumber, TxNumber};
5
6/// Saves the pruning progress of a stage.
7#[derive(Debug, PartialEq, Eq, Clone, Copy)]
8#[cfg_attr(any(test, feature = "reth-codec"), derive(reth_codecs::Compact))]
9#[cfg_attr(any(test, feature = "reth-codec"), reth_codecs::add_arbitrary_tests(compact))]
10#[cfg_attr(any(test, feature = "test-utils"), derive(Default, arbitrary::Arbitrary))]
11#[cfg_attr(any(test, feature = "serde"), derive(serde::Serialize, serde::Deserialize))]
12pub struct PruneCheckpoint {
13    /// Highest pruned block number. If it's [None], the pruning for block `0` is not finished yet.
14    pub block_number: Option<BlockNumber>,
15    /// Highest pruned transaction number, if applicable.
16    pub tx_number: Option<TxNumber>,
17    /// Prune mode.
18    pub prune_mode: PruneMode,
19}
20
21#[cfg(any(test, feature = "reth-codec"))]
22reth_codecs::impl_compression_for_compact!(PruneCheckpoint);