Commit graph

675 commits

Author SHA1 Message Date
d524543899 MerklePath: document indexing order of nodes
I've left the iteration order of `MerklePath::inner_nodes()`
unspecified, but other methods of iteration and indexing are now
specified to be in order of deepest to shallowest.
2025-04-04 15:17:21 +02:00
b31a50de2a SimpleSmt: do not assume that Merkle paths Deref to Vec in tests
This is in preparation for the next commit, where we change
`SimpleSmt::open()` to return a `SparseMerklePath`, which cannot
dereference to a Vec.
2025-04-04 15:17:21 +02:00
aa386c67a4 MerkleTree: use new NodeIndex::proof_indices() to resolve TODO 2025-04-04 15:17:21 +02:00
5febc5798f smt: add SparseMerklePath, a compact representation of MerklePath 2025-04-04 15:17:21 +02:00
07bda60233 smt: refactor MerklePath logic
Computation of the correct node indices to get is moved to
`NodeIndex::proof_indices()`, and getting a node's index based on its
parent is generalized into `SparseMerkleTree::get_hash()`.
2025-04-04 15:17:21 +02:00
5eb9a14c40 PartialSmt: fix misleading variable names 2025-04-04 15:17:21 +02:00
a27be8db4f fix clippy lints 2025-04-04 15:17:18 +02:00
4d0b507e77 smt: change SimpleSmt::open() to return a sparse path 2025-04-04 15:17:06 +02:00
980e1615bf SimpleSmt: do not assume that Merkle paths Deref to Vec in tests
This is in preparation for the next commit, where we change
`SimpleSmt::open()` to return a `SparseMerklePath`, which cannot
dereference to a Vec.
2025-04-04 15:17:06 +02:00
9ee094703c smt: add SparseMerklePath, a compact representation of MerklePath 2025-04-04 15:17:06 +02:00
2fc25c028b re-add SimpleSmt::open() commit 2025-04-04 15:16:02 +02:00
1c39f38c9c smt: change SimpleSmt::open() to return a sparse path 2025-04-04 15:14:27 +02:00
c28a9d1c30 SimpleSmt: do not assume that Merkle paths Deref to Vec in tests
This is in preparation for the next commit, where we change
`SimpleSmt::open()` to return a `SparseMerklePath`, which cannot
dereference to a Vec.
2025-04-04 15:12:40 +02:00
f018fcb2aa smt: add SparseMerklePath, a compact representation of MerklePath 2025-04-04 15:12:40 +02:00
a09ce394ae SQUASH ALL THE THINGS 2025-04-04 14:54:34 +02:00
7f2fef41d0 smt: add SparseMerklePath
SparseMerklePath: implement random access


SparseMerklePath: implement iterators


SparseMerklePath: implement Serializable and Deserializable


SparseMerklePath: impl From/Into conversions


SparseMerklePath: add SparseValuePath container


<git index>
2025-04-04 14:54:05 +02:00
0961cfb227 add MerkleTree proof_indices commit 2025-04-04 14:53:15 +02:00
d46aa998be PartialSmt: fix misleading variable names 2025-04-04 14:52:31 +02:00
fb5a865dfc Revert "smt: impl SimpleSmt::get_path() which returns a sparse path"
This reverts commit 3bcd8cfe82e1b09d974c8bd6b0b5b16bd6bcfbfe.
2025-04-04 14:52:31 +02:00
7bc5527d45 MerklePath: add clarity getters for API parity with future SparseMerklePath
This adds `MerklePath::at_depth()` and `MerklePath::at_idx()`, both for
clarity and for API parity with `SparseMerklePath` in the next commit.
2025-04-04 14:52:31 +02:00
7f4b2b326c smt: impl SimpleSmt::get_path() which returns a sparse path 2025-04-04 14:52:31 +02:00
52a653f492 MerklePath: document indexing order of nodes
I've left the iteration order of `MerklePath::inner_nodes()`
unspecified, but other methods of iteration and indexing are now
specified to be in order of deepest to shallowest.
2025-04-04 14:52:31 +02:00
cc6981de7f SparseMerklePath: add SparseValuePath container 2025-04-04 14:52:31 +02:00
055c95f32a MerkleTree: use new NodeIndex::proof_indices() to resolve TODO 2025-04-04 14:52:31 +02:00
c45d9682eb SparseMerklePath: impl From/Into conversions 2025-04-04 14:52:31 +02:00
067f5d1062 SparseMerklePath: implement Serializable and Deserializable 2025-04-04 14:52:31 +02:00
9122935685 SparseMerklePath: implement iterators 2025-04-04 14:52:31 +02:00
f8771549ea SparseMerklePath: implement random access 2025-04-04 14:52:31 +02:00
129f81eb4b smt: add SparseMerklePath 2025-04-04 14:52:31 +02:00
91aac69b8e smt: refactor MerklePath logic
Computation of the correct node indices to get is moved to
`NodeIndex::proof_indices()`, and getting a node's index based on its
parent is generalized into `SparseMerkleTree::get_hash()`.
2025-04-04 14:49:01 +02:00
3e4724d684 remove sparse_path changes from SimpleSmt commit 2025-04-04 14:43:48 +02:00
81ce40ce49 smt: impl SimpleSmt::get_path() which returns a sparse path 2025-04-04 14:43:34 +02:00
22b33ed8b6 SparseMerklePath: add SparseValuePath container 2025-04-04 14:38:54 +02:00
91983f7ced reorder commits 2025-04-04 14:36:01 +02:00
f1eb9a8f04 SparseMerklePath: impl From/Into conversions 2025-04-04 14:35:45 +02:00
5d6ef3eccf smt: impl SimpleSmt::get_path() which returns a sparse path 2025-04-04 14:35:45 +02:00
743c65979a SparseMerklePath: implement Serializable and Deserializable 2025-04-04 14:35:45 +02:00
87acaa5aad SparseMerklePath: implement iterators 2025-04-04 14:35:45 +02:00
6fe0ab3184 SparseMerklePath: implement random access 2025-04-04 14:35:45 +02:00
15a8d9cbd8 smt: add SparseMerklePath 2025-04-04 14:35:45 +02:00
002afad1d7 PartialSmt: fix misleading variable names 2025-04-04 14:35:45 +02:00
9ef9fad9a7 MerklePath: add clarity getters for API parity with future SparseMerklePath
This adds `MerklePath::at_depth()` and `MerklePath::at_idx()`, both for
clarity and for API parity with `SparseMerklePath` in the next commit.
2025-04-04 14:35:11 +02:00
c92882832c add at_idx and at_depth for MerklePath 2025-04-04 14:17:11 +02:00
bf5b0e3255 MerklePath: document indexing order of nodes
I've left the iteration order of `MerklePath::inner_nodes()`
unspecified, but other methods of iteration and indexing are now
specified to be in order of deepest to shallowest.
2025-04-04 14:16:04 +02:00
09f78036a4 MerklePath: add clarity getters for API parity with future SparseMerklePath
This adds `MerklePath::at_depth()` and `MerklePath::at_idx()`, both for
clarity and for API parity with `SparseMerklePath` in the next commit.
2025-04-04 14:16:04 +02:00
99a7988e9e PartialSmt: fix misleading variable names 2025-04-04 14:16:04 +02:00
41f72ecf2f smt: impl SimpleSmt::get_path() which returns a sparse path 2025-04-04 14:16:04 +02:00
38d2ca3505 SparseMerklePath: impl From/Into conversions 2025-04-04 14:16:04 +02:00
441e29378e SparseMerklePath: implement Serializable and Deserializable 2025-04-04 14:16:04 +02:00
8f833c77e6 SparseMerklePath: implement iterators 2025-04-04 14:16:04 +02:00