Compare commits

...

246 commits

Author SHA1 Message Date
0052fd9eea make at_depth_nonempty private 2025-04-24 14:26:54 +02:00
bbf70c90ed smt: change SimpleSmt::open() to return a sparse path 2025-04-24 14:26:37 +02:00
d4f9756e75 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-24 14:26:37 +02:00
1aba63de4b smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 14:26:37 +02:00
d30c95124c change itertools version to not specify a patch version 2025-04-24 13:45:44 +02:00
6ea938af9e smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:44:26 +02:00
5253655e11 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-24 13:44:26 +02:00
ec1ff20d5f smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:44:26 +02:00
a28e6d142c do the rest of renaming get_hash -> get_node_hash 2025-04-24 13:37:40 +02:00
efb231f666 smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:37:28 +02:00
a192014c25 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-24 13:37:28 +02:00
9be73fad85 smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:37:28 +02:00
79576d09c8 squash 'use Cow instead of the additional IntoIter struct' into 'add SparseMerklePath' 2025-04-24 13:34:02 +02:00
d637f68c50 smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:33:36 +02:00
d5f74b721c 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-24 13:33:36 +02:00
57939e19bc smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:33:36 +02:00
7dde96a437 squash 'loop over depth in tests' into 'add SparseMerklePath' 2025-04-24 13:32:57 +02:00
Grzegorz Świrski
0fb731753e use Cow instead of the additional IntoIter struct 2025-04-24 13:32:35 +02:00
10bc59c138 smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:32:35 +02:00
8755e3123f 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-24 13:32:35 +02:00
0327b04a02 smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:32:35 +02:00
121aeb3101 squash 'clarify sparse_nodes_mask documentation' into 'add SparseMerklePath' 2025-04-24 13:32:10 +02:00
Grzegorz Świrski
c1939cd562 use Cow instead of the additional IntoIter struct 2025-04-24 13:31:45 +02:00
Grzegorz Świrski
c68afb9e9b loop over depths in tests 2025-04-24 13:31:45 +02:00
d377400605 smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:31:45 +02:00
b7409532bd 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-24 13:31:45 +02:00
0b734ebca1 smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:31:45 +02:00
657ae86c15 squash 'clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total' into 'add SparseMerklePath' 2025-04-24 13:31:41 +02:00
Grzegorz Świrski
02355341dd use Cow instead of the additional IntoIter struct 2025-04-24 13:31:19 +02:00
Grzegorz Świrski
144297f4ae loop over depths in tests 2025-04-24 13:31:19 +02:00
Grzegorz Świrski
e6d1efe8e1 clarify empty_nodes_mask documentation 2025-04-24 13:31:19 +02:00
fe71275391 smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:31:19 +02:00
31ee6f2824 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-24 13:31:19 +02:00
1988a9643f smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:31:19 +02:00
60a3b0ab0e squash 'remove unsafe FromIterator<(NonZero…)>' into 'add SparseMerklePath' 2025-04-24 13:31:03 +02:00
Grzegorz Świrski
7ce5465015 use Cow instead of the additional IntoIter struct 2025-04-24 13:30:27 +02:00
Grzegorz Świrski
1d950e366e loop over depths in tests 2025-04-24 13:30:27 +02:00
Grzegorz Świrski
baec8d8efb clarify empty_nodes_mask documentation 2025-04-24 13:30:27 +02:00
Grzegorz Świrski
b7fcd73985 clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-24 13:30:27 +02:00
d0174e5917 smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:30:27 +02:00
2e08bc6fd2 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-24 13:30:27 +02:00
5cce8d6ca5 smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:30:27 +02:00
497d144399 squash 'make from_iter_with_depth private' into 'add SparseMerklePath' 2025-04-24 13:30:02 +02:00
Grzegorz Świrski
aaa85712da use Cow instead of the additional IntoIter struct 2025-04-24 13:29:34 +02:00
Grzegorz Świrski
6e16cf9256 loop over depths in tests 2025-04-24 13:29:34 +02:00
Grzegorz Świrski
0eb64cba59 clarify empty_nodes_mask documentation 2025-04-24 13:29:34 +02:00
Grzegorz Świrski
4bfbb499c8 clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-24 13:29:34 +02:00
Grzegorz Świrski
c08f98c1a4 remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-24 13:29:34 +02:00
8e1883d183 smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:29:34 +02:00
9b4c06b997 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-24 13:29:34 +02:00
1ef10c1e3a smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:29:34 +02:00
7263a0ce9d squash 'keep at_depth and at_idx consistent wrt ownership' into 'add SparseMerklePath 2025-04-24 13:28:30 +02:00
ac584be654 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-24 13:27:54 +02:00
Grzegorz Świrski
8e3bc78fb0 use Cow instead of the additional IntoIter struct 2025-04-24 13:27:54 +02:00
Grzegorz Świrski
ba464ae5f9 loop over depths in tests 2025-04-24 13:27:54 +02:00
Grzegorz Świrski
743d1cbec9 clarify empty_nodes_mask documentation 2025-04-24 13:27:54 +02:00
Grzegorz Świrski
480ce2223b clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-24 13:27:54 +02:00
Grzegorz Świrski
12c44d1d02 remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-24 13:27:54 +02:00
Grzegorz Świrski
d000eb750a make from_iter_with_depth private, make sure iterators in tests have the same length 2025-04-24 13:27:54 +02:00
a7d6ca99d7 smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:27:54 +02:00
51f17ba28b 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-24 13:27:54 +02:00
060b3cfc84 smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:27:54 +02:00
c0f6397c87 squash 'sort crate:: imports after super:: imports' into 'add SparseMerklePath' 2025-04-24 13:24:53 +02:00
Grzegorz Świrski
6f0bcaf552 use Cow instead of the additional IntoIter struct 2025-04-24 13:24:33 +02:00
Grzegorz Świrski
a80245c277 loop over depths in tests 2025-04-24 13:24:33 +02:00
Grzegorz Świrski
4c2af1c0e7 clarify empty_nodes_mask documentation 2025-04-24 13:24:33 +02:00
Grzegorz Świrski
2b1b6baa88 clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-24 13:24:33 +02:00
Grzegorz Świrski
235dcc2324 remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-24 13:24:33 +02:00
Grzegorz Świrski
262c896ad3 make from_iter_with_depth private, make sure iterators in tests have the same length 2025-04-24 13:24:33 +02:00
Grzegorz Świrski
b284b4c556 keep at_depth and at_idx consistent wrt ownership 2025-04-24 13:24:33 +02:00
dbb9017043 smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:24:33 +02:00
0cc0f4593e squash 'move comment' into 'add SparseMerklePath' 2025-04-24 13:24:05 +02:00
5b0cd8517b 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-24 13:23:35 +02:00
Grzegorz Świrski
32ac42c0bc use Cow instead of the additional IntoIter struct 2025-04-24 13:23:35 +02:00
a8b999852a smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:23:35 +02:00
Grzegorz Świrski
0e44fd7220 loop over depths in tests 2025-04-24 13:23:35 +02:00
Grzegorz Świrski
d7dedea37b clarify empty_nodes_mask documentation 2025-04-24 13:23:35 +02:00
Grzegorz Świrski
2ad7b2b71f clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-24 13:23:35 +02:00
Grzegorz Świrski
69b5807b97 remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-24 13:23:35 +02:00
Grzegorz Świrski
203bc8854a make from_iter_with_depth private, make sure iterators in tests have the same length 2025-04-24 13:23:35 +02:00
Grzegorz Świrski
2352b757ca keep at_depth and at_idx consistent wrt ownership 2025-04-24 13:23:35 +02:00
6fc1684ca1 sort crate:: imports after super:: imports 2025-04-24 13:23:35 +02:00
3273b8c1b6 smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:23:35 +02:00
3d836620c9 squash 'return a deserialization error' into 'add SparseMerklePath' 2025-04-24 13:23:21 +02:00
Grzegorz Świrski
6e9b708682 use Cow instead of the additional IntoIter struct 2025-04-24 13:22:57 +02:00
Grzegorz Świrski
07f58c97dc loop over depths in tests 2025-04-24 13:22:57 +02:00
Grzegorz Świrski
66a0e50276 clarify empty_nodes_mask documentation 2025-04-24 13:22:57 +02:00
Grzegorz Świrski
8e685432bb clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-24 13:22:57 +02:00
Grzegorz Świrski
0b3eb5c1bb remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-24 13:22:57 +02:00
Grzegorz Świrski
4319e5aa3a make from_iter_with_depth private, make sure iterators in tests have the same length 2025-04-24 13:22:57 +02:00
Grzegorz Świrski
d25488ce2e keep at_depth and at_idx consistent wrt ownership 2025-04-24 13:22:57 +02:00
Grzegorz Świrski
976bc3c69f move comment 2025-04-24 13:22:57 +02:00
0d611e63b7 sort crate:: imports after super:: imports 2025-04-24 13:22:57 +02:00
9802b1d9b9 smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:22:57 +02:00
b15f41cd99 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-24 13:22:57 +02:00
f4d8603b32 smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:22:57 +02:00
950741b255 squash 'move try_from doc to function level' into 'add SparseMerklePath' 2025-04-24 13:22:33 +02:00
Grzegorz Świrski
8f0e5ef9da use Cow instead of the additional IntoIter struct 2025-04-24 13:21:51 +02:00
Grzegorz Świrski
1ecb51b493 loop over depths in tests 2025-04-24 13:21:51 +02:00
Grzegorz Świrski
14172558cc clarify empty_nodes_mask documentation 2025-04-24 13:21:51 +02:00
Grzegorz Świrski
386f379fac clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-24 13:21:51 +02:00
Grzegorz Świrski
a2748bbf29 remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-24 13:21:51 +02:00
Grzegorz Świrski
01ba227880 make from_iter_with_depth private, make sure iterators in tests have the same length 2025-04-24 13:21:51 +02:00
Grzegorz Świrski
226f5b5340 keep at_depth and at_idx consistent wrt ownership 2025-04-24 13:21:51 +02:00
Grzegorz Świrski
8006beaaab move comment 2025-04-24 13:21:51 +02:00
Grzegorz Świrski
9855f035e0 return a deserialization error if too many empty nodes detected 2025-04-24 13:21:51 +02:00
4c990ba631 sort crate:: imports after super:: imports 2025-04-24 13:21:51 +02:00
6463802d7a smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:21:51 +02:00
abbe8d1638 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-24 13:21:51 +02:00
c5c9cb7345 smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:21:51 +02:00
36ecb991d5 squash 'clearer assertions in sparse_path tests' into 'add SparseMerklePath' 2025-04-24 13:20:59 +02:00
Grzegorz Świrski
6c9b5f1eaa use Cow instead of the additional IntoIter struct 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
a96143da4f loop over depths in tests 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
0dc3e35501 clarify empty_nodes_mask documentation 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
10a64e7e08 clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
87dc60e054 remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
34457f8b9c make from_iter_with_depth private, make sure iterators in tests have the same length 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
e63b3a8949 keep at_depth and at_idx consistent wrt ownership 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
6978cea693 move comment 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
987b50a172 return a deserialization error if too many empty nodes detected 2025-04-24 13:20:08 +02:00
Grzegorz Świrski
3a89096daf move try_from doc to function level for better ide support 2025-04-24 13:20:08 +02:00
de625fc4ce sort crate:: imports after super:: imports 2025-04-24 13:20:08 +02:00
c210f1d934 smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:20:08 +02:00
03f30b9b5a 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-24 13:20:08 +02:00
17dee2edfb smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:20:08 +02:00
9e7e8a60b4 split out 'sort crate:: imports after super:: imports' 2025-04-24 13:20:05 +02:00
Grzegorz Świrski
750ce32a71 use Cow instead of the additional IntoIter struct 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
4356d11e59 loop over depths in tests 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
0cc404c66f clarify empty_nodes_mask documentation 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
8676326550 clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
5d8e3f0cf8 remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
3362aeaddb make from_iter_with_depth private, make sure iterators in tests have the same length 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
6eb93aa334 keep at_depth and at_idx consistent wrt ownership 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
92085a75e0 move comment 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
7daabb1964 return a deserialization error if too many empty nodes detected 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
33e2d226a1 move try_from doc to function level for better ide support 2025-04-24 13:19:48 +02:00
a2a315d46d sort crate:: imports after super:: imports 2025-04-24 13:19:48 +02:00
Grzegorz Świrski
2df454c855 clearer assertions in sparse_path tests 2025-04-24 13:19:48 +02:00
a06a7b1b7e squash 'swap test_borrowing_iterator and test_owning_iterator names' into 'add SparseMerklePath' 2025-04-24 13:18:08 +02:00
e5950497f5 smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:17:37 +02:00
Grzegorz Świrski
98e0d50b71 use Cow instead of the additional IntoIter struct 2025-04-24 13:17:37 +02:00
6b07ac510d 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-24 13:17:37 +02:00
Grzegorz Świrski
a5e7f14943 loop over depths in tests 2025-04-24 13:17:37 +02:00
45eca087c3 smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:17:37 +02:00
Grzegorz Świrski
3a62c69d68 clarify empty_nodes_mask documentation 2025-04-24 13:17:37 +02:00
Grzegorz Świrski
0d54e9ed8b clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-24 13:17:37 +02:00
Grzegorz Świrski
7f90141994 remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-24 13:17:37 +02:00
Grzegorz Świrski
36a3b470b7 make from_iter_with_depth private, make sure iterators in tests have the same length 2025-04-24 13:17:37 +02:00
Grzegorz Świrski
1fd3a38415 keep at_depth and at_idx consistent wrt ownership 2025-04-24 13:17:37 +02:00
Grzegorz Świrski
277d1b3c3b move comment 2025-04-24 13:17:37 +02:00
Grzegorz Świrski
3800e19244 return a deserialization error if too many empty nodes detected 2025-04-24 13:17:37 +02:00
Grzegorz Świrski
db8f9f94bb move try_from doc to function level for better ide support 2025-04-24 13:17:37 +02:00
Grzegorz Świrski
cda565a3fe clearer assertions in sparse_path tests 2025-04-24 13:17:37 +02:00
beee1903e1 squash 'use expect instead of unwrap' into 'add SparseMerklePath' 2025-04-24 13:16:57 +02:00
Grzegorz Świrski
00eea2516f use Cow instead of the additional IntoIter struct 2025-04-24 13:16:21 +02:00
Grzegorz Świrski
c236589b5e loop over depths in tests 2025-04-24 13:16:21 +02:00
Grzegorz Świrski
c60967a21a clarify empty_nodes_mask documentation 2025-04-24 13:16:21 +02:00
Grzegorz Świrski
9b9f454a7c clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-24 13:16:21 +02:00
Grzegorz Świrski
d95d719530 remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-24 13:16:21 +02:00
Grzegorz Świrski
1aee55779c make from_iter_with_depth private, make sure iterators in tests have the same length 2025-04-24 13:16:21 +02:00
Grzegorz Świrski
97e81bc39b keep at_depth and at_idx consistent wrt ownership 2025-04-24 13:16:21 +02:00
Grzegorz Świrski
a988fb2c8c move comment 2025-04-24 13:16:21 +02:00
Grzegorz Świrski
c9ad4e570d return a deserialization error if too many empty nodes detected 2025-04-24 13:16:21 +02:00
Grzegorz Świrski
68f0b2c9b2 move try_from doc to function level for better ide support 2025-04-24 13:16:21 +02:00
Grzegorz Świrski
b28a31f495 clearer assertions in sparse_path tests 2025-04-24 13:16:21 +02:00
Grzegorz Świrski
ff75b046a6 swap test_borrowing_iterator and test_owning_iterator names 2025-04-24 13:16:21 +02:00
29e21a34ca smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:16:21 +02:00
d633acdd5b 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-24 13:16:21 +02:00
3364e59471 smt: add SparseMerklePath, a compact representation of MerklePath
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:16:21 +02:00
11af2ad57b squash 'strengthen wording in docs' into 'document indexing order of nodes 2025-04-24 13:14:42 +02:00
e514aa272a 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.

Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:14:00 +02:00
e56c386f8e 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-24 13:14:00 +02:00
Grzegorz Świrski
4cfd0bccd4 use Cow instead of the additional IntoIter struct 2025-04-24 13:14:00 +02:00
Grzegorz Świrski
4ad55debbf loop over depths in tests 2025-04-24 13:14:00 +02:00
Grzegorz Świrski
3d0160cb09 clarify empty_nodes_mask documentation 2025-04-24 13:14:00 +02:00
Grzegorz Świrski
89e93e5a98 clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-24 13:14:00 +02:00
Grzegorz Świrski
56c00da446 remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-24 13:14:00 +02:00
Grzegorz Świrski
afbda48d54 make from_iter_with_depth private, make sure iterators in tests have the same length 2025-04-24 13:14:00 +02:00
Grzegorz Świrski
ec6d5de741 keep at_depth and at_idx consistent wrt ownership 2025-04-24 13:14:00 +02:00
Grzegorz Świrski
6d53c446f4 move comment 2025-04-24 13:14:00 +02:00
Grzegorz Świrski
e89884b0ed return a deserialization error if too many empty nodes detected 2025-04-24 13:14:00 +02:00
Grzegorz Świrski
6cb2716fb6 move try_from doc to function level for better ide support 2025-04-24 13:14:00 +02:00
Grzegorz Świrski
8371347aec clearer assertions in sparse_path tests 2025-04-24 13:14:00 +02:00
Grzegorz Świrski
28ef569260 swap test_borrowing_iterator and test_owning_iterator names 2025-04-24 13:14:00 +02:00
Grzegorz Świrski
7c5f8b3723 expect instead of unwrap
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 13:14:00 +02:00
cc67a602be smt: change SimpleSmt::open() to return a sparse path 2025-04-24 13:14:00 +02:00
b43a852578 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-24 13:14:00 +02:00
116ec286be smt: add SparseMerklePath, a compact representation of MerklePath 2025-04-24 13:14:00 +02:00
610c773924 partially migrate get_hash -> get_node_hash 2025-04-24 13:13:56 +02:00
Grzegorz Świrski
c5676aed3e use Cow instead of the additional IntoIter struct 2025-04-24 12:53:38 +02:00
Grzegorz Świrski
21393fc45b loop over depths in tests 2025-04-24 12:53:38 +02:00
Grzegorz Świrski
115f10cfc7 clarify empty_nodes_mask documentation 2025-04-24 12:53:38 +02:00
Grzegorz Świrski
1c842f3bab clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-24 12:53:38 +02:00
Grzegorz Świrski
e4d58c6531 remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-24 12:53:38 +02:00
Grzegorz Świrski
cdac2d3ade make from_iter_with_depth private, make sure iterators in tests have the same length 2025-04-24 12:53:38 +02:00
Grzegorz Świrski
10557ea9e2 keep at_depth and at_idx consistent wrt ownership 2025-04-24 12:53:38 +02:00
Grzegorz Świrski
1c4eb748bd move comment 2025-04-24 12:53:38 +02:00
Grzegorz Świrski
85fc20900c return a deserialization error if too many empty nodes detected 2025-04-24 12:53:38 +02:00
Grzegorz Świrski
5c12e480df move try_from doc to function level for better ide support 2025-04-24 12:53:38 +02:00
Grzegorz Świrski
8e18827c20 clearer assertions in sparse_path tests 2025-04-24 12:53:38 +02:00
Grzegorz Świrski
f7ece78015 swap test_borrowing_iterator and test_owning_iterator names 2025-04-24 12:53:38 +02:00
Grzegorz Świrski
8e2ffb5e2a expect instead of unwrap
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 12:53:38 +02:00
Grzegorz Świrski
b77bc65b18 strengthen the wording in docs
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-24 12:53:38 +02:00
56a94c1a8b smt: change SimpleSmt::open() to return a sparse path 2025-04-24 12:53:38 +02:00
4a2bad749a MerkleTree: use new NodeIndex::proof_indices() to resolve TODO 2025-04-23 19:39:53 +02:00
72553db538 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-23 19:39:53 +02:00
632345a2f2 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-23 19:39:53 +02:00
4fe6ca3f57 smt: add SparseMerklePath, a compact representation of MerklePath 2025-04-23 19:39:53 +02:00
3971b166c8 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-23 19:39:53 +02:00
20bac15aba 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-23 19:39:53 +02:00
1f922adb96 add // TESTS header 2025-04-23 19:31:32 +02:00
Grzegorz Świrski
06e468a008 use Cow instead of the additional IntoIter struct 2025-04-23 19:31:24 +02:00
Grzegorz Świrski
e719e5e92a loop over depths in tests 2025-04-23 19:31:24 +02:00
Grzegorz Świrski
5321fff6e0 clarify empty_nodes_mask documentation 2025-04-23 19:31:24 +02:00
Grzegorz Świrski
ab2e7bef8e clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-23 19:31:24 +02:00
Grzegorz Świrski
371f7f5f86 remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-23 19:31:24 +02:00
Grzegorz Świrski
21f572b407 make from_iter_with_depth private, make sure iterators in tests have the same length 2025-04-23 19:31:24 +02:00
Grzegorz Świrski
1c5eae29c0 keep at_depth and at_idx consistent wrt ownership 2025-04-23 19:31:24 +02:00
Grzegorz Świrski
5f62212b3d move comment 2025-04-23 19:31:24 +02:00
Grzegorz Świrski
82c140e996 return a deserialization error if too many empty nodes detected 2025-04-23 19:31:24 +02:00
Grzegorz Świrski
4e97f0a192 move try_from doc to function level for better ide support 2025-04-23 19:31:24 +02:00
Grzegorz Świrski
d32e8c9fcb clearer assertions in sparse_path tests 2025-04-23 19:31:24 +02:00
Grzegorz Świrski
6ca4f887ce swap test_borrowing_iterator and test_owning_iterator names 2025-04-23 19:31:24 +02:00
Grzegorz Świrski
29d24a697c expect instead of unwrap
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-23 19:31:24 +02:00
Grzegorz Świrski
61782a5478 strengthen the wording in docs
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-23 19:31:24 +02:00
96df4fef87 smt: change SimpleSmt::open() to return a sparse path 2025-04-23 19:31:24 +02:00
76e5d4d97d 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-23 19:31:24 +02:00
fd759c23d4 smt: add SparseMerklePath, a compact representation of MerklePath 2025-04-23 19:31:24 +02:00
5d20459202 squash Cow commits into each other 2025-04-23 19:25:45 +02:00
Grzegorz Świrski
a39cd06537 use Cow instead of the additional IntoIter struct 2025-04-23 19:25:17 +02:00
8cedb9dafb fetch Greg's changes 2025-04-23 19:24:31 +02:00
Grzegorz Świrski
20156d1ac9 Cow without std 2025-04-17 22:11:46 +02:00
Grzegorz Świrski
866a6bd78a use Cow instead of the additional IntoIter struct 2025-04-16 17:47:33 +02:00
Grzegorz Świrski
9daaef8061 loop over depths in tests 2025-04-16 11:58:18 +02:00
Grzegorz Świrski
a03167ca8f clarify empty_nodes_mask documentation 2025-04-16 11:45:09 +02:00
Grzegorz Świrski
e5766b8194 clarify that SparseMerklePath can store up to SMT_MAX_DEPTH nodes total 2025-04-16 11:33:16 +02:00
Grzegorz Świrski
6c59d059eb remove unsafe FromIterator<(NonZero<u8>, Option<RpoDigest>)> 2025-04-16 11:31:04 +02:00
Grzegorz Świrski
c6edb4d42d make from_iter_with_depth private, make sure iterators in tests have the same length 2025-04-16 11:02:52 +02:00
Grzegorz Świrski
b9eaca42ac keep at_depth and at_idx consistent wrt ownership 2025-04-16 10:26:46 +02:00
Grzegorz Świrski
78f1edb918 move comment 2025-04-16 10:07:56 +02:00
Grzegorz Świrski
05fc26423d return a deserialization error if too many empty nodes detected 2025-04-16 10:05:39 +02:00
Grzegorz Świrski
d1e76062a3 move try_from doc to function level for better ide support 2025-04-16 09:50:20 +02:00
Grzegorz Świrski
d985fce4fa clearer assertions in sparse_path tests 2025-04-16 09:47:06 +02:00
Grzegorz Świrski
d2c4a02f0c swap test_borrowing_iterator and test_owning_iterator names 2025-04-16 09:40:23 +02:00
Grzegorz Świrski
71b741e0ce
expect instead of unwrap
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-16 09:34:52 +02:00
Grzegorz Świrski
c168c72f5a
strengthen the wording in docs
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
2025-04-16 09:32:16 +02:00

2
series

@ -1 +1 @@
Subproject commit 5ab7980fbc248d92fdc10d0251a69058f09c5d6d
Subproject commit bbf70c90edfa3d07810c9d94f5119061f9658930