Skip to main content

compute_range_trie_changesets_with_suffix

Function compute_range_trie_changesets_with_suffix 

Source
pub fn compute_range_trie_changesets_with_suffix<Provider, StateTrieProvider>(
    provider: &Provider,
    state_trie_provider: &StateTrieProvider,
    forward_updates: &[(u64, Arc<TrieUpdatesSorted>)],
    range: RangeInclusive<u64>,
    db_tip_block: u64,
    suffix_reverts: Option<&TrieUpdatesSorted>,
) -> Result<TrieUpdatesSorted, ProviderError>
Available on crate features trie-db and trie only.
Expand description

Computes aggregate trie changesets for an inclusive block range, like compute_range_trie_changesets, reusing known reverts for the blocks above it.

suffix_reverts, when given, must be the aggregate trie changesets of range.end() + 1..=db_tip_block, as compute_range_trie_changesets returns them. They restore the trie to its state at the end of range, so the blocks above range are not rewound again. It is ignored when range ends at db_tip_block.

ยงErrors

Returns an error if the range exceeds db_tip_block, database access fails, or state root computation fails.