Module changesets

Module changesets 

Source
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 TrieCursorFactory for reading current trie state
  • TrieUpdatesSorted containing 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§

ChangesetResult
Result type for changeset operations.