Commit graph

477 commits

Author SHA1 Message Date
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
4a2bad749a MerkleTree: use new NodeIndex::proof_indices() to resolve TODO 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
5eb9a14c40 PartialSmt: fix misleading variable names 2025-04-04 15:17:21 +02:00
Bobbin Threadbare
78672585f1
chore: update crate version to 0.15.0
Some checks failed
build / Build for no-std (push) Has been cancelled
lint / clippy nightly on ubuntu-latest (push) Has been cancelled
lint / rustfmt check nightly on ubuntu-latest (push) Has been cancelled
lint / doc stable on ubuntu-latest (push) Has been cancelled
lint / check rust version consistency (push) Has been cancelled
test / test nightly on ubuntu with default (push) Has been cancelled
test / test stable on ubuntu with default (push) Has been cancelled
test / test nightly on ubuntu with no-std (push) Has been cancelled
test / test stable on ubuntu with no-std (push) Has been cancelled
test / test nightly on ubuntu with smt-hashmaps (push) Has been cancelled
test / test stable on ubuntu with smt-hashmaps (push) Has been cancelled
test / test-smt-concurrent nightly (push) Has been cancelled
test / test-smt-concurrent stable (push) Has been cancelled
2025-03-15 18:30:53 -07:00
Bobbin Threadbare
51dbc61583
chore: fix lints 2025-03-15 17:49:02 -07:00
Bobbin Threadbare
78e32a3824
feat: added naive implementation of Smt::num_entries() 2025-03-15 17:41:08 -07:00
Bobbin Threadbare
660a667de1
chore: update changelog 2025-03-15 17:33:57 -07:00
Krushimir
8b1593f0ba
refactor: folder structure (#397) 2025-03-15 17:13:58 -07:00
Santiago Pittella
b5c568eb12
chore: update to Rust 2024 edition (#399) 2025-03-13 13:36:22 -07:00
Santiago Pittella
d5b38a8b35
chore: update rand dependency to v0.9.0 (#398) 2025-03-13 12:13:49 -07:00
Krushimir
222197d08f
feat: optimized duplicate key detection in concurrent SMT construction (#395) 2025-03-13 01:57:27 -07:00
Bobbin Threadbare
0df69679e9
Merge pull request #391 from 0xPolygonMiden/al-fix-falcon-sk-serialization
Add range checks when generating secret key
2025-03-11 00:46:26 -07:00
Bobbin Threadbare
337a57fa07
Merge branch 'next' into al-fix-falcon-sk-serialization 2025-03-10 17:48:26 -07:00
Krushimir
cd0821961d
test: adds property-based testing and fuzzing for SMT (#385)
* Adds concurrent proptests
* Adds fuzzing for SMT
* fix: concurrent mutations without mutated entries
* fix: key sorting
2025-03-10 11:51:16 -07:00
Al-Kindi-0
9acbf2f10c doc: changelog 2025-03-10 14:39:48 +01:00
Al-Kindi-0
49bf510ab0 fix: add bound checks on polynomials defining the secret key during generation 2025-03-10 14:28:35 +01:00
1e87cd60ff
docs: add SMT benchmarks (#384) 2025-02-25 13:33:19 -08:00
b97243c582
fix: dead_code warning on pairs_to_leaf when not(feature = "concurrent") (#380)
This also moves `pairs_to_leaf()` out of the `SparseMerkleTree` trait,
also removing it from `SimpleSmt`, as `pairs_to_leaf()` is only ever
used in concurrent code for `Smt`.

This fixes a warning with `--no-default-features`.
2025-02-24 10:26:56 -08:00
Philipp Gackstatter
d0e9ead6f4
feat: filter empty values in Smt::with_entries (#383) 2025-02-18 02:18:47 -08:00
Bobbin Threadbare
2ba30bf3bf
fix: error in Cargo.lock 2025-02-18 01:19:15 -08:00
Bobbin Threadbare
0514a8316a
Merge branch 'main' into next 2025-02-18 01:14:07 -08:00
Bobbin Threadbare
8ce7b68d68
chore: increment crate version to v0.13.3 and update changelog 2025-02-18 01:09:11 -08:00
Philipp Gackstatter
535637d7fb
fix: panic in PartialMmr::untrack (#382) 2025-02-18 01:04:21 -08:00
Philipp Gackstatter
ed14eaa90c
fix: PartialSmt stale proofs not resulting in error (#381) 2025-02-17 15:40:56 -08:00
Krushimir
bbe11964b1
fix: subtree8-rand benchmark panics with debug assertions enabled (#377) (#378) 2025-02-13 11:00:16 -08:00
Bobbin Threadbare
1e59686153
Merge branch 'main' into next 2025-02-11 16:45:57 -08:00
Philipp Gackstatter
12d0eefeb2
feat: implement PartialSmt (#372) 2025-02-10 23:48:32 -08:00
Al-Kindi-0
fe7bdae430
chore: update Winterfell dependencies to v0.12.0 (#374) 2025-02-10 10:29:33 -08:00
Bobbin Threadbare
117813f48d
chore: update changelog 2025-02-06 17:58:44 -08:00
Bobbin Threadbare
58d173ef7b
chore: minor code cleanup 2025-02-06 17:52:32 -08:00
Krushimir
1b77fa8039
feat: implements concurrent Smt::compute_mutations (#365) 2025-02-06 16:51:11 -08:00
arnaucube
d569c71666
feat: remove duplicated check in falcon verification (#368) 2025-01-26 00:22:28 -08:00
Bobbin Threadbare
a424652ba7
Merge branch 'main' into next 2025-01-24 17:34:50 -08:00
polydez
2a5b8ffb21
feat: implement functionality needed for computing openings for recent blocks (#367)
* refactor: make `InnerNode` and `NodeMutation` public
* feat: implement serialization for `LeafIndex`
2025-01-24 17:32:30 -08:00
Bobbin Threadbare
0e85398732
chore: update crate version to 0.14.0 and MSRV to 1.84 2025-01-23 00:11:36 -08:00
Bobbin Threadbare
a75dced6e9
chore: fix typo 2025-01-19 14:10:59 -08:00