Skip to main content

Module cnode

Module cnode 

Source
Expand description

CNodeCap — CNode cap.

Slot table is a SparseList of MissingOr entries: a sparse materialized-on-demand map from SlotIdx to CapHashOrRef. The merkle tree shape is fixed at depth 16 (= ceil_log2(MAX_CNODE_SLOTS)) regardless of size_log; size_log is runtime metadata used for bounds-checking slot indices.

Empty slots contribute zero_hash at the depth-16 leaf level; a Missing(h) placeholder substitutes losslessly for the materialized contents whose hash_tree_root equals h. This is the load-bearing property for sparse cnode loading from cold storage.

size_log is permitted in 0..=16 (the spec’s hard ceiling).

Structs§

CNodeCap
CNodeSlotEntry
One populated slot — retained as a serialisation helper for callers that need a flat (slot, target) pair (e.g., CacheDirectory::publish_cnode).

Constants§

MAX_CNODE_SLOTS
Maximum cnode capacity (2^16 slots). The SSZ merkle tree depth is fixed at 16 regardless of an individual cnode’s declared size_log.