Expand description
Trie changeset computation. Trie changeset computation.
This module provides functionality to compute trie changesets from trie updates. Changesets represent the old values of trie nodes before a block was applied, enabling reorgs by reverting blocks to their previous state.
§Overview
When a block is executed, the trie is updated with new node values. To support chain reorganizations, we need to preserve the old values that existed before the block was applied. These old values are called “changesets”.
§Usage
The primary function is compute_trie_changesets, which takes:
- A
TrieCursorFactoryfor reading current trie state TrieUpdatesSortedcontaining the new node values
And returns TrieUpdatesSorted containing the old node values.
Functions§
- compute_
trie_ changesets - Computes trie changesets by looking up current node values from the trie.
- storage_
trie_ wiped_ changeset_ iter - Returns an iterator which produces the changeset values for an account whose storage was wiped during a block.
Type Aliases§
- Changeset
Result - Result type for changeset operations.