refactor(PR 12): add SecretFr to zerokit, standardize type naming in Wasm and FFI#422
Closed
vinhtc27 wants to merge 10 commits into
Closed
refactor(PR 12): add SecretFr to zerokit, standardize type naming in Wasm and FFI#422vinhtc27 wants to merge 10 commits into
vinhtc27 wants to merge 10 commits into
Conversation
…d remove old code (#420)
…d and pmtree utilities, migrate to pmtree v3, fix override_range bug, generic PmTree<D,H> struct for any persistent backend (#421) ## This PR need the this new release of pmtree vacp2p/pmtree#6 ## Changes: All the changes related to merkle tree impl in Zerokit - Moved the sled-backed PmTree into rln module, utils module is now apure, storage-agnostic Merkle-tree crate with no sled/pmtree dependency. - Make PmTree generic over the pmtree Database backend via a PmTreeBackendConfig trait (Sled impl by default). Allow any custom impl for persistent layer (RocksDB, PostgreSQL,...) with minimal impl via Database trait. - ZerokitMerkleTree now has an associated `Error` type. The in-memory backends keep ZerokitMerkleTreeError, de-overloaded to one variant per condition; PmTree returns a structured PmTreeError that separates tree-logic errors (MerkleTree) from storage-backend faults (Backend), and pre-validates domain conditions so the same misuse yields the same variant on every backend. Callers match flat variants instead of nested enums ([#343](#343)). - Adopted pmtree 3.0.0: PmTree writes (set/delete/update_next/override_range) are now crash-atomic ([PR](vacp2p/pmtree#6)). ~- PmTree is now generic over the hash (PmTree\<H\> instead of a hardcoded PoseidonHash), so a future PoseidonHash2 can plug in.~ (Generic over both persistent backend anh hash (PmTree\<D, H\>) - Fixed override_range: replaced the per-tree span logic and its separate pre-validation pass (validate_override_range_inputs / EmptyIndicesPolicy in override_range_validation.rs, now deleted) with one shared default trait method — write the new leaves from start, reset only the delete-indices the write doesn't already cover (writes win on overlap), validate everything before touching the tree. - Fixed a bug where leaves landed at the wrong indices. Full/Optimal use the default; PmTree overrides it to apply the whole change in a single atomic commit. - Tests: value + cache + validation coverage for override_range across all three merkle tree. - Add TODO marked the RLN-math sites still calling Poseidon directly (id-commitment, nullifier, root recompute) for a later generic hash trait. - Fixed silence delete opt in Full/OptimalMerkleTree.
…follow convention
…cretFr opaque type, standardize wasm type naming
…etFr opaque type, standardize FFI type naming
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.