From 0dadb6da66f39b370b32cac65ddfdeaec6c27c4c Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Wed, 9 Sep 2026 06:21:48 +0700 Subject: [PATCH 01/20] build(platform)!: adopt GroveDB 6.0.0 and the published grovedb-bincode 2.1.0 Advance GroveDB to develop 985ece65 (6.0.0) and rust-dashcore to dev 057e79cd, use rocksdb 0.25.0 from crates.io instead of the rust-rocksdb fork, and make the workspace bincode dependency an alias for the published grovedb-bincode 2.1.0 so GroveDB, rust-dashcore and Platform share one set of bincode traits without a Cargo patch. Adapt to the GroveDB API changes: batch options in Drive's grove operations, element verification aligned with the prover's right-to-left traversal, which GroveDB now checks strictly, and the new backward reference element variants rendered by the FFI and wasm SDK path element queries. BREAKING CHANGE: Rust consumers serializing Platform or Core types must use the published grovedb-bincode 2.1.0 crate; bincode trait identities now come from it. Wire encodings and the C ABI are unchanged. Co-Authored-By: Claude Fable 5.1 --- Cargo.lock | 223 +++++++++--------- Cargo.toml | 17 +- packages/rs-dpp/Cargo.toml | 4 +- packages/rs-drive-abci/Cargo.toml | 14 +- packages/rs-drive-proof-verifier/Cargo.toml | 2 +- packages/rs-drive/Cargo.toml | 16 +- .../grove_operations/batch_delete/v0/mod.rs | 1 + .../v0/mod.rs | 1 + .../grove_operations/batch_move/v0/mod.rs | 1 + .../batch_move_items_in_path_query/v0/mod.rs | 1 + .../batch_remove_raw/v0/mod.rs | 1 + .../v0/mod.rs | 1 + .../v0/mod.rs | 1 + .../grove_batch_operations_costs/v0/mod.rs | 1 + .../grove_operations/grove_delete/v0/mod.rs | 1 + .../verify/system/verify_elements/v0/mod.rs | 4 +- packages/rs-platform-serialization/Cargo.toml | 2 +- packages/rs-platform-value/Cargo.toml | 2 +- packages/rs-platform-version/Cargo.toml | 4 +- packages/rs-platform-wallet-ffi/Cargo.toml | 2 +- .../rs-platform-wallet-storage/Cargo.toml | 2 +- packages/rs-platform-wallet/Cargo.toml | 2 +- packages/rs-sdk-ffi/Cargo.toml | 2 +- .../src/system/queries/path_elements.rs | 69 +++++- packages/rs-sdk/Cargo.toml | 2 +- packages/simple-signer/Cargo.toml | 2 +- packages/strategy-tests/Cargo.toml | 2 +- packages/wasm-dpp/Cargo.toml | 2 +- packages/wasm-dpp2/Cargo.toml | 2 +- packages/wasm-drive-verify/Cargo.toml | 2 +- packages/wasm-sdk/src/queries/system.rs | 77 +++++- 31 files changed, 300 insertions(+), 163 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0f726d3c274..fd89359e232 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -524,26 +524,6 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" -[[package]] -name = "bincode" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" -dependencies = [ - "bincode_derive", - "serde", - "unty", -] - -[[package]] -name = "bincode_derive" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf95709a440f45e986983918d0e8a1f30a9b1df04918fc828670606804ac3c09" -dependencies = [ - "virtue 0.0.18", -] - [[package]] name = "bindgen" version = "0.65.1" @@ -576,7 +556,7 @@ dependencies = [ "bitflags 2.13.0", "cexpr", "clang-sys", - "itertools 0.10.5", + "itertools 0.13.0", "proc-macro2", "quote", "regex", @@ -1662,18 +1642,18 @@ dependencies = [ [[package]] name = "dash-network" version = "0.45.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd#93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" +source = "git+https://github.com/dashpay/rust-dashcore?rev=057e79cd3e1eeb29676288e9aab76b867d8e707f#057e79cd3e1eeb29676288e9aab76b867d8e707f" dependencies = [ - "bincode", - "bincode_derive", "cbindgen 0.29.4", + "grovedb-bincode", + "grovedb-bincode-derive", "serde", ] [[package]] name = "dash-network-seeds" version = "0.45.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd#93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" +source = "git+https://github.com/dashpay/rust-dashcore?rev=057e79cd3e1eeb29676288e9aab76b867d8e707f#057e79cd3e1eeb29676288e9aab76b867d8e707f" dependencies = [ "dash-network", ] @@ -1768,7 +1748,7 @@ dependencies = [ [[package]] name = "dash-spv" version = "0.45.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd#93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" +source = "git+https://github.com/dashpay/rust-dashcore?rev=057e79cd3e1eeb29676288e9aab76b867d8e707f#057e79cd3e1eeb29676288e9aab76b867d8e707f" dependencies = [ "async-trait", "chrono", @@ -1797,13 +1777,11 @@ dependencies = [ [[package]] name = "dashcore" version = "0.45.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd#93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" +source = "git+https://github.com/dashpay/rust-dashcore?rev=057e79cd3e1eeb29676288e9aab76b867d8e707f#057e79cd3e1eeb29676288e9aab76b867d8e707f" dependencies = [ "anyhow", "base64-compat", "bech32 0.9.1", - "bincode", - "bincode_derive", "bitvec", "blake3", "blsful", @@ -1811,6 +1789,8 @@ dependencies = [ "dashcore-private", "dashcore_hashes", "ed25519-dalek", + "grovedb-bincode", + "grovedb-bincode-derive", "hex", "hex_lit", "rustversion", @@ -1823,12 +1803,12 @@ dependencies = [ [[package]] name = "dashcore-private" version = "0.45.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd#93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" +source = "git+https://github.com/dashpay/rust-dashcore?rev=057e79cd3e1eeb29676288e9aab76b867d8e707f#057e79cd3e1eeb29676288e9aab76b867d8e707f" [[package]] name = "dashcore-rpc" version = "0.45.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd#93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" +source = "git+https://github.com/dashpay/rust-dashcore?rev=057e79cd3e1eeb29676288e9aab76b867d8e707f#057e79cd3e1eeb29676288e9aab76b867d8e707f" dependencies = [ "dashcore-rpc-json", "hex", @@ -1841,10 +1821,10 @@ dependencies = [ [[package]] name = "dashcore-rpc-json" version = "0.45.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd#93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" +source = "git+https://github.com/dashpay/rust-dashcore?rev=057e79cd3e1eeb29676288e9aab76b867d8e707f#057e79cd3e1eeb29676288e9aab76b867d8e707f" dependencies = [ - "bincode", "dashcore", + "grovedb-bincode", "hex", "key-wallet", "serde", @@ -1856,10 +1836,10 @@ dependencies = [ [[package]] name = "dashcore_hashes" version = "0.45.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd#93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" +source = "git+https://github.com/dashpay/rust-dashcore?rev=057e79cd3e1eeb29676288e9aab76b867d8e707f#057e79cd3e1eeb29676288e9aab76b867d8e707f" dependencies = [ - "bincode", "dashcore-private", + "grovedb-bincode", "rs-x11-hash", "serde", ] @@ -2117,7 +2097,6 @@ dependencies = [ "async-trait", "base64 0.22.1", "bech32 0.11.1", - "bincode", "bs58", "byteorder", "chrono", @@ -2132,6 +2111,7 @@ dependencies = [ "dpp-json-convertible-derive", "env_logger", "getrandom 0.2.17", + "grovedb-bincode", "grovedb-commitment-tree", "hex", "indexmap 2.14.0", @@ -2182,7 +2162,6 @@ dependencies = [ "arc-swap", "assert_matches", "base64 0.22.1", - "bincode", "bs58", "byteorder", "chrono", @@ -2192,6 +2171,7 @@ dependencies = [ "dpp", "enum-map", "grovedb", + "grovedb-bincode", "grovedb-costs", "grovedb-epoch-based-storage-flags", "grovedb-path", @@ -2224,7 +2204,6 @@ dependencies = [ "arc-swap", "assert_matches", "async-trait", - "bincode", "blake3", "bls-signatures", "chrono", @@ -2243,6 +2222,7 @@ dependencies = [ "drive-proof-verifier", "envy", "file-rotate", + "grovedb-bincode", "grovedb-commitment-tree", "grovedb-path", "grovedb-storage", @@ -2283,12 +2263,12 @@ dependencies = [ name = "drive-proof-verifier" version = "4.2.0-dev.8" dependencies = [ - "bincode", "dapi-grpc", "dash-context-provider", "derive_more 1.0.0", "dpp", "drive", + "grovedb-bincode", "hex", "indexmap 2.14.0", "platform-serialization", @@ -2925,7 +2905,7 @@ dependencies = [ [[package]] name = "git-state" version = "0.45.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd#93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" +source = "git+https://github.com/dashpay/rust-dashcore?rev=057e79cd3e1eeb29676288e9aab76b867d8e707f#057e79cd3e1eeb29676288e9aab76b867d8e707f" [[package]] name = "glob" @@ -2974,13 +2954,13 @@ dependencies = [ [[package]] name = "grovedb" -version = "5.0.1" -source = "git+https://github.com/dashpay/grovedb?rev=6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e#6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" +version = "6.0.0" +source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" dependencies = [ "axum 0.8.9", - "bincode", - "bincode_derive", "blake3", + "grovedb-bincode", + "grovedb-bincode-derive", "grovedb-bulk-append-tree", "grovedb-commitment-tree", "grovedb-costs", @@ -3011,13 +2991,33 @@ dependencies = [ "zip-extensions", ] +[[package]] +name = "grovedb-bincode" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce912028682ecc5870a5ad609ea456b76b0bf4ec1ba1eb649400b64ff73a7782" +dependencies = [ + "grovedb-bincode-derive", + "serde", + "unty", +] + +[[package]] +name = "grovedb-bincode-derive" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eaff4e961dcb3e7e55c34c8c6982249036e5aaa19e55f6dab94ebcd4896b03a" +dependencies = [ + "virtue 0.0.18", +] + [[package]] name = "grovedb-bulk-append-tree" -version = "5.0.1" -source = "git+https://github.com/dashpay/grovedb?rev=6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e#6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" +version = "6.0.0" +source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" dependencies = [ - "bincode", "blake3", + "grovedb-bincode", "grovedb-costs", "grovedb-dense-fixed-sized-merkle-tree", "grovedb-merkle-mountain-range", @@ -3031,8 +3031,8 @@ dependencies = [ [[package]] name = "grovedb-commitment-tree" -version = "5.0.1" -source = "git+https://github.com/dashpay/grovedb?rev=6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e#6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" +version = "6.0.0" +source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3048,8 +3048,8 @@ dependencies = [ [[package]] name = "grovedb-costs" -version = "5.0.1" -source = "git+https://github.com/dashpay/grovedb?rev=6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e#6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" +version = "6.0.0" +source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" dependencies = [ "integer-encoding", "intmap", @@ -3058,11 +3058,11 @@ dependencies = [ [[package]] name = "grovedb-dense-fixed-sized-merkle-tree" -version = "5.0.1" -source = "git+https://github.com/dashpay/grovedb?rev=6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e#6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" +version = "6.0.0" +source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" dependencies = [ - "bincode", "blake3", + "grovedb-bincode", "grovedb-costs", "grovedb-query", "grovedb-storage", @@ -3072,11 +3072,11 @@ dependencies = [ [[package]] name = "grovedb-element" -version = "5.0.1" -source = "git+https://github.com/dashpay/grovedb?rev=6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e#6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" +version = "6.0.0" +source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" dependencies = [ - "bincode", - "bincode_derive", + "grovedb-bincode", + "grovedb-bincode-derive", "grovedb-path", "grovedb-query", "grovedb-version", @@ -3088,8 +3088,8 @@ dependencies = [ [[package]] name = "grovedb-epoch-based-storage-flags" -version = "5.0.1" -source = "git+https://github.com/dashpay/grovedb?rev=6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e#6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" +version = "6.0.0" +source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" dependencies = [ "grovedb-costs", "hex", @@ -3100,15 +3100,15 @@ dependencies = [ [[package]] name = "grovedb-merk" -version = "5.0.1" -source = "git+https://github.com/dashpay/grovedb?rev=6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e#6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" +version = "6.0.0" +source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" dependencies = [ - "bincode", - "bincode_derive", "blake3", "byteorder", "colored", "ed", + "grovedb-bincode", + "grovedb-bincode-derive", "grovedb-costs", "grovedb-element", "grovedb-path", @@ -3126,11 +3126,11 @@ dependencies = [ [[package]] name = "grovedb-merkle-mountain-range" -version = "5.0.1" -source = "git+https://github.com/dashpay/grovedb?rev=6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e#6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" +version = "6.0.0" +source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" dependencies = [ - "bincode", "blake3", + "grovedb-bincode", "grovedb-costs", "grovedb-storage", "grovedb-version", @@ -3139,16 +3139,16 @@ dependencies = [ [[package]] name = "grovedb-path" -version = "5.0.1" -source = "git+https://github.com/dashpay/grovedb?rev=6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e#6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" +version = "6.0.0" +source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" dependencies = [ "hex", ] [[package]] name = "grovedb-private-document-store" -version = "5.0.1" -source = "git+https://github.com/dashpay/grovedb?rev=6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e#6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" +version = "6.0.0" +source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3160,12 +3160,12 @@ dependencies = [ [[package]] name = "grovedb-query" -version = "5.0.1" -source = "git+https://github.com/dashpay/grovedb?rev=6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e#6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" +version = "6.0.0" +source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" dependencies = [ - "bincode", "byteorder", "ed", + "grovedb-bincode", "grovedb-costs", "grovedb-storage", "hex", @@ -3176,8 +3176,8 @@ dependencies = [ [[package]] name = "grovedb-storage" -version = "5.0.1" -source = "git+https://github.com/dashpay/grovedb?rev=6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e#6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" +version = "6.0.0" +source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" dependencies = [ "blake3", "grovedb-costs", @@ -3195,8 +3195,8 @@ dependencies = [ [[package]] name = "grovedb-version" -version = "5.0.1" -source = "git+https://github.com/dashpay/grovedb?rev=6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e#6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" +version = "6.0.0" +source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" dependencies = [ "thiserror 2.0.18", "versioned-feature-core", @@ -3204,8 +3204,8 @@ dependencies = [ [[package]] name = "grovedb-visualize" -version = "5.0.1" -source = "git+https://github.com/dashpay/grovedb?rev=6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e#6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" +version = "6.0.0" +source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" dependencies = [ "hex", "itertools 0.14.0", @@ -3213,8 +3213,8 @@ dependencies = [ [[package]] name = "grovedbg-types" -version = "5.0.1" -source = "git+https://github.com/dashpay/grovedb?rev=6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e#6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" +version = "6.0.0" +source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" dependencies = [ "serde", "serde_with 3.21.0", @@ -4137,13 +4137,11 @@ dependencies = [ [[package]] name = "key-wallet" version = "0.45.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd#93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" +source = "git+https://github.com/dashpay/rust-dashcore?rev=057e79cd3e1eeb29676288e9aab76b867d8e707f#057e79cd3e1eeb29676288e9aab76b867d8e707f" dependencies = [ "aes", "async-trait", "base58ck", - "bincode", - "bincode_derive", "bip39", "bitflags 2.13.0", "bs58", @@ -4151,6 +4149,8 @@ dependencies = [ "dashcore-private", "dashcore_hashes", "getrandom 0.2.17", + "grovedb-bincode", + "grovedb-bincode-derive", "hex", "rand 0.8.6", "scrypt", @@ -4166,7 +4166,7 @@ dependencies = [ [[package]] name = "key-wallet-ffi" version = "0.45.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd#93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" +source = "git+https://github.com/dashpay/rust-dashcore?rev=057e79cd3e1eeb29676288e9aab76b867d8e707f#057e79cd3e1eeb29676288e9aab76b867d8e707f" dependencies = [ "cbindgen 0.29.4", "dash-network", @@ -4182,11 +4182,11 @@ dependencies = [ [[package]] name = "key-wallet-manager" version = "0.45.0" -source = "git+https://github.com/dashpay/rust-dashcore?rev=93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd#93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" +source = "git+https://github.com/dashpay/rust-dashcore?rev=057e79cd3e1eeb29676288e9aab76b867d8e707f#057e79cd3e1eeb29676288e9aab76b867d8e707f" dependencies = [ "async-trait", - "bincode", "dashcore", + "grovedb-bincode", "key-wallet", "rayon", "serde", @@ -4276,8 +4276,9 @@ checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "librocksdb-sys" -version = "0.18.0+10.7.5" -source = "git+https://github.com/QuantumExplorer/rust-rocksdb.git?rev=52772eea7bcd214d1d07d80aa538b1d24e5015b7#52772eea7bcd214d1d07d80aa538b1d24e5015b7" +version = "0.19.0+11.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f45e86edad8e88efe97dbf384b4e48e1ff0f111eabf154c7b09d7a1e5fb573c" dependencies = [ "bindgen 0.72.1", "bzip2-sys", @@ -4285,6 +4286,7 @@ dependencies = [ "libc", "libz-sys", "lz4-sys", + "rustflags", "zstd-sys", ] @@ -5171,7 +5173,7 @@ dependencies = [ name = "platform-serialization" version = "4.2.0-dev.8" dependencies = [ - "bincode", + "grovedb-bincode", "platform-version", ] @@ -5190,9 +5192,9 @@ name = "platform-value" version = "4.2.0-dev.8" dependencies = [ "base64 0.22.1", - "bincode", "bs58", "ciborium", + "grovedb-bincode", "hex", "indexmap 2.14.0", "platform-serialization", @@ -5216,7 +5218,7 @@ dependencies = [ name = "platform-version" version = "4.2.0-dev.8" dependencies = [ - "bincode", + "grovedb-bincode", "grovedb-version", "thiserror 2.0.18", "versioned-feature-core", @@ -5277,13 +5279,13 @@ version = "4.2.0-dev.8" dependencies = [ "anyhow", "async-trait", - "bincode", "bs58", "cbindgen 0.27.0", "dash-network", "dash-sdk", "dashcore", "dpp", + "grovedb-bincode", "hex", "key-wallet", "lazy_static", @@ -5306,7 +5308,6 @@ dependencies = [ "apple-native-keyring-store", "argon2", "assert_cmd", - "bincode", "chacha20poly1305", "chrono", "clap", @@ -5317,6 +5318,7 @@ dependencies = [ "fd-lock", "filetime", "getrandom 0.2.17", + "grovedb-bincode", "hex", "humantime", "key-wallet", @@ -5582,8 +5584,8 @@ version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03da047801ff44bb6a4d407d4860c05fd70bb81714e6b2f3812603d5b145b042" dependencies = [ - "heck 0.4.1", - "itertools 0.10.5", + "heck 0.5.0", + "itertools 0.14.0", "log", "multimap", "petgraph", @@ -5604,7 +5606,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ "anyhow", - "itertools 0.10.5", + "itertools 0.14.0", "proc-macro2", "quote", "syn 2.0.117", @@ -5617,7 +5619,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf" dependencies = [ "anyhow", - "itertools 0.10.5", + "itertools 0.14.0", "proc-macro2", "quote", "syn 2.0.117", @@ -6291,8 +6293,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.24.0" -source = "git+https://github.com/QuantumExplorer/rust-rocksdb.git?rev=52772eea7bcd214d1d07d80aa538b1d24e5015b7#52772eea7bcd214d1d07d80aa538b1d24e5015b7" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8d90add70d1d420ee487bce4a1449880a8d147451c6051b2ee5f8354553dcbf" dependencies = [ "libc", "librocksdb-sys", @@ -6422,7 +6425,6 @@ name = "rs-sdk-ffi" version = "4.2.0-dev.8" dependencies = [ "async-trait", - "bincode", "bs58", "cbindgen 0.27.0", "dash-async", @@ -6433,6 +6435,7 @@ dependencies = [ "env_logger", "envy", "getrandom 0.2.17", + "grovedb-bincode", "hex", "key-wallet", "libc", @@ -6591,6 +6594,12 @@ dependencies = [ "semver", ] +[[package]] +name = "rustflags" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a39e0e9135d7a7208ee80aa4e3e4b88f0f5ad7be92153ed70686c38a03db2e63" + [[package]] name = "rustix" version = "0.38.44" @@ -7223,8 +7232,8 @@ version = "4.2.0-dev.8" dependencies = [ "async-trait", "base64 0.22.1", - "bincode", "dpp", + "grovedb-bincode", "hex", "tracing", "zeroize", @@ -7358,9 +7367,9 @@ dependencies = [ name = "strategy-tests" version = "4.2.0-dev.8" dependencies = [ - "bincode", "dpp", "drive", + "grovedb-bincode", "hex", "platform-version", "rand 0.8.6", @@ -8737,8 +8746,8 @@ version = "4.2.0-dev.8" dependencies = [ "anyhow", "async-trait", - "bincode", "dpp", + "grovedb-bincode", "hex", "itertools 0.13.0", "js-sys", @@ -8761,9 +8770,9 @@ version = "4.2.0-dev.8" dependencies = [ "anyhow", "async-trait", - "bincode", "dpp", "dpp-json-convertible-derive", + "grovedb-bincode", "hex", "js-sys", "serde", @@ -8779,12 +8788,12 @@ name = "wasm-drive-verify" version = "4.2.0-dev.8" dependencies = [ "base64 0.22.1", - "bincode", "bs58", "ciborium", "console_error_panic_hook", "dpp", "drive", + "grovedb-bincode", "hex", "indexmap 2.14.0", "js-sys", diff --git a/Cargo.toml b/Cargo.toml index 5fc7a2a957c..bb78be4d619 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,14 +53,15 @@ members = [ ] [workspace.dependencies] -dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" } -dash-network-seeds = { git = "https://github.com/dashpay/rust-dashcore", rev = "93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" } -dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" } -key-wallet = { git = "https://github.com/dashpay/rust-dashcore", rev = "93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" } -key-wallet-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" } -key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" } -dash-network = { git = "https://github.com/dashpay/rust-dashcore", rev = "93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" } -dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "93260bf39bac5d9d09e89bfb45e9ea3ff7fdcbcd" } +bincode = { package = "grovedb-bincode", version = "=2.1.0" } +dashcore = { git = "https://github.com/dashpay/rust-dashcore", rev = "057e79cd3e1eeb29676288e9aab76b867d8e707f" } +dash-network-seeds = { git = "https://github.com/dashpay/rust-dashcore", rev = "057e79cd3e1eeb29676288e9aab76b867d8e707f" } +dash-spv = { git = "https://github.com/dashpay/rust-dashcore", rev = "057e79cd3e1eeb29676288e9aab76b867d8e707f" } +key-wallet = { git = "https://github.com/dashpay/rust-dashcore", rev = "057e79cd3e1eeb29676288e9aab76b867d8e707f" } +key-wallet-ffi = { git = "https://github.com/dashpay/rust-dashcore", rev = "057e79cd3e1eeb29676288e9aab76b867d8e707f" } +key-wallet-manager = { git = "https://github.com/dashpay/rust-dashcore", rev = "057e79cd3e1eeb29676288e9aab76b867d8e707f" } +dash-network = { git = "https://github.com/dashpay/rust-dashcore", rev = "057e79cd3e1eeb29676288e9aab76b867d8e707f" } +dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", rev = "057e79cd3e1eeb29676288e9aab76b867d8e707f" } tokio-metrics = "0.5" # Size-tuned profile for the iOS `rs-unified-sdk-ffi` staticlib, which diff --git a/packages/rs-dpp/Cargo.toml b/packages/rs-dpp/Cargo.toml index a0f6f0b6889..24b587524dd 100644 --- a/packages/rs-dpp/Cargo.toml +++ b/packages/rs-dpp/Cargo.toml @@ -47,7 +47,7 @@ jsonschema = { git = "https://github.com/dashpay/jsonschema-rs", branch = "confi ], optional = true } lazy_static = { version = "1.4" } num_enum = "0.7" -bincode = { version = "=2.0.1", features = ["serde"] } +bincode = { workspace = true, features = ["serde"] } rand = { version = "0.8.5", features = ["small_rng"] } regex = { version = "1.10.4" } serde = { version = "1.0.219", features = ["derive"] } @@ -71,7 +71,7 @@ strum = { version = "0.26", features = ["derive"] } json-schema-compatibility-validator = { path = '../rs-json-schema-compatibility-validator', optional = true } once_cell = "1.19.0" tracing = { version = "0.1.41" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6", optional = true } [dev-dependencies] tokio = { version = "1.40", features = ["full"] } diff --git a/packages/rs-drive-abci/Cargo.toml b/packages/rs-drive-abci/Cargo.toml index 843fb9caee3..53b072580c8 100644 --- a/packages/rs-drive-abci/Cargo.toml +++ b/packages/rs-drive-abci/Cargo.toml @@ -14,7 +14,7 @@ license = "MIT" [dependencies] arc-swap = "1.7.0" -bincode = { version = "=2.0.1", features = ["serde"] } +bincode = { workspace = true, features = ["serde"] } ciborium = { version = "0.2.2" } chrono = "0.4.35" serde = { version = "1.0.219", features = ["derive"] } @@ -82,11 +82,11 @@ derive_more = { version = "1.0", features = ["from", "deref", "deref_mut"] } async-trait = "0.1.77" console-subscriber = { version = "0.4", optional = true } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f", optional = true } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6" } nonempty = "0.11" # Shielded-pool snapshot needs raw RocksDB SstFileWriter + ingest_external_file_cf # bindings, and blake3 for the snapshot-file checksum. -rocksdb = { git = "https://github.com/QuantumExplorer/rust-rocksdb.git", rev = "52772eea7bcd214d1d07d80aa538b1d24e5015b7" } +rocksdb = "0.25.0" blake3 = "1.5" [dev-dependencies] @@ -108,7 +108,7 @@ dpp = { path = "../rs-dpp", default-features = false, features = [ drive = { path = "../rs-drive", features = ["fixtures-and-mocks"] } drive-proof-verifier = { path = "../rs-drive-proof-verifier" } strategy-tests = { path = "../strategy-tests" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e", features = ["client"] } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6", features = ["client"] } assert_matches = "1.5.0" drive-abci = { path = ".", features = ["testing-config", "mocks", "shielded_test_data"] } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f" } @@ -117,13 +117,13 @@ dash-platform-macros = { path = "../rs-dash-platform-macros" } libc = "0.2" # For tests of grovedb verify -rocksdb = { git = "https://github.com/QuantumExplorer/rust-rocksdb.git", rev = "52772eea7bcd214d1d07d80aa538b1d24e5015b7" } +rocksdb = "0.25.0" integer-encoding = { version = "4.0.0" } # For dump_only_default_and_aux_cfs_under_shielded_subtree_prefix — same # subtree-prefix algorithm grovedb uses internally. -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6" } [features] default = ["bls-signatures"] diff --git a/packages/rs-drive-proof-verifier/Cargo.toml b/packages/rs-drive-proof-verifier/Cargo.toml index d0246c9a8eb..fe5705e4b1f 100644 --- a/packages/rs-drive-proof-verifier/Cargo.toml +++ b/packages/rs-drive-proof-verifier/Cargo.toml @@ -31,7 +31,7 @@ dpp = { path = "../rs-dpp", features = [ dash-context-provider = { path = "../rs-context-provider", features = [ "mocks", ] } -bincode = { version = "=2.0.1", features = ["serde"] } +bincode = { workspace = true, features = ["serde"] } platform-serialization-derive = { path = "../rs-platform-serialization-derive", optional = true } platform-serialization = { path = "../rs-platform-serialization" } tenderdash-abci = { git = "https://github.com/dashpay/rs-tenderdash-abci", tag = "v1.5.1", features = [ diff --git a/packages/rs-drive/Cargo.toml b/packages/rs-drive/Cargo.toml index fcbb004cc3d..6c60c2559e7 100644 --- a/packages/rs-drive/Cargo.toml +++ b/packages/rs-drive/Cargo.toml @@ -14,7 +14,7 @@ license = "MIT" resolver = "2" [dependencies] -bincode = { version = "=2.0.1", features = ["serde"] } +bincode = { workspace = true, features = ["serde"] } platform-version = { path = "../rs-platform-version" } # used to convert integers to bytes, needed in verifier integer-encoding = { version = "4.0.0" } @@ -52,13 +52,13 @@ enum-map = { version = "2.0.3", optional = true } intmap = { version = "3.0.1", features = ["serde"], optional = true } chrono = { version = "0.4.35", optional = true } itertools = { version = "0.13", optional = true } -grovedb = { git = "https://github.com/dashpay/grovedb", rev = "6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e", optional = true, default-features = false } -grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e", optional = true } -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" } -grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e", optional = true } -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" } -grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" } +grovedb = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6", optional = true, default-features = false } +grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6", optional = true } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6" } +grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6", optional = true } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6" } +grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6" } [dev-dependencies] criterion = "0.5" diff --git a/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs index a1b7680314f..545bf40c4e1 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs @@ -23,6 +23,7 @@ impl Drive { drive_version: &DriveVersion, ) -> Result<(), Error> { let options = DeleteOptions { + propagate_backward_references: false, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs index 01952b937a0..9b90ccb60cd 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs @@ -80,6 +80,7 @@ impl Drive { let current_batch_operations = LowLevelDriveOperation::grovedb_operations_batch(drive_operations); let options = DeleteOptions { + propagate_backward_references: false, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs index 3b4c7025471..fe0611c239f 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs @@ -60,6 +60,7 @@ impl Drive { // ── 2. Build the delete op ────────────────────────────────────────── let current_batch = LowLevelDriveOperation::grovedb_operations_batch(drive_operations); let delete_opts = DeleteOptions { + propagate_backward_references: false, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs index b65b3ccb69e..b8d88730cdc 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs @@ -86,6 +86,7 @@ impl Drive { let current_batch_operations = LowLevelDriveOperation::grovedb_operations_batch(drive_operations); let options = DeleteOptions { + propagate_backward_references: false, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs index 9da64b2262c..6ad8f69a6d8 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs @@ -29,6 +29,7 @@ impl Drive { let mut current_batch_operations = LowLevelDriveOperation::grovedb_operations_batch(drive_operations); let options = DeleteOptions { + propagate_backward_references: false, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs index e44000512d7..2d1b08a6c3a 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs @@ -63,6 +63,7 @@ impl Drive { let cost_context = self.grove.apply_batch_with_element_flags_update( ops.operations, Some(BatchApplyOptions { + propagate_backward_references: false, validate_insertion_does_not_override: validate, validate_insertion_does_not_override_tree: validate, disable_operation_consistency_check: !self.config.batching_consistency_verification, diff --git a/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs index a736817ab8d..f1e87a64598 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs @@ -48,6 +48,7 @@ impl Drive { let cost_context = self.grove.apply_partial_batch_with_element_flags_update( ops.operations, Some(BatchApplyOptions { + propagate_backward_references: false, validate_insertion_does_not_override: validate, validate_insertion_does_not_override_tree: validate, disable_operation_consistency_check: false, diff --git a/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs index 77d8d247a5c..3d8573a61b2 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs @@ -24,6 +24,7 @@ impl Drive { AverageCaseCostsType(estimated_layer_info), ops.operations, Some(BatchApplyOptions { + propagate_backward_references: false, validate_insertion_does_not_override: validate, validate_insertion_does_not_override_tree: validate, disable_operation_consistency_check: false, diff --git a/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs index d5e0c2ab1e2..c34356d26de 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs @@ -18,6 +18,7 @@ impl Drive { drive_version: &DriveVersion, ) -> Result<(), Error> { let options = DeleteOptions { + propagate_backward_references: false, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/verify/system/verify_elements/v0/mod.rs b/packages/rs-drive/src/verify/system/verify_elements/v0/mod.rs index c03c15b4176..46dba77a198 100644 --- a/packages/rs-drive/src/verify/system/verify_elements/v0/mod.rs +++ b/packages/rs-drive/src/verify/system/verify_elements/v0/mod.rs @@ -37,7 +37,9 @@ impl Drive { keys: Vec>, platform_version: &PlatformVersion, ) -> Result<(RootHash, BTreeMap, Option>), Error> { - let mut query = Query::new(); + // Match prove_elements_v0: Query::default() emits a right-to-left proof. + // GroveDB verifies that the proof operation family matches this direction. + let mut query = Query::new_with_direction(false); query.insert_keys(keys); let path_query = PathQuery::new(path, SizedQuery::new(query, None, None)); diff --git a/packages/rs-platform-serialization/Cargo.toml b/packages/rs-platform-serialization/Cargo.toml index 7f83bc4226e..d55316ffc6e 100644 --- a/packages/rs-platform-serialization/Cargo.toml +++ b/packages/rs-platform-serialization/Cargo.toml @@ -8,5 +8,5 @@ rust-version.workspace = true license = "MIT" [dependencies] -bincode = { version = "=2.0.1", features = ["serde"] } +bincode = { workspace = true, features = ["serde"] } platform-version = { path = "../rs-platform-version" } diff --git a/packages/rs-platform-value/Cargo.toml b/packages/rs-platform-value/Cargo.toml index fda79d9f595..73cfd8fb8a9 100644 --- a/packages/rs-platform-value/Cargo.toml +++ b/packages/rs-platform-value/Cargo.toml @@ -8,7 +8,7 @@ rust-version.workspace = true license = "MIT" [dependencies] -bincode = { version = "=2.0.1", features = ["serde"] } +bincode = { workspace = true, features = ["serde"] } ciborium = { version = "0.2.2", optional = true } thiserror = "2.0.12" bs58 = "0.5.1" diff --git a/packages/rs-platform-version/Cargo.toml b/packages/rs-platform-version/Cargo.toml index 363b9490c19..6ccfd107121 100644 --- a/packages/rs-platform-version/Cargo.toml +++ b/packages/rs-platform-version/Cargo.toml @@ -9,9 +9,9 @@ license = "MIT" [dependencies] thiserror = { version = "2.0.12" } -bincode = { version = "=2.0.1" } +bincode = { workspace = true } versioned-feature-core = "1.0.0" -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e" } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6" } [features] mock-versions = [] diff --git a/packages/rs-platform-wallet-ffi/Cargo.toml b/packages/rs-platform-wallet-ffi/Cargo.toml index 9b8f9d279b1..83cd3fbb4cd 100644 --- a/packages/rs-platform-wallet-ffi/Cargo.toml +++ b/packages/rs-platform-wallet-ffi/Cargo.toml @@ -36,7 +36,7 @@ async-trait = "0.1" # Bincode used to serialize RootExtendedPubKey / ExtendedPubKey across # FFI for watch-only restore. Same version pinned elsewhere in workspace. -bincode = { version = "=2.0.1" } +bincode = { workspace = true } # Hex used for error diagnostics that include a wallet_id. hex = "0.4" diff --git a/packages/rs-platform-wallet-storage/Cargo.toml b/packages/rs-platform-wallet-storage/Cargo.toml index 5d9fc31c24a..cd72b96ad7b 100644 --- a/packages/rs-platform-wallet-storage/Cargo.toml +++ b/packages/rs-platform-wallet-storage/Cargo.toml @@ -55,7 +55,7 @@ refinery = { version = "0.9", default-features = false, features = [ # (which derives bincode 2 `Encode`/`Decode`) and decode # `dpp::AssetLockProof` from the asset-lock blob column. Exact-pinned to # the lock-resolved version to match the crate's `=`-pin discipline. -bincode = { version = "=2.0.1", optional = true } +bincode = { workspace = true, optional = true } tempfile = { version = "3", optional = true } chrono = { version = "0.4", default-features = false, features = [ "clock", diff --git a/packages/rs-platform-wallet/Cargo.toml b/packages/rs-platform-wallet/Cargo.toml index f71439ea73d..68fc1d68fa7 100644 --- a/packages/rs-platform-wallet/Cargo.toml +++ b/packages/rs-platform-wallet/Cargo.toml @@ -61,7 +61,7 @@ zeroize = "1" log = "0.4" # Shielded pool (optional, behind `shielded` feature) -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6", optional = true } # Direct `rusqlite` access so `FileBackedShieldedStore::open_path` can set # WAL + synchronous=NORMAL pragmas before handing the connection to # `ClientPersistentCommitmentTree`. Version locked to match the rev grovedb diff --git a/packages/rs-sdk-ffi/Cargo.toml b/packages/rs-sdk-ffi/Cargo.toml index e603e523b9d..a25212abc97 100644 --- a/packages/rs-sdk-ffi/Cargo.toml +++ b/packages/rs-sdk-ffi/Cargo.toml @@ -47,7 +47,7 @@ dash-network = { workspace = true, features = ["ffi"] } # FFI and serialization serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -bincode = { version = "=2.0.1", features = ["serde"] } +bincode = { workspace = true, features = ["serde"] } # Async runtime tokio = { version = "1.41", features = ["rt-multi-thread", "macros", "sync", "time"] } diff --git a/packages/rs-sdk-ffi/src/system/queries/path_elements.rs b/packages/rs-sdk-ffi/src/system/queries/path_elements.rs index 96466024445..93eaa248b66 100644 --- a/packages/rs-sdk-ffi/src/system/queries/path_elements.rs +++ b/packages/rs-sdk-ffi/src/system/queries/path_elements.rs @@ -156,19 +156,29 @@ fn get_path_elements( /// `NonCounted` and `NotSummed` are transparent wrappers around another /// element; we render them as `non_counted()` / `not_summed()` /// so that the wrapped element's value is still visible to the caller. +/// Backward-reference metadata does not change the rendered payload; the +/// `type` field identifies the variants that support it. fn format_element_data(element: &Element) -> String { match element { - Element::Item(data, _) => hex::encode(data), + Element::Item(data, _) | Element::ItemWithBackwardsReferences(data, _, _) => { + hex::encode(data) + } Element::Reference(reference, _, _) => format!("{:?}", reference), + Element::BidirectionalReference(reference, _) => { + format!("{:?}", reference.forward_reference_path) + } Element::Tree(_, _) => "tree".to_string(), Element::SumTree(_, _, _) => "sum_tree".to_string(), - Element::SumItem(value, _) => format!("sum_item:{}", value), + Element::SumItem(value, _) | Element::SumItemWithBackwardsReferences(value, _, _) => { + format!("sum_item:{}", value) + } Element::BigSumTree(_, value, _) => format!("big_sum_tree:{}", value), Element::CountTree(_, count, _) => format!("count_tree:{}", count), Element::CountSumTree(_, count, sum, _) => { format!("count_sum_tree:{}:{}", count, sum) } - Element::ItemWithSumItem(data, sum, _) => { + Element::ItemWithSumItem(data, sum, _) + | Element::ItemWithSumItemWithBackwardsReferences(data, sum, _, _) => { format!("item_with_sum_item:{}:{}", hex::encode(data), sum) } Element::ReferenceWithSumItem(reference, _, sum, _) => { @@ -218,6 +228,16 @@ fn format_element_type(element: &Element) -> String { match element { Element::Item(_, _) => "item".to_string(), Element::Reference(_, _, _) => "reference".to_string(), + Element::BidirectionalReference(_, _) => "bidirectional_reference".to_string(), + Element::ItemWithBackwardsReferences(_, _, _) => { + "item_with_backwards_references".to_string() + } + Element::SumItemWithBackwardsReferences(_, _, _) => { + "sum_item_with_backwards_references".to_string() + } + Element::ItemWithSumItemWithBackwardsReferences(_, _, _, _) => { + "item_with_sum_item_with_backwards_references".to_string() + } Element::Tree(_, _) => "tree".to_string(), Element::SumTree(_, _, _) => "sum_tree".to_string(), Element::SumItem(_, _) => "sum_item".to_string(), @@ -257,6 +277,49 @@ fn format_element_type(element: &Element) -> String { mod tests { use super::*; use crate::test_utils::test_utils::create_mock_sdk_handle; + use dash_sdk::drive::grovedb::element::reference_path::ReferencePathType; + + #[test] + fn should_preserve_payload_rendering_for_backward_reference_variants() { + let path = ReferencePathType::SiblingReference(b"target".to_vec()); + let cases = [ + ( + Element::new_bidirectional_reference_with_options( + path.clone(), + Some(4), + true, + None, + ), + Element::Reference(path, Some(4), None), + "bidirectional_reference", + ), + ( + Element::ItemWithBackwardsReferences(vec![0, 255], Default::default(), None), + Element::Item(vec![0, 255], None), + "item_with_backwards_references", + ), + ( + Element::SumItemWithBackwardsReferences(-42, Default::default(), None), + Element::SumItem(-42, None), + "sum_item_with_backwards_references", + ), + ( + Element::ItemWithSumItemWithBackwardsReferences( + vec![0, 255], + -42, + Default::default(), + None, + ), + Element::ItemWithSumItem(vec![0, 255], -42, None), + "item_with_sum_item_with_backwards_references", + ), + ]; + + for (element, base, expected_type) in cases { + assert_eq!(format_element_data(&element), format_element_data(&base)); + assert_eq!(format_element_type(&element), expected_type); + } + } #[test] fn test_get_path_elements_null_handle() { diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index 3a142158e1b..b7a246aedb5 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -18,7 +18,7 @@ drive = { path = "../rs-drive", default-features = false, features = [ ] } drive-proof-verifier = { path = "../rs-drive-proof-verifier", default-features = false } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "6fc7e1e82de27a56c3428c0d5dd15b5f6a0ea23e", features = [ +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6", features = [ "client", "sqlite", ], optional = true } diff --git a/packages/simple-signer/Cargo.toml b/packages/simple-signer/Cargo.toml index b95f827d797..089fae064ff 100644 --- a/packages/simple-signer/Cargo.toml +++ b/packages/simple-signer/Cargo.toml @@ -20,7 +20,7 @@ dpp = { path = "../rs-dpp", default-features = false, features = [ "ed25519-dalek", ] } async-trait = { version = "0.1.79" } -bincode = { version = "=2.0.1", features = ["serde"] } +bincode = { workspace = true, features = ["serde"] } base64 = { version = "0.22.1" } hex = { version = "0.4.3" } tracing = "0.1.41" diff --git a/packages/strategy-tests/Cargo.toml b/packages/strategy-tests/Cargo.toml index 5e7b2b71a1b..06a052a4f10 100644 --- a/packages/strategy-tests/Cargo.toml +++ b/packages/strategy-tests/Cargo.toml @@ -12,7 +12,7 @@ license = "MIT" [dependencies] tracing = "0.1.41" -bincode = { version = "=2.0.1", features = ["serde"] } +bincode = { workspace = true, features = ["serde"] } drive = { path = "../rs-drive", default-features = false, features = [ "verify", ] } diff --git a/packages/wasm-dpp/Cargo.toml b/packages/wasm-dpp/Cargo.toml index 859c8474525..23864d7e170 100644 --- a/packages/wasm-dpp/Cargo.toml +++ b/packages/wasm-dpp/Cargo.toml @@ -48,7 +48,7 @@ anyhow = { version = "1.0.75" } # required, cargo-machete false positive wasm-bindgen-futures = "0.4.58" async-trait = "0.1.59" -bincode = { version = "=2.0.1" } +bincode = { workspace = true } [package.metadata.cargo-machete] ignored = ["wasm-bindgen-futures"] diff --git a/packages/wasm-dpp2/Cargo.toml b/packages/wasm-dpp2/Cargo.toml index 7af47f47f09..b8ef276100b 100644 --- a/packages/wasm-dpp2/Cargo.toml +++ b/packages/wasm-dpp2/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["cdylib", "lib"] # TODO: Consider to use talc allocator #talc = { version = "=4.4.2", default-features = false, features = ["lock_api"] } async-trait = { version = "0.1.79" } -bincode = "=2.0.1" +bincode = { workspace = true } wasm-bindgen = { version = "=0.2.108", default-features = false, features = [ "serde-serialize", ] } diff --git a/packages/wasm-drive-verify/Cargo.toml b/packages/wasm-drive-verify/Cargo.toml index 9868a27466b..ae145a41b8f 100644 --- a/packages/wasm-drive-verify/Cargo.toml +++ b/packages/wasm-drive-verify/Cargo.toml @@ -20,7 +20,7 @@ dpp = { path = "../rs-dpp", default-features = false, features = [ "platform-value-json", ] } -bincode = { version = "=2.0.1" } +bincode = { workspace = true } wasm-bindgen = { version = "=0.2.108" } serde = { version = "1.0.193", default-features = false, features = [ "alloc", diff --git a/packages/wasm-sdk/src/queries/system.rs b/packages/wasm-sdk/src/queries/system.rs index 1051361908f..0f068698282 100644 --- a/packages/wasm-sdk/src/queries/system.rs +++ b/packages/wasm-sdk/src/queries/system.rs @@ -29,6 +29,10 @@ export type GroveElementType = | "provableCountTree" | "itemWithSumItem" | "referenceWithSumItem" + | "bidirectionalReference" + | "itemWithBackwardsReferences" + | "sumItemWithBackwardsReferences" + | "itemWithSumItemWithBackwardsReferences" | "provableCountSumTree" | "provableCountProvableSumTree" | "provableSumTree" @@ -857,8 +861,10 @@ fn set_js_property(object: &Object, property: &str, value: &JsValue) -> Result<( fn element_value_bytes(element: &Element) -> Option> { match element { - Element::Item(bytes, _) => Some(bytes.clone()), - Element::ItemWithSumItem(bytes, _, _) => Some(bytes.clone()), + Element::Item(bytes, _) + | Element::ItemWithBackwardsReferences(bytes, _, _) + | Element::ItemWithSumItem(bytes, _, _) + | Element::ItemWithSumItemWithBackwardsReferences(bytes, _, _, _) => Some(bytes.clone()), Element::NonCounted(inner) | Element::NotSummed(inner) | Element::NotCountedOrSummed(inner) => element_value_bytes(inner), @@ -868,7 +874,9 @@ fn element_value_bytes(element: &Element) -> Option> { fn element_sum(element: &Element) -> Option { match element { - Element::SumItem(sum, _) => Some(*sum as i128), + Element::SumItem(sum, _) + | Element::SumItemWithBackwardsReferences(sum, _, _) + | Element::ItemWithSumItemWithBackwardsReferences(_, sum, _, _) => Some(*sum as i128), Element::SumTree(_, sum, _) => Some(*sum as i128), Element::BigSumTree(_, sum, _) => Some(*sum), Element::CountSumTree(_, _, sum, _) => Some(*sum as i128), @@ -901,16 +909,21 @@ fn element_reference_target( ) -> (Option>>, Option) { match element { Element::Reference(reference_path, _, _) - | Element::ReferenceWithSumItem(reference_path, _, _, _) => { - match path_from_reference_path_type(reference_path.clone(), parent_path, Some(key)) { - Ok(target) => (Some(target), None), - Err(error) => { - let message = error.to_string(); - tracing::warn!("failed to resolve GroveDB reference target: {}", message); - (None, Some(message)) - } + | Element::ReferenceWithSumItem(reference_path, _, _, _) + | Element::BidirectionalReference( + dash_sdk::drive::grovedb::element::BidirectionalReference { + forward_reference_path: reference_path, + .. + }, + _, + ) => match path_from_reference_path_type(reference_path.clone(), parent_path, Some(key)) { + Ok(target) => (Some(target), None), + Err(error) => { + let message = error.to_string(); + tracing::warn!("failed to resolve GroveDB reference target: {}", message); + (None, Some(message)) } - } + }, Element::NonCounted(inner) | Element::NotSummed(inner) | Element::NotCountedOrSummed(inner) => element_reference_target(inner, parent_path, key), @@ -920,6 +933,12 @@ fn element_reference_target( fn element_type_name(element: &Element) -> &'static str { match element { + Element::BidirectionalReference(_, _) => "bidirectionalReference", + Element::ItemWithBackwardsReferences(_, _, _) => "itemWithBackwardsReferences", + Element::SumItemWithBackwardsReferences(_, _, _) => "sumItemWithBackwardsReferences", + Element::ItemWithSumItemWithBackwardsReferences(_, _, _, _) => { + "itemWithSumItemWithBackwardsReferences" + } Element::Item(_, _) => "item", Element::Reference(_, _, _) => "reference", Element::Tree(_, _) => "tree", @@ -953,6 +972,11 @@ fn element_type_name(element: &Element) -> &'static str { fn non_counted_element_type_name(element: &Element) -> &'static str { match element { + // GroveDB rejects aggregation wrappers around these variants. + Element::BidirectionalReference(_, _) + | Element::ItemWithBackwardsReferences(_, _, _) + | Element::SumItemWithBackwardsReferences(_, _, _) + | Element::ItemWithSumItemWithBackwardsReferences(_, _, _, _) => element_type_name(element), Element::Item(_, _) => "nonCountedItem", Element::Reference(_, _, _) => "nonCountedReference", Element::Tree(_, _) => "nonCountedTree", @@ -1734,6 +1758,35 @@ mod tests { use super::*; use dash_sdk::drive::grovedb::element::reference_path::ReferencePathType; + #[test] + fn should_render_bidirectional_elements_without_losing_payloads() { + let item = Element::new_item_allowing_bidirectional_references(vec![1, 2]); + let sum = Element::new_sum_item_allowing_bidirectional_references(-3); + let combined = + Element::new_item_with_sum_item_allowing_bidirectional_references(vec![4, 5], 6); + let reference = Element::new_bidirectional_reference(ReferencePathType::SiblingReference( + b"target".to_vec(), + )); + let union = typescript_element_type_union(); + for (element, name) in [ + (&item, "itemWithBackwardsReferences"), + (&sum, "sumItemWithBackwardsReferences"), + (&combined, "itemWithSumItemWithBackwardsReferences"), + (&reference, "bidirectionalReference"), + ] { + assert_eq!(element_type_name(element), name); + assert!(union.contains(&format!("\"{name}\""))); + } + assert_eq!(element_value_bytes(&item), Some(vec![1, 2])); + assert_eq!(element_sum(&sum), Some(-3)); + assert_eq!(element_value_bytes(&combined), Some(vec![4, 5])); + assert_eq!(element_sum(&combined), Some(6)); + assert_eq!( + element_reference_target(&reference, &[b"parent".to_vec()], b"source"), + (Some(vec![b"parent".to_vec(), b"target".to_vec()]), None), + ); + } + #[test] fn should_decode_raw_bytes_without_utf8_expansion() { let input = [0x80, 0xff]; From 89b9b9271351547e46fc848a82dfc81e427e9929 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Wed, 9 Sep 2026 06:21:48 +0700 Subject: [PATCH 02/20] build(docker): build rocksdb 11.8.1 for the prebuilt static library librocksdb-sys 0.19.0+11.8.1 (pulled in by rocksdb 0.25) targets the RocksDB 11 C API, which dropped the deprecated in_range callback from rocksdb_slicetransform_create. The Docker image and the librocksdb GitHub action still built RocksDB 10.4.2 and 9.9.3, so bindgen produced the six-argument signature and the rocksdb crate failed to compile against it. Build 11.8.1 in both places to match the vendored version. Co-Authored-By: Claude Fable 5.1 --- .github/actions/librocksdb/action.yaml | 4 ++-- Dockerfile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/librocksdb/action.yaml b/.github/actions/librocksdb/action.yaml index 5411bbc9859..8bb32f9fae1 100644 --- a/.github/actions/librocksdb/action.yaml +++ b/.github/actions/librocksdb/action.yaml @@ -6,9 +6,9 @@ name: "librocksdb" description: "Build and install librocksdb" inputs: version: - description: RocksDB version, eg. "9.9.3" + description: RocksDB version, eg. "11.8.1" required: false - default: "9.9.3" + default: "11.8.1" force: description: Force rebuild required: false diff --git a/Dockerfile b/Dockerfile index 846150203f7..13a762334ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -306,7 +306,7 @@ ONBUILD ARG CARGO_BUILD_PROFILE=dev RUN --mount=type=secret,id=AWS < Date: Wed, 9 Sep 2026 06:21:48 +0700 Subject: [PATCH 03/20] fix(drive): verify a page's cursor document in the page's walk direction GroveDB now refuses a V1 layer proof that is read in the other op family (grovedb #863): a layer proof is emitted entirely in the family of the direction its query walks. When a document query carries a startAt or startAfter cursor, the prover merges the one-key cursor lookup into the page proof, and since grovedb's merge needs every input to walk the same way, the cursor layer is emitted in the page's orderBy direction. The verifier rebuilt that lookup as a fresh ascending single-key query, so every proved descending page with a cursor failed with InvalidProof. Read the cursor layer in the page's direction when it is verified as a subset of the page proof. The direction comes from the same query builder the prover uses and never depends on the cursor document; a single key decodes identically either way. Co-Authored-By: Claude Fable 5.1 --- .../verify_start_at_document_in_proof/v0/mod.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/rs-drive/src/verify/document/verify_start_at_document_in_proof/v0/mod.rs b/packages/rs-drive/src/verify/document/verify_start_at_document_in_proof/v0/mod.rs index 301afe65148..d22ff197018 100644 --- a/packages/rs-drive/src/verify/document/verify_start_at_document_in_proof/v0/mod.rs +++ b/packages/rs-drive/src/verify/document/verify_start_at_document_in_proof/v0/mod.rs @@ -43,10 +43,25 @@ impl DriveDocumentQuery<'_> { self.validate_in_clause_shape(platform_version)?; let (start_at_document_path, start_at_document_key) = self.start_at_document_path_and_key(&document_id); - let path_query = PathQuery::new_single_key( + let mut path_query = PathQuery::new_single_key( start_at_document_path.clone(), start_at_document_key.clone(), ); + if is_proof_subset { + // Inside a page proof this one-key lookup is merged with the main + // query, and grovedb's merge needs every input to walk the same + // way, so the prover emits the cursor layer in the page's + // `orderBy` direction (see `construct_path_query_operations`). + // A V1 layer proof only verifies in the op family of the + // direction it is read in, so read it the same way here. A single + // key decodes identically either way; this only selects the op + // family, and the direction never depends on the cursor document. + path_query.query.query.left_to_right = self + .construct_path_query(None, platform_version)? + .query + .query + .left_to_right; + } let (root_hash, mut proved_key_values) = if is_proof_subset { GroveDb::verify_subset_query(proof, &path_query, &platform_version.drive.grove_version)? } else { From c1de4a57ce73a4ada6903c9cd8f674b51a5c2fc7 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Wed, 9 Sep 2026 06:21:48 +0700 Subject: [PATCH 04/20] test(drive-abci): verify contestant vote proofs with the requested order and cursor The proved contestant-votes helper verified every proof with a fixed ascending, unlimited query regardless of the request it had just sent. GroveDB now refuses a layer proof read in the other op family, so the descending request failed with InvalidProof. Mirror the request's order, count and cursor into the verifier query, as the SDK's proof verifier does. Co-Authored-By: Claude Fable 5.1 --- .../state_transitions/masternode_vote/mod.rs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs index 3707d37c101..2cb3852135d 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs @@ -3007,6 +3007,19 @@ mod tests { let index_name = "parentNameAndLabel".to_string(); + // The verifier has to walk the proof the way the request asked + // for it, as the SDK's proof verifier does when it mirrors the + // request: grovedb refuses a layer proof read in the other + // direction. + let verifier_start_at = start_at_identifier_info.as_ref().map(|info| { + let start_identifier: [u8; 32] = info + .start_identifier + .clone() + .try_into() + .expect("expected a 32 byte start identifier"); + (start_identifier, info.start_identifier_included) + }); + let query_validation_result = platform .query_contested_resource_voters_for_identity( GetContestedResourceVotersForIdentityRequest { @@ -3063,9 +3076,9 @@ mod tests { }, contestant_id: contender_id, offset: None, - limit: None, - start_at: None, - order_ascending: true, + limit: count.map(|count| count as u16), + start_at: verifier_start_at, + order_ascending, }; let (_, voters) = resolved_contested_document_vote_poll_drive_query From 6b18e24f2959b7354dc32bdc9bee6ac8ce55c93c Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Wed, 9 Sep 2026 06:21:48 +0700 Subject: [PATCH 05/20] style(drive-abci): format the keep-history delete replay test cargo fmt --check fails on v4.2-dev since #4218 landed this test unformatted. Co-Authored-By: Claude Fable 5.1 --- .../state_transitions/batch/tests/document/deletion.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs index 0c47b893b05..27bcd8a748b 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs @@ -406,8 +406,10 @@ mod deletion_tests { } #[tokio::test] - async fn test_document_delete_on_document_type_that_keeps_history_replays_protocol_version_13() { - run_document_delete_on_document_type_that_keeps_history_at_protocol_version(13, false).await; + async fn test_document_delete_on_document_type_that_keeps_history_replays_protocol_version_13() + { + run_document_delete_on_document_type_that_keeps_history_at_protocol_version(13, false) + .await; } /// Exercises an already-deployed contradictory contract at both sides of From 38eca5808e30e3721044cfe254fcecc46b788990 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Wed, 9 Sep 2026 23:37:59 +0700 Subject: [PATCH 06/20] fix(drive): keep a $id page's direction and limit when the cursor merges onto its own layer A startAt/startAfter page proof merges the one-key cursor lookup with the page query. For an index-ordered page the two live under different subtrees, so the merge synthesizes a root above both and that root is walked ascending so the cursor branch spends its reserved limit + 1 slot first; the verifier never sees that root. A $id-ordered page addresses the primary-key tree directly (a history-keeping type's cursor sits one level below it), so the merge point is the page query's own root layer. Flipping that layer ascending contradicts the descending direction the verifier reads it in, and the reserved slot makes an inclusive page return limit + 1 rows matching the page query. GroveDB 6 rejects both: "inverted op in a left-to-right walk" and "Proof returns more data than limit". When the merge lands on the page query's own layer, keep the requested direction, and reserve the extra slot only when the page's items do not already cover the cursor key. Round-trip tests page the family contract by $id in both directions with inclusive and exclusive cursors, for plain and history-keeping document types, verifying every page's proof. Co-Authored-By: Claude Fable 5.1 --- packages/rs-drive/src/query/mod.rs | 84 +++++++++++++---- packages/rs-drive/tests/query_tests.rs | 91 ++++++++++++++++++ .../rs-drive/tests/query_tests_history.rs | 92 +++++++++++++++++++ 3 files changed, 250 insertions(+), 17 deletions(-) diff --git a/packages/rs-drive/src/query/mod.rs b/packages/rs-drive/src/query/mod.rs index 27c23346f06..a5f8662d2c2 100644 --- a/packages/rs-drive/src/query/mod.rs +++ b/packages/rs-drive/src/query/mod.rs @@ -2042,23 +2042,73 @@ impl<'a> DriveDocumentQuery<'a> { &platform_version.drive.grove_version, ) .map_err(Error::from)?; - merged.query.limit = limit.map(|a| a.saturating_add(1)); - // The merged root must be walked ascending regardless of the - // page's `orderBy` direction: the `limit + 1` above reserves - // one result slot for the cursor document, and the prover - // spends the budget in root traversal order. Ascending, the - // cursor branch (key `[0]`) is visited first and takes its - // reserved slot; descending, the index branch sorts first, - // consumes the whole budget mid-timeline, and the prover then - // omits the cursor subtree's lower layer — an unverifiable - // proof (the verifier extracts the cursor document from the - // proof before rebuilding the main query). Only this - // synthesized root flips: each input's own query lands intact - // inside a subquery branch, keeping in-branch result order. - // The verifier never rebuilds the merged query — it runs the - // cursor and main queries as separate subset queries — so the - // root's direction is not client-visible. - merged.query.query.left_to_right = true; + // Where the merge lands decides how the two queries combine. An + // index-ordered page lives under its index tree while the cursor + // lookup lives under the primary-key tree, so the merge synthesizes + // a root one level above both with each query in its own branch. + // A `$id`-ordered page addresses the primary-key tree directly: the + // cursor lookup shares that path (or, for a history-keeping type, + // sits one level below it), so the merge point is the page query's + // own root layer and the merged query IS that layer. + let cursor_on_page_layer = merged.path == main_path_query.path; + // The cursor's key on that shared layer: the cursor query's own key + // when both paths coincide, otherwise the path component the cursor + // query descends through. + let cursor_key_on_page_layer: Option<&[u8]> = if !cursor_on_page_layer { + None + } else if let Some(component) = start_at_path_query.path.get(merged.path.len()) { + Some(component.as_slice()) + } else { + match start_at_path_query.query.query.items.as_slice() { + [QueryItem::Key(cursor_key)] => Some(cursor_key.as_slice()), + _ => None, + } + }; + // On a shared layer the cursor row is already one of the page's + // rows whenever the page's own items cover it (an inclusive + // `startAt` on a range, or an `in` list that names the cursor). It + // then needs no reserved slot: reserving one would make the layer + // return `limit + 1` rows matching the page query, which the + // verifier rejects as more data than its limit. + let cursor_row_in_page = cursor_key_on_page_layer.is_some_and(|cursor_key| { + main_path_query + .query + .query + .items + .iter() + .any(|item| item.contains(cursor_key)) + }); + merged.query.limit = limit.map(|a| { + if cursor_row_in_page { + a + } else { + a.saturating_add(1) + } + }); + if !cursor_on_page_layer { + // A synthesized root must be walked ascending regardless of + // the page's `orderBy` direction: the `limit + 1` above + // reserves one result slot for the cursor document, and the + // prover spends the budget in root traversal order. Ascending, + // the cursor branch (key `[0]`) is visited first and takes its + // reserved slot; descending, the index branch sorts first, + // consumes the whole budget mid-timeline, and the prover then + // omits the cursor subtree's lower layer — an unverifiable + // proof (the verifier extracts the cursor document from the + // proof before rebuilding the main query). Only this + // synthesized root flips: each input's own query lands intact + // inside a subquery branch, keeping in-branch result order. + // The verifier never rebuilds the merged query — it runs the + // cursor and main queries as separate subset queries — so the + // root's direction is not client-visible. + // + // A shared layer has no synthesized root to flip: the merged + // query IS the page query's own layer, which the verifier + // walks in the requested direction, and the cursor row sits at + // the page's boundary, so the requested direction reaches it + // first anyway. + merged.query.query.left_to_right = true; + } Ok(merged) } else { Ok(main_path_query) diff --git a/packages/rs-drive/tests/query_tests.rs b/packages/rs-drive/tests/query_tests.rs index de895e70f2e..59d47298a03 100644 --- a/packages/rs-drive/tests/query_tests.rs +++ b/packages/rs-drive/tests/query_tests.rs @@ -8167,6 +8167,97 @@ mod tests { } #[cfg(all(feature = "server", feature = "verify"))] + #[test] + fn test_proved_primary_key_cursor_pages_in_both_directions() { + // A `$id`-ordered page with a cursor merges the cursor lookup and the + // page query at the same path: the primary-key tree. The merge then has + // no synthesized root above the page query, so the document layer must + // keep the requested direction in the proof; the verifier reads both + // the cursor lookup and the page in that direction, and GroveDB refuses + // a V1 layer proof read in the other op family. + use dpp::document::DocumentV0Getters; + use dpp::prelude::Identifier; + use platform_value::string_encoding::Encoding; + + let platform_version = PlatformVersion::latest(); + let (drive, contract) = setup_family_tests(10, 73509, platform_version); + let person_document_type = contract + .document_type_for_name("person") + .expect("contract should have a person document type"); + let root_hash = drive + .grove + .root_hash(None, &platform_version.drive.grove_version) + .unwrap() + .expect("there is always a root hash"); + + let ids_of = |results: &[Vec]| -> Vec { + results + .iter() + .map(|bytes| { + Document::from_bytes(bytes, person_document_type, platform_version) + .expect("we should be able to deserialize the document") + .id() + }) + .collect() + }; + let build = |query_value: serde_json::Value| { + let cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) + .expect("expected to serialize to cbor"); + DriveDocumentQuery::from_cbor( + cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + platform_version, + ) + .expect("query should be built") + }; + + let (all_results, _, _) = build(json!({ + "limit": 100, + "orderBy": [["$id", "asc"]], + })) + .execute_raw_results_no_proof(&drive, None, None, platform_version) + .expect("query should be executed"); + let ascending_ids = ids_of(&all_results); + assert_eq!(ascending_ids.len(), 10); + + for (ascending, included) in [(true, true), (true, false), (false, true), (false, false)] { + let ordered: Vec = if ascending { + ascending_ids.clone() + } else { + ascending_ids.iter().rev().cloned().collect() + }; + let cursor = ordered[3]; + let expected: Vec = if included { + ordered[3..6].to_vec() + } else { + ordered[4..7].to_vec() + }; + let cursor_key = if included { "startAt" } else { "startAfter" }; + let case = format!( + "orderBy $id {} with {cursor_key}", + if ascending { "asc" } else { "desc" } + ); + + let query = build(json!({ + cursor_key: cursor.to_string(Encoding::Base58), + "limit": 3, + "orderBy": [["$id", if ascending { "asc" } else { "desc" }]], + })); + let (results, _, _) = query + .execute_raw_results_no_proof(&drive, None, None, platform_version) + .expect("query should be executed"); + assert_eq!(ids_of(&results), expected, "{case}: unproved page"); + + let (proof_root_hash, proof_results, _) = query + .execute_with_proof_only_get_elements(&drive, None, None, platform_version) + .unwrap_or_else(|e| panic!("{case}: proved page should verify: {e}")); + assert_eq!(root_hash, proof_root_hash, "{case}: proof root hash"); + assert_eq!(results, proof_results, "{case}: proved page"); + } + } + #[test] fn test_proved_desc_range_continuation_page_includes_cursor_document() { // Issue #4540: a continuation page over a non-unique diff --git a/packages/rs-drive/tests/query_tests_history.rs b/packages/rs-drive/tests/query_tests_history.rs index a92fad69c74..30a7d004f41 100644 --- a/packages/rs-drive/tests/query_tests_history.rs +++ b/packages/rs-drive/tests/query_tests_history.rs @@ -256,6 +256,98 @@ fn test_setup() { setup(10, Some(range_inserts), 73509, platform_version); } +#[cfg(feature = "server")] +#[test] +fn test_proved_primary_key_cursor_pages_over_history_in_both_directions() { + // The history-keeping twin of the primary-key cursor test in + // query_tests.rs. Here the cursor lookup lands one level below the page + // query (`.../0/` with key `[0]`), so the merge point is the page + // query's own root layer: the document-id layer must keep the requested + // direction in the proof and the cursor must not claim a second slot. + use dpp::document::DocumentV0Getters; + use dpp::platform_value::string_encoding::Encoding; + use dpp::prelude::Identifier; + use drive::query::DriveDocumentQuery; + + let platform_version = PlatformVersion::latest(); + let (drive, contract) = setup(10, None, 73509, platform_version); + let person_document_type = contract + .document_type_for_name("person") + .expect("contract should have a person document type"); + let root_hash = drive + .grove + .root_hash(None, &platform_version.drive.grove_version) + .unwrap() + .expect("there is always a root hash"); + + let ids_of = |results: &[Vec]| -> Vec { + results + .iter() + .map(|bytes| { + Document::from_bytes(bytes, person_document_type, platform_version) + .expect("we should be able to deserialize the document") + .id() + }) + .collect() + }; + let build = |query_value: serde_json::Value| { + let cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) + .expect("expected to serialize to cbor"); + DriveDocumentQuery::from_cbor( + cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + platform_version, + ) + .expect("query should be built") + }; + + let (all_results, _, _) = build(json!({ + "limit": 100, + "orderBy": [["$id", "asc"]], + })) + .execute_raw_results_no_proof(&drive, None, None, platform_version) + .expect("query should be executed"); + let ascending_ids = ids_of(&all_results); + assert_eq!(ascending_ids.len(), 10); + + for (ascending, included) in [(true, true), (true, false), (false, true), (false, false)] { + let ordered: Vec = if ascending { + ascending_ids.clone() + } else { + ascending_ids.iter().rev().cloned().collect() + }; + let cursor = ordered[3]; + let expected: Vec = if included { + ordered[3..6].to_vec() + } else { + ordered[4..7].to_vec() + }; + let cursor_key = if included { "startAt" } else { "startAfter" }; + let case = format!( + "history orderBy $id {} with {cursor_key}", + if ascending { "asc" } else { "desc" } + ); + + let query = build(json!({ + cursor_key: cursor.to_string(Encoding::Base58), + "limit": 3, + "orderBy": [["$id", if ascending { "asc" } else { "desc" }]], + })); + let (results, _, _) = query + .execute_raw_results_no_proof(&drive, None, None, platform_version) + .expect("query should be executed"); + assert_eq!(ids_of(&results), expected, "{case}: unproved page"); + + let (proof_root_hash, proof_results, _) = query + .execute_with_proof_only_get_elements(&drive, None, None, platform_version) + .unwrap_or_else(|e| panic!("{case}: proved page should verify: {e}")); + assert_eq!(root_hash, proof_root_hash, "{case}: proof root hash"); + assert_eq!(results, proof_results, "{case}: proved page"); + } +} + #[cfg(feature = "server")] #[test] fn test_query_historical_first_platform_version() { From 7b596fff45d5fa09d7d93426be98f019c59df3be Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Wed, 9 Sep 2026 23:37:59 +0700 Subject: [PATCH 07/20] test(drive-abci): page proved contestant votes with cursors and limits The proved contestant-votes test only requested whole result sets, so the helper's forwarding of the request's count and cursor into the verifier query was never exercised. Add paged proved requests over the 50-voter contender: a limit smaller than the result set with inclusive and exclusive cursors in both directions, plus a short final page, each compared with the matching slice of the full ascending voter sequence. Co-Authored-By: Claude Fable 5.1 --- .../state_transitions/masternode_vote/mod.rs | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs index 2cb3852135d..de0ad97a00d 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/masternode_vote/mod.rs @@ -3490,6 +3490,53 @@ mod tests { assert_eq!(voters_3, voters_3_desc); assert_eq!(voters_3.len(), 8); + + // Paged proved requests: a limit smaller than the 50 available + // voters and a cursor, inclusive and exclusive, in both + // directions. `voters_1` is the full ascending sequence, so each + // page must equal the matching slice of it, and the verifier + // must run with the request's own order, count and cursor for + // the proof to verify at all. + let cursor = |index: usize, included: bool| { + Some( + get_contested_resource_voters_for_identity_request_v0::StartAtIdentifierInfo { + start_identifier: voters_1[index].to_vec(), + start_identifier_included: included, + }, + ) + }; + let page = |count: u32, order_ascending: bool, start_at| { + get_proved_contestant_votes( + &platform, + &platform_state, + dpns_contract.as_ref(), + contender_1.id(), + "quantum", + Some(count), + order_ascending, + start_at, + platform_version, + ) + }; + + assert_eq!(page(10, true, cursor(9, true)), voters_1[9..19].to_vec()); + assert_eq!(page(10, true, cursor(9, false)), voters_1[10..20].to_vec()); + + let descending_from_40_inclusive: Vec = + voters_1[31..=40].iter().rev().copied().collect(); + assert_eq!( + page(10, false, cursor(40, true)), + descending_from_40_inclusive + ); + let descending_from_40_exclusive: Vec = + voters_1[30..=39].iter().rev().copied().collect(); + assert_eq!( + page(10, false, cursor(40, false)), + descending_from_40_exclusive + ); + + // A short final page: the limit exceeds what remains. + assert_eq!(page(10, true, cursor(45, false)), voters_1[46..50].to_vec()); } } From 6b40e11f5e7f4c559a0f4b220caa7aed8c3bc27f Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sat, 12 Sep 2026 00:07:51 +0700 Subject: [PATCH 08/20] build(drive)!: adopt GroveDB develop f75fa362 with automatic backward references Advance the GroveDB pin from 985ece65 to develop f75fa362 (GroveDB #949, #951 and #952). GroveDB #951 replaces the per-call propagate_backward_references flag with a backward_references_policy on insert, delete, clear and batch options, defaulting to Maintain on GroveDB V4 (Platform PV14; PV13 stays on V3). Drive selects Maintain explicitly so ordinary writes keep backward-reference participants consistent without each caller predicting them, and every EstimatedLayerInformation declares may_contain_backward_references: false because Drive stores no participants, which keeps estimates byte-identical to the previous flag-less behaviour. GroveDB #949 only changes V4 recursive discovery over non-Merk descendants and needs no Drive change. Re-pin twelve PV14 processing-fee baselines in drive-abci: transitions that remove emptied index subtrees (document delete, transfer and purchase, group-action confirm) now pay for GroveDB's participant scan of those subtrees, while batch preparation through retained Merk nodes bills slightly fewer reads on DPNS create and document replace. PV13 fees are unchanged. Co-Authored-By: Claude Fable 5.1 --- Cargo.lock | 32 +++++++++---------- packages/rs-dpp/Cargo.toml | 2 +- packages/rs-drive-abci/Cargo.toml | 8 ++--- .../batch/tests/document/deletion.rs | 11 +++++-- .../batch/tests/document/dpns.rs | 6 ++-- .../batch/tests/document/nft.rs | 15 +++++++-- .../batch/tests/document/replacement.rs | 6 ++-- .../batch/tests/document/transfer.rs | 21 +++++++++--- .../batch/tests/token/burn/mod.rs | 6 ++-- packages/rs-drive/Cargo.toml | 14 ++++---- .../for_address_balance_update/v0/mod.rs | 3 ++ .../for_address_balance_update/v1/mod.rs | 3 ++ .../v0/mod.rs | 2 ++ .../v0/mod.rs | 3 ++ .../v1/mod.rs | 3 ++ .../v0/mod.rs | 1 + .../v0/mod.rs | 2 ++ .../v1/mod.rs | 2 ++ .../v2/mod.rs | 2 ++ .../v0/mod.rs | 2 ++ .../v1/mod.rs | 2 ++ .../v2/mod.rs | 2 ++ .../v0/mod.rs | 2 ++ .../v1/mod.rs | 2 ++ .../v0/mod.rs | 1 + .../v0/mod.rs | 3 ++ .../v0/mod.rs | 2 ++ .../v1/mod.rs | 2 ++ .../v2/mod.rs | 2 ++ .../v0/mod.rs | 2 ++ .../v1/mod.rs | 2 ++ .../v2/mod.rs | 2 ++ .../mod.rs | 4 +++ .../v0/mod.rs | 2 ++ .../v0/mod.rs | 2 ++ .../v0/mod.rs | 2 ++ .../v0/mod.rs | 2 ++ .../v0/mod.rs | 2 ++ .../for_add_group_action/v0/mod.rs | 10 ++++++ .../estimated_costs/for_add_groups/v0/mod.rs | 4 +++ .../v0/mod.rs | 1 + .../estimation_costs/for_balances/v0/mod.rs | 2 ++ .../for_identity_contract_info/v0/mod.rs | 4 +++ .../v0/mod.rs | 1 + .../v0/mod.rs | 1 + .../v0/mod.rs | 1 + .../for_keys_for_identity_id/v0/mod.rs | 4 +++ .../for_negative_credit/v0/mod.rs | 2 ++ .../v0/mod.rs | 1 + .../for_root_key_reference_tree/v0/mod.rs | 1 + .../for_update_nonce/v0/mod.rs | 3 ++ .../for_update_revision/v0/mod.rs | 3 ++ .../v0/mod.rs | 2 ++ .../v0/mod.rs | 1 + .../v0/mod.rs | 3 ++ .../v0/mod.rs | 7 ++++ .../v0/mod.rs | 5 +++ .../v0/mod.rs | 2 ++ .../v0/mod.rs | 2 ++ .../src/drive/shielded/estimated_costs.rs | 7 ++++ .../for_total_system_credits_update/v0/mod.rs | 2 ++ .../v0/mod.rs | 1 + .../v0/mod.rs | 2 ++ .../v0/mod.rs | 3 ++ .../for_token_balances/v0/mod.rs | 4 +++ .../for_token_contract_infos/v0/mod.rs | 3 ++ .../for_token_direct_selling_prices/v0/mod.rs | 3 ++ .../for_token_identity_infos/v0/mod.rs | 4 +++ .../v0/mod.rs | 3 ++ .../v0/mod.rs | 4 +++ .../for_token_status_infos/v0/mod.rs | 3 ++ .../for_token_total_supply/v0/mod.rs | 3 ++ .../v0/mod.rs | 2 ++ .../grove_operations/batch_delete/v0/mod.rs | 3 +- .../v0/mod.rs | 3 +- .../grove_operations/batch_move/v0/mod.rs | 3 +- .../batch_move_items_in_path_query/v0/mod.rs | 3 +- .../batch_remove_raw/v0/mod.rs | 3 +- .../v0/mod.rs | 3 +- .../v0/mod.rs | 3 +- .../grove_batch_operations_costs/v0/mod.rs | 3 +- .../grove_operations/grove_clear/v0/mod.rs | 2 ++ .../grove_operations/grove_delete/v0/mod.rs | 3 +- packages/rs-platform-version/Cargo.toml | 2 +- packages/rs-platform-wallet/Cargo.toml | 2 +- packages/rs-sdk/Cargo.toml | 2 +- 86 files changed, 264 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3938f049474..ad9b2c7c3ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2957,7 +2957,7 @@ dependencies = [ [[package]] name = "grovedb" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" +source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" dependencies = [ "axum 0.8.9", "blake3", @@ -3016,7 +3016,7 @@ dependencies = [ [[package]] name = "grovedb-bulk-append-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" +source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" dependencies = [ "blake3", "grovedb-bincode", @@ -3034,7 +3034,7 @@ dependencies = [ [[package]] name = "grovedb-commitment-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" +source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3051,7 +3051,7 @@ dependencies = [ [[package]] name = "grovedb-costs" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" +source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" dependencies = [ "integer-encoding", "intmap", @@ -3061,7 +3061,7 @@ dependencies = [ [[package]] name = "grovedb-dense-fixed-sized-merkle-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" +source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" dependencies = [ "blake3", "grovedb-bincode", @@ -3075,7 +3075,7 @@ dependencies = [ [[package]] name = "grovedb-element" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" +source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" dependencies = [ "grovedb-bincode", "grovedb-bincode-derive", @@ -3091,7 +3091,7 @@ dependencies = [ [[package]] name = "grovedb-epoch-based-storage-flags" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" +source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" dependencies = [ "grovedb-costs", "hex", @@ -3103,7 +3103,7 @@ dependencies = [ [[package]] name = "grovedb-merk" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" +source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" dependencies = [ "blake3", "byteorder", @@ -3129,7 +3129,7 @@ dependencies = [ [[package]] name = "grovedb-merkle-mountain-range" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" +source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" dependencies = [ "blake3", "grovedb-bincode", @@ -3142,7 +3142,7 @@ dependencies = [ [[package]] name = "grovedb-path" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" +source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" dependencies = [ "hex", ] @@ -3150,7 +3150,7 @@ dependencies = [ [[package]] name = "grovedb-private-document-store" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" +source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3163,7 +3163,7 @@ dependencies = [ [[package]] name = "grovedb-query" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" +source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" dependencies = [ "byteorder", "ed", @@ -3179,7 +3179,7 @@ dependencies = [ [[package]] name = "grovedb-storage" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" +source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" dependencies = [ "blake3", "grovedb-costs", @@ -3198,7 +3198,7 @@ dependencies = [ [[package]] name = "grovedb-version" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" +source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" dependencies = [ "thiserror 2.0.18", "versioned-feature-core", @@ -3207,7 +3207,7 @@ dependencies = [ [[package]] name = "grovedb-visualize" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" +source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" dependencies = [ "hex", "itertools 0.14.0", @@ -3216,7 +3216,7 @@ dependencies = [ [[package]] name = "grovedbg-types" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=985ece6574f5fc8fe80db7b304a9a701c0f4afa6#985ece6574f5fc8fe80db7b304a9a701c0f4afa6" +source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" dependencies = [ "serde", "serde_with 3.21.0", diff --git a/packages/rs-dpp/Cargo.toml b/packages/rs-dpp/Cargo.toml index 8fc452590ae..fff564fcc18 100644 --- a/packages/rs-dpp/Cargo.toml +++ b/packages/rs-dpp/Cargo.toml @@ -76,7 +76,7 @@ strum = { version = "0.26", features = ["derive"] } json-schema-compatibility-validator = { path = '../rs-json-schema-compatibility-validator', optional = true } once_cell = "1.19.0" tracing = { version = "0.1.41" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d", optional = true } [dev-dependencies] tokio = { version = "1.40", features = ["full"] } diff --git a/packages/rs-drive-abci/Cargo.toml b/packages/rs-drive-abci/Cargo.toml index 53b072580c8..4804fd79ad5 100644 --- a/packages/rs-drive-abci/Cargo.toml +++ b/packages/rs-drive-abci/Cargo.toml @@ -82,7 +82,7 @@ derive_more = { version = "1.0", features = ["from", "deref", "deref_mut"] } async-trait = "0.1.77" console-subscriber = { version = "0.4", optional = true } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f", optional = true } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6" } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d" } nonempty = "0.11" # Shielded-pool snapshot needs raw RocksDB SstFileWriter + ingest_external_file_cf # bindings, and blake3 for the snapshot-file checksum. @@ -108,7 +108,7 @@ dpp = { path = "../rs-dpp", default-features = false, features = [ drive = { path = "../rs-drive", features = ["fixtures-and-mocks"] } drive-proof-verifier = { path = "../rs-drive-proof-verifier" } strategy-tests = { path = "../strategy-tests" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6", features = ["client"] } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d", features = ["client"] } assert_matches = "1.5.0" drive-abci = { path = ".", features = ["testing-config", "mocks", "shielded_test_data"] } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f" } @@ -122,8 +122,8 @@ integer-encoding = { version = "4.0.0" } # For dump_only_default_and_aux_cfs_under_shielded_subtree_prefix — same # subtree-prefix algorithm grovedb uses internally. -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6" } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d" } [features] default = ["bls-signatures"] diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs index 27bcd8a748b..dce2f49021b 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs @@ -11,8 +11,10 @@ mod deletion_tests { run_document_delete_on_document_type_that_is_mutable_and_can_be_deleted_at_protocol_version( PlatformVersion::latest().protocol_version, // v14: the deleted document carries the contract-version stamp - // (one stored byte, five estimated), shifting processing costs - 1699620, + // (one stored byte, five estimated), and GroveDB V4 maintains backward + // references by default, so the index subtrees the delete empties are + // scanned for participants before the batch removes them + 1868020, ) .await; } @@ -603,7 +605,10 @@ mod deletion_tests { async fn test_document_delete_on_document_type_that_is_not_mutable_and_can_be_deleted() { run_document_delete_on_document_type_that_is_not_mutable_and_can_be_deleted_at_protocol_version( PlatformVersion::latest().protocol_version, - 2778700, + // v14: GroveDB V4 maintains backward references by default, so the + // index subtrees this transition empties are scanned for participants + // before the batch removes them + 3407080, ) .await; } diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns.rs index 3ed94b01192..1a264cc8db3 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns.rs @@ -23,7 +23,9 @@ mod dpns_tests { async fn test_dpns_contract_references_with_no_contested_unique_index() { run_dpns_contract_references_with_no_contested_unique_index_at_protocol_version( PlatformVersion::latest().protocol_version, - 6_010_380, + // v14: GroveDB V4 prepares the batch through retained Merk nodes, + // which bills slightly fewer reads than the V3 path + 6_006_380, ) .await; } @@ -34,7 +36,7 @@ mod dpns_tests { /// trigger context's add_operation never called on v0). Pinned so /// v11 chain history stays bit-for-bit reproducible. /// - /// Delta vs PV12: 6_010_380 - 5_978_080 = 32_300 credits = T1 + T2 + /// Delta at PV12 (6_010_380): 6_010_380 - 5_978_080 = 32_300 credits = T1 + T2 /// query costs across 3 subdomain creates (~10,767 per transition, /// or ~5,383 per query). #[tokio::test] diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/nft.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/nft.rs index 902a665fdcf..4a01e56e4b1 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/nft.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/nft.rs @@ -411,7 +411,10 @@ mod nft_tests { PlatformVersion::latest().protocol_version, 126440160, 2485600, - 4092360, + // v14: GroveDB V4 maintains backward references by default, so the + // index subtrees this transition empties are scanned for participants + // before the batch removes them + 4339640, ) .await; } @@ -834,7 +837,10 @@ mod nft_tests { 141238960, 2729120, 2733160, - 4357440, + // v14: GroveDB V4 maintains backward references by default, so the + // index subtrees this transition empties are scanned for participants + // before the batch removes them + 4610480, ) .await; } @@ -1414,7 +1420,10 @@ mod nft_tests { PlatformVersion::latest().protocol_version, 126440160, 2485600, - 4092360, + // v14: GroveDB V4 maintains backward references by default, so the + // index subtrees this transition empties are scanned for participants + // before the batch removes them + 4339640, ) .await; } diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs index 5b9c07a62c0..06a0f4dcc21 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs @@ -498,8 +498,10 @@ mod replacement_tests { async fn test_document_replace_on_document_type_that_is_mutable() { run_document_replace_on_document_type_that_is_mutable_at_protocol_version( PlatformVersion::latest().protocol_version, - // v14: replaced documents carry the contract-version stamp - 1433220, + // v14: replaced documents carry the contract-version stamp, and GroveDB + // V4 prepares the batch through retained Merk nodes, which bills + // slightly fewer reads than the V3 path + 1428320, ) .await; } diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/transfer.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/transfer.rs index e8f51ec6344..dc0a951abd4 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/transfer.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/transfer.rs @@ -213,7 +213,10 @@ mod transfer_tests { async fn test_document_transfer_on_document_type_that_is_transferable_before_creator_id() { run_document_transfer_on_document_type_that_is_transferable_before_creator_id_at_protocol_version( PlatformVersion::latest().protocol_version, - 3380960, + // v14: GroveDB V4 maintains backward references by default, so the + // index subtrees this transition empties are scanned for participants + // before the batch removes them + 3579040, ) .await; } @@ -498,8 +501,10 @@ mod transfer_tests { async fn test_document_transfer_on_document_type_that_is_transferable() { run_document_transfer_on_document_type_that_is_transferable_at_protocol_version( PlatformVersion::latest().protocol_version, - // v14: transferred documents carry the contract-version stamp - 3643860, + // v14: transferred documents carry the contract-version stamp, and + // GroveDB V4 scans the index subtrees the transfer empties for + // backward-reference participants before the batch removes them + 3841940, ) .await; } @@ -797,7 +802,10 @@ mod transfer_tests { async fn test_document_transfer_on_document_type_that_is_transferable_contract_v0() { run_document_transfer_on_document_type_that_is_transferable_contract_v0_at_protocol_version( PlatformVersion::latest().protocol_version, - 3380960, + // v14: GroveDB V4 maintains backward references by default, so the + // index subtrees this transition empties are scanned for participants + // before the batch removes them + 3579040, ) .await; } @@ -1491,7 +1499,10 @@ mod transfer_tests { async fn test_document_delete_after_transfer() { run_document_delete_after_transfer_at_protocol_version( PlatformVersion::latest().protocol_version, - 4004720, // v14: stamped documents (see transferable baseline note) + // v14: stamped documents (see transferable baseline note); GroveDB V4 + // scans the index subtrees the transfer empties for backward-reference + // participants before the batch removes them + 4252000, ) .await; } diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/burn/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/burn/mod.rs index 32d40c65338..cc7d35f33b0 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/burn/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/burn/mod.rs @@ -3959,8 +3959,10 @@ mod token_burn_tests { run_token_burn_group_action_confirmer_fee_includes_transformer_reads_at_protocol_version( PlatformVersion::latest().protocol_version, // PROTOCOL_VERSION_14: +400 — genesis system documents now carry - // the contract-version stamp, shifting byte-billed subtree reads - 4_368_280, + // the contract-version stamp, shifting byte-billed subtree reads; + // +56_660: GroveDB V4 maintains backward references by default and + // scans the subtrees the confirmer removes for participants first + 4_424_940, ) .await; } diff --git a/packages/rs-drive/Cargo.toml b/packages/rs-drive/Cargo.toml index 6c60c2559e7..bf85c7ead4c 100644 --- a/packages/rs-drive/Cargo.toml +++ b/packages/rs-drive/Cargo.toml @@ -52,13 +52,13 @@ enum-map = { version = "2.0.3", optional = true } intmap = { version = "3.0.1", features = ["serde"], optional = true } chrono = { version = "0.4.35", optional = true } itertools = { version = "0.13", optional = true } -grovedb = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6", optional = true, default-features = false } -grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6", optional = true } -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6" } -grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6", optional = true } -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6" } -grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6" } +grovedb = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d", optional = true, default-features = false } +grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d", optional = true } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d" } +grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d", optional = true } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d" } +grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d" } [dev-dependencies] criterion = "0.5" diff --git a/packages/rs-drive/src/drive/address_funds/estimated_costs/for_address_balance_update/v0/mod.rs b/packages/rs-drive/src/drive/address_funds/estimated_costs/for_address_balance_update/v0/mod.rs index e63ca81ff23..490f70ff5d0 100644 --- a/packages/rs-drive/src/drive/address_funds/estimated_costs/for_address_balance_update/v0/mod.rs +++ b/packages/rs-drive/src/drive/address_funds/estimated_costs/for_address_balance_update/v0/mod.rs @@ -45,6 +45,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: AllSubtrees( 1, @@ -70,6 +71,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(Self::addresses_path()), EstimatedLayerInformation { tree_type: TreeType::SumTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees( 1, @@ -96,6 +98,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(Self::clear_addresses_path()), EstimatedLayerInformation { tree_type: TreeType::CountSumTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( PLATFORM_ADDRESS_KEY_SIZE as u8, diff --git a/packages/rs-drive/src/drive/address_funds/estimated_costs/for_address_balance_update/v1/mod.rs b/packages/rs-drive/src/drive/address_funds/estimated_costs/for_address_balance_update/v1/mod.rs index 8d3e7339e96..533fb309c46 100644 --- a/packages/rs-drive/src/drive/address_funds/estimated_costs/for_address_balance_update/v1/mod.rs +++ b/packages/rs-drive/src/drive/address_funds/estimated_costs/for_address_balance_update/v1/mod.rs @@ -34,6 +34,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: AllSubtrees( 1, @@ -58,6 +59,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(Self::addresses_path()), EstimatedLayerInformation { tree_type: TreeType::SumTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees( 1, @@ -85,6 +87,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(Self::clear_addresses_path()), EstimatedLayerInformation { tree_type: TreeType::CountSumTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItemsWithSumItem( PLATFORM_ADDRESS_KEY_SIZE as u8, diff --git a/packages/rs-drive/src/drive/asset_lock/estimation_costs/add_estimation_costs_for_adding_asset_lock/v0/mod.rs b/packages/rs-drive/src/drive/asset_lock/estimation_costs/add_estimation_costs_for_adding_asset_lock/v0/mod.rs index efb0c2c34bb..daa079da412 100644 --- a/packages/rs-drive/src/drive/asset_lock/estimation_costs/add_estimation_costs_for_adding_asset_lock/v0/mod.rs +++ b/packages/rs-drive/src/drive/asset_lock/estimation_costs/add_estimation_costs_for_adding_asset_lock/v0/mod.rs @@ -62,6 +62,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: AllSubtrees( 12, // 32 + 1 + 1 / 3 @@ -85,6 +86,7 @@ impl Drive { KeyInfoPath::from_known_path(asset_lock_storage_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( 36, //The size of an outpoint diff --git a/packages/rs-drive/src/drive/contract/estimation_costs/add_estimation_costs_for_contract_insertion/v0/mod.rs b/packages/rs-drive/src/drive/contract/estimation_costs/add_estimation_costs_for_contract_insertion/v0/mod.rs index 2ea0ebc206c..511170b1d02 100644 --- a/packages/rs-drive/src/drive/contract/estimation_costs/add_estimation_costs_for_contract_insertion/v0/mod.rs +++ b/packages/rs-drive/src/drive/contract/estimation_costs/add_estimation_costs_for_contract_insertion/v0/mod.rs @@ -62,6 +62,7 @@ impl Drive { ), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(2), estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_INDEX_NAME_SIZE, @@ -81,6 +82,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(0, true), estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_INDEX_NAME_SIZE, @@ -104,6 +106,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(AVERAGE_NUMBER_OF_UPDATES as u32), estimated_layer_sizes: Mix { subtrees_size: None, diff --git a/packages/rs-drive/src/drive/contract/estimation_costs/add_estimation_costs_for_contract_insertion/v1/mod.rs b/packages/rs-drive/src/drive/contract/estimation_costs/add_estimation_costs_for_contract_insertion/v1/mod.rs index 6c3a3fd5025..33a4a79e42f 100644 --- a/packages/rs-drive/src/drive/contract/estimation_costs/add_estimation_costs_for_contract_insertion/v1/mod.rs +++ b/packages/rs-drive/src/drive/contract/estimation_costs/add_estimation_costs_for_contract_insertion/v1/mod.rs @@ -97,6 +97,7 @@ impl Drive { ), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(2), estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_INDEX_NAME_SIZE, @@ -164,6 +165,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(0, true), estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_INDEX_NAME_SIZE, @@ -187,6 +189,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(AVERAGE_NUMBER_OF_UPDATES as u32), estimated_layer_sizes: Mix { subtrees_size: None, diff --git a/packages/rs-drive/src/drive/document/delete/internal/add_estimation_costs_for_remove_document_to_primary_storage/v0/mod.rs b/packages/rs-drive/src/drive/document/delete/internal/add_estimation_costs_for_remove_document_to_primary_storage/v0/mod.rs index f96fafe4fe3..bd87fa726b3 100644 --- a/packages/rs-drive/src/drive/document/delete/internal/add_estimation_costs_for_remove_document_to_primary_storage/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/internal/add_estimation_costs_for_remove_document_to_primary_storage/v0/mod.rs @@ -70,6 +70,7 @@ impl Drive { KeyInfoPath::from_known_path(primary_key_path), EstimatedLayerInformation { tree_type: primary_key_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v0/mod.rs index 9da9dae15cf..00921b9d799 100644 --- a/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v0/mod.rs @@ -67,6 +67,7 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: current_layer_tree_type, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -142,6 +143,7 @@ impl Drive { sub_level_index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: property_name_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v1/mod.rs b/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v1/mod.rs index 924722b934c..f7bb76a20bd 100644 --- a/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v1/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v1/mod.rs @@ -73,6 +73,7 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: parent_value_tree_type, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -192,6 +193,7 @@ impl Drive { sub_level_index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: property_name_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v2/mod.rs b/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v2/mod.rs index a26cf2b9047..eaaf1a8124e 100644 --- a/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v2/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v2/mod.rs @@ -73,6 +73,7 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: parent_value_tree_type, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -150,6 +151,7 @@ impl Drive { sub_level_index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: property_name_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v0/mod.rs index ef129d79a32..6d7b452bad9 100644 --- a/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v0/mod.rs @@ -70,6 +70,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(contract_document_type_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -130,6 +131,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(index_path.clone()), EstimatedLayerInformation { tree_type: property_name_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v1/mod.rs b/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v1/mod.rs index d1e74ecd39a..407fa8bf41a 100644 --- a/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v1/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v1/mod.rs @@ -71,6 +71,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(contract_document_type_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -174,6 +175,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(index_path.clone()), EstimatedLayerInformation { tree_type: property_name_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v2/mod.rs b/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v2/mod.rs index 9ae6c9cfd5d..dc975717e99 100644 --- a/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v2/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v2/mod.rs @@ -93,6 +93,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(contract_document_type_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -186,6 +187,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(index_path.clone()), EstimatedLayerInformation { tree_type: property_name_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v0/mod.rs index b057e4bb4c5..ff4a1d7bf74 100644 --- a/packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v0/mod.rs @@ -88,6 +88,7 @@ impl Drive { key_info_path.clone(), EstimatedLayerInformation { tree_type: member_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, @@ -184,6 +185,7 @@ impl Drive { key_info_path.clone(), EstimatedLayerInformation { tree_type: reference_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v1/mod.rs b/packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v1/mod.rs index a48f9d7b02e..5987b56a75a 100644 --- a/packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v1/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v1/mod.rs @@ -95,6 +95,7 @@ impl Drive { key_info_path.clone(), EstimatedLayerInformation { tree_type: member_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, @@ -208,6 +209,7 @@ impl Drive { key_info_path.clone(), EstimatedLayerInformation { tree_type: reference_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_contested_document_to_primary_storage/v0/mod.rs b/packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_contested_document_to_primary_storage/v0/mod.rs index b8c7444e858..1beac769041 100644 --- a/packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_contested_document_to_primary_storage/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_contested_document_to_primary_storage/v0/mod.rs @@ -78,6 +78,7 @@ impl Drive { KeyInfoPath::from_known_path(primary_key_path), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_document_to_primary_storage/v0/mod.rs b/packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_document_to_primary_storage/v0/mod.rs index c7f22c9f20d..698ca2a776f 100644 --- a/packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_document_to_primary_storage/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_document_to_primary_storage/v0/mod.rs @@ -87,6 +87,7 @@ impl Drive { KeyInfoPath::from_known_path(primary_key_path), EstimatedLayerInformation { tree_type: primary_key_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -147,6 +148,7 @@ impl Drive { KeyInfoPath::from_known_path(document_id_in_primary_path), EstimatedLayerInformation { tree_type: per_doc_subtree_tree_type, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(AVERAGE_NUMBER_OF_UPDATES as u32), estimated_layer_sizes: Mix { subtrees_size: None, @@ -181,6 +183,7 @@ impl Drive { KeyInfoPath::from_known_path(primary_key_path), EstimatedLayerInformation { tree_type: primary_key_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v0/mod.rs index d663ad711d8..eb4924471d0 100644 --- a/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v0/mod.rs @@ -108,6 +108,7 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: current_layer_tree_type, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -272,6 +273,7 @@ impl Drive { sub_level_index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: property_name_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v1/mod.rs b/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v1/mod.rs index 353264ab4bd..8cee9fd49ef 100644 --- a/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v1/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v1/mod.rs @@ -135,6 +135,7 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: current_layer_tree_type, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -360,6 +361,7 @@ impl Drive { sub_level_index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: property_name_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v2/mod.rs b/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v2/mod.rs index 3cb13df76ee..44d809cc151 100644 --- a/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v2/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v2/mod.rs @@ -153,6 +153,7 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: current_layer_tree_type, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -273,6 +274,7 @@ impl Drive { sub_level_index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: property_name_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v0/mod.rs index 0e4802a0ee1..3de5737916a 100644 --- a/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v0/mod.rs @@ -71,6 +71,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(contract_document_type_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -218,6 +219,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(index_path.clone()), EstimatedLayerInformation { tree_type: property_name_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v1/mod.rs b/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v1/mod.rs index 57d9ef64665..8256bdcda00 100644 --- a/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v1/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v1/mod.rs @@ -72,6 +72,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(contract_document_type_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -225,6 +226,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(index_path.clone()), EstimatedLayerInformation { tree_type: property_name_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v2/mod.rs b/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v2/mod.rs index 3b23787770c..4d45e1d33e3 100644 --- a/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v2/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v2/mod.rs @@ -97,6 +97,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(contract_document_type_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -215,6 +216,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(index_path.clone()), EstimatedLayerInformation { tree_type: property_name_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/insert/add_preallocated_index_tree_operations/mod.rs b/packages/rs-drive/src/drive/document/insert/add_preallocated_index_tree_operations/mod.rs index a4a98b583be..a6eb7acdfe8 100644 --- a/packages/rs-drive/src/drive/document/insert/add_preallocated_index_tree_operations/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_preallocated_index_tree_operations/mod.rs @@ -185,6 +185,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(contract_document_type_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements( referring_index_structure.sub_levels().len() as u32 + 1, ), @@ -362,6 +363,7 @@ impl Drive { path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: property_name_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( value_key_estimated_size as u8, @@ -405,6 +407,7 @@ impl Drive { path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: value_tree_type, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements( sub_level.sub_levels().len() as u32 + 1, ), @@ -477,6 +480,7 @@ impl Drive { path_info.convert_to_key_info_path(), EstimatedLayerInformation { tree_type: member_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/document/insert/add_reference_for_index_level_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/insert/add_reference_for_index_level_for_contract_operations/v0/mod.rs index c25bb65ec5e..f4f25af0d24 100644 --- a/packages/rs-drive/src/drive/document/insert/add_reference_for_index_level_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_reference_for_index_level_for_contract_operations/v0/mod.rs @@ -193,6 +193,7 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: reference_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllReference( DEFAULT_HASH_SIZE_U8, @@ -474,6 +475,7 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: member_tree_type, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/document/insert_contested/add_contested_indices_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/insert_contested/add_contested_indices_for_contract_operations/v0/mod.rs index 9eed9dee870..dd59eff4e02 100644 --- a/packages/rs-drive/src/drive/document/insert_contested/add_contested_indices_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/insert_contested/add_contested_indices_for_contract_operations/v0/mod.rs @@ -124,6 +124,7 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, @@ -188,6 +189,7 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(16), // very seldom would more than 16 people want the resource estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/document/insert_contested/add_contested_indices_for_index_level_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/insert_contested/add_contested_indices_for_index_level_for_contract_operations/v0/mod.rs index 1ead80bba85..87cd5babf7b 100644 --- a/packages/rs-drive/src/drive/document/insert_contested/add_contested_indices_for_index_level_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/insert_contested/add_contested_indices_for_index_level_for_contract_operations/v0/mod.rs @@ -61,6 +61,7 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -135,6 +136,7 @@ impl Drive { sub_level_index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/insert_contested/add_contested_reference_and_vote_subtree_to_document_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/insert_contested/add_contested_reference_and_vote_subtree_to_document_operations/v0/mod.rs index 8aa6aa288ff..eaf031d4592 100644 --- a/packages/rs-drive/src/drive/document/insert_contested/add_contested_reference_and_vote_subtree_to_document_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/insert_contested/add_contested_reference_and_vote_subtree_to_document_operations/v0/mod.rs @@ -55,6 +55,7 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(2), estimated_layer_sizes: Mix { // The votes don't have storage flags @@ -148,6 +149,7 @@ impl Drive { votes_path_key_info.clone().convert_to_key_info_path()?, EstimatedLayerInformation { tree_type: TreeType::SumTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, U8_SIZE_U32, None), }, diff --git a/packages/rs-drive/src/drive/document/insert_contested/add_contested_vote_subtrees_for_non_identities_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/insert_contested/add_contested_vote_subtrees_for_non_identities_operations/v0/mod.rs index 9384becf62d..e6e38354777 100644 --- a/packages/rs-drive/src/drive/document/insert_contested/add_contested_vote_subtrees_for_non_identities_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/insert_contested/add_contested_vote_subtrees_for_non_identities_operations/v0/mod.rs @@ -44,6 +44,7 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(1), estimated_layer_sizes: Mix { // The votes don't have storage flags @@ -74,6 +75,7 @@ impl Drive { votes_path_key_info.clone().convert_to_key_info_path()?, EstimatedLayerInformation { tree_type: TreeType::SumTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, U8_SIZE_U32, None), }, diff --git a/packages/rs-drive/src/drive/group/estimated_costs/for_add_group_action/v0/mod.rs b/packages/rs-drive/src/drive/group/estimated_costs/for_add_group_action/v0/mod.rs index a92b45545c4..9227698a963 100644 --- a/packages/rs-drive/src/drive/group/estimated_costs/for_add_group_action/v0/mod.rs +++ b/packages/rs-drive/src/drive/group/estimated_costs/for_add_group_action/v0/mod.rs @@ -81,6 +81,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: AllSubtrees( 1, @@ -105,6 +106,7 @@ impl Drive { KeyInfoPath::from_known_path(group_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // We estimate that on average we need to update 10 nodes estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -114,6 +116,7 @@ impl Drive { KeyInfoPath::from_known_path(group_contract_path(contract_id.as_slice())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(2, NoSumTrees, None), }, @@ -126,6 +129,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -138,6 +142,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -152,6 +157,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: Mix { subtrees_size: Some((1, AllSumTrees, None, 1)), @@ -171,6 +177,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::SumTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllItems(8, 1, None), }, @@ -185,6 +192,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -199,6 +207,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: Mix { subtrees_size: Some((1, AllSumTrees, None, 1)), @@ -218,6 +227,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::SumTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllItems(8, 1, None), }, diff --git a/packages/rs-drive/src/drive/group/estimated_costs/for_add_groups/v0/mod.rs b/packages/rs-drive/src/drive/group/estimated_costs/for_add_groups/v0/mod.rs index 00923bcd538..04dacec547f 100644 --- a/packages/rs-drive/src/drive/group/estimated_costs/for_add_groups/v0/mod.rs +++ b/packages/rs-drive/src/drive/group/estimated_costs/for_add_groups/v0/mod.rs @@ -37,6 +37,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: AllSubtrees( 1, @@ -61,6 +62,7 @@ impl Drive { KeyInfoPath::from_known_path(group_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // We estimate that on average we need to update 10 nodes estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -70,6 +72,7 @@ impl Drive { KeyInfoPath::from_known_path(group_contract_path(contract_id.as_slice())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(2, NoSumTrees, None), }, @@ -83,6 +86,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_authentication_keys_security_level_in_key_reference_tree/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_authentication_keys_security_level_in_key_reference_tree/v0/mod.rs index 529b56477f6..166a4038846 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_authentication_keys_security_level_in_key_reference_tree/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_authentication_keys_security_level_in_key_reference_tree/v0/mod.rs @@ -46,6 +46,7 @@ impl Drive { //todo: revisit EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(4), //we can estimate that each security level will only have 4 keys //We can mark these as all subtrees, because the revision will be under estimated_layer_sizes: AllItems(1, KEY_REFERENCE_SIZE, None), diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_balances/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_balances/v0/mod.rs index 2dc6aac1200..a52ec96dd6a 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_balances/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_balances/v0/mod.rs @@ -57,6 +57,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees( 1, @@ -81,6 +82,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(balance_path_vec()), EstimatedLayerInformation { tree_type: TreeType::SumTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, AVERAGE_BALANCE_SIZE, None), }, diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info/v0/mod.rs index 2b46bc6a0ac..332ffe7662c 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info/v0/mod.rs @@ -20,6 +20,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -30,6 +31,7 @@ impl Drive { KeyInfoPath::from_known_path(identity_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -47,6 +49,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(identity_path_vec(identity_id.as_slice())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: Mix { subtrees_size: Some((1, NoSumTrees, None, 2)), // weight of 2 because 1 for keys and 1 for data contract info @@ -62,6 +65,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(identity_contract_info_root_path_vec(identity_id)), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group/v0/mod.rs index 637609a51c4..acdd4e177ee 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group/v0/mod.rs @@ -21,6 +21,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(2), estimated_layer_sizes: Mix { subtrees_size: Some((1, NoSumTrees, None, 1)), diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group_key_purpose/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group_key_purpose/v0/mod.rs index 195a04d3c7c..d98825c3f2d 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group_key_purpose/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group_key_purpose/v0/mod.rs @@ -26,6 +26,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(5), estimated_layer_sizes: AllReference(1, KEY_REFERENCE_SIZE, None), }, diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group_keys/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group_keys/v0/mod.rs index 069fc57bcb8..ed0550ea1d3 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group_keys/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group_keys/v0/mod.rs @@ -21,6 +21,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(2), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_keys_for_identity_id/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_keys_for_identity_id/v0/mod.rs index ac776f1ab24..a697bf46ace 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_keys_for_identity_id/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_keys_for_identity_id/v0/mod.rs @@ -59,6 +59,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -69,6 +70,7 @@ impl Drive { KeyInfoPath::from_known_path(identity_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -79,6 +81,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(identity_path_vec(identity_id.as_slice())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), //We can mark these as all subtrees, because the revision will be under estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), @@ -90,6 +93,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(identity_key_tree_path_vec(identity_id.as_slice())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(50), //we can estimate that an identity will have amount 50 keys //We can mark these as all subtrees, because the revision will be under estimated_layer_sizes: AllItems(1, 42, Some(3)), diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_negative_credit/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_negative_credit/v0/mod.rs index 94834edead9..da97999e333 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_negative_credit/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_negative_credit/v0/mod.rs @@ -37,6 +37,7 @@ impl Drive { KeyInfoPath::from_known_path(identity_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -54,6 +55,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(identity_path_vec(identity_id.as_slice())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), //We can mark these as all subtrees, because the revision will be under estimated_layer_sizes: Mix { diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_purpose_in_key_reference_tree/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_purpose_in_key_reference_tree/v0/mod.rs index 6951d86eda7..65b3b1fcd04 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_purpose_in_key_reference_tree/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_purpose_in_key_reference_tree/v0/mod.rs @@ -69,6 +69,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count, // there are //We can mark these as all subtrees, because the revision will be under estimated_layer_sizes, diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_root_key_reference_tree/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_root_key_reference_tree/v0/mod.rs index 7d312f98fd6..aded5ef2192 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_root_key_reference_tree/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_root_key_reference_tree/v0/mod.rs @@ -35,6 +35,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(identity_query_keys_tree_path_vec(identity_id)), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(4), //we can estimate that an identity will have amount 50 keys //We can mark these as all subtrees, because the revision will be under estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_update_nonce/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_update_nonce/v0/mod.rs index c71e24c305a..1fe8f106843 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_update_nonce/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_update_nonce/v0/mod.rs @@ -41,6 +41,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(0, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -51,6 +52,7 @@ impl Drive { KeyInfoPath::from_known_path(identity_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -68,6 +70,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(identity_path_vec(identity_id.as_slice())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), //We can mark these as all subtrees, because the revision will be under estimated_layer_sizes: Mix { diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_update_revision/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_update_revision/v0/mod.rs index bb95e061311..ac0ef6713bd 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_update_revision/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_update_revision/v0/mod.rs @@ -41,6 +41,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(0, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -51,6 +52,7 @@ impl Drive { KeyInfoPath::from_known_path(identity_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -68,6 +70,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(identity_path_vec(identity_id.as_slice())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), //We can mark these as all subtrees, because the revision will be under estimated_layer_sizes: Mix { diff --git a/packages/rs-drive/src/drive/identity/key/insert_key_hash_identity_reference/estimation_costs/add_estimation_costs_for_insert_non_unique_public_key_hash_reference/v0/mod.rs b/packages/rs-drive/src/drive/identity/key/insert_key_hash_identity_reference/estimation_costs/add_estimation_costs_for_insert_non_unique_public_key_hash_reference/v0/mod.rs index a24e1eea04a..6245b7f6d73 100644 --- a/packages/rs-drive/src/drive/identity/key/insert_key_hash_identity_reference/estimation_costs/add_estimation_costs_for_insert_non_unique_public_key_hash_reference/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/key/insert_key_hash_identity_reference/estimation_costs/add_estimation_costs_for_insert_non_unique_public_key_hash_reference/v0/mod.rs @@ -25,6 +25,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(non_unique_key_hashes_path), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_160_SIZE_U8, NoSumTrees, None), }, @@ -37,6 +38,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(non_unique_key_hashes_sub_path), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(ESTIMATED_NON_UNIQUE_KEY_DUPLICATES), estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, 0, None), }, diff --git a/packages/rs-drive/src/drive/identity/key/insert_key_hash_identity_reference/estimation_costs/add_estimation_costs_for_insert_unique_public_key_hash_reference/v0/mod.rs b/packages/rs-drive/src/drive/identity/key/insert_key_hash_identity_reference/estimation_costs/add_estimation_costs_for_insert_unique_public_key_hash_reference/v0/mod.rs index db8a337fa48..61d6d592b0b 100644 --- a/packages/rs-drive/src/drive/identity/key/insert_key_hash_identity_reference/estimation_costs/add_estimation_costs_for_insert_unique_public_key_hash_reference/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/key/insert_key_hash_identity_reference/estimation_costs/add_estimation_costs_for_insert_unique_public_key_hash_reference/v0/mod.rs @@ -19,6 +19,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(unique_key_hashes_path), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_160_SIZE_U8, diff --git a/packages/rs-drive/src/drive/prefunded_specialized_balances/estimation_costs/for_prefunded_specialized_balance_update/v0/mod.rs b/packages/rs-drive/src/drive/prefunded_specialized_balances/estimation_costs/for_prefunded_specialized_balance_update/v0/mod.rs index 3b30884b6cb..e65b0375482 100644 --- a/packages/rs-drive/src/drive/prefunded_specialized_balances/estimation_costs/for_prefunded_specialized_balance_update/v0/mod.rs +++ b/packages/rs-drive/src/drive/prefunded_specialized_balances/estimation_costs/for_prefunded_specialized_balance_update/v0/mod.rs @@ -29,6 +29,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, // We are on the 3rd level estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: AllSubtrees( @@ -53,6 +54,7 @@ impl Drive { KeyInfoPath::from_known_path(prefunded_specialized_balances_path()), EstimatedLayerInformation { tree_type: TreeType::SumTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(0, false), estimated_layer_sizes: AllSubtrees(1, AllSumTrees, None), }, @@ -62,6 +64,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(prefunded_specialized_balances_for_voting_path_vec()), EstimatedLayerInformation { tree_type: TreeType::SumTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, AVERAGE_BALANCE_SIZE, None), }, diff --git a/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_contested_document_tree_levels_up_to_contract/v0/mod.rs b/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_contested_document_tree_levels_up_to_contract/v0/mod.rs index 4be4c8b9058..b47b5cc2728 100644 --- a/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_contested_document_tree_levels_up_to_contract/v0/mod.rs +++ b/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_contested_document_tree_levels_up_to_contract/v0/mod.rs @@ -59,6 +59,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), //voting is on level 2 // We have balances in the middle which is a sum tree estimated_layer_sizes: AllSubtrees( @@ -84,6 +85,7 @@ impl Drive { KeyInfoPath::from_known_path(vote_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, // contested resource tree is a key of "c" so it should be on the top layer of the merk estimated_layer_count: EstimatedLevel(0, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), @@ -95,6 +97,7 @@ impl Drive { KeyInfoPath::from_known_path(vote_contested_resource_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, // active poll "p", with "e" and "i" first so it should be on the second layer of the merk estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), @@ -106,6 +109,7 @@ impl Drive { KeyInfoPath::from_known_path(vote_contested_resource_active_polls_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -119,6 +123,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(document_type_count), estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_DOCUMENT_TYPE_NAME_SIZE, @@ -138,6 +143,7 @@ impl Drive { ), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(2), estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_INDEX_NAME_SIZE, @@ -156,6 +162,7 @@ impl Drive { ), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(1024), //Just a guess estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_INDEX_NAME_SIZE, diff --git a/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded/v0/mod.rs b/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded/v0/mod.rs index 6ef2aa76708..8df5e3e2168 100644 --- a/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded/v0/mod.rs +++ b/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded/v0/mod.rs @@ -50,6 +50,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), //voting is on level 2 // We have balances in the middle which is a sum tree estimated_layer_sizes: AllSubtrees( @@ -75,6 +76,7 @@ impl Drive { KeyInfoPath::from_known_path(vote_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, // contested resource tree is a key of "c" so it should be on the top layer of the merk estimated_layer_count: EstimatedLevel(0, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), @@ -86,6 +88,7 @@ impl Drive { KeyInfoPath::from_known_path(vote_contested_resource_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, // active poll "p", with "e" and "i" first, so it should be on the second layer of the merk estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), @@ -97,6 +100,7 @@ impl Drive { KeyInfoPath::from_known_path(vote_contested_resource_active_polls_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -110,6 +114,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(document_type_count), estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_DOCUMENT_TYPE_NAME_SIZE, diff --git a/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_levels_up_to_contract/v0/mod.rs b/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_levels_up_to_contract/v0/mod.rs index 0e6e4630378..f266f433972 100644 --- a/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_levels_up_to_contract/v0/mod.rs +++ b/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_levels_up_to_contract/v0/mod.rs @@ -44,6 +44,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(0, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -54,6 +55,7 @@ impl Drive { KeyInfoPath::from_known_path(all_contracts_global_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_levels_up_to_contract_document_type_excluded/v0/mod.rs b/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_levels_up_to_contract_document_type_excluded/v0/mod.rs index 443349d04ad..eeabec5cb5a 100644 --- a/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_levels_up_to_contract_document_type_excluded/v0/mod.rs +++ b/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_levels_up_to_contract_document_type_excluded/v0/mod.rs @@ -63,6 +63,7 @@ impl Drive { KeyInfoPath::from_known_path(contract_root_path(contract.id_ref().as_bytes())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, storage_flags), }, @@ -72,6 +73,7 @@ impl Drive { KeyInfoPath::from_known_path(contract_documents_path(contract.id_ref().as_bytes())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(document_type_count), estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_DOCUMENT_TYPE_NAME_SIZE, diff --git a/packages/rs-drive/src/drive/shielded/estimated_costs.rs b/packages/rs-drive/src/drive/shielded/estimated_costs.rs index 859286eb24b..93d2c1b2f4b 100644 --- a/packages/rs-drive/src/drive/shielded/estimated_costs.rs +++ b/packages/rs-drive/src/drive/shielded/estimated_costs.rs @@ -40,6 +40,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: AllSubtrees( 1, @@ -66,6 +67,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(vec![vec![RootTree::ShieldedBalances as u8]]), EstimatedLayerInformation { tree_type: TreeType::SumTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees( 1, @@ -99,6 +101,7 @@ impl Drive { KeyInfoPath::from_known_path(shielded_credit_pool_path()), EstimatedLayerInformation { tree_type: TreeType::SumTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: Mix { subtrees_size: Some(( @@ -131,6 +134,7 @@ impl Drive { KeyInfoPath::from_known_path(shielded_credit_pool_notes_path()), EstimatedLayerInformation { tree_type: TreeType::CommitmentTree(SHIELDED_NOTES_CHUNK_POWER), + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(16, false), estimated_layer_sizes: AllItems(8, AVERAGE_NOTE_VALUE_SIZE, None), }, @@ -142,6 +146,7 @@ impl Drive { KeyInfoPath::from_known_path(shielded_credit_pool_nullifiers_path()), EstimatedLayerInformation { tree_type: TreeType::ProvableCountTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(16, false), estimated_layer_sizes: AllItems(NULLIFIER_KEY_SIZE, 0, None), }, @@ -153,6 +158,7 @@ impl Drive { KeyInfoPath::from_known_path(shielded_credit_pool_anchors_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(7, false), estimated_layer_sizes: AllItems(ANCHOR_KEY_SIZE, ANCHOR_VALUE_SIZE, None), }, @@ -164,6 +170,7 @@ impl Drive { KeyInfoPath::from_known_path(shielded_credit_pool_anchors_by_height_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(7, false), estimated_layer_sizes: AllItems( ANCHOR_VALUE_SIZE as u8, diff --git a/packages/rs-drive/src/drive/system/estimation_costs/for_total_system_credits_update/v0/mod.rs b/packages/rs-drive/src/drive/system/estimation_costs/for_total_system_credits_update/v0/mod.rs index 4583aefca0d..e0c88ba11b7 100644 --- a/packages/rs-drive/src/drive/system/estimation_costs/for_total_system_credits_update/v0/mod.rs +++ b/packages/rs-drive/src/drive/system/estimation_costs/for_total_system_credits_update/v0/mod.rs @@ -34,6 +34,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: AllSubtrees( 12, // about 32 + 1 + 1 / 3 @@ -58,6 +59,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(misc_path_vec()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: ApproximateElements(1), estimated_layer_sizes: AllItems(1, 8, None), }, diff --git a/packages/rs-drive/src/drive/tokens/distribution/mark_perpetual_release_as_distributed/v0/mod.rs b/packages/rs-drive/src/drive/tokens/distribution/mark_perpetual_release_as_distributed/v0/mod.rs index 2bacadcea45..b2e822e24eb 100644 --- a/packages/rs-drive/src/drive/tokens/distribution/mark_perpetual_release_as_distributed/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/distribution/mark_perpetual_release_as_distributed/v0/mod.rs @@ -45,6 +45,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(perpetual_distributions_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count, estimated_layer_sizes: AllItems(1, 8, None), }, diff --git a/packages/rs-drive/src/drive/tokens/distribution/mark_pre_programmed_release_as_distributed/v0/mod.rs b/packages/rs-drive/src/drive/tokens/distribution/mark_pre_programmed_release_as_distributed/v0/mod.rs index 9eb4644f7a8..b54912f2184 100644 --- a/packages/rs-drive/src/drive/tokens/distribution/mark_pre_programmed_release_as_distributed/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/distribution/mark_pre_programmed_release_as_distributed/v0/mod.rs @@ -73,6 +73,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(token_distributions_root_path_vec()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), // We should be on the first level estimated_layer_sizes: AllSubtrees(U8_SIZE_U8, NoSumTrees, None), }, @@ -97,6 +98,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(pre_programmed_distributions_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(5, false), estimated_layer_sizes: AllItems(1, 8, None), }, diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_root_token_ms_interval_distribution/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_root_token_ms_interval_distribution/v0/mod.rs index ff12c2d0141..0bff3c07497 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_root_token_ms_interval_distribution/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_root_token_ms_interval_distribution/v0/mod.rs @@ -26,6 +26,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(token_timed_distributions_path_vec()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(0, false), // 0 because ms is on top estimated_layer_sizes: AllSubtrees(U8_SIZE_U8, NoSumTrees, None), }, @@ -36,6 +37,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(token_ms_timed_distributions_path_vec()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // we can have a lot of times estimated_layer_sizes: AllSubtrees(U64_SIZE_U8, NoSumTrees, None), }, @@ -50,6 +52,7 @@ impl Drive { key, EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, // We assume a shallow sum tree for the distribution entries at a given time. estimated_layer_count: EstimatedLevel(1, false), // Each distribution entry is estimated with a fixed size. diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_balances/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_balances/v0/mod.rs index 821d7c74c63..6aa3bcd6405 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_balances/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_balances/v0/mod.rs @@ -63,6 +63,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -73,6 +74,7 @@ impl Drive { KeyInfoPath::from_known_path(tokens_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(0, false), // this should be at the top estimated_layer_sizes: AllSubtrees(1, AllBigSumTrees, None), }, @@ -82,6 +84,7 @@ impl Drive { KeyInfoPath::from_known_path(token_balances_root_path()), EstimatedLayerInformation { tree_type: TreeType::BigSumTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // we can estimate 10 levels deep estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, AllSumTrees, None), }, @@ -92,6 +95,7 @@ impl Drive { KeyInfoPath::from_known_path(token_balances_path(&token_id)), EstimatedLayerInformation { tree_type: TreeType::SumTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, AVERAGE_BALANCE_SIZE, None), }, diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_contract_infos/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_contract_infos/v0/mod.rs index ffe0f731029..2a0076e3882 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_contract_infos/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_contract_infos/v0/mod.rs @@ -63,6 +63,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -73,6 +74,7 @@ impl Drive { KeyInfoPath::from_known_path(tokens_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees( 1, @@ -96,6 +98,7 @@ impl Drive { KeyInfoPath::from_known_path(token_contract_infos_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // we can estimate 10 levels deep estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, 36, None), }, diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs index efaec560a92..22013d68d79 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs @@ -63,6 +63,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -73,6 +74,7 @@ impl Drive { KeyInfoPath::from_known_path(tokens_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees( 1, @@ -96,6 +98,7 @@ impl Drive { KeyInfoPath::from_known_path(token_direct_purchase_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // we can estimate 10 levels deep estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, 8, None), }, diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_identity_infos/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_identity_infos/v0/mod.rs index d8556ea29c7..65da255811a 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_identity_infos/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_identity_infos/v0/mod.rs @@ -30,6 +30,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -40,6 +41,7 @@ impl Drive { KeyInfoPath::from_known_path(tokens_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), // this should be at the top estimated_layer_sizes: AllSubtrees( 1, @@ -63,6 +65,7 @@ impl Drive { KeyInfoPath::from_known_path(token_identity_infos_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // we can estimate 10 levels deep estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -73,6 +76,7 @@ impl Drive { KeyInfoPath::from_known_path(token_identity_infos_path(&token_id)), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_perpetual_distribution/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_perpetual_distribution/v0/mod.rs index bee40e512db..d7057694db5 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_perpetual_distribution/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_perpetual_distribution/v0/mod.rs @@ -31,6 +31,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(token_distributions_root_path_vec()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(U8_SIZE_U8, NoSumTrees, None), }, @@ -41,6 +42,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(token_root_perpetual_distributions_path_vec()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // Estimated depth estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -54,6 +56,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees(U8_SIZE_U8, NoSumTrees, None), }, diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_pre_programmed_distribution/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_pre_programmed_distribution/v0/mod.rs index e61cb383097..115e0dd37ed 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_pre_programmed_distribution/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_pre_programmed_distribution/v0/mod.rs @@ -36,6 +36,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(token_distributions_root_path_vec()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), // We should be on the first level estimated_layer_sizes: AllSubtrees(U8_SIZE_U8, NoSumTrees, None), }, @@ -46,6 +47,7 @@ impl Drive { KeyInfoPath::from_known_owned_path(token_root_pre_programmed_distributions_path_vec()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // Just an estimate estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -58,6 +60,7 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, // At this level, expect as many children as there are time entries. estimated_layer_count: ApproximateElements( times.as_ref().map(|times| times.len()).unwrap_or(128) as u32, @@ -75,6 +78,7 @@ impl Drive { ), EstimatedLayerInformation { tree_type: TreeType::SumTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), // probably not that many estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, U64_SIZE_U32, None), }, diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_status_infos/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_status_infos/v0/mod.rs index 7c6d9135f31..28be770c7db 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_status_infos/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_status_infos/v0/mod.rs @@ -27,6 +27,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -37,6 +38,7 @@ impl Drive { KeyInfoPath::from_known_path(tokens_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), // this should be at the top estimated_layer_sizes: AllSubtrees( 1, @@ -60,6 +62,7 @@ impl Drive { KeyInfoPath::from_known_path(token_statuses_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // we can estimate 10 levels deep estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_total_supply/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_total_supply/v0/mod.rs index ec9c05ed715..aecb1a8f562 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_total_supply/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_total_supply/v0/mod.rs @@ -62,6 +62,7 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), // 17 because we have 2 layers at 32 and two layers at 2 estimated_layer_sizes: AllSubtrees( @@ -87,6 +88,7 @@ impl Drive { KeyInfoPath::from_known_path(misc_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -97,6 +99,7 @@ impl Drive { KeyInfoPath::from_known_path(total_tokens_root_supply_path()), EstimatedLayerInformation { tree_type: TreeType::BigSumTree, + may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, U64_SIZE_U32, None), }, diff --git a/packages/rs-drive/src/drive/votes/insert/vote_poll/add_vote_poll_end_date_query_operations/v0/mod.rs b/packages/rs-drive/src/drive/votes/insert/vote_poll/add_vote_poll_end_date_query_operations/v0/mod.rs index 5df377420f5..c5ba91c036c 100644 --- a/packages/rs-drive/src/drive/votes/insert/vote_poll/add_vote_poll_end_date_query_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/votes/insert/vote_poll/add_vote_poll_end_date_query_operations/v0/mod.rs @@ -53,6 +53,7 @@ impl Drive { KeyInfoPath::from_known_path(vote_end_date_queries_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, // We can estimate that there is at least a vote concluding every block, and we put blocks at 6 seconds. estimated_layer_count: ApproximateElements(201_600), estimated_layer_sizes: AllSubtrees( @@ -69,6 +70,7 @@ impl Drive { ), EstimatedLayerInformation { tree_type: TreeType::NormalTree, + may_contain_backward_references: false, // We can estimate that there is 2 votes ending per block. estimated_layer_count: ApproximateElements(2), estimated_layer_sizes: AllItems( diff --git a/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs index 545bf40c4e1..f3addefb87e 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs @@ -6,6 +6,7 @@ use crate::util::grove_operations::{push_drive_operation_result, BatchDeleteAppl use grovedb::batch::key_info::KeyInfo; use grovedb::batch::KeyInfoPath; use grovedb::operations::delete::DeleteOptions; +use grovedb::BackwardReferencesPolicy; use grovedb::{GroveDb, TransactionArg}; use grovedb_path::SubtreePath; use grovedb_storage::rocksdb_storage::RocksDbStorage; @@ -23,7 +24,7 @@ impl Drive { drive_version: &DriveVersion, ) -> Result<(), Error> { let options = DeleteOptions { - propagate_backward_references: false, + backward_references_policy: BackwardReferencesPolicy::Maintain, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs index 9b90ccb60cd..c6f6888ee46 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs @@ -8,6 +8,7 @@ use grovedb::batch::key_info::KeyInfo; use grovedb::batch::KeyInfoPath; use grovedb::operations::delete::DeleteOptions; use grovedb::query_result_type::QueryResultType; +use grovedb::BackwardReferencesPolicy; use grovedb::{GroveDb, PathQuery, TransactionArg}; use grovedb_storage::rocksdb_storage::RocksDbStorage; use platform_version::version::drive_versions::DriveVersion; @@ -80,7 +81,7 @@ impl Drive { let current_batch_operations = LowLevelDriveOperation::grovedb_operations_batch(drive_operations); let options = DeleteOptions { - propagate_backward_references: false, + backward_references_policy: BackwardReferencesPolicy::Maintain, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs index fe0611c239f..aec2ea9c915 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs @@ -7,6 +7,7 @@ use crate::util::grove_operations::{push_drive_operation_result, BatchMoveApplyT use grovedb::batch::key_info::KeyInfo; use grovedb::batch::{KeyInfoPath, QualifiedGroveDbOp}; use grovedb::operations::delete::DeleteOptions; +use grovedb::BackwardReferencesPolicy; use grovedb::{Element, GroveDb, TransactionArg}; use grovedb_epoch_based_storage_flags::StorageFlags; use grovedb_path::SubtreePath; @@ -60,7 +61,7 @@ impl Drive { // ── 2. Build the delete op ────────────────────────────────────────── let current_batch = LowLevelDriveOperation::grovedb_operations_batch(drive_operations); let delete_opts = DeleteOptions { - propagate_backward_references: false, + backward_references_policy: BackwardReferencesPolicy::Maintain, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs index b8d88730cdc..cc0895e1383 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs @@ -8,6 +8,7 @@ use grovedb::batch::key_info::KeyInfo; use grovedb::batch::{KeyInfoPath, QualifiedGroveDbOp}; use grovedb::operations::delete::DeleteOptions; use grovedb::query_result_type::QueryResultType; +use grovedb::BackwardReferencesPolicy; use grovedb::{GroveDb, PathQuery, TransactionArg}; use grovedb_epoch_based_storage_flags::StorageFlags; use grovedb_storage::rocksdb_storage::RocksDbStorage; @@ -86,7 +87,7 @@ impl Drive { let current_batch_operations = LowLevelDriveOperation::grovedb_operations_batch(drive_operations); let options = DeleteOptions { - propagate_backward_references: false, + backward_references_policy: BackwardReferencesPolicy::Maintain, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs index 6ad8f69a6d8..b510a9dffbd 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs @@ -9,6 +9,7 @@ use dpp::version::drive_versions::DriveVersion; use grovedb::batch::key_info::KeyInfo; use grovedb::batch::{GroveOp, KeyInfoPath}; use grovedb::operations::delete::DeleteOptions; +use grovedb::BackwardReferencesPolicy; use grovedb::{Element, GroveDb, TransactionArg}; use grovedb_path::SubtreePath; use grovedb_storage::rocksdb_storage::RocksDbStorage; @@ -29,7 +30,7 @@ impl Drive { let mut current_batch_operations = LowLevelDriveOperation::grovedb_operations_batch(drive_operations); let options = DeleteOptions { - propagate_backward_references: false, + backward_references_policy: BackwardReferencesPolicy::Maintain, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs index 2d1b08a6c3a..73f62f3e4a1 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs @@ -8,6 +8,7 @@ use crate::util::batch::GroveDbOpBatch; use crate::util::grove_operations::push_drive_operation_result; use crate::util::storage_flags::StorageFlags; use grovedb::batch::{BatchApplyOptions, QualifiedGroveDbOp}; +use grovedb::BackwardReferencesPolicy; use grovedb::TransactionArg; use platform_version::version::drive_versions::DriveVersion; @@ -63,7 +64,7 @@ impl Drive { let cost_context = self.grove.apply_batch_with_element_flags_update( ops.operations, Some(BatchApplyOptions { - propagate_backward_references: false, + backward_references_policy: BackwardReferencesPolicy::Maintain, validate_insertion_does_not_override: validate, validate_insertion_does_not_override_tree: validate, disable_operation_consistency_check: !self.config.batching_consistency_verification, diff --git a/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs index f1e87a64598..9ed5c2ab884 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs @@ -8,6 +8,7 @@ use crate::util::batch::GroveDbOpBatch; use crate::util::grove_operations::push_drive_operation_result; use crate::util::storage_flags::{MergingOwnersStrategy, StorageFlags}; use grovedb::batch::{BatchApplyOptions, OpsByLevelPath, QualifiedGroveDbOp}; +use grovedb::BackwardReferencesPolicy; use grovedb::TransactionArg; use grovedb_costs::storage_cost::removal::StorageRemovedBytes::BasicStorageRemoval; use grovedb_costs::storage_cost::transition::OperationStorageTransitionType; @@ -48,7 +49,7 @@ impl Drive { let cost_context = self.grove.apply_partial_batch_with_element_flags_update( ops.operations, Some(BatchApplyOptions { - propagate_backward_references: false, + backward_references_policy: BackwardReferencesPolicy::Maintain, validate_insertion_does_not_override: validate, validate_insertion_does_not_override_tree: validate, disable_operation_consistency_check: false, diff --git a/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs index 3d8573a61b2..d663ae8c7d2 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs @@ -6,6 +6,7 @@ use crate::util::batch::GroveDbOpBatch; use crate::util::grove_operations::push_drive_operation_result; use grovedb::batch::estimated_costs::EstimatedCostsType::AverageCaseCostsType; use grovedb::batch::{BatchApplyOptions, KeyInfoPath}; +use grovedb::BackwardReferencesPolicy; use grovedb::{EstimatedLayerInformation, GroveDb}; use platform_version::version::drive_versions::DriveVersion; use std::collections::HashMap; @@ -24,7 +25,7 @@ impl Drive { AverageCaseCostsType(estimated_layer_info), ops.operations, Some(BatchApplyOptions { - propagate_backward_references: false, + backward_references_policy: BackwardReferencesPolicy::Maintain, validate_insertion_does_not_override: validate, validate_insertion_does_not_override_tree: validate, disable_operation_consistency_check: false, diff --git a/packages/rs-drive/src/util/grove_operations/grove_clear/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_clear/v0/mod.rs index 41588184c93..22986fb12d9 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_clear/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_clear/v0/mod.rs @@ -1,6 +1,7 @@ use crate::drive::Drive; use crate::error::Error; use grovedb::operations::delete::ClearOptions; +use grovedb::BackwardReferencesPolicy; use grovedb::TransactionArg; use grovedb_path::SubtreePath; use platform_version::version::drive_versions::DriveVersion; @@ -14,6 +15,7 @@ impl Drive { drive_version: &DriveVersion, ) -> Result<(), Error> { let options = ClearOptions { + backward_references_policy: BackwardReferencesPolicy::Maintain, check_for_subtrees: false, allow_deleting_subtrees: false, trying_to_clear_with_subtrees_returns_error: false, diff --git a/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs index c34356d26de..c092e87fd5b 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs @@ -3,6 +3,7 @@ use crate::error::Error; use crate::fees::op::LowLevelDriveOperation; use crate::util::grove_operations::push_drive_operation_result; use grovedb::operations::delete::DeleteOptions; +use grovedb::BackwardReferencesPolicy; use grovedb::TransactionArg; use grovedb_path::SubtreePath; use platform_version::version::drive_versions::DriveVersion; @@ -18,7 +19,7 @@ impl Drive { drive_version: &DriveVersion, ) -> Result<(), Error> { let options = DeleteOptions { - propagate_backward_references: false, + backward_references_policy: BackwardReferencesPolicy::Maintain, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-platform-version/Cargo.toml b/packages/rs-platform-version/Cargo.toml index 6ccfd107121..32d778eb63f 100644 --- a/packages/rs-platform-version/Cargo.toml +++ b/packages/rs-platform-version/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" thiserror = { version = "2.0.12" } bincode = { workspace = true } versioned-feature-core = "1.0.0" -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6" } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d" } [features] mock-versions = [] diff --git a/packages/rs-platform-wallet/Cargo.toml b/packages/rs-platform-wallet/Cargo.toml index 68fc1d68fa7..7f77edbdc6a 100644 --- a/packages/rs-platform-wallet/Cargo.toml +++ b/packages/rs-platform-wallet/Cargo.toml @@ -61,7 +61,7 @@ zeroize = "1" log = "0.4" # Shielded pool (optional, behind `shielded` feature) -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d", optional = true } # Direct `rusqlite` access so `FileBackedShieldedStore::open_path` can set # WAL + synchronous=NORMAL pragmas before handing the connection to # `ClientPersistentCommitmentTree`. Version locked to match the rev grovedb diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index b7a246aedb5..ecba91a7b91 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -18,7 +18,7 @@ drive = { path = "../rs-drive", default-features = false, features = [ ] } drive-proof-verifier = { path = "../rs-drive-proof-verifier", default-features = false } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "985ece6574f5fc8fe80db7b304a9a701c0f4afa6", features = [ +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d", features = [ "client", "sqlite", ], optional = true } From f8217e40d49bc3f2d3b7222be9d7a334cbb9f021 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sat, 12 Sep 2026 00:20:40 +0700 Subject: [PATCH 09/20] fix(drive): select the Skip backward-reference policy for GroveDB V4 writes Drive stores no backward-reference participants, so GroveDB's default Maintain policy had nothing to keep consistent, while its participant scans of removed index subtrees raised PV14 processing fees on document deletes, transfers and purchases by 5 to 23 percent. Skip routes every Drive write through the released V4 executor paths, which returns the twelve drive-abci PV14 fee baselines to their existing values. Flip to Maintain under a new protocol version once Drive stores participants. Co-Authored-By: Claude Fable 5.1 --- .../batch/tests/document/deletion.rs | 11 +++------- .../batch/tests/document/dpns.rs | 6 ++---- .../batch/tests/document/nft.rs | 15 +++---------- .../batch/tests/document/replacement.rs | 6 ++---- .../batch/tests/document/transfer.rs | 21 +++++-------------- .../batch/tests/token/burn/mod.rs | 6 ++---- .../grove_operations/batch_delete/v0/mod.rs | 3 ++- .../v0/mod.rs | 3 ++- .../grove_operations/batch_move/v0/mod.rs | 3 ++- .../batch_move_items_in_path_query/v0/mod.rs | 3 ++- .../batch_remove_raw/v0/mod.rs | 3 ++- .../v0/mod.rs | 3 ++- .../v0/mod.rs | 3 ++- .../grove_batch_operations_costs/v0/mod.rs | 3 ++- .../grove_operations/grove_clear/v0/mod.rs | 3 ++- .../grove_operations/grove_delete/v0/mod.rs | 3 ++- 16 files changed, 37 insertions(+), 58 deletions(-) diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs index dce2f49021b..27bcd8a748b 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs @@ -11,10 +11,8 @@ mod deletion_tests { run_document_delete_on_document_type_that_is_mutable_and_can_be_deleted_at_protocol_version( PlatformVersion::latest().protocol_version, // v14: the deleted document carries the contract-version stamp - // (one stored byte, five estimated), and GroveDB V4 maintains backward - // references by default, so the index subtrees the delete empties are - // scanned for participants before the batch removes them - 1868020, + // (one stored byte, five estimated), shifting processing costs + 1699620, ) .await; } @@ -605,10 +603,7 @@ mod deletion_tests { async fn test_document_delete_on_document_type_that_is_not_mutable_and_can_be_deleted() { run_document_delete_on_document_type_that_is_not_mutable_and_can_be_deleted_at_protocol_version( PlatformVersion::latest().protocol_version, - // v14: GroveDB V4 maintains backward references by default, so the - // index subtrees this transition empties are scanned for participants - // before the batch removes them - 3407080, + 2778700, ) .await; } diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns.rs index 1a264cc8db3..3ed94b01192 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns.rs @@ -23,9 +23,7 @@ mod dpns_tests { async fn test_dpns_contract_references_with_no_contested_unique_index() { run_dpns_contract_references_with_no_contested_unique_index_at_protocol_version( PlatformVersion::latest().protocol_version, - // v14: GroveDB V4 prepares the batch through retained Merk nodes, - // which bills slightly fewer reads than the V3 path - 6_006_380, + 6_010_380, ) .await; } @@ -36,7 +34,7 @@ mod dpns_tests { /// trigger context's add_operation never called on v0). Pinned so /// v11 chain history stays bit-for-bit reproducible. /// - /// Delta at PV12 (6_010_380): 6_010_380 - 5_978_080 = 32_300 credits = T1 + T2 + /// Delta vs PV12: 6_010_380 - 5_978_080 = 32_300 credits = T1 + T2 /// query costs across 3 subdomain creates (~10,767 per transition, /// or ~5,383 per query). #[tokio::test] diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/nft.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/nft.rs index 4a01e56e4b1..902a665fdcf 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/nft.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/nft.rs @@ -411,10 +411,7 @@ mod nft_tests { PlatformVersion::latest().protocol_version, 126440160, 2485600, - // v14: GroveDB V4 maintains backward references by default, so the - // index subtrees this transition empties are scanned for participants - // before the batch removes them - 4339640, + 4092360, ) .await; } @@ -837,10 +834,7 @@ mod nft_tests { 141238960, 2729120, 2733160, - // v14: GroveDB V4 maintains backward references by default, so the - // index subtrees this transition empties are scanned for participants - // before the batch removes them - 4610480, + 4357440, ) .await; } @@ -1420,10 +1414,7 @@ mod nft_tests { PlatformVersion::latest().protocol_version, 126440160, 2485600, - // v14: GroveDB V4 maintains backward references by default, so the - // index subtrees this transition empties are scanned for participants - // before the batch removes them - 4339640, + 4092360, ) .await; } diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs index 06a0f4dcc21..5b9c07a62c0 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs @@ -498,10 +498,8 @@ mod replacement_tests { async fn test_document_replace_on_document_type_that_is_mutable() { run_document_replace_on_document_type_that_is_mutable_at_protocol_version( PlatformVersion::latest().protocol_version, - // v14: replaced documents carry the contract-version stamp, and GroveDB - // V4 prepares the batch through retained Merk nodes, which bills - // slightly fewer reads than the V3 path - 1428320, + // v14: replaced documents carry the contract-version stamp + 1433220, ) .await; } diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/transfer.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/transfer.rs index dc0a951abd4..e8f51ec6344 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/transfer.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/transfer.rs @@ -213,10 +213,7 @@ mod transfer_tests { async fn test_document_transfer_on_document_type_that_is_transferable_before_creator_id() { run_document_transfer_on_document_type_that_is_transferable_before_creator_id_at_protocol_version( PlatformVersion::latest().protocol_version, - // v14: GroveDB V4 maintains backward references by default, so the - // index subtrees this transition empties are scanned for participants - // before the batch removes them - 3579040, + 3380960, ) .await; } @@ -501,10 +498,8 @@ mod transfer_tests { async fn test_document_transfer_on_document_type_that_is_transferable() { run_document_transfer_on_document_type_that_is_transferable_at_protocol_version( PlatformVersion::latest().protocol_version, - // v14: transferred documents carry the contract-version stamp, and - // GroveDB V4 scans the index subtrees the transfer empties for - // backward-reference participants before the batch removes them - 3841940, + // v14: transferred documents carry the contract-version stamp + 3643860, ) .await; } @@ -802,10 +797,7 @@ mod transfer_tests { async fn test_document_transfer_on_document_type_that_is_transferable_contract_v0() { run_document_transfer_on_document_type_that_is_transferable_contract_v0_at_protocol_version( PlatformVersion::latest().protocol_version, - // v14: GroveDB V4 maintains backward references by default, so the - // index subtrees this transition empties are scanned for participants - // before the batch removes them - 3579040, + 3380960, ) .await; } @@ -1499,10 +1491,7 @@ mod transfer_tests { async fn test_document_delete_after_transfer() { run_document_delete_after_transfer_at_protocol_version( PlatformVersion::latest().protocol_version, - // v14: stamped documents (see transferable baseline note); GroveDB V4 - // scans the index subtrees the transfer empties for backward-reference - // participants before the batch removes them - 4252000, + 4004720, // v14: stamped documents (see transferable baseline note) ) .await; } diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/burn/mod.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/burn/mod.rs index cc7d35f33b0..32d40c65338 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/burn/mod.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/burn/mod.rs @@ -3959,10 +3959,8 @@ mod token_burn_tests { run_token_burn_group_action_confirmer_fee_includes_transformer_reads_at_protocol_version( PlatformVersion::latest().protocol_version, // PROTOCOL_VERSION_14: +400 — genesis system documents now carry - // the contract-version stamp, shifting byte-billed subtree reads; - // +56_660: GroveDB V4 maintains backward references by default and - // scans the subtrees the confirmer removes for participants first - 4_424_940, + // the contract-version stamp, shifting byte-billed subtree reads + 4_368_280, ) .await; } diff --git a/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs index f3addefb87e..70794e63e4c 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs @@ -24,7 +24,8 @@ impl Drive { drive_version: &DriveVersion, ) -> Result<(), Error> { let options = DeleteOptions { - backward_references_policy: BackwardReferencesPolicy::Maintain, + // Drive stores no backward-reference participants; Skip keeps the released V4 path. + backward_references_policy: BackwardReferencesPolicy::Skip, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs index c6f6888ee46..87bcd78dac2 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs @@ -81,7 +81,8 @@ impl Drive { let current_batch_operations = LowLevelDriveOperation::grovedb_operations_batch(drive_operations); let options = DeleteOptions { - backward_references_policy: BackwardReferencesPolicy::Maintain, + // Drive stores no backward-reference participants; Skip keeps the released V4 path. + backward_references_policy: BackwardReferencesPolicy::Skip, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs index aec2ea9c915..58d3e058bd3 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs @@ -61,7 +61,8 @@ impl Drive { // ── 2. Build the delete op ────────────────────────────────────────── let current_batch = LowLevelDriveOperation::grovedb_operations_batch(drive_operations); let delete_opts = DeleteOptions { - backward_references_policy: BackwardReferencesPolicy::Maintain, + // Drive stores no backward-reference participants; Skip keeps the released V4 path. + backward_references_policy: BackwardReferencesPolicy::Skip, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs index cc0895e1383..09581042750 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs @@ -87,7 +87,8 @@ impl Drive { let current_batch_operations = LowLevelDriveOperation::grovedb_operations_batch(drive_operations); let options = DeleteOptions { - backward_references_policy: BackwardReferencesPolicy::Maintain, + // Drive stores no backward-reference participants; Skip keeps the released V4 path. + backward_references_policy: BackwardReferencesPolicy::Skip, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs index b510a9dffbd..236654eef90 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs @@ -30,7 +30,8 @@ impl Drive { let mut current_batch_operations = LowLevelDriveOperation::grovedb_operations_batch(drive_operations); let options = DeleteOptions { - backward_references_policy: BackwardReferencesPolicy::Maintain, + // Drive stores no backward-reference participants; Skip keeps the released V4 path. + backward_references_policy: BackwardReferencesPolicy::Skip, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs index 73f62f3e4a1..842f8a102a6 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs @@ -64,7 +64,8 @@ impl Drive { let cost_context = self.grove.apply_batch_with_element_flags_update( ops.operations, Some(BatchApplyOptions { - backward_references_policy: BackwardReferencesPolicy::Maintain, + // Drive stores no backward-reference participants; Skip keeps the released V4 path. + backward_references_policy: BackwardReferencesPolicy::Skip, validate_insertion_does_not_override: validate, validate_insertion_does_not_override_tree: validate, disable_operation_consistency_check: !self.config.batching_consistency_verification, diff --git a/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs index 9ed5c2ab884..6f896a2000e 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs @@ -49,7 +49,8 @@ impl Drive { let cost_context = self.grove.apply_partial_batch_with_element_flags_update( ops.operations, Some(BatchApplyOptions { - backward_references_policy: BackwardReferencesPolicy::Maintain, + // Drive stores no backward-reference participants; Skip keeps the released V4 path. + backward_references_policy: BackwardReferencesPolicy::Skip, validate_insertion_does_not_override: validate, validate_insertion_does_not_override_tree: validate, disable_operation_consistency_check: false, diff --git a/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs index d663ae8c7d2..df80e50103e 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs @@ -25,7 +25,8 @@ impl Drive { AverageCaseCostsType(estimated_layer_info), ops.operations, Some(BatchApplyOptions { - backward_references_policy: BackwardReferencesPolicy::Maintain, + // Drive stores no backward-reference participants; Skip keeps the released V4 path. + backward_references_policy: BackwardReferencesPolicy::Skip, validate_insertion_does_not_override: validate, validate_insertion_does_not_override_tree: validate, disable_operation_consistency_check: false, diff --git a/packages/rs-drive/src/util/grove_operations/grove_clear/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_clear/v0/mod.rs index 22986fb12d9..2531843378c 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_clear/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_clear/v0/mod.rs @@ -15,7 +15,8 @@ impl Drive { drive_version: &DriveVersion, ) -> Result<(), Error> { let options = ClearOptions { - backward_references_policy: BackwardReferencesPolicy::Maintain, + // Drive stores no backward-reference participants; Skip keeps the released V4 path. + backward_references_policy: BackwardReferencesPolicy::Skip, check_for_subtrees: false, allow_deleting_subtrees: false, trying_to_clear_with_subtrees_returns_error: false, diff --git a/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs index c092e87fd5b..43f2c262961 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs @@ -19,7 +19,8 @@ impl Drive { drive_version: &DriveVersion, ) -> Result<(), Error> { let options = DeleteOptions { - backward_references_policy: BackwardReferencesPolicy::Maintain, + // Drive stores no backward-reference participants; Skip keeps the released V4 path. + backward_references_policy: BackwardReferencesPolicy::Skip, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, From 24f91bf5c77bb5ca1087c3aeb523f429ef7ab8bb Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sat, 12 Sep 2026 17:24:32 +0700 Subject: [PATCH 10/20] build(drive)!: adopt GroveDB #953's per-operation backward-reference declarations Advance the GroveDB pin to the head of dashpay/grovedb#953 (08003fa2), which replaces #951's batch-level Maintain/Skip policy with a declaration on every operation, DisplacedValue::{MayBeParticipant, NotParticipant}, carried by InsertOptions, DeleteOptions, ClearOptions and each QualifiedGroveDbOp, and drops the per-layer estimator flag. Drive stores no backward-reference participants, so every op it hands to GroveDB is declared NotParticipant at the three places Drive applies or estimates a batch (declaring_no_participants), and its live delete and clear options say the same. GroveDB checks the claim for free from the value it reads for the write and refuses a false one, so the declaration cannot corrupt state. The 165 may_contain_backward_references layer fields go away with the field. GroveDB V4 now keeps its single prepared write path for Drive: the participant scans that raised PV14 delete, transfer and purchase fees under Maintain are gone, and the retained-node read saving of #951 stays, so DPNS domain create and document replace are re-pinned 4,000 and 4,900 credits lower. Every other baseline is unchanged; PV13 stays on GroveDB V3. Co-Authored-By: Claude Fable 5.1 --- Cargo.lock | 32 +++++++++---------- packages/rs-dpp/Cargo.toml | 2 +- packages/rs-drive-abci/Cargo.toml | 8 ++--- .../batch/tests/document/dpns.rs | 6 ++-- .../batch/tests/document/replacement.rs | 6 ++-- packages/rs-drive/Cargo.toml | 14 ++++---- .../for_address_balance_update/v0/mod.rs | 3 -- .../for_address_balance_update/v1/mod.rs | 3 -- .../v0/mod.rs | 2 -- .../v0/mod.rs | 3 -- .../v1/mod.rs | 3 -- .../v0/mod.rs | 1 - .../v0/mod.rs | 2 -- .../v1/mod.rs | 2 -- .../v2/mod.rs | 2 -- .../v0/mod.rs | 2 -- .../v1/mod.rs | 2 -- .../v2/mod.rs | 2 -- .../v0/mod.rs | 2 -- .../v1/mod.rs | 2 -- .../v0/mod.rs | 1 - .../v0/mod.rs | 3 -- .../v0/mod.rs | 2 -- .../v1/mod.rs | 2 -- .../v2/mod.rs | 2 -- .../v0/mod.rs | 2 -- .../v1/mod.rs | 2 -- .../v2/mod.rs | 2 -- .../mod.rs | 4 --- .../v0/mod.rs | 2 -- .../v0/mod.rs | 2 -- .../v0/mod.rs | 2 -- .../v0/mod.rs | 2 -- .../v0/mod.rs | 2 -- .../for_add_group_action/v0/mod.rs | 10 ------ .../estimated_costs/for_add_groups/v0/mod.rs | 4 --- .../v0/mod.rs | 1 - .../estimation_costs/for_balances/v0/mod.rs | 2 -- .../for_identity_contract_info/v0/mod.rs | 4 --- .../v0/mod.rs | 1 - .../v0/mod.rs | 1 - .../v0/mod.rs | 1 - .../for_keys_for_identity_id/v0/mod.rs | 4 --- .../for_negative_credit/v0/mod.rs | 2 -- .../v0/mod.rs | 1 - .../for_root_key_reference_tree/v0/mod.rs | 1 - .../for_update_nonce/v0/mod.rs | 3 -- .../for_update_revision/v0/mod.rs | 3 -- .../v0/mod.rs | 2 -- .../v0/mod.rs | 1 - .../v0/mod.rs | 3 -- .../v0/mod.rs | 7 ---- .../v0/mod.rs | 5 --- .../v0/mod.rs | 2 -- .../v0/mod.rs | 2 -- .../src/drive/shielded/estimated_costs.rs | 7 ---- .../for_total_system_credits_update/v0/mod.rs | 2 -- .../v0/mod.rs | 1 - .../v0/mod.rs | 2 -- .../v0/mod.rs | 3 -- .../for_token_balances/v0/mod.rs | 4 --- .../for_token_contract_infos/v0/mod.rs | 3 -- .../for_token_direct_selling_prices/v0/mod.rs | 3 -- .../for_token_identity_infos/v0/mod.rs | 4 --- .../v0/mod.rs | 3 -- .../v0/mod.rs | 4 --- .../for_token_status_infos/v0/mod.rs | 3 -- .../for_token_total_supply/v0/mod.rs | 3 -- .../v0/mod.rs | 2 -- .../grove_operations/batch_delete/v0/mod.rs | 7 ++-- .../v0/mod.rs | 7 ++-- .../grove_operations/batch_move/v0/mod.rs | 7 ++-- .../batch_move_items_in_path_query/v0/mod.rs | 7 ++-- .../batch_remove_raw/v0/mod.rs | 7 ++-- .../v0/mod.rs | 7 ++-- .../v0/mod.rs | 7 ++-- .../grove_batch_operations_costs/v0/mod.rs | 7 ++-- .../grove_operations/grove_clear/v0/mod.rs | 7 ++-- .../grove_operations/grove_delete/v0/mod.rs | 7 ++-- .../rs-drive/src/util/grove_operations/mod.rs | 19 +++++++++++ .../tests/drive_storage_ops_coverage.rs | 3 +- packages/rs-platform-version/Cargo.toml | 2 +- packages/rs-platform-wallet/Cargo.toml | 2 +- packages/rs-sdk/Cargo.toml | 2 +- 84 files changed, 94 insertions(+), 237 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ad9b2c7c3ac..2aa1550d2c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2957,7 +2957,7 @@ dependencies = [ [[package]] name = "grovedb" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" +source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" dependencies = [ "axum 0.8.9", "blake3", @@ -3016,7 +3016,7 @@ dependencies = [ [[package]] name = "grovedb-bulk-append-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" +source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" dependencies = [ "blake3", "grovedb-bincode", @@ -3034,7 +3034,7 @@ dependencies = [ [[package]] name = "grovedb-commitment-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" +source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3051,7 +3051,7 @@ dependencies = [ [[package]] name = "grovedb-costs" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" +source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" dependencies = [ "integer-encoding", "intmap", @@ -3061,7 +3061,7 @@ dependencies = [ [[package]] name = "grovedb-dense-fixed-sized-merkle-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" +source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" dependencies = [ "blake3", "grovedb-bincode", @@ -3075,7 +3075,7 @@ dependencies = [ [[package]] name = "grovedb-element" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" +source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" dependencies = [ "grovedb-bincode", "grovedb-bincode-derive", @@ -3091,7 +3091,7 @@ dependencies = [ [[package]] name = "grovedb-epoch-based-storage-flags" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" +source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" dependencies = [ "grovedb-costs", "hex", @@ -3103,7 +3103,7 @@ dependencies = [ [[package]] name = "grovedb-merk" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" +source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" dependencies = [ "blake3", "byteorder", @@ -3129,7 +3129,7 @@ dependencies = [ [[package]] name = "grovedb-merkle-mountain-range" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" +source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" dependencies = [ "blake3", "grovedb-bincode", @@ -3142,7 +3142,7 @@ dependencies = [ [[package]] name = "grovedb-path" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" +source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" dependencies = [ "hex", ] @@ -3150,7 +3150,7 @@ dependencies = [ [[package]] name = "grovedb-private-document-store" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" +source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3163,7 +3163,7 @@ dependencies = [ [[package]] name = "grovedb-query" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" +source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" dependencies = [ "byteorder", "ed", @@ -3179,7 +3179,7 @@ dependencies = [ [[package]] name = "grovedb-storage" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" +source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" dependencies = [ "blake3", "grovedb-costs", @@ -3198,7 +3198,7 @@ dependencies = [ [[package]] name = "grovedb-version" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" +source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" dependencies = [ "thiserror 2.0.18", "versioned-feature-core", @@ -3207,7 +3207,7 @@ dependencies = [ [[package]] name = "grovedb-visualize" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" +source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" dependencies = [ "hex", "itertools 0.14.0", @@ -3216,7 +3216,7 @@ dependencies = [ [[package]] name = "grovedbg-types" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=f75fa36230902b983d231572b6aa2c17eb72cf7d#f75fa36230902b983d231572b6aa2c17eb72cf7d" +source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" dependencies = [ "serde", "serde_with 3.21.0", diff --git a/packages/rs-dpp/Cargo.toml b/packages/rs-dpp/Cargo.toml index fff564fcc18..8be6fdb5680 100644 --- a/packages/rs-dpp/Cargo.toml +++ b/packages/rs-dpp/Cargo.toml @@ -76,7 +76,7 @@ strum = { version = "0.26", features = ["derive"] } json-schema-compatibility-validator = { path = '../rs-json-schema-compatibility-validator', optional = true } once_cell = "1.19.0" tracing = { version = "0.1.41" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2", optional = true } [dev-dependencies] tokio = { version = "1.40", features = ["full"] } diff --git a/packages/rs-drive-abci/Cargo.toml b/packages/rs-drive-abci/Cargo.toml index 4804fd79ad5..aec40b8d50c 100644 --- a/packages/rs-drive-abci/Cargo.toml +++ b/packages/rs-drive-abci/Cargo.toml @@ -82,7 +82,7 @@ derive_more = { version = "1.0", features = ["from", "deref", "deref_mut"] } async-trait = "0.1.77" console-subscriber = { version = "0.4", optional = true } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f", optional = true } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d" } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2" } nonempty = "0.11" # Shielded-pool snapshot needs raw RocksDB SstFileWriter + ingest_external_file_cf # bindings, and blake3 for the snapshot-file checksum. @@ -108,7 +108,7 @@ dpp = { path = "../rs-dpp", default-features = false, features = [ drive = { path = "../rs-drive", features = ["fixtures-and-mocks"] } drive-proof-verifier = { path = "../rs-drive-proof-verifier" } strategy-tests = { path = "../strategy-tests" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d", features = ["client"] } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2", features = ["client"] } assert_matches = "1.5.0" drive-abci = { path = ".", features = ["testing-config", "mocks", "shielded_test_data"] } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f" } @@ -122,8 +122,8 @@ integer-encoding = { version = "4.0.0" } # For dump_only_default_and_aux_cfs_under_shielded_subtree_prefix — same # subtree-prefix algorithm grovedb uses internally. -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d" } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2" } [features] default = ["bls-signatures"] diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns.rs index 3ed94b01192..9d6927cc46b 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns.rs @@ -23,7 +23,9 @@ mod dpns_tests { async fn test_dpns_contract_references_with_no_contested_unique_index() { run_dpns_contract_references_with_no_contested_unique_index_at_protocol_version( PlatformVersion::latest().protocol_version, - 6_010_380, + // v14: GroveDB V4 writes through the Merk node it retains from + // reading the old value, billing one fewer seek than the V3 path + 6_006_380, ) .await; } @@ -34,7 +36,7 @@ mod dpns_tests { /// trigger context's add_operation never called on v0). Pinned so /// v11 chain history stays bit-for-bit reproducible. /// - /// Delta vs PV12: 6_010_380 - 5_978_080 = 32_300 credits = T1 + T2 + /// Delta at PV12 (6_010_380): 6_010_380 - 5_978_080 = 32_300 credits = T1 + T2 /// query costs across 3 subdomain creates (~10,767 per transition, /// or ~5,383 per query). #[tokio::test] diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs index 5b9c07a62c0..8e8ca006643 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs @@ -498,8 +498,10 @@ mod replacement_tests { async fn test_document_replace_on_document_type_that_is_mutable() { run_document_replace_on_document_type_that_is_mutable_at_protocol_version( PlatformVersion::latest().protocol_version, - // v14: replaced documents carry the contract-version stamp - 1433220, + // v14: replaced documents carry the contract-version stamp, and + // GroveDB V4 writes through the Merk node it retains from reading + // the old value, billing slightly fewer reads than the V3 path + 1428320, ) .await; } diff --git a/packages/rs-drive/Cargo.toml b/packages/rs-drive/Cargo.toml index bf85c7ead4c..05c85e8d9c0 100644 --- a/packages/rs-drive/Cargo.toml +++ b/packages/rs-drive/Cargo.toml @@ -52,13 +52,13 @@ enum-map = { version = "2.0.3", optional = true } intmap = { version = "3.0.1", features = ["serde"], optional = true } chrono = { version = "0.4.35", optional = true } itertools = { version = "0.13", optional = true } -grovedb = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d", optional = true, default-features = false } -grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d", optional = true } -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d" } -grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d", optional = true } -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d" } -grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d" } +grovedb = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2", optional = true, default-features = false } +grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2", optional = true } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2" } +grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2", optional = true } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2" } +grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2" } [dev-dependencies] criterion = "0.5" diff --git a/packages/rs-drive/src/drive/address_funds/estimated_costs/for_address_balance_update/v0/mod.rs b/packages/rs-drive/src/drive/address_funds/estimated_costs/for_address_balance_update/v0/mod.rs index 490f70ff5d0..e63ca81ff23 100644 --- a/packages/rs-drive/src/drive/address_funds/estimated_costs/for_address_balance_update/v0/mod.rs +++ b/packages/rs-drive/src/drive/address_funds/estimated_costs/for_address_balance_update/v0/mod.rs @@ -45,7 +45,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: AllSubtrees( 1, @@ -71,7 +70,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(Self::addresses_path()), EstimatedLayerInformation { tree_type: TreeType::SumTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees( 1, @@ -98,7 +96,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(Self::clear_addresses_path()), EstimatedLayerInformation { tree_type: TreeType::CountSumTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( PLATFORM_ADDRESS_KEY_SIZE as u8, diff --git a/packages/rs-drive/src/drive/address_funds/estimated_costs/for_address_balance_update/v1/mod.rs b/packages/rs-drive/src/drive/address_funds/estimated_costs/for_address_balance_update/v1/mod.rs index 533fb309c46..8d3e7339e96 100644 --- a/packages/rs-drive/src/drive/address_funds/estimated_costs/for_address_balance_update/v1/mod.rs +++ b/packages/rs-drive/src/drive/address_funds/estimated_costs/for_address_balance_update/v1/mod.rs @@ -34,7 +34,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: AllSubtrees( 1, @@ -59,7 +58,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(Self::addresses_path()), EstimatedLayerInformation { tree_type: TreeType::SumTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees( 1, @@ -87,7 +85,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(Self::clear_addresses_path()), EstimatedLayerInformation { tree_type: TreeType::CountSumTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItemsWithSumItem( PLATFORM_ADDRESS_KEY_SIZE as u8, diff --git a/packages/rs-drive/src/drive/asset_lock/estimation_costs/add_estimation_costs_for_adding_asset_lock/v0/mod.rs b/packages/rs-drive/src/drive/asset_lock/estimation_costs/add_estimation_costs_for_adding_asset_lock/v0/mod.rs index daa079da412..efb0c2c34bb 100644 --- a/packages/rs-drive/src/drive/asset_lock/estimation_costs/add_estimation_costs_for_adding_asset_lock/v0/mod.rs +++ b/packages/rs-drive/src/drive/asset_lock/estimation_costs/add_estimation_costs_for_adding_asset_lock/v0/mod.rs @@ -62,7 +62,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: AllSubtrees( 12, // 32 + 1 + 1 / 3 @@ -86,7 +85,6 @@ impl Drive { KeyInfoPath::from_known_path(asset_lock_storage_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( 36, //The size of an outpoint diff --git a/packages/rs-drive/src/drive/contract/estimation_costs/add_estimation_costs_for_contract_insertion/v0/mod.rs b/packages/rs-drive/src/drive/contract/estimation_costs/add_estimation_costs_for_contract_insertion/v0/mod.rs index 511170b1d02..2ea0ebc206c 100644 --- a/packages/rs-drive/src/drive/contract/estimation_costs/add_estimation_costs_for_contract_insertion/v0/mod.rs +++ b/packages/rs-drive/src/drive/contract/estimation_costs/add_estimation_costs_for_contract_insertion/v0/mod.rs @@ -62,7 +62,6 @@ impl Drive { ), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(2), estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_INDEX_NAME_SIZE, @@ -82,7 +81,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(0, true), estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_INDEX_NAME_SIZE, @@ -106,7 +104,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(AVERAGE_NUMBER_OF_UPDATES as u32), estimated_layer_sizes: Mix { subtrees_size: None, diff --git a/packages/rs-drive/src/drive/contract/estimation_costs/add_estimation_costs_for_contract_insertion/v1/mod.rs b/packages/rs-drive/src/drive/contract/estimation_costs/add_estimation_costs_for_contract_insertion/v1/mod.rs index 33a4a79e42f..6c3a3fd5025 100644 --- a/packages/rs-drive/src/drive/contract/estimation_costs/add_estimation_costs_for_contract_insertion/v1/mod.rs +++ b/packages/rs-drive/src/drive/contract/estimation_costs/add_estimation_costs_for_contract_insertion/v1/mod.rs @@ -97,7 +97,6 @@ impl Drive { ), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(2), estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_INDEX_NAME_SIZE, @@ -165,7 +164,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(0, true), estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_INDEX_NAME_SIZE, @@ -189,7 +187,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(AVERAGE_NUMBER_OF_UPDATES as u32), estimated_layer_sizes: Mix { subtrees_size: None, diff --git a/packages/rs-drive/src/drive/document/delete/internal/add_estimation_costs_for_remove_document_to_primary_storage/v0/mod.rs b/packages/rs-drive/src/drive/document/delete/internal/add_estimation_costs_for_remove_document_to_primary_storage/v0/mod.rs index bd87fa726b3..f96fafe4fe3 100644 --- a/packages/rs-drive/src/drive/document/delete/internal/add_estimation_costs_for_remove_document_to_primary_storage/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/internal/add_estimation_costs_for_remove_document_to_primary_storage/v0/mod.rs @@ -70,7 +70,6 @@ impl Drive { KeyInfoPath::from_known_path(primary_key_path), EstimatedLayerInformation { tree_type: primary_key_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v0/mod.rs index 00921b9d799..9da9dae15cf 100644 --- a/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v0/mod.rs @@ -67,7 +67,6 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: current_layer_tree_type, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -143,7 +142,6 @@ impl Drive { sub_level_index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: property_name_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v1/mod.rs b/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v1/mod.rs index f7bb76a20bd..924722b934c 100644 --- a/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v1/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v1/mod.rs @@ -73,7 +73,6 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: parent_value_tree_type, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -193,7 +192,6 @@ impl Drive { sub_level_index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: property_name_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v2/mod.rs b/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v2/mod.rs index eaaf1a8124e..a26cf2b9047 100644 --- a/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v2/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/remove_indices_for_index_level_for_contract_operations/v2/mod.rs @@ -73,7 +73,6 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: parent_value_tree_type, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -151,7 +150,6 @@ impl Drive { sub_level_index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: property_name_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v0/mod.rs index 6d7b452bad9..ef129d79a32 100644 --- a/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v0/mod.rs @@ -70,7 +70,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(contract_document_type_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -131,7 +130,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(index_path.clone()), EstimatedLayerInformation { tree_type: property_name_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v1/mod.rs b/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v1/mod.rs index 407fa8bf41a..d1e74ecd39a 100644 --- a/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v1/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v1/mod.rs @@ -71,7 +71,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(contract_document_type_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -175,7 +174,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(index_path.clone()), EstimatedLayerInformation { tree_type: property_name_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v2/mod.rs b/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v2/mod.rs index dc975717e99..9ae6c9cfd5d 100644 --- a/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v2/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/remove_indices_for_top_index_level_for_contract_operations/v2/mod.rs @@ -93,7 +93,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(contract_document_type_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -187,7 +186,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(index_path.clone()), EstimatedLayerInformation { tree_type: property_name_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v0/mod.rs index ff4a1d7bf74..b057e4bb4c5 100644 --- a/packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v0/mod.rs @@ -88,7 +88,6 @@ impl Drive { key_info_path.clone(), EstimatedLayerInformation { tree_type: member_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, @@ -185,7 +184,6 @@ impl Drive { key_info_path.clone(), EstimatedLayerInformation { tree_type: reference_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v1/mod.rs b/packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v1/mod.rs index 5987b56a75a..a48f9d7b02e 100644 --- a/packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v1/mod.rs +++ b/packages/rs-drive/src/drive/document/delete/remove_reference_for_index_level_for_contract_operations/v1/mod.rs @@ -95,7 +95,6 @@ impl Drive { key_info_path.clone(), EstimatedLayerInformation { tree_type: member_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, @@ -209,7 +208,6 @@ impl Drive { key_info_path.clone(), EstimatedLayerInformation { tree_type: reference_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_contested_document_to_primary_storage/v0/mod.rs b/packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_contested_document_to_primary_storage/v0/mod.rs index 1beac769041..b8c7444e858 100644 --- a/packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_contested_document_to_primary_storage/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_contested_document_to_primary_storage/v0/mod.rs @@ -78,7 +78,6 @@ impl Drive { KeyInfoPath::from_known_path(primary_key_path), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_document_to_primary_storage/v0/mod.rs b/packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_document_to_primary_storage/v0/mod.rs index 698ca2a776f..c7f22c9f20d 100644 --- a/packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_document_to_primary_storage/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/estimation_costs/add_estimation_costs_for_add_document_to_primary_storage/v0/mod.rs @@ -87,7 +87,6 @@ impl Drive { KeyInfoPath::from_known_path(primary_key_path), EstimatedLayerInformation { tree_type: primary_key_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -148,7 +147,6 @@ impl Drive { KeyInfoPath::from_known_path(document_id_in_primary_path), EstimatedLayerInformation { tree_type: per_doc_subtree_tree_type, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(AVERAGE_NUMBER_OF_UPDATES as u32), estimated_layer_sizes: Mix { subtrees_size: None, @@ -183,7 +181,6 @@ impl Drive { KeyInfoPath::from_known_path(primary_key_path), EstimatedLayerInformation { tree_type: primary_key_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v0/mod.rs index eb4924471d0..d663ad711d8 100644 --- a/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v0/mod.rs @@ -108,7 +108,6 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: current_layer_tree_type, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -273,7 +272,6 @@ impl Drive { sub_level_index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: property_name_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v1/mod.rs b/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v1/mod.rs index 8cee9fd49ef..353264ab4bd 100644 --- a/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v1/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v1/mod.rs @@ -135,7 +135,6 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: current_layer_tree_type, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -361,7 +360,6 @@ impl Drive { sub_level_index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: property_name_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v2/mod.rs b/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v2/mod.rs index 44d809cc151..3cb13df76ee 100644 --- a/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v2/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_indices_for_index_level_for_contract_operations/v2/mod.rs @@ -153,7 +153,6 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: current_layer_tree_type, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -274,7 +273,6 @@ impl Drive { sub_level_index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: property_name_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v0/mod.rs index 3de5737916a..0e4802a0ee1 100644 --- a/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v0/mod.rs @@ -71,7 +71,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(contract_document_type_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -219,7 +218,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(index_path.clone()), EstimatedLayerInformation { tree_type: property_name_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v1/mod.rs b/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v1/mod.rs index 8256bdcda00..57d9ef64665 100644 --- a/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v1/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v1/mod.rs @@ -72,7 +72,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(contract_document_type_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -226,7 +225,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(index_path.clone()), EstimatedLayerInformation { tree_type: property_name_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v2/mod.rs b/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v2/mod.rs index 4d45e1d33e3..3b23787770c 100644 --- a/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v2/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_indices_for_top_index_level_for_contract_operations/v2/mod.rs @@ -97,7 +97,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(contract_document_type_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -216,7 +215,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(index_path.clone()), EstimatedLayerInformation { tree_type: property_name_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/insert/add_preallocated_index_tree_operations/mod.rs b/packages/rs-drive/src/drive/document/insert/add_preallocated_index_tree_operations/mod.rs index a6eb7acdfe8..a4a98b583be 100644 --- a/packages/rs-drive/src/drive/document/insert/add_preallocated_index_tree_operations/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_preallocated_index_tree_operations/mod.rs @@ -185,7 +185,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(contract_document_type_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements( referring_index_structure.sub_levels().len() as u32 + 1, ), @@ -363,7 +362,6 @@ impl Drive { path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: property_name_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( value_key_estimated_size as u8, @@ -407,7 +405,6 @@ impl Drive { path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: value_tree_type, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements( sub_level.sub_levels().len() as u32 + 1, ), @@ -480,7 +477,6 @@ impl Drive { path_info.convert_to_key_info_path(), EstimatedLayerInformation { tree_type: member_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/document/insert/add_reference_for_index_level_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/insert/add_reference_for_index_level_for_contract_operations/v0/mod.rs index f4f25af0d24..c25bb65ec5e 100644 --- a/packages/rs-drive/src/drive/document/insert/add_reference_for_index_level_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/insert/add_reference_for_index_level_for_contract_operations/v0/mod.rs @@ -193,7 +193,6 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: reference_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllReference( DEFAULT_HASH_SIZE_U8, @@ -475,7 +474,6 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: member_tree_type, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/document/insert_contested/add_contested_indices_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/insert_contested/add_contested_indices_for_contract_operations/v0/mod.rs index dd59eff4e02..9eed9dee870 100644 --- a/packages/rs-drive/src/drive/document/insert_contested/add_contested_indices_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/insert_contested/add_contested_indices_for_contract_operations/v0/mod.rs @@ -124,7 +124,6 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, @@ -189,7 +188,6 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(16), // very seldom would more than 16 people want the resource estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/document/insert_contested/add_contested_indices_for_index_level_for_contract_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/insert_contested/add_contested_indices_for_index_level_for_contract_operations/v0/mod.rs index 87cd5babf7b..1ead80bba85 100644 --- a/packages/rs-drive/src/drive/document/insert_contested/add_contested_indices_for_index_level_for_contract_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/insert_contested/add_contested_indices_for_index_level_for_contract_operations/v0/mod.rs @@ -61,7 +61,6 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(sub_level_index_count + 1), estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, @@ -136,7 +135,6 @@ impl Drive { sub_level_index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( document_top_field_estimated_size as u8, diff --git a/packages/rs-drive/src/drive/document/insert_contested/add_contested_reference_and_vote_subtree_to_document_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/insert_contested/add_contested_reference_and_vote_subtree_to_document_operations/v0/mod.rs index eaf031d4592..8aa6aa288ff 100644 --- a/packages/rs-drive/src/drive/document/insert_contested/add_contested_reference_and_vote_subtree_to_document_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/insert_contested/add_contested_reference_and_vote_subtree_to_document_operations/v0/mod.rs @@ -55,7 +55,6 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(2), estimated_layer_sizes: Mix { // The votes don't have storage flags @@ -149,7 +148,6 @@ impl Drive { votes_path_key_info.clone().convert_to_key_info_path()?, EstimatedLayerInformation { tree_type: TreeType::SumTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, U8_SIZE_U32, None), }, diff --git a/packages/rs-drive/src/drive/document/insert_contested/add_contested_vote_subtrees_for_non_identities_operations/v0/mod.rs b/packages/rs-drive/src/drive/document/insert_contested/add_contested_vote_subtrees_for_non_identities_operations/v0/mod.rs index e6e38354777..9384becf62d 100644 --- a/packages/rs-drive/src/drive/document/insert_contested/add_contested_vote_subtrees_for_non_identities_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/document/insert_contested/add_contested_vote_subtrees_for_non_identities_operations/v0/mod.rs @@ -44,7 +44,6 @@ impl Drive { index_path_info.clone().convert_to_key_info_path(), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(1), estimated_layer_sizes: Mix { // The votes don't have storage flags @@ -75,7 +74,6 @@ impl Drive { votes_path_key_info.clone().convert_to_key_info_path()?, EstimatedLayerInformation { tree_type: TreeType::SumTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, U8_SIZE_U32, None), }, diff --git a/packages/rs-drive/src/drive/group/estimated_costs/for_add_group_action/v0/mod.rs b/packages/rs-drive/src/drive/group/estimated_costs/for_add_group_action/v0/mod.rs index 9227698a963..a92b45545c4 100644 --- a/packages/rs-drive/src/drive/group/estimated_costs/for_add_group_action/v0/mod.rs +++ b/packages/rs-drive/src/drive/group/estimated_costs/for_add_group_action/v0/mod.rs @@ -81,7 +81,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: AllSubtrees( 1, @@ -106,7 +105,6 @@ impl Drive { KeyInfoPath::from_known_path(group_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // We estimate that on average we need to update 10 nodes estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -116,7 +114,6 @@ impl Drive { KeyInfoPath::from_known_path(group_contract_path(contract_id.as_slice())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(2, NoSumTrees, None), }, @@ -129,7 +126,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -142,7 +138,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -157,7 +152,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: Mix { subtrees_size: Some((1, AllSumTrees, None, 1)), @@ -177,7 +171,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::SumTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllItems(8, 1, None), }, @@ -192,7 +185,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -207,7 +199,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: Mix { subtrees_size: Some((1, AllSumTrees, None, 1)), @@ -227,7 +218,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::SumTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllItems(8, 1, None), }, diff --git a/packages/rs-drive/src/drive/group/estimated_costs/for_add_groups/v0/mod.rs b/packages/rs-drive/src/drive/group/estimated_costs/for_add_groups/v0/mod.rs index 04dacec547f..00923bcd538 100644 --- a/packages/rs-drive/src/drive/group/estimated_costs/for_add_groups/v0/mod.rs +++ b/packages/rs-drive/src/drive/group/estimated_costs/for_add_groups/v0/mod.rs @@ -37,7 +37,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: AllSubtrees( 1, @@ -62,7 +61,6 @@ impl Drive { KeyInfoPath::from_known_path(group_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // We estimate that on average we need to update 10 nodes estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -72,7 +70,6 @@ impl Drive { KeyInfoPath::from_known_path(group_contract_path(contract_id.as_slice())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(2, NoSumTrees, None), }, @@ -86,7 +83,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_authentication_keys_security_level_in_key_reference_tree/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_authentication_keys_security_level_in_key_reference_tree/v0/mod.rs index 166a4038846..529b56477f6 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_authentication_keys_security_level_in_key_reference_tree/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_authentication_keys_security_level_in_key_reference_tree/v0/mod.rs @@ -46,7 +46,6 @@ impl Drive { //todo: revisit EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(4), //we can estimate that each security level will only have 4 keys //We can mark these as all subtrees, because the revision will be under estimated_layer_sizes: AllItems(1, KEY_REFERENCE_SIZE, None), diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_balances/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_balances/v0/mod.rs index a52ec96dd6a..2dc6aac1200 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_balances/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_balances/v0/mod.rs @@ -57,7 +57,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees( 1, @@ -82,7 +81,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(balance_path_vec()), EstimatedLayerInformation { tree_type: TreeType::SumTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, AVERAGE_BALANCE_SIZE, None), }, diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info/v0/mod.rs index 332ffe7662c..2b46bc6a0ac 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info/v0/mod.rs @@ -20,7 +20,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -31,7 +30,6 @@ impl Drive { KeyInfoPath::from_known_path(identity_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -49,7 +47,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(identity_path_vec(identity_id.as_slice())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: Mix { subtrees_size: Some((1, NoSumTrees, None, 2)), // weight of 2 because 1 for keys and 1 for data contract info @@ -65,7 +62,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(identity_contract_info_root_path_vec(identity_id)), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group/v0/mod.rs index acdd4e177ee..637609a51c4 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group/v0/mod.rs @@ -21,7 +21,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(2), estimated_layer_sizes: Mix { subtrees_size: Some((1, NoSumTrees, None, 1)), diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group_key_purpose/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group_key_purpose/v0/mod.rs index d98825c3f2d..195a04d3c7c 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group_key_purpose/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group_key_purpose/v0/mod.rs @@ -26,7 +26,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(5), estimated_layer_sizes: AllReference(1, KEY_REFERENCE_SIZE, None), }, diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group_keys/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group_keys/v0/mod.rs index ed0550ea1d3..069fc57bcb8 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group_keys/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_identity_contract_info_group_keys/v0/mod.rs @@ -21,7 +21,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(2), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_keys_for_identity_id/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_keys_for_identity_id/v0/mod.rs index a697bf46ace..ac776f1ab24 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_keys_for_identity_id/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_keys_for_identity_id/v0/mod.rs @@ -59,7 +59,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -70,7 +69,6 @@ impl Drive { KeyInfoPath::from_known_path(identity_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -81,7 +79,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(identity_path_vec(identity_id.as_slice())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), //We can mark these as all subtrees, because the revision will be under estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), @@ -93,7 +90,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(identity_key_tree_path_vec(identity_id.as_slice())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(50), //we can estimate that an identity will have amount 50 keys //We can mark these as all subtrees, because the revision will be under estimated_layer_sizes: AllItems(1, 42, Some(3)), diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_negative_credit/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_negative_credit/v0/mod.rs index da97999e333..94834edead9 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_negative_credit/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_negative_credit/v0/mod.rs @@ -37,7 +37,6 @@ impl Drive { KeyInfoPath::from_known_path(identity_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -55,7 +54,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(identity_path_vec(identity_id.as_slice())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), //We can mark these as all subtrees, because the revision will be under estimated_layer_sizes: Mix { diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_purpose_in_key_reference_tree/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_purpose_in_key_reference_tree/v0/mod.rs index 65b3b1fcd04..6951d86eda7 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_purpose_in_key_reference_tree/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_purpose_in_key_reference_tree/v0/mod.rs @@ -69,7 +69,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count, // there are //We can mark these as all subtrees, because the revision will be under estimated_layer_sizes, diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_root_key_reference_tree/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_root_key_reference_tree/v0/mod.rs index aded5ef2192..7d312f98fd6 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_root_key_reference_tree/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_root_key_reference_tree/v0/mod.rs @@ -35,7 +35,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(identity_query_keys_tree_path_vec(identity_id)), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(4), //we can estimate that an identity will have amount 50 keys //We can mark these as all subtrees, because the revision will be under estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_update_nonce/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_update_nonce/v0/mod.rs index 1fe8f106843..c71e24c305a 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_update_nonce/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_update_nonce/v0/mod.rs @@ -41,7 +41,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(0, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -52,7 +51,6 @@ impl Drive { KeyInfoPath::from_known_path(identity_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -70,7 +68,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(identity_path_vec(identity_id.as_slice())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), //We can mark these as all subtrees, because the revision will be under estimated_layer_sizes: Mix { diff --git a/packages/rs-drive/src/drive/identity/estimation_costs/for_update_revision/v0/mod.rs b/packages/rs-drive/src/drive/identity/estimation_costs/for_update_revision/v0/mod.rs index ac0ef6713bd..bb95e061311 100644 --- a/packages/rs-drive/src/drive/identity/estimation_costs/for_update_revision/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/estimation_costs/for_update_revision/v0/mod.rs @@ -41,7 +41,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(0, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -52,7 +51,6 @@ impl Drive { KeyInfoPath::from_known_path(identity_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -70,7 +68,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(identity_path_vec(identity_id.as_slice())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), //We can mark these as all subtrees, because the revision will be under estimated_layer_sizes: Mix { diff --git a/packages/rs-drive/src/drive/identity/key/insert_key_hash_identity_reference/estimation_costs/add_estimation_costs_for_insert_non_unique_public_key_hash_reference/v0/mod.rs b/packages/rs-drive/src/drive/identity/key/insert_key_hash_identity_reference/estimation_costs/add_estimation_costs_for_insert_non_unique_public_key_hash_reference/v0/mod.rs index 6245b7f6d73..a24e1eea04a 100644 --- a/packages/rs-drive/src/drive/identity/key/insert_key_hash_identity_reference/estimation_costs/add_estimation_costs_for_insert_non_unique_public_key_hash_reference/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/key/insert_key_hash_identity_reference/estimation_costs/add_estimation_costs_for_insert_non_unique_public_key_hash_reference/v0/mod.rs @@ -25,7 +25,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(non_unique_key_hashes_path), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_160_SIZE_U8, NoSumTrees, None), }, @@ -38,7 +37,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(non_unique_key_hashes_sub_path), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(ESTIMATED_NON_UNIQUE_KEY_DUPLICATES), estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, 0, None), }, diff --git a/packages/rs-drive/src/drive/identity/key/insert_key_hash_identity_reference/estimation_costs/add_estimation_costs_for_insert_unique_public_key_hash_reference/v0/mod.rs b/packages/rs-drive/src/drive/identity/key/insert_key_hash_identity_reference/estimation_costs/add_estimation_costs_for_insert_unique_public_key_hash_reference/v0/mod.rs index 61d6d592b0b..db8a337fa48 100644 --- a/packages/rs-drive/src/drive/identity/key/insert_key_hash_identity_reference/estimation_costs/add_estimation_costs_for_insert_unique_public_key_hash_reference/v0/mod.rs +++ b/packages/rs-drive/src/drive/identity/key/insert_key_hash_identity_reference/estimation_costs/add_estimation_costs_for_insert_unique_public_key_hash_reference/v0/mod.rs @@ -19,7 +19,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(unique_key_hashes_path), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_160_SIZE_U8, diff --git a/packages/rs-drive/src/drive/prefunded_specialized_balances/estimation_costs/for_prefunded_specialized_balance_update/v0/mod.rs b/packages/rs-drive/src/drive/prefunded_specialized_balances/estimation_costs/for_prefunded_specialized_balance_update/v0/mod.rs index e65b0375482..3b30884b6cb 100644 --- a/packages/rs-drive/src/drive/prefunded_specialized_balances/estimation_costs/for_prefunded_specialized_balance_update/v0/mod.rs +++ b/packages/rs-drive/src/drive/prefunded_specialized_balances/estimation_costs/for_prefunded_specialized_balance_update/v0/mod.rs @@ -29,7 +29,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, // We are on the 3rd level estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: AllSubtrees( @@ -54,7 +53,6 @@ impl Drive { KeyInfoPath::from_known_path(prefunded_specialized_balances_path()), EstimatedLayerInformation { tree_type: TreeType::SumTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(0, false), estimated_layer_sizes: AllSubtrees(1, AllSumTrees, None), }, @@ -64,7 +62,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(prefunded_specialized_balances_for_voting_path_vec()), EstimatedLayerInformation { tree_type: TreeType::SumTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, AVERAGE_BALANCE_SIZE, None), }, diff --git a/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_contested_document_tree_levels_up_to_contract/v0/mod.rs b/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_contested_document_tree_levels_up_to_contract/v0/mod.rs index b47b5cc2728..4be4c8b9058 100644 --- a/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_contested_document_tree_levels_up_to_contract/v0/mod.rs +++ b/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_contested_document_tree_levels_up_to_contract/v0/mod.rs @@ -59,7 +59,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), //voting is on level 2 // We have balances in the middle which is a sum tree estimated_layer_sizes: AllSubtrees( @@ -85,7 +84,6 @@ impl Drive { KeyInfoPath::from_known_path(vote_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, // contested resource tree is a key of "c" so it should be on the top layer of the merk estimated_layer_count: EstimatedLevel(0, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), @@ -97,7 +95,6 @@ impl Drive { KeyInfoPath::from_known_path(vote_contested_resource_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, // active poll "p", with "e" and "i" first so it should be on the second layer of the merk estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), @@ -109,7 +106,6 @@ impl Drive { KeyInfoPath::from_known_path(vote_contested_resource_active_polls_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -123,7 +119,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(document_type_count), estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_DOCUMENT_TYPE_NAME_SIZE, @@ -143,7 +138,6 @@ impl Drive { ), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(2), estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_INDEX_NAME_SIZE, @@ -162,7 +156,6 @@ impl Drive { ), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(1024), //Just a guess estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_INDEX_NAME_SIZE, diff --git a/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded/v0/mod.rs b/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded/v0/mod.rs index 8df5e3e2168..6ef2aa76708 100644 --- a/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded/v0/mod.rs +++ b/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_contested_document_tree_levels_up_to_contract_document_type_excluded/v0/mod.rs @@ -50,7 +50,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), //voting is on level 2 // We have balances in the middle which is a sum tree estimated_layer_sizes: AllSubtrees( @@ -76,7 +75,6 @@ impl Drive { KeyInfoPath::from_known_path(vote_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, // contested resource tree is a key of "c" so it should be on the top layer of the merk estimated_layer_count: EstimatedLevel(0, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), @@ -88,7 +86,6 @@ impl Drive { KeyInfoPath::from_known_path(vote_contested_resource_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, // active poll "p", with "e" and "i" first, so it should be on the second layer of the merk estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), @@ -100,7 +97,6 @@ impl Drive { KeyInfoPath::from_known_path(vote_contested_resource_active_polls_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -114,7 +110,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(document_type_count), estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_DOCUMENT_TYPE_NAME_SIZE, diff --git a/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_levels_up_to_contract/v0/mod.rs b/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_levels_up_to_contract/v0/mod.rs index f266f433972..0e6e4630378 100644 --- a/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_levels_up_to_contract/v0/mod.rs +++ b/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_levels_up_to_contract/v0/mod.rs @@ -44,7 +44,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(0, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -55,7 +54,6 @@ impl Drive { KeyInfoPath::from_known_path(all_contracts_global_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllSubtrees( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_levels_up_to_contract_document_type_excluded/v0/mod.rs b/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_levels_up_to_contract_document_type_excluded/v0/mod.rs index eeabec5cb5a..443349d04ad 100644 --- a/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_levels_up_to_contract_document_type_excluded/v0/mod.rs +++ b/packages/rs-drive/src/drive/shared/shared_estimation_costs/add_estimation_costs_for_levels_up_to_contract_document_type_excluded/v0/mod.rs @@ -63,7 +63,6 @@ impl Drive { KeyInfoPath::from_known_path(contract_root_path(contract.id_ref().as_bytes())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, storage_flags), }, @@ -73,7 +72,6 @@ impl Drive { KeyInfoPath::from_known_path(contract_documents_path(contract.id_ref().as_bytes())), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(document_type_count), estimated_layer_sizes: AllSubtrees( ESTIMATED_AVERAGE_DOCUMENT_TYPE_NAME_SIZE, diff --git a/packages/rs-drive/src/drive/shielded/estimated_costs.rs b/packages/rs-drive/src/drive/shielded/estimated_costs.rs index 93d2c1b2f4b..859286eb24b 100644 --- a/packages/rs-drive/src/drive/shielded/estimated_costs.rs +++ b/packages/rs-drive/src/drive/shielded/estimated_costs.rs @@ -40,7 +40,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: AllSubtrees( 1, @@ -67,7 +66,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(vec![vec![RootTree::ShieldedBalances as u8]]), EstimatedLayerInformation { tree_type: TreeType::SumTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees( 1, @@ -101,7 +99,6 @@ impl Drive { KeyInfoPath::from_known_path(shielded_credit_pool_path()), EstimatedLayerInformation { tree_type: TreeType::SumTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: Mix { subtrees_size: Some(( @@ -134,7 +131,6 @@ impl Drive { KeyInfoPath::from_known_path(shielded_credit_pool_notes_path()), EstimatedLayerInformation { tree_type: TreeType::CommitmentTree(SHIELDED_NOTES_CHUNK_POWER), - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(16, false), estimated_layer_sizes: AllItems(8, AVERAGE_NOTE_VALUE_SIZE, None), }, @@ -146,7 +142,6 @@ impl Drive { KeyInfoPath::from_known_path(shielded_credit_pool_nullifiers_path()), EstimatedLayerInformation { tree_type: TreeType::ProvableCountTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(16, false), estimated_layer_sizes: AllItems(NULLIFIER_KEY_SIZE, 0, None), }, @@ -158,7 +153,6 @@ impl Drive { KeyInfoPath::from_known_path(shielded_credit_pool_anchors_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(7, false), estimated_layer_sizes: AllItems(ANCHOR_KEY_SIZE, ANCHOR_VALUE_SIZE, None), }, @@ -170,7 +164,6 @@ impl Drive { KeyInfoPath::from_known_path(shielded_credit_pool_anchors_by_height_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(7, false), estimated_layer_sizes: AllItems( ANCHOR_VALUE_SIZE as u8, diff --git a/packages/rs-drive/src/drive/system/estimation_costs/for_total_system_credits_update/v0/mod.rs b/packages/rs-drive/src/drive/system/estimation_costs/for_total_system_credits_update/v0/mod.rs index e0c88ba11b7..4583aefca0d 100644 --- a/packages/rs-drive/src/drive/system/estimation_costs/for_total_system_credits_update/v0/mod.rs +++ b/packages/rs-drive/src/drive/system/estimation_costs/for_total_system_credits_update/v0/mod.rs @@ -34,7 +34,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), estimated_layer_sizes: AllSubtrees( 12, // about 32 + 1 + 1 / 3 @@ -59,7 +58,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(misc_path_vec()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: ApproximateElements(1), estimated_layer_sizes: AllItems(1, 8, None), }, diff --git a/packages/rs-drive/src/drive/tokens/distribution/mark_perpetual_release_as_distributed/v0/mod.rs b/packages/rs-drive/src/drive/tokens/distribution/mark_perpetual_release_as_distributed/v0/mod.rs index b2e822e24eb..2bacadcea45 100644 --- a/packages/rs-drive/src/drive/tokens/distribution/mark_perpetual_release_as_distributed/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/distribution/mark_perpetual_release_as_distributed/v0/mod.rs @@ -45,7 +45,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(perpetual_distributions_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count, estimated_layer_sizes: AllItems(1, 8, None), }, diff --git a/packages/rs-drive/src/drive/tokens/distribution/mark_pre_programmed_release_as_distributed/v0/mod.rs b/packages/rs-drive/src/drive/tokens/distribution/mark_pre_programmed_release_as_distributed/v0/mod.rs index b54912f2184..9eb4644f7a8 100644 --- a/packages/rs-drive/src/drive/tokens/distribution/mark_pre_programmed_release_as_distributed/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/distribution/mark_pre_programmed_release_as_distributed/v0/mod.rs @@ -73,7 +73,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(token_distributions_root_path_vec()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), // We should be on the first level estimated_layer_sizes: AllSubtrees(U8_SIZE_U8, NoSumTrees, None), }, @@ -98,7 +97,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(pre_programmed_distributions_path.clone()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(5, false), estimated_layer_sizes: AllItems(1, 8, None), }, diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_root_token_ms_interval_distribution/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_root_token_ms_interval_distribution/v0/mod.rs index 0bff3c07497..ff12c2d0141 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_root_token_ms_interval_distribution/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_root_token_ms_interval_distribution/v0/mod.rs @@ -26,7 +26,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(token_timed_distributions_path_vec()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(0, false), // 0 because ms is on top estimated_layer_sizes: AllSubtrees(U8_SIZE_U8, NoSumTrees, None), }, @@ -37,7 +36,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(token_ms_timed_distributions_path_vec()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // we can have a lot of times estimated_layer_sizes: AllSubtrees(U64_SIZE_U8, NoSumTrees, None), }, @@ -52,7 +50,6 @@ impl Drive { key, EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, // We assume a shallow sum tree for the distribution entries at a given time. estimated_layer_count: EstimatedLevel(1, false), // Each distribution entry is estimated with a fixed size. diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_balances/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_balances/v0/mod.rs index 6aa3bcd6405..821d7c74c63 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_balances/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_balances/v0/mod.rs @@ -63,7 +63,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -74,7 +73,6 @@ impl Drive { KeyInfoPath::from_known_path(tokens_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(0, false), // this should be at the top estimated_layer_sizes: AllSubtrees(1, AllBigSumTrees, None), }, @@ -84,7 +82,6 @@ impl Drive { KeyInfoPath::from_known_path(token_balances_root_path()), EstimatedLayerInformation { tree_type: TreeType::BigSumTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // we can estimate 10 levels deep estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, AllSumTrees, None), }, @@ -95,7 +92,6 @@ impl Drive { KeyInfoPath::from_known_path(token_balances_path(&token_id)), EstimatedLayerInformation { tree_type: TreeType::SumTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, AVERAGE_BALANCE_SIZE, None), }, diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_contract_infos/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_contract_infos/v0/mod.rs index 2a0076e3882..ffe0f731029 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_contract_infos/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_contract_infos/v0/mod.rs @@ -63,7 +63,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -74,7 +73,6 @@ impl Drive { KeyInfoPath::from_known_path(tokens_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees( 1, @@ -98,7 +96,6 @@ impl Drive { KeyInfoPath::from_known_path(token_contract_infos_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // we can estimate 10 levels deep estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, 36, None), }, diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs index 22013d68d79..efaec560a92 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_direct_selling_prices/v0/mod.rs @@ -63,7 +63,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -74,7 +73,6 @@ impl Drive { KeyInfoPath::from_known_path(tokens_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees( 1, @@ -98,7 +96,6 @@ impl Drive { KeyInfoPath::from_known_path(token_direct_purchase_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // we can estimate 10 levels deep estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, 8, None), }, diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_identity_infos/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_identity_infos/v0/mod.rs index 65da255811a..d8556ea29c7 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_identity_infos/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_identity_infos/v0/mod.rs @@ -30,7 +30,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -41,7 +40,6 @@ impl Drive { KeyInfoPath::from_known_path(tokens_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), // this should be at the top estimated_layer_sizes: AllSubtrees( 1, @@ -65,7 +63,6 @@ impl Drive { KeyInfoPath::from_known_path(token_identity_infos_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // we can estimate 10 levels deep estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -76,7 +73,6 @@ impl Drive { KeyInfoPath::from_known_path(token_identity_infos_path(&token_id)), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: PotentiallyAtMaxElements, estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_perpetual_distribution/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_perpetual_distribution/v0/mod.rs index d7057694db5..bee40e512db 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_perpetual_distribution/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_perpetual_distribution/v0/mod.rs @@ -31,7 +31,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(token_distributions_root_path_vec()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), estimated_layer_sizes: AllSubtrees(U8_SIZE_U8, NoSumTrees, None), }, @@ -42,7 +41,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(token_root_perpetual_distributions_path_vec()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // Estimated depth estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -56,7 +54,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees(U8_SIZE_U8, NoSumTrees, None), }, diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_pre_programmed_distribution/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_pre_programmed_distribution/v0/mod.rs index 115e0dd37ed..e61cb383097 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_pre_programmed_distribution/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_pre_programmed_distribution/v0/mod.rs @@ -36,7 +36,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(token_distributions_root_path_vec()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), // We should be on the first level estimated_layer_sizes: AllSubtrees(U8_SIZE_U8, NoSumTrees, None), }, @@ -47,7 +46,6 @@ impl Drive { KeyInfoPath::from_known_owned_path(token_root_pre_programmed_distributions_path_vec()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // Just an estimate estimated_layer_sizes: AllSubtrees(DEFAULT_HASH_SIZE_U8, NoSumTrees, None), }, @@ -60,7 +58,6 @@ impl Drive { )), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, // At this level, expect as many children as there are time entries. estimated_layer_count: ApproximateElements( times.as_ref().map(|times| times.len()).unwrap_or(128) as u32, @@ -78,7 +75,6 @@ impl Drive { ), EstimatedLayerInformation { tree_type: TreeType::SumTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), // probably not that many estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, U64_SIZE_U32, None), }, diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_status_infos/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_status_infos/v0/mod.rs index 28be770c7db..7c6d9135f31 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_status_infos/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_status_infos/v0/mod.rs @@ -27,7 +27,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -38,7 +37,6 @@ impl Drive { KeyInfoPath::from_known_path(tokens_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(1, false), // this should be at the top estimated_layer_sizes: AllSubtrees( 1, @@ -62,7 +60,6 @@ impl Drive { KeyInfoPath::from_known_path(token_statuses_root_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), // we can estimate 10 levels deep estimated_layer_sizes: AllItems( DEFAULT_HASH_SIZE_U8, diff --git a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_total_supply/v0/mod.rs b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_total_supply/v0/mod.rs index aecb1a8f562..ec9c05ed715 100644 --- a/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_total_supply/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/estimated_costs/for_token_total_supply/v0/mod.rs @@ -62,7 +62,6 @@ impl Drive { KeyInfoPath::from_known_path([]), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(3, false), // 17 because we have 2 layers at 32 and two layers at 2 estimated_layer_sizes: AllSubtrees( @@ -88,7 +87,6 @@ impl Drive { KeyInfoPath::from_known_path(misc_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(2, false), estimated_layer_sizes: AllSubtrees(1, NoSumTrees, None), }, @@ -99,7 +97,6 @@ impl Drive { KeyInfoPath::from_known_path(total_tokens_root_supply_path()), EstimatedLayerInformation { tree_type: TreeType::BigSumTree, - may_contain_backward_references: false, estimated_layer_count: EstimatedLevel(10, false), estimated_layer_sizes: AllItems(DEFAULT_HASH_SIZE_U8, U64_SIZE_U32, None), }, diff --git a/packages/rs-drive/src/drive/votes/insert/vote_poll/add_vote_poll_end_date_query_operations/v0/mod.rs b/packages/rs-drive/src/drive/votes/insert/vote_poll/add_vote_poll_end_date_query_operations/v0/mod.rs index c5ba91c036c..5df377420f5 100644 --- a/packages/rs-drive/src/drive/votes/insert/vote_poll/add_vote_poll_end_date_query_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/votes/insert/vote_poll/add_vote_poll_end_date_query_operations/v0/mod.rs @@ -53,7 +53,6 @@ impl Drive { KeyInfoPath::from_known_path(vote_end_date_queries_tree_path()), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, // We can estimate that there is at least a vote concluding every block, and we put blocks at 6 seconds. estimated_layer_count: ApproximateElements(201_600), estimated_layer_sizes: AllSubtrees( @@ -70,7 +69,6 @@ impl Drive { ), EstimatedLayerInformation { tree_type: TreeType::NormalTree, - may_contain_backward_references: false, // We can estimate that there is 2 votes ending per block. estimated_layer_count: ApproximateElements(2), estimated_layer_sizes: AllItems( diff --git a/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs index 70794e63e4c..0d81e99e9d9 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs @@ -6,7 +6,7 @@ use crate::util::grove_operations::{push_drive_operation_result, BatchDeleteAppl use grovedb::batch::key_info::KeyInfo; use grovedb::batch::KeyInfoPath; use grovedb::operations::delete::DeleteOptions; -use grovedb::BackwardReferencesPolicy; +use grovedb::DisplacedValue; use grovedb::{GroveDb, TransactionArg}; use grovedb_path::SubtreePath; use grovedb_storage::rocksdb_storage::RocksDbStorage; @@ -24,8 +24,9 @@ impl Drive { drive_version: &DriveVersion, ) -> Result<(), Error> { let options = DeleteOptions { - // Drive stores no backward-reference participants; Skip keeps the released V4 path. - backward_references_policy: BackwardReferencesPolicy::Skip, + // Drive stores no backward-reference participants; GroveDB checks the + // claim for free from the value it reads for the write. + displaced_value: DisplacedValue::NotParticipant, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs index 87bcd78dac2..47e4c10737a 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs @@ -8,7 +8,7 @@ use grovedb::batch::key_info::KeyInfo; use grovedb::batch::KeyInfoPath; use grovedb::operations::delete::DeleteOptions; use grovedb::query_result_type::QueryResultType; -use grovedb::BackwardReferencesPolicy; +use grovedb::DisplacedValue; use grovedb::{GroveDb, PathQuery, TransactionArg}; use grovedb_storage::rocksdb_storage::RocksDbStorage; use platform_version::version::drive_versions::DriveVersion; @@ -81,8 +81,9 @@ impl Drive { let current_batch_operations = LowLevelDriveOperation::grovedb_operations_batch(drive_operations); let options = DeleteOptions { - // Drive stores no backward-reference participants; Skip keeps the released V4 path. - backward_references_policy: BackwardReferencesPolicy::Skip, + // Drive stores no backward-reference participants; GroveDB checks the + // claim for free from the value it reads for the write. + displaced_value: DisplacedValue::NotParticipant, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs index 58d3e058bd3..c05cc3805f0 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs @@ -7,7 +7,7 @@ use crate::util::grove_operations::{push_drive_operation_result, BatchMoveApplyT use grovedb::batch::key_info::KeyInfo; use grovedb::batch::{KeyInfoPath, QualifiedGroveDbOp}; use grovedb::operations::delete::DeleteOptions; -use grovedb::BackwardReferencesPolicy; +use grovedb::DisplacedValue; use grovedb::{Element, GroveDb, TransactionArg}; use grovedb_epoch_based_storage_flags::StorageFlags; use grovedb_path::SubtreePath; @@ -61,8 +61,9 @@ impl Drive { // ── 2. Build the delete op ────────────────────────────────────────── let current_batch = LowLevelDriveOperation::grovedb_operations_batch(drive_operations); let delete_opts = DeleteOptions { - // Drive stores no backward-reference participants; Skip keeps the released V4 path. - backward_references_policy: BackwardReferencesPolicy::Skip, + // Drive stores no backward-reference participants; GroveDB checks the + // claim for free from the value it reads for the write. + displaced_value: DisplacedValue::NotParticipant, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs index 09581042750..daee80bc758 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs @@ -8,7 +8,7 @@ use grovedb::batch::key_info::KeyInfo; use grovedb::batch::{KeyInfoPath, QualifiedGroveDbOp}; use grovedb::operations::delete::DeleteOptions; use grovedb::query_result_type::QueryResultType; -use grovedb::BackwardReferencesPolicy; +use grovedb::DisplacedValue; use grovedb::{GroveDb, PathQuery, TransactionArg}; use grovedb_epoch_based_storage_flags::StorageFlags; use grovedb_storage::rocksdb_storage::RocksDbStorage; @@ -87,8 +87,9 @@ impl Drive { let current_batch_operations = LowLevelDriveOperation::grovedb_operations_batch(drive_operations); let options = DeleteOptions { - // Drive stores no backward-reference participants; Skip keeps the released V4 path. - backward_references_policy: BackwardReferencesPolicy::Skip, + // Drive stores no backward-reference participants; GroveDB checks the + // claim for free from the value it reads for the write. + displaced_value: DisplacedValue::NotParticipant, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs index 236654eef90..f490b149706 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs @@ -9,7 +9,7 @@ use dpp::version::drive_versions::DriveVersion; use grovedb::batch::key_info::KeyInfo; use grovedb::batch::{GroveOp, KeyInfoPath}; use grovedb::operations::delete::DeleteOptions; -use grovedb::BackwardReferencesPolicy; +use grovedb::DisplacedValue; use grovedb::{Element, GroveDb, TransactionArg}; use grovedb_path::SubtreePath; use grovedb_storage::rocksdb_storage::RocksDbStorage; @@ -30,8 +30,9 @@ impl Drive { let mut current_batch_operations = LowLevelDriveOperation::grovedb_operations_batch(drive_operations); let options = DeleteOptions { - // Drive stores no backward-reference participants; Skip keeps the released V4 path. - backward_references_policy: BackwardReferencesPolicy::Skip, + // Drive stores no backward-reference participants; GroveDB checks the + // claim for free from the value it reads for the write. + displaced_value: DisplacedValue::NotParticipant, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs index 842f8a102a6..35c2f5c0337 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs @@ -5,10 +5,9 @@ use crate::fees::op::LowLevelDriveOperation; use crate::query::GroveError; use crate::util::batch::grovedb_op_batch::GroveDbOpBatchV0Methods; use crate::util::batch::GroveDbOpBatch; -use crate::util::grove_operations::push_drive_operation_result; +use crate::util::grove_operations::{declaring_no_participants, push_drive_operation_result}; use crate::util::storage_flags::StorageFlags; use grovedb::batch::{BatchApplyOptions, QualifiedGroveDbOp}; -use grovedb::BackwardReferencesPolicy; use grovedb::TransactionArg; use platform_version::version::drive_versions::DriveVersion; @@ -62,10 +61,8 @@ impl Drive { }; let cost_context = self.grove.apply_batch_with_element_flags_update( - ops.operations, + declaring_no_participants(ops.operations), Some(BatchApplyOptions { - // Drive stores no backward-reference participants; Skip keeps the released V4 path. - backward_references_policy: BackwardReferencesPolicy::Skip, validate_insertion_does_not_override: validate, validate_insertion_does_not_override_tree: validate, disable_operation_consistency_check: !self.config.batching_consistency_verification, diff --git a/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs index 6f896a2000e..409b3f9546d 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs @@ -5,10 +5,9 @@ use crate::fees::op::LowLevelDriveOperation; use crate::query::GroveError; use crate::util::batch::grovedb_op_batch::GroveDbOpBatchV0Methods; use crate::util::batch::GroveDbOpBatch; -use crate::util::grove_operations::push_drive_operation_result; +use crate::util::grove_operations::{declaring_no_participants, push_drive_operation_result}; use crate::util::storage_flags::{MergingOwnersStrategy, StorageFlags}; use grovedb::batch::{BatchApplyOptions, OpsByLevelPath, QualifiedGroveDbOp}; -use grovedb::BackwardReferencesPolicy; use grovedb::TransactionArg; use grovedb_costs::storage_cost::removal::StorageRemovedBytes::BasicStorageRemoval; use grovedb_costs::storage_cost::transition::OperationStorageTransitionType; @@ -47,10 +46,8 @@ impl Drive { } let cost_context = self.grove.apply_partial_batch_with_element_flags_update( - ops.operations, + declaring_no_participants(ops.operations), Some(BatchApplyOptions { - // Drive stores no backward-reference participants; Skip keeps the released V4 path. - backward_references_policy: BackwardReferencesPolicy::Skip, validate_insertion_does_not_override: validate, validate_insertion_does_not_override_tree: validate, disable_operation_consistency_check: false, diff --git a/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs index df80e50103e..ae3e4c5f630 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs @@ -3,10 +3,9 @@ use crate::error::Error; use crate::fees::op::LowLevelDriveOperation; use crate::query::GroveError; use crate::util::batch::GroveDbOpBatch; -use crate::util::grove_operations::push_drive_operation_result; +use crate::util::grove_operations::{declaring_no_participants, push_drive_operation_result}; use grovedb::batch::estimated_costs::EstimatedCostsType::AverageCaseCostsType; use grovedb::batch::{BatchApplyOptions, KeyInfoPath}; -use grovedb::BackwardReferencesPolicy; use grovedb::{EstimatedLayerInformation, GroveDb}; use platform_version::version::drive_versions::DriveVersion; use std::collections::HashMap; @@ -23,10 +22,8 @@ impl Drive { ) -> Result<(), Error> { let cost_context = GroveDb::estimated_case_operations_for_batch( AverageCaseCostsType(estimated_layer_info), - ops.operations, + declaring_no_participants(ops.operations), Some(BatchApplyOptions { - // Drive stores no backward-reference participants; Skip keeps the released V4 path. - backward_references_policy: BackwardReferencesPolicy::Skip, validate_insertion_does_not_override: validate, validate_insertion_does_not_override_tree: validate, disable_operation_consistency_check: false, diff --git a/packages/rs-drive/src/util/grove_operations/grove_clear/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_clear/v0/mod.rs index 2531843378c..a70e476b5c8 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_clear/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_clear/v0/mod.rs @@ -1,7 +1,7 @@ use crate::drive::Drive; use crate::error::Error; use grovedb::operations::delete::ClearOptions; -use grovedb::BackwardReferencesPolicy; +use grovedb::DisplacedValue; use grovedb::TransactionArg; use grovedb_path::SubtreePath; use platform_version::version::drive_versions::DriveVersion; @@ -15,8 +15,9 @@ impl Drive { drive_version: &DriveVersion, ) -> Result<(), Error> { let options = ClearOptions { - // Drive stores no backward-reference participants; Skip keeps the released V4 path. - backward_references_policy: BackwardReferencesPolicy::Skip, + // Drive stores no backward-reference participants; GroveDB checks the + // claim for free from the value it reads for the write. + displaced_value: DisplacedValue::NotParticipant, check_for_subtrees: false, allow_deleting_subtrees: false, trying_to_clear_with_subtrees_returns_error: false, diff --git a/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs index 43f2c262961..7a4d85b6eef 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs @@ -3,7 +3,7 @@ use crate::error::Error; use crate::fees::op::LowLevelDriveOperation; use crate::util::grove_operations::push_drive_operation_result; use grovedb::operations::delete::DeleteOptions; -use grovedb::BackwardReferencesPolicy; +use grovedb::DisplacedValue; use grovedb::TransactionArg; use grovedb_path::SubtreePath; use platform_version::version::drive_versions::DriveVersion; @@ -19,8 +19,9 @@ impl Drive { drive_version: &DriveVersion, ) -> Result<(), Error> { let options = DeleteOptions { - // Drive stores no backward-reference participants; Skip keeps the released V4 path. - backward_references_policy: BackwardReferencesPolicy::Skip, + // Drive stores no backward-reference participants; GroveDB checks the + // claim for free from the value it reads for the write. + displaced_value: DisplacedValue::NotParticipant, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-drive/src/util/grove_operations/mod.rs b/packages/rs-drive/src/util/grove_operations/mod.rs index ef3b826c99e..9d9fddd2a5a 100644 --- a/packages/rs-drive/src/util/grove_operations/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/mod.rs @@ -3,6 +3,25 @@ //! Defines and implements in Drive functions pertinent to groveDB operations. //! +use grovedb::batch::QualifiedGroveDbOp; +use grovedb::DisplacedValue; + +/// Every op Drive hands to GroveDB declares that the value it displaces takes +/// no part in backward references, because Drive stores no such participants. +/// GroveDB checks the claim for free from the value it reads for the write +/// and refuses a false one, so the declaration cannot corrupt state; it only +/// spares the maintenance planning and the estimated fan-out. When a document +/// type starts storing participants, declare per op where the ops are built +/// instead of here. +pub(crate) fn declaring_no_participants( + operations: Vec, +) -> Vec { + operations + .into_iter() + .map(|op| op.with_displaced_value(DisplacedValue::NotParticipant)) + .collect() +} + /// Grove insert operation pub mod grove_insert; diff --git a/packages/rs-drive/tests/drive_storage_ops_coverage.rs b/packages/rs-drive/tests/drive_storage_ops_coverage.rs index 25ea15b592e..143eaa32056 100644 --- a/packages/rs-drive/tests/drive_storage_ops_coverage.rs +++ b/packages/rs-drive/tests/drive_storage_ops_coverage.rs @@ -955,7 +955,7 @@ mod grovedb_op_batch_tests { use drive::util::batch::grovedb_op_batch::GroveDbOpBatch; use drive::util::batch::grovedb_op_batch::GroveDbOpBatchV0Methods; use grovedb::batch::{GroveOp, QualifiedGroveDbOp}; - use grovedb::{Element, TreeType}; + use grovedb::{DisplacedValue, Element, TreeType}; #[test] fn new_batch_is_empty() { @@ -1399,6 +1399,7 @@ mod grovedb_op_batch_tests { path: KeyInfoPath(vec![]), key: None, op: GroveOp::Delete, + displaced_value: DisplacedValue::NotParticipant, }; let mut batch = GroveDbOpBatch::new(); batch.push(op); diff --git a/packages/rs-platform-version/Cargo.toml b/packages/rs-platform-version/Cargo.toml index 32d778eb63f..628c749b03b 100644 --- a/packages/rs-platform-version/Cargo.toml +++ b/packages/rs-platform-version/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" thiserror = { version = "2.0.12" } bincode = { workspace = true } versioned-feature-core = "1.0.0" -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d" } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2" } [features] mock-versions = [] diff --git a/packages/rs-platform-wallet/Cargo.toml b/packages/rs-platform-wallet/Cargo.toml index 7f77edbdc6a..5af435758eb 100644 --- a/packages/rs-platform-wallet/Cargo.toml +++ b/packages/rs-platform-wallet/Cargo.toml @@ -61,7 +61,7 @@ zeroize = "1" log = "0.4" # Shielded pool (optional, behind `shielded` feature) -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2", optional = true } # Direct `rusqlite` access so `FileBackedShieldedStore::open_path` can set # WAL + synchronous=NORMAL pragmas before handing the connection to # `ClientPersistentCommitmentTree`. Version locked to match the rev grovedb diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index ecba91a7b91..7fc65eb02ff 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -18,7 +18,7 @@ drive = { path = "../rs-drive", default-features = false, features = [ ] } drive-proof-verifier = { path = "../rs-drive-proof-verifier", default-features = false } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "f75fa36230902b983d231572b6aa2c17eb72cf7d", features = [ +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2", features = [ "client", "sqlite", ], optional = true } From a95249b0c89b472e218ab6e0713361b664fa7e7f Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sat, 12 Sep 2026 17:43:10 +0700 Subject: [PATCH 11/20] test(drive-abci): pin the version 13 DPNS create fee beside the moved version 14 baseline Document replace already had a version 13 twin; DPNS domain create is the other baseline this PR moves at version 14, so it gets one too, pinned at 6,010,380 (the pre-change value: version 13 stays on GroveDB V3, which the GroveDB bump leaves byte-stable). Co-Authored-By: Claude Fable 5.1 --- .../state_transitions/batch/tests/document/dpns.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns.rs b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns.rs index 9d6927cc46b..ac0956c6916 100644 --- a/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns.rs +++ b/packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/dpns.rs @@ -30,6 +30,18 @@ mod dpns_tests { .await; } + /// PROTOCOL_VERSION_13: fee predating every v14 change on this path, + /// including GroveDB V4's write through the retained old-value node + /// (v13 stays on GroveDB V3). Pinned so v13 chain history stays + /// bit-for-bit reproducible. + #[tokio::test] + async fn test_dpns_contract_references_with_no_contested_unique_index_protocol_version_13() { + run_dpns_contract_references_with_no_contested_unique_index_at_protocol_version( + 13, 6_010_380, + ) + .await; + } + /// PROTOCOL_VERSION_11: pre-T1/T2 fee — `create_domain_data_trigger_v0` /// runs the same parent-domain + preorder queries but discards their /// cost (epoch=None → `query_documents` cost short-circuits to 0, From 359615f791bce49bfc4367162c7650bbd53208c0 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sat, 12 Sep 2026 19:18:02 +0700 Subject: [PATCH 12/20] build(drive)!: declare Drive's GroveDB ops through their DontCheck twins GroveDB #953 now expresses the per-operation declaration as DontCheck twins of the displacing batch ops instead of a field on the op wrapper. Drive keeps building the checked ops and converts each one to its twin at the three GroveDB boundaries it already funnels through, so its own batch-inspection code is untouched. Pin moved to the PR head 82b9c745. Fees are unchanged from the previous revision: rs-drive 3,755 and drive-abci 3,114 tests pass at the same baselines. Co-Authored-By: Claude Fable 5.1 --- Cargo.lock | 32 +++++++++---------- packages/rs-dpp/Cargo.toml | 2 +- packages/rs-drive-abci/Cargo.toml | 8 ++--- packages/rs-drive/Cargo.toml | 14 ++++---- .../rs-drive/src/util/grove_operations/mod.rs | 20 ++++++------ .../tests/drive_storage_ops_coverage.rs | 3 +- packages/rs-platform-version/Cargo.toml | 2 +- packages/rs-platform-wallet/Cargo.toml | 2 +- packages/rs-sdk/Cargo.toml | 2 +- 9 files changed, 42 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2aa1550d2c2..cafc9c932a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2957,7 +2957,7 @@ dependencies = [ [[package]] name = "grovedb" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" +source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" dependencies = [ "axum 0.8.9", "blake3", @@ -3016,7 +3016,7 @@ dependencies = [ [[package]] name = "grovedb-bulk-append-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" +source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" dependencies = [ "blake3", "grovedb-bincode", @@ -3034,7 +3034,7 @@ dependencies = [ [[package]] name = "grovedb-commitment-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" +source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3051,7 +3051,7 @@ dependencies = [ [[package]] name = "grovedb-costs" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" +source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" dependencies = [ "integer-encoding", "intmap", @@ -3061,7 +3061,7 @@ dependencies = [ [[package]] name = "grovedb-dense-fixed-sized-merkle-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" +source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" dependencies = [ "blake3", "grovedb-bincode", @@ -3075,7 +3075,7 @@ dependencies = [ [[package]] name = "grovedb-element" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" +source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" dependencies = [ "grovedb-bincode", "grovedb-bincode-derive", @@ -3091,7 +3091,7 @@ dependencies = [ [[package]] name = "grovedb-epoch-based-storage-flags" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" +source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" dependencies = [ "grovedb-costs", "hex", @@ -3103,7 +3103,7 @@ dependencies = [ [[package]] name = "grovedb-merk" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" +source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" dependencies = [ "blake3", "byteorder", @@ -3129,7 +3129,7 @@ dependencies = [ [[package]] name = "grovedb-merkle-mountain-range" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" +source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" dependencies = [ "blake3", "grovedb-bincode", @@ -3142,7 +3142,7 @@ dependencies = [ [[package]] name = "grovedb-path" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" +source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" dependencies = [ "hex", ] @@ -3150,7 +3150,7 @@ dependencies = [ [[package]] name = "grovedb-private-document-store" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" +source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3163,7 +3163,7 @@ dependencies = [ [[package]] name = "grovedb-query" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" +source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" dependencies = [ "byteorder", "ed", @@ -3179,7 +3179,7 @@ dependencies = [ [[package]] name = "grovedb-storage" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" +source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" dependencies = [ "blake3", "grovedb-costs", @@ -3198,7 +3198,7 @@ dependencies = [ [[package]] name = "grovedb-version" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" +source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" dependencies = [ "thiserror 2.0.18", "versioned-feature-core", @@ -3207,7 +3207,7 @@ dependencies = [ [[package]] name = "grovedb-visualize" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" +source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" dependencies = [ "hex", "itertools 0.14.0", @@ -3216,7 +3216,7 @@ dependencies = [ [[package]] name = "grovedbg-types" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=08003fa209f3439a7062d0fcaeec500f87b38bd2#08003fa209f3439a7062d0fcaeec500f87b38bd2" +source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" dependencies = [ "serde", "serde_with 3.21.0", diff --git a/packages/rs-dpp/Cargo.toml b/packages/rs-dpp/Cargo.toml index 8be6fdb5680..64db8bfd871 100644 --- a/packages/rs-dpp/Cargo.toml +++ b/packages/rs-dpp/Cargo.toml @@ -76,7 +76,7 @@ strum = { version = "0.26", features = ["derive"] } json-schema-compatibility-validator = { path = '../rs-json-schema-compatibility-validator', optional = true } once_cell = "1.19.0" tracing = { version = "0.1.41" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22", optional = true } [dev-dependencies] tokio = { version = "1.40", features = ["full"] } diff --git a/packages/rs-drive-abci/Cargo.toml b/packages/rs-drive-abci/Cargo.toml index aec40b8d50c..5beb9765418 100644 --- a/packages/rs-drive-abci/Cargo.toml +++ b/packages/rs-drive-abci/Cargo.toml @@ -82,7 +82,7 @@ derive_more = { version = "1.0", features = ["from", "deref", "deref_mut"] } async-trait = "0.1.77" console-subscriber = { version = "0.4", optional = true } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f", optional = true } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2" } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22" } nonempty = "0.11" # Shielded-pool snapshot needs raw RocksDB SstFileWriter + ingest_external_file_cf # bindings, and blake3 for the snapshot-file checksum. @@ -108,7 +108,7 @@ dpp = { path = "../rs-dpp", default-features = false, features = [ drive = { path = "../rs-drive", features = ["fixtures-and-mocks"] } drive-proof-verifier = { path = "../rs-drive-proof-verifier" } strategy-tests = { path = "../strategy-tests" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2", features = ["client"] } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22", features = ["client"] } assert_matches = "1.5.0" drive-abci = { path = ".", features = ["testing-config", "mocks", "shielded_test_data"] } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f" } @@ -122,8 +122,8 @@ integer-encoding = { version = "4.0.0" } # For dump_only_default_and_aux_cfs_under_shielded_subtree_prefix — same # subtree-prefix algorithm grovedb uses internally. -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2" } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22" } [features] default = ["bls-signatures"] diff --git a/packages/rs-drive/Cargo.toml b/packages/rs-drive/Cargo.toml index 05c85e8d9c0..7e016537f72 100644 --- a/packages/rs-drive/Cargo.toml +++ b/packages/rs-drive/Cargo.toml @@ -52,13 +52,13 @@ enum-map = { version = "2.0.3", optional = true } intmap = { version = "3.0.1", features = ["serde"], optional = true } chrono = { version = "0.4.35", optional = true } itertools = { version = "0.13", optional = true } -grovedb = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2", optional = true, default-features = false } -grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2", optional = true } -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2" } -grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2", optional = true } -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2" } -grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2" } +grovedb = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22", optional = true, default-features = false } +grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22", optional = true } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22" } +grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22", optional = true } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22" } +grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22" } [dev-dependencies] criterion = "0.5" diff --git a/packages/rs-drive/src/util/grove_operations/mod.rs b/packages/rs-drive/src/util/grove_operations/mod.rs index 9d9fddd2a5a..0b1971908cf 100644 --- a/packages/rs-drive/src/util/grove_operations/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/mod.rs @@ -4,21 +4,21 @@ //! use grovedb::batch::QualifiedGroveDbOp; -use grovedb::DisplacedValue; - -/// Every op Drive hands to GroveDB declares that the value it displaces takes -/// no part in backward references, because Drive stores no such participants. -/// GroveDB checks the claim for free from the value it reads for the write -/// and refuses a false one, so the declaration cannot corrupt state; it only -/// spares the maintenance planning and the estimated fan-out. When a document -/// type starts storing participants, declare per op where the ops are built -/// instead of here. + +/// Every op Drive hands to GroveDB becomes its `DontCheck` twin, declaring +/// that the value it displaces takes no part in backward references, because +/// Drive stores no such participants. GroveDB checks the claim for free from +/// the value it reads for the write and refuses a false one, so the +/// declaration cannot corrupt state; it only spares the maintenance planning +/// and the estimated fan-out. When a document type starts storing +/// participants, build the checked ops for it where they are created instead +/// of converting here. pub(crate) fn declaring_no_participants( operations: Vec, ) -> Vec { operations .into_iter() - .map(|op| op.with_displaced_value(DisplacedValue::NotParticipant)) + .map(QualifiedGroveDbOp::dont_check) .collect() } diff --git a/packages/rs-drive/tests/drive_storage_ops_coverage.rs b/packages/rs-drive/tests/drive_storage_ops_coverage.rs index 143eaa32056..25ea15b592e 100644 --- a/packages/rs-drive/tests/drive_storage_ops_coverage.rs +++ b/packages/rs-drive/tests/drive_storage_ops_coverage.rs @@ -955,7 +955,7 @@ mod grovedb_op_batch_tests { use drive::util::batch::grovedb_op_batch::GroveDbOpBatch; use drive::util::batch::grovedb_op_batch::GroveDbOpBatchV0Methods; use grovedb::batch::{GroveOp, QualifiedGroveDbOp}; - use grovedb::{DisplacedValue, Element, TreeType}; + use grovedb::{Element, TreeType}; #[test] fn new_batch_is_empty() { @@ -1399,7 +1399,6 @@ mod grovedb_op_batch_tests { path: KeyInfoPath(vec![]), key: None, op: GroveOp::Delete, - displaced_value: DisplacedValue::NotParticipant, }; let mut batch = GroveDbOpBatch::new(); batch.push(op); diff --git a/packages/rs-platform-version/Cargo.toml b/packages/rs-platform-version/Cargo.toml index 628c749b03b..f3a8778be4b 100644 --- a/packages/rs-platform-version/Cargo.toml +++ b/packages/rs-platform-version/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" thiserror = { version = "2.0.12" } bincode = { workspace = true } versioned-feature-core = "1.0.0" -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2" } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22" } [features] mock-versions = [] diff --git a/packages/rs-platform-wallet/Cargo.toml b/packages/rs-platform-wallet/Cargo.toml index 5af435758eb..c5d8213b5fd 100644 --- a/packages/rs-platform-wallet/Cargo.toml +++ b/packages/rs-platform-wallet/Cargo.toml @@ -61,7 +61,7 @@ zeroize = "1" log = "0.4" # Shielded pool (optional, behind `shielded` feature) -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22", optional = true } # Direct `rusqlite` access so `FileBackedShieldedStore::open_path` can set # WAL + synchronous=NORMAL pragmas before handing the connection to # `ClientPersistentCommitmentTree`. Version locked to match the rev grovedb diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index 7fc65eb02ff..4ca0e4af535 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -18,7 +18,7 @@ drive = { path = "../rs-drive", default-features = false, features = [ ] } drive-proof-verifier = { path = "../rs-drive-proof-verifier", default-features = false } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "08003fa209f3439a7062d0fcaeec500f87b38bd2", features = [ +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22", features = [ "client", "sqlite", ], optional = true } From 5f907532122c1d76806e644dc16f271fe78417f0 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sun, 13 Sep 2026 09:11:40 +0700 Subject: [PATCH 13/20] fix(drive)!: declare the backward-reference twin where each GroveDB op is built Drive converted every op to its DontCheck twin at the three places it applies or estimates a batch. That hid the declaration from the code that builds the ops. Each of Drive's 58 QualifiedGroveDbOp constructor sites now builds the twin itself (delete, delete-tree, insert-or-replace, replace and patch, since the estimator charges the displaced-participant fan-out per op declared MayBeParticipant), the delete ops GroveDB builds for Drive carry NotParticipant from its DeleteOptions and DeleteUpTreeOptions, the estimated delete builders receive the same declaration, and Drive's batch inspection matches both the checked op and its twin. The boundary conversion is gone. GroveDB is pinned at #953 head a584d9d7, which makes the delete builders honor the declaration they are given. PV14 fees are unchanged from the previous revision, and PV13 is untouched. Co-Authored-By: Claude Fable 5.1 --- Cargo.lock | 32 +++---- packages/rs-dpp/Cargo.toml | 2 +- packages/rs-drive-abci/Cargo.toml | 8 +- packages/rs-drive/Cargo.toml | 14 +-- .../v0/mod.rs | 3 +- .../v0/mod.rs | 3 +- .../contract/update/update_keywords/v0/mod.rs | 4 +- .../add_epoch_final_info_operation/v0/mod.rs | 3 +- .../credit_pools/epochs/operations_factory.rs | 16 +++- .../rs-drive/src/drive/credit_pools/mod.rs | 4 +- .../src/drive/credit_pools/operations.rs | 4 +- .../v0/mod.rs | 2 +- .../src/drive/identity/balance/update.rs | 16 ++-- .../v0/mod.rs | 2 + .../v1/mod.rs | 2 + .../v0/mod.rs | 3 +- .../v1/mod.rs | 3 +- .../v0/mod.rs | 11 ++- .../fetch/single_balance/v0/mod.rs | 3 +- .../shielded/update_total_balance/v0/mod.rs | 3 +- .../src/drive/tokens/balance/update.rs | 16 ++-- .../set_direct_purchase_price/v0/mod.rs | 2 +- .../add_to_token_total_supply/v0/mod.rs | 3 +- .../remove_from_token_total_supply/v0/mod.rs | 3 +- packages/rs-drive/src/fees/op.rs | 23 +++-- .../src/util/batch/grovedb_op_batch/mod.rs | 58 ++++++------ .../grove_operations/batch_delete/v0/mod.rs | 1 + .../v0/mod.rs | 1 + .../v0/mod.rs | 6 +- .../v0/mod.rs | 26 ++++-- .../v0/mod.rs | 2 +- .../grove_operations/batch_move/v0/mod.rs | 10 +- .../batch_move_items_in_path_query/v0/mod.rs | 10 +- .../batch_remove_raw/v0/mod.rs | 34 ++++--- .../grove_operations/batch_replace/v0/mod.rs | 2 +- .../v0/mod.rs | 4 +- .../v0/mod.rs | 4 +- .../grove_batch_operations_costs/v0/mod.rs | 4 +- .../rs-drive/src/util/grove_operations/mod.rs | 19 ---- .../rs-drive/src/util/operations/tests.rs | 91 ++++++++++--------- .../verify_shielded_pool_state/v0/mod.rs | 3 +- .../tests/drive_storage_ops_coverage.rs | 15 ++- packages/rs-platform-version/Cargo.toml | 2 +- packages/rs-platform-wallet/Cargo.toml | 2 +- packages/rs-sdk/Cargo.toml | 2 +- 45 files changed, 272 insertions(+), 209 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cafc9c932a6..f6f18bbe53c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2957,7 +2957,7 @@ dependencies = [ [[package]] name = "grovedb" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" +source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" dependencies = [ "axum 0.8.9", "blake3", @@ -3016,7 +3016,7 @@ dependencies = [ [[package]] name = "grovedb-bulk-append-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" +source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" dependencies = [ "blake3", "grovedb-bincode", @@ -3034,7 +3034,7 @@ dependencies = [ [[package]] name = "grovedb-commitment-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" +source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3051,7 +3051,7 @@ dependencies = [ [[package]] name = "grovedb-costs" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" +source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" dependencies = [ "integer-encoding", "intmap", @@ -3061,7 +3061,7 @@ dependencies = [ [[package]] name = "grovedb-dense-fixed-sized-merkle-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" +source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" dependencies = [ "blake3", "grovedb-bincode", @@ -3075,7 +3075,7 @@ dependencies = [ [[package]] name = "grovedb-element" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" +source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" dependencies = [ "grovedb-bincode", "grovedb-bincode-derive", @@ -3091,7 +3091,7 @@ dependencies = [ [[package]] name = "grovedb-epoch-based-storage-flags" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" +source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" dependencies = [ "grovedb-costs", "hex", @@ -3103,7 +3103,7 @@ dependencies = [ [[package]] name = "grovedb-merk" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" +source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" dependencies = [ "blake3", "byteorder", @@ -3129,7 +3129,7 @@ dependencies = [ [[package]] name = "grovedb-merkle-mountain-range" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" +source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" dependencies = [ "blake3", "grovedb-bincode", @@ -3142,7 +3142,7 @@ dependencies = [ [[package]] name = "grovedb-path" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" +source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" dependencies = [ "hex", ] @@ -3150,7 +3150,7 @@ dependencies = [ [[package]] name = "grovedb-private-document-store" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" +source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3163,7 +3163,7 @@ dependencies = [ [[package]] name = "grovedb-query" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" +source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" dependencies = [ "byteorder", "ed", @@ -3179,7 +3179,7 @@ dependencies = [ [[package]] name = "grovedb-storage" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" +source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" dependencies = [ "blake3", "grovedb-costs", @@ -3198,7 +3198,7 @@ dependencies = [ [[package]] name = "grovedb-version" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" +source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" dependencies = [ "thiserror 2.0.18", "versioned-feature-core", @@ -3207,7 +3207,7 @@ dependencies = [ [[package]] name = "grovedb-visualize" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" +source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" dependencies = [ "hex", "itertools 0.14.0", @@ -3216,7 +3216,7 @@ dependencies = [ [[package]] name = "grovedbg-types" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=82b9c74532977bf67b3a1cb3028126d38dbbdc22#82b9c74532977bf67b3a1cb3028126d38dbbdc22" +source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" dependencies = [ "serde", "serde_with 3.21.0", diff --git a/packages/rs-dpp/Cargo.toml b/packages/rs-dpp/Cargo.toml index 64db8bfd871..52e5249e992 100644 --- a/packages/rs-dpp/Cargo.toml +++ b/packages/rs-dpp/Cargo.toml @@ -76,7 +76,7 @@ strum = { version = "0.26", features = ["derive"] } json-schema-compatibility-validator = { path = '../rs-json-schema-compatibility-validator', optional = true } once_cell = "1.19.0" tracing = { version = "0.1.41" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1", optional = true } [dev-dependencies] tokio = { version = "1.40", features = ["full"] } diff --git a/packages/rs-drive-abci/Cargo.toml b/packages/rs-drive-abci/Cargo.toml index 5beb9765418..71e692a86be 100644 --- a/packages/rs-drive-abci/Cargo.toml +++ b/packages/rs-drive-abci/Cargo.toml @@ -82,7 +82,7 @@ derive_more = { version = "1.0", features = ["from", "deref", "deref_mut"] } async-trait = "0.1.77" console-subscriber = { version = "0.4", optional = true } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f", optional = true } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22" } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" } nonempty = "0.11" # Shielded-pool snapshot needs raw RocksDB SstFileWriter + ingest_external_file_cf # bindings, and blake3 for the snapshot-file checksum. @@ -108,7 +108,7 @@ dpp = { path = "../rs-dpp", default-features = false, features = [ drive = { path = "../rs-drive", features = ["fixtures-and-mocks"] } drive-proof-verifier = { path = "../rs-drive-proof-verifier" } strategy-tests = { path = "../strategy-tests" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22", features = ["client"] } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1", features = ["client"] } assert_matches = "1.5.0" drive-abci = { path = ".", features = ["testing-config", "mocks", "shielded_test_data"] } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f" } @@ -122,8 +122,8 @@ integer-encoding = { version = "4.0.0" } # For dump_only_default_and_aux_cfs_under_shielded_subtree_prefix — same # subtree-prefix algorithm grovedb uses internally. -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22" } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" } [features] default = ["bls-signatures"] diff --git a/packages/rs-drive/Cargo.toml b/packages/rs-drive/Cargo.toml index 7e016537f72..816e56e999f 100644 --- a/packages/rs-drive/Cargo.toml +++ b/packages/rs-drive/Cargo.toml @@ -52,13 +52,13 @@ enum-map = { version = "2.0.3", optional = true } intmap = { version = "3.0.1", features = ["serde"], optional = true } chrono = { version = "0.4.35", optional = true } itertools = { version = "0.13", optional = true } -grovedb = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22", optional = true, default-features = false } -grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22", optional = true } -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22" } -grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22", optional = true } -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22" } -grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22" } +grovedb = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1", optional = true, default-features = false } +grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1", optional = true } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" } +grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1", optional = true } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" } +grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" } [dev-dependencies] criterion = "0.5" diff --git a/packages/rs-drive/src/drive/balances/add_to_system_credits_operations/v0/mod.rs b/packages/rs-drive/src/drive/balances/add_to_system_credits_operations/v0/mod.rs index 33b1740e104..f29f7ae8afe 100644 --- a/packages/rs-drive/src/drive/balances/add_to_system_credits_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/balances/add_to_system_credits_operations/v0/mod.rs @@ -56,7 +56,8 @@ impl Drive { path_holding_total_credits_vec, TOTAL_SYSTEM_CREDITS_STORAGE_KEY.to_vec(), Item(new_total.encode_var_vec(), None), - ); + ) + .dont_check(); drive_operations.push(GroveOperation(replace_op)); Ok(drive_operations) } diff --git a/packages/rs-drive/src/drive/balances/remove_from_system_credits_operations/v0/mod.rs b/packages/rs-drive/src/drive/balances/remove_from_system_credits_operations/v0/mod.rs index 8bdb989d21f..744d4d3dc96 100644 --- a/packages/rs-drive/src/drive/balances/remove_from_system_credits_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/balances/remove_from_system_credits_operations/v0/mod.rs @@ -57,7 +57,8 @@ impl Drive { path_holding_total_credits_vec, TOTAL_SYSTEM_CREDITS_STORAGE_KEY.to_vec(), Item(new_total.encode_var_vec(), None), - ); + ) + .dont_check(); drive_operations.push(GroveOperation(replace_op)); Ok(drive_operations) } diff --git a/packages/rs-drive/src/drive/contract/update/update_keywords/v0/mod.rs b/packages/rs-drive/src/drive/contract/update/update_keywords/v0/mod.rs index 15a847c7e8a..880fe63ad00 100644 --- a/packages/rs-drive/src/drive/contract/update/update_keywords/v0/mod.rs +++ b/packages/rs-drive/src/drive/contract/update/update_keywords/v0/mod.rs @@ -596,7 +596,9 @@ mod tests { .fold((0, 0), |(deletes, inserts), operation| match operation { LowLevelDriveOperation::GroveOperation(op) if op.path.to_path() == group_path => { match op.op { - GroveOp::Delete | GroveOp::DeleteTree(..) => (deletes + 1, inserts), + GroveOp::DeleteDontCheck | GroveOp::DeleteTreeDontCheck(..) => { + (deletes + 1, inserts) + } _ => (deletes, inserts + 1), } } diff --git a/packages/rs-drive/src/drive/credit_pools/epochs/credit_distribution_pools/add_epoch_final_info_operation/v0/mod.rs b/packages/rs-drive/src/drive/credit_pools/epochs/credit_distribution_pools/add_epoch_final_info_operation/v0/mod.rs index 212ca01d11e..905ec42ba86 100644 --- a/packages/rs-drive/src/drive/credit_pools/epochs/credit_distribution_pools/add_epoch_final_info_operation/v0/mod.rs +++ b/packages/rs-drive/src/drive/credit_pools/epochs/credit_distribution_pools/add_epoch_final_info_operation/v0/mod.rs @@ -25,6 +25,7 @@ impl Drive { epoch_tree_path, epoch_key_constants::KEY_FINISHED_EPOCH_INFO.to_vec(), Element::new_item(serialized), - )) + ) + .dont_check()) } } diff --git a/packages/rs-drive/src/drive/credit_pools/epochs/operations_factory.rs b/packages/rs-drive/src/drive/credit_pools/epochs/operations_factory.rs index a3396005212..14cfdf747c9 100644 --- a/packages/rs-drive/src/drive/credit_pools/epochs/operations_factory.rs +++ b/packages/rs-drive/src/drive/credit_pools/epochs/operations_factory.rs @@ -194,6 +194,7 @@ impl EpochOperations for Epoch { KEY_PROTOCOL_VERSION.to_vec(), Element::Item(protocol_version.to_be_bytes().to_vec(), None), ) + .dont_check() } /// Returns a groveDB op which updates the epoch start time. @@ -203,6 +204,7 @@ impl EpochOperations for Epoch { KEY_START_TIME.to_vec(), Element::Item(time_ms.to_be_bytes().to_vec(), None), ) + .dont_check() } /// Returns a groveDB op which updates the epoch start block height. @@ -212,6 +214,7 @@ impl EpochOperations for Epoch { KEY_START_BLOCK_HEIGHT.to_vec(), Element::Item(start_block_height.to_be_bytes().to_vec(), None), ) + .dont_check() } /// Returns a groveDB op which updates the epoch start block core height. @@ -224,6 +227,7 @@ impl EpochOperations for Epoch { KEY_START_BLOCK_CORE_HEIGHT.to_vec(), Element::Item(start_block_core_height.to_be_bytes().to_vec(), None), ) + .dont_check() } /// Returns a groveDB op which updates the epoch fee multiplier. @@ -233,6 +237,7 @@ impl EpochOperations for Epoch { KEY_FEE_MULTIPLIER.to_vec(), Element::Item(multiplier_permille.to_be_bytes().to_vec(), None), ) + .dont_check() } /// Returns a groveDB op which updates the epoch processing credits for distribution. @@ -244,12 +249,14 @@ impl EpochOperations for Epoch { self.get_path_vec(), KEY_POOL_PROCESSING_FEES.to_vec(), Element::new_sum_item(processing_fee.to_signed()?), - )) + ) + .dont_check()) } /// Returns a groveDB op which deletes the epoch processing credits for distribution tree. fn delete_processing_credits_for_distribution_operation(&self) -> QualifiedGroveDbOp { QualifiedGroveDbOp::delete_op(self.get_path_vec(), KEY_POOL_PROCESSING_FEES.to_vec()) + .dont_check() } /// Returns a groveDB op which updates the epoch storage credits for distribution. @@ -261,12 +268,14 @@ impl EpochOperations for Epoch { self.get_path_vec(), KEY_POOL_STORAGE_FEES.to_vec(), Element::new_sum_item(storage_fee.to_signed()?), - )) + ) + .dont_check()) } /// Returns a groveDB op which deletes the epoch storage credits for distribution tree. fn delete_storage_credits_for_distribution_operation(&self) -> QualifiedGroveDbOp { QualifiedGroveDbOp::delete_op(self.get_path_vec(), KEY_POOL_STORAGE_FEES.to_vec()) + .dont_check() } /// Returns a groveDB op which updates the given epoch proposer's block count. @@ -280,6 +289,7 @@ impl EpochOperations for Epoch { proposer_pro_tx_hash.to_vec(), Element::Item(block_count.to_be_bytes().to_vec(), None), ) + .dont_check() } /// Returns a groveDB op which inserts an empty tree into the epoch proposers path. @@ -289,6 +299,7 @@ impl EpochOperations for Epoch { KEY_PROPOSERS.to_vec(), Element::empty_tree(), ) + .dont_check() } /// Returns a groveDB op which deletes the epoch proposers tree. @@ -299,6 +310,7 @@ impl EpochOperations for Epoch { TreeType::NormalTree, SubelementsDeletionBehavior::DeleteChildren, ) + .dont_check() } /// Adds a groveDB op to the batch which deletes the given epoch proposers from the proposers tree. diff --git a/packages/rs-drive/src/drive/credit_pools/mod.rs b/packages/rs-drive/src/drive/credit_pools/mod.rs index 0d8e3f29726..c2f7a258939 100644 --- a/packages/rs-drive/src/drive/credit_pools/mod.rs +++ b/packages/rs-drive/src/drive/credit_pools/mod.rs @@ -270,7 +270,7 @@ mod tests { Epoch::new(i as EpochIndex).unwrap().get_path_vec() ); - let GroveOp::InsertOrReplace { + let GroveOp::InsertOrReplaceDontCheck { element: Element::SumItem(credits, _), } = operation.op else { @@ -334,7 +334,7 @@ mod tests { let updated_credits: Vec<_> = batch .into_iter() .map(|operation| { - let GroveOp::InsertOrReplace { + let GroveOp::InsertOrReplaceDontCheck { element: Element::SumItem(credits, _), } = operation.op else { diff --git a/packages/rs-drive/src/drive/credit_pools/operations.rs b/packages/rs-drive/src/drive/credit_pools/operations.rs index 9aad69bf5b4..66076815b64 100644 --- a/packages/rs-drive/src/drive/credit_pools/operations.rs +++ b/packages/rs-drive/src/drive/credit_pools/operations.rs @@ -26,7 +26,8 @@ pub fn update_storage_fee_distribution_pool_operation( pools_vec_path(), KEY_STORAGE_FEE_POOL.to_vec(), Element::new_sum_item(storage_fee.to_signed()?), - )) + ) + .dont_check()) } #[cfg(feature = "server")] @@ -37,6 +38,7 @@ pub fn update_unpaid_epoch_index_operation(epoch_index: EpochIndex) -> Qualified KEY_UNPAID_EPOCH_INDEX.to_vec(), Element::new_item(epoch_index.to_be_bytes().to_vec()), ) + .dont_check() } #[cfg(test)] diff --git a/packages/rs-drive/src/drive/credit_pools/pending_epoch_refunds/methods/add_delete_pending_epoch_refunds_except_specified/v0/mod.rs b/packages/rs-drive/src/drive/credit_pools/pending_epoch_refunds/methods/add_delete_pending_epoch_refunds_except_specified/v0/mod.rs index ed2b1a5d8e3..f0b69f36e18 100644 --- a/packages/rs-drive/src/drive/credit_pools/pending_epoch_refunds/methods/add_delete_pending_epoch_refunds_except_specified/v0/mod.rs +++ b/packages/rs-drive/src/drive/credit_pools/pending_epoch_refunds/methods/add_delete_pending_epoch_refunds_except_specified/v0/mod.rs @@ -124,7 +124,7 @@ mod tests { assert_eq!(batch.len(), expected_pending_refunds.len()); for operation in batch.into_iter() { - assert!(matches!(operation.op, GroveOp::Delete)); + assert!(matches!(operation.op, GroveOp::DeleteDontCheck)); assert_eq!(operation.path.to_path(), pending_epoch_refunds_path_vec()); diff --git a/packages/rs-drive/src/drive/identity/balance/update.rs b/packages/rs-drive/src/drive/identity/balance/update.rs index 83d8278467b..324b25b8a7d 100644 --- a/packages/rs-drive/src/drive/identity/balance/update.rs +++ b/packages/rs-drive/src/drive/identity/balance/update.rs @@ -600,14 +600,14 @@ mod tests { _, _, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::Replace { + op: GroveOp::ReplaceDontCheck { element: Element::SumItem(refund_amount, None), }, .. }), .., LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::Replace { + op: GroveOp::ReplaceDontCheck { element: Element::SumItem(other_refund_amount, None), }, .. @@ -696,13 +696,13 @@ mod tests { _, _, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::Replace { + op: GroveOp::ReplaceDontCheck { element: Element::SumItem(refund_amount, None), }, .. }), LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::Replace { + op: GroveOp::ReplaceDontCheck { element: Element::Item(debt_bytes, None), }, .. @@ -771,7 +771,7 @@ mod tests { _, _, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::Replace { + op: GroveOp::ReplaceDontCheck { element: Element::Item(debt_bytes, None), }, .. @@ -826,7 +826,7 @@ mod tests { assert!(matches!( drive_operations[..], [_, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::Replace { + op: GroveOp::ReplaceDontCheck { element: Element::SumItem(balance, None), }, .. @@ -885,13 +885,13 @@ mod tests { [ _, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::Replace { + op: GroveOp::ReplaceDontCheck { element: Element::SumItem(balance, None), }, .. }), LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::Replace { + op: GroveOp::ReplaceDontCheck { element: Element::Item(debt_bytes, None), }, .. diff --git a/packages/rs-drive/src/drive/prefunded_specialized_balances/add_prefunded_specialized_balance_operations/v0/mod.rs b/packages/rs-drive/src/drive/prefunded_specialized_balances/add_prefunded_specialized_balance_operations/v0/mod.rs index e4602733a57..79e932a764a 100644 --- a/packages/rs-drive/src/drive/prefunded_specialized_balances/add_prefunded_specialized_balance_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/prefunded_specialized_balances/add_prefunded_specialized_balance_operations/v0/mod.rs @@ -67,12 +67,14 @@ impl Drive { specialized_balance_id.to_vec(), Element::new_sum_item(new_total as i64), ) + .dont_check() } else { QualifiedGroveDbOp::insert_or_replace_op( path_holding_total_credits_vec, specialized_balance_id.to_vec(), Element::new_sum_item(new_total as i64), ) + .dont_check() }; drive_operations.push(GroveOperation(op)); Ok(drive_operations) diff --git a/packages/rs-drive/src/drive/prefunded_specialized_balances/add_prefunded_specialized_balance_operations/v1/mod.rs b/packages/rs-drive/src/drive/prefunded_specialized_balances/add_prefunded_specialized_balance_operations/v1/mod.rs index a65eb8f7564..30dd26cc70d 100644 --- a/packages/rs-drive/src/drive/prefunded_specialized_balances/add_prefunded_specialized_balance_operations/v1/mod.rs +++ b/packages/rs-drive/src/drive/prefunded_specialized_balances/add_prefunded_specialized_balance_operations/v1/mod.rs @@ -78,12 +78,14 @@ impl Drive { specialized_balance_id.to_vec(), Element::new_sum_item(new_total as i64), ) + .dont_check() } else { QualifiedGroveDbOp::insert_or_replace_op( path_holding_total_credits_vec, specialized_balance_id.to_vec(), Element::new_sum_item(new_total as i64), ) + .dont_check() }; drive_operations.push(GroveOperation(op)); Ok(drive_operations) diff --git a/packages/rs-drive/src/drive/prefunded_specialized_balances/deduct_from_prefunded_specialized_balance_operations/v0/mod.rs b/packages/rs-drive/src/drive/prefunded_specialized_balances/deduct_from_prefunded_specialized_balance_operations/v0/mod.rs index ef3a75fc580..36bc5af5a1f 100644 --- a/packages/rs-drive/src/drive/prefunded_specialized_balances/deduct_from_prefunded_specialized_balance_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/prefunded_specialized_balances/deduct_from_prefunded_specialized_balance_operations/v0/mod.rs @@ -64,7 +64,8 @@ impl Drive { path_holding_total_credits_vec, specialized_balance_id.to_vec(), Element::new_sum_item(new_total as i64), - ); + ) + .dont_check(); drive_operations.push(GroveOperation(replace_op)); Ok(drive_operations) } diff --git a/packages/rs-drive/src/drive/prefunded_specialized_balances/deduct_from_prefunded_specialized_balance_operations/v1/mod.rs b/packages/rs-drive/src/drive/prefunded_specialized_balances/deduct_from_prefunded_specialized_balance_operations/v1/mod.rs index c043e83d78c..7d43f368ecf 100644 --- a/packages/rs-drive/src/drive/prefunded_specialized_balances/deduct_from_prefunded_specialized_balance_operations/v1/mod.rs +++ b/packages/rs-drive/src/drive/prefunded_specialized_balances/deduct_from_prefunded_specialized_balance_operations/v1/mod.rs @@ -84,7 +84,8 @@ impl Drive { path_holding_total_credits_vec, specialized_balance_id.to_vec(), Element::new_sum_item(new_total as i64), - ); + ) + .dont_check(); drive_operations.push(GroveOperation(replace_op)); Ok(drive_operations) } diff --git a/packages/rs-drive/src/drive/prefunded_specialized_balances/empty_prefunded_specialized_balance_operations/v0/mod.rs b/packages/rs-drive/src/drive/prefunded_specialized_balances/empty_prefunded_specialized_balance_operations/v0/mod.rs index b971adc53c2..f5e3a0fcd04 100644 --- a/packages/rs-drive/src/drive/prefunded_specialized_balances/empty_prefunded_specialized_balance_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/prefunded_specialized_balances/empty_prefunded_specialized_balance_operations/v0/mod.rs @@ -78,7 +78,8 @@ impl Drive { let delete_op = QualifiedGroveDbOp::delete_op( path_holding_total_credits_vec, specialized_balance_id.to_vec(), - ); + ) + .dont_check(); drive_operations.push(GroveOperation(delete_op)); Ok((previous_credits_in_specialized_balance, drive_operations)) } @@ -101,7 +102,13 @@ mod tests { fn has_delete_op(ops: &[crate::fees::op::LowLevelDriveOperation]) -> bool { ops.iter().any(|op| match op { GroveOperation(qualified) => { - matches!(qualified.op, GroveOp::Delete | GroveOp::DeleteTree { .. }) + matches!( + qualified.op, + GroveOp::Delete + | GroveOp::DeleteDontCheck + | GroveOp::DeleteTree { .. } + | GroveOp::DeleteTreeDontCheck { .. } + ) } _ => false, }) diff --git a/packages/rs-drive/src/drive/prefunded_specialized_balances/fetch/single_balance/v0/mod.rs b/packages/rs-drive/src/drive/prefunded_specialized_balances/fetch/single_balance/v0/mod.rs index a8811774b07..bb621de235c 100644 --- a/packages/rs-drive/src/drive/prefunded_specialized_balances/fetch/single_balance/v0/mod.rs +++ b/packages/rs-drive/src/drive/prefunded_specialized_balances/fetch/single_balance/v0/mod.rs @@ -194,7 +194,8 @@ mod tests { prefunded_specialized_balances_for_voting_path_vec(), id.to_vec(), Element::new_sum_item(-42), - ); + ) + .dont_check(); drive .grove_apply_batch( crate::util::batch::GroveDbOpBatch::from_operations(vec![op]), diff --git a/packages/rs-drive/src/drive/shielded/update_total_balance/v0/mod.rs b/packages/rs-drive/src/drive/shielded/update_total_balance/v0/mod.rs index b7fcc8814ca..aa2928ed72c 100644 --- a/packages/rs-drive/src/drive/shielded/update_total_balance/v0/mod.rs +++ b/packages/rs-drive/src/drive/shielded/update_total_balance/v0/mod.rs @@ -26,7 +26,8 @@ impl Drive { pool_path, vec![SHIELDED_TOTAL_BALANCE_KEY], Element::new_sum_item(balance_i64), - ), + ) + .dont_check(), )]) } } diff --git a/packages/rs-drive/src/drive/tokens/balance/update.rs b/packages/rs-drive/src/drive/tokens/balance/update.rs index df479eb6200..e65606bdd76 100644 --- a/packages/rs-drive/src/drive/tokens/balance/update.rs +++ b/packages/rs-drive/src/drive/tokens/balance/update.rs @@ -619,14 +619,14 @@ mod tests { _, _, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::Replace { + op: GroveOp::ReplaceDontCheck { element: Element::SumItem(refund_amount, None), }, .. }), .., LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::Replace { + op: GroveOp::ReplaceDontCheck { element: Element::SumItem(other_refund_amount, None), }, .. @@ -715,13 +715,13 @@ mod tests { _, _, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::Replace { + op: GroveOp::ReplaceDontCheck { element: Element::SumItem(refund_amount, None), }, .. }), LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::Replace { + op: GroveOp::ReplaceDontCheck { element: Element::Item(debt_bytes, None), }, .. @@ -790,7 +790,7 @@ mod tests { _, _, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::Replace { + op: GroveOp::ReplaceDontCheck { element: Element::Item(debt_bytes, None), }, .. @@ -845,7 +845,7 @@ mod tests { assert!(matches!( drive_operations[..], [_, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::Replace { + op: GroveOp::ReplaceDontCheck { element: Element::SumItem(balance, None), }, .. @@ -904,13 +904,13 @@ mod tests { [ _, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::Replace { + op: GroveOp::ReplaceDontCheck { element: Element::SumItem(balance, None), }, .. }), LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::Replace { + op: GroveOp::ReplaceDontCheck { element: Element::Item(debt_bytes, None), }, .. diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/v0/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/v0/mod.rs index 9c05f3bcd29..55bdb253b2c 100644 --- a/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/v0/mod.rs @@ -40,7 +40,7 @@ impl Drive { )); } else { drive_operations.push(LowLevelDriveOperation::GroveOperation( - QualifiedGroveDbOp::delete_op(direct_selling_path, token_id.to_vec()), + QualifiedGroveDbOp::delete_op(direct_selling_path, token_id.to_vec()).dont_check(), )); } diff --git a/packages/rs-drive/src/drive/tokens/system/add_to_token_total_supply/v0/mod.rs b/packages/rs-drive/src/drive/tokens/system/add_to_token_total_supply/v0/mod.rs index dd5626a67b6..e07424e0e26 100644 --- a/packages/rs-drive/src/drive/tokens/system/add_to_token_total_supply/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/system/add_to_token_total_supply/v0/mod.rs @@ -138,7 +138,8 @@ impl Drive { path_holding_total_token_supply_vec, token_id.to_vec(), SumItem(new_total, None), - ); + ) + .dont_check(); drive_operations.push(GroveOperation(replace_op)); new_total as u64 - total_token_supply_in_platform } else if allow_first_mint { diff --git a/packages/rs-drive/src/drive/tokens/system/remove_from_token_total_supply/v0/mod.rs b/packages/rs-drive/src/drive/tokens/system/remove_from_token_total_supply/v0/mod.rs index 6efdc122fd6..769551bb793 100644 --- a/packages/rs-drive/src/drive/tokens/system/remove_from_token_total_supply/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/system/remove_from_token_total_supply/v0/mod.rs @@ -138,7 +138,8 @@ impl Drive { path_holding_total_token_supply_vec, token_id.to_vec(), SumItem(new_total as i64, None), - ); + ) + .dont_check(); drive_operations.push(GroveOperation(replace_op)); Ok(drive_operations) diff --git a/packages/rs-drive/src/fees/op.rs b/packages/rs-drive/src/fees/op.rs index 7e55a751bd4..8336de45512 100644 --- a/packages/rs-drive/src/fees/op.rs +++ b/packages/rs-drive/src/fees/op.rs @@ -1382,7 +1382,7 @@ impl LowLevelDriveOperation { key: Vec, element: Element, ) -> Self { - GroveOperation(QualifiedGroveDbOp::insert_or_replace_op(path, key, element)) + GroveOperation(QualifiedGroveDbOp::insert_or_replace_op(path, key, element).dont_check()) } /// Sets `GroveOperation` for replacement of an element at the given path and key @@ -1391,7 +1391,7 @@ impl LowLevelDriveOperation { key: Vec, element: Element, ) -> Self { - GroveOperation(QualifiedGroveDbOp::replace_op(path, key, element)) + GroveOperation(QualifiedGroveDbOp::replace_op(path, key, element).dont_check()) } /// Sets `GroveOperation` for patching of an element at the given path and key @@ -1402,12 +1402,9 @@ impl LowLevelDriveOperation { element: Element, change_in_bytes: i32, ) -> Self { - GroveOperation(QualifiedGroveDbOp::patch_op( - path, - key, - element, - change_in_bytes, - )) + GroveOperation( + QualifiedGroveDbOp::patch_op(path, key, element, change_in_bytes).dont_check(), + ) } /// Sets `GroveOperation` for inserting an element at an unknown estimated path and key @@ -1416,7 +1413,7 @@ impl LowLevelDriveOperation { key: KeyInfo, element: Element, ) -> Self { - GroveOperation(QualifiedGroveDbOp::insert_estimated_op(path, key, element)) + GroveOperation(QualifiedGroveDbOp::insert_estimated_op(path, key, element).dont_check()) } /// Sets `GroveOperation` for replacement of an element at an unknown estimated path and key @@ -1425,7 +1422,7 @@ impl LowLevelDriveOperation { key: KeyInfo, element: Element, ) -> Self { - GroveOperation(QualifiedGroveDbOp::replace_estimated_op(path, key, element)) + GroveOperation(QualifiedGroveDbOp::replace_estimated_op(path, key, element).dont_check()) } /// Sets `GroveOperation` for refresh of a reference at the given path and key @@ -2440,7 +2437,8 @@ mod tests { match op { LowLevelDriveOperation::GroveOperation(grove_op) => match grove_op.op { - GroveOp::InsertOrReplace { element } => assert!( + GroveOp::InsertOrReplace { element } + | GroveOp::InsertOrReplaceDontCheck { element } => assert!( matches!(element, Element::ProvableSumTree(..)), "expected ProvableSumTree element, got: {:?}", element @@ -2525,7 +2523,8 @@ mod tests { }); let element = match op { LowLevelDriveOperation::GroveOperation(grove_op) => match grove_op.op { - GroveOp::InsertOrReplace { element } => element, + GroveOp::InsertOrReplace { element } + | GroveOp::InsertOrReplaceDontCheck { element } => element, other => panic!("expected InsertOrReplace, got {other:?}"), }, other => panic!("expected GroveOperation, got {other:?}"), diff --git a/packages/rs-drive/src/util/batch/grovedb_op_batch/mod.rs b/packages/rs-drive/src/util/batch/grovedb_op_batch/mod.rs index 7e0c7e9ec8a..7890aa34ebc 100644 --- a/packages/rs-drive/src/util/batch/grovedb_op_batch/mod.rs +++ b/packages/rs-drive/src/util/batch/grovedb_op_batch/mod.rs @@ -347,6 +347,7 @@ impl fmt::Display for GroveDbOpBatch { writeln!(f, " Key: {}", key_string)?; match &op.op { GroveOp::InsertOrReplace { element } + | GroveOp::InsertOrReplaceDontCheck { element } | GroveOp::InsertWithKnownToNotAlreadyExist { element } | GroveOp::InsertIfNotExists { element, .. } => { let flags = element.get_flags(); @@ -536,12 +537,9 @@ impl GroveDbOpBatchV0Methods for GroveDbOpBatch { /// Adds an `Insert` operation with an empty tree at the specified path and key to a list of GroveDB ops. fn add_insert_empty_tree(&mut self, path: Vec>, key: Vec) { - self.operations - .push(QualifiedGroveDbOp::insert_or_replace_op( - path, - key, - Element::empty_tree(), - )) + self.operations.push( + QualifiedGroveDbOp::insert_or_replace_op(path, key, Element::empty_tree()).dont_check(), + ) } /// Adds an `Insert` operation with an empty tree with storage flags to a list of GroveDB ops. @@ -551,24 +549,24 @@ impl GroveDbOpBatchV0Methods for GroveDbOpBatch { key: Vec, storage_flags: &Option>, ) { - self.operations - .push(QualifiedGroveDbOp::insert_or_replace_op( + self.operations.push( + QualifiedGroveDbOp::insert_or_replace_op( path, key, Element::empty_tree_with_flags( StorageFlags::map_borrowed_cow_to_some_element_flags(storage_flags), ), - )) + ) + .dont_check(), + ) } /// Adds an `Insert` operation with an empty sum tree at the specified path and key to a list of GroveDB ops. fn add_insert_empty_sum_tree(&mut self, path: Vec>, key: Vec) { - self.operations - .push(QualifiedGroveDbOp::insert_or_replace_op( - path, - key, - Element::empty_sum_tree(), - )) + self.operations.push( + QualifiedGroveDbOp::insert_or_replace_op(path, key, Element::empty_sum_tree()) + .dont_check(), + ) } /// Adds an `Insert` operation with an empty sum tree with storage flags to a list of GroveDB ops. @@ -578,38 +576,43 @@ impl GroveDbOpBatchV0Methods for GroveDbOpBatch { key: Vec, storage_flags: &Option>, ) { - self.operations - .push(QualifiedGroveDbOp::insert_or_replace_op( + self.operations.push( + QualifiedGroveDbOp::insert_or_replace_op( path, key, Element::empty_sum_tree_with_flags( StorageFlags::map_borrowed_cow_to_some_element_flags(storage_flags), ), - )) + ) + .dont_check(), + ) } /// Adds a `Delete` operation to a list of GroveDB ops. fn add_delete(&mut self, path: Vec>, key: Vec) { self.operations - .push(QualifiedGroveDbOp::delete_op(path, key)) + .push(QualifiedGroveDbOp::delete_op(path, key).dont_check()) } /// Adds a `Delete` tree operation to a list of GroveDB ops. /// Uses `DontCheckWithNoCleanup` because callers (e.g. `batch_delete_up_tree_while_empty`) /// have already verified the tree is empty. fn add_delete_tree(&mut self, path: Vec>, key: Vec, tree_type: TreeType) { - self.operations.push(QualifiedGroveDbOp::delete_tree_op( - path, - key, - tree_type, - SubelementsDeletionBehavior::DontCheckWithNoCleanup, - )) + self.operations.push( + QualifiedGroveDbOp::delete_tree_op( + path, + key, + tree_type, + SubelementsDeletionBehavior::DontCheckWithNoCleanup, + ) + .dont_check(), + ) } /// Adds an `Insert` operation with an element to a list of GroveDB ops. fn add_insert(&mut self, path: Vec>, key: Vec, element: Element) { self.operations - .push(QualifiedGroveDbOp::insert_or_replace_op(path, key, element)) + .push(QualifiedGroveDbOp::insert_or_replace_op(path, key, element).dont_check()) } /// Verify consistency of operations @@ -707,10 +710,13 @@ impl GroveDbOpBatchV0Methods for GroveDbOpBatch { let op = if matches!( op, &GroveOp::InsertOrReplace { .. } + | &GroveOp::InsertOrReplaceDontCheck { .. } | &GroveOp::InsertWithKnownToNotAlreadyExist { .. } | &GroveOp::InsertIfNotExists { .. } | &GroveOp::Replace { .. } + | &GroveOp::ReplaceDontCheck { .. } | &GroveOp::Patch { .. } + | &GroveOp::PatchDontCheck { .. } ) { self.operations.remove(index).op } else { diff --git a/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs index 0d81e99e9d9..33601cff683 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs @@ -70,6 +70,7 @@ impl Drive { true, 0, (estimated_key_size, estimated_value_size), + DisplacedValue::NotParticipant, &drive_version.grove_version, ) .map(|r| r.map(Some)), diff --git a/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs index 47e4c10737a..34105bd4222 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs @@ -102,6 +102,7 @@ impl Drive { true, 0, (estimated_key_size, estimated_value_size), + DisplacedValue::NotParticipant, &drive_version.grove_version, ) .map(|r| r.map(Some)), diff --git a/packages/rs-drive/src/util/grove_operations/batch_delete_up_tree_while_empty/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_delete_up_tree_while_empty/v0/mod.rs index d292aae1fdd..06951e98327 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_delete_up_tree_while_empty/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_delete_up_tree_while_empty/v0/mod.rs @@ -7,7 +7,7 @@ use crate::util::grove_operations::{push_drive_operation_result, BatchDeleteUpTr use grovedb::batch::key_info::KeyInfo; use grovedb::batch::KeyInfoPath; use grovedb::operations::delete::DeleteUpTreeOptions; -use grovedb::{GroveDb, TransactionArg}; +use grovedb::{DisplacedValue, GroveDb, TransactionArg}; use grovedb_storage::rocksdb_storage::RocksDbStorage; use platform_version::version::drive_versions::DriveVersion; @@ -46,6 +46,7 @@ impl Drive { stop_path_height, true, estimated_layer_info, + DisplacedValue::NotParticipant, &drive_version.grove_version, ), BatchDeleteUpTreeApplyType::StatefulBatchDelete { @@ -57,6 +58,9 @@ impl Drive { base_root_storage_is_free: true, validate_tree_at_path_exists: false, stop_path_height, + // Drive stores no backward-reference participants; GroveDB checks + // the claim for free from the value it reads for each delete. + displaced_value: DisplacedValue::NotParticipant, }; self.grove.delete_operations_for_delete_up_tree_while_empty( path.to_path_refs().as_slice().into(), diff --git a/packages/rs-drive/src/util/grove_operations/batch_insert_empty_tree_if_not_exists/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_insert_empty_tree_if_not_exists/v0/mod.rs index 4e425c7296c..44ea04331d5 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_insert_empty_tree_if_not_exists/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_insert_empty_tree_if_not_exists/v0/mod.rs @@ -114,7 +114,10 @@ impl Drive { } else if let GroveOperation(grove_op) = previous_drive_operation { if grove_op.key == Some(KeyInfo::KnownKey(key.to_vec())) && grove_op.path == path - && matches!(grove_op.op, GroveOp::DeleteTree(_, _)) + && matches!( + grove_op.op, + GroveOp::DeleteTree(_, _) | GroveOp::DeleteTreeDontCheck(_, _) + ) { found = true; existing_operations.remove(i); @@ -177,7 +180,10 @@ impl Drive { } else if let GroveOperation(grove_op) = previous_drive_operation { if grove_op.key == Some(KeyInfo::KnownKey(key.to_vec())) && grove_op.path == path - && matches!(grove_op.op, GroveOp::DeleteTree(_, _)) + && matches!( + grove_op.op, + GroveOp::DeleteTree(_, _) | GroveOp::DeleteTreeDontCheck(_, _) + ) { found = true; existing_operations.remove(i); @@ -238,7 +244,10 @@ impl Drive { } else if let GroveOperation(grove_op) = previous_drive_operation { if grove_op.key == Some(KeyInfo::KnownKey(key.to_vec())) && grove_op.path == path - && matches!(grove_op.op, GroveOp::DeleteTree(_, _)) + && matches!( + grove_op.op, + GroveOp::DeleteTree(_, _) | GroveOp::DeleteTreeDontCheck(_, _) + ) { found = true; existing_operations.remove(i); @@ -299,7 +308,10 @@ impl Drive { } else if let GroveOperation(grove_op) = previous_drive_operation { if grove_op.key == Some(KeyInfo::KnownKey(key.to_vec())) && grove_op.path == path - && matches!(grove_op.op, GroveOp::DeleteTree(_, _)) + && matches!( + grove_op.op, + GroveOp::DeleteTree(_, _) | GroveOp::DeleteTreeDontCheck(_, _) + ) { found = true; existing_operations.remove(i); @@ -718,7 +730,7 @@ mod tests { let element = match ops.pop().expect("one operation must be pushed") { LowLevelDriveOperation::GroveOperation(grove_op) => match grove_op.op { - GroveOp::InsertOrReplace { element } => element, + GroveOp::InsertOrReplaceDontCheck { element } => element, other => panic!("{description}: expected InsertOrReplace, got {other:?}"), }, other => panic!("{description}: expected GroveOperation, got {other:?}"), @@ -746,7 +758,7 @@ mod tests { assert!(inserted); let element = match ops.pop().expect("one operation must be pushed") { LowLevelDriveOperation::GroveOperation(grove_op) => match grove_op.op { - GroveOp::InsertOrReplace { element } => element, + GroveOp::InsertOrReplaceDontCheck { element } => element, other => panic!("expected InsertOrReplace, got {other:?}"), }, other => panic!("expected GroveOperation, got {other:?}"), @@ -807,7 +819,7 @@ mod tests { assert!(inserted); let element = match ops.pop().expect("one operation must be pushed") { LowLevelDriveOperation::GroveOperation(grove_op) => match grove_op.op { - GroveOp::InsertOrReplace { element } => element, + GroveOp::InsertOrReplaceDontCheck { element } => element, other => panic!("expected InsertOrReplace, got {other:?}"), }, other => panic!("expected GroveOperation, got {other:?}"), diff --git a/packages/rs-drive/src/util/grove_operations/batch_insert_sum_item_or_add_to_if_already_exists/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_insert_sum_item_or_add_to_if_already_exists/v0/mod.rs index e20dc882e83..e51116fe5a1 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_insert_sum_item_or_add_to_if_already_exists/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_insert_sum_item_or_add_to_if_already_exists/v0/mod.rs @@ -328,7 +328,7 @@ mod tests { let insert_op = &ops[1]; match insert_op { LowLevelDriveOperation::GroveOperation(grove_op) => match &grove_op.op { - GroveOp::InsertOrReplace { element } => { + GroveOp::InsertOrReplaceDontCheck { element } => { assert_eq!( *element, Element::new_sum_item(15), diff --git a/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs index c05cc3805f0..5b86644dba0 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs @@ -84,6 +84,7 @@ impl Drive { true, 0, (estimated_key_size, estimated_value_size), + DisplacedValue::NotParticipant, &drive_version.grove_version, ) .map(|r| r.map(Some)), @@ -107,11 +108,10 @@ impl Drive { } drive_operations.push(GroveOperation(delete_op)); - drive_operations.push(GroveOperation(QualifiedGroveDbOp::insert_or_replace_op( - to_path, - key.to_vec(), - element, - ))); + drive_operations.push(GroveOperation( + QualifiedGroveDbOp::insert_or_replace_op(to_path, key.to_vec(), element) + .dont_check(), + )); } Ok(()) diff --git a/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs index daee80bc758..fd5e5aa5f42 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs @@ -109,6 +109,7 @@ impl Drive { true, 0, (estimated_key_size, estimated_value_size), + DisplacedValue::NotParticipant, &drive_version.grove_version, ) .map(|r| r.map(Some)), @@ -136,11 +137,10 @@ impl Drive { // Add the delete operation to the batch of drive operations drive_operations.push(GroveOperation(delete_operation)); // Adds the insert operation to the batch of drive operations - drive_operations.push(GroveOperation(QualifiedGroveDbOp::insert_or_replace_op( - new_path.clone(), - key, - element, - ))); + drive_operations.push(GroveOperation( + QualifiedGroveDbOp::insert_or_replace_op(new_path.clone(), key, element) + .dont_check(), + )); } } diff --git a/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs index f490b149706..06c6744fad7 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs @@ -39,19 +39,26 @@ impl Drive { validate_tree_at_path_exists: false, //todo: not sure about this one }; - let needs_removal_from_state = - match current_batch_operations.remove_if_insert(path.to_vec(), key) { - Some(GroveOp::InsertOrReplace { element }) - | Some(GroveOp::Replace { element }) - | Some(GroveOp::Patch { element, .. }) => return Ok(Some(element)), - Some(GroveOp::InsertTreeWithRootHash { .. }) => { - return Err(Error::Drive(DriveError::CorruptedCodeExecution( - "we should not be seeing internal grovedb operations", - ))); - } - Some(GroveOp::Delete) | Some(GroveOp::DeleteTree(_, _)) => false, - _ => true, - }; + let needs_removal_from_state = match current_batch_operations + .remove_if_insert(path.to_vec(), key) + { + Some( + GroveOp::InsertOrReplace { element } + | GroveOp::InsertOrReplaceDontCheck { element }, + ) + | Some(GroveOp::Replace { element } | GroveOp::ReplaceDontCheck { element }) + | Some(GroveOp::Patch { element, .. } | GroveOp::PatchDontCheck { element, .. }) => { + return Ok(Some(element)) + } + Some(GroveOp::InsertTreeWithRootHash { .. }) => { + return Err(Error::Drive(DriveError::CorruptedCodeExecution( + "we should not be seeing internal grovedb operations", + ))); + } + Some(GroveOp::Delete | GroveOp::DeleteDontCheck) + | Some(GroveOp::DeleteTree(_, _) | GroveOp::DeleteTreeDontCheck(_, _)) => false, + _ => true, + }; let maybe_element = self.grove_get_raw_optional( path.clone(), @@ -83,6 +90,7 @@ impl Drive { true, 0, (estimated_key_size, estimated_value_size), + DisplacedValue::NotParticipant, &drive_version.grove_version, ) .map(|r| r.map(Some)), diff --git a/packages/rs-drive/src/util/grove_operations/batch_replace/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_replace/v0/mod.rs index fc23b3f3d39..bf72c66a901 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_replace/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_replace/v0/mod.rs @@ -71,7 +71,7 @@ mod tests { match &ops[0] { LowLevelDriveOperation::GroveOperation(grove_op) => { assert!( - matches!(grove_op.op, GroveOp::Replace { .. }), + matches!(grove_op.op, GroveOp::ReplaceDontCheck { .. }), "Expected GroveOp::Replace, got {:?}", grove_op.op ); diff --git a/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs index 35c2f5c0337..e44000512d7 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_apply_batch_with_add_costs/v0/mod.rs @@ -5,7 +5,7 @@ use crate::fees::op::LowLevelDriveOperation; use crate::query::GroveError; use crate::util::batch::grovedb_op_batch::GroveDbOpBatchV0Methods; use crate::util::batch::GroveDbOpBatch; -use crate::util::grove_operations::{declaring_no_participants, push_drive_operation_result}; +use crate::util::grove_operations::push_drive_operation_result; use crate::util::storage_flags::StorageFlags; use grovedb::batch::{BatchApplyOptions, QualifiedGroveDbOp}; use grovedb::TransactionArg; @@ -61,7 +61,7 @@ impl Drive { }; let cost_context = self.grove.apply_batch_with_element_flags_update( - declaring_no_participants(ops.operations), + ops.operations, Some(BatchApplyOptions { validate_insertion_does_not_override: validate, validate_insertion_does_not_override_tree: validate, diff --git a/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs index 409b3f9546d..a736817ab8d 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_apply_partial_batch_with_add_costs/v0/mod.rs @@ -5,7 +5,7 @@ use crate::fees::op::LowLevelDriveOperation; use crate::query::GroveError; use crate::util::batch::grovedb_op_batch::GroveDbOpBatchV0Methods; use crate::util::batch::GroveDbOpBatch; -use crate::util::grove_operations::{declaring_no_participants, push_drive_operation_result}; +use crate::util::grove_operations::push_drive_operation_result; use crate::util::storage_flags::{MergingOwnersStrategy, StorageFlags}; use grovedb::batch::{BatchApplyOptions, OpsByLevelPath, QualifiedGroveDbOp}; use grovedb::TransactionArg; @@ -46,7 +46,7 @@ impl Drive { } let cost_context = self.grove.apply_partial_batch_with_element_flags_update( - declaring_no_participants(ops.operations), + ops.operations, Some(BatchApplyOptions { validate_insertion_does_not_override: validate, validate_insertion_does_not_override_tree: validate, diff --git a/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs index ae3e4c5f630..77d8d247a5c 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_batch_operations_costs/v0/mod.rs @@ -3,7 +3,7 @@ use crate::error::Error; use crate::fees::op::LowLevelDriveOperation; use crate::query::GroveError; use crate::util::batch::GroveDbOpBatch; -use crate::util::grove_operations::{declaring_no_participants, push_drive_operation_result}; +use crate::util::grove_operations::push_drive_operation_result; use grovedb::batch::estimated_costs::EstimatedCostsType::AverageCaseCostsType; use grovedb::batch::{BatchApplyOptions, KeyInfoPath}; use grovedb::{EstimatedLayerInformation, GroveDb}; @@ -22,7 +22,7 @@ impl Drive { ) -> Result<(), Error> { let cost_context = GroveDb::estimated_case_operations_for_batch( AverageCaseCostsType(estimated_layer_info), - declaring_no_participants(ops.operations), + ops.operations, Some(BatchApplyOptions { validate_insertion_does_not_override: validate, validate_insertion_does_not_override_tree: validate, diff --git a/packages/rs-drive/src/util/grove_operations/mod.rs b/packages/rs-drive/src/util/grove_operations/mod.rs index 0b1971908cf..ef3b826c99e 100644 --- a/packages/rs-drive/src/util/grove_operations/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/mod.rs @@ -3,25 +3,6 @@ //! Defines and implements in Drive functions pertinent to groveDB operations. //! -use grovedb::batch::QualifiedGroveDbOp; - -/// Every op Drive hands to GroveDB becomes its `DontCheck` twin, declaring -/// that the value it displaces takes no part in backward references, because -/// Drive stores no such participants. GroveDB checks the claim for free from -/// the value it reads for the write and refuses a false one, so the -/// declaration cannot corrupt state; it only spares the maintenance planning -/// and the estimated fan-out. When a document type starts storing -/// participants, build the checked ops for it where they are created instead -/// of converting here. -pub(crate) fn declaring_no_participants( - operations: Vec, -) -> Vec { - operations - .into_iter() - .map(QualifiedGroveDbOp::dont_check) - .collect() -} - /// Grove insert operation pub mod grove_insert; diff --git a/packages/rs-drive/src/util/operations/tests.rs b/packages/rs-drive/src/util/operations/tests.rs index 1dc9d637052..bf13f1d2971 100644 --- a/packages/rs-drive/src/util/operations/tests.rs +++ b/packages/rs-drive/src/util/operations/tests.rs @@ -92,17 +92,19 @@ fn apply_batch_low_level_mixed_ops_applies_grove_and_preserves_leftovers() { // of guessing paths, we build grove ops against an already-existing // subtree by inserting at a *newly created* subtree first. let batch_ops = vec![ - LowLevelDriveOperation::GroveOperation(QualifiedGroveDbOp::insert_or_replace_op( - vec![], - vec![0xfe], - Element::empty_tree(), - )), + LowLevelDriveOperation::GroveOperation( + QualifiedGroveDbOp::insert_or_replace_op(vec![], vec![0xfe], Element::empty_tree()) + .dont_check(), + ), function_op(), - LowLevelDriveOperation::GroveOperation(QualifiedGroveDbOp::insert_or_replace_op( - vec![vec![0xfe]], - vec![0x01], - Element::new_item(vec![1, 2, 3]), - )), + LowLevelDriveOperation::GroveOperation( + QualifiedGroveDbOp::insert_or_replace_op( + vec![vec![0xfe]], + vec![0x01], + Element::new_item(vec![1, 2, 3]), + ) + .dont_check(), + ), ]; let mut drive_operations: Vec = vec![]; @@ -145,16 +147,18 @@ fn apply_batch_low_level_actually_persists_grove_inserts() { let platform_version = PlatformVersion::latest(); let batch_ops = vec![ - LowLevelDriveOperation::GroveOperation(QualifiedGroveDbOp::insert_or_replace_op( - vec![], - vec![0xfd], - Element::empty_tree(), - )), - LowLevelDriveOperation::GroveOperation(QualifiedGroveDbOp::insert_or_replace_op( - vec![vec![0xfd]], - b"hello".to_vec(), - Element::new_item(b"world".to_vec()), - )), + LowLevelDriveOperation::GroveOperation( + QualifiedGroveDbOp::insert_or_replace_op(vec![], vec![0xfd], Element::empty_tree()) + .dont_check(), + ), + LowLevelDriveOperation::GroveOperation( + QualifiedGroveDbOp::insert_or_replace_op( + vec![vec![0xfd]], + b"hello".to_vec(), + Element::new_item(b"world".to_vec()), + ) + .dont_check(), + ), ]; let mut drive_operations: Vec = vec![]; @@ -280,16 +284,18 @@ fn rollback_transaction_v0_discards_uncommitted_changes() { // Build ops inside the transaction. let batch_ops = vec![ - LowLevelDriveOperation::GroveOperation(QualifiedGroveDbOp::insert_or_replace_op( - vec![], - vec![0xfb], - Element::empty_tree(), - )), - LowLevelDriveOperation::GroveOperation(QualifiedGroveDbOp::insert_or_replace_op( - vec![vec![0xfb]], - b"k".to_vec(), - Element::new_item(b"v".to_vec()), - )), + LowLevelDriveOperation::GroveOperation( + QualifiedGroveDbOp::insert_or_replace_op(vec![], vec![0xfb], Element::empty_tree()) + .dont_check(), + ), + LowLevelDriveOperation::GroveOperation( + QualifiedGroveDbOp::insert_or_replace_op( + vec![vec![0xfb]], + b"k".to_vec(), + Element::new_item(b"v".to_vec()), + ) + .dont_check(), + ), ]; let mut drive_operations: Vec = vec![]; drive @@ -323,7 +329,8 @@ fn rollback_transaction_v0_discards_uncommitted_changes() { vec![vec![0xfb]], b"k2".to_vec(), Element::new_item(b"v2".to_vec()), - ), + ) + .dont_check(), )]; let mut drive_operations: Vec = vec![]; let res = drive.apply_batch_low_level_drive_operations_v0( @@ -387,16 +394,18 @@ fn public_apply_batch_low_level_drive_operations_routes_through_v0() { let platform_version = PlatformVersion::latest(); let batch_ops = vec![ - LowLevelDriveOperation::GroveOperation(QualifiedGroveDbOp::insert_or_replace_op( - vec![], - vec![0xfa], - Element::empty_tree(), - )), - LowLevelDriveOperation::GroveOperation(QualifiedGroveDbOp::insert_or_replace_op( - vec![vec![0xfa]], - b"x".to_vec(), - Element::new_item(b"y".to_vec()), - )), + LowLevelDriveOperation::GroveOperation( + QualifiedGroveDbOp::insert_or_replace_op(vec![], vec![0xfa], Element::empty_tree()) + .dont_check(), + ), + LowLevelDriveOperation::GroveOperation( + QualifiedGroveDbOp::insert_or_replace_op( + vec![vec![0xfa]], + b"x".to_vec(), + Element::new_item(b"y".to_vec()), + ) + .dont_check(), + ), ]; let mut drive_operations: Vec = vec![]; diff --git a/packages/rs-drive/src/verify/shielded/verify_shielded_pool_state/v0/mod.rs b/packages/rs-drive/src/verify/shielded/verify_shielded_pool_state/v0/mod.rs index c9028c29db3..8d64192c656 100644 --- a/packages/rs-drive/src/verify/shielded/verify_shielded_pool_state/v0/mod.rs +++ b/packages/rs-drive/src/verify/shielded/verify_shielded_pool_state/v0/mod.rs @@ -91,7 +91,8 @@ mod tests { pool_path.clone(), vec![SHIELDED_TOTAL_BALANCE_KEY], Element::new_sum_item(balance as i64), - ); + ) + .dont_check(); drive .grove_apply_batch( diff --git a/packages/rs-drive/tests/drive_storage_ops_coverage.rs b/packages/rs-drive/tests/drive_storage_ops_coverage.rs index 25ea15b592e..cbe03dbc39e 100644 --- a/packages/rs-drive/tests/drive_storage_ops_coverage.rs +++ b/packages/rs-drive/tests/drive_storage_ops_coverage.rs @@ -968,7 +968,8 @@ mod grovedb_op_batch_tests { fn push_increases_len() { let mut batch = GroveDbOpBatch::new(); let op = - QualifiedGroveDbOp::insert_or_replace_op(vec![vec![1]], vec![2], Element::empty_tree()); + QualifiedGroveDbOp::insert_or_replace_op(vec![vec![1]], vec![2], Element::empty_tree()) + .dont_check(); batch.push(op); assert_eq!(batch.len(), 1); assert!(!batch.is_empty()); @@ -977,8 +978,10 @@ mod grovedb_op_batch_tests { #[test] fn from_operations() { let ops = vec![ - QualifiedGroveDbOp::insert_or_replace_op(vec![vec![1]], vec![2], Element::empty_tree()), - QualifiedGroveDbOp::insert_or_replace_op(vec![vec![3]], vec![4], Element::empty_tree()), + QualifiedGroveDbOp::insert_or_replace_op(vec![vec![1]], vec![2], Element::empty_tree()) + .dont_check(), + QualifiedGroveDbOp::insert_or_replace_op(vec![vec![3]], vec![4], Element::empty_tree()) + .dont_check(), ]; let batch = GroveDbOpBatch::from_operations(ops); assert_eq!(batch.len(), 2); @@ -1002,8 +1005,10 @@ mod grovedb_op_batch_tests { fn extend_adds_operations() { let mut batch = GroveDbOpBatch::new(); let ops = vec![ - QualifiedGroveDbOp::insert_or_replace_op(vec![vec![1]], vec![2], Element::empty_tree()), - QualifiedGroveDbOp::insert_or_replace_op(vec![vec![3]], vec![4], Element::empty_tree()), + QualifiedGroveDbOp::insert_or_replace_op(vec![vec![1]], vec![2], Element::empty_tree()) + .dont_check(), + QualifiedGroveDbOp::insert_or_replace_op(vec![vec![3]], vec![4], Element::empty_tree()) + .dont_check(), ]; batch.extend(ops); assert_eq!(batch.len(), 2); diff --git a/packages/rs-platform-version/Cargo.toml b/packages/rs-platform-version/Cargo.toml index f3a8778be4b..e2c10aa17f7 100644 --- a/packages/rs-platform-version/Cargo.toml +++ b/packages/rs-platform-version/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" thiserror = { version = "2.0.12" } bincode = { workspace = true } versioned-feature-core = "1.0.0" -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22" } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" } [features] mock-versions = [] diff --git a/packages/rs-platform-wallet/Cargo.toml b/packages/rs-platform-wallet/Cargo.toml index c5d8213b5fd..0fd51b2e457 100644 --- a/packages/rs-platform-wallet/Cargo.toml +++ b/packages/rs-platform-wallet/Cargo.toml @@ -61,7 +61,7 @@ zeroize = "1" log = "0.4" # Shielded pool (optional, behind `shielded` feature) -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1", optional = true } # Direct `rusqlite` access so `FileBackedShieldedStore::open_path` can set # WAL + synchronous=NORMAL pragmas before handing the connection to # `ClientPersistentCommitmentTree`. Version locked to match the rev grovedb diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index 4ca0e4af535..bcde851e1d1 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -18,7 +18,7 @@ drive = { path = "../rs-drive", default-features = false, features = [ ] } drive-proof-verifier = { path = "../rs-drive-proof-verifier", default-features = false } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "82b9c74532977bf67b3a1cb3028126d38dbbdc22", features = [ +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1", features = [ "client", "sqlite", ], optional = true } From e33a2d3106a25d4bea41b0f8952a958563be658e Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sun, 13 Sep 2026 09:29:41 +0700 Subject: [PATCH 14/20] refactor(drive): call the twin builder dont_check_for_backwards_references GroveDB #953 renamed `dont_check` so the name says what the twin skips; Drive's 58 constructor sites follow, and the pin moves to that head. Co-Authored-By: Claude Fable 5.1 --- Cargo.lock | 32 +++++++++---------- packages/rs-dpp/Cargo.toml | 2 +- packages/rs-drive-abci/Cargo.toml | 8 ++--- packages/rs-drive/Cargo.toml | 14 ++++---- .../v0/mod.rs | 2 +- .../v0/mod.rs | 2 +- .../add_epoch_final_info_operation/v0/mod.rs | 2 +- .../credit_pools/epochs/operations_factory.rs | 24 +++++++------- .../src/drive/credit_pools/operations.rs | 4 +-- .../v0/mod.rs | 4 +-- .../v1/mod.rs | 4 +-- .../v0/mod.rs | 2 +- .../v1/mod.rs | 2 +- .../v0/mod.rs | 2 +- .../fetch/single_balance/v0/mod.rs | 2 +- .../shielded/update_total_balance/v0/mod.rs | 2 +- .../set_direct_purchase_price/v0/mod.rs | 3 +- .../add_to_token_total_supply/v0/mod.rs | 2 +- .../remove_from_token_total_supply/v0/mod.rs | 2 +- packages/rs-drive/src/fees/op.rs | 23 ++++++++++--- .../src/util/batch/grovedb_op_batch/mod.rs | 19 ++++++----- .../grove_operations/batch_move/v0/mod.rs | 2 +- .../batch_move_items_in_path_query/v0/mod.rs | 2 +- .../rs-drive/src/util/operations/tests.rs | 18 +++++------ .../verify_shielded_pool_state/v0/mod.rs | 2 +- .../tests/drive_storage_ops_coverage.rs | 10 +++--- packages/rs-platform-version/Cargo.toml | 2 +- packages/rs-platform-wallet/Cargo.toml | 2 +- packages/rs-sdk/Cargo.toml | 2 +- 29 files changed, 107 insertions(+), 90 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f6f18bbe53c..994f251cec0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2957,7 +2957,7 @@ dependencies = [ [[package]] name = "grovedb" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" +source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" dependencies = [ "axum 0.8.9", "blake3", @@ -3016,7 +3016,7 @@ dependencies = [ [[package]] name = "grovedb-bulk-append-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" +source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" dependencies = [ "blake3", "grovedb-bincode", @@ -3034,7 +3034,7 @@ dependencies = [ [[package]] name = "grovedb-commitment-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" +source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3051,7 +3051,7 @@ dependencies = [ [[package]] name = "grovedb-costs" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" +source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" dependencies = [ "integer-encoding", "intmap", @@ -3061,7 +3061,7 @@ dependencies = [ [[package]] name = "grovedb-dense-fixed-sized-merkle-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" +source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" dependencies = [ "blake3", "grovedb-bincode", @@ -3075,7 +3075,7 @@ dependencies = [ [[package]] name = "grovedb-element" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" +source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" dependencies = [ "grovedb-bincode", "grovedb-bincode-derive", @@ -3091,7 +3091,7 @@ dependencies = [ [[package]] name = "grovedb-epoch-based-storage-flags" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" +source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" dependencies = [ "grovedb-costs", "hex", @@ -3103,7 +3103,7 @@ dependencies = [ [[package]] name = "grovedb-merk" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" +source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" dependencies = [ "blake3", "byteorder", @@ -3129,7 +3129,7 @@ dependencies = [ [[package]] name = "grovedb-merkle-mountain-range" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" +source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" dependencies = [ "blake3", "grovedb-bincode", @@ -3142,7 +3142,7 @@ dependencies = [ [[package]] name = "grovedb-path" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" +source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" dependencies = [ "hex", ] @@ -3150,7 +3150,7 @@ dependencies = [ [[package]] name = "grovedb-private-document-store" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" +source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3163,7 +3163,7 @@ dependencies = [ [[package]] name = "grovedb-query" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" +source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" dependencies = [ "byteorder", "ed", @@ -3179,7 +3179,7 @@ dependencies = [ [[package]] name = "grovedb-storage" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" +source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" dependencies = [ "blake3", "grovedb-costs", @@ -3198,7 +3198,7 @@ dependencies = [ [[package]] name = "grovedb-version" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" +source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" dependencies = [ "thiserror 2.0.18", "versioned-feature-core", @@ -3207,7 +3207,7 @@ dependencies = [ [[package]] name = "grovedb-visualize" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" +source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" dependencies = [ "hex", "itertools 0.14.0", @@ -3216,7 +3216,7 @@ dependencies = [ [[package]] name = "grovedbg-types" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1#a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" +source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" dependencies = [ "serde", "serde_with 3.21.0", diff --git a/packages/rs-dpp/Cargo.toml b/packages/rs-dpp/Cargo.toml index 52e5249e992..aa467302f64 100644 --- a/packages/rs-dpp/Cargo.toml +++ b/packages/rs-dpp/Cargo.toml @@ -76,7 +76,7 @@ strum = { version = "0.26", features = ["derive"] } json-schema-compatibility-validator = { path = '../rs-json-schema-compatibility-validator', optional = true } once_cell = "1.19.0" tracing = { version = "0.1.41" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6", optional = true } [dev-dependencies] tokio = { version = "1.40", features = ["full"] } diff --git a/packages/rs-drive-abci/Cargo.toml b/packages/rs-drive-abci/Cargo.toml index 71e692a86be..e5f97c9463c 100644 --- a/packages/rs-drive-abci/Cargo.toml +++ b/packages/rs-drive-abci/Cargo.toml @@ -82,7 +82,7 @@ derive_more = { version = "1.0", features = ["from", "deref", "deref_mut"] } async-trait = "0.1.77" console-subscriber = { version = "0.4", optional = true } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f", optional = true } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6" } nonempty = "0.11" # Shielded-pool snapshot needs raw RocksDB SstFileWriter + ingest_external_file_cf # bindings, and blake3 for the snapshot-file checksum. @@ -108,7 +108,7 @@ dpp = { path = "../rs-dpp", default-features = false, features = [ drive = { path = "../rs-drive", features = ["fixtures-and-mocks"] } drive-proof-verifier = { path = "../rs-drive-proof-verifier" } strategy-tests = { path = "../strategy-tests" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1", features = ["client"] } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6", features = ["client"] } assert_matches = "1.5.0" drive-abci = { path = ".", features = ["testing-config", "mocks", "shielded_test_data"] } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f" } @@ -122,8 +122,8 @@ integer-encoding = { version = "4.0.0" } # For dump_only_default_and_aux_cfs_under_shielded_subtree_prefix — same # subtree-prefix algorithm grovedb uses internally. -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6" } [features] default = ["bls-signatures"] diff --git a/packages/rs-drive/Cargo.toml b/packages/rs-drive/Cargo.toml index 816e56e999f..bc370ac0966 100644 --- a/packages/rs-drive/Cargo.toml +++ b/packages/rs-drive/Cargo.toml @@ -52,13 +52,13 @@ enum-map = { version = "2.0.3", optional = true } intmap = { version = "3.0.1", features = ["serde"], optional = true } chrono = { version = "0.4.35", optional = true } itertools = { version = "0.13", optional = true } -grovedb = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1", optional = true, default-features = false } -grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1", optional = true } -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" } -grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1", optional = true } -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" } -grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" } +grovedb = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6", optional = true, default-features = false } +grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6", optional = true } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6" } +grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6", optional = true } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6" } +grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6" } [dev-dependencies] criterion = "0.5" diff --git a/packages/rs-drive/src/drive/balances/add_to_system_credits_operations/v0/mod.rs b/packages/rs-drive/src/drive/balances/add_to_system_credits_operations/v0/mod.rs index f29f7ae8afe..16096317bc7 100644 --- a/packages/rs-drive/src/drive/balances/add_to_system_credits_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/balances/add_to_system_credits_operations/v0/mod.rs @@ -57,7 +57,7 @@ impl Drive { TOTAL_SYSTEM_CREDITS_STORAGE_KEY.to_vec(), Item(new_total.encode_var_vec(), None), ) - .dont_check(); + .dont_check_for_backwards_references(); drive_operations.push(GroveOperation(replace_op)); Ok(drive_operations) } diff --git a/packages/rs-drive/src/drive/balances/remove_from_system_credits_operations/v0/mod.rs b/packages/rs-drive/src/drive/balances/remove_from_system_credits_operations/v0/mod.rs index 744d4d3dc96..d6cc791db2f 100644 --- a/packages/rs-drive/src/drive/balances/remove_from_system_credits_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/balances/remove_from_system_credits_operations/v0/mod.rs @@ -58,7 +58,7 @@ impl Drive { TOTAL_SYSTEM_CREDITS_STORAGE_KEY.to_vec(), Item(new_total.encode_var_vec(), None), ) - .dont_check(); + .dont_check_for_backwards_references(); drive_operations.push(GroveOperation(replace_op)); Ok(drive_operations) } diff --git a/packages/rs-drive/src/drive/credit_pools/epochs/credit_distribution_pools/add_epoch_final_info_operation/v0/mod.rs b/packages/rs-drive/src/drive/credit_pools/epochs/credit_distribution_pools/add_epoch_final_info_operation/v0/mod.rs index 905ec42ba86..a2128f3f8ca 100644 --- a/packages/rs-drive/src/drive/credit_pools/epochs/credit_distribution_pools/add_epoch_final_info_operation/v0/mod.rs +++ b/packages/rs-drive/src/drive/credit_pools/epochs/credit_distribution_pools/add_epoch_final_info_operation/v0/mod.rs @@ -26,6 +26,6 @@ impl Drive { epoch_key_constants::KEY_FINISHED_EPOCH_INFO.to_vec(), Element::new_item(serialized), ) - .dont_check()) + .dont_check_for_backwards_references()) } } diff --git a/packages/rs-drive/src/drive/credit_pools/epochs/operations_factory.rs b/packages/rs-drive/src/drive/credit_pools/epochs/operations_factory.rs index 14cfdf747c9..c030fb1ff43 100644 --- a/packages/rs-drive/src/drive/credit_pools/epochs/operations_factory.rs +++ b/packages/rs-drive/src/drive/credit_pools/epochs/operations_factory.rs @@ -194,7 +194,7 @@ impl EpochOperations for Epoch { KEY_PROTOCOL_VERSION.to_vec(), Element::Item(protocol_version.to_be_bytes().to_vec(), None), ) - .dont_check() + .dont_check_for_backwards_references() } /// Returns a groveDB op which updates the epoch start time. @@ -204,7 +204,7 @@ impl EpochOperations for Epoch { KEY_START_TIME.to_vec(), Element::Item(time_ms.to_be_bytes().to_vec(), None), ) - .dont_check() + .dont_check_for_backwards_references() } /// Returns a groveDB op which updates the epoch start block height. @@ -214,7 +214,7 @@ impl EpochOperations for Epoch { KEY_START_BLOCK_HEIGHT.to_vec(), Element::Item(start_block_height.to_be_bytes().to_vec(), None), ) - .dont_check() + .dont_check_for_backwards_references() } /// Returns a groveDB op which updates the epoch start block core height. @@ -227,7 +227,7 @@ impl EpochOperations for Epoch { KEY_START_BLOCK_CORE_HEIGHT.to_vec(), Element::Item(start_block_core_height.to_be_bytes().to_vec(), None), ) - .dont_check() + .dont_check_for_backwards_references() } /// Returns a groveDB op which updates the epoch fee multiplier. @@ -237,7 +237,7 @@ impl EpochOperations for Epoch { KEY_FEE_MULTIPLIER.to_vec(), Element::Item(multiplier_permille.to_be_bytes().to_vec(), None), ) - .dont_check() + .dont_check_for_backwards_references() } /// Returns a groveDB op which updates the epoch processing credits for distribution. @@ -250,13 +250,13 @@ impl EpochOperations for Epoch { KEY_POOL_PROCESSING_FEES.to_vec(), Element::new_sum_item(processing_fee.to_signed()?), ) - .dont_check()) + .dont_check_for_backwards_references()) } /// Returns a groveDB op which deletes the epoch processing credits for distribution tree. fn delete_processing_credits_for_distribution_operation(&self) -> QualifiedGroveDbOp { QualifiedGroveDbOp::delete_op(self.get_path_vec(), KEY_POOL_PROCESSING_FEES.to_vec()) - .dont_check() + .dont_check_for_backwards_references() } /// Returns a groveDB op which updates the epoch storage credits for distribution. @@ -269,13 +269,13 @@ impl EpochOperations for Epoch { KEY_POOL_STORAGE_FEES.to_vec(), Element::new_sum_item(storage_fee.to_signed()?), ) - .dont_check()) + .dont_check_for_backwards_references()) } /// Returns a groveDB op which deletes the epoch storage credits for distribution tree. fn delete_storage_credits_for_distribution_operation(&self) -> QualifiedGroveDbOp { QualifiedGroveDbOp::delete_op(self.get_path_vec(), KEY_POOL_STORAGE_FEES.to_vec()) - .dont_check() + .dont_check_for_backwards_references() } /// Returns a groveDB op which updates the given epoch proposer's block count. @@ -289,7 +289,7 @@ impl EpochOperations for Epoch { proposer_pro_tx_hash.to_vec(), Element::Item(block_count.to_be_bytes().to_vec(), None), ) - .dont_check() + .dont_check_for_backwards_references() } /// Returns a groveDB op which inserts an empty tree into the epoch proposers path. @@ -299,7 +299,7 @@ impl EpochOperations for Epoch { KEY_PROPOSERS.to_vec(), Element::empty_tree(), ) - .dont_check() + .dont_check_for_backwards_references() } /// Returns a groveDB op which deletes the epoch proposers tree. @@ -310,7 +310,7 @@ impl EpochOperations for Epoch { TreeType::NormalTree, SubelementsDeletionBehavior::DeleteChildren, ) - .dont_check() + .dont_check_for_backwards_references() } /// Adds a groveDB op to the batch which deletes the given epoch proposers from the proposers tree. diff --git a/packages/rs-drive/src/drive/credit_pools/operations.rs b/packages/rs-drive/src/drive/credit_pools/operations.rs index 66076815b64..62e42a99d2d 100644 --- a/packages/rs-drive/src/drive/credit_pools/operations.rs +++ b/packages/rs-drive/src/drive/credit_pools/operations.rs @@ -27,7 +27,7 @@ pub fn update_storage_fee_distribution_pool_operation( KEY_STORAGE_FEE_POOL.to_vec(), Element::new_sum_item(storage_fee.to_signed()?), ) - .dont_check()) + .dont_check_for_backwards_references()) } #[cfg(feature = "server")] @@ -38,7 +38,7 @@ pub fn update_unpaid_epoch_index_operation(epoch_index: EpochIndex) -> Qualified KEY_UNPAID_EPOCH_INDEX.to_vec(), Element::new_item(epoch_index.to_be_bytes().to_vec()), ) - .dont_check() + .dont_check_for_backwards_references() } #[cfg(test)] diff --git a/packages/rs-drive/src/drive/prefunded_specialized_balances/add_prefunded_specialized_balance_operations/v0/mod.rs b/packages/rs-drive/src/drive/prefunded_specialized_balances/add_prefunded_specialized_balance_operations/v0/mod.rs index 79e932a764a..f1a4f9b02d4 100644 --- a/packages/rs-drive/src/drive/prefunded_specialized_balances/add_prefunded_specialized_balance_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/prefunded_specialized_balances/add_prefunded_specialized_balance_operations/v0/mod.rs @@ -67,14 +67,14 @@ impl Drive { specialized_balance_id.to_vec(), Element::new_sum_item(new_total as i64), ) - .dont_check() + .dont_check_for_backwards_references() } else { QualifiedGroveDbOp::insert_or_replace_op( path_holding_total_credits_vec, specialized_balance_id.to_vec(), Element::new_sum_item(new_total as i64), ) - .dont_check() + .dont_check_for_backwards_references() }; drive_operations.push(GroveOperation(op)); Ok(drive_operations) diff --git a/packages/rs-drive/src/drive/prefunded_specialized_balances/add_prefunded_specialized_balance_operations/v1/mod.rs b/packages/rs-drive/src/drive/prefunded_specialized_balances/add_prefunded_specialized_balance_operations/v1/mod.rs index 30dd26cc70d..0a49cc213d4 100644 --- a/packages/rs-drive/src/drive/prefunded_specialized_balances/add_prefunded_specialized_balance_operations/v1/mod.rs +++ b/packages/rs-drive/src/drive/prefunded_specialized_balances/add_prefunded_specialized_balance_operations/v1/mod.rs @@ -78,14 +78,14 @@ impl Drive { specialized_balance_id.to_vec(), Element::new_sum_item(new_total as i64), ) - .dont_check() + .dont_check_for_backwards_references() } else { QualifiedGroveDbOp::insert_or_replace_op( path_holding_total_credits_vec, specialized_balance_id.to_vec(), Element::new_sum_item(new_total as i64), ) - .dont_check() + .dont_check_for_backwards_references() }; drive_operations.push(GroveOperation(op)); Ok(drive_operations) diff --git a/packages/rs-drive/src/drive/prefunded_specialized_balances/deduct_from_prefunded_specialized_balance_operations/v0/mod.rs b/packages/rs-drive/src/drive/prefunded_specialized_balances/deduct_from_prefunded_specialized_balance_operations/v0/mod.rs index 36bc5af5a1f..bffbe462439 100644 --- a/packages/rs-drive/src/drive/prefunded_specialized_balances/deduct_from_prefunded_specialized_balance_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/prefunded_specialized_balances/deduct_from_prefunded_specialized_balance_operations/v0/mod.rs @@ -65,7 +65,7 @@ impl Drive { specialized_balance_id.to_vec(), Element::new_sum_item(new_total as i64), ) - .dont_check(); + .dont_check_for_backwards_references(); drive_operations.push(GroveOperation(replace_op)); Ok(drive_operations) } diff --git a/packages/rs-drive/src/drive/prefunded_specialized_balances/deduct_from_prefunded_specialized_balance_operations/v1/mod.rs b/packages/rs-drive/src/drive/prefunded_specialized_balances/deduct_from_prefunded_specialized_balance_operations/v1/mod.rs index 7d43f368ecf..c7c21ebc7e9 100644 --- a/packages/rs-drive/src/drive/prefunded_specialized_balances/deduct_from_prefunded_specialized_balance_operations/v1/mod.rs +++ b/packages/rs-drive/src/drive/prefunded_specialized_balances/deduct_from_prefunded_specialized_balance_operations/v1/mod.rs @@ -85,7 +85,7 @@ impl Drive { specialized_balance_id.to_vec(), Element::new_sum_item(new_total as i64), ) - .dont_check(); + .dont_check_for_backwards_references(); drive_operations.push(GroveOperation(replace_op)); Ok(drive_operations) } diff --git a/packages/rs-drive/src/drive/prefunded_specialized_balances/empty_prefunded_specialized_balance_operations/v0/mod.rs b/packages/rs-drive/src/drive/prefunded_specialized_balances/empty_prefunded_specialized_balance_operations/v0/mod.rs index f5e3a0fcd04..2ba27befc19 100644 --- a/packages/rs-drive/src/drive/prefunded_specialized_balances/empty_prefunded_specialized_balance_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/prefunded_specialized_balances/empty_prefunded_specialized_balance_operations/v0/mod.rs @@ -79,7 +79,7 @@ impl Drive { path_holding_total_credits_vec, specialized_balance_id.to_vec(), ) - .dont_check(); + .dont_check_for_backwards_references(); drive_operations.push(GroveOperation(delete_op)); Ok((previous_credits_in_specialized_balance, drive_operations)) } diff --git a/packages/rs-drive/src/drive/prefunded_specialized_balances/fetch/single_balance/v0/mod.rs b/packages/rs-drive/src/drive/prefunded_specialized_balances/fetch/single_balance/v0/mod.rs index bb621de235c..c02d03e5f60 100644 --- a/packages/rs-drive/src/drive/prefunded_specialized_balances/fetch/single_balance/v0/mod.rs +++ b/packages/rs-drive/src/drive/prefunded_specialized_balances/fetch/single_balance/v0/mod.rs @@ -195,7 +195,7 @@ mod tests { id.to_vec(), Element::new_sum_item(-42), ) - .dont_check(); + .dont_check_for_backwards_references(); drive .grove_apply_batch( crate::util::batch::GroveDbOpBatch::from_operations(vec![op]), diff --git a/packages/rs-drive/src/drive/shielded/update_total_balance/v0/mod.rs b/packages/rs-drive/src/drive/shielded/update_total_balance/v0/mod.rs index aa2928ed72c..278447e5991 100644 --- a/packages/rs-drive/src/drive/shielded/update_total_balance/v0/mod.rs +++ b/packages/rs-drive/src/drive/shielded/update_total_balance/v0/mod.rs @@ -27,7 +27,7 @@ impl Drive { vec![SHIELDED_TOTAL_BALANCE_KEY], Element::new_sum_item(balance_i64), ) - .dont_check(), + .dont_check_for_backwards_references(), )]) } } diff --git a/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/v0/mod.rs b/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/v0/mod.rs index 55bdb253b2c..0905d940dbf 100644 --- a/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/direct_purchase/set_direct_purchase_price/v0/mod.rs @@ -40,7 +40,8 @@ impl Drive { )); } else { drive_operations.push(LowLevelDriveOperation::GroveOperation( - QualifiedGroveDbOp::delete_op(direct_selling_path, token_id.to_vec()).dont_check(), + QualifiedGroveDbOp::delete_op(direct_selling_path, token_id.to_vec()) + .dont_check_for_backwards_references(), )); } diff --git a/packages/rs-drive/src/drive/tokens/system/add_to_token_total_supply/v0/mod.rs b/packages/rs-drive/src/drive/tokens/system/add_to_token_total_supply/v0/mod.rs index e07424e0e26..eb74f24d56d 100644 --- a/packages/rs-drive/src/drive/tokens/system/add_to_token_total_supply/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/system/add_to_token_total_supply/v0/mod.rs @@ -139,7 +139,7 @@ impl Drive { token_id.to_vec(), SumItem(new_total, None), ) - .dont_check(); + .dont_check_for_backwards_references(); drive_operations.push(GroveOperation(replace_op)); new_total as u64 - total_token_supply_in_platform } else if allow_first_mint { diff --git a/packages/rs-drive/src/drive/tokens/system/remove_from_token_total_supply/v0/mod.rs b/packages/rs-drive/src/drive/tokens/system/remove_from_token_total_supply/v0/mod.rs index 769551bb793..4b5cda29f51 100644 --- a/packages/rs-drive/src/drive/tokens/system/remove_from_token_total_supply/v0/mod.rs +++ b/packages/rs-drive/src/drive/tokens/system/remove_from_token_total_supply/v0/mod.rs @@ -139,7 +139,7 @@ impl Drive { token_id.to_vec(), SumItem(new_total as i64, None), ) - .dont_check(); + .dont_check_for_backwards_references(); drive_operations.push(GroveOperation(replace_op)); Ok(drive_operations) diff --git a/packages/rs-drive/src/fees/op.rs b/packages/rs-drive/src/fees/op.rs index 8336de45512..fca88f1cf99 100644 --- a/packages/rs-drive/src/fees/op.rs +++ b/packages/rs-drive/src/fees/op.rs @@ -1382,7 +1382,10 @@ impl LowLevelDriveOperation { key: Vec, element: Element, ) -> Self { - GroveOperation(QualifiedGroveDbOp::insert_or_replace_op(path, key, element).dont_check()) + GroveOperation( + QualifiedGroveDbOp::insert_or_replace_op(path, key, element) + .dont_check_for_backwards_references(), + ) } /// Sets `GroveOperation` for replacement of an element at the given path and key @@ -1391,7 +1394,10 @@ impl LowLevelDriveOperation { key: Vec, element: Element, ) -> Self { - GroveOperation(QualifiedGroveDbOp::replace_op(path, key, element).dont_check()) + GroveOperation( + QualifiedGroveDbOp::replace_op(path, key, element) + .dont_check_for_backwards_references(), + ) } /// Sets `GroveOperation` for patching of an element at the given path and key @@ -1403,7 +1409,8 @@ impl LowLevelDriveOperation { change_in_bytes: i32, ) -> Self { GroveOperation( - QualifiedGroveDbOp::patch_op(path, key, element, change_in_bytes).dont_check(), + QualifiedGroveDbOp::patch_op(path, key, element, change_in_bytes) + .dont_check_for_backwards_references(), ) } @@ -1413,7 +1420,10 @@ impl LowLevelDriveOperation { key: KeyInfo, element: Element, ) -> Self { - GroveOperation(QualifiedGroveDbOp::insert_estimated_op(path, key, element).dont_check()) + GroveOperation( + QualifiedGroveDbOp::insert_estimated_op(path, key, element) + .dont_check_for_backwards_references(), + ) } /// Sets `GroveOperation` for replacement of an element at an unknown estimated path and key @@ -1422,7 +1432,10 @@ impl LowLevelDriveOperation { key: KeyInfo, element: Element, ) -> Self { - GroveOperation(QualifiedGroveDbOp::replace_estimated_op(path, key, element).dont_check()) + GroveOperation( + QualifiedGroveDbOp::replace_estimated_op(path, key, element) + .dont_check_for_backwards_references(), + ) } /// Sets `GroveOperation` for refresh of a reference at the given path and key diff --git a/packages/rs-drive/src/util/batch/grovedb_op_batch/mod.rs b/packages/rs-drive/src/util/batch/grovedb_op_batch/mod.rs index 7890aa34ebc..6ebd4d5721f 100644 --- a/packages/rs-drive/src/util/batch/grovedb_op_batch/mod.rs +++ b/packages/rs-drive/src/util/batch/grovedb_op_batch/mod.rs @@ -538,7 +538,8 @@ impl GroveDbOpBatchV0Methods for GroveDbOpBatch { /// Adds an `Insert` operation with an empty tree at the specified path and key to a list of GroveDB ops. fn add_insert_empty_tree(&mut self, path: Vec>, key: Vec) { self.operations.push( - QualifiedGroveDbOp::insert_or_replace_op(path, key, Element::empty_tree()).dont_check(), + QualifiedGroveDbOp::insert_or_replace_op(path, key, Element::empty_tree()) + .dont_check_for_backwards_references(), ) } @@ -557,7 +558,7 @@ impl GroveDbOpBatchV0Methods for GroveDbOpBatch { StorageFlags::map_borrowed_cow_to_some_element_flags(storage_flags), ), ) - .dont_check(), + .dont_check_for_backwards_references(), ) } @@ -565,7 +566,7 @@ impl GroveDbOpBatchV0Methods for GroveDbOpBatch { fn add_insert_empty_sum_tree(&mut self, path: Vec>, key: Vec) { self.operations.push( QualifiedGroveDbOp::insert_or_replace_op(path, key, Element::empty_sum_tree()) - .dont_check(), + .dont_check_for_backwards_references(), ) } @@ -584,14 +585,14 @@ impl GroveDbOpBatchV0Methods for GroveDbOpBatch { StorageFlags::map_borrowed_cow_to_some_element_flags(storage_flags), ), ) - .dont_check(), + .dont_check_for_backwards_references(), ) } /// Adds a `Delete` operation to a list of GroveDB ops. fn add_delete(&mut self, path: Vec>, key: Vec) { self.operations - .push(QualifiedGroveDbOp::delete_op(path, key).dont_check()) + .push(QualifiedGroveDbOp::delete_op(path, key).dont_check_for_backwards_references()) } /// Adds a `Delete` tree operation to a list of GroveDB ops. @@ -605,14 +606,16 @@ impl GroveDbOpBatchV0Methods for GroveDbOpBatch { tree_type, SubelementsDeletionBehavior::DontCheckWithNoCleanup, ) - .dont_check(), + .dont_check_for_backwards_references(), ) } /// Adds an `Insert` operation with an element to a list of GroveDB ops. fn add_insert(&mut self, path: Vec>, key: Vec, element: Element) { - self.operations - .push(QualifiedGroveDbOp::insert_or_replace_op(path, key, element).dont_check()) + self.operations.push( + QualifiedGroveDbOp::insert_or_replace_op(path, key, element) + .dont_check_for_backwards_references(), + ) } /// Verify consistency of operations diff --git a/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs index 5b86644dba0..8e64733df36 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs @@ -110,7 +110,7 @@ impl Drive { drive_operations.push(GroveOperation(delete_op)); drive_operations.push(GroveOperation( QualifiedGroveDbOp::insert_or_replace_op(to_path, key.to_vec(), element) - .dont_check(), + .dont_check_for_backwards_references(), )); } diff --git a/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs index fd5e5aa5f42..9595f75535e 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs @@ -139,7 +139,7 @@ impl Drive { // Adds the insert operation to the batch of drive operations drive_operations.push(GroveOperation( QualifiedGroveDbOp::insert_or_replace_op(new_path.clone(), key, element) - .dont_check(), + .dont_check_for_backwards_references(), )); } } diff --git a/packages/rs-drive/src/util/operations/tests.rs b/packages/rs-drive/src/util/operations/tests.rs index bf13f1d2971..ecad1957d63 100644 --- a/packages/rs-drive/src/util/operations/tests.rs +++ b/packages/rs-drive/src/util/operations/tests.rs @@ -94,7 +94,7 @@ fn apply_batch_low_level_mixed_ops_applies_grove_and_preserves_leftovers() { let batch_ops = vec![ LowLevelDriveOperation::GroveOperation( QualifiedGroveDbOp::insert_or_replace_op(vec![], vec![0xfe], Element::empty_tree()) - .dont_check(), + .dont_check_for_backwards_references(), ), function_op(), LowLevelDriveOperation::GroveOperation( @@ -103,7 +103,7 @@ fn apply_batch_low_level_mixed_ops_applies_grove_and_preserves_leftovers() { vec![0x01], Element::new_item(vec![1, 2, 3]), ) - .dont_check(), + .dont_check_for_backwards_references(), ), ]; let mut drive_operations: Vec = vec![]; @@ -149,7 +149,7 @@ fn apply_batch_low_level_actually_persists_grove_inserts() { let batch_ops = vec![ LowLevelDriveOperation::GroveOperation( QualifiedGroveDbOp::insert_or_replace_op(vec![], vec![0xfd], Element::empty_tree()) - .dont_check(), + .dont_check_for_backwards_references(), ), LowLevelDriveOperation::GroveOperation( QualifiedGroveDbOp::insert_or_replace_op( @@ -157,7 +157,7 @@ fn apply_batch_low_level_actually_persists_grove_inserts() { b"hello".to_vec(), Element::new_item(b"world".to_vec()), ) - .dont_check(), + .dont_check_for_backwards_references(), ), ]; let mut drive_operations: Vec = vec![]; @@ -286,7 +286,7 @@ fn rollback_transaction_v0_discards_uncommitted_changes() { let batch_ops = vec![ LowLevelDriveOperation::GroveOperation( QualifiedGroveDbOp::insert_or_replace_op(vec![], vec![0xfb], Element::empty_tree()) - .dont_check(), + .dont_check_for_backwards_references(), ), LowLevelDriveOperation::GroveOperation( QualifiedGroveDbOp::insert_or_replace_op( @@ -294,7 +294,7 @@ fn rollback_transaction_v0_discards_uncommitted_changes() { b"k".to_vec(), Element::new_item(b"v".to_vec()), ) - .dont_check(), + .dont_check_for_backwards_references(), ), ]; let mut drive_operations: Vec = vec![]; @@ -330,7 +330,7 @@ fn rollback_transaction_v0_discards_uncommitted_changes() { b"k2".to_vec(), Element::new_item(b"v2".to_vec()), ) - .dont_check(), + .dont_check_for_backwards_references(), )]; let mut drive_operations: Vec = vec![]; let res = drive.apply_batch_low_level_drive_operations_v0( @@ -396,7 +396,7 @@ fn public_apply_batch_low_level_drive_operations_routes_through_v0() { let batch_ops = vec![ LowLevelDriveOperation::GroveOperation( QualifiedGroveDbOp::insert_or_replace_op(vec![], vec![0xfa], Element::empty_tree()) - .dont_check(), + .dont_check_for_backwards_references(), ), LowLevelDriveOperation::GroveOperation( QualifiedGroveDbOp::insert_or_replace_op( @@ -404,7 +404,7 @@ fn public_apply_batch_low_level_drive_operations_routes_through_v0() { b"x".to_vec(), Element::new_item(b"y".to_vec()), ) - .dont_check(), + .dont_check_for_backwards_references(), ), ]; let mut drive_operations: Vec = vec![]; diff --git a/packages/rs-drive/src/verify/shielded/verify_shielded_pool_state/v0/mod.rs b/packages/rs-drive/src/verify/shielded/verify_shielded_pool_state/v0/mod.rs index 8d64192c656..0a1f202f7f7 100644 --- a/packages/rs-drive/src/verify/shielded/verify_shielded_pool_state/v0/mod.rs +++ b/packages/rs-drive/src/verify/shielded/verify_shielded_pool_state/v0/mod.rs @@ -92,7 +92,7 @@ mod tests { vec![SHIELDED_TOTAL_BALANCE_KEY], Element::new_sum_item(balance as i64), ) - .dont_check(); + .dont_check_for_backwards_references(); drive .grove_apply_batch( diff --git a/packages/rs-drive/tests/drive_storage_ops_coverage.rs b/packages/rs-drive/tests/drive_storage_ops_coverage.rs index cbe03dbc39e..6403e728fec 100644 --- a/packages/rs-drive/tests/drive_storage_ops_coverage.rs +++ b/packages/rs-drive/tests/drive_storage_ops_coverage.rs @@ -969,7 +969,7 @@ mod grovedb_op_batch_tests { let mut batch = GroveDbOpBatch::new(); let op = QualifiedGroveDbOp::insert_or_replace_op(vec![vec![1]], vec![2], Element::empty_tree()) - .dont_check(); + .dont_check_for_backwards_references(); batch.push(op); assert_eq!(batch.len(), 1); assert!(!batch.is_empty()); @@ -979,9 +979,9 @@ mod grovedb_op_batch_tests { fn from_operations() { let ops = vec![ QualifiedGroveDbOp::insert_or_replace_op(vec![vec![1]], vec![2], Element::empty_tree()) - .dont_check(), + .dont_check_for_backwards_references(), QualifiedGroveDbOp::insert_or_replace_op(vec![vec![3]], vec![4], Element::empty_tree()) - .dont_check(), + .dont_check_for_backwards_references(), ]; let batch = GroveDbOpBatch::from_operations(ops); assert_eq!(batch.len(), 2); @@ -1006,9 +1006,9 @@ mod grovedb_op_batch_tests { let mut batch = GroveDbOpBatch::new(); let ops = vec![ QualifiedGroveDbOp::insert_or_replace_op(vec![vec![1]], vec![2], Element::empty_tree()) - .dont_check(), + .dont_check_for_backwards_references(), QualifiedGroveDbOp::insert_or_replace_op(vec![vec![3]], vec![4], Element::empty_tree()) - .dont_check(), + .dont_check_for_backwards_references(), ]; batch.extend(ops); assert_eq!(batch.len(), 2); diff --git a/packages/rs-platform-version/Cargo.toml b/packages/rs-platform-version/Cargo.toml index e2c10aa17f7..bbb1ff545f4 100644 --- a/packages/rs-platform-version/Cargo.toml +++ b/packages/rs-platform-version/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" thiserror = { version = "2.0.12" } bincode = { workspace = true } versioned-feature-core = "1.0.0" -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1" } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6" } [features] mock-versions = [] diff --git a/packages/rs-platform-wallet/Cargo.toml b/packages/rs-platform-wallet/Cargo.toml index 0fd51b2e457..411f8ec66e0 100644 --- a/packages/rs-platform-wallet/Cargo.toml +++ b/packages/rs-platform-wallet/Cargo.toml @@ -61,7 +61,7 @@ zeroize = "1" log = "0.4" # Shielded pool (optional, behind `shielded` feature) -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6", optional = true } # Direct `rusqlite` access so `FileBackedShieldedStore::open_path` can set # WAL + synchronous=NORMAL pragmas before handing the connection to # `ClientPersistentCommitmentTree`. Version locked to match the rev grovedb diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index bcde851e1d1..7217ae36aa6 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -18,7 +18,7 @@ drive = { path = "../rs-drive", default-features = false, features = [ ] } drive-proof-verifier = { path = "../rs-drive-proof-verifier", default-features = false } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "a584d9d72c6dfac83d867c6ac52685bd3cb0dfa1", features = [ +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6", features = [ "client", "sqlite", ], optional = true } From 4937925ccbf89a8d582813728fa308f6c6cf41b7 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sun, 13 Sep 2026 09:51:16 +0700 Subject: [PATCH 15/20] refactor(drive): follow GroveDB's DontCheckForBackwardsReferences variant names GroveDB #953 renamed the twin variants and `is_dont_check` so the names say what the twin skips; Drive's inspection sites and tests follow, and the pin moves to that head. Co-Authored-By: Claude Fable 5.1 --- Cargo.lock | 32 ++++++------- packages/rs-dpp/Cargo.toml | 2 +- packages/rs-drive-abci/Cargo.toml | 8 ++-- packages/rs-drive/Cargo.toml | 14 +++--- .../contract/update/update_keywords/v0/mod.rs | 3 +- .../rs-drive/src/drive/credit_pools/mod.rs | 4 +- .../v0/mod.rs | 5 +- .../src/drive/identity/balance/update.rs | 16 +++---- .../v0/mod.rs | 4 +- .../src/drive/tokens/balance/update.rs | 16 +++---- packages/rs-drive/src/fees/op.rs | 6 ++- .../src/util/batch/grovedb_op_batch/mod.rs | 8 ++-- .../v0/mod.rs | 18 +++++--- .../v0/mod.rs | 2 +- .../batch_remove_raw/v0/mod.rs | 46 +++++++++++-------- .../grove_operations/batch_replace/v0/mod.rs | 5 +- packages/rs-platform-version/Cargo.toml | 2 +- packages/rs-platform-wallet/Cargo.toml | 2 +- packages/rs-sdk/Cargo.toml | 2 +- 19 files changed, 107 insertions(+), 88 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 994f251cec0..8fff01e9269 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2957,7 +2957,7 @@ dependencies = [ [[package]] name = "grovedb" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" +source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" dependencies = [ "axum 0.8.9", "blake3", @@ -3016,7 +3016,7 @@ dependencies = [ [[package]] name = "grovedb-bulk-append-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" +source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" dependencies = [ "blake3", "grovedb-bincode", @@ -3034,7 +3034,7 @@ dependencies = [ [[package]] name = "grovedb-commitment-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" +source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3051,7 +3051,7 @@ dependencies = [ [[package]] name = "grovedb-costs" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" +source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" dependencies = [ "integer-encoding", "intmap", @@ -3061,7 +3061,7 @@ dependencies = [ [[package]] name = "grovedb-dense-fixed-sized-merkle-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" +source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" dependencies = [ "blake3", "grovedb-bincode", @@ -3075,7 +3075,7 @@ dependencies = [ [[package]] name = "grovedb-element" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" +source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" dependencies = [ "grovedb-bincode", "grovedb-bincode-derive", @@ -3091,7 +3091,7 @@ dependencies = [ [[package]] name = "grovedb-epoch-based-storage-flags" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" +source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" dependencies = [ "grovedb-costs", "hex", @@ -3103,7 +3103,7 @@ dependencies = [ [[package]] name = "grovedb-merk" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" +source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" dependencies = [ "blake3", "byteorder", @@ -3129,7 +3129,7 @@ dependencies = [ [[package]] name = "grovedb-merkle-mountain-range" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" +source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" dependencies = [ "blake3", "grovedb-bincode", @@ -3142,7 +3142,7 @@ dependencies = [ [[package]] name = "grovedb-path" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" +source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" dependencies = [ "hex", ] @@ -3150,7 +3150,7 @@ dependencies = [ [[package]] name = "grovedb-private-document-store" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" +source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3163,7 +3163,7 @@ dependencies = [ [[package]] name = "grovedb-query" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" +source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" dependencies = [ "byteorder", "ed", @@ -3179,7 +3179,7 @@ dependencies = [ [[package]] name = "grovedb-storage" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" +source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" dependencies = [ "blake3", "grovedb-costs", @@ -3198,7 +3198,7 @@ dependencies = [ [[package]] name = "grovedb-version" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" +source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" dependencies = [ "thiserror 2.0.18", "versioned-feature-core", @@ -3207,7 +3207,7 @@ dependencies = [ [[package]] name = "grovedb-visualize" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" +source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" dependencies = [ "hex", "itertools 0.14.0", @@ -3216,7 +3216,7 @@ dependencies = [ [[package]] name = "grovedbg-types" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=78c10e389e6d6f3585f7a87f9eadb298f36f41b6#78c10e389e6d6f3585f7a87f9eadb298f36f41b6" +source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" dependencies = [ "serde", "serde_with 3.21.0", diff --git a/packages/rs-dpp/Cargo.toml b/packages/rs-dpp/Cargo.toml index aa467302f64..7807fcdcc38 100644 --- a/packages/rs-dpp/Cargo.toml +++ b/packages/rs-dpp/Cargo.toml @@ -76,7 +76,7 @@ strum = { version = "0.26", features = ["derive"] } json-schema-compatibility-validator = { path = '../rs-json-schema-compatibility-validator', optional = true } once_cell = "1.19.0" tracing = { version = "0.1.41" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09", optional = true } [dev-dependencies] tokio = { version = "1.40", features = ["full"] } diff --git a/packages/rs-drive-abci/Cargo.toml b/packages/rs-drive-abci/Cargo.toml index e5f97c9463c..52972d20ba8 100644 --- a/packages/rs-drive-abci/Cargo.toml +++ b/packages/rs-drive-abci/Cargo.toml @@ -82,7 +82,7 @@ derive_more = { version = "1.0", features = ["from", "deref", "deref_mut"] } async-trait = "0.1.77" console-subscriber = { version = "0.4", optional = true } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f", optional = true } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6" } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" } nonempty = "0.11" # Shielded-pool snapshot needs raw RocksDB SstFileWriter + ingest_external_file_cf # bindings, and blake3 for the snapshot-file checksum. @@ -108,7 +108,7 @@ dpp = { path = "../rs-dpp", default-features = false, features = [ drive = { path = "../rs-drive", features = ["fixtures-and-mocks"] } drive-proof-verifier = { path = "../rs-drive-proof-verifier" } strategy-tests = { path = "../strategy-tests" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6", features = ["client"] } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09", features = ["client"] } assert_matches = "1.5.0" drive-abci = { path = ".", features = ["testing-config", "mocks", "shielded_test_data"] } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f" } @@ -122,8 +122,8 @@ integer-encoding = { version = "4.0.0" } # For dump_only_default_and_aux_cfs_under_shielded_subtree_prefix — same # subtree-prefix algorithm grovedb uses internally. -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6" } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" } [features] default = ["bls-signatures"] diff --git a/packages/rs-drive/Cargo.toml b/packages/rs-drive/Cargo.toml index bc370ac0966..be2ed008a62 100644 --- a/packages/rs-drive/Cargo.toml +++ b/packages/rs-drive/Cargo.toml @@ -52,13 +52,13 @@ enum-map = { version = "2.0.3", optional = true } intmap = { version = "3.0.1", features = ["serde"], optional = true } chrono = { version = "0.4.35", optional = true } itertools = { version = "0.13", optional = true } -grovedb = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6", optional = true, default-features = false } -grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6", optional = true } -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6" } -grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6", optional = true } -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6" } -grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6" } +grovedb = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09", optional = true, default-features = false } +grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09", optional = true } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" } +grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09", optional = true } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" } +grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" } [dev-dependencies] criterion = "0.5" diff --git a/packages/rs-drive/src/drive/contract/update/update_keywords/v0/mod.rs b/packages/rs-drive/src/drive/contract/update/update_keywords/v0/mod.rs index 880fe63ad00..0f93b9d4381 100644 --- a/packages/rs-drive/src/drive/contract/update/update_keywords/v0/mod.rs +++ b/packages/rs-drive/src/drive/contract/update/update_keywords/v0/mod.rs @@ -596,7 +596,8 @@ mod tests { .fold((0, 0), |(deletes, inserts), operation| match operation { LowLevelDriveOperation::GroveOperation(op) if op.path.to_path() == group_path => { match op.op { - GroveOp::DeleteDontCheck | GroveOp::DeleteTreeDontCheck(..) => { + GroveOp::DeleteDontCheckForBackwardsReferences + | GroveOp::DeleteTreeDontCheckForBackwardsReferences(..) => { (deletes + 1, inserts) } _ => (deletes, inserts + 1), diff --git a/packages/rs-drive/src/drive/credit_pools/mod.rs b/packages/rs-drive/src/drive/credit_pools/mod.rs index c2f7a258939..7af05d8b402 100644 --- a/packages/rs-drive/src/drive/credit_pools/mod.rs +++ b/packages/rs-drive/src/drive/credit_pools/mod.rs @@ -270,7 +270,7 @@ mod tests { Epoch::new(i as EpochIndex).unwrap().get_path_vec() ); - let GroveOp::InsertOrReplaceDontCheck { + let GroveOp::InsertOrReplaceDontCheckForBackwardsReferences { element: Element::SumItem(credits, _), } = operation.op else { @@ -334,7 +334,7 @@ mod tests { let updated_credits: Vec<_> = batch .into_iter() .map(|operation| { - let GroveOp::InsertOrReplaceDontCheck { + let GroveOp::InsertOrReplaceDontCheckForBackwardsReferences { element: Element::SumItem(credits, _), } = operation.op else { diff --git a/packages/rs-drive/src/drive/credit_pools/pending_epoch_refunds/methods/add_delete_pending_epoch_refunds_except_specified/v0/mod.rs b/packages/rs-drive/src/drive/credit_pools/pending_epoch_refunds/methods/add_delete_pending_epoch_refunds_except_specified/v0/mod.rs index f0b69f36e18..fcb4223f946 100644 --- a/packages/rs-drive/src/drive/credit_pools/pending_epoch_refunds/methods/add_delete_pending_epoch_refunds_except_specified/v0/mod.rs +++ b/packages/rs-drive/src/drive/credit_pools/pending_epoch_refunds/methods/add_delete_pending_epoch_refunds_except_specified/v0/mod.rs @@ -124,7 +124,10 @@ mod tests { assert_eq!(batch.len(), expected_pending_refunds.len()); for operation in batch.into_iter() { - assert!(matches!(operation.op, GroveOp::DeleteDontCheck)); + assert!(matches!( + operation.op, + GroveOp::DeleteDontCheckForBackwardsReferences + )); assert_eq!(operation.path.to_path(), pending_epoch_refunds_path_vec()); diff --git a/packages/rs-drive/src/drive/identity/balance/update.rs b/packages/rs-drive/src/drive/identity/balance/update.rs index 324b25b8a7d..d2dca9e0f2a 100644 --- a/packages/rs-drive/src/drive/identity/balance/update.rs +++ b/packages/rs-drive/src/drive/identity/balance/update.rs @@ -600,14 +600,14 @@ mod tests { _, _, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::ReplaceDontCheck { + op: GroveOp::ReplaceDontCheckForBackwardsReferences { element: Element::SumItem(refund_amount, None), }, .. }), .., LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::ReplaceDontCheck { + op: GroveOp::ReplaceDontCheckForBackwardsReferences { element: Element::SumItem(other_refund_amount, None), }, .. @@ -696,13 +696,13 @@ mod tests { _, _, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::ReplaceDontCheck { + op: GroveOp::ReplaceDontCheckForBackwardsReferences { element: Element::SumItem(refund_amount, None), }, .. }), LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::ReplaceDontCheck { + op: GroveOp::ReplaceDontCheckForBackwardsReferences { element: Element::Item(debt_bytes, None), }, .. @@ -771,7 +771,7 @@ mod tests { _, _, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::ReplaceDontCheck { + op: GroveOp::ReplaceDontCheckForBackwardsReferences { element: Element::Item(debt_bytes, None), }, .. @@ -826,7 +826,7 @@ mod tests { assert!(matches!( drive_operations[..], [_, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::ReplaceDontCheck { + op: GroveOp::ReplaceDontCheckForBackwardsReferences { element: Element::SumItem(balance, None), }, .. @@ -885,13 +885,13 @@ mod tests { [ _, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::ReplaceDontCheck { + op: GroveOp::ReplaceDontCheckForBackwardsReferences { element: Element::SumItem(balance, None), }, .. }), LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::ReplaceDontCheck { + op: GroveOp::ReplaceDontCheckForBackwardsReferences { element: Element::Item(debt_bytes, None), }, .. diff --git a/packages/rs-drive/src/drive/prefunded_specialized_balances/empty_prefunded_specialized_balance_operations/v0/mod.rs b/packages/rs-drive/src/drive/prefunded_specialized_balances/empty_prefunded_specialized_balance_operations/v0/mod.rs index 2ba27befc19..1b748f43cf0 100644 --- a/packages/rs-drive/src/drive/prefunded_specialized_balances/empty_prefunded_specialized_balance_operations/v0/mod.rs +++ b/packages/rs-drive/src/drive/prefunded_specialized_balances/empty_prefunded_specialized_balance_operations/v0/mod.rs @@ -105,9 +105,9 @@ mod tests { matches!( qualified.op, GroveOp::Delete - | GroveOp::DeleteDontCheck + | GroveOp::DeleteDontCheckForBackwardsReferences | GroveOp::DeleteTree { .. } - | GroveOp::DeleteTreeDontCheck { .. } + | GroveOp::DeleteTreeDontCheckForBackwardsReferences { .. } ) } _ => false, diff --git a/packages/rs-drive/src/drive/tokens/balance/update.rs b/packages/rs-drive/src/drive/tokens/balance/update.rs index e65606bdd76..cae7c826817 100644 --- a/packages/rs-drive/src/drive/tokens/balance/update.rs +++ b/packages/rs-drive/src/drive/tokens/balance/update.rs @@ -619,14 +619,14 @@ mod tests { _, _, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::ReplaceDontCheck { + op: GroveOp::ReplaceDontCheckForBackwardsReferences { element: Element::SumItem(refund_amount, None), }, .. }), .., LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::ReplaceDontCheck { + op: GroveOp::ReplaceDontCheckForBackwardsReferences { element: Element::SumItem(other_refund_amount, None), }, .. @@ -715,13 +715,13 @@ mod tests { _, _, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::ReplaceDontCheck { + op: GroveOp::ReplaceDontCheckForBackwardsReferences { element: Element::SumItem(refund_amount, None), }, .. }), LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::ReplaceDontCheck { + op: GroveOp::ReplaceDontCheckForBackwardsReferences { element: Element::Item(debt_bytes, None), }, .. @@ -790,7 +790,7 @@ mod tests { _, _, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::ReplaceDontCheck { + op: GroveOp::ReplaceDontCheckForBackwardsReferences { element: Element::Item(debt_bytes, None), }, .. @@ -845,7 +845,7 @@ mod tests { assert!(matches!( drive_operations[..], [_, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::ReplaceDontCheck { + op: GroveOp::ReplaceDontCheckForBackwardsReferences { element: Element::SumItem(balance, None), }, .. @@ -904,13 +904,13 @@ mod tests { [ _, LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::ReplaceDontCheck { + op: GroveOp::ReplaceDontCheckForBackwardsReferences { element: Element::SumItem(balance, None), }, .. }), LowLevelDriveOperation::GroveOperation(grovedb::batch::QualifiedGroveDbOp { - op: GroveOp::ReplaceDontCheck { + op: GroveOp::ReplaceDontCheckForBackwardsReferences { element: Element::Item(debt_bytes, None), }, .. diff --git a/packages/rs-drive/src/fees/op.rs b/packages/rs-drive/src/fees/op.rs index fca88f1cf99..97cde2a1921 100644 --- a/packages/rs-drive/src/fees/op.rs +++ b/packages/rs-drive/src/fees/op.rs @@ -2451,7 +2451,7 @@ mod tests { match op { LowLevelDriveOperation::GroveOperation(grove_op) => match grove_op.op { GroveOp::InsertOrReplace { element } - | GroveOp::InsertOrReplaceDontCheck { element } => assert!( + | GroveOp::InsertOrReplaceDontCheckForBackwardsReferences { element } => assert!( matches!(element, Element::ProvableSumTree(..)), "expected ProvableSumTree element, got: {:?}", element @@ -2537,7 +2537,9 @@ mod tests { let element = match op { LowLevelDriveOperation::GroveOperation(grove_op) => match grove_op.op { GroveOp::InsertOrReplace { element } - | GroveOp::InsertOrReplaceDontCheck { element } => element, + | GroveOp::InsertOrReplaceDontCheckForBackwardsReferences { element } => { + element + } other => panic!("expected InsertOrReplace, got {other:?}"), }, other => panic!("expected GroveOperation, got {other:?}"), diff --git a/packages/rs-drive/src/util/batch/grovedb_op_batch/mod.rs b/packages/rs-drive/src/util/batch/grovedb_op_batch/mod.rs index 6ebd4d5721f..de7a8cc8eb6 100644 --- a/packages/rs-drive/src/util/batch/grovedb_op_batch/mod.rs +++ b/packages/rs-drive/src/util/batch/grovedb_op_batch/mod.rs @@ -347,7 +347,7 @@ impl fmt::Display for GroveDbOpBatch { writeln!(f, " Key: {}", key_string)?; match &op.op { GroveOp::InsertOrReplace { element } - | GroveOp::InsertOrReplaceDontCheck { element } + | GroveOp::InsertOrReplaceDontCheckForBackwardsReferences { element } | GroveOp::InsertWithKnownToNotAlreadyExist { element } | GroveOp::InsertIfNotExists { element, .. } => { let flags = element.get_flags(); @@ -713,13 +713,13 @@ impl GroveDbOpBatchV0Methods for GroveDbOpBatch { let op = if matches!( op, &GroveOp::InsertOrReplace { .. } - | &GroveOp::InsertOrReplaceDontCheck { .. } + | &GroveOp::InsertOrReplaceDontCheckForBackwardsReferences { .. } | &GroveOp::InsertWithKnownToNotAlreadyExist { .. } | &GroveOp::InsertIfNotExists { .. } | &GroveOp::Replace { .. } - | &GroveOp::ReplaceDontCheck { .. } + | &GroveOp::ReplaceDontCheckForBackwardsReferences { .. } | &GroveOp::Patch { .. } - | &GroveOp::PatchDontCheck { .. } + | &GroveOp::PatchDontCheckForBackwardsReferences { .. } ) { self.operations.remove(index).op } else { diff --git a/packages/rs-drive/src/util/grove_operations/batch_insert_empty_tree_if_not_exists/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_insert_empty_tree_if_not_exists/v0/mod.rs index 44ea04331d5..ed457b4cda9 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_insert_empty_tree_if_not_exists/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_insert_empty_tree_if_not_exists/v0/mod.rs @@ -116,7 +116,8 @@ impl Drive { && grove_op.path == path && matches!( grove_op.op, - GroveOp::DeleteTree(_, _) | GroveOp::DeleteTreeDontCheck(_, _) + GroveOp::DeleteTree(_, _) + | GroveOp::DeleteTreeDontCheckForBackwardsReferences(_, _) ) { found = true; @@ -182,7 +183,8 @@ impl Drive { && grove_op.path == path && matches!( grove_op.op, - GroveOp::DeleteTree(_, _) | GroveOp::DeleteTreeDontCheck(_, _) + GroveOp::DeleteTree(_, _) + | GroveOp::DeleteTreeDontCheckForBackwardsReferences(_, _) ) { found = true; @@ -246,7 +248,8 @@ impl Drive { && grove_op.path == path && matches!( grove_op.op, - GroveOp::DeleteTree(_, _) | GroveOp::DeleteTreeDontCheck(_, _) + GroveOp::DeleteTree(_, _) + | GroveOp::DeleteTreeDontCheckForBackwardsReferences(_, _) ) { found = true; @@ -310,7 +313,8 @@ impl Drive { && grove_op.path == path && matches!( grove_op.op, - GroveOp::DeleteTree(_, _) | GroveOp::DeleteTreeDontCheck(_, _) + GroveOp::DeleteTree(_, _) + | GroveOp::DeleteTreeDontCheckForBackwardsReferences(_, _) ) { found = true; @@ -730,7 +734,7 @@ mod tests { let element = match ops.pop().expect("one operation must be pushed") { LowLevelDriveOperation::GroveOperation(grove_op) => match grove_op.op { - GroveOp::InsertOrReplaceDontCheck { element } => element, + GroveOp::InsertOrReplaceDontCheckForBackwardsReferences { element } => element, other => panic!("{description}: expected InsertOrReplace, got {other:?}"), }, other => panic!("{description}: expected GroveOperation, got {other:?}"), @@ -758,7 +762,7 @@ mod tests { assert!(inserted); let element = match ops.pop().expect("one operation must be pushed") { LowLevelDriveOperation::GroveOperation(grove_op) => match grove_op.op { - GroveOp::InsertOrReplaceDontCheck { element } => element, + GroveOp::InsertOrReplaceDontCheckForBackwardsReferences { element } => element, other => panic!("expected InsertOrReplace, got {other:?}"), }, other => panic!("expected GroveOperation, got {other:?}"), @@ -819,7 +823,7 @@ mod tests { assert!(inserted); let element = match ops.pop().expect("one operation must be pushed") { LowLevelDriveOperation::GroveOperation(grove_op) => match grove_op.op { - GroveOp::InsertOrReplaceDontCheck { element } => element, + GroveOp::InsertOrReplaceDontCheckForBackwardsReferences { element } => element, other => panic!("expected InsertOrReplace, got {other:?}"), }, other => panic!("expected GroveOperation, got {other:?}"), diff --git a/packages/rs-drive/src/util/grove_operations/batch_insert_sum_item_or_add_to_if_already_exists/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_insert_sum_item_or_add_to_if_already_exists/v0/mod.rs index e51116fe5a1..8c5b6c3cf09 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_insert_sum_item_or_add_to_if_already_exists/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_insert_sum_item_or_add_to_if_already_exists/v0/mod.rs @@ -328,7 +328,7 @@ mod tests { let insert_op = &ops[1]; match insert_op { LowLevelDriveOperation::GroveOperation(grove_op) => match &grove_op.op { - GroveOp::InsertOrReplaceDontCheck { element } => { + GroveOp::InsertOrReplaceDontCheckForBackwardsReferences { element } => { assert_eq!( *element, Element::new_sum_item(15), diff --git a/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs index 06c6744fad7..332243888c1 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs @@ -39,26 +39,32 @@ impl Drive { validate_tree_at_path_exists: false, //todo: not sure about this one }; - let needs_removal_from_state = match current_batch_operations - .remove_if_insert(path.to_vec(), key) - { - Some( - GroveOp::InsertOrReplace { element } - | GroveOp::InsertOrReplaceDontCheck { element }, - ) - | Some(GroveOp::Replace { element } | GroveOp::ReplaceDontCheck { element }) - | Some(GroveOp::Patch { element, .. } | GroveOp::PatchDontCheck { element, .. }) => { - return Ok(Some(element)) - } - Some(GroveOp::InsertTreeWithRootHash { .. }) => { - return Err(Error::Drive(DriveError::CorruptedCodeExecution( - "we should not be seeing internal grovedb operations", - ))); - } - Some(GroveOp::Delete | GroveOp::DeleteDontCheck) - | Some(GroveOp::DeleteTree(_, _) | GroveOp::DeleteTreeDontCheck(_, _)) => false, - _ => true, - }; + let needs_removal_from_state = + match current_batch_operations.remove_if_insert(path.to_vec(), key) { + Some( + GroveOp::InsertOrReplace { element } + | GroveOp::InsertOrReplaceDontCheckForBackwardsReferences { element }, + ) + | Some( + GroveOp::Replace { element } + | GroveOp::ReplaceDontCheckForBackwardsReferences { element }, + ) + | Some( + GroveOp::Patch { element, .. } + | GroveOp::PatchDontCheckForBackwardsReferences { element, .. }, + ) => return Ok(Some(element)), + Some(GroveOp::InsertTreeWithRootHash { .. }) => { + return Err(Error::Drive(DriveError::CorruptedCodeExecution( + "we should not be seeing internal grovedb operations", + ))); + } + Some(GroveOp::Delete | GroveOp::DeleteDontCheckForBackwardsReferences) + | Some( + GroveOp::DeleteTree(_, _) + | GroveOp::DeleteTreeDontCheckForBackwardsReferences(_, _), + ) => false, + _ => true, + }; let maybe_element = self.grove_get_raw_optional( path.clone(), diff --git a/packages/rs-drive/src/util/grove_operations/batch_replace/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_replace/v0/mod.rs index bf72c66a901..61898b6214d 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_replace/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_replace/v0/mod.rs @@ -71,7 +71,10 @@ mod tests { match &ops[0] { LowLevelDriveOperation::GroveOperation(grove_op) => { assert!( - matches!(grove_op.op, GroveOp::ReplaceDontCheck { .. }), + matches!( + grove_op.op, + GroveOp::ReplaceDontCheckForBackwardsReferences { .. } + ), "Expected GroveOp::Replace, got {:?}", grove_op.op ); diff --git a/packages/rs-platform-version/Cargo.toml b/packages/rs-platform-version/Cargo.toml index bbb1ff545f4..3254f960a3e 100644 --- a/packages/rs-platform-version/Cargo.toml +++ b/packages/rs-platform-version/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" thiserror = { version = "2.0.12" } bincode = { workspace = true } versioned-feature-core = "1.0.0" -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6" } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" } [features] mock-versions = [] diff --git a/packages/rs-platform-wallet/Cargo.toml b/packages/rs-platform-wallet/Cargo.toml index 411f8ec66e0..d1c0c1d77ff 100644 --- a/packages/rs-platform-wallet/Cargo.toml +++ b/packages/rs-platform-wallet/Cargo.toml @@ -61,7 +61,7 @@ zeroize = "1" log = "0.4" # Shielded pool (optional, behind `shielded` feature) -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09", optional = true } # Direct `rusqlite` access so `FileBackedShieldedStore::open_path` can set # WAL + synchronous=NORMAL pragmas before handing the connection to # `ClientPersistentCommitmentTree`. Version locked to match the rev grovedb diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index 7217ae36aa6..9d8a5fae89e 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -18,7 +18,7 @@ drive = { path = "../rs-drive", default-features = false, features = [ ] } drive-proof-verifier = { path = "../rs-drive-proof-verifier", default-features = false } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "78c10e389e6d6f3585f7a87f9eadb298f36f41b6", features = [ +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09", features = [ "client", "sqlite", ], optional = true } From 96ec41304ed6a5cc38ce8c5802357e836483abd3 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sun, 13 Sep 2026 10:27:58 +0700 Subject: [PATCH 16/20] refactor(drive): declare backwards_references: BackwardsReferences::DontCheck on live options GroveDB #953 renamed the live declaration to match its batch twins; Drive's eight option sites and six estimated-delete calls follow, and the pin moves to that head. Co-Authored-By: Claude Fable 5.1 --- Cargo.lock | 32 +++++++++---------- packages/rs-dpp/Cargo.toml | 2 +- packages/rs-drive-abci/Cargo.toml | 8 ++--- packages/rs-drive/Cargo.toml | 14 ++++---- .../grove_operations/batch_delete/v0/mod.rs | 6 ++-- .../v0/mod.rs | 6 ++-- .../v0/mod.rs | 6 ++-- .../grove_operations/batch_move/v0/mod.rs | 6 ++-- .../batch_move_items_in_path_query/v0/mod.rs | 6 ++-- .../batch_remove_raw/v0/mod.rs | 6 ++-- .../grove_operations/grove_clear/v0/mod.rs | 4 +-- .../grove_operations/grove_delete/v0/mod.rs | 4 +-- packages/rs-platform-version/Cargo.toml | 2 +- packages/rs-platform-wallet/Cargo.toml | 2 +- packages/rs-sdk/Cargo.toml | 2 +- 15 files changed, 53 insertions(+), 53 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8fff01e9269..74fa5ba6057 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2957,7 +2957,7 @@ dependencies = [ [[package]] name = "grovedb" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" +source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" dependencies = [ "axum 0.8.9", "blake3", @@ -3016,7 +3016,7 @@ dependencies = [ [[package]] name = "grovedb-bulk-append-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" +source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" dependencies = [ "blake3", "grovedb-bincode", @@ -3034,7 +3034,7 @@ dependencies = [ [[package]] name = "grovedb-commitment-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" +source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3051,7 +3051,7 @@ dependencies = [ [[package]] name = "grovedb-costs" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" +source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" dependencies = [ "integer-encoding", "intmap", @@ -3061,7 +3061,7 @@ dependencies = [ [[package]] name = "grovedb-dense-fixed-sized-merkle-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" +source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" dependencies = [ "blake3", "grovedb-bincode", @@ -3075,7 +3075,7 @@ dependencies = [ [[package]] name = "grovedb-element" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" +source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" dependencies = [ "grovedb-bincode", "grovedb-bincode-derive", @@ -3091,7 +3091,7 @@ dependencies = [ [[package]] name = "grovedb-epoch-based-storage-flags" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" +source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" dependencies = [ "grovedb-costs", "hex", @@ -3103,7 +3103,7 @@ dependencies = [ [[package]] name = "grovedb-merk" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" +source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" dependencies = [ "blake3", "byteorder", @@ -3129,7 +3129,7 @@ dependencies = [ [[package]] name = "grovedb-merkle-mountain-range" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" +source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" dependencies = [ "blake3", "grovedb-bincode", @@ -3142,7 +3142,7 @@ dependencies = [ [[package]] name = "grovedb-path" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" +source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" dependencies = [ "hex", ] @@ -3150,7 +3150,7 @@ dependencies = [ [[package]] name = "grovedb-private-document-store" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" +source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3163,7 +3163,7 @@ dependencies = [ [[package]] name = "grovedb-query" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" +source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" dependencies = [ "byteorder", "ed", @@ -3179,7 +3179,7 @@ dependencies = [ [[package]] name = "grovedb-storage" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" +source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" dependencies = [ "blake3", "grovedb-costs", @@ -3198,7 +3198,7 @@ dependencies = [ [[package]] name = "grovedb-version" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" +source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" dependencies = [ "thiserror 2.0.18", "versioned-feature-core", @@ -3207,7 +3207,7 @@ dependencies = [ [[package]] name = "grovedb-visualize" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" +source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" dependencies = [ "hex", "itertools 0.14.0", @@ -3216,7 +3216,7 @@ dependencies = [ [[package]] name = "grovedbg-types" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09#d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" +source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" dependencies = [ "serde", "serde_with 3.21.0", diff --git a/packages/rs-dpp/Cargo.toml b/packages/rs-dpp/Cargo.toml index 7807fcdcc38..c1b19e5521b 100644 --- a/packages/rs-dpp/Cargo.toml +++ b/packages/rs-dpp/Cargo.toml @@ -76,7 +76,7 @@ strum = { version = "0.26", features = ["derive"] } json-schema-compatibility-validator = { path = '../rs-json-schema-compatibility-validator', optional = true } once_cell = "1.19.0" tracing = { version = "0.1.41" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45", optional = true } [dev-dependencies] tokio = { version = "1.40", features = ["full"] } diff --git a/packages/rs-drive-abci/Cargo.toml b/packages/rs-drive-abci/Cargo.toml index 52972d20ba8..2b48604d13e 100644 --- a/packages/rs-drive-abci/Cargo.toml +++ b/packages/rs-drive-abci/Cargo.toml @@ -82,7 +82,7 @@ derive_more = { version = "1.0", features = ["from", "deref", "deref_mut"] } async-trait = "0.1.77" console-subscriber = { version = "0.4", optional = true } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f", optional = true } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45" } nonempty = "0.11" # Shielded-pool snapshot needs raw RocksDB SstFileWriter + ingest_external_file_cf # bindings, and blake3 for the snapshot-file checksum. @@ -108,7 +108,7 @@ dpp = { path = "../rs-dpp", default-features = false, features = [ drive = { path = "../rs-drive", features = ["fixtures-and-mocks"] } drive-proof-verifier = { path = "../rs-drive-proof-verifier" } strategy-tests = { path = "../strategy-tests" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09", features = ["client"] } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45", features = ["client"] } assert_matches = "1.5.0" drive-abci = { path = ".", features = ["testing-config", "mocks", "shielded_test_data"] } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f" } @@ -122,8 +122,8 @@ integer-encoding = { version = "4.0.0" } # For dump_only_default_and_aux_cfs_under_shielded_subtree_prefix — same # subtree-prefix algorithm grovedb uses internally. -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45" } [features] default = ["bls-signatures"] diff --git a/packages/rs-drive/Cargo.toml b/packages/rs-drive/Cargo.toml index be2ed008a62..55d00e05dfc 100644 --- a/packages/rs-drive/Cargo.toml +++ b/packages/rs-drive/Cargo.toml @@ -52,13 +52,13 @@ enum-map = { version = "2.0.3", optional = true } intmap = { version = "3.0.1", features = ["serde"], optional = true } chrono = { version = "0.4.35", optional = true } itertools = { version = "0.13", optional = true } -grovedb = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09", optional = true, default-features = false } -grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09", optional = true } -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" } -grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09", optional = true } -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" } -grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" } +grovedb = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45", optional = true, default-features = false } +grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45", optional = true } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45" } +grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45", optional = true } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45" } +grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45" } [dev-dependencies] criterion = "0.5" diff --git a/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs index 33601cff683..067766ccd8a 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_delete/v0/mod.rs @@ -6,7 +6,7 @@ use crate::util::grove_operations::{push_drive_operation_result, BatchDeleteAppl use grovedb::batch::key_info::KeyInfo; use grovedb::batch::KeyInfoPath; use grovedb::operations::delete::DeleteOptions; -use grovedb::DisplacedValue; +use grovedb::BackwardsReferences; use grovedb::{GroveDb, TransactionArg}; use grovedb_path::SubtreePath; use grovedb_storage::rocksdb_storage::RocksDbStorage; @@ -26,7 +26,7 @@ impl Drive { let options = DeleteOptions { // Drive stores no backward-reference participants; GroveDB checks the // claim for free from the value it reads for the write. - displaced_value: DisplacedValue::NotParticipant, + backwards_references: BackwardsReferences::DontCheck, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, @@ -70,7 +70,7 @@ impl Drive { true, 0, (estimated_key_size, estimated_value_size), - DisplacedValue::NotParticipant, + BackwardsReferences::DontCheck, &drive_version.grove_version, ) .map(|r| r.map(Some)), diff --git a/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs index 34105bd4222..3a3530aeadb 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_delete_items_in_path_query/v0/mod.rs @@ -8,7 +8,7 @@ use grovedb::batch::key_info::KeyInfo; use grovedb::batch::KeyInfoPath; use grovedb::operations::delete::DeleteOptions; use grovedb::query_result_type::QueryResultType; -use grovedb::DisplacedValue; +use grovedb::BackwardsReferences; use grovedb::{GroveDb, PathQuery, TransactionArg}; use grovedb_storage::rocksdb_storage::RocksDbStorage; use platform_version::version::drive_versions::DriveVersion; @@ -83,7 +83,7 @@ impl Drive { let options = DeleteOptions { // Drive stores no backward-reference participants; GroveDB checks the // claim for free from the value it reads for the write. - displaced_value: DisplacedValue::NotParticipant, + backwards_references: BackwardsReferences::DontCheck, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, @@ -102,7 +102,7 @@ impl Drive { true, 0, (estimated_key_size, estimated_value_size), - DisplacedValue::NotParticipant, + BackwardsReferences::DontCheck, &drive_version.grove_version, ) .map(|r| r.map(Some)), diff --git a/packages/rs-drive/src/util/grove_operations/batch_delete_up_tree_while_empty/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_delete_up_tree_while_empty/v0/mod.rs index 06951e98327..4f9f189b82a 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_delete_up_tree_while_empty/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_delete_up_tree_while_empty/v0/mod.rs @@ -7,7 +7,7 @@ use crate::util::grove_operations::{push_drive_operation_result, BatchDeleteUpTr use grovedb::batch::key_info::KeyInfo; use grovedb::batch::KeyInfoPath; use grovedb::operations::delete::DeleteUpTreeOptions; -use grovedb::{DisplacedValue, GroveDb, TransactionArg}; +use grovedb::{BackwardsReferences, GroveDb, TransactionArg}; use grovedb_storage::rocksdb_storage::RocksDbStorage; use platform_version::version::drive_versions::DriveVersion; @@ -46,7 +46,7 @@ impl Drive { stop_path_height, true, estimated_layer_info, - DisplacedValue::NotParticipant, + BackwardsReferences::DontCheck, &drive_version.grove_version, ), BatchDeleteUpTreeApplyType::StatefulBatchDelete { @@ -60,7 +60,7 @@ impl Drive { stop_path_height, // Drive stores no backward-reference participants; GroveDB checks // the claim for free from the value it reads for each delete. - displaced_value: DisplacedValue::NotParticipant, + backwards_references: BackwardsReferences::DontCheck, }; self.grove.delete_operations_for_delete_up_tree_while_empty( path.to_path_refs().as_slice().into(), diff --git a/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs index 8e64733df36..5666c01da7a 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_move/v0/mod.rs @@ -7,7 +7,7 @@ use crate::util::grove_operations::{push_drive_operation_result, BatchMoveApplyT use grovedb::batch::key_info::KeyInfo; use grovedb::batch::{KeyInfoPath, QualifiedGroveDbOp}; use grovedb::operations::delete::DeleteOptions; -use grovedb::DisplacedValue; +use grovedb::BackwardsReferences; use grovedb::{Element, GroveDb, TransactionArg}; use grovedb_epoch_based_storage_flags::StorageFlags; use grovedb_path::SubtreePath; @@ -63,7 +63,7 @@ impl Drive { let delete_opts = DeleteOptions { // Drive stores no backward-reference participants; GroveDB checks the // claim for free from the value it reads for the write. - displaced_value: DisplacedValue::NotParticipant, + backwards_references: BackwardsReferences::DontCheck, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, @@ -84,7 +84,7 @@ impl Drive { true, 0, (estimated_key_size, estimated_value_size), - DisplacedValue::NotParticipant, + BackwardsReferences::DontCheck, &drive_version.grove_version, ) .map(|r| r.map(Some)), diff --git a/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs index 9595f75535e..28206996cd8 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_move_items_in_path_query/v0/mod.rs @@ -8,7 +8,7 @@ use grovedb::batch::key_info::KeyInfo; use grovedb::batch::{KeyInfoPath, QualifiedGroveDbOp}; use grovedb::operations::delete::DeleteOptions; use grovedb::query_result_type::QueryResultType; -use grovedb::DisplacedValue; +use grovedb::BackwardsReferences; use grovedb::{GroveDb, PathQuery, TransactionArg}; use grovedb_epoch_based_storage_flags::StorageFlags; use grovedb_storage::rocksdb_storage::RocksDbStorage; @@ -89,7 +89,7 @@ impl Drive { let options = DeleteOptions { // Drive stores no backward-reference participants; GroveDB checks the // claim for free from the value it reads for the write. - displaced_value: DisplacedValue::NotParticipant, + backwards_references: BackwardsReferences::DontCheck, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, @@ -109,7 +109,7 @@ impl Drive { true, 0, (estimated_key_size, estimated_value_size), - DisplacedValue::NotParticipant, + BackwardsReferences::DontCheck, &drive_version.grove_version, ) .map(|r| r.map(Some)), diff --git a/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs index 332243888c1..264ccf70e2e 100644 --- a/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/batch_remove_raw/v0/mod.rs @@ -9,7 +9,7 @@ use dpp::version::drive_versions::DriveVersion; use grovedb::batch::key_info::KeyInfo; use grovedb::batch::{GroveOp, KeyInfoPath}; use grovedb::operations::delete::DeleteOptions; -use grovedb::DisplacedValue; +use grovedb::BackwardsReferences; use grovedb::{Element, GroveDb, TransactionArg}; use grovedb_path::SubtreePath; use grovedb_storage::rocksdb_storage::RocksDbStorage; @@ -32,7 +32,7 @@ impl Drive { let options = DeleteOptions { // Drive stores no backward-reference participants; GroveDB checks the // claim for free from the value it reads for the write. - displaced_value: DisplacedValue::NotParticipant, + backwards_references: BackwardsReferences::DontCheck, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, @@ -96,7 +96,7 @@ impl Drive { true, 0, (estimated_key_size, estimated_value_size), - DisplacedValue::NotParticipant, + BackwardsReferences::DontCheck, &drive_version.grove_version, ) .map(|r| r.map(Some)), diff --git a/packages/rs-drive/src/util/grove_operations/grove_clear/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_clear/v0/mod.rs index a70e476b5c8..8a9491d035c 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_clear/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_clear/v0/mod.rs @@ -1,7 +1,7 @@ use crate::drive::Drive; use crate::error::Error; use grovedb::operations::delete::ClearOptions; -use grovedb::DisplacedValue; +use grovedb::BackwardsReferences; use grovedb::TransactionArg; use grovedb_path::SubtreePath; use platform_version::version::drive_versions::DriveVersion; @@ -17,7 +17,7 @@ impl Drive { let options = ClearOptions { // Drive stores no backward-reference participants; GroveDB checks the // claim for free from the value it reads for the write. - displaced_value: DisplacedValue::NotParticipant, + backwards_references: BackwardsReferences::DontCheck, check_for_subtrees: false, allow_deleting_subtrees: false, trying_to_clear_with_subtrees_returns_error: false, diff --git a/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs b/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs index 7a4d85b6eef..0a7f29f2a07 100644 --- a/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs +++ b/packages/rs-drive/src/util/grove_operations/grove_delete/v0/mod.rs @@ -3,7 +3,7 @@ use crate::error::Error; use crate::fees::op::LowLevelDriveOperation; use crate::util::grove_operations::push_drive_operation_result; use grovedb::operations::delete::DeleteOptions; -use grovedb::DisplacedValue; +use grovedb::BackwardsReferences; use grovedb::TransactionArg; use grovedb_path::SubtreePath; use platform_version::version::drive_versions::DriveVersion; @@ -21,7 +21,7 @@ impl Drive { let options = DeleteOptions { // Drive stores no backward-reference participants; GroveDB checks the // claim for free from the value it reads for the write. - displaced_value: DisplacedValue::NotParticipant, + backwards_references: BackwardsReferences::DontCheck, allow_deleting_non_empty_trees: false, deleting_non_empty_trees_returns_error: true, base_root_storage_is_free: true, diff --git a/packages/rs-platform-version/Cargo.toml b/packages/rs-platform-version/Cargo.toml index 3254f960a3e..67fa3adf669 100644 --- a/packages/rs-platform-version/Cargo.toml +++ b/packages/rs-platform-version/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" thiserror = { version = "2.0.12" } bincode = { workspace = true } versioned-feature-core = "1.0.0" -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09" } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45" } [features] mock-versions = [] diff --git a/packages/rs-platform-wallet/Cargo.toml b/packages/rs-platform-wallet/Cargo.toml index d1c0c1d77ff..fab385a9730 100644 --- a/packages/rs-platform-wallet/Cargo.toml +++ b/packages/rs-platform-wallet/Cargo.toml @@ -61,7 +61,7 @@ zeroize = "1" log = "0.4" # Shielded pool (optional, behind `shielded` feature) -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45", optional = true } # Direct `rusqlite` access so `FileBackedShieldedStore::open_path` can set # WAL + synchronous=NORMAL pragmas before handing the connection to # `ClientPersistentCommitmentTree`. Version locked to match the rev grovedb diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index 9d8a5fae89e..9ec48e5fd65 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -18,7 +18,7 @@ drive = { path = "../rs-drive", default-features = false, features = [ ] } drive-proof-verifier = { path = "../rs-drive-proof-verifier", default-features = false } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "d69cbae0139daa0a1e71d6944da5bfb7ee9b0c09", features = [ +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45", features = [ "client", "sqlite", ], optional = true } From e71d6039263245cb856310abec646d878e0e05cf Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sun, 13 Sep 2026 10:56:04 +0700 Subject: [PATCH 17/20] test(drive): gate the history cursor proof test like the proof API it calls The new history-keeping cursor round trip calls `execute_with_proof_only_get_elements`, which exists only with both the `server` and `verify` features, so the test now carries the same gate as its sibling in query_tests.rs (review suggestion). Also declare the `serde` feature on the two crates that call `bincode::serde` directly (wasm-dpp2, rs-platform-wallet-storage) instead of relying on `dpp` enabling it for them (review suggestion). Co-Authored-By: Claude Fable 5.1 --- packages/rs-drive/tests/query_tests_history.rs | 2 +- packages/rs-platform-wallet-storage/Cargo.toml | 2 +- packages/wasm-dpp2/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/rs-drive/tests/query_tests_history.rs b/packages/rs-drive/tests/query_tests_history.rs index 30a7d004f41..604658a97f0 100644 --- a/packages/rs-drive/tests/query_tests_history.rs +++ b/packages/rs-drive/tests/query_tests_history.rs @@ -256,7 +256,7 @@ fn test_setup() { setup(10, Some(range_inserts), 73509, platform_version); } -#[cfg(feature = "server")] +#[cfg(all(feature = "server", feature = "verify"))] #[test] fn test_proved_primary_key_cursor_pages_over_history_in_both_directions() { // The history-keeping twin of the primary-key cursor test in diff --git a/packages/rs-platform-wallet-storage/Cargo.toml b/packages/rs-platform-wallet-storage/Cargo.toml index 1ffb9829f07..63e7491e009 100644 --- a/packages/rs-platform-wallet-storage/Cargo.toml +++ b/packages/rs-platform-wallet-storage/Cargo.toml @@ -60,7 +60,7 @@ time = { version = "=0.3.49", features = ["parsing"], optional = true } # (which derives bincode 2 `Encode`/`Decode`) and decode # `dpp::AssetLockProof` from the asset-lock blob column. Exact-pinned to # the lock-resolved version to match the crate's `=`-pin discipline. -bincode = { workspace = true, optional = true } +bincode = { workspace = true, optional = true, features = ["serde"] } tempfile = { version = "3", optional = true } chrono = { version = "0.4", default-features = false, features = [ "clock", diff --git a/packages/wasm-dpp2/Cargo.toml b/packages/wasm-dpp2/Cargo.toml index b8ef276100b..d405cffcacb 100644 --- a/packages/wasm-dpp2/Cargo.toml +++ b/packages/wasm-dpp2/Cargo.toml @@ -10,7 +10,7 @@ crate-type = ["cdylib", "lib"] # TODO: Consider to use talc allocator #talc = { version = "=4.4.2", default-features = false, features = ["lock_api"] } async-trait = { version = "0.1.79" } -bincode = { workspace = true } +bincode = { workspace = true, features = ["serde"] } wasm-bindgen = { version = "=0.2.108", default-features = false, features = [ "serde-serialize", ] } From 3ad60b4c9e822557ba1e5893af97f84975e1a2ec Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sun, 13 Sep 2026 11:23:39 +0700 Subject: [PATCH 18/20] build(drive): move the GroveDB pin to #953 head 90d8ae1d Picks up the fix that keeps each partial-batch DeleteTree removal's cleanup behavior on the observed deletion instead of a path-keyed map. No Drive change; rs-drive and the fee baselines are unchanged. Co-Authored-By: Claude Fable 5.1 --- Cargo.lock | 32 ++++++++++++------------- packages/rs-dpp/Cargo.toml | 2 +- packages/rs-drive-abci/Cargo.toml | 8 +++---- packages/rs-drive/Cargo.toml | 14 +++++------ packages/rs-platform-version/Cargo.toml | 2 +- packages/rs-platform-wallet/Cargo.toml | 2 +- packages/rs-sdk/Cargo.toml | 2 +- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 74fa5ba6057..24eef059f22 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2957,7 +2957,7 @@ dependencies = [ [[package]] name = "grovedb" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" +source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" dependencies = [ "axum 0.8.9", "blake3", @@ -3016,7 +3016,7 @@ dependencies = [ [[package]] name = "grovedb-bulk-append-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" +source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" dependencies = [ "blake3", "grovedb-bincode", @@ -3034,7 +3034,7 @@ dependencies = [ [[package]] name = "grovedb-commitment-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" +source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3051,7 +3051,7 @@ dependencies = [ [[package]] name = "grovedb-costs" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" +source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" dependencies = [ "integer-encoding", "intmap", @@ -3061,7 +3061,7 @@ dependencies = [ [[package]] name = "grovedb-dense-fixed-sized-merkle-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" +source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" dependencies = [ "blake3", "grovedb-bincode", @@ -3075,7 +3075,7 @@ dependencies = [ [[package]] name = "grovedb-element" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" +source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" dependencies = [ "grovedb-bincode", "grovedb-bincode-derive", @@ -3091,7 +3091,7 @@ dependencies = [ [[package]] name = "grovedb-epoch-based-storage-flags" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" +source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" dependencies = [ "grovedb-costs", "hex", @@ -3103,7 +3103,7 @@ dependencies = [ [[package]] name = "grovedb-merk" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" +source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" dependencies = [ "blake3", "byteorder", @@ -3129,7 +3129,7 @@ dependencies = [ [[package]] name = "grovedb-merkle-mountain-range" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" +source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" dependencies = [ "blake3", "grovedb-bincode", @@ -3142,7 +3142,7 @@ dependencies = [ [[package]] name = "grovedb-path" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" +source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" dependencies = [ "hex", ] @@ -3150,7 +3150,7 @@ dependencies = [ [[package]] name = "grovedb-private-document-store" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" +source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3163,7 +3163,7 @@ dependencies = [ [[package]] name = "grovedb-query" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" +source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" dependencies = [ "byteorder", "ed", @@ -3179,7 +3179,7 @@ dependencies = [ [[package]] name = "grovedb-storage" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" +source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" dependencies = [ "blake3", "grovedb-costs", @@ -3198,7 +3198,7 @@ dependencies = [ [[package]] name = "grovedb-version" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" +source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" dependencies = [ "thiserror 2.0.18", "versioned-feature-core", @@ -3207,7 +3207,7 @@ dependencies = [ [[package]] name = "grovedb-visualize" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" +source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" dependencies = [ "hex", "itertools 0.14.0", @@ -3216,7 +3216,7 @@ dependencies = [ [[package]] name = "grovedbg-types" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=b0e637e08367d52077c3f636513bb05bb907fd45#b0e637e08367d52077c3f636513bb05bb907fd45" +source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" dependencies = [ "serde", "serde_with 3.21.0", diff --git a/packages/rs-dpp/Cargo.toml b/packages/rs-dpp/Cargo.toml index c1b19e5521b..a1cbbb57ddd 100644 --- a/packages/rs-dpp/Cargo.toml +++ b/packages/rs-dpp/Cargo.toml @@ -76,7 +76,7 @@ strum = { version = "0.26", features = ["derive"] } json-schema-compatibility-validator = { path = '../rs-json-schema-compatibility-validator', optional = true } once_cell = "1.19.0" tracing = { version = "0.1.41" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1", optional = true } [dev-dependencies] tokio = { version = "1.40", features = ["full"] } diff --git a/packages/rs-drive-abci/Cargo.toml b/packages/rs-drive-abci/Cargo.toml index 2b48604d13e..04ac42811a2 100644 --- a/packages/rs-drive-abci/Cargo.toml +++ b/packages/rs-drive-abci/Cargo.toml @@ -82,7 +82,7 @@ derive_more = { version = "1.0", features = ["from", "deref", "deref_mut"] } async-trait = "0.1.77" console-subscriber = { version = "0.4", optional = true } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f", optional = true } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45" } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" } nonempty = "0.11" # Shielded-pool snapshot needs raw RocksDB SstFileWriter + ingest_external_file_cf # bindings, and blake3 for the snapshot-file checksum. @@ -108,7 +108,7 @@ dpp = { path = "../rs-dpp", default-features = false, features = [ drive = { path = "../rs-drive", features = ["fixtures-and-mocks"] } drive-proof-verifier = { path = "../rs-drive-proof-verifier" } strategy-tests = { path = "../strategy-tests" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45", features = ["client"] } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1", features = ["client"] } assert_matches = "1.5.0" drive-abci = { path = ".", features = ["testing-config", "mocks", "shielded_test_data"] } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f" } @@ -122,8 +122,8 @@ integer-encoding = { version = "4.0.0" } # For dump_only_default_and_aux_cfs_under_shielded_subtree_prefix — same # subtree-prefix algorithm grovedb uses internally. -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45" } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" } [features] default = ["bls-signatures"] diff --git a/packages/rs-drive/Cargo.toml b/packages/rs-drive/Cargo.toml index 55d00e05dfc..b6deaa13887 100644 --- a/packages/rs-drive/Cargo.toml +++ b/packages/rs-drive/Cargo.toml @@ -52,13 +52,13 @@ enum-map = { version = "2.0.3", optional = true } intmap = { version = "3.0.1", features = ["serde"], optional = true } chrono = { version = "0.4.35", optional = true } itertools = { version = "0.13", optional = true } -grovedb = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45", optional = true, default-features = false } -grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45", optional = true } -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45" } -grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45", optional = true } -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45" } -grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45" } +grovedb = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1", optional = true, default-features = false } +grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1", optional = true } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" } +grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1", optional = true } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" } +grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" } [dev-dependencies] criterion = "0.5" diff --git a/packages/rs-platform-version/Cargo.toml b/packages/rs-platform-version/Cargo.toml index 67fa3adf669..6710c3dbf1c 100644 --- a/packages/rs-platform-version/Cargo.toml +++ b/packages/rs-platform-version/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" thiserror = { version = "2.0.12" } bincode = { workspace = true } versioned-feature-core = "1.0.0" -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45" } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" } [features] mock-versions = [] diff --git a/packages/rs-platform-wallet/Cargo.toml b/packages/rs-platform-wallet/Cargo.toml index fab385a9730..574eeff440b 100644 --- a/packages/rs-platform-wallet/Cargo.toml +++ b/packages/rs-platform-wallet/Cargo.toml @@ -61,7 +61,7 @@ zeroize = "1" log = "0.4" # Shielded pool (optional, behind `shielded` feature) -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1", optional = true } # Direct `rusqlite` access so `FileBackedShieldedStore::open_path` can set # WAL + synchronous=NORMAL pragmas before handing the connection to # `ClientPersistentCommitmentTree`. Version locked to match the rev grovedb diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index 9ec48e5fd65..b8e7012887d 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -18,7 +18,7 @@ drive = { path = "../rs-drive", default-features = false, features = [ ] } drive-proof-verifier = { path = "../rs-drive-proof-verifier", default-features = false } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "b0e637e08367d52077c3f636513bb05bb907fd45", features = [ +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1", features = [ "client", "sqlite", ], optional = true } From 82c6364604904867ac4b71b495840ad43aabc8a7 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sun, 13 Sep 2026 11:51:22 +0700 Subject: [PATCH 19/20] build(drive): move the GroveDB pin to #953 head fe932e1f Test-only change on the GroveDB side (coverage for the twin ops); no Drive change and the fee baselines are unchanged. Co-Authored-By: Claude Fable 5.1 --- Cargo.lock | 32 ++++++++++++------------- packages/rs-dpp/Cargo.toml | 2 +- packages/rs-drive-abci/Cargo.toml | 8 +++---- packages/rs-drive/Cargo.toml | 14 +++++------ packages/rs-platform-version/Cargo.toml | 2 +- packages/rs-platform-wallet/Cargo.toml | 2 +- packages/rs-sdk/Cargo.toml | 2 +- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 24eef059f22..9e489c4a8a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2957,7 +2957,7 @@ dependencies = [ [[package]] name = "grovedb" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" +source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" dependencies = [ "axum 0.8.9", "blake3", @@ -3016,7 +3016,7 @@ dependencies = [ [[package]] name = "grovedb-bulk-append-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" +source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" dependencies = [ "blake3", "grovedb-bincode", @@ -3034,7 +3034,7 @@ dependencies = [ [[package]] name = "grovedb-commitment-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" +source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3051,7 +3051,7 @@ dependencies = [ [[package]] name = "grovedb-costs" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" +source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" dependencies = [ "integer-encoding", "intmap", @@ -3061,7 +3061,7 @@ dependencies = [ [[package]] name = "grovedb-dense-fixed-sized-merkle-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" +source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" dependencies = [ "blake3", "grovedb-bincode", @@ -3075,7 +3075,7 @@ dependencies = [ [[package]] name = "grovedb-element" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" +source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" dependencies = [ "grovedb-bincode", "grovedb-bincode-derive", @@ -3091,7 +3091,7 @@ dependencies = [ [[package]] name = "grovedb-epoch-based-storage-flags" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" +source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" dependencies = [ "grovedb-costs", "hex", @@ -3103,7 +3103,7 @@ dependencies = [ [[package]] name = "grovedb-merk" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" +source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" dependencies = [ "blake3", "byteorder", @@ -3129,7 +3129,7 @@ dependencies = [ [[package]] name = "grovedb-merkle-mountain-range" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" +source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" dependencies = [ "blake3", "grovedb-bincode", @@ -3142,7 +3142,7 @@ dependencies = [ [[package]] name = "grovedb-path" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" +source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" dependencies = [ "hex", ] @@ -3150,7 +3150,7 @@ dependencies = [ [[package]] name = "grovedb-private-document-store" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" +source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3163,7 +3163,7 @@ dependencies = [ [[package]] name = "grovedb-query" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" +source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" dependencies = [ "byteorder", "ed", @@ -3179,7 +3179,7 @@ dependencies = [ [[package]] name = "grovedb-storage" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" +source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" dependencies = [ "blake3", "grovedb-costs", @@ -3198,7 +3198,7 @@ dependencies = [ [[package]] name = "grovedb-version" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" +source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" dependencies = [ "thiserror 2.0.18", "versioned-feature-core", @@ -3207,7 +3207,7 @@ dependencies = [ [[package]] name = "grovedb-visualize" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" +source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" dependencies = [ "hex", "itertools 0.14.0", @@ -3216,7 +3216,7 @@ dependencies = [ [[package]] name = "grovedbg-types" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=90d8ae1d1c0078021093a90d0553e8f2f7ecacc1#90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" +source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" dependencies = [ "serde", "serde_with 3.21.0", diff --git a/packages/rs-dpp/Cargo.toml b/packages/rs-dpp/Cargo.toml index a1cbbb57ddd..1a6cf1a75df 100644 --- a/packages/rs-dpp/Cargo.toml +++ b/packages/rs-dpp/Cargo.toml @@ -76,7 +76,7 @@ strum = { version = "0.26", features = ["derive"] } json-schema-compatibility-validator = { path = '../rs-json-schema-compatibility-validator', optional = true } once_cell = "1.19.0" tracing = { version = "0.1.41" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b", optional = true } [dev-dependencies] tokio = { version = "1.40", features = ["full"] } diff --git a/packages/rs-drive-abci/Cargo.toml b/packages/rs-drive-abci/Cargo.toml index 04ac42811a2..fd773cf2186 100644 --- a/packages/rs-drive-abci/Cargo.toml +++ b/packages/rs-drive-abci/Cargo.toml @@ -82,7 +82,7 @@ derive_more = { version = "1.0", features = ["from", "deref", "deref_mut"] } async-trait = "0.1.77" console-subscriber = { version = "0.4", optional = true } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f", optional = true } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b" } nonempty = "0.11" # Shielded-pool snapshot needs raw RocksDB SstFileWriter + ingest_external_file_cf # bindings, and blake3 for the snapshot-file checksum. @@ -108,7 +108,7 @@ dpp = { path = "../rs-dpp", default-features = false, features = [ drive = { path = "../rs-drive", features = ["fixtures-and-mocks"] } drive-proof-verifier = { path = "../rs-drive-proof-verifier" } strategy-tests = { path = "../strategy-tests" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1", features = ["client"] } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b", features = ["client"] } assert_matches = "1.5.0" drive-abci = { path = ".", features = ["testing-config", "mocks", "shielded_test_data"] } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f" } @@ -122,8 +122,8 @@ integer-encoding = { version = "4.0.0" } # For dump_only_default_and_aux_cfs_under_shielded_subtree_prefix — same # subtree-prefix algorithm grovedb uses internally. -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b" } [features] default = ["bls-signatures"] diff --git a/packages/rs-drive/Cargo.toml b/packages/rs-drive/Cargo.toml index b6deaa13887..58fccd84932 100644 --- a/packages/rs-drive/Cargo.toml +++ b/packages/rs-drive/Cargo.toml @@ -52,13 +52,13 @@ enum-map = { version = "2.0.3", optional = true } intmap = { version = "3.0.1", features = ["serde"], optional = true } chrono = { version = "0.4.35", optional = true } itertools = { version = "0.13", optional = true } -grovedb = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1", optional = true, default-features = false } -grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1", optional = true } -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" } -grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1", optional = true } -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" } -grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" } +grovedb = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b", optional = true, default-features = false } +grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b", optional = true } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b" } +grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b", optional = true } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b" } +grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b" } [dev-dependencies] criterion = "0.5" diff --git a/packages/rs-platform-version/Cargo.toml b/packages/rs-platform-version/Cargo.toml index 6710c3dbf1c..4d230f23c26 100644 --- a/packages/rs-platform-version/Cargo.toml +++ b/packages/rs-platform-version/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" thiserror = { version = "2.0.12" } bincode = { workspace = true } versioned-feature-core = "1.0.0" -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1" } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b" } [features] mock-versions = [] diff --git a/packages/rs-platform-wallet/Cargo.toml b/packages/rs-platform-wallet/Cargo.toml index 574eeff440b..62a2db59148 100644 --- a/packages/rs-platform-wallet/Cargo.toml +++ b/packages/rs-platform-wallet/Cargo.toml @@ -61,7 +61,7 @@ zeroize = "1" log = "0.4" # Shielded pool (optional, behind `shielded` feature) -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b", optional = true } # Direct `rusqlite` access so `FileBackedShieldedStore::open_path` can set # WAL + synchronous=NORMAL pragmas before handing the connection to # `ClientPersistentCommitmentTree`. Version locked to match the rev grovedb diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index b8e7012887d..7ed15639065 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -18,7 +18,7 @@ drive = { path = "../rs-drive", default-features = false, features = [ ] } drive-proof-verifier = { path = "../rs-drive-proof-verifier", default-features = false } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "90d8ae1d1c0078021093a90d0553e8f2f7ecacc1", features = [ +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b", features = [ "client", "sqlite", ], optional = true } From f92d6c43fd48887da2712c530a7036e01a760dbd Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Sun, 13 Sep 2026 12:00:17 +0700 Subject: [PATCH 20/20] build(drive): pin GroveDB at develop 6816457d, the merge of #953 GroveDB #953 (per-operation backward-reference declarations through the DontCheckForBackwardsReferences twins) is merged; the pins move from the PR head to the develop merge commit. The Rust tree is identical to the previous pin; only CI workflow files differ. Co-Authored-By: Claude Fable 5.1 --- Cargo.lock | 32 ++++++++++++------------- packages/rs-dpp/Cargo.toml | 2 +- packages/rs-drive-abci/Cargo.toml | 8 +++---- packages/rs-drive/Cargo.toml | 14 +++++------ packages/rs-platform-version/Cargo.toml | 2 +- packages/rs-platform-wallet/Cargo.toml | 2 +- packages/rs-sdk/Cargo.toml | 2 +- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9e489c4a8a3..d9997eaa125 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2957,7 +2957,7 @@ dependencies = [ [[package]] name = "grovedb" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" +source = "git+https://github.com/dashpay/grovedb?rev=6816457d2b2df98653f286bf9a374f236a17748f#6816457d2b2df98653f286bf9a374f236a17748f" dependencies = [ "axum 0.8.9", "blake3", @@ -3016,7 +3016,7 @@ dependencies = [ [[package]] name = "grovedb-bulk-append-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" +source = "git+https://github.com/dashpay/grovedb?rev=6816457d2b2df98653f286bf9a374f236a17748f#6816457d2b2df98653f286bf9a374f236a17748f" dependencies = [ "blake3", "grovedb-bincode", @@ -3034,7 +3034,7 @@ dependencies = [ [[package]] name = "grovedb-commitment-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" +source = "git+https://github.com/dashpay/grovedb?rev=6816457d2b2df98653f286bf9a374f236a17748f#6816457d2b2df98653f286bf9a374f236a17748f" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3051,7 +3051,7 @@ dependencies = [ [[package]] name = "grovedb-costs" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" +source = "git+https://github.com/dashpay/grovedb?rev=6816457d2b2df98653f286bf9a374f236a17748f#6816457d2b2df98653f286bf9a374f236a17748f" dependencies = [ "integer-encoding", "intmap", @@ -3061,7 +3061,7 @@ dependencies = [ [[package]] name = "grovedb-dense-fixed-sized-merkle-tree" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" +source = "git+https://github.com/dashpay/grovedb?rev=6816457d2b2df98653f286bf9a374f236a17748f#6816457d2b2df98653f286bf9a374f236a17748f" dependencies = [ "blake3", "grovedb-bincode", @@ -3075,7 +3075,7 @@ dependencies = [ [[package]] name = "grovedb-element" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" +source = "git+https://github.com/dashpay/grovedb?rev=6816457d2b2df98653f286bf9a374f236a17748f#6816457d2b2df98653f286bf9a374f236a17748f" dependencies = [ "grovedb-bincode", "grovedb-bincode-derive", @@ -3091,7 +3091,7 @@ dependencies = [ [[package]] name = "grovedb-epoch-based-storage-flags" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" +source = "git+https://github.com/dashpay/grovedb?rev=6816457d2b2df98653f286bf9a374f236a17748f#6816457d2b2df98653f286bf9a374f236a17748f" dependencies = [ "grovedb-costs", "hex", @@ -3103,7 +3103,7 @@ dependencies = [ [[package]] name = "grovedb-merk" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" +source = "git+https://github.com/dashpay/grovedb?rev=6816457d2b2df98653f286bf9a374f236a17748f#6816457d2b2df98653f286bf9a374f236a17748f" dependencies = [ "blake3", "byteorder", @@ -3129,7 +3129,7 @@ dependencies = [ [[package]] name = "grovedb-merkle-mountain-range" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" +source = "git+https://github.com/dashpay/grovedb?rev=6816457d2b2df98653f286bf9a374f236a17748f#6816457d2b2df98653f286bf9a374f236a17748f" dependencies = [ "blake3", "grovedb-bincode", @@ -3142,7 +3142,7 @@ dependencies = [ [[package]] name = "grovedb-path" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" +source = "git+https://github.com/dashpay/grovedb?rev=6816457d2b2df98653f286bf9a374f236a17748f#6816457d2b2df98653f286bf9a374f236a17748f" dependencies = [ "hex", ] @@ -3150,7 +3150,7 @@ dependencies = [ [[package]] name = "grovedb-private-document-store" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" +source = "git+https://github.com/dashpay/grovedb?rev=6816457d2b2df98653f286bf9a374f236a17748f#6816457d2b2df98653f286bf9a374f236a17748f" dependencies = [ "blake3", "grovedb-bulk-append-tree", @@ -3163,7 +3163,7 @@ dependencies = [ [[package]] name = "grovedb-query" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" +source = "git+https://github.com/dashpay/grovedb?rev=6816457d2b2df98653f286bf9a374f236a17748f#6816457d2b2df98653f286bf9a374f236a17748f" dependencies = [ "byteorder", "ed", @@ -3179,7 +3179,7 @@ dependencies = [ [[package]] name = "grovedb-storage" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" +source = "git+https://github.com/dashpay/grovedb?rev=6816457d2b2df98653f286bf9a374f236a17748f#6816457d2b2df98653f286bf9a374f236a17748f" dependencies = [ "blake3", "grovedb-costs", @@ -3198,7 +3198,7 @@ dependencies = [ [[package]] name = "grovedb-version" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" +source = "git+https://github.com/dashpay/grovedb?rev=6816457d2b2df98653f286bf9a374f236a17748f#6816457d2b2df98653f286bf9a374f236a17748f" dependencies = [ "thiserror 2.0.18", "versioned-feature-core", @@ -3207,7 +3207,7 @@ dependencies = [ [[package]] name = "grovedb-visualize" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" +source = "git+https://github.com/dashpay/grovedb?rev=6816457d2b2df98653f286bf9a374f236a17748f#6816457d2b2df98653f286bf9a374f236a17748f" dependencies = [ "hex", "itertools 0.14.0", @@ -3216,7 +3216,7 @@ dependencies = [ [[package]] name = "grovedbg-types" version = "6.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=fe932e1fd55e253737e2644d6d35c3a1b3a4054b#fe932e1fd55e253737e2644d6d35c3a1b3a4054b" +source = "git+https://github.com/dashpay/grovedb?rev=6816457d2b2df98653f286bf9a374f236a17748f#6816457d2b2df98653f286bf9a374f236a17748f" dependencies = [ "serde", "serde_with 3.21.0", diff --git a/packages/rs-dpp/Cargo.toml b/packages/rs-dpp/Cargo.toml index 1a6cf1a75df..b1a6d6a8c61 100644 --- a/packages/rs-dpp/Cargo.toml +++ b/packages/rs-dpp/Cargo.toml @@ -76,7 +76,7 @@ strum = { version = "0.26", features = ["derive"] } json-schema-compatibility-validator = { path = '../rs-json-schema-compatibility-validator', optional = true } once_cell = "1.19.0" tracing = { version = "0.1.41" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "6816457d2b2df98653f286bf9a374f236a17748f", optional = true } [dev-dependencies] tokio = { version = "1.40", features = ["full"] } diff --git a/packages/rs-drive-abci/Cargo.toml b/packages/rs-drive-abci/Cargo.toml index fd773cf2186..dccf7521b5c 100644 --- a/packages/rs-drive-abci/Cargo.toml +++ b/packages/rs-drive-abci/Cargo.toml @@ -82,7 +82,7 @@ derive_more = { version = "1.0", features = ["from", "deref", "deref_mut"] } async-trait = "0.1.77" console-subscriber = { version = "0.4", optional = true } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f", optional = true } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b" } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "6816457d2b2df98653f286bf9a374f236a17748f" } nonempty = "0.11" # Shielded-pool snapshot needs raw RocksDB SstFileWriter + ingest_external_file_cf # bindings, and blake3 for the snapshot-file checksum. @@ -108,7 +108,7 @@ dpp = { path = "../rs-dpp", default-features = false, features = [ drive = { path = "../rs-drive", features = ["fixtures-and-mocks"] } drive-proof-verifier = { path = "../rs-drive-proof-verifier" } strategy-tests = { path = "../strategy-tests" } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b", features = ["client"] } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "6816457d2b2df98653f286bf9a374f236a17748f", features = ["client"] } assert_matches = "1.5.0" drive-abci = { path = ".", features = ["testing-config", "mocks", "shielded_test_data"] } bls-signatures = { git = "https://github.com/dashpay/bls-signatures", rev = "0842b17583888e8f46c252a4ee84cdfd58e0546f" } @@ -122,8 +122,8 @@ integer-encoding = { version = "4.0.0" } # For dump_only_default_and_aux_cfs_under_shielded_subtree_prefix — same # subtree-prefix algorithm grovedb uses internally. -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b" } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "6816457d2b2df98653f286bf9a374f236a17748f" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "6816457d2b2df98653f286bf9a374f236a17748f" } [features] default = ["bls-signatures"] diff --git a/packages/rs-drive/Cargo.toml b/packages/rs-drive/Cargo.toml index 58fccd84932..b73a0ebaec5 100644 --- a/packages/rs-drive/Cargo.toml +++ b/packages/rs-drive/Cargo.toml @@ -52,13 +52,13 @@ enum-map = { version = "2.0.3", optional = true } intmap = { version = "3.0.1", features = ["serde"], optional = true } chrono = { version = "0.4.35", optional = true } itertools = { version = "0.13", optional = true } -grovedb = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b", optional = true, default-features = false } -grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b", optional = true } -grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b" } -grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b" } -grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b", optional = true } -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b" } -grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b" } +grovedb = { git = "https://github.com/dashpay/grovedb", rev = "6816457d2b2df98653f286bf9a374f236a17748f", optional = true, default-features = false } +grovedb-costs = { git = "https://github.com/dashpay/grovedb", rev = "6816457d2b2df98653f286bf9a374f236a17748f", optional = true } +grovedb-path = { git = "https://github.com/dashpay/grovedb", rev = "6816457d2b2df98653f286bf9a374f236a17748f" } +grovedb-query = { git = "https://github.com/dashpay/grovedb", rev = "6816457d2b2df98653f286bf9a374f236a17748f" } +grovedb-storage = { git = "https://github.com/dashpay/grovedb", rev = "6816457d2b2df98653f286bf9a374f236a17748f", optional = true } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "6816457d2b2df98653f286bf9a374f236a17748f" } +grovedb-epoch-based-storage-flags = { git = "https://github.com/dashpay/grovedb", rev = "6816457d2b2df98653f286bf9a374f236a17748f" } [dev-dependencies] criterion = "0.5" diff --git a/packages/rs-platform-version/Cargo.toml b/packages/rs-platform-version/Cargo.toml index 4d230f23c26..94951daa007 100644 --- a/packages/rs-platform-version/Cargo.toml +++ b/packages/rs-platform-version/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT" thiserror = { version = "2.0.12" } bincode = { workspace = true } versioned-feature-core = "1.0.0" -grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b" } +grovedb-version = { git = "https://github.com/dashpay/grovedb", rev = "6816457d2b2df98653f286bf9a374f236a17748f" } [features] mock-versions = [] diff --git a/packages/rs-platform-wallet/Cargo.toml b/packages/rs-platform-wallet/Cargo.toml index 62a2db59148..f4e5d000787 100644 --- a/packages/rs-platform-wallet/Cargo.toml +++ b/packages/rs-platform-wallet/Cargo.toml @@ -61,7 +61,7 @@ zeroize = "1" log = "0.4" # Shielded pool (optional, behind `shielded` feature) -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b", optional = true } +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "6816457d2b2df98653f286bf9a374f236a17748f", optional = true } # Direct `rusqlite` access so `FileBackedShieldedStore::open_path` can set # WAL + synchronous=NORMAL pragmas before handing the connection to # `ClientPersistentCommitmentTree`. Version locked to match the rev grovedb diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index 7ed15639065..a307441b67a 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -18,7 +18,7 @@ drive = { path = "../rs-drive", default-features = false, features = [ ] } drive-proof-verifier = { path = "../rs-drive-proof-verifier", default-features = false } -grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "fe932e1fd55e253737e2644d6d35c3a1b3a4054b", features = [ +grovedb-commitment-tree = { git = "https://github.com/dashpay/grovedb", rev = "6816457d2b2df98653f286bf9a374f236a17748f", features = [ "client", "sqlite", ], optional = true }