Expand description
This module provides a wrapper around the ConcurrentMerkleTree struct from
the spl_concurrent_merkle_tree crate. It provides a set of functions that
can be called from the Anchor program to interact with the tree.
The functions are used to initialize the tree, set a leaf, fill empty or
append a leaf, and prove a leaf. As the tree is generic over the depth and
buffer size, the functions are implemented using macros that infer the depth
and buffer size from the header information stored on-chain. Usage of the
macros directly is discouraged, as they have huge match statements with
every case taking it’s own stack frame. Instead, use the exported functions
from this module and refenrece or Box the arguments to the functions to
avoid the stack frame explosion.
Re-exports§
pub use crate::error::AccountCompressionError;
Structs§
- Concurrent
Merkle Tree - Exported for Anchor / Solita Conurrent Merkle Tree is a Merkle Tree that allows multiple tree operations targeted for the same tree root to succeed.
- Fill
Empty OrAppend Args - Exported for Anchor / Solita Arguments structure for filling an empty leaf or appending a new leaf to the tree.
- Initialize
With Root Args - Exported for Anchor / Solita Arguments structure for initializing a tree with a root.
- Prove
Leaf Args - Exported for Anchor / Solita Arguments structure for proving a leaf in the tree.
- SetLeaf
Args - Exported for Anchor / Solita Arguments structure for setting a leaf in the tree.
Enums§
- Concurrent
Merkle Tree Error - Exported for Anchor / Solita Concurrent merkle tree operation errors
Constants§
- EMPTY
- Exported for Anchor / Solita An empty node is a 32 byte array of zeroes
Functions§
- merkle_
tree_ append_ leaf - merkle_
tree_ fill_ empty_ or_ append - merkle_
tree_ initialize_ empty - merkle_
tree_ initialize_ with_ root - merkle_
tree_ prove_ leaf - merkle_
tree_ prove_ tree_ is_ empty - merkle_
tree_ set_ leaf
Type Aliases§
- Node
- Exported for Anchor / Solita Abstract type for 32 byte leaf data