reth_trie/
progress.rs
1use crate::{hash_builder::HashBuilder, trie_cursor::CursorSubNode, updates::TrieUpdates};
2use alloy_primitives::B256;
3use reth_stages_types::MerkleCheckpoint;
4
5#[derive(Debug)]
7pub enum StateRootProgress {
8 Complete(B256, usize, TrieUpdates),
10 Progress(Box<IntermediateStateRootState>, usize, TrieUpdates),
13}
14
15#[derive(Debug)]
17pub struct IntermediateStateRootState {
18 pub hash_builder: HashBuilder,
20 pub walker_stack: Vec<CursorSubNode>,
22 pub last_account_key: B256,
24}
25
26impl From<MerkleCheckpoint> for IntermediateStateRootState {
27 fn from(value: MerkleCheckpoint) -> Self {
28 Self {
29 hash_builder: HashBuilder::from(value.state),
30 walker_stack: value.walker_stack.into_iter().map(CursorSubNode::from).collect(),
31 last_account_key: value.last_account_key,
32 }
33 }
34}