miden-crypto/src/merkle
Qyriad 394b8db006 feat(smt): implement generic prospective insertions
This commit adds a type, MutationSet, which represents a set of changes
to a SparseMerkleTree that haven't happened yet, and can be queried on
to ensure a set of insertions result in the correct tree root before
finalizing and committing the mutation.

This is a direct step towards issue 222, and will directly enable
removing Merkle tree clones in miden-node InnerState::apply_block().

As part of this change, SparseMerkleTree now requires its Key to be Ord
and its Leaf to be Clone (both bounds which were already met by existing
implementations). The Ord bound could instead be changed to Eq + Hash,
if MutationSet were changed to use a HashMap instead of a BTreeMap.

Additionally, as MutationSet is a generic type
which works on any type that implements SparseMerkleTree, but is
intended for public API use, the SparseMerkleTree trait and InnerNode
type have been made public so MutationSet can be used outside of this
crate.
2024-09-05 15:23:30 -06:00
..
mmr fmt 2024-08-21 14:04:23 +01:00
partial_mt Updated Makefile and Readme 2024-08-16 15:07:27 -07:00
smt feat(smt): implement generic prospective insertions 2024-09-05 15:23:30 -06:00
store Updated Makefile and Readme 2024-08-16 15:07:27 -07:00
empty_roots.rs fix: clippy warnings (#280) 2024-02-21 20:55:02 -08:00
error.rs Updated Makefile and Readme 2024-08-16 15:07:27 -07:00
index.rs fix: clippy warnings (#280) 2024-02-21 20:55:02 -08:00
merkle_tree.rs feat: migrate to new Winterfell (#315) 2024-05-12 03:09:27 +08:00
mod.rs feat(smt): implement generic prospective insertions 2024-09-05 15:23:30 -06:00
node.rs feat: RPX (xHash12) hash function implementation 2024-02-14 11:52:40 -08:00
path.rs chore: handle deprecations in winterfell 0.8.3 release 2024-03-17 16:18:23 -04:00