reth_prune_types/
checkpoint.rs

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