Module reward_mt

Module reward_mt 

Source
Expand description

Two-level Merkle tree for reward account balances.

Uses an outer tree (4 bits, 16 partitions) of inner trees (156 bits each) for efficient storage and retrieval across a 160-bit address space.

§Storage Implementations

§Example

let mut tree = RewardMerkleTreeV2::new(REWARD_MERKLE_TREE_V2_HEIGHT);
tree.update(&account, &amount)?;
let result = tree.lookup(&account);

Modules§

storage
Storage abstraction for inner Merkle tree roots.

Structs§

OuterKeccak256Hasher
Keccak256 hasher for outer tree nodes.
StorageBackedRewardMerkleTreeV2
Two-level reward Merkle tree with pluggable storage backend.

Constants§

REWARD_MERKLE_TREE_V2_ARITY
Arity of the Merkle tree (binary tree)
REWARD_MERKLE_TREE_V2_HEIGHT
Total height of the reward Merkle tree (160 bits = Ethereum address space)
REWARD_MERKLE_TREE_V2_INNER_HEIGHT 🔒
Height of each inner tree (156 bits)
REWARD_MERKLE_TREE_V2_OUTER_HEIGHT 🔒
Height of outer tree (4 bits = 16 partitions)

Type Aliases§

ExpectedRewardMerkleTreeV2
Expected type alias for single-level reward Merkle tree.
InMemoryRewardMerkleTreeV2
Two-level reward Merkle tree with in-memory storage (default).
InnerRewardMerkleTreeV2 🔒
Inner tree type: 156-bit universal Merkle tree for account balances.
OuterRewardMerkleProof 🔒
Membership proof for an inner tree root in the outer tree.
OuterRewardMerkleTreeV2 🔒
Outer tree type: 4-bit universal Merkle tree storing inner tree roots.
RewardMerkleCommitmentV2
Merkle tree commitment (root hash).
RewardMerkleNode 🔒
Merkle node containing a reward amount leaf.
RewardMerkleProof
Membership proof for an account’s balance in the tree.
RewardMerkleTreeV2
Canonical reward Merkle tree type (single-level, 160-bit).
RewardNonMembershipProof
Non-membership proof for an account not in the tree.
VerificationResult
Verification result for merkle proofs.