Skip to main content

BlockMerkleNode

Type Alias BlockMerkleNode 

Source
type BlockMerkleNode = MerkleNode<Commitment<Header>, u64, Sha3Node>;

Aliased Type§

enum BlockMerkleNode {
    Empty,
    Branch {
        value: Sha3Node,
        children: Vec<Arc<MerkleNode<Commitment<Header>, u64, Sha3Node>>>,
    },
    Leaf {
        value: Sha3Node,
        pos: u64,
        elem: Commitment<Header>,
    },
    ForgettenSubtree {
        value: Sha3Node,
    },
}

Variants§

§

Empty

An empty subtree with no elements.

§

Branch

An internal branching node with children.

Fields

§value: Sha3Node

Merkle hash value of this subtree

§children: Vec<Arc<MerkleNode<Commitment<Header>, u64, Sha3Node>>>

All its children nodes

§

Leaf

A leaf node containing an element.

Fields

§value: Sha3Node

Merkle hash value of this leaf

§pos: u64

Index of this leaf in the tree

§elem: Commitment<Header>

Associated element stored in this leaf

§

ForgettenSubtree

A subtree that has been forgotten from memory.

This variant retains only the hash value of the subtree, allowing the tree commitment to remain valid while reducing memory usage. Forgotten subtrees can be restored using the remember_internal method if a valid proof is provided.

Fields

§value: Sha3Node

Merkle hash value of this forgotten subtree