diff --git a/Cargo.lock b/Cargo.lock index 24e763e7aa3cc..07d0e3c4d9f66 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -903,12 +903,12 @@ dependencies = [ [[package]] name = "hash-db" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "hash256-std-hasher" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1204,11 +1204,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "keccak-hasher" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hash256-std-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash256-std-hasher 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "tiny-keccak 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1722,10 +1722,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "memory-db" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1921,7 +1921,7 @@ dependencies = [ "substrate-primitives 0.1.0", "substrate-state-machine 0.1.0", "substrate-trie 0.4.0", - "trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-root 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "wabt 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2003,7 +2003,7 @@ dependencies = [ "substrate-service 0.3.0", "substrate-transaction-pool 0.1.0", "tokio 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-root 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "vergen 3.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3004,7 +3004,7 @@ name = "sr-io" version = "0.1.0" dependencies = [ "environmental 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "libsecp256k1 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3675,7 +3675,7 @@ dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", @@ -3703,7 +3703,7 @@ name = "substrate-client-db" version = "0.1.0" dependencies = [ "env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", "kvdb-memorydb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", "kvdb-rocksdb 0.1.4 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", @@ -4038,8 +4038,8 @@ dependencies = [ "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hash256-std-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash256-std-hasher 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4185,7 +4185,7 @@ dependencies = [ name = "substrate-state-machine" version = "0.1.0" dependencies = [ - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4194,8 +4194,8 @@ dependencies = [ "substrate-panic-handler 0.1.0", "substrate-primitives 0.1.0", "substrate-trie 0.4.0", - "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-root 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4297,16 +4297,16 @@ name = "substrate-trie" version = "0.4.0" dependencies = [ "criterion 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memory-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hasher 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memory-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-primitives 0.1.0", - "trie-bench 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-standardmap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-bench 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-root 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-standardmap 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4673,46 +4673,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "trie-bench" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "criterion 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memory-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hasher 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memory-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-standardmap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-root 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-standardmap 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "trie-db" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "elastic-array 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "trie-root" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "trie-standardmap" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "criterion 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "keccak-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak-hasher 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -4735,7 +4735,7 @@ name = "twox-hash" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -5176,8 +5176,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" "checksum globset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4743617a7464bbda3c8aec8558ff2f9429047e025771037df561d383337ff865" "checksum h2 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "ddb2b25a33e231484694267af28fec74ac63b5ccf51ee2065a5e313b834d836e" -"checksum hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b03501f6e1a2a97f1618879aba3156f14ca2847faa530c4e28859638bd11483" -"checksum hash256-std-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5c13dbac3cc50684760f54af18545c9e80fb75e93a3e586d71ebdc13138f6a4" +"checksum hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07463834729d0ce8d475e7dd6d302e407093ad9a9c02d77eb07fb74b5373829d" +"checksum hash256-std-hasher 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1224388a21c88a80ae7087a2a245ca6d80acc97a9186b75789fb3eeefd0609af" "checksum hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3bae29b6653b3412c2e71e9d486db9f9df5d701941d86683005efb9f2d28e3da" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" @@ -5208,7 +5208,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum jsonrpc-server-utils 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5521613b31ea22d36d9f95ad642058dccec846a94ed8690957652d479f620707" "checksum jsonrpc-ws-server 10.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20b8333a5a6e6ccbcf5c90f90919de557cba4929efa164e9bd0e8e497eb20e46" "checksum keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" -"checksum keccak-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cb9d3670023f4c04153d90b8a557a822d1b27ed702bb015a87cf7bffead5b611" +"checksum keccak-hasher 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a02fb74dc1b613522069b5f2023c014756ce121c6c6fb39364c139b0efc39a2d" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)" = "" "checksum kvdb-memorydb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)" = "" @@ -5249,7 +5249,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum memchr 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e1dd4eaac298c32ce07eb6ed9242eda7d82955b9170b7d6db59b2e02cc63fcb8" "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" -"checksum memory-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94da53143d45f6bad3753f532e56ad57a6a26c0ca6881794583310c7cb4c885f" +"checksum memory-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3dd87d4d64f7b86d8804bbb419f8ecb187cb8f40a50e91c72848075c604ba88d" "checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" "checksum merlin 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a9e97b439f6d38cbe2a4a4aa93f6770c5305f62761b78b1851406c09c87ee2a" "checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" @@ -5420,10 +5420,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445" "checksum toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" -"checksum trie-bench 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "77087d1bce467cf8371a5c0e10e4d925b065ec6cfad8b9cdff1fad4f218c6750" -"checksum trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7319e28ca295f27359d944a682f7f65b419158bf1590c92cadc0000258d788" -"checksum trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3c6fef2705af3258ec46a7e22286090394a44216201a1cf7d04b78db825e543" -"checksum trie-standardmap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0e4729504b8102acb1bef3f16e6b64d41aeb1ff0e329081451e8191df0f61ab2" +"checksum trie-bench 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eafa32a8662c06f5bf135984bc1a12821fd38770b5c2f2f9e8750327fcbe3955" +"checksum trie-db 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "843af112ba3a8c919cd961edf3cac9272353f5e277ad8678c7023fa70e5c0e2d" +"checksum trie-root 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e45632ecaf2b8b4a40b5208383cd659b4e66f58ccd40086467a4614b45781430" +"checksum trie-standardmap 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "006314f54f2ea7944a878e66fd93ad7978095bc355f30a2f26ec40f664d86c86" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" "checksum twofish 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d261e83e727c8e2dbb75dacac67c36e35db36a958ee504f2164fc052434e1" "checksum twox-hash 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "555cd4909480122bbbf21e34faac4cb08a171f324775670447ed116726c474af" diff --git a/core/client/Cargo.toml b/core/client/Cargo.toml index f797d93f1fe9c..cfc7eb3e3447e 100644 --- a/core/client/Cargo.toml +++ b/core/client/Cargo.toml @@ -18,7 +18,7 @@ state-machine = { package = "substrate-state-machine", path = "../state-machine" keyring = { package = "substrate-keyring", path = "../keyring", optional = true } trie = { package = "substrate-trie", path = "../trie", optional = true } substrate-telemetry = { path = "../telemetry", optional = true } -hash-db = { version = "0.11", optional = true } +hash-db = { version = "0.12", optional = true } kvdb = { git = "https://github.com/paritytech/parity-common", optional = true, rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" } parity-codec = { version = "3.2", default-features = false, features = ["derive"] } primitives = { package = "substrate-primitives", path = "../primitives", default-features = false } diff --git a/core/client/db/Cargo.toml b/core/client/db/Cargo.toml index 97de2cd7cdc8b..7fc1cc5d95750 100644 --- a/core/client/db/Cargo.toml +++ b/core/client/db/Cargo.toml @@ -12,7 +12,7 @@ kvdb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" } kvdb-memorydb = { git = "https://github.com/paritytech/parity-common", rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d", optional = true } lru-cache = "0.1.1" -hash-db = { version = "0.11" } +hash-db = { version = "0.12" } primitives = { package = "substrate-primitives", path = "../../primitives" } runtime_primitives = { package = "sr-primitives", path = "../../sr-primitives" } client = { package = "substrate-client", path = "../../client" } diff --git a/core/client/db/src/lib.rs b/core/client/db/src/lib.rs index 5d8d3cb606156..93adb990240a6 100644 --- a/core/client/db/src/lib.rs +++ b/core/client/db/src/lib.rs @@ -40,7 +40,7 @@ use client::ExecutionStrategies; use parity_codec::{Decode, Encode}; use hash_db::Hasher; use kvdb::{KeyValueDB, DBTransaction}; -use trie::MemoryDB; +use trie::{MemoryDB, PrefixedMemoryDB, prefixed_key}; use parking_lot::RwLock; use primitives::{H256, Blake2Hasher, ChangesTrieConfiguration, convert_hash}; use primitives::storage::well_known_keys; @@ -259,7 +259,7 @@ impl client::blockchain::Backend for BlockchainDb { /// Database transaction pub struct BlockImportOperation { old_state: CachingState, - db_updates: MemoryDB, + db_updates: PrefixedMemoryDB, storage_updates: Vec<(Vec, Option>)>, changes_trie_updates: MemoryDB, pending_block: Option>, @@ -310,7 +310,7 @@ where Block: BlockT, // currently authorities are not cached on full nodes } - fn update_db_storage(&mut self, update: MemoryDB) -> Result<(), client::error::Error> { + fn update_db_storage(&mut self, update: PrefixedMemoryDB) -> Result<(), client::error::Error> { self.db_updates = update; Ok(()) } @@ -321,7 +321,7 @@ where Block: BlockT, return Err(client::error::ErrorKind::GenesisInvalid.into()); } - let mut transaction: MemoryDB = Default::default(); + let mut transaction: PrefixedMemoryDB = Default::default(); for (child_key, child_map) in children { if !well_known_keys::is_child_storage_key(&child_key) { @@ -374,22 +374,23 @@ where Block: BlockT, struct StorageDb { pub db: Arc, - pub state_db: StateDb, + pub state_db: StateDb>, } impl state_machine::Storage for StorageDb { - fn get(&self, key: &H256) -> Result, String> { - self.state_db.get(key, self).map(|r| r.map(|v| DBValue::from_slice(&v))) + fn get(&self, key: &H256, prefix: &[u8]) -> Result, String> { + let key = prefixed_key::(key, prefix); + self.state_db.get(&key, self).map(|r| r.map(|v| DBValue::from_slice(&v))) .map_err(|e| format!("Database backend error: {:?}", e)) } } -impl state_db::HashDb for StorageDb { +impl state_db::NodeDb for StorageDb { type Error = io::Error; - type Hash = H256; + type Key = [u8]; - fn get(&self, key: &H256) -> Result>, Self::Error> { - self.db.get(columns::STATE, key.as_bytes()).map(|r| r.map(|v| v.to_vec())) + fn get(&self, key: &[u8]) -> Result>, Self::Error> { + self.db.get(columns::STATE, key).map(|r| r.map(|v| v.to_vec())) } } @@ -405,7 +406,7 @@ impl DbGenesisStorage { } impl state_machine::Storage for DbGenesisStorage { - fn get(&self, _key: &H256) -> Result, String> { + fn get(&self, _key: &H256, _prefix: &[u8]) -> Result, String> { Ok(None) } } @@ -515,7 +516,7 @@ impl state_machine::ChangesTrieRootsStorage for DbC } impl state_machine::ChangesTrieStorage for DbChangesTrieStorage { - fn get(&self, key: &H256) -> Result, String> { + fn get(&self, key: &H256, _prefix: &[u8]) -> Result, String> { self.db.get(columns::CHANGES_TRIE, &key[..]) .map_err(|err| format!("{}", err)) } @@ -559,7 +560,7 @@ impl> Backend { let blockchain = BlockchainDb::new(db.clone())?; let meta = blockchain.meta.clone(); let map_e = |e: state_db::Error| ::client::error::Error::from(format!("State database error: {:?}", e)); - let state_db: StateDb = StateDb::new(pruning, &StateMetaDb(&*db)).map_err(map_e)?; + let state_db: StateDb<_, _> = StateDb::new(pruning, &StateMetaDb(&*db)).map_err(map_e)?; let storage_db = StorageDb { db: db.clone(), state_db, @@ -832,7 +833,7 @@ impl> Backend { transaction.put(columns::META, meta_keys::GENESIS_HASH, hash.as_ref()); } - let mut changeset: state_db::ChangeSet = state_db::ChangeSet::default(); + let mut changeset: state_db::ChangeSet> = state_db::ChangeSet::default(); for (key, (val, rc)) in operation.db_updates.drain() { if rc > 0 { changeset.inserted.push((key, val.to_vec())); @@ -981,7 +982,7 @@ impl> Backend { } } -fn apply_state_commit(transaction: &mut DBTransaction, commit: state_db::CommitSet) { +fn apply_state_commit(transaction: &mut DBTransaction, commit: state_db::CommitSet>) { for (key, val) in commit.data.inserted.into_iter() { transaction.put(columns::STATE, &key[..], &val); } @@ -1031,7 +1032,7 @@ impl client::backend::Backend for Backend whe Ok(BlockImportOperation { pending_block: None, old_state, - db_updates: MemoryDB::default(), + db_updates: PrefixedMemoryDB::default(), storage_updates: Default::default(), changes_trie_updates: MemoryDB::default(), aux_ops: Vec::new(), @@ -1414,7 +1415,7 @@ mod tests { op.reset_storage(storage.iter().cloned().collect(), Default::default()).unwrap(); - key = op.db_updates.insert(b"hello"); + key = op.db_updates.insert(&[], b"hello"); op.set_block_data( header, Some(vec![]), @@ -1448,8 +1449,8 @@ mod tests { ).0.into(); let hash = header.hash(); - op.db_updates.insert(b"hello"); - op.db_updates.remove(&key); + op.db_updates.insert(&[], b"hello"); + op.db_updates.remove(&key, &[]); op.set_block_data( header, Some(vec![]), @@ -1483,7 +1484,7 @@ mod tests { ).0.into(); let hash = header.hash(); - op.db_updates.remove(&key); + op.db_updates.remove(&key, &[]); op.set_block_data( header, Some(vec![]), @@ -1549,7 +1550,7 @@ mod tests { assert_eq!(backend.changes_tries_storage.root(&anchor, block), Ok(Some(changes_root))); for (key, (val, _)) in changes_trie_update.drain() { - assert_eq!(backend.changes_trie_storage().unwrap().get(&key), Ok(Some(val))); + assert_eq!(backend.changes_trie_storage().unwrap().get(&key, &[]), Ok(Some(val))); } }; @@ -1675,23 +1676,23 @@ mod tests { let mut tx = DBTransaction::new(); backend.changes_tries_storage.prune(Some(config.clone()), &mut tx, Default::default(), 12); backend.storage.db.write(tx).unwrap(); - assert!(backend.changes_tries_storage.get(&root1).unwrap().is_none()); - assert!(backend.changes_tries_storage.get(&root2).unwrap().is_none()); - assert!(backend.changes_tries_storage.get(&root3).unwrap().is_none()); - assert!(backend.changes_tries_storage.get(&root4).unwrap().is_none()); - assert!(backend.changes_tries_storage.get(&root5).unwrap().is_some()); - assert!(backend.changes_tries_storage.get(&root6).unwrap().is_some()); - assert!(backend.changes_tries_storage.get(&root7).unwrap().is_some()); - assert!(backend.changes_tries_storage.get(&root8).unwrap().is_some()); + assert!(backend.changes_tries_storage.get(&root1, &[]).unwrap().is_none()); + assert!(backend.changes_tries_storage.get(&root2, &[]).unwrap().is_none()); + assert!(backend.changes_tries_storage.get(&root3, &[]).unwrap().is_none()); + assert!(backend.changes_tries_storage.get(&root4, &[]).unwrap().is_none()); + assert!(backend.changes_tries_storage.get(&root5, &[]).unwrap().is_some()); + assert!(backend.changes_tries_storage.get(&root6, &[]).unwrap().is_some()); + assert!(backend.changes_tries_storage.get(&root7, &[]).unwrap().is_some()); + assert!(backend.changes_tries_storage.get(&root8, &[]).unwrap().is_some()); // now simulate finalization of block#16, causing prune of tries at #5..#8 let mut tx = DBTransaction::new(); backend.changes_tries_storage.prune(Some(config.clone()), &mut tx, Default::default(), 16); backend.storage.db.write(tx).unwrap(); - assert!(backend.changes_tries_storage.get(&root5).unwrap().is_none()); - assert!(backend.changes_tries_storage.get(&root6).unwrap().is_none()); - assert!(backend.changes_tries_storage.get(&root7).unwrap().is_none()); - assert!(backend.changes_tries_storage.get(&root8).unwrap().is_none()); + assert!(backend.changes_tries_storage.get(&root5, &[]).unwrap().is_none()); + assert!(backend.changes_tries_storage.get(&root6, &[]).unwrap().is_none()); + assert!(backend.changes_tries_storage.get(&root7, &[]).unwrap().is_none()); + assert!(backend.changes_tries_storage.get(&root8, &[]).unwrap().is_none()); // now "change" pruning mode to archive && simulate finalization of block#20 // => no changes tries are pruned, because we never prune in archive mode @@ -1699,10 +1700,10 @@ mod tests { let mut tx = DBTransaction::new(); backend.changes_tries_storage.prune(Some(config), &mut tx, Default::default(), 20); backend.storage.db.write(tx).unwrap(); - assert!(backend.changes_tries_storage.get(&root9).unwrap().is_some()); - assert!(backend.changes_tries_storage.get(&root10).unwrap().is_some()); - assert!(backend.changes_tries_storage.get(&root11).unwrap().is_some()); - assert!(backend.changes_tries_storage.get(&root12).unwrap().is_some()); + assert!(backend.changes_tries_storage.get(&root9, &[]).unwrap().is_some()); + assert!(backend.changes_tries_storage.get(&root10, &[]).unwrap().is_some()); + assert!(backend.changes_tries_storage.get(&root11, &[]).unwrap().is_some()); + assert!(backend.changes_tries_storage.get(&root12, &[]).unwrap().is_some()); } #[test] @@ -1741,15 +1742,15 @@ mod tests { let mut tx = DBTransaction::new(); backend.changes_tries_storage.prune(Some(config.clone()), &mut tx, block5, 5); backend.storage.db.write(tx).unwrap(); - assert!(backend.changes_tries_storage.get(&root1).unwrap().is_none()); - assert!(backend.changes_tries_storage.get(&root2).unwrap().is_some()); + assert!(backend.changes_tries_storage.get(&root1, &[]).unwrap().is_none()); + assert!(backend.changes_tries_storage.get(&root2, &[]).unwrap().is_some()); // now simulate finalization of block#6, causing prune of tries at #2 let mut tx = DBTransaction::new(); backend.changes_tries_storage.prune(Some(config.clone()), &mut tx, block6, 6); backend.storage.db.write(tx).unwrap(); - assert!(backend.changes_tries_storage.get(&root2).unwrap().is_none()); - assert!(backend.changes_tries_storage.get(&root3).unwrap().is_some()); + assert!(backend.changes_tries_storage.get(&root2, &[]).unwrap().is_none()); + assert!(backend.changes_tries_storage.get(&root3, &[]).unwrap().is_some()); } #[test] diff --git a/core/client/src/client.rs b/core/client/src/client.rs index 26ba126b85c31..699bbcad8dfe1 100644 --- a/core/client/src/client.rs +++ b/core/client/src/client.rs @@ -508,8 +508,8 @@ impl Client where } impl<'a, Block: BlockT> ChangesTrieStorage for AccessedRootsRecorder<'a, Block> { - fn get(&self, key: &H256) -> Result, String> { - self.storage.get(key) + fn get(&self, key: &H256, prefix: &[u8]) -> Result, String> { + self.storage.get(key, prefix) } } diff --git a/core/client/src/in_mem.rs b/core/client/src/in_mem.rs index fc95e9664b4e4..7f3cdfd8dde62 100644 --- a/core/client/src/in_mem.rs +++ b/core/client/src/in_mem.rs @@ -742,8 +742,8 @@ impl state_machine::ChangesTrieRootsStorage for ChangesTrieStorage } impl state_machine::ChangesTrieStorage for ChangesTrieStorage where H::Out: HeapSizeOf { - fn get(&self, key: &H::Out) -> Result, String> { - self.0.get(key) + fn get(&self, key: &H::Out, prefix: &[u8]) -> Result, String> { + self.0.get(key, prefix) } } diff --git a/core/client/src/light/fetcher.rs b/core/client/src/light/fetcher.rs index bb6624f91f1a9..893682d5f8698 100644 --- a/core/client/src/light/fetcher.rs +++ b/core/client/src/light/fetcher.rs @@ -282,7 +282,7 @@ impl, F> LightDataChecker Result, Self::Error>; + fn get(&self, key: &Self::Key) -> Result, Self::Error>; } /// Error type. @@ -285,11 +285,13 @@ impl StateDbSync { self.pinned.remove(hash); } - pub fn get>(&self, key: &Key, db: &D) -> Result, Error> { + pub fn get(&self, key: &Key, db: &D) -> Result, Error> + where Key: AsRef + { if let Some(value) = self.non_canonical.get(key) { return Ok(Some(value)); } - db.get(key).map_err(|e| Error::Db(e)) + db.get(key.as_ref()).map_err(|e| Error::Db(e)) } pub fn apply_pending(&mut self) { @@ -349,7 +351,9 @@ impl StateDb { } /// Get a value from non-canonical/pruning overlay or the backing DB. - pub fn get>(&self, key: &Key, db: &D) -> Result, Error> { + pub fn get(&self, key: &Key, db: &D) -> Result, Error> + where Key: AsRef + { self.db.read().get(key, db) } diff --git a/core/state-db/src/test.rs b/core/state-db/src/test.rs index cec5935142e74..d90c36990612e 100644 --- a/core/state-db/src/test.rs +++ b/core/state-db/src/test.rs @@ -18,7 +18,7 @@ use std::collections::HashMap; use primitives::H256; -use crate::{DBValue, ChangeSet, CommitSet, MetaDb, HashDb}; +use crate::{DBValue, ChangeSet, CommitSet, MetaDb, NodeDb}; #[derive(Default, Debug, Clone, PartialEq, Eq)] pub struct TestDb { @@ -34,9 +34,9 @@ impl MetaDb for TestDb { } } -impl HashDb for TestDb { +impl NodeDb for TestDb { type Error = (); - type Hash = H256; + type Key = H256; fn get(&self, key: &H256) -> Result, ()> { Ok(self.data.get(key).cloned()) diff --git a/core/state-machine/Cargo.toml b/core/state-machine/Cargo.toml index 61a99f8e94fde..d81079b5f9c39 100644 --- a/core/state-machine/Cargo.toml +++ b/core/state-machine/Cargo.toml @@ -10,9 +10,9 @@ hex-literal = "0.1.0" log = "0.4" parking_lot = "0.7.1" heapsize = "0.4" -hash-db = "0.11" -trie-db = "0.11" -trie-root = "0.11" +hash-db = "0.12" +trie-db = "0.12" +trie-root = "0.12" trie = { package = "substrate-trie", path = "../trie" } primitives = { package = "substrate-primitives", path = "../primitives" } panic-handler = { package = "substrate-panic-handler", path = "../panic-handler" } diff --git a/core/state-machine/src/backend.rs b/core/state-machine/src/backend.rs index 0acbf278579ba..14e60b140a0e8 100644 --- a/core/state-machine/src/backend.rs +++ b/core/state-machine/src/backend.rs @@ -112,9 +112,9 @@ impl Consolidate for Vec<(Option>, Vec, Option>)> { } } -impl Consolidate for MemoryDB { +impl> Consolidate for trie::GenericMemoryDB { fn consolidate(&mut self, other: Self) { - MemoryDB::consolidate(self, other) + trie::GenericMemoryDB::consolidate(self, other) } } diff --git a/core/state-machine/src/changes_trie/changes_iterator.rs b/core/state-machine/src/changes_trie/changes_iterator.rs index f524b0799cc35..ad70117984989 100644 --- a/core/state-machine/src/changes_trie/changes_iterator.rs +++ b/core/state-machine/src/changes_trie/changes_iterator.rs @@ -115,7 +115,7 @@ pub fn key_changes_proof_check, H: Hasher>( let mut proof_db = MemoryDB::::default(); for item in proof { - proof_db.insert(&item); + proof_db.insert(&[], &item); } let proof_db = InMemoryStorage::with_db(proof_db); diff --git a/core/state-machine/src/changes_trie/mod.rs b/core/state-machine/src/changes_trie/mod.rs index 0119c3ca3105b..c29131cc0c5d8 100644 --- a/core/state-machine/src/changes_trie/mod.rs +++ b/core/state-machine/src/changes_trie/mod.rs @@ -77,7 +77,7 @@ pub trait RootsStorage: Send + Sync { /// Changes trie storage. Provides access to trie roots and trie nodes. pub trait Storage: RootsStorage { /// Get a trie node. - fn get(&self, key: &H::Out) -> Result, String>; + fn get(&self, key: &H::Out, prefix: &[u8]) -> Result, String>; } /// Changes trie configuration. diff --git a/core/state-machine/src/changes_trie/storage.rs b/core/state-machine/src/changes_trie/storage.rs index 4eb8db0de9035..decc332c1a618 100644 --- a/core/state-machine/src/changes_trie/storage.rs +++ b/core/state-machine/src/changes_trie/storage.rs @@ -92,7 +92,7 @@ impl InMemoryStorage where H::Out: HeapSizeOf { pub fn remove_from_storage(&self, keys: &HashSet) { let mut data = self.data.write(); for key in keys { - data.mdb.remove_and_purge(key); + data.mdb.remove_and_purge(key, &[]); } } @@ -116,8 +116,8 @@ impl RootsStorage for InMemoryStorage where H::Out: HeapSizeOf } impl Storage for InMemoryStorage where H::Out: HeapSizeOf { - fn get(&self, key: &H::Out) -> Result, String> { - MemoryDB::::get(&self.data.read().mdb, key) + fn get(&self, key: &H::Out, prefix: &[u8]) -> Result, String> { + MemoryDB::::get(&self.data.read().mdb, key, prefix) } } @@ -128,7 +128,9 @@ impl<'a, H: Hasher, S: 'a + Storage> TrieBackendAdapter<'a, H, S> { } impl<'a, H: Hasher, S: 'a + Storage> TrieBackendStorage for TrieBackendAdapter<'a, H, S> { - fn get(&self, key: &H::Out) -> Result, String> { - self.storage.get(key) + type Overlay = MemoryDB; + + fn get(&self, key: &H::Out, prefix: &[u8]) -> Result, String> { + self.storage.get(key, prefix) } } diff --git a/core/state-machine/src/proving_backend.rs b/core/state-machine/src/proving_backend.rs index 81d68352c8699..4d85791faf681 100644 --- a/core/state-machine/src/proving_backend.rs +++ b/core/state-machine/src/proving_backend.rs @@ -21,7 +21,7 @@ use log::debug; use hash_db::Hasher; use heapsize::HeapSizeOf; use hash_db::HashDB; -use trie::{Recorder, MemoryDB, TrieError, default_child_trie_root, read_trie_value_with, read_child_trie_value_with, record_all_keys}; +use trie::{Recorder, MemoryDB, PrefixedMemoryDB, TrieError, default_child_trie_root, read_trie_value_with, read_child_trie_value_with, record_all_keys}; use crate::trie_backend::TrieBackend; use crate::trie_backend_essence::{Ephemeral, TrieBackendEssence, TrieBackendStorage}; use crate::{Error, ExecutionError, Backend}; @@ -40,7 +40,7 @@ impl<'a, S, H> ProvingBackendEssence<'a, S, H> H::Out: HeapSizeOf, { pub fn storage(&mut self, key: &[u8]) -> Result>, String> { - let mut read_overlay = MemoryDB::default(); + let mut read_overlay = S::Overlay::default(); let eph = Ephemeral::new( self.backend.backend_storage(), &mut read_overlay, @@ -54,7 +54,7 @@ impl<'a, S, H> ProvingBackendEssence<'a, S, H> pub fn child_storage(&mut self, storage_key: &[u8], key: &[u8]) -> Result>, String> { let root = self.storage(storage_key)?.unwrap_or(default_child_trie_root::(storage_key)); - let mut read_overlay = MemoryDB::default(); + let mut read_overlay = S::Overlay::default(); let eph = Ephemeral::new( self.backend.backend_storage(), &mut read_overlay, @@ -66,7 +66,7 @@ impl<'a, S, H> ProvingBackendEssence<'a, S, H> } pub fn record_all_keys(&mut self) { - let mut read_overlay = MemoryDB::default(); + let mut read_overlay = S::Overlay::default(); let eph = Ephemeral::new( self.backend.backend_storage(), &mut read_overlay, @@ -116,8 +116,8 @@ impl<'a, S, H> Backend for ProvingBackend<'a, S, H> H::Out: Ord + HeapSizeOf, { type Error = String; - type Transaction = MemoryDB; - type TrieBackendStorage = MemoryDB; + type Transaction = S::Overlay; + type TrieBackendStorage = PrefixedMemoryDB; fn storage(&self, key: &[u8]) -> Result>, Self::Error> { ProvingBackendEssence { @@ -151,7 +151,7 @@ impl<'a, S, H> Backend for ProvingBackend<'a, S, H> self.backend.keys(prefix) } - fn storage_root(&self, delta: I) -> (H::Out, MemoryDB) + fn storage_root(&self, delta: I) -> (H::Out, Self::Transaction) where I: IntoIterator, Option>)> { self.backend.storage_root(delta) @@ -181,7 +181,7 @@ where { let db = create_proof_check_backend_storage(proof); - if !db.contains(&root) { + if !db.contains(&root, &[]) { return Err(Box::new(ExecutionError::InvalidProof) as Box); } @@ -198,7 +198,7 @@ where { let mut db = MemoryDB::default(); for item in proof { - db.insert(&item); + db.insert(&[], &item); } db } @@ -210,7 +210,7 @@ mod tests { use super::*; use primitives::{Blake2Hasher}; - fn test_proving<'a>(trie_backend: &'a TrieBackend, Blake2Hasher>) -> ProvingBackend<'a, MemoryDB, Blake2Hasher> { + fn test_proving<'a>(trie_backend: &'a TrieBackend, Blake2Hasher>) -> ProvingBackend<'a, PrefixedMemoryDB, Blake2Hasher> { ProvingBackend::new(trie_backend) } diff --git a/core/state-machine/src/trie_backend.rs b/core/state-machine/src/trie_backend.rs index 5de6c8837b8e3..b152d7fea1857 100644 --- a/core/state-machine/src/trie_backend.rs +++ b/core/state-machine/src/trie_backend.rs @@ -19,7 +19,7 @@ use log::{warn, debug}; use hash_db::Hasher; use heapsize::HeapSizeOf; -use trie::{TrieDB, TrieError, Trie, MemoryDB, delta_trie_root, default_child_trie_root, child_delta_trie_root}; +use trie::{TrieDB, TrieError, Trie, delta_trie_root, default_child_trie_root, child_delta_trie_root}; use crate::trie_backend_essence::{TrieBackendEssence, TrieBackendStorage, Ephemeral}; use crate::Backend; @@ -63,7 +63,7 @@ impl, H: Hasher> Backend for TrieBackend where H::Out: Ord + HeapSizeOf, { type Error = String; - type Transaction = MemoryDB; + type Transaction = S::Overlay; type TrieBackendStorage = S; fn storage(&self, key: &[u8]) -> Result>, Self::Error> { @@ -83,7 +83,7 @@ impl, H: Hasher> Backend for TrieBackend where } fn pairs(&self) -> Vec<(Vec, Vec)> { - let mut read_overlay = MemoryDB::default(); + let mut read_overlay = S::Overlay::default(); let eph = Ephemeral::new(self.essence.backend_storage(), &mut read_overlay); let collect_all = || -> Result<_, Box>> { @@ -107,7 +107,7 @@ impl, H: Hasher> Backend for TrieBackend where } fn keys(&self, prefix: &Vec) -> Vec> { - let mut read_overlay = MemoryDB::default(); + let mut read_overlay = S::Overlay::default(); let eph = Ephemeral::new(self.essence.backend_storage(), &mut read_overlay); let collect_all = || -> Result<_, Box>> { @@ -126,10 +126,10 @@ impl, H: Hasher> Backend for TrieBackend where collect_all().map_err(|e| debug!(target: "trie", "Error extracting trie keys: {}", e)).unwrap_or_default() } - fn storage_root(&self, delta: I) -> (H::Out, MemoryDB) + fn storage_root(&self, delta: I) -> (H::Out, S::Overlay) where I: IntoIterator, Option>)> { - let mut write_overlay = MemoryDB::default(); + let mut write_overlay = S::Overlay::default(); let mut root = *self.essence.root(); { @@ -154,7 +154,7 @@ impl, H: Hasher> Backend for TrieBackend where { let default_root = default_child_trie_root::(storage_key); - let mut write_overlay = MemoryDB::default(); + let mut write_overlay = S::Overlay::default(); let mut root = match self.storage(storage_key) { Ok(value) => value.unwrap_or(default_child_trie_root::(storage_key)), Err(e) => { @@ -189,12 +189,12 @@ impl, H: Hasher> Backend for TrieBackend where pub mod tests { use std::collections::HashSet; use primitives::{Blake2Hasher, H256}; - use trie::{TrieMut, TrieDBMut}; + use trie::{TrieMut, TrieDBMut, PrefixedMemoryDB}; use super::*; - fn test_db() -> (MemoryDB, H256) { + fn test_db() -> (PrefixedMemoryDB, H256) { let mut root = H256::default(); - let mut mdb = MemoryDB::::default(); + let mut mdb = PrefixedMemoryDB::::default(); { let mut trie = TrieDBMut::new(&mut mdb, &mut root); trie.insert(b"key", b"value").expect("insert failed"); @@ -208,7 +208,7 @@ pub mod tests { (mdb, root) } - pub(crate) fn test_trie() -> TrieBackend, Blake2Hasher> { + pub(crate) fn test_trie() -> TrieBackend, Blake2Hasher> { let (mdb, root) = test_db(); TrieBackend::new(mdb, root) } @@ -230,8 +230,8 @@ pub mod tests { #[test] fn pairs_are_empty_on_empty_storage() { - assert!(TrieBackend::, Blake2Hasher>::new( - MemoryDB::default(), + assert!(TrieBackend::, Blake2Hasher>::new( + PrefixedMemoryDB::default(), Default::default(), ).pairs().is_empty()); } diff --git a/core/state-machine/src/trie_backend_essence.rs b/core/state-machine/src/trie_backend_essence.rs index b429e7aa04619..8101126c39d78 100644 --- a/core/state-machine/src/trie_backend_essence.rs +++ b/core/state-machine/src/trie_backend_essence.rs @@ -22,13 +22,14 @@ use std::sync::Arc; use log::{debug, warn}; use hash_db::{self, Hasher}; use heapsize::HeapSizeOf; -use trie::{TrieDB, Trie, MemoryDB, DBValue, TrieError, default_child_trie_root, read_trie_value, read_child_trie_value, for_keys_in_child_trie}; +use trie::{TrieDB, Trie, MemoryDB, PrefixedMemoryDB, DBValue, TrieError, default_child_trie_root, read_trie_value, read_child_trie_value, for_keys_in_child_trie}; use crate::changes_trie::Storage as ChangesTrieStorage; +use crate::backend::Consolidate; /// Patricia trie-based storage trait. pub trait Storage: Send + Sync { /// Get a trie node. - fn get(&self, key: &H::Out) -> Result, String>; + fn get(&self, key: &H::Out, prefix: &[u8]) -> Result, String>; } /// Patricia trie-based pairs storage essence. @@ -63,7 +64,7 @@ impl, H: Hasher> TrieBackendEssence where H::Out: /// Get the value of storage at given key. pub fn storage(&self, key: &[u8]) -> Result>, String> { - let mut read_overlay = MemoryDB::default(); + let mut read_overlay = S::Overlay::default(); let eph = Ephemeral { storage: &self.storage, overlay: &mut read_overlay, @@ -78,7 +79,7 @@ impl, H: Hasher> TrieBackendEssence where H::Out: pub fn child_storage(&self, storage_key: &[u8], key: &[u8]) -> Result>, String> { let root = self.storage(storage_key)?.unwrap_or(default_child_trie_root::(storage_key)); - let mut read_overlay = MemoryDB::default(); + let mut read_overlay = S::Overlay::default(); let eph = Ephemeral { storage: &self.storage, overlay: &mut read_overlay, @@ -99,7 +100,7 @@ impl, H: Hasher> TrieBackendEssence where H::Out: } }; - let mut read_overlay = MemoryDB::default(); + let mut read_overlay = S::Overlay::default(); let eph = Ephemeral { storage: &self.storage, overlay: &mut read_overlay, @@ -112,7 +113,7 @@ impl, H: Hasher> TrieBackendEssence where H::Out: /// Execute given closure for all keys starting with prefix. pub fn for_keys_with_prefix(&self, prefix: &[u8], mut f: F) { - let mut read_overlay = MemoryDB::default(); + let mut read_overlay = S::Overlay::default(); let eph = Ephemeral { storage: &self.storage, overlay: &mut read_overlay, @@ -145,7 +146,7 @@ impl, H: Hasher> TrieBackendEssence where H::Out: pub(crate) struct Ephemeral<'a, S: 'a + TrieBackendStorage, H: 'a + Hasher> { storage: &'a S, - overlay: &'a mut MemoryDB, + overlay: &'a mut S::Overlay, } impl<'a, @@ -171,7 +172,7 @@ impl<'a, } impl<'a, S: TrieBackendStorage, H: Hasher> Ephemeral<'a, S, H> { - pub fn new(storage: &'a S, overlay: &'a mut MemoryDB) -> Self { + pub fn new(storage: &'a S, overlay: &'a mut S::Overlay) -> Self { Ephemeral { storage, overlay, @@ -187,10 +188,10 @@ impl<'a, where H::Out: HeapSizeOf { fn get(&self, key: &H::Out) -> Option { - if let Some(val) = hash_db::PlainDB::get(self.overlay, key) { + if let Some(val) = hash_db::HashDB::get(self.overlay, key, &[]) { Some(val) } else { - match self.storage.get(&key) { + match self.storage.get(&key, &[]) { Ok(x) => x, Err(e) => { warn!(target: "trie", "Failed to read from DB: {}", e); @@ -201,15 +202,15 @@ impl<'a, } fn contains(&self, key: &H::Out) -> bool { - hash_db::PlainDB::get(self, key).is_some() + hash_db::HashDB::get(self, key, &[]).is_some() } fn emplace(&mut self, key: H::Out, value: DBValue) { - hash_db::PlainDB::emplace(self.overlay, key, value) + hash_db::HashDB::emplace(self.overlay, key, &[], value) } fn remove(&mut self, key: &H::Out) { - hash_db::PlainDB::remove(self.overlay, key) + hash_db::HashDB::remove(self.overlay, key, &[]) } } @@ -231,11 +232,11 @@ impl<'a, for Ephemeral<'a, S, H> where H::Out: HeapSizeOf { - fn get(&self, key: &H::Out) -> Option { - if let Some(val) = hash_db::HashDB::get(self.overlay, key) { + fn get(&self, key: &H::Out, prefix: &[u8]) -> Option { + if let Some(val) = hash_db::HashDB::get(self.overlay, key, prefix) { Some(val) } else { - match self.storage.get(&key) { + match self.storage.get(&key, prefix) { Ok(x) => x, Err(e) => { warn!(target: "trie", "Failed to read from DB: {}", e); @@ -245,20 +246,20 @@ impl<'a, } } - fn contains(&self, key: &H::Out) -> bool { - hash_db::HashDB::get(self, key).is_some() + fn contains(&self, key: &H::Out, prefix: &[u8]) -> bool { + hash_db::HashDB::get(self, key, prefix).is_some() } - fn insert(&mut self, value: &[u8]) -> H::Out { - hash_db::HashDB::insert(self.overlay, value) + fn insert(&mut self, prefix: &[u8], value: &[u8]) -> H::Out { + hash_db::HashDB::insert(self.overlay, prefix, value) } - fn emplace(&mut self, key: H::Out, value: DBValue) { - hash_db::HashDB::emplace(self.overlay, key, value) + fn emplace(&mut self, key: H::Out, prefix: &[u8], value: DBValue) { + hash_db::HashDB::emplace(self.overlay, key, prefix, value) } - fn remove(&mut self, key: &H::Out) { - hash_db::HashDB::remove(self.overlay, key) + fn remove(&mut self, key: &H::Out, prefix: &[u8]) { + hash_db::HashDB::remove(self.overlay, key, prefix) } } @@ -269,33 +270,49 @@ impl<'a, for Ephemeral<'a, S, H> where H::Out: HeapSizeOf { - fn get(&self, key: &H::Out) -> Option { hash_db::HashDB::get(self, key) } - fn contains(&self, key: &H::Out) -> bool { hash_db::HashDB::contains(self, key) } + fn get(&self, key: &H::Out, prefix: &[u8]) -> Option { hash_db::HashDB::get(self, key, prefix) } + fn contains(&self, key: &H::Out, prefix: &[u8]) -> bool { hash_db::HashDB::contains(self, key, prefix) } } /// Key-value pairs storage that is used by trie backend essence. pub trait TrieBackendStorage: Send + Sync { + /// Type of in-memory overlay. + type Overlay: hash_db::HashDB + Default + Consolidate; /// Get the value stored at key. - fn get(&self, key: &H::Out) -> Result, String>; + fn get(&self, key: &H::Out, prefix: &[u8]) -> Result, String>; } // This implementation is used by normal storage trie clients. impl TrieBackendStorage for Arc> { - fn get(&self, key: &H::Out) -> Result, String> { - Storage::::get(self.deref(), key) + type Overlay = PrefixedMemoryDB; + + fn get(&self, key: &H::Out, prefix: &[u8]) -> Result, String> { + Storage::::get(self.deref(), key, prefix) } } // This implementation is used by test storage trie clients. +impl TrieBackendStorage for PrefixedMemoryDB { + type Overlay = PrefixedMemoryDB; + + fn get(&self, key: &H::Out, prefix: &[u8]) -> Result, String> { + Ok(hash_db::HashDB::get(self, key, prefix)) + } +} + impl TrieBackendStorage for MemoryDB { - fn get(&self, key: &H::Out) -> Result, String> { - Ok(hash_db::PlainDB::get(self, key)) + type Overlay = MemoryDB; + + fn get(&self, key: &H::Out, prefix: &[u8]) -> Result, String> { + Ok(hash_db::HashDB::get(self, key, prefix)) } } // This implementation is used by changes trie clients. impl<'a, S, H: Hasher> TrieBackendStorage for &'a S where S: ChangesTrieStorage { - fn get(&self, key: &H::Out) -> Result, String> { - ChangesTrieStorage::::get(*self, key) + type Overlay = MemoryDB; + + fn get(&self, key: &H::Out, prefix: &[u8]) -> Result, String> { + ChangesTrieStorage::::get(*self, key, prefix) } } diff --git a/core/test-runtime/wasm/Cargo.lock b/core/test-runtime/wasm/Cargo.lock index d8eda0e88eba0..771ffe97e3deb 100644 --- a/core/test-runtime/wasm/Cargo.lock +++ b/core/test-runtime/wasm/Cargo.lock @@ -611,12 +611,12 @@ dependencies = [ [[package]] name = "hash-db" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "hash256-std-hasher" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1153,10 +1153,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "memory-db" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2019,7 +2019,7 @@ name = "sr-io" version = "0.1.0" dependencies = [ "environmental 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "libsecp256k1 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2255,7 +2255,7 @@ dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", @@ -2369,8 +2369,8 @@ dependencies = [ "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hash256-std-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash256-std-hasher 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2404,7 +2404,7 @@ dependencies = [ name = "substrate-state-machine" version = "0.1.0" dependencies = [ - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2413,8 +2413,8 @@ dependencies = [ "substrate-panic-handler 0.1.0", "substrate-primitives 0.1.0", "substrate-trie 0.4.0", - "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-root 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2469,11 +2469,11 @@ dependencies = [ name = "substrate-trie" version = "0.4.0" dependencies = [ - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memory-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memory-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-root 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2753,21 +2753,21 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "elastic-array 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "trie-root" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3048,8 +3048,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum generic-array 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c0f28c2f5bfb5960175af447a2da7c18900693738343dc896ffbcabd9839592" "checksum generic-array 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fceb69994e330afed50c93524be68c42fa898c2d9fd4ee8da03bd7363acd26f2" -"checksum hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b03501f6e1a2a97f1618879aba3156f14ca2847faa530c4e28859638bd11483" -"checksum hash256-std-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5c13dbac3cc50684760f54af18545c9e80fb75e93a3e586d71ebdc13138f6a4" +"checksum hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07463834729d0ce8d475e7dd6d302e407093ad9a9c02d77eb07fb74b5373829d" +"checksum hash256-std-hasher 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1224388a21c88a80ae7087a2a245ca6d80acc97a9186b75789fb3eeefd0609af" "checksum hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3bae29b6653b3412c2e71e9d486db9f9df5d701941d86683005efb9f2d28e3da" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" @@ -3095,7 +3095,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39" "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" -"checksum memory-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94da53143d45f6bad3753f532e56ad57a6a26c0ca6881794583310c7cb4c885f" +"checksum memory-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3dd87d4d64f7b86d8804bbb419f8ecb187cb8f40a50e91c72848075c604ba88d" "checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" "checksum merlin 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "83c2dda19c01176e8e7148f7bdb88bbdf215a8db0641f89fc40e4b81736aeda5" "checksum mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "71646331f2619b1026cc302f87a2b8b648d5c6dd6937846a16cc8ce0f347f432" @@ -3225,8 +3225,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum tokio-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "66268575b80f4a4a710ef83d087fdfeeabdce9b74c797535fbac18a2cb906e92" "checksum tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445" "checksum toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" -"checksum trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7319e28ca295f27359d944a682f7f65b419158bf1590c92cadc0000258d788" -"checksum trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3c6fef2705af3258ec46a7e22286090394a44216201a1cf7d04b78db825e543" +"checksum trie-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f23230c31251bdbdba89cd9caa0cbe2aa9e4aa5f92a80e6eb6296bb290e9146" +"checksum trie-root 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e45632ecaf2b8b4a40b5208383cd659b4e66f58ccd40086467a4614b45781430" "checksum twofish 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d261e83e727c8e2dbb75dacac67c36e35db36a958ee504f2164fc052434e1" "checksum twox-hash 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "555cd4909480122bbbf21e34faac4cb08a171f324775670447ed116726c474af" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" diff --git a/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm b/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm index ae9fc72beb735..84893ab509842 100644 Binary files a/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm and b/core/test-runtime/wasm/target/wasm32-unknown-unknown/release/substrate_test_runtime.compact.wasm differ diff --git a/core/trie/Cargo.toml b/core/trie/Cargo.toml index 9d93cbe599b65..a75aac23431e9 100644 --- a/core/trie/Cargo.toml +++ b/core/trie/Cargo.toml @@ -13,16 +13,16 @@ harness = false [dependencies] codec = { package = "parity-codec", version = "3.2" } -hash-db = { version = "0.11", default-features = false } -trie-db = { version = "0.11", optional = true } -trie-root = { version = "0.11", default-features = false } -memory-db = { version = "0.11", optional = true } +hash-db = { version = "0.12", default-features = false } +trie-db = { version = "0.12", optional = true } +trie-root = { version = "0.12", default-features = false } +memory-db = { version = "0.12", optional = true } [dev-dependencies] substrate-primitives = { path = "../primitives" } -trie-bench = { version = "0.11" } -trie-standardmap = { version = "0.11" } -keccak-hasher = { version = "0.11" } +trie-bench = { version = "0.12" } +trie-standardmap = { version = "0.12" } +keccak-hasher = { version = "0.12" } criterion = "0.2" hex-literal = "0.1.0" diff --git a/core/trie/src/lib.rs b/core/trie/src/lib.rs index 071f49d875514..999f1e67c9f86 100644 --- a/core/trie/src/lib.rs +++ b/core/trie/src/lib.rs @@ -32,6 +32,8 @@ pub use trie_stream::TrieStream; pub use node_codec::NodeCodec; /// Various re-exports from the `trie-db` crate. pub use trie_db::{Trie, TrieMut, DBValue, Recorder, Query}; +/// Various re-exports from the `memory-db` crate. +pub use memory_db::{KeyFunction, prefixed_key}; /// As in `trie_db`, but less generic, error type for the crate. pub type TrieError = trie_db::TrieError; @@ -42,8 +44,12 @@ impl> AsHashDB for T {} pub type HashDB<'a, H> = hash_db::HashDB + 'a; /// As in `hash_db`, but less generic, trait exposed. pub type PlainDB<'a, K> = hash_db::PlainDB + 'a; +/// As in `memory_db::MemoryDB` that uses prefixed storage key scheme. +pub type PrefixedMemoryDB = memory_db::MemoryDB, trie_db::DBValue>; +/// As in `memory_db::MemoryDB` that uses prefixed storage key scheme. +pub type MemoryDB = memory_db::MemoryDB, trie_db::DBValue>; /// As in `memory_db`, but less generic, trait exposed. -pub type MemoryDB = memory_db::MemoryDB; +pub type GenericMemoryDB = memory_db::MemoryDB; /// Persistent trie database read-access interface for the a given hasher. pub type TrieDB<'a, H> = trie_db::TrieDB<'a, H, NodeCodec>; @@ -313,7 +319,6 @@ mod tests { use super::*; use codec::{Encode, Compact}; use substrate_primitives::Blake2Hasher; - use memory_db::MemoryDB; use hash_db::{HashDB, Hasher}; use trie_db::{DBValue, TrieMut, Trie}; use trie_standardmap::{Alphabet, ValueMode, StandardMap}; diff --git a/node-template/Cargo.toml b/node-template/Cargo.toml index 53874bb181111..786f49023b403 100644 --- a/node-template/Cargo.toml +++ b/node-template/Cargo.toml @@ -19,7 +19,7 @@ exit-future = "0.1" parking_lot = "0.7.1" hex-literal = "0.1" parity-codec = "3.2" -trie-root = "0.11.0" +trie-root = "0.12.0" sr-io = { path = "../core/sr-io" } substrate-cli = { path = "../core/cli" } primitives = { package = "substrate-primitives", path = "../core/primitives" } diff --git a/node-template/runtime/wasm/Cargo.lock b/node-template/runtime/wasm/Cargo.lock index 34fc8036ed992..6db886a520434 100644 --- a/node-template/runtime/wasm/Cargo.lock +++ b/node-template/runtime/wasm/Cargo.lock @@ -611,12 +611,12 @@ dependencies = [ [[package]] name = "hash-db" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "hash256-std-hasher" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1153,10 +1153,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "memory-db" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2053,7 +2053,7 @@ name = "sr-io" version = "0.1.0" dependencies = [ "environmental 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "libsecp256k1 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2420,7 +2420,7 @@ dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", @@ -2534,8 +2534,8 @@ dependencies = [ "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hash256-std-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash256-std-hasher 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2569,7 +2569,7 @@ dependencies = [ name = "substrate-state-machine" version = "0.1.0" dependencies = [ - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2578,8 +2578,8 @@ dependencies = [ "substrate-panic-handler 0.1.0", "substrate-primitives 0.1.0", "substrate-trie 0.4.0", - "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-root 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2603,11 +2603,11 @@ dependencies = [ name = "substrate-trie" version = "0.4.0" dependencies = [ - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memory-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memory-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-root 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2887,21 +2887,21 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "elastic-array 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "trie-root" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3182,8 +3182,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum generic-array 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c0f28c2f5bfb5960175af447a2da7c18900693738343dc896ffbcabd9839592" "checksum generic-array 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fceb69994e330afed50c93524be68c42fa898c2d9fd4ee8da03bd7363acd26f2" -"checksum hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b03501f6e1a2a97f1618879aba3156f14ca2847faa530c4e28859638bd11483" -"checksum hash256-std-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5c13dbac3cc50684760f54af18545c9e80fb75e93a3e586d71ebdc13138f6a4" +"checksum hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07463834729d0ce8d475e7dd6d302e407093ad9a9c02d77eb07fb74b5373829d" +"checksum hash256-std-hasher 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1224388a21c88a80ae7087a2a245ca6d80acc97a9186b75789fb3eeefd0609af" "checksum hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3bae29b6653b3412c2e71e9d486db9f9df5d701941d86683005efb9f2d28e3da" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" @@ -3229,7 +3229,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39" "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" -"checksum memory-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94da53143d45f6bad3753f532e56ad57a6a26c0ca6881794583310c7cb4c885f" +"checksum memory-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3dd87d4d64f7b86d8804bbb419f8ecb187cb8f40a50e91c72848075c604ba88d" "checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" "checksum merlin 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "83c2dda19c01176e8e7148f7bdb88bbdf215a8db0641f89fc40e4b81736aeda5" "checksum mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "71646331f2619b1026cc302f87a2b8b648d5c6dd6937846a16cc8ce0f347f432" @@ -3359,8 +3359,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum tokio-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "66268575b80f4a4a710ef83d087fdfeeabdce9b74c797535fbac18a2cb906e92" "checksum tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445" "checksum toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" -"checksum trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7319e28ca295f27359d944a682f7f65b419158bf1590c92cadc0000258d788" -"checksum trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3c6fef2705af3258ec46a7e22286090394a44216201a1cf7d04b78db825e543" +"checksum trie-db 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "843af112ba3a8c919cd961edf3cac9272353f5e277ad8678c7023fa70e5c0e2d" +"checksum trie-root 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e45632ecaf2b8b4a40b5208383cd659b4e66f58ccd40086467a4614b45781430" "checksum twofish 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d261e83e727c8e2dbb75dacac67c36e35db36a958ee504f2164fc052434e1" "checksum twox-hash 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "555cd4909480122bbbf21e34faac4cb08a171f324775670447ed116726c474af" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" diff --git a/node/executor/Cargo.toml b/node/executor/Cargo.toml index 572aa9dbcfb55..3c2e9a688cb9b 100644 --- a/node/executor/Cargo.toml +++ b/node/executor/Cargo.toml @@ -6,7 +6,7 @@ description = "Substrate node implementation in Rust." edition = "2018" [dependencies] -trie-root = "0.11" +trie-root = "0.12" parity-codec = "3.2" runtime_io = { package = "sr-io", path = "../../core/sr-io" } state_machine = { package = "substrate-state-machine", path = "../../core/state-machine" } diff --git a/node/runtime/wasm/Cargo.lock b/node/runtime/wasm/Cargo.lock index 396d377ade5a1..4ad70d11347c5 100644 --- a/node/runtime/wasm/Cargo.lock +++ b/node/runtime/wasm/Cargo.lock @@ -611,12 +611,12 @@ dependencies = [ [[package]] name = "hash-db" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "hash256-std-hasher" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crunchy 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1153,10 +1153,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "memory-db" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2087,7 +2087,7 @@ name = "sr-io" version = "0.1.0" dependencies = [ "environmental 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "libsecp256k1 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2564,7 +2564,7 @@ dependencies = [ "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)", @@ -2689,8 +2689,8 @@ dependencies = [ "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hash256-std-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash256-std-hasher 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2724,7 +2724,7 @@ dependencies = [ name = "substrate-state-machine" version = "0.1.0" dependencies = [ - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex-literal 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2733,8 +2733,8 @@ dependencies = [ "substrate-panic-handler 0.1.0", "substrate-primitives 0.1.0", "substrate-trie 0.4.0", - "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-root 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2758,11 +2758,11 @@ dependencies = [ name = "substrate-trie" version = "0.4.0" dependencies = [ - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memory-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memory-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "parity-codec 3.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "trie-root 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3042,21 +3042,21 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "elastic-array 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "trie-root" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3337,8 +3337,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum generic-array 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c0f28c2f5bfb5960175af447a2da7c18900693738343dc896ffbcabd9839592" "checksum generic-array 0.8.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fceb69994e330afed50c93524be68c42fa898c2d9fd4ee8da03bd7363acd26f2" -"checksum hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b03501f6e1a2a97f1618879aba3156f14ca2847faa530c4e28859638bd11483" -"checksum hash256-std-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5c13dbac3cc50684760f54af18545c9e80fb75e93a3e586d71ebdc13138f6a4" +"checksum hash-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07463834729d0ce8d475e7dd6d302e407093ad9a9c02d77eb07fb74b5373829d" +"checksum hash256-std-hasher 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1224388a21c88a80ae7087a2a245ca6d80acc97a9186b75789fb3eeefd0609af" "checksum hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3bae29b6653b3412c2e71e9d486db9f9df5d701941d86683005efb9f2d28e3da" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" @@ -3384,7 +3384,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39" "checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" -"checksum memory-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94da53143d45f6bad3753f532e56ad57a6a26c0ca6881794583310c7cb4c885f" +"checksum memory-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3dd87d4d64f7b86d8804bbb419f8ecb187cb8f40a50e91c72848075c604ba88d" "checksum memory_units 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "71d96e3f3c0b6325d8ccd83c33b28acb183edcb6c67938ba104ec546854b0882" "checksum merlin 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "83c2dda19c01176e8e7148f7bdb88bbdf215a8db0641f89fc40e4b81736aeda5" "checksum mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "71646331f2619b1026cc302f87a2b8b648d5c6dd6937846a16cc8ce0f347f432" @@ -3515,8 +3515,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum tokio-udp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "66268575b80f4a4a710ef83d087fdfeeabdce9b74c797535fbac18a2cb906e92" "checksum tokio-uds 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445" "checksum toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" -"checksum trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c7319e28ca295f27359d944a682f7f65b419158bf1590c92cadc0000258d788" -"checksum trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e3c6fef2705af3258ec46a7e22286090394a44216201a1cf7d04b78db825e543" +"checksum trie-db 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f23230c31251bdbdba89cd9caa0cbe2aa9e4aa5f92a80e6eb6296bb290e9146" +"checksum trie-root 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e45632ecaf2b8b4a40b5208383cd659b4e66f58ccd40086467a4614b45781430" "checksum twofish 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712d261e83e727c8e2dbb75dacac67c36e35db36a958ee504f2164fc052434e1" "checksum twox-hash 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "555cd4909480122bbbf21e34faac4cb08a171f324775670447ed116726c474af" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" diff --git a/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm b/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm index 98058fe83361c..53ad4d8a909ab 100644 Binary files a/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm and b/node/runtime/wasm/target/wasm32-unknown-unknown/release/node_runtime.compact.wasm differ