feat: Add delete operation, parallel processing, RocksDB loading, and CRS error handling#106
Open
tx-tomcat wants to merge 8 commits intocrate-crypto:masterfrom
Open
feat: Add delete operation, parallel processing, RocksDB loading, and CRS error handling#106tx-tomcat wants to merge 8 commits intocrate-crypto:masterfrom
tx-tomcat wants to merge 8 commits intocrate-crypto:masterfrom
Conversation
- Add CRSError enum with InvalidLength, DuplicatePoints, and PointDeserializationError variants - Add try_from_bytes_uncompressed method to Element for safe deserialization - Update CRS::from_bytes to return Result<CRS, CRSError> - Add validate_no_duplicates helper for duplicate point detection - Add deprecated from_bytes_unchecked wrapper for backward compatibility - Add comprehensive unit tests for all error paths - Add thiserror dependency to ipa-multipoint Closes part of PR crate-crypto#105 - fixes panic on invalid CRS bytes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- Add populate_cache_from_storage() method to VerkleDb - Perform BFS traversal to load top CACHE_DEPTH (4) levels from storage - Call cache population in from_path() for automatic loading on init - Add rocks_db feature flag to verkle-trie for conditional RocksDB support - Add basic tests for cache configuration constants - Add RocksDB loading tests (some marked ignored due to serialization issues) Closes crate-crypto#95 - Enables loading Verkle trie from existing RocksDB database 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Add key deletion capability to achieve feature parity with go-verkle. Changes: - Add DeleteError type to errors.rs with StemNotFound, BranchNotFound, and CommitmentUpdateFailed variants - Extend WriteOnlyHigherDb trait with delete_leaf, delete_stem, delete_branch, and remove_branch_child methods - Implement delete methods in MemoryDb, VerkleDb, and GenericBatchWriter - Implement Trie::delete() with full commitment update propagation - Add helper methods: update_stem_after_delete, delete_stem_and_prune, remove_child_from_branch, prune_empty_branches, get_stem_depth, update_parent_after_stem_change, update_parent_branch - Add comprehensive tests for delete operations including: - Delete existing/nonexistent keys - Delete updates root commitment - Delete last key removes stem - Partial stem deletion - Delete and reinsert produces same root - Delete to empty trie - Delete with C2 suffix (>= 128) - Delete multiple stems 🤖 Generated with [Claude Code](https://claude.com/claude-code)
- Add hash_commitments_parallel() with threshold-based switching (100+ items) - Add insert_parallel() with stem-based grouping for efficient batch processing - Add ParallelInsertConfig for runtime configuration - Add comprehensive tests for determinism and threshold behavior - Both functions maintain backward compatibility for small batches - Remove unused ParallelConfig struct and debug statements 🤖 Generated with [Claude Code](https://claude.com/claude-code)
… and polynomial operations in `MultiPoint::open`, updating the README and adding a determinism test.
…ation and activating related tests."
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.
Summary
This PR adds several enhancements to rust-verkle to improve functionality, performance, and robustness:
Changes
1. Delete Operation (
Trie::delete)DeleteErrortype withStemNotFound,BranchNotFound, andCommitmentUpdateFailedvariantsWriteOnlyHigherDbtrait withdelete_leaf,delete_stem,delete_branch, andremove_branch_childmethodsMemoryDb,VerkleDb, andGenericBatchWriter2. Parallel Operations
hash_commitments_parallel()in FFI with threshold-based switching (100+ items uses parallel)insert_parallel()in Trie with stem-based grouping for efficient batch processingParallelInsertConfigfor explicit control over parallelism3. RocksDB Loading (Closes #95)
populate_cache_from_storage()method toVerkleDbCACHE_DEPTH(4) levels from storage on initfrom_path()4. CRS Error Handling (Closes part of #105)
CRSErrorenum withInvalidLength,DuplicatePoints, andPointDeserializationErrorCRS::from_bytesto returnResult<CRS, CRSError>instead of panickingtry_from_bytes_uncompressedto Element for safe deserializationfrom_bytes_uncheckedwrapper for backward compatibilityTest Plan