Skip to main content

state_root

Function state_root 

Source
pub fn state_root(state: &State) -> CapHash
Expand description

State-root: SSZ hash_tree_root of the cache’s blobs.

Each leaf is a StateLeaf { blob_hash, cap_hash } container. The full state root is hash_tree_root of the Vec<StateLeaf>, which merkleizes the per-leaf roots, pads to the next power of two, and mixes in the length per SSZ List semantics.

Leaves are sorted by blob_hash explicitly so the result is independent of insertion order (the cap store is a HashMap, whose iteration order is unspecified). Empty caches reduce to the SSZ canonical empty-list root.