Re-implement merkletree with persistent storage (key-value db) (#487)

* refactor merkletree to work with disk keyvalue database (wip)

* various fixes post reimplementation; pending delete leaf

* add delete operation case for the new in db tree approach

* polish tree update & delete; everything works (pending polishing)

* polish panics into errs, prints, etc

* Implement iterator

* Lint

* fix case no-siblings

* case delete with semi-empty branch

* polishing

* starting to add rocksdb & heeddb for the DB & Txn traits

* Satisfy the borrow checker

* abstract merkletree tests to use the various available DBs

* update store_node interface (rm hash input), rm heed.rs

* polishing

* typos

* Ditch transactions

* add feature for rocksdb, return errs at new_with_db, remove empty leaf case in Leaf::new

* intermediate instead of leaf in empty node when deleting leaf

---------

Co-authored-by: Ahmad <root@ahmadafuni.com>
This commit is contained in:
arnaucube 2026-03-11 16:32:42 +01:00 committed by GitHub
parent a79f82eb9d
commit 32f45872d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 974 additions and 431 deletions

View file

@ -2276,9 +2276,9 @@ mod tests {
]
.into_iter()
.for_each(|(op, st)| {
let check = std::panic::catch_unwind(|| {
let check = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
operation_verify(st, op, prev_statements.to_vec(), Aux::default())
});
}));
match check {
Err(e) => {
let err_string = e.downcast_ref::<String>().unwrap();
@ -2689,9 +2689,9 @@ mod tests {
);
let prev_statements = [Statement::None.into()];
let check = std::panic::catch_unwind(|| {
let check = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
operation_verify(st, op, prev_statements.to_vec(), Aux::default())
});
}));
match check {
Err(e) => {
let err_string = e.downcast_ref::<String>().unwrap();