Skip to main content

Module recent_roots

Module recent_roots 

Source
Expand description

Delta encoding for fixed-size Ethereum consensus root buffers.

Ethereum consensus stores historical roots (such as block roots and state roots) in fixed-capacity circular buffers. Advancing the chain overwrites the oldest entries once the buffer wraps.

Rather than diffing the entire buffer, this module records only the sequence of newly written roots between two slots. Applying the delta replays those writes into another buffer using the same circular indexing logic.

This representation is independent of the buffer capacity and works with any fixed-size root ring.

Functionsยง

apply_roots
Applies a root delta to a circular root buffer.
diff_roots
Computes the sequence of newly written roots between two slots.