From c1ff7d22d0458c0a5bd79e5ab00d0b8584755830 Mon Sep 17 00:00:00 2001 From: Facundo Farall <37149322+ffarall@users.noreply.github.com> Date: Thu, 4 Apr 2024 13:27:51 -0300 Subject: [PATCH 1/4] build: :arrow_up: Upgrade `trie-db` from `0.28.0` to `0.29.0` --- Cargo.lock | 26 ++++++++++++++----- bridges/primitives/runtime/Cargo.toml | 2 +- cumulus/pallets/parachain-system/Cargo.toml | 2 +- substrate/primitives/state-machine/Cargo.toml | 2 +- substrate/primitives/trie/Cargo.toml | 2 +- substrate/test-utils/runtime/Cargo.toml | 2 +- .../rpc/state-trie-migration-rpc/Cargo.toml | 2 +- 7 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1ea460815c2f..32f9adf4d224 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1869,7 +1869,7 @@ dependencies = [ "sp-state-machine", "sp-std 14.0.0", "sp-trie", - "trie-db", + "trie-db 0.29.0", ] [[package]] @@ -3895,7 +3895,7 @@ dependencies = [ "sp-trie", "sp-version", "staging-xcm", - "trie-db", + "trie-db 0.29.0", "trie-standardmap", ] @@ -19154,7 +19154,7 @@ dependencies = [ "sp-trie", "thiserror", "tracing", - "trie-db", + "trie-db 0.29.0", ] [[package]] @@ -19301,7 +19301,7 @@ dependencies = [ "thiserror", "tracing", "trie-bench", - "trie-db", + "trie-db 0.29.0", "trie-root", "trie-standardmap", ] @@ -19931,7 +19931,7 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-trie", - "trie-db", + "trie-db 0.29.0", ] [[package]] @@ -20007,7 +20007,7 @@ dependencies = [ "sp-version", "substrate-test-runtime-client", "substrate-wasm-builder", - "trie-db", + "trie-db 0.29.0", ] [[package]] @@ -20972,7 +20972,7 @@ dependencies = [ "keccak-hasher", "memory-db", "parity-scale-codec", - "trie-db", + "trie-db 0.28.0", "trie-root", "trie-standardmap", ] @@ -20990,6 +20990,18 @@ dependencies = [ "smallvec", ] +[[package]] +name = "trie-db" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65ed83be775d85ebb0e272914fff6462c39b3ddd6dc67b5c1c41271aad280c69" +dependencies = [ + "hash-db", + "log", + "rustc-hex", + "smallvec", +] + [[package]] name = "trie-root" version = "0.18.0" diff --git a/bridges/primitives/runtime/Cargo.toml b/bridges/primitives/runtime/Cargo.toml index cca9c21a608d..9a9b0291687d 100644 --- a/bridges/primitives/runtime/Cargo.toml +++ b/bridges/primitives/runtime/Cargo.toml @@ -29,7 +29,7 @@ sp-runtime = { path = "../../../substrate/primitives/runtime", default-features sp-state-machine = { path = "../../../substrate/primitives/state-machine", default-features = false } sp-std = { path = "../../../substrate/primitives/std", default-features = false } sp-trie = { path = "../../../substrate/primitives/trie", default-features = false } -trie-db = { version = "0.28.0", default-features = false } +trie-db = { version = "0.29.0", default-features = false } [dev-dependencies] hex-literal = "0.4" diff --git a/cumulus/pallets/parachain-system/Cargo.toml b/cumulus/pallets/parachain-system/Cargo.toml index a905df5b94a6..c08232cf32ac 100644 --- a/cumulus/pallets/parachain-system/Cargo.toml +++ b/cumulus/pallets/parachain-system/Cargo.toml @@ -15,7 +15,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = environmental = { version = "1.1.4", default-features = false } impl-trait-for-tuples = "0.2.1" log = { workspace = true } -trie-db = { version = "0.28.0", default-features = false } +trie-db = { version = "0.29.0", default-features = false } scale-info = { version = "2.11.1", default-features = false, features = ["derive"] } # Substrate diff --git a/substrate/primitives/state-machine/Cargo.toml b/substrate/primitives/state-machine/Cargo.toml index aaedb500b59c..63251bbd181d 100644 --- a/substrate/primitives/state-machine/Cargo.toml +++ b/substrate/primitives/state-machine/Cargo.toml @@ -29,7 +29,7 @@ sp-core = { path = "../core", default-features = false } sp-externalities = { path = "../externalities", default-features = false } sp-panic-handler = { path = "../panic-handler", optional = true } sp-trie = { path = "../trie", default-features = false } -trie-db = { version = "0.28.0", default-features = false } +trie-db = { version = "0.29.0", default-features = false } [dev-dependencies] array-bytes = "6.1" diff --git a/substrate/primitives/trie/Cargo.toml b/substrate/primitives/trie/Cargo.toml index 28c496d7a8e0..7c1b0471a83a 100644 --- a/substrate/primitives/trie/Cargo.toml +++ b/substrate/primitives/trie/Cargo.toml @@ -32,7 +32,7 @@ rand = { version = "0.8", optional = true } scale-info = { version = "2.11.1", default-features = false, features = ["derive"] } thiserror = { optional = true, workspace = true } tracing = { version = "0.1.29", optional = true } -trie-db = { version = "0.28.0", default-features = false } +trie-db = { version = "0.29.0", default-features = false } trie-root = { version = "0.18.0", default-features = false } sp-core = { path = "../core", default-features = false } sp-externalities = { path = "../externalities", default-features = false } diff --git a/substrate/test-utils/runtime/Cargo.toml b/substrate/test-utils/runtime/Cargo.toml index ffbd59f39ad2..5f68b45869af 100644 --- a/substrate/test-utils/runtime/Cargo.toml +++ b/substrate/test-utils/runtime/Cargo.toml @@ -43,7 +43,7 @@ pallet-timestamp = { path = "../../frame/timestamp", default-features = false } sp-consensus-grandpa = { path = "../../primitives/consensus/grandpa", default-features = false, features = ["serde"] } sp-trie = { path = "../../primitives/trie", default-features = false } sp-transaction-pool = { path = "../../primitives/transaction-pool", default-features = false } -trie-db = { version = "0.28.0", default-features = false } +trie-db = { version = "0.29.0", default-features = false } sc-service = { path = "../../client/service", default-features = false, features = ["test-helpers"], optional = true } sp-state-machine = { path = "../../primitives/state-machine", default-features = false } sp-externalities = { path = "../../primitives/externalities", default-features = false } diff --git a/substrate/utils/frame/rpc/state-trie-migration-rpc/Cargo.toml b/substrate/utils/frame/rpc/state-trie-migration-rpc/Cargo.toml index f9a45e21ce13..98a87b7d5b20 100644 --- a/substrate/utils/frame/rpc/state-trie-migration-rpc/Cargo.toml +++ b/substrate/utils/frame/rpc/state-trie-migration-rpc/Cargo.toml @@ -22,7 +22,7 @@ serde = { features = ["derive"], workspace = true, default-features = true } sp-core = { path = "../../../../primitives/core" } sp-state-machine = { path = "../../../../primitives/state-machine" } sp-trie = { path = "../../../../primitives/trie" } -trie-db = "0.28.0" +trie-db = "0.29.0" jsonrpsee = { version = "0.22", features = ["client-core", "macros", "server"] } From ae0e38a600b7fb5ee189f64e5102fa763537fd08 Mon Sep 17 00:00:00 2001 From: Facundo Farall <37149322+ffarall@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:11:22 -0300 Subject: [PATCH 2/4] feat: :sparkles: Reexport DoubleEnded iterators --- substrate/primitives/trie/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/substrate/primitives/trie/src/lib.rs b/substrate/primitives/trie/src/lib.rs index 0ae448aff6e1..54f202eda0c9 100644 --- a/substrate/primitives/trie/src/lib.rs +++ b/substrate/primitives/trie/src/lib.rs @@ -55,8 +55,10 @@ use trie_db::proof::{generate_proof, verify_proof}; pub use trie_db::{ nibble_ops, node::{NodePlan, ValuePlan}, + triedb::{TrieDBDoubleEndedIterator, TrieDBKeyDoubleEndedIterator}, CError, DBValue, Query, Recorder, Trie, TrieCache, TrieConfiguration, TrieDBIterator, - TrieDBKeyIterator, TrieDBRawIterator, TrieLayout, TrieMut, TrieRecorder, + TrieDBKeyIterator, TrieDBNodeDoubleEndedIterator, TrieDBRawIterator, TrieLayout, TrieMut, + TrieRecorder, }; pub use trie_db::{proof::VerifyError, MerkleValue}; /// The Substrate format implementation of `TrieStream`. From 6d0016afeadb642435754fd3ebc608e36ae454d3 Mon Sep 17 00:00:00 2001 From: ffarall <37149322+ffarall@users.noreply.github.com> Date: Fri, 5 Apr 2024 06:27:15 -0700 Subject: [PATCH 3/4] build: :arrow_up: Upgrade `trie-bench` from `0.38.0` to `0.39.0` --- Cargo.lock | 33 +++++++++------------------- substrate/primitives/trie/Cargo.toml | 2 +- 2 files changed, 11 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5711983bf67c..b3604eb2c31d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1869,7 +1869,7 @@ dependencies = [ "sp-state-machine", "sp-std 14.0.0", "sp-trie", - "trie-db 0.29.0", + "trie-db", ] [[package]] @@ -3895,7 +3895,7 @@ dependencies = [ "sp-trie", "sp-version", "staging-xcm", - "trie-db 0.29.0", + "trie-db", "trie-standardmap", ] @@ -19160,7 +19160,7 @@ dependencies = [ "sp-trie", "thiserror", "tracing", - "trie-db 0.29.0", + "trie-db", ] [[package]] @@ -19307,7 +19307,7 @@ dependencies = [ "thiserror", "tracing", "trie-bench", - "trie-db 0.29.0", + "trie-db", "trie-root", "trie-standardmap", ] @@ -19938,7 +19938,7 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-trie", - "trie-db 0.29.0", + "trie-db", ] [[package]] @@ -20015,7 +20015,7 @@ dependencies = [ "sp-version", "substrate-test-runtime-client", "substrate-wasm-builder", - "trie-db 0.29.0", + "trie-db", ] [[package]] @@ -20971,33 +20971,20 @@ dependencies = [ [[package]] name = "trie-bench" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4680cb226e31d2a096592d0edecdda91cc371743002f80c0f8cf80219819b3b" +checksum = "3092f400e9f7e3ce8c1756016a8b6287163ab7a11dd47d82169260cb4cc2d680" dependencies = [ - "criterion 0.4.0", + "criterion 0.5.1", "hash-db", "keccak-hasher", "memory-db", "parity-scale-codec", - "trie-db 0.28.0", + "trie-db", "trie-root", "trie-standardmap", ] -[[package]] -name = "trie-db" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff28e0f815c2fea41ebddf148e008b077d2faddb026c9555b29696114d602642" -dependencies = [ - "hash-db", - "hashbrown 0.13.2", - "log", - "rustc-hex", - "smallvec", -] - [[package]] name = "trie-db" version = "0.29.0" diff --git a/substrate/primitives/trie/Cargo.toml b/substrate/primitives/trie/Cargo.toml index 7c1b0471a83a..db255ee22b75 100644 --- a/substrate/primitives/trie/Cargo.toml +++ b/substrate/primitives/trie/Cargo.toml @@ -41,7 +41,7 @@ schnellru = { version = "0.2.1", optional = true } [dev-dependencies] array-bytes = "6.1" criterion = "0.4.0" -trie-bench = "0.38.0" +trie-bench = "0.39.0" trie-standardmap = "0.16.0" sp-runtime = { path = "../runtime" } From dc851871c69013c88f3a1399d11e1e8d34981e96 Mon Sep 17 00:00:00 2001 From: ffarall <37149322+ffarall@users.noreply.github.com> Date: Fri, 5 Apr 2024 08:50:19 -0700 Subject: [PATCH 4/4] build: :arrow_up: Upgrade `criterion` from `0.4.0` to `0.5.1` --- Cargo.lock | 2 +- substrate/primitives/trie/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3604eb2c31d..4c006db41573 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19291,7 +19291,7 @@ version = "29.0.0" dependencies = [ "ahash 0.8.8", "array-bytes 6.1.0", - "criterion 0.4.0", + "criterion 0.5.1", "hash-db", "lazy_static", "memory-db", diff --git a/substrate/primitives/trie/Cargo.toml b/substrate/primitives/trie/Cargo.toml index db255ee22b75..6469a59e0d10 100644 --- a/substrate/primitives/trie/Cargo.toml +++ b/substrate/primitives/trie/Cargo.toml @@ -40,7 +40,7 @@ schnellru = { version = "0.2.1", optional = true } [dev-dependencies] array-bytes = "6.1" -criterion = "0.4.0" +criterion = "0.5.1" trie-bench = "0.39.0" trie-standardmap = "0.16.0" sp-runtime = { path = "../runtime" }