From ddfa4f10053e85ef9a57861497acea2217dad95f Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Thu, 30 Nov 2023 18:16:17 +0300 Subject: [PATCH 01/43] Use locked/polkadot-v0.9.40 substrate and frontier deps --- Cargo.lock | 655 +++++++++++++++++++++++++++++------------------------ Cargo.toml | 176 +++++++------- 2 files changed, 445 insertions(+), 386 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6601e1070..c473eb9eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1476,7 +1476,7 @@ dependencies = [ "frame-support", "pallet-im-online", "sp-consensus-babe", - "sp-finality-grandpa", + "sp-consensus-grandpa", "sp-runtime", ] @@ -1486,7 +1486,7 @@ version = "0.1.0" dependencies = [ "anyhow", "bip32", - "hex-literal", + "hex-literal 0.4.1", "libsecp256k1", "sha3 0.10.6", "sp-core", @@ -2038,7 +2038,7 @@ version = "0.1.0" dependencies = [ "eip191-crypto", "hex", - "hex-literal", + "hex-literal 0.4.1", "primitives-ethereum", "sp-std", ] @@ -2049,14 +2049,14 @@ version = "0.1.0" dependencies = [ "eip712-common", "eip712-common-test-utils", - "hex-literal", + "hex-literal 0.4.1", ] [[package]] name = "eip712-common" version = "0.1.0" dependencies = [ - "hex-literal", + "hex-literal 0.4.1", "primitives-ethereum", "sp-core", "sp-core-hashing-proc-macro", @@ -2082,7 +2082,7 @@ version = "0.1.0" dependencies = [ "eip712-common", "eip712-common-test-utils", - "hex-literal", + "hex-literal 0.4.1", ] [[package]] @@ -2239,7 +2239,7 @@ checksum = "6a89fb87a9e103f71b903b80b670200b54cc67a07578f070681f1fffb7396fb7" dependencies = [ "bytes", "ethereum-types", - "hash-db", + "hash-db 0.15.2", "hash256-std-hasher", "parity-scale-codec", "rlp", @@ -2320,6 +2320,16 @@ dependencies = [ "sha3 0.10.6", ] +[[package]] +name = "evm" +version = "1.0.0-dev" +source = "git+https://github.com/rust-blockchain/evm?branch=master#53d082f0efeb4173a5bc4fc3f4a851a3b60fa149" +dependencies = [ + "evm-interpreter", + "primitive-types", + "sha3 0.10.6", +] + [[package]] name = "evm-core" version = "0.37.0" @@ -2344,6 +2354,19 @@ dependencies = [ "primitive-types", ] +[[package]] +name = "evm-interpreter" +version = "1.0.0-dev" +source = "git+https://github.com/rust-blockchain/evm?branch=master#53d082f0efeb4173a5bc4fc3f4a851a3b60fa149" +dependencies = [ + "parity-scale-codec", + "primitive-types", + "rlp", + "scale-info", + "serde", + "sha3 0.10.6", +] + [[package]] name = "evm-runtime" version = "0.37.0" @@ -2366,6 +2389,19 @@ dependencies = [ "futures", ] +[[package]] +name = "expander" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f360349150728553f92e4c997a16af8915f418d3a0f21b440d34c5632f16ed84" +dependencies = [ + "blake2", + "fs-err", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "facetec-api-client" version = "0.1.0" @@ -2405,7 +2441,7 @@ dependencies = [ [[package]] name = "fc-cli" version = "1.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "clap", "ethereum-types", @@ -2423,16 +2459,14 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "async-trait", - "fc-db", "fp-consensus", "fp-rpc", "sc-consensus", "sp-api", "sp-block-builder", - "sp-blockchain", "sp-consensus", "sp-runtime", "thiserror", @@ -2441,16 +2475,15 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ + "async-trait", "fp-storage", - "kvdb-rocksdb", "log", "parity-db", "parity-scale-codec", "parking_lot 0.12.1", "sc-client-db", - "smallvec", "sp-blockchain", "sp-core", "sp-database", @@ -2460,7 +2493,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "fc-db", "fc-storage", @@ -2481,11 +2514,11 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "ethereum", "ethereum-types", - "evm", + "evm 1.0.0-dev", "fc-db", "fc-mapping-sync", "fc-rpc-core", @@ -2508,11 +2541,13 @@ dependencies = [ "sc-client-api", "sc-network", "sc-network-common", + "sc-network-sync", "sc-rpc", "sc-service", "sc-transaction-pool", "sc-transaction-pool-api", "sc-utils", + "serde", "sp-api", "sp-block-builder", "sp-blockchain", @@ -2529,7 +2564,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "ethereum", "ethereum-types", @@ -2542,7 +2577,7 @@ dependencies = [ [[package]] name = "fc-storage" version = "1.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "ethereum", "ethereum-types", @@ -2692,7 +2727,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "parity-scale-codec", ] @@ -2709,7 +2744,7 @@ dependencies = [ [[package]] name = "fp-account" version = "1.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "hex", "impl-serde", @@ -2721,13 +2756,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", + "sp-runtime-interface", "sp-std", ] [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "ethereum", "parity-scale-codec", @@ -2739,7 +2775,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "ethereum", "ethereum-types", @@ -2753,9 +2789,9 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ - "evm", + "evm 1.0.0-dev", "frame-support", "parity-scale-codec", "serde", @@ -2767,7 +2803,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "ethereum", "ethereum-types", @@ -2784,7 +2820,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "frame-support", "parity-scale-codec", @@ -2796,7 +2832,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "parity-scale-codec", "serde", @@ -2811,7 +2847,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-support", "frame-support-procedural", @@ -2836,7 +2872,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "Inflector", "array-bytes", @@ -2883,7 +2919,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-support", "frame-system", @@ -2912,7 +2948,7 @@ dependencies = [ [[package]] name = "frame-remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "futures", "log", @@ -2928,9 +2964,10 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "bitflags", + "environmental", "frame-metadata", "frame-support-procedural", "impl-trait-for-tuples", @@ -2960,7 +2997,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "Inflector", "cfg-expr", @@ -2975,7 +3012,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2987,7 +3024,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "proc-macro2", "quote", @@ -2997,7 +3034,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-support", "log", @@ -3015,7 +3052,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-benchmarking", "frame-support", @@ -3030,7 +3067,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "parity-scale-codec", "sp-api", @@ -3039,7 +3076,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-support", "parity-scale-codec", @@ -3048,6 +3085,15 @@ dependencies = [ "sp-std", ] +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + [[package]] name = "fs2" version = "0.4.3" @@ -3058,6 +3104,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "fs4" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7672706608ecb74ab2e055c68327ffc25ae4cac1e12349204fd5fb0f3487cce2" +dependencies = [ + "rustix 0.37.11", + "windows-sys 0.48.0", +] + [[package]] name = "funty" version = "2.0.0" @@ -3366,6 +3422,12 @@ version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" +[[package]] +name = "hash-db" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" + [[package]] name = "hash256-std-hasher" version = "0.15.2" @@ -3454,6 +3516,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex-literal" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" + [[package]] name = "hex-literal" version = "0.4.1" @@ -3607,7 +3675,7 @@ dependencies = [ "frame-system-rpc-runtime-api", "futures", "hex", - "hex-literal", + "hex-literal 0.4.1", "humanode-rpc", "humanode-runtime", "indoc", @@ -3626,8 +3694,8 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-consensus-babe", + "sc-consensus-grandpa", "sc-executor", - "sc-finality-grandpa", "sc-service", "sc-telemetry", "sc-transaction-pool", @@ -3636,8 +3704,8 @@ dependencies = [ "sp-api", "sp-application-crypto", "sp-consensus-babe", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-inherents", "sp-io", "sp-keyring", @@ -3678,8 +3746,8 @@ dependencies = [ "sc-consensus-babe", "sc-consensus-babe-rpc", "sc-consensus-epochs", - "sc-finality-grandpa", - "sc-finality-grandpa-rpc", + "sc-consensus-grandpa", + "sc-consensus-grandpa-rpc", "sc-network", "sc-rpc", "sc-rpc-api", @@ -3724,7 +3792,7 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "hex", - "hex-literal", + "hex-literal 0.4.1", "keystore-bioauth-account-id", "libsecp256k1", "pallet-authorship", @@ -5077,15 +5145,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.8.0" @@ -5097,12 +5156,11 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0c7cba9ce19ac7ffd2053ac9f49843bbd3f4318feedfd74e85c19d5fb0ba66" +checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" dependencies = [ - "hash-db", - "hashbrown 0.12.3", + "hash-db 0.16.0", ] [[package]] @@ -5466,20 +5524,6 @@ dependencies = [ "memoffset 0.6.5", ] -[[package]] -name = "nix" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" -dependencies = [ - "bitflags", - "cfg-if", - "libc", - "memoffset 0.7.1", - "pin-utils", - "static_assertions", -] - [[package]] name = "nohash-hasher" version = "0.2.0" @@ -5813,7 +5857,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-support", "frame-system", @@ -5827,7 +5871,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-benchmarking", "frame-support", @@ -5866,7 +5910,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-benchmarking", "frame-support", @@ -5959,7 +6003,7 @@ dependencies = [ "fp-evm", "frame-support", "frame-system", - "hex-literal", + "hex-literal 0.4.1", "pallet-balances", "pallet-evm", "pallet-evm-balances", @@ -5986,11 +6030,11 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "ethereum", "ethereum-types", - "evm", + "evm 1.0.0-dev", "fp-consensus", "fp-ethereum", "fp-evm", @@ -6022,16 +6066,17 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "environmental", - "evm", + "evm 1.0.0-dev", "fp-account", "fp-evm", "frame-benchmarking", "frame-support", "frame-system", "hex", + "hex-literal 0.3.4", "impl-trait-for-tuples", "log", "parity-scale-codec", @@ -6061,7 +6106,7 @@ dependencies = [ [[package]] name = "pallet-evm-balances" version = "1.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "frame-support", "frame-system", @@ -6075,7 +6120,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "fp-evm", "num", @@ -6084,7 +6129,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "fp-evm", "tiny-keccak", @@ -6093,7 +6138,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "fp-evm", "ripemd", @@ -6103,7 +6148,7 @@ dependencies = [ [[package]] name = "pallet-evm-system" version = "1.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.39#a487de275b0bfa60f924fef5b3d6ba446fad1edd" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "fp-evm", "frame-support", @@ -6118,7 +6163,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6129,8 +6174,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-application-crypto", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-io", "sp-runtime", "sp-session", @@ -6156,7 +6201,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6176,7 +6221,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6192,7 +6237,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-support", "frame-system", @@ -6222,7 +6267,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-support", "frame-system", @@ -6243,7 +6288,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-support", "frame-system", @@ -6257,7 +6302,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6294,7 +6339,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-support", "frame-system", @@ -6310,7 +6355,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -6326,7 +6371,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -6338,7 +6383,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-benchmarking", "frame-support", @@ -6754,7 +6799,7 @@ dependencies = [ "fp-evm", "frame-support", "frame-system", - "hex-literal", + "hex-literal 0.4.1", "mockall", "num_enum 0.6.0", "pallet-balances", @@ -6776,7 +6821,7 @@ dependencies = [ "fp-evm", "frame-support", "frame-system", - "hex-literal", + "hex-literal 0.4.1", "mockall", "pallet-evm-accounts-mapping", "parity-scale-codec", @@ -6795,7 +6840,7 @@ dependencies = [ "fp-evm", "frame-support", "frame-system", - "hex-literal", + "hex-literal 0.4.1", "num_enum 0.6.0", "pallet-balances", "pallet-erc20-support", @@ -6813,11 +6858,11 @@ dependencies = [ name = "precompile-utils" version = "0.1.0" dependencies = [ - "evm", + "evm 0.37.0", "fp-evm", "frame-support", "frame-system", - "hex-literal", + "hex-literal 0.4.1", "impl-trait-for-tuples", "log", "num_enum 0.6.0", @@ -7546,7 +7591,7 @@ name = "robonode-crypto" version = "0.1.0" dependencies = [ "ed25519-dalek 2.0.0", - "hex-literal", + "hex-literal 0.4.1", "rand 0.8.5", ] @@ -7651,7 +7696,7 @@ dependencies = [ "log", "netlink-packet-route", "netlink-proto", - "nix 0.24.3", + "nix", "thiserror", "tokio", ] @@ -7834,7 +7879,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "log", "sp-core", @@ -7845,7 +7890,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "futures", "futures-timer", @@ -7868,7 +7913,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -7878,28 +7923,31 @@ dependencies = [ "sp-core", "sp-inherents", "sp-runtime", - "sp-state-machine", ] [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "memmap2", "sc-chain-spec-derive", - "sc-network-common", + "sc-client-api", + "sc-executor", + "sc-network", "sc-telemetry", "serde", "serde_json", + "sp-blockchain", "sp-core", "sp-runtime", + "sp-state-machine", ] [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7910,7 +7958,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "array-bytes", "chrono", @@ -7950,7 +7998,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "fnv", "futures", @@ -7976,9 +8024,9 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ - "hash-db", + "hash-db 0.16.0", "kvdb", "kvdb-memorydb", "kvdb-rocksdb", @@ -8002,7 +8050,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "async-trait", "futures", @@ -8027,7 +8075,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "async-trait", "fork-tree", @@ -8066,7 +8114,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "futures", "jsonrpsee", @@ -8088,20 +8136,80 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" +dependencies = [ + "fork-tree", + "parity-scale-codec", + "sc-client-api", + "sc-consensus", + "sp-blockchain", + "sp-runtime", +] + +[[package]] +name = "sc-consensus-grandpa" +version = "0.10.0-dev" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ + "ahash 0.8.3", + "array-bytes", + "async-trait", + "dyn-clone", + "finality-grandpa", "fork-tree", + "futures", + "futures-timer", + "log", "parity-scale-codec", + "parking_lot 0.12.1", + "rand 0.8.5", + "sc-block-builder", + "sc-chain-spec", "sc-client-api", "sc-consensus", + "sc-network", + "sc-network-common", + "sc-network-gossip", + "sc-telemetry", + "sc-utils", + "serde_json", + "sp-api", + "sp-application-crypto", + "sp-arithmetic", "sp-blockchain", + "sp-consensus", + "sp-consensus-grandpa", + "sp-core", + "sp-keystore", "sp-runtime", + "substrate-prometheus-endpoint", + "thiserror", +] + +[[package]] +name = "sc-consensus-grandpa-rpc" +version = "0.10.0-dev" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" +dependencies = [ + "finality-grandpa", + "futures", + "jsonrpsee", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-consensus-grandpa", + "sc-rpc", + "serde", + "sp-blockchain", + "sp-core", + "sp-runtime", + "thiserror", ] [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "async-trait", "futures", @@ -8124,7 +8232,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "lru", "parity-scale-codec", @@ -8148,7 +8256,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -8161,7 +8269,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "log", "sc-allocator", @@ -8174,7 +8282,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "anyhow", "cfg-if", @@ -8189,76 +8297,17 @@ dependencies = [ "wasmtime", ] -[[package]] -name = "sc-finality-grandpa" -version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" -dependencies = [ - "ahash 0.8.3", - "array-bytes", - "async-trait", - "dyn-clone", - "finality-grandpa", - "fork-tree", - "futures", - "futures-timer", - "log", - "parity-scale-codec", - "parking_lot 0.12.1", - "rand 0.8.5", - "sc-block-builder", - "sc-chain-spec", - "sc-client-api", - "sc-consensus", - "sc-network", - "sc-network-common", - "sc-network-gossip", - "sc-telemetry", - "sc-utils", - "serde_json", - "sp-api", - "sp-application-crypto", - "sp-arithmetic", - "sp-blockchain", - "sp-consensus", - "sp-core", - "sp-finality-grandpa", - "sp-keystore", - "sp-runtime", - "substrate-prometheus-endpoint", - "thiserror", -] - -[[package]] -name = "sc-finality-grandpa-rpc" -version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" -dependencies = [ - "finality-grandpa", - "futures", - "jsonrpsee", - "log", - "parity-scale-codec", - "sc-client-api", - "sc-finality-grandpa", - "sc-rpc", - "serde", - "sp-blockchain", - "sp-core", - "sp-runtime", - "thiserror", -] - [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "ansi_term", "futures", "futures-timer", "log", "sc-client-api", + "sc-network", "sc-network-common", "sp-blockchain", "sp-runtime", @@ -8267,7 +8316,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "array-bytes", "async-trait", @@ -8282,12 +8331,12 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "array-bytes", + "async-channel", "async-trait", "asynchronous-codec", - "backtrace", "bytes", "either", "fnv", @@ -8295,6 +8344,7 @@ dependencies = [ "futures-timer", "ip_network", "libp2p", + "linked_hash_set", "log", "lru", "mockall", @@ -8325,7 +8375,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "cid", "futures", @@ -8334,6 +8384,7 @@ dependencies = [ "prost", "prost-build", "sc-client-api", + "sc-network", "sc-network-common", "sp-blockchain", "sp-runtime", @@ -8344,33 +8395,35 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ + "array-bytes", "async-trait", "bitflags", "bytes", "futures", "futures-timer", "libp2p", - "linked_hash_set", "parity-scale-codec", "prost-build", "sc-consensus", "sc-peerset", + "sc-utils", "serde", "smallvec", "sp-blockchain", "sp-consensus", - "sp-finality-grandpa", + "sp-consensus-grandpa", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", + "zeroize", ] [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "ahash 0.8.3", "futures", @@ -8378,6 +8431,7 @@ dependencies = [ "libp2p", "log", "lru", + "sc-network", "sc-network-common", "sc-peerset", "sp-runtime", @@ -8388,7 +8442,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "array-bytes", "futures", @@ -8398,6 +8452,7 @@ dependencies = [ "prost", "prost-build", "sc-client-api", + "sc-network", "sc-network-common", "sc-peerset", "sp-blockchain", @@ -8409,12 +8464,13 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "array-bytes", "async-trait", "fork-tree", "futures", + "futures-timer", "libp2p", "log", "lru", @@ -8424,6 +8480,7 @@ dependencies = [ "prost-build", "sc-client-api", "sc-consensus", + "sc-network", "sc-network-common", "sc-peerset", "sc-utils", @@ -8431,8 +8488,8 @@ dependencies = [ "sp-arithmetic", "sp-blockchain", "sp-consensus", + "sp-consensus-grandpa", "sp-core", - "sp-finality-grandpa", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", @@ -8441,7 +8498,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "array-bytes", "futures", @@ -8449,6 +8506,7 @@ dependencies = [ "log", "parity-scale-codec", "pin-project", + "sc-network", "sc-network-common", "sc-peerset", "sc-utils", @@ -8460,7 +8518,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "array-bytes", "bytes", @@ -8476,6 +8534,7 @@ dependencies = [ "parking_lot 0.12.1", "rand 0.8.5", "sc-client-api", + "sc-network", "sc-network-common", "sc-peerset", "sc-utils", @@ -8490,7 +8549,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "futures", "libp2p", @@ -8503,7 +8562,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -8512,7 +8571,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "futures", "jsonrpsee", @@ -8542,7 +8601,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -8561,7 +8620,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "http", "jsonrpsee", @@ -8576,7 +8635,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "array-bytes", "futures", @@ -8602,7 +8661,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "async-trait", "directories", @@ -8668,7 +8727,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "log", "parity-scale-codec", @@ -8679,12 +8738,12 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "clap", + "fs4", "futures", "log", - "nix 0.26.2", "sc-client-db", "sc-utils", "sp-core", @@ -8695,7 +8754,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "futures", "libc", @@ -8714,7 +8773,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "chrono", "futures", @@ -8733,7 +8792,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "ansi_term", "atty", @@ -8764,7 +8823,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8775,7 +8834,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "async-trait", "futures", @@ -8802,7 +8861,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "async-trait", "futures", @@ -8816,15 +8875,16 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ - "backtrace", + "async-channel", "futures", "futures-timer", "lazy_static", "log", "parking_lot 0.12.1", "prometheus", + "sp-arithmetic", ] [[package]] @@ -9375,9 +9435,9 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ - "hash-db", + "hash-db 0.16.0", "log", "parity-scale-codec", "sp-api-proc-macro", @@ -9393,9 +9453,11 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ + "Inflector", "blake2", + "expander", "proc-macro-crate", "proc-macro2", "quote", @@ -9405,7 +9467,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "7.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "parity-scale-codec", "scale-info", @@ -9418,7 +9480,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "6.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "integer-sqrt", "num-traits", @@ -9432,7 +9494,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "parity-scale-codec", "sp-api", @@ -9444,7 +9506,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "futures", "log", @@ -9462,25 +9524,22 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "async-trait", "futures", "log", - "parity-scale-codec", "sp-core", "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std", - "sp-version", "thiserror", ] [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "async-trait", "parity-scale-codec", @@ -9498,7 +9557,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "async-trait", "merlin", @@ -9518,10 +9577,28 @@ dependencies = [ "sp-timestamp", ] +[[package]] +name = "sp-consensus-grandpa" +version = "4.0.0-dev" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" +dependencies = [ + "finality-grandpa", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-api", + "sp-application-crypto", + "sp-core", + "sp-keystore", + "sp-runtime", + "sp-std", +] + [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "parity-scale-codec", "scale-info", @@ -9533,7 +9610,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "parity-scale-codec", "scale-info", @@ -9546,7 +9623,7 @@ dependencies = [ [[package]] name = "sp-core" version = "7.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "array-bytes", "base58", @@ -9556,7 +9633,7 @@ dependencies = [ "dyn-clonable", "ed25519-zebra", "futures", - "hash-db", + "hash-db 0.16.0", "hash256-std-hasher", "impl-serde", "lazy_static", @@ -9589,9 +9666,9 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "5.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ - "blake2", + "blake2b_simd", "byteorder", "digest 0.10.6", "sha2 0.10.6", @@ -9603,7 +9680,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "proc-macro2", "quote", @@ -9614,7 +9691,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -9623,7 +9700,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "5.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "proc-macro2", "quote", @@ -9633,7 +9710,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.13.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "environmental", "parity-scale-codec", @@ -9641,28 +9718,10 @@ dependencies = [ "sp-storage", ] -[[package]] -name = "sp-finality-grandpa" -version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" -dependencies = [ - "finality-grandpa", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-api", - "sp-application-crypto", - "sp-core", - "sp-keystore", - "sp-runtime", - "sp-std", -] - [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -9677,7 +9736,7 @@ dependencies = [ [[package]] name = "sp-io" version = "7.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "bytes", "ed25519 1.5.3", @@ -9702,7 +9761,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "7.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "lazy_static", "sp-core", @@ -9713,7 +9772,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.13.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "async-trait", "futures", @@ -9730,7 +9789,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "thiserror", "zstd", @@ -9739,7 +9798,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "sp-api", "sp-core", @@ -9749,7 +9808,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "5.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "backtrace", "lazy_static", @@ -9759,7 +9818,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "rustc-hash", "serde", @@ -9769,7 +9828,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "7.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "either", "hash256-std-hasher", @@ -9791,7 +9850,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "7.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -9809,7 +9868,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "6.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "Inflector", "proc-macro-crate", @@ -9821,7 +9880,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "parity-scale-codec", "scale-info", @@ -9835,7 +9894,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "parity-scale-codec", "scale-info", @@ -9847,9 +9906,9 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.13.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ - "hash-db", + "hash-db 0.16.0", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -9867,12 +9926,12 @@ dependencies = [ [[package]] name = "sp-std" version = "5.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" [[package]] name = "sp-storage" version = "7.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9885,7 +9944,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "async-trait", "futures-timer", @@ -9900,7 +9959,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "6.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "parity-scale-codec", "sp-std", @@ -9912,7 +9971,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "sp-api", "sp-runtime", @@ -9921,7 +9980,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "async-trait", "log", @@ -9937,10 +9996,10 @@ dependencies = [ [[package]] name = "sp-trie" version = "7.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "ahash 0.8.3", - "hash-db", + "hash-db 0.16.0", "hashbrown 0.12.3", "lazy_static", "memory-db", @@ -9960,7 +10019,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9977,7 +10036,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -9988,7 +10047,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "7.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -10002,7 +10061,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "parity-scale-codec", "scale-info", @@ -10164,7 +10223,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -10183,7 +10242,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "hyper", "log", @@ -10195,7 +10254,7 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "async-trait", "jsonrpsee", @@ -10208,7 +10267,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "ansi_term", "build-helper", @@ -10749,11 +10808,11 @@ dependencies = [ [[package]] name = "trie-db" -version = "0.25.1" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3390c0409daaa6027d6681393316f4ccd3ff82e1590a1e4725014e3ae2bf1920" +checksum = "767abe6ffed88a1889671a102c2861ae742726f52e0a5a425b92c9fbfa7e9c85" dependencies = [ - "hash-db", + "hash-db 0.16.0", "hashbrown 0.13.2", "log", "rustc-hex", @@ -10762,11 +10821,11 @@ dependencies = [ [[package]] name = "trie-root" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a36c5ca3911ed3c9a5416ee6c679042064b93fc637ded67e25f92e68d783891" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" dependencies = [ - "hash-db", + "hash-db 0.16.0", ] [[package]] @@ -10775,7 +10834,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" dependencies = [ - "hash-db", + "hash-db 0.15.2", "rlp", ] @@ -10834,7 +10893,7 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.39#5b23f49147d482eadf96a1bb95924e8b661a931a" +source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ "async-trait", "clap", @@ -11808,7 +11867,7 @@ dependencies = [ "lazy_static", "libc", "log", - "nix 0.24.3", + "nix", "rand 0.8.5", "thiserror", "tokio", diff --git a/Cargo.toml b/Cargo.toml index 4f500734b..10f9f5bec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,96 +66,96 @@ wiremock = { version = "0.5", default-features = false } codec = { package = "parity-scale-codec", version = "3.2.2", default-features = false } # Substrate fork. -frame-benchmarking = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -frame-benchmarking-cli = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -frame-executive = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -frame-support = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -frame-system = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -frame-system-benchmarking = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -frame-system-rpc-runtime-api = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -frame-try-runtime = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-authorship = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-babe = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-balances = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-grandpa = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-im-online = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-multisig = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-offences = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-session = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-sudo = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-timestamp = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-transaction-payment = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-transaction-payment-rpc = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-utility = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-basic-authorship = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-chain-spec = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-chain-spec-derive = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-cli = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-client-api = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-consensus = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-consensus-babe = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-consensus-babe-rpc = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-consensus-epochs = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-executor = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-finality-grandpa = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-finality-grandpa-rpc = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-network = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-rpc = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-rpc-api = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-rpc-spec-v2 = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-service = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-telemetry = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-tracing = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-transaction-pool = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-transaction-pool-api = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sc-utils = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-api = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-application-crypto = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-block-builder = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-blockchain = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-consensus = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-consensus-babe = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-core = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-core-hashing-proc-macro = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-finality-grandpa = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-inherents = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-io = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-keyring = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-keystore = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-offchain = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-panic-handler = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-runtime = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-session = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-staking = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-std = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-timestamp = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-tracing = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-transaction-pool = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -sp-version = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -substrate-frame-rpc-system = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -substrate-wasm-builder = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } -try-runtime-cli = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.39", default-features = false } +frame-benchmarking = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +frame-benchmarking-cli = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +frame-executive = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +frame-support = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +frame-system = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +frame-system-benchmarking = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +frame-try-runtime = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-authorship = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-babe = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-balances = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-grandpa = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-im-online = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-multisig = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-offences = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-session = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-sudo = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-timestamp = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-transaction-payment = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-transaction-payment-rpc = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-utility = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-basic-authorship = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-chain-spec = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-chain-spec-derive = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-cli = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-client-api = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-consensus = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-consensus-babe = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-consensus-babe-rpc = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-consensus-epochs = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-executor = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-finality-grandpa = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-finality-grandpa-rpc = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-network = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-rpc = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-rpc-api = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-rpc-spec-v2 = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-service = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-telemetry = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-tracing = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-transaction-pool = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-transaction-pool-api = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-utils = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-api = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-application-crypto = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-block-builder = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-blockchain = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-consensus = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-consensus-babe = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-core = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-core-hashing-proc-macro = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-finality-grandpa = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-inherents = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-io = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-keyring = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-keystore = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-offchain = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-panic-handler = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-runtime = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-session = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-staking = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-std = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-timestamp = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-tracing = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-transaction-pool = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-version = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +substrate-frame-rpc-system = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +substrate-wasm-builder = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +try-runtime-cli = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } # Frontier fork. -fc-cli = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -fc-consensus = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -fc-db = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -fc-mapping-sync = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -fc-rpc = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -fc-rpc-core = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -fc-storage = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -fp-evm = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -fp-rpc = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -fp-self-contained = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -fp-storage = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-ethereum = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-evm = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-evm-balances = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-evm-precompile-modexp = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-evm-precompile-sha3fips = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-evm-precompile-simple = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } -pallet-evm-system = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.39", default-features = false } +fc-cli = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +fc-consensus = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +fc-db = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +fc-mapping-sync = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +fc-rpc = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +fc-rpc-core = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +fc-storage = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +fp-evm = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +fp-rpc = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +fp-self-contained = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +fp-storage = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-ethereum = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-evm = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-evm-balances = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-evm-precompile-modexp = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-evm-precompile-sha3fips = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-evm-precompile-simple = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } +pallet-evm-system = { git = "https://github.com/humanode-network/frontier", branch = "locked/polkadot-v0.9.40", default-features = false } [profile.release-lto] inherits = "release" From 7c93f7c799ef54e4f1ec4af12ea0d29301ac11b9 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Thu, 30 Nov 2023 18:23:17 +0300 Subject: [PATCH 02/43] [substrate-apply] Move grandpa crates to consensus folder #13458 --- Cargo.toml | 6 ++--- crates/crypto-utils/Cargo.toml | 2 +- crates/crypto-utils/src/lib.rs | 2 +- crates/humanode-peer/Cargo.toml | 4 ++-- crates/humanode-peer/src/chain_spec.rs | 2 +- crates/humanode-peer/src/cli/run.rs | 2 +- crates/humanode-peer/src/service/mod.rs | 30 ++++++++++++------------- crates/humanode-rpc/Cargo.toml | 4 ++-- crates/humanode-rpc/src/lib.rs | 12 +++++----- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 10f9f5bec..a05c54786 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,9 +97,9 @@ sc-consensus = { git = "https://github.com/humanode-network/substrate", branch = sc-consensus-babe = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sc-consensus-babe-rpc = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sc-consensus-epochs = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-consensus-grandpa = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-consensus-grandpa-rpc = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sc-executor = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } -sc-finality-grandpa = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } -sc-finality-grandpa-rpc = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sc-network = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sc-rpc = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sc-rpc-api = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } @@ -116,9 +116,9 @@ sp-block-builder = { git = "https://github.com/humanode-network/substrate", bran sp-blockchain = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sp-consensus = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sp-consensus-babe = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sp-consensus-grandpa = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sp-core = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sp-core-hashing-proc-macro = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } -sp-finality-grandpa = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sp-inherents = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sp-io = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sp-keyring = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } diff --git a/crates/crypto-utils/Cargo.toml b/crates/crypto-utils/Cargo.toml index d29c98799..c93c9a3aa 100644 --- a/crates/crypto-utils/Cargo.toml +++ b/crates/crypto-utils/Cargo.toml @@ -8,5 +8,5 @@ publish = false frame-support = { workspace = true } pallet-im-online = { workspace = true } sp-consensus-babe = { workspace = true } -sp-finality-grandpa = { workspace = true } +sp-consensus-grandpa = { workspace = true } sp-runtime = { workspace = true } diff --git a/crates/crypto-utils/src/lib.rs b/crates/crypto-utils/src/lib.rs index 5f34a8564..e377aa395 100644 --- a/crates/crypto-utils/src/lib.rs +++ b/crates/crypto-utils/src/lib.rs @@ -2,7 +2,7 @@ use pallet_im_online::sr25519::AuthorityId as ImOnlineId; use sp_consensus_babe::AuthorityId as BabeId; -use sp_finality_grandpa::AuthorityId as GrandpaId; +use sp_consensus_grandpa::AuthorityId as GrandpaId; use sp_runtime::{ app_crypto::{Pair, Public}, traits::IdentifyAccount, diff --git a/crates/humanode-peer/Cargo.toml b/crates/humanode-peer/Cargo.toml index 2c213b6c4..59af02749 100644 --- a/crates/humanode-peer/Cargo.toml +++ b/crates/humanode-peer/Cargo.toml @@ -53,8 +53,8 @@ sc-cli = { workspace = true } sc-client-api = { workspace = true } sc-consensus = { workspace = true } sc-consensus-babe = { workspace = true } +sc-consensus-grandpa = { workspace = true } sc-executor = { workspace = true } -sc-finality-grandpa = { workspace = true } sc-service = { workspace = true } sc-telemetry = { workspace = true } sc-transaction-pool = { workspace = true } @@ -63,8 +63,8 @@ serde_json = { workspace = true } sp-api = { workspace = true } sp-application-crypto = { workspace = true } sp-consensus-babe = { workspace = true } +sp-consensus-grandpa = { workspace = true } sp-core = { workspace = true } -sp-finality-grandpa = { workspace = true } sp-inherents = { workspace = true } sp-io = { workspace = true } sp-keyring = { workspace = true } diff --git a/crates/humanode-peer/src/chain_spec.rs b/crates/humanode-peer/src/chain_spec.rs index bc47b1b2d..4a8b79c9a 100644 --- a/crates/humanode-peer/src/chain_spec.rs +++ b/crates/humanode-peer/src/chain_spec.rs @@ -15,7 +15,7 @@ use sc_chain_spec_derive::{ChainSpecExtension, ChainSpecGroup}; use sc_service::ChainType; use serde::{Deserialize, Serialize}; use sp_consensus_babe::AuthorityId as BabeId; -use sp_finality_grandpa::AuthorityId as GrandpaId; +use sp_consensus_grandpa::AuthorityId as GrandpaId; use sp_runtime::{app_crypto::sr25519, traits::Verify}; /// The concrete chain spec type we're using for the humanode network. diff --git a/crates/humanode-peer/src/cli/run.rs b/crates/humanode-peer/src/cli/run.rs index dbef7a99d..a9d5dd685 100644 --- a/crates/humanode-peer/src/cli/run.rs +++ b/crates/humanode-peer/src/cli/run.rs @@ -100,7 +100,7 @@ pub async fn run() -> sc_cli::Result<()> { } = service::new_partial(&config)?; let aux_revert = Box::new(|client, backend, blocks| { sc_consensus_babe::revert(Arc::clone(&client), backend, blocks)?; - sc_finality_grandpa::revert(client, blocks)?; + sc_consensus_grandpa::revert(client, blocks)?; Ok(()) }); Ok((cmd.run(client, backend, Some(aux_revert)), task_manager)) diff --git a/crates/humanode-peer/src/service/mod.rs b/crates/humanode-peer/src/service/mod.rs index bd859e044..274ebaee3 100644 --- a/crates/humanode-peer/src/service/mod.rs +++ b/crates/humanode-peer/src/service/mod.rs @@ -16,7 +16,7 @@ use humanode_runtime::{self, opaque::Block, RuntimeApi}; use sc_client_api::{BlockBackend, BlockchainEvents}; use sc_consensus_babe::SlotProportion; pub use sc_executor::NativeElseWasmExecutor; -use sc_finality_grandpa::SharedVoterState; +use sc_consensus_grandpa::SharedVoterState; use sc_service::{ Error as ServiceError, KeystoreContainer, PartialComponents, TaskManager, WarpSyncParams, }; @@ -61,7 +61,7 @@ type FullBackend = sc_service::TFullBackend; type FullSelectChain = sc_consensus::LongestChain; /// Full type for `GrandpaBlockImport`. type FullGrandpa = - sc_finality_grandpa::GrandpaBlockImport; + sc_consensus_grandpa::GrandpaBlockImport; /// Full type for `BabeBlockImport`. type FullBabe = sc_consensus_babe::BabeBlockImport; /// Full type for `FrontierBlockImport`. @@ -98,7 +98,7 @@ pub fn new_partial( sc_consensus::DefaultImportQueue, sc_transaction_pool::FullPool, ( - sc_finality_grandpa::LinkHalf, + sc_consensus_grandpa::LinkHalf, sc_consensus_babe::BabeLink, EffectiveFullBlockImport, inherents::Creator, @@ -157,7 +157,7 @@ pub fn new_partial( let select_chain = sc_consensus::LongestChain::new(Arc::clone(&backend)); - let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import( + let (grandpa_block_import, grandpa_link) = sc_consensus_grandpa::block_import( Arc::clone(&client), &(Arc::clone(&client) as Arc<_>), select_chain.clone(), @@ -246,7 +246,7 @@ pub async fn new_full(config: Configuration) -> Result Result Result Result Result Result Result { pub grandpa_shared_authority_set: SharedAuthoritySet, /// Receives notifications about justification events from Grandpa. pub grandpa_justification_stream: GrandpaJustificationStream, - /// Finality proof provider. - pub grandpa_finality_provider: Arc>, + /// consensus proof provider. + pub grandpa_consensus_provider: Arc>, } /// Extra EVM related dependencies. @@ -222,7 +222,7 @@ where grandpa_shared_voter_state, grandpa_shared_authority_set, grandpa_justification_stream, - grandpa_finality_provider, + grandpa_consensus_provider, } = grandpa; let EvmDeps { @@ -270,7 +270,7 @@ where grandpa_shared_authority_set, grandpa_shared_voter_state, grandpa_justification_stream, - grandpa_finality_provider, + grandpa_consensus_provider, ) .into_rpc(), )?; From 6502f4dd2be256619ca9652dbed49f971564252d Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Thu, 30 Nov 2023 19:47:12 +0300 Subject: [PATCH 03/43] Use suitable evm version --- Cargo.lock | 53 +++++++++++++---------------------------------------- Cargo.toml | 2 +- 2 files changed, 14 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c473eb9eb..44e009a2d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2301,9 +2301,8 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "evm" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4448c65b71e8e2b9718232d84d09045eeaaccb2320494e6bd6dbf7e58fec8ff" +version = "0.39.1" +source = "git+https://github.com/rust-blockchain/evm?branch=master#b7b82c7e1fc57b7449d6dfa6826600de37cc1e65" dependencies = [ "auto_impl", "environmental", @@ -2320,21 +2319,10 @@ dependencies = [ "sha3 0.10.6", ] -[[package]] -name = "evm" -version = "1.0.0-dev" -source = "git+https://github.com/rust-blockchain/evm?branch=master#53d082f0efeb4173a5bc4fc3f4a851a3b60fa149" -dependencies = [ - "evm-interpreter", - "primitive-types", - "sha3 0.10.6", -] - [[package]] name = "evm-core" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c51bec0eb68a891c2575c758eaaa1d61373fc51f7caaf216b1fb5c3fea3b5d" +version = "0.39.0" +source = "git+https://github.com/rust-blockchain/evm?branch=master#b7b82c7e1fc57b7449d6dfa6826600de37cc1e65" dependencies = [ "parity-scale-codec", "primitive-types", @@ -2344,9 +2332,8 @@ dependencies = [ [[package]] name = "evm-gasometer" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8b93c59c54fc26522d842f0e0d3f8e8be331c776df18ff3e540b53c2f64d509" +version = "0.39.0" +source = "git+https://github.com/rust-blockchain/evm?branch=master#b7b82c7e1fc57b7449d6dfa6826600de37cc1e65" dependencies = [ "environmental", "evm-core", @@ -2354,24 +2341,10 @@ dependencies = [ "primitive-types", ] -[[package]] -name = "evm-interpreter" -version = "1.0.0-dev" -source = "git+https://github.com/rust-blockchain/evm?branch=master#53d082f0efeb4173a5bc4fc3f4a851a3b60fa149" -dependencies = [ - "parity-scale-codec", - "primitive-types", - "rlp", - "scale-info", - "serde", - "sha3 0.10.6", -] - [[package]] name = "evm-runtime" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79b9459ce64f1a28688397c4013764ce53cd57bb84efc16b5187fa9b05b13ad" +version = "0.39.0" +source = "git+https://github.com/rust-blockchain/evm?branch=master#b7b82c7e1fc57b7449d6dfa6826600de37cc1e65" dependencies = [ "auto_impl", "environmental", @@ -2518,7 +2491,7 @@ source = "git+https://github.com/humanode-network/frontier?branch=locked/polkado dependencies = [ "ethereum", "ethereum-types", - "evm 1.0.0-dev", + "evm", "fc-db", "fc-mapping-sync", "fc-rpc-core", @@ -2791,7 +2764,7 @@ name = "fp-evm" version = "3.0.0-dev" source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ - "evm 1.0.0-dev", + "evm", "frame-support", "parity-scale-codec", "serde", @@ -6034,7 +6007,7 @@ source = "git+https://github.com/humanode-network/frontier?branch=locked/polkado dependencies = [ "ethereum", "ethereum-types", - "evm 1.0.0-dev", + "evm", "fp-consensus", "fp-ethereum", "fp-evm", @@ -6069,7 +6042,7 @@ version = "6.0.0-dev" source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "environmental", - "evm 1.0.0-dev", + "evm", "fp-account", "fp-evm", "frame-benchmarking", @@ -6858,7 +6831,7 @@ dependencies = [ name = "precompile-utils" version = "0.1.0" dependencies = [ - "evm 0.37.0", + "evm", "fp-evm", "frame-support", "frame-system", diff --git a/Cargo.toml b/Cargo.toml index a05c54786..282ea5cb5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ clap = { version = "4", default-features = false } ed25519-dalek = { version = "2", default-features = false } ethereum = { version = "0.14", default-features = false } ethers-core = { version = "2.0.3", default-features = false } -evm = { version = "0.37", default-features = false } +evm = { git = "https://github.com/rust-blockchain/evm", branch = "master", default-features = false } fdlimit = { version = "0.2", default-features = false } futures = { version = "0.3", default-features = false } getrandom = { version = "0.2", default-features = false } From 83d879bde250c90b26fdedb4cdb9c51552bca7a0 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Thu, 30 Nov 2023 19:54:04 +0300 Subject: [PATCH 04/43] Fix naming --- crates/humanode-peer/src/service/mod.rs | 8 ++++---- crates/humanode-rpc/src/lib.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/humanode-peer/src/service/mod.rs b/crates/humanode-peer/src/service/mod.rs index 274ebaee3..1485610c6 100644 --- a/crates/humanode-peer/src/service/mod.rs +++ b/crates/humanode-peer/src/service/mod.rs @@ -15,8 +15,8 @@ use futures::StreamExt; use humanode_runtime::{self, opaque::Block, RuntimeApi}; use sc_client_api::{BlockBackend, BlockchainEvents}; use sc_consensus_babe::SlotProportion; -pub use sc_executor::NativeElseWasmExecutor; use sc_consensus_grandpa::SharedVoterState; +pub use sc_executor::NativeElseWasmExecutor; use sc_service::{ Error as ServiceError, KeystoreContainer, PartialComponents, TaskManager, WarpSyncParams, }; @@ -349,8 +349,8 @@ pub async fn new_full(config: Configuration) -> Result Result { pub grandpa_shared_authority_set: SharedAuthoritySet, /// Receives notifications about justification events from Grandpa. pub grandpa_justification_stream: GrandpaJustificationStream, - /// consensus proof provider. - pub grandpa_consensus_provider: Arc>, + /// Finality proof provider. + pub grandpa_finality_provider: Arc>, } /// Extra EVM related dependencies. @@ -222,7 +222,7 @@ where grandpa_shared_voter_state, grandpa_shared_authority_set, grandpa_justification_stream, - grandpa_consensus_provider, + grandpa_finality_provider, } = grandpa; let EvmDeps { @@ -270,7 +270,7 @@ where grandpa_shared_authority_set, grandpa_shared_voter_state, grandpa_justification_stream, - grandpa_consensus_provider, + grandpa_finality_provider, ) .into_rpc(), )?; From b82fdcacca1fea2fca0761a0f29e792458ec44a1 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Fri, 1 Dec 2023 18:07:35 +0300 Subject: [PATCH 05/43] [frontier-apply] EVM + Weight v2 support #1039 --- .../src/frontier_precompiles.rs | 11 ++- crates/precompile-utils/src/precompile_set.rs | 76 +++++++++++++------ crates/precompile-utils/src/testing.rs | 10 +++ 3 files changed, 72 insertions(+), 25 deletions(-) diff --git a/crates/humanode-runtime/src/frontier_precompiles.rs b/crates/humanode-runtime/src/frontier_precompiles.rs index c1b820853..b9676adbd 100644 --- a/crates/humanode-runtime/src/frontier_precompiles.rs +++ b/crates/humanode-runtime/src/frontier_precompiles.rs @@ -1,5 +1,7 @@ use frame_support::traits::Currency; -use pallet_evm::{Precompile, PrecompileHandle, PrecompileResult, PrecompileSet}; +use pallet_evm::{ + IsPrecompileResult, Precompile, PrecompileHandle, PrecompileResult, PrecompileSet, +}; use pallet_evm_precompile_modexp::Modexp; use pallet_evm_precompile_sha3fips::Sha3FIPS256; use pallet_evm_precompile_simple::{ECRecover, ECRecoverPublicKey, Identity, Ripemd160, Sha256}; @@ -120,8 +122,11 @@ where } } - fn is_precompile(&self, address: H160) -> bool { - Self::used_addresses().contains(&address) + fn is_precompile(&self, address: H160, _gas: u64) -> bool { + IsPrecompileResult::Answer { + is_precompile: Self::used_addresses().contains(&address), + extra_cost: 0, + } } } diff --git a/crates/precompile-utils/src/precompile_set.rs b/crates/precompile-utils/src/precompile_set.rs index 0d9cc9fbc..0952f3255 100644 --- a/crates/precompile-utils/src/precompile_set.rs +++ b/crates/precompile-utils/src/precompile_set.rs @@ -2,7 +2,7 @@ //! final precompile set with security checks. All security checks are enabled by //! default and must be disabled explicely throught type annotations. -use fp_evm::{Precompile, PrecompileHandle, PrecompileResult, PrecompileSet}; +use fp_evm::{IsPrecompileResult, Precompile, PrecompileHandle, PrecompileResult, PrecompileSet}; use frame_support::pallet_prelude::Get; use impl_trait_for_tuples::impl_for_tuples; use pallet_evm::AddressMapping; @@ -99,7 +99,7 @@ pub trait PrecompileSetFragment { fn execute(&self, handle: &mut impl PrecompileHandle) -> Option; /// Is the provided address a precompile in this fragment? - fn is_precompile(&self, address: H160) -> bool; + fn is_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult; /// Return the list of addresses covered by this fragment. fn used_addresses(&self) -> Vec; @@ -186,8 +186,11 @@ where } #[inline(always)] - fn is_precompile(&self, address: H160) -> bool { - address == A::get() + fn is_precompile(&self, address: H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: address == A::get(), + extra_cost: 0, + } } #[inline(always)] @@ -279,8 +282,11 @@ where } #[inline(always)] - fn is_precompile(&self, address: H160) -> bool { - address == A::get() + fn is_precompile(&self, address: H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: address == A::get(), + extra_cost: 0, + } } #[inline(always)] @@ -320,8 +326,13 @@ where fn execute(&self, handle: &mut impl PrecompileHandle) -> Option { let code_address = handle.code_address(); - if !self.is_precompile(code_address) { - return None; + match self.is_precompile(code_address, handle.remaining_gas()) { + IsPrecompileResult::Answer { is_precompile, .. } => { + if !is_precompile { + return None; + } + } + IsPrecompileResult::OutOfGas => return None, } // Check DELEGATECALL config. @@ -378,8 +389,14 @@ where } #[inline(always)] - fn is_precompile(&self, address: H160) -> bool { - address.as_bytes().starts_with(A::get()) && self.precompile_set.is_precompile(address) + fn is_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult { + if address.as_bytes().starts_with(A::get()) { + return self.precompile_set.is_precompile(address, gas); + } + IsPrecompileResult::Answer { + is_precompile: false, + extra_cost: 0, + } } #[inline(always)] @@ -412,8 +429,11 @@ where } #[inline(always)] - fn is_precompile(&self, address: H160) -> bool { - address == A::get() + fn is_precompile(&self, address: H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: address == A::get(), + extra_cost: 0, + } } #[inline(always)] @@ -444,14 +464,23 @@ impl PrecompileSetFragment for Tuple { } #[inline(always)] - fn is_precompile(&self, address: H160) -> bool { + fn is_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult { for_tuples!(#( - if self.Tuple.is_precompile(address) { - return true; - } + if let IsPrecompileResult::Answer { + is_precompile: true, + .. + } = self.Tuple.is_precompile(address, gas) { + return IsPrecompileResult::Answer { + is_precompile: true, + extra_cost: 0, + } + } )*); - false + IsPrecompileResult::Answer { + is_precompile: false, + extra_cost: 0, + } } #[inline(always)] @@ -497,11 +526,14 @@ where } } - fn is_precompile(&self, address: H160) -> bool { + fn is_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult { if self.range.contains(&address) { - self.inner.is_precompile(address) + self.inner.is_precompile(address, gas) } else { - false + IsPrecompileResult::Answer { + is_precompile: false, + extra_cost: 0, + } } } @@ -521,8 +553,8 @@ impl PrecompileSet for PrecompileSetBuilder { self.inner.execute(handle) } - fn is_precompile(&self, address: H160) -> bool { - self.inner.is_precompile(address) + fn is_precompile(&self, address: H160, gas: u64) -> IsPrecompileResult { + self.inner.is_precompile(address, gas) } } diff --git a/crates/precompile-utils/src/testing.rs b/crates/precompile-utils/src/testing.rs index e091b5c4f..705411304 100644 --- a/crates/precompile-utils/src/testing.rs +++ b/crates/precompile-utils/src/testing.rs @@ -172,6 +172,16 @@ impl PrecompileHandle for MockHandle { fn gas_limit(&self) -> Option { Some(self.gas_limit) } + + fn record_external_cost( + &mut self, + _ref_time: Option, + _proof_size: Option, + ) -> Result<(), ExitError> { + Ok(()) + } + + fn refund_external_cost(&mut self, _ref_time: Option, _proof_size: Option) {} } pub struct PrecompilesTester<'p, P> { From 03778fc1f9eef58816c9c9b2a74b03e74812fdc8 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Fri, 1 Dec 2023 18:36:01 +0300 Subject: [PATCH 06/43] [substrate-apply] Deprecate Weight::from_{ref_time, proof_size} #13475 --- crates/humanode-runtime/src/lib.rs | 4 ++-- .../src/tests/claims_and_vesting.rs | 2 +- .../src/tests/fixed_supply.rs | 2 +- .../src/weights/frame_system.rs | 12 +++++----- .../src/weights/pallet_balances.rs | 14 +++++------ .../src/weights/pallet_bioauth.rs | 8 +++---- .../weights/pallet_evm_accounts_mapping.rs | 2 +- .../src/weights/pallet_im_online.rs | 6 ++--- .../src/weights/pallet_multisig.rs | 24 +++++++++---------- .../src/weights/pallet_timestamp.rs | 4 ++-- .../src/weights/pallet_token_claims.rs | 8 +++---- .../src/weights/pallet_utility.rs | 10 ++++---- .../src/weights/pallet_vesting.rs | 4 ++-- .../src/mock/v0.rs | 4 ++-- .../src/mock/v1.rs | 4 ++-- crates/pallet-token-claims/src/tests.rs | 6 ++--- crates/precompile-currency-swap/src/mock.rs | 4 ++-- crates/precompile-native-currency/src/mock.rs | 4 ++-- crates/precompile-utils/src/lib.rs | 6 +++-- utils/weights/assets/template.hbs | 12 ++++++---- 20 files changed, 72 insertions(+), 68 deletions(-) diff --git a/crates/humanode-runtime/src/lib.rs b/crates/humanode-runtime/src/lib.rs index 264b832ab..fd41e6db5 100644 --- a/crates/humanode-runtime/src/lib.rs +++ b/crates/humanode-runtime/src/lib.rs @@ -639,11 +639,11 @@ const_assert!(WEIGHT_MILLISECS_PER_BLOCK == 2000u64); parameter_types! { pub BlockGasLimit: U256 = U256::from(constants::evm_fees::BLOCK_GAS_LIMIT); pub PrecompilesValue: FrontierPrecompiles = FrontierPrecompiles::<_>::default(); - pub WeightPerGas: Weight = Weight::from_ref_time(fp_evm::weight_per_gas( + pub WeightPerGas: Weight = Weight::from_parts(fp_evm::weight_per_gas( constants::evm_fees::BLOCK_GAS_LIMIT, NORMAL_DISPATCH_RATIO, WEIGHT_MILLISECS_PER_BLOCK, - )); + ), 0); } impl pallet_evm_system::Config for Runtime { diff --git a/crates/humanode-runtime/src/tests/claims_and_vesting.rs b/crates/humanode-runtime/src/tests/claims_and_vesting.rs index e64837514..2f5101518 100644 --- a/crates/humanode-runtime/src/tests/claims_and_vesting.rs +++ b/crates/humanode-runtime/src/tests/claims_and_vesting.rs @@ -88,7 +88,7 @@ fn prepare_applyable_data( ); let normal_dispatch_info = DispatchInfo { - weight: Weight::from_ref_time(100), + weight: Weight::from_parts(100, 0), class: DispatchClass::Normal, pays_fee: Pays::No, }; diff --git a/crates/humanode-runtime/src/tests/fixed_supply.rs b/crates/humanode-runtime/src/tests/fixed_supply.rs index d29ab4c83..f198f2e75 100644 --- a/crates/humanode-runtime/src/tests/fixed_supply.rs +++ b/crates/humanode-runtime/src/tests/fixed_supply.rs @@ -209,7 +209,7 @@ fn total_issuance_transaction_payment_validate() { } .into(); let normal = DispatchInfo { - weight: Weight::from_ref_time(10), + weight: Weight::from_parts(10, 0), class: DispatchClass::Normal, pays_fee: Pays::Yes, }; diff --git a/crates/humanode-runtime/src/weights/frame_system.rs b/crates/humanode-runtime/src/weights/frame_system.rs index 61a3985c7..b4564aa9e 100644 --- a/crates/humanode-runtime/src/weights/frame_system.rs +++ b/crates/humanode-runtime/src/weights/frame_system.rs @@ -14,35 +14,35 @@ impl frame_system::WeightInfo for WeightInfo { /// The range of component `b` is `[0, 3932160]`. fn remark(_b: u32, ) -> Weight { // Minimum execution time: 3_000 nanoseconds. - Weight::from_ref_time(336_000_000) + Weight::from_parts(336_000_000, 0) } /// The range of component `b` is `[0, 3932160]`. fn remark_with_event(_b: u32, ) -> Weight { // Minimum execution time: 12_000 nanoseconds. - Weight::from_ref_time(4_281_000_000) + Weight::from_parts(4_281_000_000, 0) } fn set_heap_pages() -> Weight { // Minimum execution time: 8_000 nanoseconds. - Weight::from_ref_time(8_000_000) + Weight::from_parts(8_000_000, 0) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(2)) } /// The range of component `i` is `[0, 1000]`. fn set_storage(_i: u32, ) -> Weight { // Minimum execution time: 4_000 nanoseconds. - Weight::from_ref_time(632_000_000) + Weight::from_parts(632_000_000, 0) .saturating_add(T::DbWeight::get().writes(1000)) } /// The range of component `i` is `[0, 1000]`. fn kill_storage(_i: u32, ) -> Weight { // Minimum execution time: 3_000 nanoseconds. - Weight::from_ref_time(580_000_000) + Weight::from_parts(580_000_000, 0) .saturating_add(T::DbWeight::get().writes(1000)) } /// The range of component `p` is `[0, 1000]`. fn kill_prefix(_p: u32, ) -> Weight { // Minimum execution time: 7_000 nanoseconds. - Weight::from_ref_time(1_467_000_000) + Weight::from_parts(1_467_000_000, 0) .saturating_add(T::DbWeight::get().writes(1000)) } } diff --git a/crates/humanode-runtime/src/weights/pallet_balances.rs b/crates/humanode-runtime/src/weights/pallet_balances.rs index 5b34e857b..4ab57445a 100644 --- a/crates/humanode-runtime/src/weights/pallet_balances.rs +++ b/crates/humanode-runtime/src/weights/pallet_balances.rs @@ -13,43 +13,43 @@ pub struct WeightInfo(PhantomData); impl pallet_balances::WeightInfo for WeightInfo { fn transfer() -> Weight { // Minimum execution time: 37_000 nanoseconds. - Weight::from_ref_time(37_000_000) + Weight::from_parts(37_000_000, 0) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } fn transfer_keep_alive() -> Weight { // Minimum execution time: 25_000 nanoseconds. - Weight::from_ref_time(25_000_000) + Weight::from_parts(25_000_000, 0) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } fn set_balance_creating() -> Weight { // Minimum execution time: 20_000 nanoseconds. - Weight::from_ref_time(20_000_000) + Weight::from_parts(20_000_000, 0) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } fn set_balance_killing() -> Weight { // Minimum execution time: 21_000 nanoseconds. - Weight::from_ref_time(21_000_000) + Weight::from_parts(21_000_000, 0) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } fn force_transfer() -> Weight { // Minimum execution time: 37_000 nanoseconds. - Weight::from_ref_time(37_000_000) + Weight::from_parts(37_000_000, 0) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(3)) } fn transfer_all() -> Weight { // Minimum execution time: 30_000 nanoseconds. - Weight::from_ref_time(30_000_000) + Weight::from_parts(30_000_000, 0) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } fn force_unreserve() -> Weight { // Minimum execution time: 17_000 nanoseconds. - Weight::from_ref_time(17_000_000) + Weight::from_parts(17_000_000, 0) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/crates/humanode-runtime/src/weights/pallet_bioauth.rs b/crates/humanode-runtime/src/weights/pallet_bioauth.rs index 8a1ff7c31..280b5f356 100644 --- a/crates/humanode-runtime/src/weights/pallet_bioauth.rs +++ b/crates/humanode-runtime/src/weights/pallet_bioauth.rs @@ -15,22 +15,22 @@ impl pallet_bioauth::WeightInfo for WeightInfo { /// The range of component `a` is `[0, 3071]`. fn authenticate(_a: u32, n: u32, ) -> Weight { // Minimum execution time: 127_000 nanoseconds. - Weight::from_ref_time(227_889_999_931) + Weight::from_parts(227_889_999_931, 0) // Standard Error: 9_401 - .saturating_add(Weight::from_ref_time(132_701).saturating_mul(n.into())) + .saturating_add(Weight::from_parts(132_701, 0).saturating_mul(n.into())) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } /// The range of component `a` is `[0, 3072]`. fn set_robonode_public_key(_a: u32, ) -> Weight { // Minimum execution time: 6_000 nanoseconds. - Weight::from_ref_time(7_000_000) + Weight::from_parts(7_000_000, 0) .saturating_add(T::DbWeight::get().writes(2)) } /// The range of component `a` is `[0, 3072]`. fn on_initialize(_a: u32, ) -> Weight { // Minimum execution time: 6_000 nanoseconds. - Weight::from_ref_time(74_000_000) + Weight::from_parts(74_000_000, 0) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/crates/humanode-runtime/src/weights/pallet_evm_accounts_mapping.rs b/crates/humanode-runtime/src/weights/pallet_evm_accounts_mapping.rs index ff60aa1ea..8c5c10f5a 100644 --- a/crates/humanode-runtime/src/weights/pallet_evm_accounts_mapping.rs +++ b/crates/humanode-runtime/src/weights/pallet_evm_accounts_mapping.rs @@ -13,7 +13,7 @@ pub struct WeightInfo(PhantomData); impl pallet_evm_accounts_mapping::WeightInfo for WeightInfo { fn claim_account() -> Weight { // Minimum execution time: 58_000 nanoseconds. - Weight::from_ref_time(58_000_000) + Weight::from_parts(58_000_000, 0) .saturating_add(T::DbWeight::get().reads(4)) .saturating_add(T::DbWeight::get().writes(2)) } diff --git a/crates/humanode-runtime/src/weights/pallet_im_online.rs b/crates/humanode-runtime/src/weights/pallet_im_online.rs index e8b76ba51..3a2c4209d 100644 --- a/crates/humanode-runtime/src/weights/pallet_im_online.rs +++ b/crates/humanode-runtime/src/weights/pallet_im_online.rs @@ -15,11 +15,11 @@ impl pallet_im_online::WeightInfo for WeightInfo { /// The range of component `k` is `[1, 1000]`. fn validate_unsigned_and_then_heartbeat(k: u32, e: u32, ) -> Weight { // Minimum execution time: 94_000 nanoseconds. - Weight::from_ref_time(71_732_732) + Weight::from_parts(71_732_732, 0) // Standard Error: 5_201 - .saturating_add(Weight::from_ref_time(45_045).saturating_mul(k.into())) + .saturating_add(Weight::from_parts(45_045, 0).saturating_mul(k.into())) // Standard Error: 52_486 - .saturating_add(Weight::from_ref_time(222_222).saturating_mul(e.into())) + .saturating_add(Weight::from_parts(222_222, 0).saturating_mul(e.into())) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/crates/humanode-runtime/src/weights/pallet_multisig.rs b/crates/humanode-runtime/src/weights/pallet_multisig.rs index 8949e99ea..33705b650 100644 --- a/crates/humanode-runtime/src/weights/pallet_multisig.rs +++ b/crates/humanode-runtime/src/weights/pallet_multisig.rs @@ -14,17 +14,17 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `z` is `[0, 10000]`. fn as_multi_threshold_1(_z: u32, ) -> Weight { // Minimum execution time: 14_000 nanoseconds. - Weight::from_ref_time(16_000_000) + Weight::from_parts(16_000_000, 0) } /// The range of component `z` is `[0, 10000]`. /// The range of component `s` is `[2, 128]`. fn as_multi_create(s: u32, z: u32, ) -> Weight { // Minimum execution time: 34_000 nanoseconds. - Weight::from_ref_time(26_888_888) + Weight::from_parts(26_888_888, 0) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(55_555).saturating_mul(s.into())) + .saturating_add(Weight::from_parts(55_555, 0).saturating_mul(s.into())) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000).saturating_mul(z.into())) + .saturating_add(Weight::from_parts(1_000, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -32,11 +32,11 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `z` is `[0, 10000]`. fn as_multi_approve(s: u32, z: u32, ) -> Weight { // Minimum execution time: 25_000 nanoseconds. - Weight::from_ref_time(19_368_000) + Weight::from_parts(19_368_000, 0) // Standard Error: 20_784 - .saturating_add(Weight::from_ref_time(44_000).saturating_mul(s.into())) + .saturating_add(Weight::from_parts(44_000, 0).saturating_mul(s.into())) // Standard Error: 259 - .saturating_add(Weight::from_ref_time(1_050).saturating_mul(z.into())) + .saturating_add(Weight::from_parts(1_050, 0).saturating_mul(z.into())) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } @@ -44,30 +44,30 @@ impl pallet_multisig::WeightInfo for WeightInfo { /// The range of component `z` is `[0, 10000]`. fn as_multi_complete(s: u32, _z: u32, ) -> Weight { // Minimum execution time: 39_000 nanoseconds. - Weight::from_ref_time(47_349_206) + Weight::from_parts(47_349_206, 0) // Standard Error: 48_112 - .saturating_add(Weight::from_ref_time(75_396).saturating_mul(s.into())) + .saturating_add(Weight::from_parts(75_396, 0).saturating_mul(s.into())) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(2)) } /// The range of component `s` is `[2, 128]`. fn approve_as_multi_create(_s: u32, ) -> Weight { // Minimum execution time: 30_000 nanoseconds. - Weight::from_ref_time(32_000_000) + Weight::from_parts(32_000_000, 0) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } /// The range of component `s` is `[2, 128]`. fn approve_as_multi_approve(_s: u32, ) -> Weight { // Minimum execution time: 20_000 nanoseconds. - Weight::from_ref_time(24_000_000) + Weight::from_parts(24_000_000, 0) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } /// The range of component `s` is `[2, 128]`. fn cancel_as_multi(_s: u32, ) -> Weight { // Minimum execution time: 25_000 nanoseconds. - Weight::from_ref_time(35_000_000) + Weight::from_parts(35_000_000, 0) .saturating_add(T::DbWeight::get().reads(1)) .saturating_add(T::DbWeight::get().writes(1)) } diff --git a/crates/humanode-runtime/src/weights/pallet_timestamp.rs b/crates/humanode-runtime/src/weights/pallet_timestamp.rs index fa2252cbe..e10e19d42 100644 --- a/crates/humanode-runtime/src/weights/pallet_timestamp.rs +++ b/crates/humanode-runtime/src/weights/pallet_timestamp.rs @@ -13,12 +13,12 @@ pub struct WeightInfo(PhantomData); impl pallet_timestamp::WeightInfo for WeightInfo { fn set() -> Weight { // Minimum execution time: 11_000 nanoseconds. - Weight::from_ref_time(11_000_000) + Weight::from_parts(11_000_000, 0) .saturating_add(T::DbWeight::get().reads(2)) .saturating_add(T::DbWeight::get().writes(1)) } fn on_finalize() -> Weight { // Minimum execution time: 4_000 nanoseconds. - Weight::from_ref_time(4_000_000) + Weight::from_parts(4_000_000, 0) } } diff --git a/crates/humanode-runtime/src/weights/pallet_token_claims.rs b/crates/humanode-runtime/src/weights/pallet_token_claims.rs index d33c1c461..620fbe231 100644 --- a/crates/humanode-runtime/src/weights/pallet_token_claims.rs +++ b/crates/humanode-runtime/src/weights/pallet_token_claims.rs @@ -13,25 +13,25 @@ pub struct WeightInfo(PhantomData); impl pallet_token_claims::WeightInfo for WeightInfo { fn claim() -> Weight { // Minimum execution time: 93_000 nanoseconds. - Weight::from_ref_time(93_000_000) + Weight::from_parts(93_000_000, 0) .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(5)) } fn add_claim() -> Weight { // Minimum execution time: 31_000 nanoseconds. - Weight::from_ref_time(31_000_000) + Weight::from_parts(31_000_000, 0) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) } fn remove_claim() -> Weight { // Minimum execution time: 30_000 nanoseconds. - Weight::from_ref_time(30_000_000) + Weight::from_parts(30_000_000, 0) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) } fn change_claim() -> Weight { // Minimum execution time: 32_000 nanoseconds. - Weight::from_ref_time(32_000_000) + Weight::from_parts(32_000_000, 0) .saturating_add(T::DbWeight::get().reads(3)) .saturating_add(T::DbWeight::get().writes(4)) } diff --git a/crates/humanode-runtime/src/weights/pallet_utility.rs b/crates/humanode-runtime/src/weights/pallet_utility.rs index 877d886d8..52f65b149 100644 --- a/crates/humanode-runtime/src/weights/pallet_utility.rs +++ b/crates/humanode-runtime/src/weights/pallet_utility.rs @@ -14,24 +14,24 @@ impl pallet_utility::WeightInfo for WeightInfo { /// The range of component `c` is `[0, 1000]`. fn batch(_c: u32, ) -> Weight { // Minimum execution time: 11_000 nanoseconds. - Weight::from_ref_time(1_867_000_000) + Weight::from_parts(1_867_000_000, 0) } fn as_derivative() -> Weight { // Minimum execution time: 13_000 nanoseconds. - Weight::from_ref_time(13_000_000) + Weight::from_parts(13_000_000, 0) } /// The range of component `c` is `[0, 1000]`. fn batch_all(_c: u32, ) -> Weight { // Minimum execution time: 13_000 nanoseconds. - Weight::from_ref_time(2_124_000_000) + Weight::from_parts(2_124_000_000, 0) } fn dispatch_as() -> Weight { // Minimum execution time: 13_000 nanoseconds. - Weight::from_ref_time(13_000_000) + Weight::from_parts(13_000_000, 0) } /// The range of component `c` is `[0, 1000]`. fn force_batch(_c: u32, ) -> Weight { // Minimum execution time: 10_000 nanoseconds. - Weight::from_ref_time(1_822_000_000) + Weight::from_parts(1_822_000_000, 0) } } diff --git a/crates/humanode-runtime/src/weights/pallet_vesting.rs b/crates/humanode-runtime/src/weights/pallet_vesting.rs index a76b1e1e8..ef492ab2b 100644 --- a/crates/humanode-runtime/src/weights/pallet_vesting.rs +++ b/crates/humanode-runtime/src/weights/pallet_vesting.rs @@ -13,13 +13,13 @@ pub struct WeightInfo(PhantomData); impl pallet_vesting::WeightInfo for WeightInfo { fn unlock() -> Weight { // Minimum execution time: 35_000 nanoseconds. - Weight::from_ref_time(35_000_000) + Weight::from_parts(35_000_000, 0) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } fn update_schedule() -> Weight { // Minimum execution time: 38_000 nanoseconds. - Weight::from_ref_time(38_000_000) + Weight::from_parts(38_000_000, 0) .saturating_add(T::DbWeight::get().reads(5)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/crates/pallet-dummy-precompiles-code/src/mock/v0.rs b/crates/pallet-dummy-precompiles-code/src/mock/v0.rs index 622ca6dcd..33b21b4ac 100644 --- a/crates/pallet-dummy-precompiles-code/src/mock/v0.rs +++ b/crates/pallet-dummy-precompiles-code/src/mock/v0.rs @@ -108,13 +108,13 @@ pub struct FixedGasPrice; impl fp_evm::FeeCalculator for FixedGasPrice { fn min_gas_price() -> (U256, Weight) { // Return some meaningful gas price and weight - (*GAS_PRICE, Weight::from_ref_time(7u64)) + (*GAS_PRICE, Weight::from_parts(7u64, 0)) } } frame_support::parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); - pub WeightPerGas: Weight = Weight::from_ref_time(20_000); + pub WeightPerGas: Weight = Weight::from_parts(20_000, 0); } impl pallet_evm::Config for Test { diff --git a/crates/pallet-dummy-precompiles-code/src/mock/v1.rs b/crates/pallet-dummy-precompiles-code/src/mock/v1.rs index ef657e8fe..31587f6f9 100644 --- a/crates/pallet-dummy-precompiles-code/src/mock/v1.rs +++ b/crates/pallet-dummy-precompiles-code/src/mock/v1.rs @@ -114,13 +114,13 @@ pub struct FixedGasPrice; impl fp_evm::FeeCalculator for FixedGasPrice { fn min_gas_price() -> (U256, Weight) { // Return some meaningful gas price and weight - (*GAS_PRICE, Weight::from_ref_time(7u64)) + (*GAS_PRICE, Weight::from_parts(7u64, 0)) } } frame_support::parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); - pub WeightPerGas: Weight = Weight::from_ref_time(20_000); + pub WeightPerGas: Weight = Weight::from_parts(20_000, 0); } impl pallet_evm::Config for Test { diff --git a/crates/pallet-token-claims/src/tests.rs b/crates/pallet-token-claims/src/tests.rs index 4bfa2e75d..0a6577a74 100644 --- a/crates/pallet-token-claims/src/tests.rs +++ b/crates/pallet-token-claims/src/tests.rs @@ -1156,7 +1156,7 @@ fn signed_ext_validate_works() { // Invoke the function under test. let normal = DispatchInfo { - weight: Weight::from_ref_time(100), + weight: Weight::from_parts(100, 0), class: DispatchClass::Normal, pays_fee: Pays::No, }; @@ -1208,7 +1208,7 @@ fn signed_ext_validate_fails_invalid_eth_signature() { // Invoke the function under test. let normal = DispatchInfo { - weight: Weight::from_ref_time(100), + weight: Weight::from_parts(100, 0), class: DispatchClass::Normal, pays_fee: Pays::No, }; @@ -1260,7 +1260,7 @@ fn signed_ext_validate_fails_when_claim_is_absent() { // Invoke the function under test. let normal = DispatchInfo { - weight: Weight::from_ref_time(100), + weight: Weight::from_parts(100, 0), class: DispatchClass::Normal, pays_fee: Pays::No, }; diff --git a/crates/precompile-currency-swap/src/mock.rs b/crates/precompile-currency-swap/src/mock.rs index ce9dba6cc..c49a1324b 100644 --- a/crates/precompile-currency-swap/src/mock.rs +++ b/crates/precompile-currency-swap/src/mock.rs @@ -116,13 +116,13 @@ pub struct FixedGasPrice; impl fp_evm::FeeCalculator for FixedGasPrice { fn min_gas_price() -> (U256, Weight) { // Return some meaningful gas price and weight - (*GAS_PRICE, Weight::from_ref_time(7u64)) + (*GAS_PRICE, Weight::from_parts(7u64, 0)) } } frame_support::parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); - pub WeightPerGas: Weight = Weight::from_ref_time(20_000); + pub WeightPerGas: Weight = Weight::from_parts(20_000, 0); pub MockPrecompiles: MockPrecompileSet = MockPrecompileSet; } diff --git a/crates/precompile-native-currency/src/mock.rs b/crates/precompile-native-currency/src/mock.rs index 8db15318e..96c6e7ae4 100644 --- a/crates/precompile-native-currency/src/mock.rs +++ b/crates/precompile-native-currency/src/mock.rs @@ -141,7 +141,7 @@ pub struct FixedGasPrice; impl fp_evm::FeeCalculator for FixedGasPrice { fn min_gas_price() -> (U256, Weight) { // Return some meaningful gas price and weight - (*GAS_PRICE, Weight::from_ref_time(7u64)) + (*GAS_PRICE, Weight::from_parts(7u64, 0)) } } @@ -154,7 +154,7 @@ pub type Precompiles = frame_support::parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); - pub WeightPerGas: Weight = Weight::from_ref_time(20_000); + pub WeightPerGas: Weight = Weight::from_parts(20_000, 0); pub PrecompileAddress: H160 = *PRECOMPILE_ADDRESS; pub PrecompilesValue: Precompiles = Precompiles::new(); } diff --git a/crates/precompile-utils/src/lib.rs b/crates/precompile-utils/src/lib.rs index 6b1c8c5f8..a6dde71c0 100644 --- a/crates/precompile-utils/src/lib.rs +++ b/crates/precompile-utils/src/lib.rs @@ -227,15 +227,17 @@ where { /// Cost of a Substrate DB write in gas. pub fn db_write_gas_cost() -> u64 { - ::GasWeightMapping::weight_to_gas(Weight::from_ref_time( + ::GasWeightMapping::weight_to_gas(Weight::from_parts( ::DbWeight::get().write, + 0, )) } /// Cost of a Substrate DB read in gas. pub fn db_read_gas_cost() -> u64 { - ::GasWeightMapping::weight_to_gas(Weight::from_ref_time( + ::GasWeightMapping::weight_to_gas(Weight::from_parts( ::DbWeight::get().read, + 0, )) } } diff --git a/utils/weights/assets/template.hbs b/utils/weights/assets/template.hbs index 7f99b341f..1f9e56817 100644 --- a/utils/weights/assets/template.hbs +++ b/utils/weights/assets/template.hbs @@ -23,12 +23,14 @@ impl {{pallet}}::WeightInfo for WeightInfo { {{~#each benchmark.components as |c| ~}} {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} ) -> Weight { - // Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds. - Weight::from_ref_time({{underscore benchmark.base_weight}}) - .saturating_add(Weight::from_proof_size({{benchmark.base_calculated_proof_size}})) + // Proof Size summary in bytes: + // Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Minimum execution time: {{underscore benchmark.min_execution_time}}_000 picoseconds. + Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}}) {{#each benchmark.component_weight as |cw|}} // Standard Error: {{underscore cw.error}} - .saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into())) + .saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into())) {{/each}} {{#if (ne benchmark.base_reads "0")}} .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}})) @@ -40,7 +42,7 @@ impl {{pallet}}::WeightInfo for WeightInfo { .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}})) {{/if}} {{#each benchmark.component_writes as |cw|}} - .saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into()))) + .saturating_add(Weight::from_parts(0, {{cp.slope}}).saturating_mul({{cp.name}}.into())) {{/each}} } {{/each}} From b2956a388d46a55220c7cec94568f74788f8b98f Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Fri, 1 Dec 2023 19:02:26 +0300 Subject: [PATCH 07/43] [substrate-apply] Offences report system rework #13425 --- crates/humanode-runtime/src/lib.rs | 31 ++++++++---------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/crates/humanode-runtime/src/lib.rs b/crates/humanode-runtime/src/lib.rs index fd41e6db5..3f1b3acdd 100644 --- a/crates/humanode-runtime/src/lib.rs +++ b/crates/humanode-runtime/src/lib.rs @@ -312,19 +312,12 @@ impl pallet_babe::Config for Runtime { type EpochChangeTrigger = pallet_babe::ExternalTrigger; type DisabledValidators = Session; - type KeyOwnerProofSystem = Historical; - type KeyOwnerProof = - >::Proof; - - type KeyOwnerIdentification = >::IdentificationTuple; - - type HandleEquivocation = pallet_babe::EquivocationHandler< - Self::KeyOwnerIdentification, + >::Proof; + type EquivocationReportSystem = pallet_babe::EquivocationReportSystem< + Self, Offences, + Historical, ConstU64, >; @@ -361,19 +354,11 @@ impl pallet_session::historical::Config for Runtime { impl pallet_grandpa::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type KeyOwnerProofSystem = Historical; - - type KeyOwnerProof = - >::Proof; - - type KeyOwnerIdentification = >::IdentificationTuple; - - type HandleEquivocation = pallet_grandpa::EquivocationHandler< - Self::KeyOwnerIdentification, + type KeyOwnerProof = >::Proof; + type EquivocationReportSystem = pallet_grandpa::EquivocationReportSystem< + Self, Offences, + Historical, ConstU64, >; From d635e8ffccc8a7484bf0fd2e80a7f5a0e2f67812 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Mon, 4 Dec 2023 20:02:45 +0300 Subject: [PATCH 08/43] Add missing GasLimitPovSizeRatio for pallet_evm::Config --- crates/humanode-runtime/src/constants.rs | 6 ++++++ crates/humanode-runtime/src/lib.rs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/crates/humanode-runtime/src/constants.rs b/crates/humanode-runtime/src/constants.rs index 8814e1eb9..51567f77e 100644 --- a/crates/humanode-runtime/src/constants.rs +++ b/crates/humanode-runtime/src/constants.rs @@ -113,6 +113,12 @@ pub mod evm_fees { /// - so we must charge about 0.2 * 10^18 / 21000 fee per a unit of gas /// The value below is a nice round number that fits the requirements outlined above. pub const FEE_PER_GAS: u128 = 10_000_000_000_000; + + /// The max proof size ratio per block. + /// Set to the zero as humanode is solo chain. Otherwise, additional used gas has + /// been added to transactions cost. + /// Ref: + pub const GAS_LIMIT_POV_SIZE_RATIO: u64 = 0; } /// Ethereum related constants. diff --git a/crates/humanode-runtime/src/lib.rs b/crates/humanode-runtime/src/lib.rs index 3f1b3acdd..381289ca0 100644 --- a/crates/humanode-runtime/src/lib.rs +++ b/crates/humanode-runtime/src/lib.rs @@ -623,6 +623,7 @@ const_assert!(WEIGHT_MILLISECS_PER_BLOCK == 2000u64); parameter_types! { pub BlockGasLimit: U256 = U256::from(constants::evm_fees::BLOCK_GAS_LIMIT); + pub GasLimitPovSizeRatio: u64 = constants::evm_fees::GAS_LIMIT_POV_SIZE_RATIO; pub PrecompilesValue: FrontierPrecompiles = FrontierPrecompiles::<_>::default(); pub WeightPerGas: Weight = Weight::from_parts(fp_evm::weight_per_gas( constants::evm_fees::BLOCK_GAS_LIMIT, @@ -687,6 +688,7 @@ impl pallet_evm::Config for Runtime { type FindAuthor = find_author::FindAuthorTruncated< find_author::FindAuthorFromSession, >; + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; type Timestamp = Timestamp; type WeightInfo = pallet_evm::weights::SubstrateWeight; } From 8ea9f5ed13f98de0540a674a6dfb9a12f1db9800 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Thu, 7 Dec 2023 15:30:56 +0300 Subject: [PATCH 09/43] [frontier-apply] Add pending support for eth_getBlockByNumber #1048 --- crates/humanode-runtime/src/lib.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/crates/humanode-runtime/src/lib.rs b/crates/humanode-runtime/src/lib.rs index 381289ca0..d2a0bce94 100644 --- a/crates/humanode-runtime/src/lib.rs +++ b/crates/humanode-runtime/src/lib.rs @@ -1416,6 +1416,21 @@ impl_runtime_apis! { } fn gas_limit_multiplier_support() {} + + fn pending_block( + xts: Vec<::Extrinsic>, + ) -> (Option, Option>) { + for ext in xts.into_iter() { + let _ = Executive::apply_extrinsic(ext); + } + + Ethereum::on_finalize(System::block_number() + 1); + + ( + pallet_ethereum::CurrentBlock::::get(), + pallet_ethereum::CurrentTransactionStatuses::::get() + ) + } } impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi From 38a4476280b7741cc01c5a4fb0c6929bcf763e1a Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Thu, 7 Dec 2023 15:33:35 +0300 Subject: [PATCH 10/43] Fix is_precompile return value --- crates/humanode-runtime/src/frontier_precompiles.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/humanode-runtime/src/frontier_precompiles.rs b/crates/humanode-runtime/src/frontier_precompiles.rs index b9676adbd..004d768ef 100644 --- a/crates/humanode-runtime/src/frontier_precompiles.rs +++ b/crates/humanode-runtime/src/frontier_precompiles.rs @@ -122,7 +122,7 @@ where } } - fn is_precompile(&self, address: H160, _gas: u64) -> bool { + fn is_precompile(&self, address: H160, _gas: u64) -> IsPrecompileResult { IsPrecompileResult::Answer { is_precompile: Self::used_addresses().contains(&address), extra_cost: 0, From 068844917a7b34468f2a61c0d2deae63d6bf5419 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Thu, 7 Dec 2023 15:40:54 +0300 Subject: [PATCH 11/43] Add missing args for weight limit and transaction len at runner call and created methods --- crates/humanode-runtime/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/humanode-runtime/src/lib.rs b/crates/humanode-runtime/src/lib.rs index d2a0bce94..9c0b3f980 100644 --- a/crates/humanode-runtime/src/lib.rs +++ b/crates/humanode-runtime/src/lib.rs @@ -1338,6 +1338,10 @@ impl_runtime_apis! { access_list.unwrap_or_default(), is_transactional, validate, + // TODO: should we define limit for weight and transaction len. + // . + None, + None, &config, ).map_err(|err| err.error.into()) } @@ -1374,6 +1378,10 @@ impl_runtime_apis! { access_list.unwrap_or_default(), is_transactional, validate, + // TODO: should we define limit for weight and transaction len. + // . + None, + None, &config, ).map_err(|err| err.error.into()) } From a25f485e6970fcf3f8411b9c3e0f62d0e49b218b Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Thu, 7 Dec 2023 15:41:40 +0300 Subject: [PATCH 12/43] Add missing trait OnFinalize --- crates/humanode-runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/humanode-runtime/src/lib.rs b/crates/humanode-runtime/src/lib.rs index 9c0b3f980..bb2916abb 100644 --- a/crates/humanode-runtime/src/lib.rs +++ b/crates/humanode-runtime/src/lib.rs @@ -21,7 +21,7 @@ pub use frame_support::{ construct_runtime, parameter_types, traits::{ ConstBool, ConstU128, ConstU16, ConstU32, ConstU64, ConstU8, FindAuthor, Get, - KeyOwnerProofSystem, Randomness, + KeyOwnerProofSystem, OnFinalize, Randomness, }, weights::{ constants::{ From 10bc7f9b66d1b99f0e5c00188d653307edfbd6e9 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Thu, 7 Dec 2023 15:51:17 +0300 Subject: [PATCH 13/43] Use SyncingService for Eth --- Cargo.lock | 1 + Cargo.toml | 1 + crates/humanode-rpc/Cargo.toml | 1 + crates/humanode-rpc/src/lib.rs | 10 +++++++--- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 44e009a2d..b99d4c1fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3722,6 +3722,7 @@ dependencies = [ "sc-consensus-grandpa", "sc-consensus-grandpa-rpc", "sc-network", + "sc-network-sync", "sc-rpc", "sc-rpc-api", "sc-rpc-spec-v2", diff --git a/Cargo.toml b/Cargo.toml index 282ea5cb5..ca8c803a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -101,6 +101,7 @@ sc-consensus-grandpa = { git = "https://github.com/humanode-network/substrate", sc-consensus-grandpa-rpc = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sc-executor = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sc-network = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } +sc-network-sync = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sc-rpc = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sc-rpc-api = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } sc-rpc-spec-v2 = { git = "https://github.com/humanode-network/substrate", branch = "locked/polkadot-v0.9.40", default-features = false } diff --git a/crates/humanode-rpc/Cargo.toml b/crates/humanode-rpc/Cargo.toml index 60df8fb3f..384b84cfe 100644 --- a/crates/humanode-rpc/Cargo.toml +++ b/crates/humanode-rpc/Cargo.toml @@ -29,6 +29,7 @@ sc-consensus-epochs = { workspace = true } sc-consensus-grandpa = { workspace = true } sc-consensus-grandpa-rpc = { workspace = true } sc-network = { workspace = true } +sc-network-sync = { workspace = true } sc-rpc = { workspace = true } sc-rpc-api = { workspace = true } sc-rpc-spec-v2 = { workspace = true } diff --git a/crates/humanode-rpc/src/lib.rs b/crates/humanode-rpc/src/lib.rs index b0dba5810..90c563d05 100644 --- a/crates/humanode-rpc/src/lib.rs +++ b/crates/humanode-rpc/src/lib.rs @@ -29,6 +29,7 @@ use sc_consensus_grandpa::{ }; use sc_consensus_grandpa_rpc::{Grandpa, GrandpaApiServer}; use sc_network::NetworkService; +use sc_network_sync::SyncingService; pub use sc_rpc_api::DenyUnsafe; use sc_rpc_spec_v2::chain_spec::{ChainSpec, ChainSpecApiServer}; use sc_transaction_pool::{ChainApi, Pool}; @@ -126,8 +127,10 @@ pub struct Deps { pub deny_unsafe: DenyUnsafe, /// Graph pool instance. pub graph: Arc>, - /// Network service + /// Network service. pub network: Arc>, + /// Chain syncing service. + pub sync: Arc>, /// A copy of the chain spec. pub chain_spec: Box, /// AuthorExt specific dependencies. @@ -191,6 +194,7 @@ where deny_unsafe, graph, network, + sync, chain_spec, author_ext, is_authority, @@ -303,7 +307,7 @@ where Arc::clone(&pool), graph, Some(humanode_runtime::TransactionConverter), - Arc::clone(&network), + Arc::clone(&sync), Vec::new(), Arc::clone(ð_overrides), Arc::clone(ð_backend), @@ -324,7 +328,7 @@ where EthPubSub::new( Arc::clone(&pool), Arc::clone(&client), - Arc::clone(&network), + Arc::clone(&sync), Arc::clone(&subscription_task_executor), Arc::clone(ð_overrides), Arc::clone(ð_pubsub_notification_sinks), From c58a4cca831e1dd11e9c18d7ca4ea125c5edccf0 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Thu, 7 Dec 2023 15:56:17 +0300 Subject: [PATCH 14/43] [frontier-apply] sql backend w/ receipt log indexing #883 (part 1) --- crates/humanode-rpc/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/humanode-rpc/src/lib.rs b/crates/humanode-rpc/src/lib.rs index 90c563d05..fecaef8ed 100644 --- a/crates/humanode-rpc/src/lib.rs +++ b/crates/humanode-rpc/src/lib.rs @@ -87,7 +87,7 @@ pub struct EvmDeps { /// Maximum number of stored filters. pub eth_max_stored_filters: usize, /// Backend. - pub eth_backend: Arc>, + pub eth_backend: Arc + Send + Sync>, /// Maximum number of logs in a query. pub eth_max_past_logs: u32, /// Maximum fee history cache size. From d0639712f76f927d1b35e440989bc1ad852668e2 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Thu, 7 Dec 2023 16:03:05 +0300 Subject: [PATCH 15/43] [frontier-apply] Add txpool RPC and impl new_pending_transaction_filter #1073 --- crates/humanode-rpc/src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/humanode-rpc/src/lib.rs b/crates/humanode-rpc/src/lib.rs index fecaef8ed..9368fbf62 100644 --- a/crates/humanode-rpc/src/lib.rs +++ b/crates/humanode-rpc/src/lib.rs @@ -8,7 +8,7 @@ use bioauth_flow_rpc::{Bioauth, BioauthServer, Signer, SignerFactory}; use bioauth_keys::traits::KeyExtractor as KeyExtractorT; use fc_rpc::{ Eth, EthApiServer, EthBlockDataCacheTask, EthConfig, EthFilter, EthFilterApiServer, EthPubSub, - EthPubSubApiServer, Net, NetApiServer, Web3, Web3ApiServer, + EthPubSubApiServer, Net, NetApiServer, TxPool, TxPoolApiServer, Web3, Web3ApiServer, }; use fc_rpc_core::types::{FeeHistoryCache, FilterPool}; use fc_storage::OverrideHandle; @@ -305,7 +305,7 @@ where Eth::new( Arc::clone(&client), Arc::clone(&pool), - graph, + Arc::clone(&graph), Some(humanode_runtime::TransactionConverter), Arc::clone(&sync), Vec::new(), @@ -346,11 +346,14 @@ where .into_rpc(), )?; + let eth_tx_pool = TxPool::new(Arc::clone(&client), graph); + if let Some(eth_filter_pool) = eth_filter_pool { io.merge( EthFilter::new( client, eth_backend, + eth_tx_pool.clone(), eth_filter_pool, eth_max_stored_filters, eth_max_past_logs, @@ -360,5 +363,7 @@ where )?; } + io.merge(eth_tx_pool.into_rpc())?; + Ok(io) } From 01c062e93cef4cd3ab95f7e2b14c0640831f3581 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Fri, 8 Dec 2023 11:47:56 +0300 Subject: [PATCH 16/43] [substrate-apply] Extract syncing protocol from sc-network #12828 --- crates/humanode-peer/src/service/mod.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/humanode-peer/src/service/mod.rs b/crates/humanode-peer/src/service/mod.rs index 1485610c6..9e31a09a7 100644 --- a/crates/humanode-peer/src/service/mod.rs +++ b/crates/humanode-peer/src/service/mod.rs @@ -8,7 +8,7 @@ use std::{ }; use fc_consensus::FrontierBlockImport; -use fc_mapping_sync::{MappingSyncWorker, SyncStrategy}; +use fc_mapping_sync::SyncStrategy; use fc_rpc::EthTask; use fc_rpc_core::types::{FeeHistoryCache, FilterPool}; use futures::StreamExt; @@ -304,7 +304,7 @@ pub async fn new_full(config: Configuration) -> Result Result Result Result Result Result Date: Fri, 8 Dec 2023 13:27:27 +0300 Subject: [PATCH 17/43] sql backend w/ receipt log indexing #883 (part 2) --- Cargo.lock | 530 +++++++++++++++++-- crates/humanode-peer/Cargo.toml | 4 +- crates/humanode-peer/src/cli/config.rs | 5 + crates/humanode-peer/src/cli/params.rs | 23 + crates/humanode-peer/src/configuration.rs | 31 ++ crates/humanode-peer/src/service/frontier.rs | 53 +- crates/humanode-peer/src/service/mod.rs | 89 ++-- 7 files changed, 662 insertions(+), 73 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b99d4c1fa..949baedaf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,6 +179,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -435,6 +441,15 @@ dependencies = [ "pin-project-lite 0.2.9", ] +[[package]] +name = "atoi" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +dependencies = [ + "num-traits", +] + [[package]] name = "atomic-waker" version = "1.1.1" @@ -581,7 +596,7 @@ version = "0.64.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4243e6031260db77ede97ad86c27e501d646a27ab57b59a574f725d98ab1fb4" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cexpr", "clang-sys", "lazy_static", @@ -662,6 +677,15 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +dependencies = [ + "serde", +] + [[package]] name = "bitvec" version = "1.0.1" @@ -1082,7 +1106,7 @@ checksum = "223163f58c9a40c3b0a43e1c4b50a9ce09f007ea2cb1ec258a687945b4b7929f" dependencies = [ "anstream", "anstyle", - "bitflags", + "bitflags 1.3.2", "clap_lex", "strsim", ] @@ -1309,7 +1333,7 @@ dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools", + "itertools 0.10.5", "log", "smallvec", "wasmparser", @@ -1374,6 +1398,16 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.15" @@ -1389,7 +1423,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67" dependencies = [ - "bitflags", + "bitflags 1.3.2", "crossterm_winapi", "libc", "mio", @@ -1697,7 +1731,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" dependencies = [ "const-oid", - "pem-rfc7468", + "pem-rfc7468 0.6.0", "zeroize", ] @@ -1708,6 +1742,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82b10af9f9f9f2134a42d3f8aa74658660f2e0234b0eb81bd171df8aa32779ed" dependencies = [ "const-oid", + "pem-rfc7468 0.7.0", "zeroize", ] @@ -1890,6 +1925,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + [[package]] name = "downcast" version = "0.11.0" @@ -2090,6 +2131,9 @@ name = "either" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +dependencies = [ + "serde", +] [[package]] name = "elliptic-curve" @@ -2105,7 +2149,7 @@ dependencies = [ "generic-array 0.14.7", "group 0.12.1", "hkdf", - "pem-rfc7468", + "pem-rfc7468 0.6.0", "pkcs8 0.9.0", "rand_core 0.6.4", "sec1 0.3.0", @@ -2178,6 +2222,12 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48c92028aaa870e83d51c64e5d4e0b6981b360c522198c23959f219a4e1b15b" +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.3.1" @@ -2199,6 +2249,17 @@ dependencies = [ "libc", ] +[[package]] +name = "etcetera" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +dependencies = [ + "cfg-if", + "home", + "windows-sys 0.48.0", +] + [[package]] name = "ethabi" version = "18.0.0" @@ -2451,16 +2512,26 @@ version = "2.0.0-dev" source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" dependencies = [ "async-trait", + "ethereum", + "fc-storage", + "fp-consensus", + "fp-rpc", "fp-storage", + "futures", "log", "parity-db", "parity-scale-codec", "parking_lot 0.12.1", + "sc-client-api", "sc-client-db", + "sp-api", "sp-blockchain", "sp-core", "sp-database", "sp-runtime", + "sp-storage", + "sqlx", + "tokio", ] [[package]] @@ -2481,7 +2552,9 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-consensus", + "sp-core", "sp-runtime", + "tokio", ] [[package]] @@ -2638,6 +2711,12 @@ dependencies = [ "scale-info", ] +[[package]] +name = "finl_unicode" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" + [[package]] name = "fixed-hash" version = "0.8.0" @@ -2676,6 +2755,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "futures-core", + "futures-sink", + "spin 0.9.8", +] + [[package]] name = "fnv" version = "1.0.7" @@ -2857,7 +2947,7 @@ dependencies = [ "frame-system", "gethostname", "handlebars", - "itertools", + "itertools 0.10.5", "lazy_static", "linked-hash-map", "log", @@ -2939,7 +3029,7 @@ name = "frame-support" version = "4.0.0-dev" source = "git+https://github.com/humanode-network/substrate?branch=locked/polkadot-v0.9.40#fc5aabd84ebf6be57f97bf6dbf557eed5753719b" dependencies = [ - "bitflags", + "bitflags 1.3.2", "environmental", "frame-metadata", "frame-support-procedural", @@ -2976,7 +3066,7 @@ dependencies = [ "cfg-expr", "derive-syn-parse", "frame-support-procedural-tools", - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", "syn 1.0.109", @@ -3136,6 +3226,17 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", + "parking_lot 0.12.1", +] + [[package]] name = "futures-io" version = "0.3.28" @@ -3305,7 +3406,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" dependencies = [ "fallible-iterator", - "indexmap", + "indexmap 1.9.3", "stable_deref_trait", ] @@ -3368,7 +3469,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -3428,6 +3529,25 @@ dependencies = [ "ahash 0.8.3", ] +[[package]] +name = "hashbrown" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +dependencies = [ + "ahash 0.8.3", + "allocator-api2", +] + +[[package]] +name = "hashlink" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.2", +] + [[package]] name = "headers" version = "0.3.8" @@ -3435,7 +3555,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" dependencies = [ "base64 0.13.1", - "bitflags", + "bitflags 1.3.2", "bytes", "headers-core", "http", @@ -3458,6 +3578,9 @@ name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +dependencies = [ + "unicode-segmentation", +] [[package]] name = "hermit-abi" @@ -3550,6 +3673,15 @@ dependencies = [ "hmac 0.8.1", ] +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "hostname" version = "0.3.1" @@ -4025,6 +4157,16 @@ dependencies = [ "serde", ] +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.2", +] + [[package]] name = "indoc" version = "2.0.1" @@ -4139,6 +4281,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.6" @@ -4371,6 +4522,9 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin 0.5.2", +] [[package]] name = "lazycell" @@ -4916,6 +5070,17 @@ dependencies = [ "libsecp256k1-core", ] +[[package]] +name = "libsqlite3-sys" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + [[package]] name = "libz-sys" version = "1.1.8" @@ -5428,7 +5593,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" dependencies = [ "anyhow", - "bitflags", + "bitflags 1.3.2", "byteorder", "libc", "netlink-packet-core", @@ -5492,7 +5657,7 @@ version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "libc", "memoffset 0.6.5", @@ -5555,6 +5720,23 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand 0.8.5", + "smallvec", + "zeroize", +] + [[package]] name = "num-complex" version = "0.4.3" @@ -5614,6 +5796,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -5682,7 +5865,7 @@ checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ "crc32fast", "hashbrown 0.12.3", - "indexmap", + "indexmap 1.9.3", "memchr", ] @@ -5762,7 +5945,7 @@ version = "0.10.55" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "foreign-types", "libc", @@ -6558,6 +6741,15 @@ dependencies = [ "base64ct", ] +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.2.0" @@ -6615,7 +6807,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.3", ] [[package]] @@ -6656,6 +6848,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der 0.7.3", + "pkcs8 0.10.2", + "spki 0.7.1", +] + [[package]] name = "pkcs8" version = "0.9.0" @@ -6695,7 +6898,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4be1c66a6add46bff50935c313dae30a5030cf8385c5206e8a95e9e9def974aa" dependencies = [ "autocfg", - "bitflags", + "bitflags 1.3.2", "cfg-if", "concurrent-queue", "libc", @@ -6868,7 +7071,7 @@ checksum = "59230a63c37f3e18569bdb90e4a89cbf5bf8b06fea0b84e65ea10cc4df47addd" dependencies = [ "difflib", "float-cmp", - "itertools", + "itertools 0.10.5", "normalize-line-endings", "predicates-core", "regex", @@ -7059,7 +7262,7 @@ checksum = "2c828f93f5ca4826f97fedcbd3f9a536c16b12cff3dbbb4a007f932bbad95b12" dependencies = [ "bytes", "heck", - "itertools", + "itertools 0.10.5", "lazy_static", "log", "multimap", @@ -7093,7 +7296,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ea9b0f8cbe5e15a8a042d030bd96668db28ecb567ec37d691971ff5731d2b1b" dependencies = [ "anyhow", - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", "syn 1.0.109", @@ -7334,7 +7537,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -7343,7 +7546,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -7421,7 +7624,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" dependencies = [ - "bitflags", + "bitflags 1.3.2", "libc", "mach", "winapi", @@ -7649,6 +7852,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "rsa" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f1471dbb4be5de45050e8ef7040625298ccb9efe941419ac2697088715925f" +dependencies = [ + "byteorder", + "const-oid", + "digest 0.10.6", + "num-bigint-dig", + "num-integer", + "num-iter", + "num-traits", + "pkcs1", + "pkcs8 0.10.2", + "rand_core 0.6.4", + "signature 2.1.0", + "subtle", + "zeroize", +] + [[package]] name = "rtcp" version = "0.7.2" @@ -7741,7 +7965,7 @@ version = "0.36.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes", "libc", @@ -7755,7 +7979,7 @@ version = "0.37.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85597d61f83914ddeba6a47b3b8ffe7365107221c2e557ed94426489fefb5f77" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes", "libc", @@ -8373,7 +8597,7 @@ source = "git+https://github.com/humanode-network/substrate?branch=locked/polkad dependencies = [ "array-bytes", "async-trait", - "bitflags", + "bitflags 1.3.2", "bytes", "futures", "futures-timer", @@ -9054,7 +9278,7 @@ version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -9601,7 +9825,7 @@ source = "git+https://github.com/humanode-network/substrate?branch=locked/polkad dependencies = [ "array-bytes", "base58", - "bitflags", + "bitflags 1.3.2", "blake2", "bounded-collections", "dyn-clonable", @@ -10058,6 +10282,9 @@ name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] [[package]] name = "spki" @@ -10079,6 +10306,212 @@ dependencies = [ "der 0.7.3", ] +[[package]] +name = "sqlformat" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" +dependencies = [ + "itertools 0.12.0", + "nom", + "unicode_categories", +] + +[[package]] +name = "sqlx" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e50c216e3624ec8e7ecd14c6a6a6370aad6ee5d8cfc3ab30b5162eeeef2ed33" +dependencies = [ + "sqlx-core", + "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", +] + +[[package]] +name = "sqlx-core" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d6753e460c998bbd4cd8c6f0ed9a64346fcca0723d6e75e52fdc351c5d2169d" +dependencies = [ + "ahash 0.8.3", + "atoi", + "byteorder", + "bytes", + "crc", + "crossbeam-queue", + "dotenvy", + "either", + "event-listener", + "futures-channel", + "futures-core", + "futures-intrusive", + "futures-io", + "futures-util", + "hashlink", + "hex", + "indexmap 2.1.0", + "log", + "memchr", + "native-tls", + "once_cell", + "paste", + "percent-encoding", + "serde", + "serde_json", + "sha2 0.10.6", + "smallvec", + "sqlformat", + "thiserror", + "tokio", + "tokio-stream", + "tracing", + "url", +] + +[[package]] +name = "sqlx-macros" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a793bb3ba331ec8359c1853bd39eed32cdd7baaf22c35ccf5c92a7e8d1189ec" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 1.0.109", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4ee1e104e00dedb6aa5ffdd1343107b0a4702e862a84320ee7cc74782d96fc" +dependencies = [ + "dotenvy", + "either", + "heck", + "hex", + "once_cell", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2 0.10.6", + "sqlx-core", + "sqlx-mysql", + "sqlx-sqlite", + "syn 1.0.109", + "tempfile", + "tokio", + "url", +] + +[[package]] +name = "sqlx-mysql" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "864b869fdf56263f4c95c45483191ea0af340f9f3e3e7b4d57a61c7c87a970db" +dependencies = [ + "atoi", + "base64 0.21.0", + "bitflags 2.4.1", + "byteorder", + "bytes", + "crc", + "digest 0.10.6", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array 0.14.7", + "hex", + "hkdf", + "hmac 0.12.1", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "percent-encoding", + "rand 0.8.5", + "rsa", + "serde", + "sha1", + "sha2 0.10.6", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-postgres" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb7ae0e6a97fb3ba33b23ac2671a5ce6e3cabe003f451abd5a56e7951d975624" +dependencies = [ + "atoi", + "base64 0.21.0", + "bitflags 2.4.1", + "byteorder", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "hex", + "hkdf", + "hmac 0.12.1", + "home", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "rand 0.8.5", + "serde", + "serde_json", + "sha1", + "sha2 0.10.6", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d59dc83cf45d89c555a577694534fcd1b55c545a816c816ce51f20bbe56a4f3f" +dependencies = [ + "atoi", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "sqlx-core", + "tracing", + "url", +] + [[package]] name = "ss58-registry" version = "1.39.0" @@ -10112,7 +10545,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg_aliases", "libc", "parking_lot 0.11.2", @@ -10134,6 +10567,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "stringprep" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" +dependencies = [ + "finl_unicode", + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "strsim" version = "0.10.0" @@ -10310,7 +10754,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75182f12f490e953596550b65ee31bda7c8e043d9386174b353bda50838c3fd" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "system-configuration-sys", ] @@ -10627,7 +11071,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bytes", "futures-core", "futures-util", @@ -11029,6 +11473,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + [[package]] name = "universal-hash" version = "0.4.1" @@ -11414,7 +11864,7 @@ version = "0.100.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64b20236ab624147dfbb62cf12a19aaf66af0e41b8398838b66e997d07d269d4" dependencies = [ - "indexmap", + "indexmap 1.9.3", "url", ] @@ -11427,7 +11877,7 @@ dependencies = [ "anyhow", "bincode", "cfg-if", - "indexmap", + "indexmap 1.9.3", "libc", "log", "object 0.29.0", @@ -11505,7 +11955,7 @@ dependencies = [ "anyhow", "cranelift-entity", "gimli 0.26.2", - "indexmap", + "indexmap 1.9.3", "log", "object 0.29.0", "serde", @@ -11570,7 +12020,7 @@ dependencies = [ "anyhow", "cc", "cfg-if", - "indexmap", + "indexmap 1.9.3", "libc", "log", "mach", @@ -11834,7 +12284,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" dependencies = [ "async-trait", - "bitflags", + "bitflags 1.3.2", "bytes", "cc", "ipnet", @@ -11859,6 +12309,12 @@ dependencies = [ "once_cell", ] +[[package]] +name = "whoami" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" + [[package]] name = "wide" version = "0.7.13" diff --git a/crates/humanode-peer/Cargo.toml b/crates/humanode-peer/Cargo.toml index 59af02749..c8bb1d9e0 100644 --- a/crates/humanode-peer/Cargo.toml +++ b/crates/humanode-peer/Cargo.toml @@ -27,8 +27,8 @@ clap = { workspace = true, features = ["derive"] } codec = { workspace = true, package = "parity-scale-codec" } fc-cli = { workspace = true } fc-consensus = { workspace = true } -fc-db = { workspace = true } -fc-mapping-sync = { workspace = true } +fc-db = { workspace = true, features = ["sql"] } +fc-mapping-sync = { workspace = true, features = ["sql"] } fc-rpc = { workspace = true } fc-rpc-core = { workspace = true } fc-storage = { workspace = true } diff --git a/crates/humanode-peer/src/cli/config.rs b/crates/humanode-peer/src/cli/config.rs index 5af2c44b4..df539ded1 100644 --- a/crates/humanode-peer/src/cli/config.rs +++ b/crates/humanode-peer/src/cli/config.rs @@ -52,6 +52,11 @@ pub trait CliConfigurationExt: SubstrateCliConfigurationProvider { max_stored_filters: params.max_stored_filters, fee_history_limit: params.fee_history_limit, execute_gas_limit_multiplier: params.execute_gas_limit_multiplier, + frontier_backend_type: params.frontier_backend_type, + frontier_sql_backend_pool_size: params.frontier_sql_backend_pool_size, + frontier_sql_backend_num_ops_timeout: params.frontier_sql_backend_num_ops_timeout, + frontier_sql_backend_thread_count: params.frontier_sql_backend_thread_count, + frontier_sql_backend_cache_size: params.frontier_sql_backend_cache_size, }); let time_warp = self.time_warp_params().and_then(|params| { diff --git a/crates/humanode-peer/src/cli/params.rs b/crates/humanode-peer/src/cli/params.rs index 168043a43..22e9f8c34 100644 --- a/crates/humanode-peer/src/cli/params.rs +++ b/crates/humanode-peer/src/cli/params.rs @@ -1,5 +1,7 @@ //! Shared CLI parameters. +use crate::configuration::FrontierBackendType; + /// Possible RPC URL scheme preference options. #[derive(Debug, clap::ValueEnum, Clone)] pub enum RpcUrlSchemePreference { @@ -73,6 +75,27 @@ pub struct EthereumRpcParams { /// block.gas_limit * execute_gas_limit_multiplier. #[arg(long, default_value = "10")] pub execute_gas_limit_multiplier: u64, + + /// Sets the frontier backend type (KeyValue or Sql). + #[arg(long, value_enum, ignore_case = true, default_value_t = FrontierBackendType::default())] + pub frontier_backend_type: FrontierBackendType, + + // Sets the SQL backend's pool size. + #[arg(long, default_value = "100")] + pub frontier_sql_backend_pool_size: u32, + + /// Sets the SQL backend's query timeout in number of VM ops. + #[arg(long, default_value = "10000000")] + pub frontier_sql_backend_num_ops_timeout: u32, + + /// Sets the SQL backend's auxiliary thread limit. + #[arg(long, default_value = "4")] + pub frontier_sql_backend_thread_count: u32, + + /// Sets the SQL backend's query timeout in number of VM ops. + /// Default value is 200MB. + #[arg(long, default_value = "209715200")] + pub frontier_sql_backend_cache_size: u64, } /// Shared CLI parameters used to configure time warp mode. diff --git a/crates/humanode-peer/src/configuration.rs b/crates/humanode-peer/src/configuration.rs index 81b741c21..de0d71441 100644 --- a/crates/humanode-peer/src/configuration.rs +++ b/crates/humanode-peer/src/configuration.rs @@ -72,4 +72,35 @@ pub struct EthereumRpc { /// When using eth_call/eth_estimateGas, the maximum allowed gas limit will be /// block.gas_limit * execute_gas_limit_multiplier. pub execute_gas_limit_multiplier: u64, + + /// Sets the frontier backend type (KeyValue or Sql). + pub frontier_backend_type: FrontierBackendType, + + // Sets the SQL backend's pool size. + pub frontier_sql_backend_pool_size: u32, + + /// Sets the SQL backend's query timeout in number of VM ops. + pub frontier_sql_backend_num_ops_timeout: u32, + + /// Sets the SQL backend's auxiliary thread limit. + pub frontier_sql_backend_thread_count: u32, + + /// Sets the SQL backend's query timeout in number of VM ops. + /// Default value is 200MB. + pub frontier_sql_backend_cache_size: u64, +} + +/// Avalailable frontier backend types. +#[derive(Debug, Copy, Clone, clap::ValueEnum)] +pub enum FrontierBackendType { + /// Either RocksDb or ParityDb as per inherited from the global backend settings. + KeyValue, + /// Sql database with custom log indexing. + Sql, +} + +impl Default for FrontierBackendType { + fn default() -> FrontierBackendType { + FrontierBackendType::KeyValue + } } diff --git a/crates/humanode-peer/src/service/frontier.rs b/crates/humanode-peer/src/service/frontier.rs index 9330c6faa..adf197b65 100644 --- a/crates/humanode-peer/src/service/frontier.rs +++ b/crates/humanode-peer/src/service/frontier.rs @@ -1,9 +1,15 @@ //! The Frontier related stuff. +use std::{path::Path, sync::Arc}; + +use fc_storage::OverrideHandle; use humanode_runtime::opaque::Block; use sc_cli::SubstrateCli; use sc_client_api::backend::Backend; -use sc_service::BasePath; +use sc_service::{BasePath, Configuration}; + +use super::{FrontierBackend, FullClient}; +use crate::configuration::{EthereumRpc, FrontierBackendType}; /// Create frontier dir. pub fn db_config_dir(config: &sc_service::Configuration) -> std::path::PathBuf { @@ -17,6 +23,51 @@ pub fn db_config_dir(config: &sc_service::Configuration) -> std::path::PathBuf { }) } +pub fn frontier_backend( + config: &Configuration, + client: Arc, + eth_rpc: &Option, + eth_overrides: Arc>, +) -> FrontierBackend { + let key_value_frontier_backend = FrontierBackend::KeyValue( + fc_db::kv::Backend::open( + Arc::clone(&client), + &config.database, + &db_config_dir(config), + ) + .unwrap(), + ); + + if let Some(eth_rpc) = eth_rpc { + match eth_rpc.frontier_backend_type { + FrontierBackendType::KeyValue => key_value_frontier_backend, + FrontierBackendType::Sql => { + let db_path = db_config_dir(config).join("sql"); + std::fs::create_dir_all(&db_path).expect("failed creating sql db directory"); + let backend = futures::executor::block_on(fc_db::sql::Backend::new( + fc_db::sql::BackendConfig::Sqlite(fc_db::sql::SqliteBackendConfig { + path: Path::new("sqlite:///") + .join(db_path) + .join("frontier.db3") + .to_str() + .unwrap(), + create_if_missing: true, + thread_count: eth_rpc.frontier_sql_backend_thread_count, + cache_size: eth_rpc.frontier_sql_backend_cache_size, + }), + eth_rpc.frontier_sql_backend_pool_size, + std::num::NonZeroU32::new(eth_rpc.frontier_sql_backend_num_ops_timeout), + Arc::clone(ð_overrides), + )) + .unwrap_or_else(|err| panic!("failed creating sql backend: {:?}", err)); + FrontierBackend::Sql(backend) + } + } + } else { + key_value_frontier_backend + } +} + /// Default ethereum config. pub struct DefaultEthConfig(std::marker::PhantomData<(C, BE)>); diff --git a/crates/humanode-peer/src/service/mod.rs b/crates/humanode-peer/src/service/mod.rs index 9e31a09a7..5b5717e2e 100644 --- a/crates/humanode-peer/src/service/mod.rs +++ b/crates/humanode-peer/src/service/mod.rs @@ -8,7 +8,6 @@ use std::{ }; use fc_consensus::FrontierBlockImport; -use fc_mapping_sync::SyncStrategy; use fc_rpc::EthTask; use fc_rpc_core::types::{FeeHistoryCache, FilterPool}; use futures::StreamExt; @@ -102,7 +101,7 @@ pub fn new_partial( sc_consensus_babe::BabeLink, EffectiveFullBlockImport, inherents::Creator, - Arc, + FrontierBackend, Option, ), >, @@ -111,6 +110,7 @@ pub fn new_partial( let Configuration { substrate: config, time_warp: time_warp_config, + ethereum_rpc: eth_rpc, .. } = config; @@ -170,16 +170,13 @@ pub fn new_partial( Arc::clone(&client), )?; - let frontier_backend = Arc::new(FrontierBackend::open( - Arc::clone(&client), - &config.database, - &frontier::db_config_dir(config), - )?); - let frontier_block_import = FrontierBlockImport::new( - babe_block_import, + let frontier_backend = frontier::frontier_backend( + config, Arc::clone(&client), - Arc::clone(&frontier_backend), + ð_rpc, + fc_storage::overrides_handle(Arc::clone(&client)), ); + let frontier_block_import = FrontierBlockImport::new(babe_block_import, Arc::clone(&client)); let raw_slot_duration = babe_link.config().slot_duration(); let inherent_data_providers_creator = inherents::Creator { @@ -364,7 +361,7 @@ pub async fn new_full(config: Configuration) -> Result Result Arc::new(b), + fc_db::Backend::Sql(b) => Arc::new(b), + }, eth_max_past_logs: ethereum_rpc_config.max_past_logs, eth_fee_history_limit, eth_fee_history_cache: Arc::clone(ð_fee_history_cache), @@ -497,7 +497,7 @@ pub async fn new_full(config: Configuration) -> Result Result::Number, - 0, - SyncStrategy::Normal, - network, - eth_pubsub_notification_sinks, - ) - .for_each(|()| futures::future::ready(())), - ); + match frontier_backend { + fc_db::Backend::KeyValue(b) => { + task_manager.spawn_essential_handle().spawn( + "frontier-mapping-sync-worker", + Some("evm"), + fc_mapping_sync::kv::MappingSyncWorker::new( + client.import_notification_stream(), + Duration::from_millis(humanode_runtime::SLOT_DURATION), + Arc::clone(&client), + backend, + Arc::clone(ð_overrides), + Arc::new(b), + // retry_times: usize. + 3, + // sync_from: ::Number. + 0, + fc_mapping_sync::SyncStrategy::Normal, + sync_service, + eth_pubsub_notification_sinks, + ) + .for_each(|()| futures::future::ready(())), + ); + } + fc_db::Backend::Sql(b) => { + task_manager.spawn_essential_handle().spawn_blocking( + "frontier-mapping-sync-worker", + Some("evm"), + fc_mapping_sync::sql::SyncWorker::run( + Arc::clone(&client), + backend, + Arc::new(b), + client.import_notification_stream(), + fc_mapping_sync::sql::SyncWorkerConfig { + read_notification_timeout: Duration::from_secs(10), + check_indexed_blocks_interval: Duration::from_secs(60), + }, + fc_mapping_sync::SyncStrategy::Parachain, + sync_service, + eth_pubsub_notification_sinks, + ), + ); + } + } // Spawn Frontier FeeHistory cache maintenance task. task_manager.spawn_essential_handle().spawn( From 4534351a78000fdd02dd97b4e763888287008f4d Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Mon, 11 Dec 2023 15:11:47 +0300 Subject: [PATCH 18/43] [frontier-apply] sql backend w/ receipt log indexing #883 (part 3) --- crates/humanode-peer/src/cli/run.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/humanode-peer/src/cli/run.rs b/crates/humanode-peer/src/cli/run.rs index a9d5dd685..fd986bace 100644 --- a/crates/humanode-peer/src/cli/run.rs +++ b/crates/humanode-peer/src/cli/run.rs @@ -230,7 +230,10 @@ pub async fn run() -> sc_cli::Result<()> { let runner = root.create_humanode_runner(cmd)?; runner.sync_run(|config| { let partial = service::new_partial(&config)?; - let frontier_backend = partial.other.4; + let frontier_backend = match partial.other.4 { + fc_db::Backend::KeyValue(kv) => Arc::new(kv), + _ => panic!("Only fc_db::Backend::KeyValue supported"), + }; cmd.run(partial.client, frontier_backend) }) } From c31739c8804b9f6cd75da4f08780191382301d27 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Mon, 11 Dec 2023 15:48:45 +0300 Subject: [PATCH 19/43] Fix tests --- .../src/tests/currency_swap.rs | 4 +- crates/humanode-runtime/src/tests/fees.rs | 10 ++++- .../src/mock/v0.rs | 2 + .../src/mock/v1.rs | 2 + crates/precompile-bioauth/src/mock.rs | 8 ++++ crates/precompile-currency-swap/src/mock.rs | 11 +++-- crates/precompile-currency-swap/src/tests.rs | 40 ++++++++++++++----- .../src/mock.rs | 8 ++++ crates/precompile-native-currency/src/mock.rs | 2 + .../precompile-native-currency/src/tests.rs | 16 ++++++-- 10 files changed, 84 insertions(+), 19 deletions(-) diff --git a/crates/humanode-runtime/src/tests/currency_swap.rs b/crates/humanode-runtime/src/tests/currency_swap.rs index 300c05df9..a5ba72123 100644 --- a/crates/humanode-runtime/src/tests/currency_swap.rs +++ b/crates/humanode-runtime/src/tests/currency_swap.rs @@ -202,6 +202,8 @@ fn currency_swap_precompile_call_works() { Vec::new(), true, true, + None, + None, config, ) .unwrap(); @@ -209,7 +211,7 @@ fn currency_swap_precompile_call_works() { execinfo.exit_reason, fp_evm::ExitReason::Succeed(fp_evm::ExitSucceed::Returned) ); - assert_eq!(execinfo.used_gas, expected_gas_usage.into()); + assert_eq!(execinfo.used_gas.standard, expected_gas_usage.into()); assert_eq!(execinfo.value, EvmDataWriter::new().write(true).build()); assert_eq!( execinfo.logs, diff --git a/crates/humanode-runtime/src/tests/fees.rs b/crates/humanode-runtime/src/tests/fees.rs index 945bd8dcb..697950bbc 100644 --- a/crates/humanode-runtime/src/tests/fees.rs +++ b/crates/humanode-runtime/src/tests/fees.rs @@ -169,7 +169,7 @@ pub mod crypto { } fn switch_block() { - use frame_support::traits::{OnFinalize, OnInitialize}; + use frame_support::traits::OnInitialize; if System::block_number() != 0 { AllPalletsWithSystem::on_finalize(System::block_number()); @@ -315,6 +315,8 @@ fn simple_evm_transaction_via_runner_estimate() { access_list, is_transactional, validate, + None, + None, config, ) .unwrap(); @@ -323,7 +325,11 @@ fn simple_evm_transaction_via_runner_estimate() { fp_evm::CallInfo { exit_reason: fp_evm::ExitReason::Succeed(fp_evm::ExitSucceed::Stopped), value: vec![], - used_gas: 21000.into(), + used_gas: fp_evm::UsedGas { + standard: 21000.into(), + effective: 21000.into(), + }, + weight_info: Default::default(), logs: vec![] } ); diff --git a/crates/pallet-dummy-precompiles-code/src/mock/v0.rs b/crates/pallet-dummy-precompiles-code/src/mock/v0.rs index 33b21b4ac..7f115ce1b 100644 --- a/crates/pallet-dummy-precompiles-code/src/mock/v0.rs +++ b/crates/pallet-dummy-precompiles-code/src/mock/v0.rs @@ -114,6 +114,7 @@ impl fp_evm::FeeCalculator for FixedGasPrice { frame_support::parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); + pub GasLimitPovSizeRatio: u64 = 0; pub WeightPerGas: Weight = Weight::from_parts(20_000, 0); } @@ -140,6 +141,7 @@ impl pallet_evm::Config for Test { type OnChargeTransaction = (); type OnCreate = (); type FindAuthor = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; type Timestamp = Timestamp; type WeightInfo = (); } diff --git a/crates/pallet-dummy-precompiles-code/src/mock/v1.rs b/crates/pallet-dummy-precompiles-code/src/mock/v1.rs index 31587f6f9..aeff7a758 100644 --- a/crates/pallet-dummy-precompiles-code/src/mock/v1.rs +++ b/crates/pallet-dummy-precompiles-code/src/mock/v1.rs @@ -120,6 +120,7 @@ impl fp_evm::FeeCalculator for FixedGasPrice { frame_support::parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); + pub GasLimitPovSizeRatio: u64 = 0; pub WeightPerGas: Weight = Weight::from_parts(20_000, 0); } @@ -146,6 +147,7 @@ impl pallet_evm::Config for Test { type OnChargeTransaction = (); type OnCreate = (); type FindAuthor = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; type Timestamp = Timestamp; type WeightInfo = (); } diff --git a/crates/precompile-bioauth/src/mock.rs b/crates/precompile-bioauth/src/mock.rs index 62298b74c..eb8de1ebd 100644 --- a/crates/precompile-bioauth/src/mock.rs +++ b/crates/precompile-bioauth/src/mock.rs @@ -213,6 +213,14 @@ mock! { fn is_static(&self) -> bool; fn gas_limit(&self) -> Option; + + fn record_external_cost( + &mut self, + ref_time: Option, + proof_size: Option, + ) -> Result<(), ExitError>; + + fn refund_external_cost(&mut self, ref_time: Option, proof_size: Option); } } diff --git a/crates/precompile-currency-swap/src/mock.rs b/crates/precompile-currency-swap/src/mock.rs index c49a1324b..0dd5ac6c4 100644 --- a/crates/precompile-currency-swap/src/mock.rs +++ b/crates/precompile-currency-swap/src/mock.rs @@ -3,7 +3,7 @@ // Allow simple integer arithmetic in tests. #![allow(clippy::arithmetic_side_effects)] -use fp_evm::PrecompileHandle; +use fp_evm::{IsPrecompileResult, PrecompileHandle}; use frame_support::{ once_cell::sync::Lazy, sp_io, @@ -122,6 +122,7 @@ impl fp_evm::FeeCalculator for FixedGasPrice { frame_support::parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); + pub GasLimitPovSizeRatio: u64 = 0; pub WeightPerGas: Weight = Weight::from_parts(20_000, 0); pub MockPrecompiles: MockPrecompileSet = MockPrecompileSet; } @@ -149,6 +150,7 @@ impl pallet_evm::Config for Test { type OnChargeTransaction = (); type OnCreate = (); type FindAuthor = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; type Timestamp = Timestamp; type WeightInfo = (); } @@ -178,8 +180,11 @@ impl pallet_evm::PrecompileSet for MockPrecompileSet { /// Check if the given address is a precompile. Should only be called to /// perform the check while not executing the precompile afterward, since /// `execute` already performs a check internally. - fn is_precompile(&self, address: H160) -> bool { - address == *PRECOMPILE_ADDRESS + fn is_precompile(&self, address: H160, _gas: u64) -> IsPrecompileResult { + IsPrecompileResult::Answer { + is_precompile: address == *PRECOMPILE_ADDRESS, + extra_cost: 0, + } } } diff --git a/crates/precompile-currency-swap/src/tests.rs b/crates/precompile-currency-swap/src/tests.rs index 79a79d5c7..dfd7381d5 100644 --- a/crates/precompile-currency-swap/src/tests.rs +++ b/crates/precompile-currency-swap/src/tests.rs @@ -77,6 +77,8 @@ fn swap_works() { Vec::new(), true, true, + None, + None, config, ) .unwrap(); @@ -84,7 +86,7 @@ fn swap_works() { execinfo.exit_reason, fp_evm::ExitReason::Succeed(fp_evm::ExitSucceed::Returned) ); - assert_eq!(execinfo.used_gas, expected_gas_usage.into()); + assert_eq!(execinfo.used_gas.standard, expected_gas_usage.into()); assert_eq!(execinfo.value, EvmDataWriter::new().write(true).build()); assert_eq!( execinfo.logs, @@ -178,6 +180,8 @@ fn swap_works_almost_full_balance() { Vec::new(), true, true, + None, + None, config, ) .unwrap(); @@ -185,7 +189,7 @@ fn swap_works_almost_full_balance() { execinfo.exit_reason, fp_evm::ExitReason::Succeed(fp_evm::ExitSucceed::Returned) ); - assert_eq!(execinfo.used_gas, expected_gas_usage.into()); + assert_eq!(execinfo.used_gas.standard, expected_gas_usage.into()); assert_eq!(execinfo.value, EvmDataWriter::new().write(true).build()); assert_eq!( execinfo.logs, @@ -264,6 +268,8 @@ fn swap_fail_no_funds() { Vec::new(), true, true, + None, + None, config, ) .unwrap_err(); @@ -343,6 +349,8 @@ fn swap_fail_below_ed() { Vec::new(), true, true, + None, + None, config, ) .unwrap(); @@ -350,7 +358,7 @@ fn swap_fail_below_ed() { execinfo.exit_reason, fp_evm::ExitReason::Error(fp_evm::ExitError::OutOfFund) ); - assert_eq!(execinfo.used_gas, expected_gas_usage.into()); + assert_eq!(execinfo.used_gas.standard, expected_gas_usage.into()); assert_eq!(execinfo.value, Vec::::new()); assert_eq!(execinfo.logs, Vec::new()); @@ -438,6 +446,8 @@ fn swap_fail_trait_error() { Vec::new(), true, true, + None, + None, config, ) .unwrap(); @@ -445,7 +455,7 @@ fn swap_fail_trait_error() { execinfo.exit_reason, fp_evm::ExitReason::Revert(ExitRevert::Reverted) ); - assert_eq!(execinfo.used_gas, expected_gas_usage.into()); + assert_eq!(execinfo.used_gas.standard, expected_gas_usage.into()); assert_eq!(execinfo.value, "unable to swap the currency".as_bytes()); assert_eq!(execinfo.logs, Vec::new()); @@ -530,6 +540,8 @@ fn swap_works_full_balance() { Vec::new(), true, true, + None, + None, config, ) .unwrap(); @@ -537,7 +549,7 @@ fn swap_works_full_balance() { execinfo.exit_reason, fp_evm::ExitReason::Succeed(fp_evm::ExitSucceed::Returned) ); - assert_eq!(execinfo.used_gas, expected_gas_usage.into()); + assert_eq!(execinfo.used_gas.standard, expected_gas_usage.into()); assert_eq!(execinfo.value, EvmDataWriter::new().write(true).build()); assert_eq!( execinfo.logs, @@ -617,6 +629,8 @@ fn swap_fail_bad_selector() { Vec::new(), true, true, + None, + None, config, ) .unwrap(); @@ -624,7 +638,7 @@ fn swap_fail_bad_selector() { execinfo.exit_reason, fp_evm::ExitReason::Error(fp_evm::ExitError::Other("invalid function selector".into())) ); - assert_eq!(execinfo.used_gas, expected_gas_usage.into()); + assert_eq!(execinfo.used_gas.standard, expected_gas_usage.into()); assert_eq!(execinfo.value, Vec::::new()); assert_eq!(execinfo.logs, Vec::new()); @@ -697,6 +711,8 @@ fn swap_fail_value_overflow() { Vec::new(), true, true, + None, + None, config, ) .unwrap_err(); @@ -769,6 +785,8 @@ fn swap_fail_no_arguments() { Vec::new(), true, true, + None, + None, config, ) .unwrap(); @@ -778,7 +796,7 @@ fn swap_fail_no_arguments() { "exactly one argument is expected".into() )) ); - assert_eq!(execinfo.used_gas, expected_gas_usage.into()); + assert_eq!(execinfo.used_gas.standard, expected_gas_usage.into()); assert_eq!(execinfo.value, Vec::::new()); assert_eq!(execinfo.logs, Vec::new()); @@ -848,6 +866,8 @@ fn swap_fail_short_argument() { Vec::new(), true, true, + None, + None, config, ) .unwrap(); @@ -857,7 +877,7 @@ fn swap_fail_short_argument() { "exactly one argument is expected".into() )) ); - assert_eq!(execinfo.used_gas, expected_gas_usage.into()); + assert_eq!(execinfo.used_gas.standard, expected_gas_usage.into()); assert_eq!(execinfo.value, Vec::::new()); assert_eq!(execinfo.logs, Vec::new()); @@ -929,6 +949,8 @@ fn swap_fail_trailing_junk() { Vec::new(), true, true, + None, + None, config, ) .unwrap(); @@ -936,7 +958,7 @@ fn swap_fail_trailing_junk() { execinfo.exit_reason, fp_evm::ExitReason::Error(fp_evm::ExitError::Other("junk at the end of input".into())) ); - assert_eq!(execinfo.used_gas, expected_gas_usage.into()); + assert_eq!(execinfo.used_gas.standard, expected_gas_usage.into()); assert_eq!(execinfo.value, Vec::::new()); assert_eq!(execinfo.logs, Vec::new()); diff --git a/crates/precompile-evm-accounts-mapping/src/mock.rs b/crates/precompile-evm-accounts-mapping/src/mock.rs index 6053645c2..97653914c 100644 --- a/crates/precompile-evm-accounts-mapping/src/mock.rs +++ b/crates/precompile-evm-accounts-mapping/src/mock.rs @@ -107,6 +107,14 @@ mock! { fn is_static(&self) -> bool; fn gas_limit(&self) -> Option; + + fn record_external_cost( + &mut self, + ref_time: Option, + proof_size: Option, + ) -> Result<(), ExitError>; + + fn refund_external_cost(&mut self, ref_time: Option, proof_size: Option); } } diff --git a/crates/precompile-native-currency/src/mock.rs b/crates/precompile-native-currency/src/mock.rs index 96c6e7ae4..621eb6500 100644 --- a/crates/precompile-native-currency/src/mock.rs +++ b/crates/precompile-native-currency/src/mock.rs @@ -154,6 +154,7 @@ pub type Precompiles = frame_support::parameter_types! { pub BlockGasLimit: U256 = U256::max_value(); + pub GasLimitPovSizeRatio: u64 = 0; pub WeightPerGas: Weight = Weight::from_parts(20_000, 0); pub PrecompileAddress: H160 = *PRECOMPILE_ADDRESS; pub PrecompilesValue: Precompiles = Precompiles::new(); @@ -182,6 +183,7 @@ impl pallet_evm::Config for Test { type OnChargeTransaction = (); type OnCreate = (); type FindAuthor = (); + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; type Timestamp = Timestamp; type WeightInfo = (); } diff --git a/crates/precompile-native-currency/src/tests.rs b/crates/precompile-native-currency/src/tests.rs index 769d5a302..ea166a43a 100644 --- a/crates/precompile-native-currency/src/tests.rs +++ b/crates/precompile-native-currency/src/tests.rs @@ -389,6 +389,8 @@ fn deposit_works() { Vec::new(), true, true, + None, + None, config, ) .unwrap(); @@ -396,7 +398,7 @@ fn deposit_works() { execinfo.exit_reason, fp_evm::ExitReason::Succeed(fp_evm::ExitSucceed::Returned) ); - assert_eq!(execinfo.used_gas, expected_gas_usage.into()); + assert_eq!(execinfo.used_gas.standard, expected_gas_usage.into()); assert_eq!(execinfo.value, EvmDataWriter::new().write(true).build()); assert_eq!( execinfo.logs, @@ -447,6 +449,8 @@ fn deposit_fails_zero_value() { Vec::new(), true, true, + None, + None, config, ) .unwrap(); @@ -454,7 +458,7 @@ fn deposit_fails_zero_value() { execinfo.exit_reason, fp_evm::ExitReason::Revert(ExitRevert::Reverted) ); - assert_eq!(execinfo.used_gas, expected_gas_usage.into()); + assert_eq!(execinfo.used_gas.standard, expected_gas_usage.into()); assert_eq!( execinfo.value, "deposited amount must be non-zero".as_bytes() @@ -501,6 +505,8 @@ fn withdraw_works() { Vec::new(), true, true, + None, + None, config, ) .unwrap(); @@ -508,7 +514,7 @@ fn withdraw_works() { execinfo.exit_reason, fp_evm::ExitReason::Succeed(fp_evm::ExitSucceed::Returned) ); - assert_eq!(execinfo.used_gas, expected_gas_usage.into()); + assert_eq!(execinfo.used_gas.standard, expected_gas_usage.into()); assert_eq!(execinfo.value, EvmDataWriter::new().write(true).build()); assert_eq!( execinfo.logs, @@ -559,6 +565,8 @@ fn withdraw_fails_more_than_allowed() { Vec::new(), true, true, + None, + None, config, ) .unwrap(); @@ -566,7 +574,7 @@ fn withdraw_fails_more_than_allowed() { execinfo.exit_reason, fp_evm::ExitReason::Revert(ExitRevert::Reverted) ); - assert_eq!(execinfo.used_gas, expected_gas_usage.into()); + assert_eq!(execinfo.used_gas.standard, expected_gas_usage.into()); assert_eq!( execinfo.value, "trying to withdraw more than owned".as_bytes() From 6fc23ec237a4759edf951a027836f8bd7af6ecd6 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Mon, 11 Dec 2023 15:58:19 +0300 Subject: [PATCH 20/43] Update features snapshot --- utils/checks/snapshots/features.yaml | 301 +++++++++++++++++++++------ 1 file changed, 236 insertions(+), 65 deletions(-) diff --git a/utils/checks/snapshots/features.yaml b/utils/checks/snapshots/features.yaml index 48bd20134..8cefb1535 100644 --- a/utils/checks/snapshots/features.yaml +++ b/utils/checks/snapshots/features.yaml @@ -56,6 +56,9 @@ features: - default - std +- name: allocator-api2 0.2.16 + features: + - alloc - name: android_system_properties 0.1.5 features: [] - name: ansi_term 0.12.1 @@ -131,6 +134,10 @@ - name: asynchronous-codec 0.6.1 features: - default +- name: atoi 2.0.0 + features: + - default + - std - name: atomic-waker 1.1.1 features: [] - name: atty 0.2.14 @@ -204,6 +211,9 @@ - name: bitflags 1.3.2 features: - default +- name: bitflags 2.4.1 + features: + - serde - name: bitvec 1.0.1 features: - alloc @@ -213,7 +223,8 @@ - default - std - name: blake2b_simd 1.0.1 - features: [] + features: + - std - name: blake2s_simd 1.0.1 features: [] - name: blake3 1.3.3 @@ -472,6 +483,11 @@ features: - alloc - std +- name: crossbeam-queue 0.3.8 + features: + - alloc + - default + - std - name: crossbeam-utils 0.8.15 features: - default @@ -587,6 +603,7 @@ features: - alloc - oid + - pem - std - zeroize - name: der-parser 7.0.0 @@ -647,6 +664,8 @@ features: - default - std +- name: dotenvy 0.15.7 + features: [] - name: downcast 0.11.0 features: - default @@ -735,6 +754,7 @@ - name: either 1.8.1 features: - default + - serde - use_std - name: elliptic-curve 0.12.3 features: @@ -782,10 +802,14 @@ - name: environmental 1.1.4 features: - std +- name: equivalent 1.0.1 + features: [] - name: errno 0.3.1 features: [] - name: errno-dragonfly 0.1.2 features: [] +- name: etcetera 0.8.0 + features: [] - name: ethabi 18.0.0 features: - full-serde @@ -833,7 +857,7 @@ - eip712 - name: event-listener 2.5.3 features: [] -- name: evm 0.37.0 +- name: evm 0.39.1 features: - environmental - scale-codec @@ -842,7 +866,7 @@ - std - with-codec - with-serde -- name: evm-core 0.37.0 +- name: evm-core 0.39.0 features: - scale-codec - scale-info @@ -850,16 +874,21 @@ - std - with-codec - with-serde -- name: evm-gasometer 0.37.0 +- name: evm-gasometer 0.39.0 features: - environmental - std -- name: evm-runtime 0.37.0 +- name: evm-runtime 0.39.0 features: - environmental - std - name: exit-future 0.2.0 features: [] +- name: expander 1.0.0 + features: + - default + - syn + - syndicate - name: facetec-api-client 0.1.0 features: [] - name: fake-simd 0.1.2 @@ -876,10 +905,23 @@ - name: fc-db 2.0.0-dev features: - default - - kvdb-rocksdb + - ethereum + - fc-storage + - fp-consensus + - fp-rpc + - futures - parity-db + - sc-client-api + - sp-api + - sp-storage + - sql + - sqlx + - tokio - name: fc-mapping-sync 2.0.0-dev - features: [] + features: + - sp-core + - sql + - tokio - name: fc-rpc 2.0.0-dev features: - rpc-binary-search-estimate @@ -912,6 +954,11 @@ - parking_lot - scale-info - std +- name: finl_unicode 1.2.0 + features: + - categories + - default + - grapheme_clusters - name: fixed-hash 0.8.0 features: - byteorder @@ -930,6 +977,11 @@ - default - num-traits - ratio +- name: flume 0.11.0 + features: + - async + - futures-core + - futures-sink - name: fnv 1.0.7 features: - default @@ -1022,8 +1074,14 @@ - name: frame-try-runtime 0.10.0-dev features: - std +- name: fs-err 2.11.0 + features: [] - name: fs2 0.4.3 features: [] +- name: fs4 0.6.5 + features: + - default + - sync - name: funty 2.0.0 features: [] - name: futures 0.3.28 @@ -1053,9 +1111,16 @@ - unstable - name: futures-executor 0.3.28 features: + - default - num_cpus - std - thread-pool +- name: futures-intrusive 0.5.0 + features: + - alloc + - default + - parking_lot + - std - name: futures-io 0.3.28 features: - default @@ -1158,6 +1223,9 @@ features: - default - name: hash-db 0.15.2 + features: + - std +- name: hash-db 0.16.0 features: - default - std @@ -1175,6 +1243,15 @@ - ahash - inline-more - raw +- name: hashbrown 0.14.2 + features: + - ahash + - allocator-api2 + - default + - inline-more + - raw +- name: hashlink 0.8.4 + features: [] - name: headers 0.3.8 features: [] - name: headers-core 0.2.0 @@ -1182,6 +1259,8 @@ - name: heck 0.4.1 features: - default + - unicode + - unicode-segmentation - name: hermit-abi 0.1.19 features: - default @@ -1196,6 +1275,8 @@ - alloc - default - std +- name: hex-literal 0.3.4 + features: [] - name: hex-literal 0.4.1 features: [] - name: hkdf 0.12.3 @@ -1210,6 +1291,8 @@ features: [] - name: hmac-drbg 0.3.0 features: [] +- name: home 0.5.5 + features: [] - name: hostname 0.3.1 features: - default @@ -1301,6 +1384,10 @@ - serde - serde-1 - std +- name: indexmap 2.1.0 + features: + - default + - std - name: indoc 2.0.1 features: [] - name: infer 0.2.3 @@ -1337,6 +1424,11 @@ - default - use_alloc - use_std +- name: itertools 0.12.0 + features: + - default + - use_alloc + - use_std - name: itoa 1.0.6 features: [] - name: jobserver 0.1.26 @@ -1408,7 +1500,9 @@ - name: kvdb-rocksdb 0.17.0 features: [] - name: lazy_static 1.4.0 - features: [] + features: + - spin + - spin_no_std - name: lazycell 1.3.0 features: [] - name: libc 0.2.141 @@ -1526,6 +1620,14 @@ features: [] - name: libsecp256k1-gen-genmult 0.3.0 features: [] +- name: libsqlite3-sys 0.26.0 + features: + - bundled + - bundled_bindings + - cc + - pkg-config + - unlock_notify + - vcpkg - name: libz-sys 1.1.8 features: - static @@ -1597,13 +1699,10 @@ - name: memoffset 0.6.5 features: - default -- name: memoffset 0.7.1 - features: - - default - name: memoffset 0.8.0 features: - default -- name: memory-db 0.31.0 +- name: memory-db 0.32.0 features: - std - name: memory_units 0.4.0 @@ -1758,43 +1857,6 @@ - uio - user - zerocopy -- name: nix 0.26.2 - features: - - acct - - aio - - default - - dir - - env - - event - - feature - - fs - - hostname - - inotify - - ioctl - - kmod - - memoffset - - mman - - mount - - mqueue - - net - - personality - - pin-utils - - poll - - process - - pthread - - ptrace - - quota - - reboot - - resource - - sched - - signal - - socket - - term - - time - - ucontext - - uio - - user - - zerocopy - name: nohash-hasher 0.2.0 features: - default @@ -1818,6 +1880,13 @@ features: - default - std +- name: num-bigint-dig 0.8.4 + features: + - i128 + - prime + - rand + - u64_digit + - zeroize - name: num-complex 0.4.3 features: - std @@ -1843,6 +1912,7 @@ features: - default - i128 + - libm - std - name: num_cpus 1.15.0 features: [] @@ -2155,6 +2225,9 @@ - name: pem-rfc7468 0.6.0 features: - alloc +- name: pem-rfc7468 0.7.0 + features: + - alloc - name: percent-encoding 2.2.0 features: - alloc @@ -2185,9 +2258,17 @@ features: [] - name: pin-utils 0.1.0 features: [] +- name: pkcs1 0.7.5 + features: + - alloc + - pem + - pkcs8 + - std + - zeroize - name: pkcs8 0.10.2 features: - alloc + - pem - std - name: pkcs8 0.9.0 features: @@ -2512,6 +2593,12 @@ features: [] - name: rpc-validator-key-logic 0.1.0 features: [] +- name: rsa 0.9.1 + features: + - default + - pem + - std + - u64_digit - name: rtcp 0.7.2 features: [] - name: rtnetlink 0.10.1 @@ -2601,7 +2688,6 @@ features: [] - name: sc-cli 0.10.0-dev features: - - default - rocksdb - name: sc-client-api 4.0.0-dev features: [] @@ -2618,6 +2704,10 @@ features: [] - name: sc-consensus-epochs 0.10.0-dev features: [] +- name: sc-consensus-grandpa 0.10.0-dev + features: [] +- name: sc-consensus-grandpa-rpc 0.10.0-dev + features: [] - name: sc-consensus-slots 0.10.0-dev features: [] - name: sc-executor 0.10.0-dev @@ -2631,10 +2721,6 @@ features: [] - name: sc-executor-wasmtime 0.10.0-dev features: [] -- name: sc-finality-grandpa 0.10.0-dev - features: [] -- name: sc-finality-grandpa-rpc 0.10.0-dev - features: [] - name: sc-informant 0.10.0-dev features: [] - name: sc-keystore 4.0.0-dev @@ -2670,9 +2756,7 @@ - name: sc-rpc-spec-v2 0.10.0-dev features: [] - name: sc-service 0.10.0-dev - features: - - default - - rocksdb + features: [] - name: sc-state-db 0.10.0-dev features: [] - name: sc-storage-monitor 0.1.0 @@ -2798,6 +2882,7 @@ - alloc - default - derive + - rc - serde_derive - std - name: serde_derive 1.0.160 @@ -2969,6 +3054,12 @@ - sp-keystore - sp-timestamp - std +- name: sp-consensus-grandpa 4.0.0-dev + features: + - default + - serde + - sp-keystore + - std - name: sp-consensus-slots 0.10.0-dev features: - default @@ -3018,12 +3109,6 @@ features: - default - std -- name: sp-finality-grandpa 4.0.0-dev - features: - - default - - serde - - sp-keystore - - std - name: sp-inherents 4.0.0-dev features: - async-trait @@ -3168,7 +3253,14 @@ features: [] - name: spin 0.9.8 features: + - barrier + - default + - lazy + - lock_api + - lock_api_crate - mutex + - once + - rwlock - spin_mutex - name: spki 0.6.0 features: @@ -3178,7 +3270,77 @@ - name: spki 0.7.1 features: - alloc + - pem - std +- name: sqlformat 0.2.3 + features: [] +- name: sqlx 0.7.2 + features: + - _rt-tokio + - any + - default + - json + - macros + - migrate + - runtime-tokio + - runtime-tokio-native-tls + - sqlite + - sqlx-macros + - sqlx-sqlite + - tls-native-tls +- name: sqlx-core 0.7.2 + features: + - _rt-tokio + - _tls-native-tls + - any + - crc + - default + - json + - migrate + - native-tls + - offline + - serde + - serde_json + - sha2 + - tokio + - tokio-stream +- name: sqlx-macros 0.7.2 + features: + - _rt-tokio + - _tls-native-tls + - default + - json + - migrate + - sqlite +- name: sqlx-macros-core 0.7.2 + features: + - _rt-tokio + - _tls-native-tls + - default + - json + - migrate + - sqlite + - sqlx-sqlite + - tokio +- name: sqlx-mysql 0.7.2 + features: + - any + - json + - migrate + - offline + - serde +- name: sqlx-postgres 0.7.2 + features: + - any + - json + - migrate +- name: sqlx-sqlite 0.7.2 + features: + - any + - json + - migrate + - offline + - serde - name: ss58-registry 1.39.0 features: - num-format @@ -3194,6 +3356,8 @@ - default - name: static_init_macro 1.0.2 features: [] +- name: stringprep 0.1.4 + features: [] - name: strsim 0.10.0 features: [] - name: strum 0.24.1 @@ -3360,6 +3524,7 @@ - name: tokio-stream 0.1.12 features: - default + - fs - sync - time - tokio-util @@ -3466,11 +3631,11 @@ features: [] - name: tracing-test-macro 0.2.4 features: [] -- name: trie-db 0.25.1 +- name: trie-db 0.27.1 features: - rustc-hex - std -- name: trie-root 0.17.0 +- name: trie-root 0.18.0 features: - std - name: triehash 0.8.4 @@ -3538,6 +3703,8 @@ - name: unicode-xid 0.2.4 features: - default +- name: unicode_categories 0.1.1 + features: [] - name: universal-hash 0.4.1 features: [] - name: universal-hash 0.5.0 @@ -3765,6 +3932,8 @@ - vnet - name: which 4.4.0 features: [] +- name: whoami 1.4.1 + features: [] - name: wide 0.7.13 features: - std @@ -3892,6 +4061,8 @@ - Win32_System_LibraryLoader - Win32_System_Threading - Win32_System_WindowsProgramming + - Win32_UI + - Win32_UI_Shell - default - name: windows-targets 0.42.2 features: [] From 3dfcf0c83ced42758a43bb9b44c4d1b99f2c3bb7 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Mon, 11 Dec 2023 15:59:33 +0300 Subject: [PATCH 21/43] Fux typo --- crates/humanode-peer/src/configuration.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/humanode-peer/src/configuration.rs b/crates/humanode-peer/src/configuration.rs index de0d71441..3abd0d08b 100644 --- a/crates/humanode-peer/src/configuration.rs +++ b/crates/humanode-peer/src/configuration.rs @@ -76,7 +76,7 @@ pub struct EthereumRpc { /// Sets the frontier backend type (KeyValue or Sql). pub frontier_backend_type: FrontierBackendType, - // Sets the SQL backend's pool size. + /// Sets the SQL backend's pool size. pub frontier_sql_backend_pool_size: u32, /// Sets the SQL backend's query timeout in number of VM ops. From 2f394d620cd57bedd4905db2f9c81d25e7a2fb07 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Mon, 11 Dec 2023 16:00:29 +0300 Subject: [PATCH 22/43] Fix clippy default usage --- crates/humanode-peer/src/configuration.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/crates/humanode-peer/src/configuration.rs b/crates/humanode-peer/src/configuration.rs index 3abd0d08b..d75b47f28 100644 --- a/crates/humanode-peer/src/configuration.rs +++ b/crates/humanode-peer/src/configuration.rs @@ -91,16 +91,11 @@ pub struct EthereumRpc { } /// Avalailable frontier backend types. -#[derive(Debug, Copy, Clone, clap::ValueEnum)] +#[derive(Default, Debug, Copy, Clone, clap::ValueEnum)] pub enum FrontierBackendType { /// Either RocksDb or ParityDb as per inherited from the global backend settings. + #[default] KeyValue, /// Sql database with custom log indexing. Sql, } - -impl Default for FrontierBackendType { - fn default() -> FrontierBackendType { - FrontierBackendType::KeyValue - } -} From 62dd6c22b81348bea328953dadbc8f94ae06a8b0 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Mon, 11 Dec 2023 16:01:10 +0300 Subject: [PATCH 23/43] Fix clippy ref usage --- crates/humanode-peer/src/cli/params.rs | 2 +- crates/humanode-peer/src/service/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/humanode-peer/src/cli/params.rs b/crates/humanode-peer/src/cli/params.rs index 22e9f8c34..9f0c4ea00 100644 --- a/crates/humanode-peer/src/cli/params.rs +++ b/crates/humanode-peer/src/cli/params.rs @@ -80,7 +80,7 @@ pub struct EthereumRpcParams { #[arg(long, value_enum, ignore_case = true, default_value_t = FrontierBackendType::default())] pub frontier_backend_type: FrontierBackendType, - // Sets the SQL backend's pool size. + /// Sets the SQL backend's pool size. #[arg(long, default_value = "100")] pub frontier_sql_backend_pool_size: u32, diff --git a/crates/humanode-peer/src/service/mod.rs b/crates/humanode-peer/src/service/mod.rs index 5b5717e2e..516eef6b1 100644 --- a/crates/humanode-peer/src/service/mod.rs +++ b/crates/humanode-peer/src/service/mod.rs @@ -173,7 +173,7 @@ pub fn new_partial( let frontier_backend = frontier::frontier_backend( config, Arc::clone(&client), - ð_rpc, + eth_rpc, fc_storage::overrides_handle(Arc::clone(&client)), ); let frontier_block_import = FrontierBlockImport::new(babe_block_import, Arc::clone(&client)); From bd7b194703ac3f3ed1cab7a1580a8f93dbd37570 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Mon, 11 Dec 2023 16:01:48 +0300 Subject: [PATCH 24/43] Add missing docs --- crates/humanode-peer/src/service/frontier.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/humanode-peer/src/service/frontier.rs b/crates/humanode-peer/src/service/frontier.rs index adf197b65..74f9ed0ea 100644 --- a/crates/humanode-peer/src/service/frontier.rs +++ b/crates/humanode-peer/src/service/frontier.rs @@ -12,7 +12,7 @@ use super::{FrontierBackend, FullClient}; use crate::configuration::{EthereumRpc, FrontierBackendType}; /// Create frontier dir. -pub fn db_config_dir(config: &sc_service::Configuration) -> std::path::PathBuf { +fn db_config_dir(config: &sc_service::Configuration) -> std::path::PathBuf { config .base_path .as_ref() @@ -23,6 +23,7 @@ pub fn db_config_dir(config: &sc_service::Configuration) -> std::path::PathBuf { }) } +/// Create frontier backend. pub fn frontier_backend( config: &Configuration, client: Arc, From 0f3b31dfd48c4b0d4d7da230ff1ef979a2f54423 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Mon, 11 Dec 2023 16:29:02 +0300 Subject: [PATCH 25/43] Introduce frontier backend configuration --- crates/humanode-peer/src/cli/config.rs | 20 ++++-- crates/humanode-peer/src/cli/params.rs | 4 ++ crates/humanode-peer/src/cli/run.rs | 4 +- crates/humanode-peer/src/configuration.rs | 6 ++ crates/humanode-peer/src/service/frontier.rs | 68 +++++++++----------- crates/humanode-peer/src/service/mod.rs | 4 +- 6 files changed, 60 insertions(+), 46 deletions(-) diff --git a/crates/humanode-peer/src/cli/config.rs b/crates/humanode-peer/src/cli/config.rs index df539ded1..aa5da88fc 100644 --- a/crates/humanode-peer/src/cli/config.rs +++ b/crates/humanode-peer/src/cli/config.rs @@ -52,13 +52,17 @@ pub trait CliConfigurationExt: SubstrateCliConfigurationProvider { max_stored_filters: params.max_stored_filters, fee_history_limit: params.fee_history_limit, execute_gas_limit_multiplier: params.execute_gas_limit_multiplier, - frontier_backend_type: params.frontier_backend_type, - frontier_sql_backend_pool_size: params.frontier_sql_backend_pool_size, - frontier_sql_backend_num_ops_timeout: params.frontier_sql_backend_num_ops_timeout, - frontier_sql_backend_thread_count: params.frontier_sql_backend_thread_count, - frontier_sql_backend_cache_size: params.frontier_sql_backend_cache_size, }); + let fb_params = self.frontier_backend(); + let frontier_backend = configuration::FrontierBackend { + frontier_backend_type: fb_params.frontier_backend_type, + frontier_sql_backend_pool_size: fb_params.frontier_sql_backend_pool_size, + frontier_sql_backend_num_ops_timeout: fb_params.frontier_sql_backend_num_ops_timeout, + frontier_sql_backend_thread_count: fb_params.frontier_sql_backend_thread_count, + frontier_sql_backend_cache_size: fb_params.frontier_sql_backend_cache_size, + }; + let time_warp = self.time_warp_params().and_then(|params| { params .time_warp_fork_timestamp @@ -76,6 +80,7 @@ pub trait CliConfigurationExt: SubstrateCliConfigurationProvider { substrate, bioauth_flow, ethereum_rpc, + frontier_backend, time_warp, }) } @@ -90,6 +95,11 @@ pub trait CliConfigurationExt: SubstrateCliConfigurationProvider { None } + /// Provide the Frontier backend params. + fn frontier_backend(&self) -> params::FrontierBackendParams { + Default::default() + } + /// Provide the time warp related params, if available. fn time_warp_params(&self) -> Option<¶ms::TimeWarpParams> { None diff --git a/crates/humanode-peer/src/cli/params.rs b/crates/humanode-peer/src/cli/params.rs index 9f0c4ea00..667229afa 100644 --- a/crates/humanode-peer/src/cli/params.rs +++ b/crates/humanode-peer/src/cli/params.rs @@ -75,7 +75,11 @@ pub struct EthereumRpcParams { /// block.gas_limit * execute_gas_limit_multiplier. #[arg(long, default_value = "10")] pub execute_gas_limit_multiplier: u64, +} +/// Shared CLI parameters used to configure Frontier backend. +#[derive(Debug, Default, clap::Parser, Clone)] +pub struct FrontierBackendParams { /// Sets the frontier backend type (KeyValue or Sql). #[arg(long, value_enum, ignore_case = true, default_value_t = FrontierBackendType::default())] pub frontier_backend_type: FrontierBackendType, diff --git a/crates/humanode-peer/src/cli/run.rs b/crates/humanode-peer/src/cli/run.rs index fd986bace..896cbd461 100644 --- a/crates/humanode-peer/src/cli/run.rs +++ b/crates/humanode-peer/src/cli/run.rs @@ -231,8 +231,8 @@ pub async fn run() -> sc_cli::Result<()> { runner.sync_run(|config| { let partial = service::new_partial(&config)?; let frontier_backend = match partial.other.4 { - fc_db::Backend::KeyValue(kv) => Arc::new(kv), - _ => panic!("Only fc_db::Backend::KeyValue supported"), + fc_db::Backend::KeyValue(kv_fb) => Arc::new(kv_fb), + _ => panic!("Only fc_db::Backend::KeyValue supported for FrontierDb command"), }; cmd.run(partial.client, frontier_backend) }) diff --git a/crates/humanode-peer/src/configuration.rs b/crates/humanode-peer/src/configuration.rs index d75b47f28..920255c74 100644 --- a/crates/humanode-peer/src/configuration.rs +++ b/crates/humanode-peer/src/configuration.rs @@ -21,6 +21,9 @@ pub struct Configuration { /// Ethereum RPC configuration. pub ethereum_rpc: Option, + /// Frontier backend configuration. + pub frontier_backend: FrontierBackend, + /// Time warp mode configuration. /// If not defined, time warp mode isn't enabled. pub time_warp: Option, @@ -72,7 +75,10 @@ pub struct EthereumRpc { /// When using eth_call/eth_estimateGas, the maximum allowed gas limit will be /// block.gas_limit * execute_gas_limit_multiplier. pub execute_gas_limit_multiplier: u64, +} +/// Frontier backend configuration parameters. +pub struct FrontierBackend { /// Sets the frontier backend type (KeyValue or Sql). pub frontier_backend_type: FrontierBackendType, diff --git a/crates/humanode-peer/src/service/frontier.rs b/crates/humanode-peer/src/service/frontier.rs index 74f9ed0ea..470620a0d 100644 --- a/crates/humanode-peer/src/service/frontier.rs +++ b/crates/humanode-peer/src/service/frontier.rs @@ -9,7 +9,7 @@ use sc_client_api::backend::Backend; use sc_service::{BasePath, Configuration}; use super::{FrontierBackend, FullClient}; -use crate::configuration::{EthereumRpc, FrontierBackendType}; +use crate::configuration::{self, FrontierBackendType}; /// Create frontier dir. fn db_config_dir(config: &sc_service::Configuration) -> std::path::PathBuf { @@ -27,45 +27,39 @@ fn db_config_dir(config: &sc_service::Configuration) -> std::path::PathBuf { pub fn frontier_backend( config: &Configuration, client: Arc, - eth_rpc: &Option, + fb_config: &configuration::FrontierBackend, eth_overrides: Arc>, ) -> FrontierBackend { - let key_value_frontier_backend = FrontierBackend::KeyValue( - fc_db::kv::Backend::open( - Arc::clone(&client), - &config.database, - &db_config_dir(config), - ) - .unwrap(), - ); - - if let Some(eth_rpc) = eth_rpc { - match eth_rpc.frontier_backend_type { - FrontierBackendType::KeyValue => key_value_frontier_backend, - FrontierBackendType::Sql => { - let db_path = db_config_dir(config).join("sql"); - std::fs::create_dir_all(&db_path).expect("failed creating sql db directory"); - let backend = futures::executor::block_on(fc_db::sql::Backend::new( - fc_db::sql::BackendConfig::Sqlite(fc_db::sql::SqliteBackendConfig { - path: Path::new("sqlite:///") - .join(db_path) - .join("frontier.db3") - .to_str() - .unwrap(), - create_if_missing: true, - thread_count: eth_rpc.frontier_sql_backend_thread_count, - cache_size: eth_rpc.frontier_sql_backend_cache_size, - }), - eth_rpc.frontier_sql_backend_pool_size, - std::num::NonZeroU32::new(eth_rpc.frontier_sql_backend_num_ops_timeout), - Arc::clone(ð_overrides), - )) - .unwrap_or_else(|err| panic!("failed creating sql backend: {:?}", err)); - FrontierBackend::Sql(backend) - } + match fb_config.frontier_backend_type { + FrontierBackendType::KeyValue => FrontierBackend::KeyValue( + fc_db::kv::Backend::open( + Arc::clone(&client), + &config.database, + &db_config_dir(config), + ) + .unwrap(), + ), + FrontierBackendType::Sql => { + let db_path = db_config_dir(config).join("sql"); + std::fs::create_dir_all(&db_path).expect("failed creating sql db directory"); + let backend = futures::executor::block_on(fc_db::sql::Backend::new( + fc_db::sql::BackendConfig::Sqlite(fc_db::sql::SqliteBackendConfig { + path: Path::new("sqlite:///") + .join(db_path) + .join("frontier.db3") + .to_str() + .unwrap(), + create_if_missing: true, + thread_count: fb_config.frontier_sql_backend_thread_count, + cache_size: fb_config.frontier_sql_backend_cache_size, + }), + fb_config.frontier_sql_backend_pool_size, + std::num::NonZeroU32::new(fb_config.frontier_sql_backend_num_ops_timeout), + Arc::clone(ð_overrides), + )) + .unwrap_or_else(|err| panic!("failed creating sql backend: {:?}", err)); + FrontierBackend::Sql(backend) } - } else { - key_value_frontier_backend } } diff --git a/crates/humanode-peer/src/service/mod.rs b/crates/humanode-peer/src/service/mod.rs index 516eef6b1..ce92c2a81 100644 --- a/crates/humanode-peer/src/service/mod.rs +++ b/crates/humanode-peer/src/service/mod.rs @@ -110,7 +110,7 @@ pub fn new_partial( let Configuration { substrate: config, time_warp: time_warp_config, - ethereum_rpc: eth_rpc, + frontier_backend: fronter_backend_config, .. } = config; @@ -173,7 +173,7 @@ pub fn new_partial( let frontier_backend = frontier::frontier_backend( config, Arc::clone(&client), - eth_rpc, + fronter_backend_config, fc_storage::overrides_handle(Arc::clone(&client)), ); let frontier_block_import = FrontierBlockImport::new(babe_block_import, Arc::clone(&client)); From 1748656941f96ddd3e3658a540e60f112a98a63d Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Tue, 12 Dec 2023 20:18:26 +0300 Subject: [PATCH 26/43] [frontier-apply] make rocksdb and paritydb optional. (#1088) --- Cargo.lock | 2 ++ crates/humanode-peer/Cargo.toml | 3 ++- crates/humanode-peer/src/cli/run.rs | 8 +++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 949baedaf..34ac31158 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2518,12 +2518,14 @@ dependencies = [ "fp-rpc", "fp-storage", "futures", + "kvdb-rocksdb", "log", "parity-db", "parity-scale-codec", "parking_lot 0.12.1", "sc-client-api", "sc-client-db", + "smallvec", "sp-api", "sp-blockchain", "sp-core", diff --git a/crates/humanode-peer/Cargo.toml b/crates/humanode-peer/Cargo.toml index c8bb1d9e0..3ed7b7551 100644 --- a/crates/humanode-peer/Cargo.toml +++ b/crates/humanode-peer/Cargo.toml @@ -87,7 +87,8 @@ sp-io = { workspace = true } vergen = { workspace = true, features = ["cargo", "git", "gitcl"] } [features] -default = [] +default = ["rocksdb"] +rocksdb = ["fc-db/rocksdb"] runtime-benchmarks = [ "frame-benchmarking-cli/runtime-benchmarks", "frame-benchmarking/runtime-benchmarks", diff --git a/crates/humanode-peer/src/cli/run.rs b/crates/humanode-peer/src/cli/run.rs index 896cbd461..425601b29 100644 --- a/crates/humanode-peer/src/cli/run.rs +++ b/crates/humanode-peer/src/cli/run.rs @@ -86,7 +86,13 @@ pub async fn run() -> sc_cli::Result<()> { } Some(Subcommand::PurgeChain(cmd)) => { let runner = root.create_humanode_runner(cmd)?; - runner.sync_run(|config| cmd.run(config.substrate.database)) + runner.sync_run(|config| { + match config.frontier_backend.frontier_backend_type { + crate::configuration::FrontierBackendType::KeyValue => todo!(), + crate::configuration::FrontierBackendType::Sql => todo!(), + } + cmd.run(config.substrate.database) + }) } Some(Subcommand::Revert(cmd)) => { let runner = root.create_humanode_runner(cmd)?; From 51b3313438457710eb1d82053732cb8453085e3a Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Tue, 12 Dec 2023 20:51:48 +0300 Subject: [PATCH 27/43] Make new_partial async --- crates/humanode-peer/src/cli/run.rs | 42 ++++++++++++++----------- crates/humanode-peer/src/service/mod.rs | 8 +++-- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/crates/humanode-peer/src/cli/run.rs b/crates/humanode-peer/src/cli/run.rs index 425601b29..f6895c91d 100644 --- a/crates/humanode-peer/src/cli/run.rs +++ b/crates/humanode-peer/src/cli/run.rs @@ -39,7 +39,7 @@ pub async fn run() -> sc_cli::Result<()> { task_manager, import_queue, .. - } = service::new_partial(&config)?; + } = service::new_partial(&config).await?; Ok((cmd.run(client, import_queue), task_manager)) }) .await @@ -52,7 +52,7 @@ pub async fn run() -> sc_cli::Result<()> { client, task_manager, .. - } = service::new_partial(&config)?; + } = service::new_partial(&config).await?; Ok((cmd.run(client, config.substrate.database), task_manager)) }) .await @@ -65,7 +65,7 @@ pub async fn run() -> sc_cli::Result<()> { client, task_manager, .. - } = service::new_partial(&config)?; + } = service::new_partial(&config).await?; Ok((cmd.run(client, config.substrate.chain_spec), task_manager)) }) .await @@ -79,7 +79,7 @@ pub async fn run() -> sc_cli::Result<()> { task_manager, import_queue, .. - } = service::new_partial(&config)?; + } = service::new_partial(&config).await?; Ok((cmd.run(client, import_queue), task_manager)) }) .await @@ -103,7 +103,7 @@ pub async fn run() -> sc_cli::Result<()> { task_manager, backend, .. - } = service::new_partial(&config)?; + } = service::new_partial(&config).await?; let aux_revert = Box::new(|client, backend, blocks| { sc_consensus_babe::revert(Arc::clone(&client), backend, blocks)?; sc_consensus_grandpa::revert(client, blocks)?; @@ -149,7 +149,7 @@ pub async fn run() -> sc_cli::Result<()> { let cmd = &**cmd; let runner = root.create_humanode_runner(cmd)?; - runner.sync_run(|config| { + runner.async_run(|config| async move { // This switch needs to be in the client, since the client decides // which sub-commands it wants to support. match cmd { @@ -165,7 +165,7 @@ pub async fn run() -> sc_cli::Result<()> { cmd.run::(config.substrate) } BenchmarkCmd::Block(cmd) => { - let partial = service::new_partial(&config)?; + let partial = service::new_partial(&config).await?; cmd.run(partial.client) } #[cfg(not(feature = "runtime-benchmarks"))] @@ -175,7 +175,7 @@ pub async fn run() -> sc_cli::Result<()> { ), #[cfg(feature = "runtime-benchmarks")] BenchmarkCmd::Storage(cmd) => { - let partial = service::new_partial(&config)?; + let partial = service::new_partial(&config).await?; let db = partial.backend.expose_db(); let storage = partial.backend.expose_storage(); @@ -187,7 +187,7 @@ pub async fn run() -> sc_cli::Result<()> { ), #[cfg(feature = "runtime-benchmarks")] BenchmarkCmd::Overhead(cmd) => { - let partial = service::new_partial(&config)?; + let partial = service::new_partial(&config).await?; let ext_builder = RemarkBuilder { client: Arc::clone(&partial.client), }; @@ -206,7 +206,7 @@ pub async fn run() -> sc_cli::Result<()> { ), #[cfg(feature = "runtime-benchmarks")] BenchmarkCmd::Extrinsic(cmd) => { - let partial = service::new_partial(&config)?; + let partial = service::new_partial(&config).await?; let existential_deposit = <::ExistentialDeposit as Get>::get(); let ext_factory = ExtrinsicFactory(vec![ Box::new(RemarkBuilder { @@ -230,18 +230,22 @@ pub async fn run() -> sc_cli::Result<()> { cmd.run(&config.substrate, SUBSTRATE_REFERENCE_HARDWARE.clone()) } } - }) + }).await } Some(Subcommand::FrontierDb(cmd)) => { let runner = root.create_humanode_runner(cmd)?; - runner.sync_run(|config| { - let partial = service::new_partial(&config)?; - let frontier_backend = match partial.other.4 { - fc_db::Backend::KeyValue(kv_fb) => Arc::new(kv_fb), - _ => panic!("Only fc_db::Backend::KeyValue supported for FrontierDb command"), - }; - cmd.run(partial.client, frontier_backend) - }) + runner + .async_run(|config| async move { + let partial = service::new_partial(&config).await?; + let frontier_backend = match partial.other.4 { + fc_db::Backend::KeyValue(kv_fb) => Arc::new(kv_fb), + _ => { + panic!("Only fc_db::Backend::KeyValue supported for FrontierDb command") + } + }; + cmd.run(partial.client, frontier_backend) + }) + .await } Some(Subcommand::ExportEmbeddedRuntime(cmd)) => cmd.run().await, #[cfg(feature = "try-runtime")] diff --git a/crates/humanode-peer/src/service/mod.rs b/crates/humanode-peer/src/service/mod.rs index ce92c2a81..d0cb16116 100644 --- a/crates/humanode-peer/src/service/mod.rs +++ b/crates/humanode-peer/src/service/mod.rs @@ -87,7 +87,7 @@ pub fn keystore_container( } /// Extract substrate partial components. -pub fn new_partial( +pub async fn new_partial( config: &Configuration, ) -> Result< PartialComponents< @@ -175,7 +175,9 @@ pub fn new_partial( Arc::clone(&client), fronter_backend_config, fc_storage::overrides_handle(Arc::clone(&client)), - ); + ) + .await?; + let frontier_block_import = FrontierBlockImport::new(babe_block_import, Arc::clone(&client)); let raw_slot_duration = babe_link.config().slot_duration(); @@ -235,7 +237,7 @@ pub async fn new_full(config: Configuration) -> Result Date: Tue, 12 Dec 2023 20:52:10 +0300 Subject: [PATCH 28/43] Return result for frontier backend creation --- crates/humanode-peer/src/service/frontier.rs | 34 ++++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/crates/humanode-peer/src/service/frontier.rs b/crates/humanode-peer/src/service/frontier.rs index 470620a0d..542f87dda 100644 --- a/crates/humanode-peer/src/service/frontier.rs +++ b/crates/humanode-peer/src/service/frontier.rs @@ -8,7 +8,7 @@ use sc_cli::SubstrateCli; use sc_client_api::backend::Backend; use sc_service::{BasePath, Configuration}; -use super::{FrontierBackend, FullClient}; +use super::{FrontierBackend, FullClient, ServiceError}; use crate::configuration::{self, FrontierBackendType}; /// Create frontier dir. @@ -24,31 +24,29 @@ fn db_config_dir(config: &sc_service::Configuration) -> std::path::PathBuf { } /// Create frontier backend. -pub fn frontier_backend( +pub async fn frontier_backend( config: &Configuration, client: Arc, fb_config: &configuration::FrontierBackend, eth_overrides: Arc>, -) -> FrontierBackend { +) -> Result { match fb_config.frontier_backend_type { - FrontierBackendType::KeyValue => FrontierBackend::KeyValue( - fc_db::kv::Backend::open( - Arc::clone(&client), - &config.database, - &db_config_dir(config), - ) - .unwrap(), - ), + FrontierBackendType::KeyValue => Ok(FrontierBackend::KeyValue(fc_db::kv::Backend::open( + Arc::clone(&client), + &config.database, + &db_config_dir(config), + )?)), FrontierBackendType::Sql => { let db_path = db_config_dir(config).join("sql"); - std::fs::create_dir_all(&db_path).expect("failed creating sql db directory"); - let backend = futures::executor::block_on(fc_db::sql::Backend::new( + std::fs::create_dir_all(&db_path)?; + + let backend = fc_db::sql::Backend::new( fc_db::sql::BackendConfig::Sqlite(fc_db::sql::SqliteBackendConfig { path: Path::new("sqlite:///") .join(db_path) .join("frontier.db3") .to_str() - .unwrap(), + .ok_or(ServiceError::Other("invalid sqlite path".to_owned()))?, create_if_missing: true, thread_count: fb_config.frontier_sql_backend_thread_count, cache_size: fb_config.frontier_sql_backend_cache_size, @@ -56,9 +54,11 @@ pub fn frontier_backend( fb_config.frontier_sql_backend_pool_size, std::num::NonZeroU32::new(fb_config.frontier_sql_backend_num_ops_timeout), Arc::clone(ð_overrides), - )) - .unwrap_or_else(|err| panic!("failed creating sql backend: {:?}", err)); - FrontierBackend::Sql(backend) + ) + .await + .map_err(|err| ServiceError::Application(err.into()))?; + + Ok(FrontierBackend::Sql(backend)) } } } From c0d9e3ab34529317ff69fa1ce391da0826dc96ea Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Tue, 12 Dec 2023 21:22:49 +0300 Subject: [PATCH 29/43] Implement a helper function to remove frontier offchain db --- crates/humanode-peer/src/cli/run.rs | 50 +++++++++++++++++--- crates/humanode-peer/src/service/frontier.rs | 2 +- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/crates/humanode-peer/src/cli/run.rs b/crates/humanode-peer/src/cli/run.rs index f6895c91d..ab38af5f8 100644 --- a/crates/humanode-peer/src/cli/run.rs +++ b/crates/humanode-peer/src/cli/run.rs @@ -6,7 +6,7 @@ use frame_benchmarking_cli::*; use humanode_runtime::Block; #[cfg(feature = "runtime-benchmarks")] use humanode_runtime::Runtime; -use sc_service::PartialComponents; +use sc_service::{DatabaseSource, PartialComponents}; #[cfg(feature = "runtime-benchmarks")] use sp_core::Get; #[cfg(feature = "try-runtime")] @@ -18,7 +18,7 @@ use { use super::{bioauth, Root, Subcommand}; #[cfg(feature = "runtime-benchmarks")] use crate::benchmarking::{inherent_benchmark_data, RemarkBuilder, TransferKeepAliveBuilder}; -use crate::service; +use crate::{configuration, service}; /// Parse command line arguments and run the requested operation. pub async fn run() -> sc_cli::Result<()> { @@ -87,10 +87,7 @@ pub async fn run() -> sc_cli::Result<()> { Some(Subcommand::PurgeChain(cmd)) => { let runner = root.create_humanode_runner(cmd)?; runner.sync_run(|config| { - match config.frontier_backend.frontier_backend_type { - crate::configuration::FrontierBackendType::KeyValue => todo!(), - crate::configuration::FrontierBackendType::Sql => todo!(), - } + remove_frontier_offchain_db(cmd, &config)?; cmd.run(config.substrate.database) }) } @@ -310,3 +307,44 @@ fn print_build_info() { crate::build_info::CARGO_FEATURES ); } + +/// Remove Frontier offchain db. +fn remove_frontier_offchain_db( + cmd: &sc_cli::PurgeChainCmd, + config: &configuration::Configuration, +) -> sc_cli::Result<()> { + let fdb_config_dir = service::frontier::db_config_dir(&config.substrate); + + match config.frontier_backend.frontier_backend_type { + crate::configuration::FrontierBackendType::KeyValue => { + let frontier_database_config = match config.substrate.database { + DatabaseSource::RocksDb { .. } => DatabaseSource::RocksDb { + path: fc_db::kv::frontier_database_dir(&fdb_config_dir, "db"), + cache_size: 0, + }, + DatabaseSource::ParityDb { .. } => DatabaseSource::ParityDb { + path: fc_db::kv::frontier_database_dir(&fdb_config_dir, "paritydb"), + }, + _ => panic!("frontier supports either rocksdb or paritydb"), + }; + cmd.run(frontier_database_config)?; + } + crate::configuration::FrontierBackendType::Sql => { + let db_path = fdb_config_dir.join("sql"); + + match std::fs::remove_dir_all(&db_path) { + Ok(_) => { + tracing::info!("{:?} removed.", &db_path); + } + Err(ref err) if err.kind() == std::io::ErrorKind::NotFound => { + tracing::error!("{:?} did not exist.", &db_path); + } + Err(err) => { + return Err(format!("Cannot purge `{:?}` database: {:?}", db_path, err).into()) + } + }; + } + }; + + Ok(()) +} diff --git a/crates/humanode-peer/src/service/frontier.rs b/crates/humanode-peer/src/service/frontier.rs index 542f87dda..f871eb9bf 100644 --- a/crates/humanode-peer/src/service/frontier.rs +++ b/crates/humanode-peer/src/service/frontier.rs @@ -12,7 +12,7 @@ use super::{FrontierBackend, FullClient, ServiceError}; use crate::configuration::{self, FrontierBackendType}; /// Create frontier dir. -fn db_config_dir(config: &sc_service::Configuration) -> std::path::PathBuf { +pub fn db_config_dir(config: &sc_service::Configuration) -> std::path::PathBuf { config .base_path .as_ref() From f2a03cc5a08cd0b1383f5a79189ae35268eb3b78 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Tue, 12 Dec 2023 21:44:38 +0300 Subject: [PATCH 30/43] Update features snapshot --- utils/checks/snapshots/features.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/checks/snapshots/features.yaml b/utils/checks/snapshots/features.yaml index 8cefb1535..a60f91645 100644 --- a/utils/checks/snapshots/features.yaml +++ b/utils/checks/snapshots/features.yaml @@ -910,8 +910,11 @@ - fp-consensus - fp-rpc - futures + - kvdb-rocksdb - parity-db + - rocksdb - sc-client-api + - smallvec - sp-api - sp-storage - sql @@ -1315,6 +1318,7 @@ - name: humanode-peer 0.1.0 features: - default + - rocksdb - name: humanode-rpc 0.1.0 features: [] - name: humanode-runtime 0.1.0 From 1e8cdd8eaed9451d49718c4609ef881d20b34426 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Tue, 12 Dec 2023 21:46:02 +0300 Subject: [PATCH 31/43] Fix clippy --- crates/humanode-runtime/src/lib.rs | 2 +- utils/e2e-tests/bash/fixtures/help.stdout.txt | 188 +++++++++--------- 2 files changed, 95 insertions(+), 95 deletions(-) diff --git a/crates/humanode-runtime/src/lib.rs b/crates/humanode-runtime/src/lib.rs index bb2916abb..cd4be5a73 100644 --- a/crates/humanode-runtime/src/lib.rs +++ b/crates/humanode-runtime/src/lib.rs @@ -1428,7 +1428,7 @@ impl_runtime_apis! { fn pending_block( xts: Vec<::Extrinsic>, ) -> (Option, Option>) { - for ext in xts.into_iter() { + for ext in xts { let _ = Executive::apply_extrinsic(ext); } diff --git a/utils/e2e-tests/bash/fixtures/help.stdout.txt b/utils/e2e-tests/bash/fixtures/help.stdout.txt index 6cbb6bab5..08962ed9d 100644 --- a/utils/e2e-tests/bash/fixtures/help.stdout.txt +++ b/utils/e2e-tests/bash/fixtures/help.stdout.txt @@ -38,7 +38,7 @@ Commands: Options: --validator Enable validator mode. - + The node will be started with the authority role and actively participate in any consensus task that it can (e.g. depending on availability of local keys). --no-grandpa @@ -46,22 +46,22 @@ Options: --rpc-external Listen to all RPC interfaces. - + Default is local. Note: not all RPC methods are safe to be exposed publicly. Use an RPC proxy server to filter out dangerous methods. More details: . Use `--unsafe-rpc-external` to suppress the warning if you understand the risks. --unsafe-rpc-external Listen to all RPC interfaces. - + Same as `--rpc-external`. --rpc-methods RPC methods to expose. - + - `unsafe`: Exposes every RPC method. - `safe`: Exposes only a safe subset of RPC methods, denying unsafe RPC methods. - `auto`: Acts as `safe` if RPC is served externally, e.g. when `--{rpc,ws}-external` is passed, otherwise acts as `unsafe`. - + [default: auto] Possible values: @@ -74,12 +74,12 @@ Options: --ws-external Listen to all Websocket interfaces. - + Default is local. Note: not all RPC methods are safe to be exposed publicly. Use an RPC proxy server to filter out dangerous methods. More details: . Use `--unsafe-ws-external` to suppress the warning if you understand the risks. --unsafe-ws-external Listen to all Websocket interfaces. - + Same as `--ws-external` but doesn't warn you about it. --rpc-max-payload @@ -96,7 +96,7 @@ Options: --prometheus-external Expose Prometheus exporter on all interfaces. - + Default is local. --ipc-path @@ -116,7 +116,7 @@ Options: --rpc-cors Specify browser Origins allowed to access the HTTP & WS RPC servers. - + A comma-separated list of origins (protocol://domain or special `null` value). Value of `all` will disable origin validation. Default is to allow localhost and origins. When running in --dev mode the default is to allow all origins. --prometheus-port @@ -124,29 +124,29 @@ Options: --no-prometheus Do not expose a Prometheus exporter endpoint. - + Prometheus metric endpoint is enabled by default. --name The human-readable name for this node. - + The node name will be reported to the telemetry server, if enabled. --no-telemetry Disable connecting to the Substrate telemetry server. - + Telemetry is on by default on global chains. --telemetry-url The URL of the telemetry server to connect to. - + This flag can be passed multiple times as a means to specify multiple telemetry endpoints. Verbosity levels range from 0-9, with 0 denoting the least verbosity. Expected format is 'URL VERBOSITY', e.g. `--telemetry-url 'wss://foo/bar 0'`. --offchain-worker Should execute offchain workers on every block. - + By default it's only enabled for nodes that are authoring new blocks. - + [default: when-authority] Possible values: @@ -159,20 +159,20 @@ Options: --enable-offchain-indexing Enable Offchain Indexing API, which allows block import to write to Offchain DB. - + Enables a runtime to write directly to a offchain workers DB during block import. - + [default: false] [possible values: true, false] --chain Specify the chain specification. - + It can be one of the predefined ones (dev, local, or staging) or it can be a path to a file with the chainspec (such as one exported by the `build-spec` subcommand). --dev Specify the development chain. - + This flag sets `--chain=dev`, `--force-authoring`, `--rpc-cors=all`, `--alice`, and `--tmp` flags, unless explicitly overridden. -d, --base-path @@ -180,14 +180,14 @@ Options: -l, --log ... Sets a custom logging filter. Syntax is `=`, e.g. -lsync=debug. - + Log levels (least to most verbose) are error, warn, info, debug, and trace. By default, all targets log `info`. The global log level can be set with `-l`. --detailed-log-output Enable detailed log output. - + This includes displaying the log target, log level and thread name. - + This is automatically enabled when something is logged with any higher level than `info`. --disable-log-color @@ -195,9 +195,9 @@ Options: --enable-log-reloading Enable feature to dynamically update and reload the log filter. - + Be aware that enabling this feature can lead to a performance decrease up to factor six or more. Depending on the global logging level the performance decrease changes. - + The `system_addLogFilter` and `system_resetLogFilter` RPCs will have no effect with this option not being set. --tracing-targets @@ -205,7 +205,7 @@ Options: --tracing-receiver Receiver to process tracing messages - + [default: log] Possible values: @@ -213,44 +213,44 @@ Options: --state-pruning Specify the state pruning mode. - + This mode specifies when the block's state (ie, storage) should be pruned (ie, removed) from the database. - + This setting can only be set on the first creation of the database. Every subsequent run will load the pruning mode from the database and will error if the stored mode doesn't match this CLI value. It is fine to drop this CLI flag for subsequent runs. - + Possible values: - + - archive: - + Keep the state of all blocks. - + - 'archive-canonical' - + Keep only the state of finalized blocks. - + - number - + Keep the state of the last number of finalized blocks. - + [default: 256] --blocks-pruning Specify the blocks pruning mode. - + This mode specifies when the block's body (including justifications) should be pruned (ie, removed) from the database. - + Possible values: - 'archive' - + Keep all blocks. - + - 'archive-canonical' - + Keep only finalized blocks. - + - number - + Keep the last `number` of finalized blocks. - + [default: archive-canonical] --database @@ -271,7 +271,7 @@ Options: --wasm-execution Method for executing Wasm runtime code - + [default: compiled] Possible values: @@ -280,15 +280,15 @@ Options: --wasmtime-instantiation-strategy The WASM instantiation method to use. - + Only has an effect when `wasm-execution` is set to `compiled`. - + The copy-on-write strategies are only supported on Linux. If the copy-on-write variant of a strategy is unsupported the executor will fall back to the non-CoW equivalent. - + The fastest (and the default) strategy available is `pooling-copy-on-write`. - + The `legacy-instance-reuse` strategy is deprecated and will be removed in the future. It should only be used in case of issues with the default instantiation strategy. - + [default: pooling-copy-on-write] Possible values: @@ -305,7 +305,7 @@ Options: --wasm-runtime-overrides Specify the path where local WASM runtimes are stored. - + These runtimes will override on-chain runtimes when the version matches. --execution-syncing @@ -388,14 +388,14 @@ Options: --trie-cache-size Specify the state cache size. - + Providing `0` will disable the cache. - + [default: 67108864] --state-cache-size DEPRECATED - + Switch to `--trie-cache-size`. --bootnodes ... @@ -406,9 +406,9 @@ Options: --reserved-only Whether to only synchronize the chain with reserved nodes. - + Also disables automatic peer discovery. - + TCP connections might still be established with non-reserved nodes. In particular, if you are a validator your node might still connect to other validator nodes and collator nodes regardless of whether they are defined as reserved nodes. --public-addr ... @@ -416,7 +416,7 @@ Options: --listen-addr ... Listen on this multiaddress. - + By default: If `--validator` is passed: `/ip4/0.0.0.0/tcp/` and `/ip6/[::]/tcp/`. Otherwise: `/ip4/0.0.0.0/tcp//ws` and `/ip6/[::]/tcp//ws`. --port @@ -430,55 +430,55 @@ Options: --out-peers Specify the number of outgoing connections we're trying to maintain - + [default: 15] --in-peers Maximum number of inbound full nodes peers - + [default: 25] --in-peers-light Maximum number of inbound light nodes peers - + [default: 100] --no-mdns Disable mDNS discovery. - + By default, the network will use mDNS to discover other nodes on the local network. This disables it. Automatically implied when using --dev. --max-parallel-downloads Maximum number of peers from which to ask for the same blocks in parallel. - + This allows downloading announced blocks from multiple peers. Decrease to save traffic and risk increased latency. - + [default: 5] --node-key The secret key to use for libp2p networking. - + The value is a string that is parsed according to the choice of `--node-key-type` as follows: - + `ed25519`: The value is parsed as a hex-encoded Ed25519 32 byte secret key, i.e. 64 hex characters. - + The value of this option takes precedence over `--node-key-file`. - + WARNING: Secrets provided as command-line arguments are easily exposed. Use of this option should be limited to development and testing. To use an externally managed secret key, use `--node-key-file` instead. --node-key-type The type of secret key to use for libp2p networking. - + The secret key of the node is obtained as follows: - + * If the `--node-key` option is given, the value is parsed as a secret key according to the type. See the documentation for `--node-key`. - + * If the `--node-key-file` option is given, the secret key is read from the specified file. See the documentation for `--node-key-file`. - + * Otherwise, the secret key is read from a file with a predetermined, type-specific name from the chain-specific network config directory inside the base directory specified by `--base-dir`. If this file does not exist, it is created with a newly generated secret key of the chosen type. - + The node's secret key determines the corresponding public key and hence the node's peer ID in the context of libp2p. - + [default: ed25519] Possible values: @@ -486,21 +486,21 @@ Options: --node-key-file The file from which to read the node's secret key to use for libp2p networking. - + The contents of the file are parsed according to the choice of `--node-key-type` as follows: - + `ed25519`: The file must contain an unencoded 32 byte or hex encoded Ed25519 secret key. - + If the file does not exist, it is created with a newly generated secret key of the chosen type. --discover-local Enable peer discovery on local networks. - + By default this option is `true` for `--dev` or when the chain type is `Local`/`Development` and false otherwise. --kademlia-disjoint-query-paths Require iterative Kademlia DHT queries to use disjoint paths for increased resiliency in the presence of potentially adversarial nodes. - + See the S/Kademlia paper for more information on the high level design as well as its security improvements. --ipfs-server @@ -508,12 +508,12 @@ Options: --sync Blockchain syncing mode. - + - `full`: Download and validate full blockchain history. - `fast`: Download blocks and the latest state only. - `fast-unsafe`: Same as `fast`, but skip downloading state proofs. - `warp`: Download the latest state and proof. - + [default: full] Possible values: @@ -528,12 +528,12 @@ Options: --pool-limit Maximum number of transactions in the transaction pool - + [default: 8192] --pool-kbytes Maximum number of kilobytes of all transactions stored in the pool - + [default: 20480] --tx-ban-seconds @@ -583,21 +583,21 @@ Options: --max-runtime-instances The size of the instances cache for each runtime. - + The default value is 8 and the values higher than 256 are ignored. --runtime-cache-size Maximum number of different runtimes that can be cached - + [default: 2] --tmp Run a temporary node. - + A temporary directory will be created to store the configuration and will be deleted at the end of the process. - + Note: the directory is random per process execution. This directory is used as base path which includes: database, node key and keystore. - + When `--dev` is given and no explicit `--base-path`, this option is implied. --webapp-url @@ -608,7 +608,7 @@ Options: --rpc-url-scheme-preference What RPC URL scheme to prefer - + [default: no-preference] Possible values: @@ -624,7 +624,7 @@ Options: --rpc-url-ngrok-detect-from The tunnel name at ngrok to detect RPC URL from, if ngrok is used to detect the RPC URL - + [default: command_line] --robonode-url @@ -632,24 +632,24 @@ Options: --max-past-logs Maximum number of logs to keep from the latest block; it is not possible to query logs older than this amount from the latest block in the past - + [default: 10000] --max-stored-filters Maximum number of stored filters - + [default: 500] --fee-history-limit Maximum fee history cache size - + [default: 2048] --execute-gas-limit-multiplier A multiplier to allow larger gas limit in non-transactional execution. - + When using eth_call/eth_estimateGas, the maximum allowed gas limit will be block.gas_limit * execute_gas_limit_multiplier. - + [default: 10] --time-warp-revive-timestamp @@ -665,4 +665,4 @@ Options: Print help (see a summary with '-h') -V, --version - Print version + Print version From ea07c3222ef94db04e8e63280c346cd5bc4f7a86 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Tue, 12 Dec 2023 21:52:50 +0300 Subject: [PATCH 32/43] Update help stdout fixture --- utils/e2e-tests/bash/fixtures/help.stdout.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/e2e-tests/bash/fixtures/help.stdout.txt b/utils/e2e-tests/bash/fixtures/help.stdout.txt index 08962ed9d..1623b3eea 100644 --- a/utils/e2e-tests/bash/fixtures/help.stdout.txt +++ b/utils/e2e-tests/bash/fixtures/help.stdout.txt @@ -431,12 +431,12 @@ Options: --out-peers Specify the number of outgoing connections we're trying to maintain - [default: 15] + [default: 8] --in-peers Maximum number of inbound full nodes peers - [default: 25] + [default: 32] --in-peers-light Maximum number of inbound light nodes peers From 409db7098a1733a213e5ba22c160bde812e6289c Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Mon, 18 Dec 2023 11:56:55 +0300 Subject: [PATCH 33/43] [substrate-apply] Pub enum runtime to pub struct runtime #13250 --- crates/humanode-runtime/src/lib.rs | 2 +- .../src/mock/v0.rs | 3 ++- .../src/mock/v1.rs | 3 ++- .../src/mock/v2.rs | 3 ++- crates/pallet-bioauth/src/mock/testing.rs | 2 +- crates/pallet-chain-properties/src/mock.rs | 2 +- crates/pallet-chain-start-moment/src/mock.rs | 2 +- crates/pallet-currency-swap/src/mock.rs | 3 ++- crates/pallet-dummy-precompiles-code/src/mock/v0.rs | 3 ++- crates/pallet-dummy-precompiles-code/src/mock/v1.rs | 3 ++- crates/pallet-erc20-support/src/mock.rs | 3 ++- crates/pallet-ethereum-chain-id/src/mock.rs | 2 +- crates/pallet-evm-accounts-mapping/src/mock.rs | 2 +- crates/pallet-token-claims/src/mock.rs | 2 +- crates/pallet-vesting/src/mock.rs | 2 +- crates/precompile-bioauth/src/mock.rs | 2 +- crates/precompile-currency-swap/src/mock.rs | 3 ++- crates/precompile-evm-accounts-mapping/src/mock.rs | 3 ++- crates/precompile-native-currency/src/mock.rs | 3 ++- 19 files changed, 29 insertions(+), 19 deletions(-) diff --git a/crates/humanode-runtime/src/lib.rs b/crates/humanode-runtime/src/lib.rs index 307e67ccb..d0759470f 100644 --- a/crates/humanode-runtime/src/lib.rs +++ b/crates/humanode-runtime/src/lib.rs @@ -821,7 +821,7 @@ impl pallet_dummy_precompiles_code::Config for Runtime { // Create the runtime by composing the FRAME pallets that were previously // configured. construct_runtime!( - pub enum Runtime where + pub struct Runtime where Block = Block, NodeBlock = opaque::Block, UncheckedExtrinsic = UncheckedExtrinsic diff --git a/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v0.rs b/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v0.rs index 8d7d39e4c..02279cc53 100644 --- a/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v0.rs +++ b/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v0.rs @@ -19,7 +19,8 @@ type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub enum Test where + pub struct Test + where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v1.rs b/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v1.rs index e32f6e253..ec2ad2127 100644 --- a/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v1.rs +++ b/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v1.rs @@ -22,7 +22,8 @@ type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub enum Test where + pub struct Test + where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v2.rs b/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v2.rs index eb97e1cdf..a4c295231 100644 --- a/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v2.rs +++ b/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v2.rs @@ -22,7 +22,8 @@ type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub enum Test where + pub struct Test + where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/pallet-bioauth/src/mock/testing.rs b/crates/pallet-bioauth/src/mock/testing.rs index 28abb0579..6a43d892f 100644 --- a/crates/pallet-bioauth/src/mock/testing.rs +++ b/crates/pallet-bioauth/src/mock/testing.rs @@ -27,7 +27,7 @@ pub type BlockNumber = u64; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where + pub struct Test where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/pallet-chain-properties/src/mock.rs b/crates/pallet-chain-properties/src/mock.rs index 5d58dbe52..fbc194b0a 100644 --- a/crates/pallet-chain-properties/src/mock.rs +++ b/crates/pallet-chain-properties/src/mock.rs @@ -17,7 +17,7 @@ pub type BlockNumber = u64; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where + pub struct Test where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/pallet-chain-start-moment/src/mock.rs b/crates/pallet-chain-start-moment/src/mock.rs index cc06ff770..0d9e3ce65 100644 --- a/crates/pallet-chain-start-moment/src/mock.rs +++ b/crates/pallet-chain-start-moment/src/mock.rs @@ -19,7 +19,7 @@ type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub enum Test where + pub struct Test where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/pallet-currency-swap/src/mock.rs b/crates/pallet-currency-swap/src/mock.rs index 73d023f9a..d0f5b63ce 100644 --- a/crates/pallet-currency-swap/src/mock.rs +++ b/crates/pallet-currency-swap/src/mock.rs @@ -27,7 +27,8 @@ pub(crate) type EvmAccountId = H160; type Balance = u64; frame_support::construct_runtime!( - pub enum Test where + pub struct Test + where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/pallet-dummy-precompiles-code/src/mock/v0.rs b/crates/pallet-dummy-precompiles-code/src/mock/v0.rs index 7f115ce1b..0524b1b42 100644 --- a/crates/pallet-dummy-precompiles-code/src/mock/v0.rs +++ b/crates/pallet-dummy-precompiles-code/src/mock/v0.rs @@ -20,7 +20,8 @@ type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub enum Test where + pub struct Test + where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/pallet-dummy-precompiles-code/src/mock/v1.rs b/crates/pallet-dummy-precompiles-code/src/mock/v1.rs index aeff7a758..0842439a9 100644 --- a/crates/pallet-dummy-precompiles-code/src/mock/v1.rs +++ b/crates/pallet-dummy-precompiles-code/src/mock/v1.rs @@ -25,7 +25,8 @@ pub(crate) type EvmAccountId = H160; type Balance = u64; frame_support::construct_runtime!( - pub enum Test where + pub struct Test + where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/pallet-erc20-support/src/mock.rs b/crates/pallet-erc20-support/src/mock.rs index 499eb8602..589daf473 100644 --- a/crates/pallet-erc20-support/src/mock.rs +++ b/crates/pallet-erc20-support/src/mock.rs @@ -22,7 +22,8 @@ type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where + pub struct Test + where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/pallet-ethereum-chain-id/src/mock.rs b/crates/pallet-ethereum-chain-id/src/mock.rs index c33db0674..51d73d07e 100644 --- a/crates/pallet-ethereum-chain-id/src/mock.rs +++ b/crates/pallet-ethereum-chain-id/src/mock.rs @@ -17,7 +17,7 @@ pub type BlockNumber = u64; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where + pub struct Test where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/pallet-evm-accounts-mapping/src/mock.rs b/crates/pallet-evm-accounts-mapping/src/mock.rs index 2f4f49a5d..b0fae13fd 100644 --- a/crates/pallet-evm-accounts-mapping/src/mock.rs +++ b/crates/pallet-evm-accounts-mapping/src/mock.rs @@ -62,7 +62,7 @@ impl TestExternalitiesExt for frame_support::sp_io::TestExternalities { } frame_support::construct_runtime!( - pub enum Test where + pub struct Test where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/pallet-token-claims/src/mock.rs b/crates/pallet-token-claims/src/mock.rs index 0672e6940..7e817280d 100644 --- a/crates/pallet-token-claims/src/mock.rs +++ b/crates/pallet-token-claims/src/mock.rs @@ -25,7 +25,7 @@ type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub enum Test where + pub struct Test where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/pallet-vesting/src/mock.rs b/crates/pallet-vesting/src/mock.rs index 25fd6c2c0..7d176e7fb 100644 --- a/crates/pallet-vesting/src/mock.rs +++ b/crates/pallet-vesting/src/mock.rs @@ -20,7 +20,7 @@ type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub enum Test where + pub struct Test where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/precompile-bioauth/src/mock.rs b/crates/precompile-bioauth/src/mock.rs index eb8de1ebd..d19cb0b5a 100644 --- a/crates/precompile-bioauth/src/mock.rs +++ b/crates/precompile-bioauth/src/mock.rs @@ -29,7 +29,7 @@ pub type BlockNumber = u64; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where + pub struct Test where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/precompile-currency-swap/src/mock.rs b/crates/precompile-currency-swap/src/mock.rs index 0dd5ac6c4..f556d8f74 100644 --- a/crates/precompile-currency-swap/src/mock.rs +++ b/crates/precompile-currency-swap/src/mock.rs @@ -29,7 +29,8 @@ pub(crate) type Balance = u128; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where + pub struct Test + where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/precompile-evm-accounts-mapping/src/mock.rs b/crates/precompile-evm-accounts-mapping/src/mock.rs index 97653914c..005ffe979 100644 --- a/crates/precompile-evm-accounts-mapping/src/mock.rs +++ b/crates/precompile-evm-accounts-mapping/src/mock.rs @@ -26,7 +26,8 @@ pub type AccountId = <::Signer as IdentifyAccount>::Account // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where + pub struct Test + where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, diff --git a/crates/precompile-native-currency/src/mock.rs b/crates/precompile-native-currency/src/mock.rs index 621eb6500..6d835d6a7 100644 --- a/crates/precompile-native-currency/src/mock.rs +++ b/crates/precompile-native-currency/src/mock.rs @@ -30,7 +30,8 @@ pub(crate) const GAS_COST: u64 = 200; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where + pub struct Test + where Block = Block, NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, From 9b5459ebcd8e2fe266f4aac6f28dffd5bb794d9d Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Fri, 22 Dec 2023 14:37:32 +0300 Subject: [PATCH 34/43] Update frontier --- Cargo.lock | 83 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34ac31158..0a311c46c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2363,7 +2363,7 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "evm" version = "0.39.1" -source = "git+https://github.com/rust-blockchain/evm?branch=master#b7b82c7e1fc57b7449d6dfa6826600de37cc1e65" +source = "git+https://github.com/rust-blockchain/evm?rev=b7b82c7e1fc57b7449d6dfa6826600de37cc1e65#b7b82c7e1fc57b7449d6dfa6826600de37cc1e65" dependencies = [ "auto_impl", "environmental", @@ -2380,10 +2380,20 @@ dependencies = [ "sha3 0.10.6", ] +[[package]] +name = "evm" +version = "1.0.0-dev" +source = "git+https://github.com/rust-blockchain/evm?branch=master#9fdc7fe450a173c4452a0adee7d59ec784297e8c" +dependencies = [ + "evm-interpreter", + "primitive-types", + "sha3 0.10.6", +] + [[package]] name = "evm-core" version = "0.39.0" -source = "git+https://github.com/rust-blockchain/evm?branch=master#b7b82c7e1fc57b7449d6dfa6826600de37cc1e65" +source = "git+https://github.com/rust-blockchain/evm?rev=b7b82c7e1fc57b7449d6dfa6826600de37cc1e65#b7b82c7e1fc57b7449d6dfa6826600de37cc1e65" dependencies = [ "parity-scale-codec", "primitive-types", @@ -2394,7 +2404,7 @@ dependencies = [ [[package]] name = "evm-gasometer" version = "0.39.0" -source = "git+https://github.com/rust-blockchain/evm?branch=master#b7b82c7e1fc57b7449d6dfa6826600de37cc1e65" +source = "git+https://github.com/rust-blockchain/evm?rev=b7b82c7e1fc57b7449d6dfa6826600de37cc1e65#b7b82c7e1fc57b7449d6dfa6826600de37cc1e65" dependencies = [ "environmental", "evm-core", @@ -2402,10 +2412,23 @@ dependencies = [ "primitive-types", ] +[[package]] +name = "evm-interpreter" +version = "1.0.0-dev" +source = "git+https://github.com/rust-blockchain/evm?branch=master#9fdc7fe450a173c4452a0adee7d59ec784297e8c" +dependencies = [ + "parity-scale-codec", + "primitive-types", + "rlp", + "scale-info", + "serde", + "sha3 0.10.6", +] + [[package]] name = "evm-runtime" version = "0.39.0" -source = "git+https://github.com/rust-blockchain/evm?branch=master#b7b82c7e1fc57b7449d6dfa6826600de37cc1e65" +source = "git+https://github.com/rust-blockchain/evm?rev=b7b82c7e1fc57b7449d6dfa6826600de37cc1e65#b7b82c7e1fc57b7449d6dfa6826600de37cc1e65" dependencies = [ "auto_impl", "environmental", @@ -2475,7 +2498,7 @@ dependencies = [ [[package]] name = "fc-cli" version = "1.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "clap", "ethereum-types", @@ -2493,7 +2516,7 @@ dependencies = [ [[package]] name = "fc-consensus" version = "2.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "async-trait", "fp-consensus", @@ -2509,7 +2532,7 @@ dependencies = [ [[package]] name = "fc-db" version = "2.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "async-trait", "ethereum", @@ -2539,7 +2562,7 @@ dependencies = [ [[package]] name = "fc-mapping-sync" version = "2.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "fc-db", "fc-storage", @@ -2562,11 +2585,11 @@ dependencies = [ [[package]] name = "fc-rpc" version = "2.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "ethereum", "ethereum-types", - "evm", + "evm 0.39.1", "fc-db", "fc-mapping-sync", "fc-rpc-core", @@ -2612,7 +2635,7 @@ dependencies = [ [[package]] name = "fc-rpc-core" version = "1.1.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "ethereum", "ethereum-types", @@ -2625,7 +2648,7 @@ dependencies = [ [[package]] name = "fc-storage" version = "1.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "ethereum", "ethereum-types", @@ -2809,7 +2832,7 @@ dependencies = [ [[package]] name = "fp-account" version = "1.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "hex", "impl-serde", @@ -2828,7 +2851,7 @@ dependencies = [ [[package]] name = "fp-consensus" version = "2.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "ethereum", "parity-scale-codec", @@ -2840,7 +2863,7 @@ dependencies = [ [[package]] name = "fp-ethereum" version = "1.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "ethereum", "ethereum-types", @@ -2854,9 +2877,9 @@ dependencies = [ [[package]] name = "fp-evm" version = "3.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ - "evm", + "evm 0.39.1", "frame-support", "parity-scale-codec", "serde", @@ -2868,7 +2891,7 @@ dependencies = [ [[package]] name = "fp-rpc" version = "3.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "ethereum", "ethereum-types", @@ -2885,7 +2908,7 @@ dependencies = [ [[package]] name = "fp-self-contained" version = "1.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "frame-support", "parity-scale-codec", @@ -2897,7 +2920,7 @@ dependencies = [ [[package]] name = "fp-storage" version = "2.0.0" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "parity-scale-codec", "serde", @@ -6189,11 +6212,11 @@ dependencies = [ [[package]] name = "pallet-ethereum" version = "4.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "ethereum", "ethereum-types", - "evm", + "evm 0.39.1", "fp-consensus", "fp-ethereum", "fp-evm", @@ -6225,10 +6248,10 @@ dependencies = [ [[package]] name = "pallet-evm" version = "6.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "environmental", - "evm", + "evm 0.39.1", "fp-account", "fp-evm", "frame-benchmarking", @@ -6265,7 +6288,7 @@ dependencies = [ [[package]] name = "pallet-evm-balances" version = "1.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "frame-support", "frame-system", @@ -6279,7 +6302,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-modexp" version = "2.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "fp-evm", "num", @@ -6288,7 +6311,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-sha3fips" version = "2.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "fp-evm", "tiny-keccak", @@ -6297,7 +6320,7 @@ dependencies = [ [[package]] name = "pallet-evm-precompile-simple" version = "2.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "fp-evm", "ripemd", @@ -6307,7 +6330,7 @@ dependencies = [ [[package]] name = "pallet-evm-system" version = "1.0.0-dev" -source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#de37e5347fda74321d7f64e9f888219e676722ec" +source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "fp-evm", "frame-support", @@ -7037,7 +7060,7 @@ dependencies = [ name = "precompile-utils" version = "0.1.0" dependencies = [ - "evm", + "evm 1.0.0-dev", "fp-evm", "frame-support", "frame-system", From 54130a78144712e17242d3ebde9839e167d38a50 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Fri, 22 Dec 2023 14:37:56 +0300 Subject: [PATCH 35/43] Properly use evm deps --- Cargo.lock | 33 +++++---------------------------- Cargo.toml | 2 +- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0a311c46c..9c0d5023d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2380,16 +2380,6 @@ dependencies = [ "sha3 0.10.6", ] -[[package]] -name = "evm" -version = "1.0.0-dev" -source = "git+https://github.com/rust-blockchain/evm?branch=master#9fdc7fe450a173c4452a0adee7d59ec784297e8c" -dependencies = [ - "evm-interpreter", - "primitive-types", - "sha3 0.10.6", -] - [[package]] name = "evm-core" version = "0.39.0" @@ -2412,19 +2402,6 @@ dependencies = [ "primitive-types", ] -[[package]] -name = "evm-interpreter" -version = "1.0.0-dev" -source = "git+https://github.com/rust-blockchain/evm?branch=master#9fdc7fe450a173c4452a0adee7d59ec784297e8c" -dependencies = [ - "parity-scale-codec", - "primitive-types", - "rlp", - "scale-info", - "serde", - "sha3 0.10.6", -] - [[package]] name = "evm-runtime" version = "0.39.0" @@ -2589,7 +2566,7 @@ source = "git+https://github.com/humanode-network/frontier?branch=locked/polkado dependencies = [ "ethereum", "ethereum-types", - "evm 0.39.1", + "evm", "fc-db", "fc-mapping-sync", "fc-rpc-core", @@ -2879,7 +2856,7 @@ name = "fp-evm" version = "3.0.0-dev" source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ - "evm 0.39.1", + "evm", "frame-support", "parity-scale-codec", "serde", @@ -6216,7 +6193,7 @@ source = "git+https://github.com/humanode-network/frontier?branch=locked/polkado dependencies = [ "ethereum", "ethereum-types", - "evm 0.39.1", + "evm", "fp-consensus", "fp-ethereum", "fp-evm", @@ -6251,7 +6228,7 @@ version = "6.0.0-dev" source = "git+https://github.com/humanode-network/frontier?branch=locked/polkadot-v0.9.40#9f01d682957d0a2bcc022e0f0264941342fb5305" dependencies = [ "environmental", - "evm 0.39.1", + "evm", "fp-account", "fp-evm", "frame-benchmarking", @@ -7060,7 +7037,7 @@ dependencies = [ name = "precompile-utils" version = "0.1.0" dependencies = [ - "evm 1.0.0-dev", + "evm", "fp-evm", "frame-support", "frame-system", diff --git a/Cargo.toml b/Cargo.toml index ca8c803a3..e995012d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ clap = { version = "4", default-features = false } ed25519-dalek = { version = "2", default-features = false } ethereum = { version = "0.14", default-features = false } ethers-core = { version = "2.0.3", default-features = false } -evm = { git = "https://github.com/rust-blockchain/evm", branch = "master", default-features = false } +evm = { git = "https://github.com/rust-blockchain/evm", rev = "b7b82c7e1fc57b7449d6dfa6826600de37cc1e65", default-features = false } fdlimit = { version = "0.2", default-features = false } futures = { version = "0.3", default-features = false } getrandom = { version = "0.2", default-features = false } From 9b0bee14a5478c5675bf0024201f971bcc84fe5f Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Tue, 26 Dec 2023 16:24:30 +0300 Subject: [PATCH 36/43] Fix fmt --- .../src/mock/v0.rs | 2 +- .../src/mock/v1.rs | 2 +- .../src/mock/v2.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v0.rs b/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v0.rs index 02279cc53..f119d8c60 100644 --- a/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v0.rs +++ b/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v0.rs @@ -25,7 +25,7 @@ frame_support::construct_runtime!( NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, { - System: frame_system, + System: frame_system = 0, Balances: pallet_balances::, EvmBalances: pallet_balances::, } diff --git a/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v1.rs b/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v1.rs index ec2ad2127..29b4efabd 100644 --- a/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v1.rs +++ b/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v1.rs @@ -28,7 +28,7 @@ frame_support::construct_runtime!( NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, { - System: frame_system, + System: frame_system = 0, Balances: pallet_balances::, EvmBalances: pallet_balances::, SwapBridgeNativeToEvmPot: pallet_pot::, diff --git a/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v2.rs b/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v2.rs index a4c295231..65792ea55 100644 --- a/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v2.rs +++ b/crates/pallet-balanced-currency-swap-bridges-initializer/src/mock/v2.rs @@ -28,7 +28,7 @@ frame_support::construct_runtime!( NodeBlock = Block, UncheckedExtrinsic = UncheckedExtrinsic, { - System: frame_system, + System: frame_system = 0, Balances: pallet_balances::, EvmBalances: pallet_balances::, SwapBridgeNativeToEvmPot: pallet_pot::, From 020def58d3d3e4fcc1305ed3f408f57648b88df7 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Mon, 8 Jan 2024 17:23:35 +0300 Subject: [PATCH 37/43] Use fully qualified TxPool usage --- crates/humanode-rpc/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/humanode-rpc/src/lib.rs b/crates/humanode-rpc/src/lib.rs index 9368fbf62..290972b8c 100644 --- a/crates/humanode-rpc/src/lib.rs +++ b/crates/humanode-rpc/src/lib.rs @@ -8,7 +8,7 @@ use bioauth_flow_rpc::{Bioauth, BioauthServer, Signer, SignerFactory}; use bioauth_keys::traits::KeyExtractor as KeyExtractorT; use fc_rpc::{ Eth, EthApiServer, EthBlockDataCacheTask, EthConfig, EthFilter, EthFilterApiServer, EthPubSub, - EthPubSubApiServer, Net, NetApiServer, TxPool, TxPoolApiServer, Web3, Web3ApiServer, + EthPubSubApiServer, Net, NetApiServer, TxPoolApiServer, Web3, Web3ApiServer, }; use fc_rpc_core::types::{FeeHistoryCache, FilterPool}; use fc_storage::OverrideHandle; @@ -346,7 +346,7 @@ where .into_rpc(), )?; - let eth_tx_pool = TxPool::new(Arc::clone(&client), graph); + let eth_tx_pool = fc_rpc::TxPool::new(Arc::clone(&client), graph); if let Some(eth_filter_pool) = eth_filter_pool { io.merge( From 8d66bedd177b222cba57ee2bc4adcac82fd14061 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Mon, 8 Jan 2024 17:35:13 +0300 Subject: [PATCH 38/43] Link TODO to humanode issue --- crates/humanode-runtime/src/lib.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/humanode-runtime/src/lib.rs b/crates/humanode-runtime/src/lib.rs index da151e9a4..2fa5e847e 100644 --- a/crates/humanode-runtime/src/lib.rs +++ b/crates/humanode-runtime/src/lib.rs @@ -1338,8 +1338,7 @@ impl_runtime_apis! { access_list.unwrap_or_default(), is_transactional, validate, - // TODO: should we define limit for weight and transaction len. - // . + // TODO(#864): set proper values. None, None, &config, @@ -1378,8 +1377,7 @@ impl_runtime_apis! { access_list.unwrap_or_default(), is_transactional, validate, - // TODO: should we define limit for weight and transaction len. - // . + // TODO(#864): set proper values. None, None, &config, From 5268b4feb9386fae19164755714956fcb5d3ee36 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Tue, 9 Jan 2024 18:05:16 +0300 Subject: [PATCH 39/43] Add test to verify pending block extraction --- utils/e2e-tests/ts/tests/rpc/eth.ts | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/utils/e2e-tests/ts/tests/rpc/eth.ts b/utils/e2e-tests/ts/tests/rpc/eth.ts index e5ef70676..729a8fef0 100644 --- a/utils/e2e-tests/ts/tests/rpc/eth.ts +++ b/utils/e2e-tests/ts/tests/rpc/eth.ts @@ -77,4 +77,39 @@ describe("eth rpc", () => { }); }); }); + + describe("pending block", () => { + it("should return pending block", async function () { + const [alice, bob] = devSigners; + + var nonce = 0; + // Prepare and send transaction from alice increasing nonce value. + let sendTransaction = async () => { + const tx = + { + from: alice, + to: bob, + value: ethers.parseEther("1"), + nonce: nonce, + }; + nonce = nonce + 1; + return (await alice.sendTransaction(tx)); + }; + + // Send enough transactions number to have some pending. + const expectedXtsNumber = 10; + for (var _ of Array(expectedXtsNumber)) { + await sendTransaction(); + } + + // Get pending block. + const pending = await provider.send("eth_getBlockByNumber", ["pending", false]); + expect(pending.hash).to.be.null; + expect(pending.miner).to.be.null; + expect(pending.nonce).to.be.null; + expect(pending.totalDifficulty).to.be.null; + // Check that there are some pending transactions. + expect(pending.transactions.length).toBeGreaterThan(0); + }); + }); }); From bdbe4dde8cd443ef8a40f7eb2182608e838d8f19 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Tue, 9 Jan 2024 18:29:15 +0300 Subject: [PATCH 40/43] Return new_partial to be synchronously --- crates/humanode-peer/src/cli/run.rs | 44 ++++++++++---------- crates/humanode-peer/src/service/frontier.rs | 7 ++-- crates/humanode-peer/src/service/mod.rs | 9 ++-- utils/e2e-tests/ts/tests/rpc/test-block.ts | 0 4 files changed, 28 insertions(+), 32 deletions(-) create mode 100644 utils/e2e-tests/ts/tests/rpc/test-block.ts diff --git a/crates/humanode-peer/src/cli/run.rs b/crates/humanode-peer/src/cli/run.rs index ab38af5f8..5353507a1 100644 --- a/crates/humanode-peer/src/cli/run.rs +++ b/crates/humanode-peer/src/cli/run.rs @@ -39,7 +39,7 @@ pub async fn run() -> sc_cli::Result<()> { task_manager, import_queue, .. - } = service::new_partial(&config).await?; + } = service::new_partial(&config)?; Ok((cmd.run(client, import_queue), task_manager)) }) .await @@ -52,7 +52,7 @@ pub async fn run() -> sc_cli::Result<()> { client, task_manager, .. - } = service::new_partial(&config).await?; + } = service::new_partial(&config)?; Ok((cmd.run(client, config.substrate.database), task_manager)) }) .await @@ -65,7 +65,7 @@ pub async fn run() -> sc_cli::Result<()> { client, task_manager, .. - } = service::new_partial(&config).await?; + } = service::new_partial(&config)?; Ok((cmd.run(client, config.substrate.chain_spec), task_manager)) }) .await @@ -79,7 +79,7 @@ pub async fn run() -> sc_cli::Result<()> { task_manager, import_queue, .. - } = service::new_partial(&config).await?; + } = service::new_partial(&config)?; Ok((cmd.run(client, import_queue), task_manager)) }) .await @@ -100,7 +100,7 @@ pub async fn run() -> sc_cli::Result<()> { task_manager, backend, .. - } = service::new_partial(&config).await?; + } = service::new_partial(&config)?; let aux_revert = Box::new(|client, backend, blocks| { sc_consensus_babe::revert(Arc::clone(&client), backend, blocks)?; sc_consensus_grandpa::revert(client, blocks)?; @@ -146,7 +146,7 @@ pub async fn run() -> sc_cli::Result<()> { let cmd = &**cmd; let runner = root.create_humanode_runner(cmd)?; - runner.async_run(|config| async move { + runner.sync_run(|config| { // This switch needs to be in the client, since the client decides // which sub-commands it wants to support. match cmd { @@ -162,7 +162,7 @@ pub async fn run() -> sc_cli::Result<()> { cmd.run::(config.substrate) } BenchmarkCmd::Block(cmd) => { - let partial = service::new_partial(&config).await?; + let partial = service::new_partial(&config)?; cmd.run(partial.client) } #[cfg(not(feature = "runtime-benchmarks"))] @@ -172,7 +172,7 @@ pub async fn run() -> sc_cli::Result<()> { ), #[cfg(feature = "runtime-benchmarks")] BenchmarkCmd::Storage(cmd) => { - let partial = service::new_partial(&config).await?; + let partial = service::new_partial(&config)?; let db = partial.backend.expose_db(); let storage = partial.backend.expose_storage(); @@ -184,7 +184,7 @@ pub async fn run() -> sc_cli::Result<()> { ), #[cfg(feature = "runtime-benchmarks")] BenchmarkCmd::Overhead(cmd) => { - let partial = service::new_partial(&config).await?; + let partial = service::new_partial(&config)?; let ext_builder = RemarkBuilder { client: Arc::clone(&partial.client), }; @@ -203,7 +203,7 @@ pub async fn run() -> sc_cli::Result<()> { ), #[cfg(feature = "runtime-benchmarks")] BenchmarkCmd::Extrinsic(cmd) => { - let partial = service::new_partial(&config).await?; + let partial = service::new_partial(&config)?; let existential_deposit = <::ExistentialDeposit as Get>::get(); let ext_factory = ExtrinsicFactory(vec![ Box::new(RemarkBuilder { @@ -227,22 +227,20 @@ pub async fn run() -> sc_cli::Result<()> { cmd.run(&config.substrate, SUBSTRATE_REFERENCE_HARDWARE.clone()) } } - }).await + }) } Some(Subcommand::FrontierDb(cmd)) => { let runner = root.create_humanode_runner(cmd)?; - runner - .async_run(|config| async move { - let partial = service::new_partial(&config).await?; - let frontier_backend = match partial.other.4 { - fc_db::Backend::KeyValue(kv_fb) => Arc::new(kv_fb), - _ => { - panic!("Only fc_db::Backend::KeyValue supported for FrontierDb command") - } - }; - cmd.run(partial.client, frontier_backend) - }) - .await + runner.sync_run(|config| { + let partial = service::new_partial(&config)?; + let frontier_backend = match partial.other.4 { + fc_db::Backend::KeyValue(kv_fb) => Arc::new(kv_fb), + _ => { + panic!("Only fc_db::Backend::KeyValue supported for FrontierDb command") + } + }; + cmd.run(partial.client, frontier_backend) + }) } Some(Subcommand::ExportEmbeddedRuntime(cmd)) => cmd.run().await, #[cfg(feature = "try-runtime")] diff --git a/crates/humanode-peer/src/service/frontier.rs b/crates/humanode-peer/src/service/frontier.rs index f871eb9bf..7d5539f8b 100644 --- a/crates/humanode-peer/src/service/frontier.rs +++ b/crates/humanode-peer/src/service/frontier.rs @@ -24,7 +24,7 @@ pub fn db_config_dir(config: &sc_service::Configuration) -> std::path::PathBuf { } /// Create frontier backend. -pub async fn frontier_backend( +pub fn backend( config: &Configuration, client: Arc, fb_config: &configuration::FrontierBackend, @@ -40,7 +40,7 @@ pub async fn frontier_backend( let db_path = db_config_dir(config).join("sql"); std::fs::create_dir_all(&db_path)?; - let backend = fc_db::sql::Backend::new( + let backend = futures::executor::block_on(fc_db::sql::Backend::new( fc_db::sql::BackendConfig::Sqlite(fc_db::sql::SqliteBackendConfig { path: Path::new("sqlite:///") .join(db_path) @@ -54,8 +54,7 @@ pub async fn frontier_backend( fb_config.frontier_sql_backend_pool_size, std::num::NonZeroU32::new(fb_config.frontier_sql_backend_num_ops_timeout), Arc::clone(ð_overrides), - ) - .await + )) .map_err(|err| ServiceError::Application(err.into()))?; Ok(FrontierBackend::Sql(backend)) diff --git a/crates/humanode-peer/src/service/mod.rs b/crates/humanode-peer/src/service/mod.rs index d0cb16116..d8facb35f 100644 --- a/crates/humanode-peer/src/service/mod.rs +++ b/crates/humanode-peer/src/service/mod.rs @@ -87,7 +87,7 @@ pub fn keystore_container( } /// Extract substrate partial components. -pub async fn new_partial( +pub fn new_partial( config: &Configuration, ) -> Result< PartialComponents< @@ -170,13 +170,12 @@ pub async fn new_partial( Arc::clone(&client), )?; - let frontier_backend = frontier::frontier_backend( + let frontier_backend = frontier::backend( config, Arc::clone(&client), fronter_backend_config, fc_storage::overrides_handle(Arc::clone(&client)), - ) - .await?; + )?; let frontier_block_import = FrontierBlockImport::new(babe_block_import, Arc::clone(&client)); @@ -237,7 +236,7 @@ pub async fn new_full(config: Configuration) -> Result Date: Tue, 9 Jan 2024 18:45:12 +0300 Subject: [PATCH 41/43] Remove missed added test file --- utils/e2e-tests/ts/tests/rpc/test-block.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 utils/e2e-tests/ts/tests/rpc/test-block.ts diff --git a/utils/e2e-tests/ts/tests/rpc/test-block.ts b/utils/e2e-tests/ts/tests/rpc/test-block.ts deleted file mode 100644 index e69de29bb..000000000 From 193f3cb3156975fd5f31c9566612b67fec57d2fb Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Wed, 17 Jan 2024 15:44:07 +0300 Subject: [PATCH 42/43] Fix help sdtout fixture --- utils/e2e-tests/bash/fixtures/help.stdout.txt | 188 +++++++++--------- 1 file changed, 94 insertions(+), 94 deletions(-) diff --git a/utils/e2e-tests/bash/fixtures/help.stdout.txt b/utils/e2e-tests/bash/fixtures/help.stdout.txt index 1623b3eea..ef2021f51 100644 --- a/utils/e2e-tests/bash/fixtures/help.stdout.txt +++ b/utils/e2e-tests/bash/fixtures/help.stdout.txt @@ -38,7 +38,7 @@ Commands: Options: --validator Enable validator mode. - + The node will be started with the authority role and actively participate in any consensus task that it can (e.g. depending on availability of local keys). --no-grandpa @@ -46,22 +46,22 @@ Options: --rpc-external Listen to all RPC interfaces. - + Default is local. Note: not all RPC methods are safe to be exposed publicly. Use an RPC proxy server to filter out dangerous methods. More details: . Use `--unsafe-rpc-external` to suppress the warning if you understand the risks. --unsafe-rpc-external Listen to all RPC interfaces. - + Same as `--rpc-external`. --rpc-methods RPC methods to expose. - + - `unsafe`: Exposes every RPC method. - `safe`: Exposes only a safe subset of RPC methods, denying unsafe RPC methods. - `auto`: Acts as `safe` if RPC is served externally, e.g. when `--{rpc,ws}-external` is passed, otherwise acts as `unsafe`. - + [default: auto] Possible values: @@ -74,12 +74,12 @@ Options: --ws-external Listen to all Websocket interfaces. - + Default is local. Note: not all RPC methods are safe to be exposed publicly. Use an RPC proxy server to filter out dangerous methods. More details: . Use `--unsafe-ws-external` to suppress the warning if you understand the risks. --unsafe-ws-external Listen to all Websocket interfaces. - + Same as `--ws-external` but doesn't warn you about it. --rpc-max-payload @@ -96,7 +96,7 @@ Options: --prometheus-external Expose Prometheus exporter on all interfaces. - + Default is local. --ipc-path @@ -116,7 +116,7 @@ Options: --rpc-cors Specify browser Origins allowed to access the HTTP & WS RPC servers. - + A comma-separated list of origins (protocol://domain or special `null` value). Value of `all` will disable origin validation. Default is to allow localhost and origins. When running in --dev mode the default is to allow all origins. --prometheus-port @@ -124,29 +124,29 @@ Options: --no-prometheus Do not expose a Prometheus exporter endpoint. - + Prometheus metric endpoint is enabled by default. --name The human-readable name for this node. - + The node name will be reported to the telemetry server, if enabled. --no-telemetry Disable connecting to the Substrate telemetry server. - + Telemetry is on by default on global chains. --telemetry-url The URL of the telemetry server to connect to. - + This flag can be passed multiple times as a means to specify multiple telemetry endpoints. Verbosity levels range from 0-9, with 0 denoting the least verbosity. Expected format is 'URL VERBOSITY', e.g. `--telemetry-url 'wss://foo/bar 0'`. --offchain-worker Should execute offchain workers on every block. - + By default it's only enabled for nodes that are authoring new blocks. - + [default: when-authority] Possible values: @@ -159,20 +159,20 @@ Options: --enable-offchain-indexing Enable Offchain Indexing API, which allows block import to write to Offchain DB. - + Enables a runtime to write directly to a offchain workers DB during block import. - + [default: false] [possible values: true, false] --chain Specify the chain specification. - + It can be one of the predefined ones (dev, local, or staging) or it can be a path to a file with the chainspec (such as one exported by the `build-spec` subcommand). --dev Specify the development chain. - + This flag sets `--chain=dev`, `--force-authoring`, `--rpc-cors=all`, `--alice`, and `--tmp` flags, unless explicitly overridden. -d, --base-path @@ -180,14 +180,14 @@ Options: -l, --log ... Sets a custom logging filter. Syntax is `=`, e.g. -lsync=debug. - + Log levels (least to most verbose) are error, warn, info, debug, and trace. By default, all targets log `info`. The global log level can be set with `-l`. --detailed-log-output Enable detailed log output. - + This includes displaying the log target, log level and thread name. - + This is automatically enabled when something is logged with any higher level than `info`. --disable-log-color @@ -195,9 +195,9 @@ Options: --enable-log-reloading Enable feature to dynamically update and reload the log filter. - + Be aware that enabling this feature can lead to a performance decrease up to factor six or more. Depending on the global logging level the performance decrease changes. - + The `system_addLogFilter` and `system_resetLogFilter` RPCs will have no effect with this option not being set. --tracing-targets @@ -205,7 +205,7 @@ Options: --tracing-receiver Receiver to process tracing messages - + [default: log] Possible values: @@ -213,44 +213,44 @@ Options: --state-pruning Specify the state pruning mode. - + This mode specifies when the block's state (ie, storage) should be pruned (ie, removed) from the database. - + This setting can only be set on the first creation of the database. Every subsequent run will load the pruning mode from the database and will error if the stored mode doesn't match this CLI value. It is fine to drop this CLI flag for subsequent runs. - + Possible values: - + - archive: - + Keep the state of all blocks. - + - 'archive-canonical' - + Keep only the state of finalized blocks. - + - number - + Keep the state of the last number of finalized blocks. - + [default: 256] --blocks-pruning Specify the blocks pruning mode. - + This mode specifies when the block's body (including justifications) should be pruned (ie, removed) from the database. - + Possible values: - 'archive' - + Keep all blocks. - + - 'archive-canonical' - + Keep only finalized blocks. - + - number - + Keep the last `number` of finalized blocks. - + [default: archive-canonical] --database @@ -271,7 +271,7 @@ Options: --wasm-execution Method for executing Wasm runtime code - + [default: compiled] Possible values: @@ -280,15 +280,15 @@ Options: --wasmtime-instantiation-strategy The WASM instantiation method to use. - + Only has an effect when `wasm-execution` is set to `compiled`. - + The copy-on-write strategies are only supported on Linux. If the copy-on-write variant of a strategy is unsupported the executor will fall back to the non-CoW equivalent. - + The fastest (and the default) strategy available is `pooling-copy-on-write`. - + The `legacy-instance-reuse` strategy is deprecated and will be removed in the future. It should only be used in case of issues with the default instantiation strategy. - + [default: pooling-copy-on-write] Possible values: @@ -305,7 +305,7 @@ Options: --wasm-runtime-overrides Specify the path where local WASM runtimes are stored. - + These runtimes will override on-chain runtimes when the version matches. --execution-syncing @@ -388,14 +388,14 @@ Options: --trie-cache-size Specify the state cache size. - + Providing `0` will disable the cache. - + [default: 67108864] --state-cache-size DEPRECATED - + Switch to `--trie-cache-size`. --bootnodes ... @@ -406,9 +406,9 @@ Options: --reserved-only Whether to only synchronize the chain with reserved nodes. - + Also disables automatic peer discovery. - + TCP connections might still be established with non-reserved nodes. In particular, if you are a validator your node might still connect to other validator nodes and collator nodes regardless of whether they are defined as reserved nodes. --public-addr ... @@ -416,7 +416,7 @@ Options: --listen-addr ... Listen on this multiaddress. - + By default: If `--validator` is passed: `/ip4/0.0.0.0/tcp/` and `/ip6/[::]/tcp/`. Otherwise: `/ip4/0.0.0.0/tcp//ws` and `/ip6/[::]/tcp//ws`. --port @@ -430,55 +430,55 @@ Options: --out-peers Specify the number of outgoing connections we're trying to maintain - + [default: 8] --in-peers Maximum number of inbound full nodes peers - + [default: 32] --in-peers-light Maximum number of inbound light nodes peers - + [default: 100] --no-mdns Disable mDNS discovery. - + By default, the network will use mDNS to discover other nodes on the local network. This disables it. Automatically implied when using --dev. --max-parallel-downloads Maximum number of peers from which to ask for the same blocks in parallel. - + This allows downloading announced blocks from multiple peers. Decrease to save traffic and risk increased latency. - + [default: 5] --node-key The secret key to use for libp2p networking. - + The value is a string that is parsed according to the choice of `--node-key-type` as follows: - + `ed25519`: The value is parsed as a hex-encoded Ed25519 32 byte secret key, i.e. 64 hex characters. - + The value of this option takes precedence over `--node-key-file`. - + WARNING: Secrets provided as command-line arguments are easily exposed. Use of this option should be limited to development and testing. To use an externally managed secret key, use `--node-key-file` instead. --node-key-type The type of secret key to use for libp2p networking. - + The secret key of the node is obtained as follows: - + * If the `--node-key` option is given, the value is parsed as a secret key according to the type. See the documentation for `--node-key`. - + * If the `--node-key-file` option is given, the secret key is read from the specified file. See the documentation for `--node-key-file`. - + * Otherwise, the secret key is read from a file with a predetermined, type-specific name from the chain-specific network config directory inside the base directory specified by `--base-dir`. If this file does not exist, it is created with a newly generated secret key of the chosen type. - + The node's secret key determines the corresponding public key and hence the node's peer ID in the context of libp2p. - + [default: ed25519] Possible values: @@ -486,21 +486,21 @@ Options: --node-key-file The file from which to read the node's secret key to use for libp2p networking. - + The contents of the file are parsed according to the choice of `--node-key-type` as follows: - + `ed25519`: The file must contain an unencoded 32 byte or hex encoded Ed25519 secret key. - + If the file does not exist, it is created with a newly generated secret key of the chosen type. --discover-local Enable peer discovery on local networks. - + By default this option is `true` for `--dev` or when the chain type is `Local`/`Development` and false otherwise. --kademlia-disjoint-query-paths Require iterative Kademlia DHT queries to use disjoint paths for increased resiliency in the presence of potentially adversarial nodes. - + See the S/Kademlia paper for more information on the high level design as well as its security improvements. --ipfs-server @@ -508,12 +508,12 @@ Options: --sync Blockchain syncing mode. - + - `full`: Download and validate full blockchain history. - `fast`: Download blocks and the latest state only. - `fast-unsafe`: Same as `fast`, but skip downloading state proofs. - `warp`: Download the latest state and proof. - + [default: full] Possible values: @@ -528,12 +528,12 @@ Options: --pool-limit Maximum number of transactions in the transaction pool - + [default: 8192] --pool-kbytes Maximum number of kilobytes of all transactions stored in the pool - + [default: 20480] --tx-ban-seconds @@ -583,21 +583,21 @@ Options: --max-runtime-instances The size of the instances cache for each runtime. - + The default value is 8 and the values higher than 256 are ignored. --runtime-cache-size Maximum number of different runtimes that can be cached - + [default: 2] --tmp Run a temporary node. - + A temporary directory will be created to store the configuration and will be deleted at the end of the process. - + Note: the directory is random per process execution. This directory is used as base path which includes: database, node key and keystore. - + When `--dev` is given and no explicit `--base-path`, this option is implied. --webapp-url @@ -608,7 +608,7 @@ Options: --rpc-url-scheme-preference What RPC URL scheme to prefer - + [default: no-preference] Possible values: @@ -624,7 +624,7 @@ Options: --rpc-url-ngrok-detect-from The tunnel name at ngrok to detect RPC URL from, if ngrok is used to detect the RPC URL - + [default: command_line] --robonode-url @@ -632,24 +632,24 @@ Options: --max-past-logs Maximum number of logs to keep from the latest block; it is not possible to query logs older than this amount from the latest block in the past - + [default: 10000] --max-stored-filters Maximum number of stored filters - + [default: 500] --fee-history-limit Maximum fee history cache size - + [default: 2048] --execute-gas-limit-multiplier A multiplier to allow larger gas limit in non-transactional execution. - + When using eth_call/eth_estimateGas, the maximum allowed gas limit will be block.gas_limit * execute_gas_limit_multiplier. - + [default: 10] --time-warp-revive-timestamp @@ -665,4 +665,4 @@ Options: Print help (see a summary with '-h') -V, --version - Print version + Print version From d0ef1f3dfedaf2e10efaa2a59a6347ba69762677 Mon Sep 17 00:00:00 2001 From: Dmitry Lavrenov Date: Wed, 17 Jan 2024 15:48:23 +0300 Subject: [PATCH 43/43] Remove pending block test --- utils/e2e-tests/ts/tests/rpc/eth.ts | 35 ----------------------------- 1 file changed, 35 deletions(-) diff --git a/utils/e2e-tests/ts/tests/rpc/eth.ts b/utils/e2e-tests/ts/tests/rpc/eth.ts index 729a8fef0..e5ef70676 100644 --- a/utils/e2e-tests/ts/tests/rpc/eth.ts +++ b/utils/e2e-tests/ts/tests/rpc/eth.ts @@ -77,39 +77,4 @@ describe("eth rpc", () => { }); }); }); - - describe("pending block", () => { - it("should return pending block", async function () { - const [alice, bob] = devSigners; - - var nonce = 0; - // Prepare and send transaction from alice increasing nonce value. - let sendTransaction = async () => { - const tx = - { - from: alice, - to: bob, - value: ethers.parseEther("1"), - nonce: nonce, - }; - nonce = nonce + 1; - return (await alice.sendTransaction(tx)); - }; - - // Send enough transactions number to have some pending. - const expectedXtsNumber = 10; - for (var _ of Array(expectedXtsNumber)) { - await sendTransaction(); - } - - // Get pending block. - const pending = await provider.send("eth_getBlockByNumber", ["pending", false]); - expect(pending.hash).to.be.null; - expect(pending.miner).to.be.null; - expect(pending.nonce).to.be.null; - expect(pending.totalDifficulty).to.be.null; - // Check that there are some pending transactions. - expect(pending.transactions.length).toBeGreaterThan(0); - }); - }); });