11af2ad57b
squash 'strengthen wording in docs' into 'document indexing order of nodes
2025-04-24 13:14:42 +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
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
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
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