diff --git a/Cargo.lock b/Cargo.lock index f1c453dece5..2a4304a1731 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -752,7 +752,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -763,7 +763,7 @@ checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -865,7 +865,7 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "hash-db", "log", @@ -898,7 +898,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -1844,9 +1844,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.3.11" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1640e5cc7fb47dbb8338fd471b105e7ed6c3cb2aeb00c2e067127ffd3764a05d" +checksum = "3eab9e8ceb9afdade1ab3f0fd8dbce5b1b2f468ad653baf10e771781b2b67b73" dependencies = [ "clap_builder", "clap_derive", @@ -1855,9 +1855,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.11" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c59138d527eeaf9b53f35a77fcc1fad9d883116070c63d5de1c7dc7b00c72b" +checksum = "9f2763db829349bf00cfc06251268865ed4363b93a943174f638daf3ecdba2cd" dependencies = [ "anstream", "anstyle 1.0.0", @@ -1867,14 +1867,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.2" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -2578,10 +2578,12 @@ dependencies = [ "cumulus-client-collator", "cumulus-client-consensus-common", "cumulus-client-consensus-proposer", + "cumulus-primitives-aura", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-relay-chain-interface", "futures", + "lru 0.10.0", "parity-scale-codec", "polkadot-node-primitives", "polkadot-overseer", @@ -2589,6 +2591,7 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-consensus-aura", + "sc-consensus-babe", "sc-consensus-slots", "sc-telemetry", "sp-api", @@ -2624,11 +2627,14 @@ dependencies = [ "polkadot-primitives", "sc-client-api", "sc-consensus", + "sc-consensus-babe", "schnellru", "sp-blockchain", "sp-consensus", + "sp-consensus-slots", "sp-core", "sp-runtime", + "sp-timestamp", "sp-tracing", "sp-trie", "substrate-prometheus-endpoint", @@ -2842,7 +2848,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -2927,6 +2933,19 @@ dependencies = [ "xcm", ] +[[package]] +name = "cumulus-primitives-aura" +version = "0.1.0" +dependencies = [ + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-primitives", + "sp-api", + "sp-consensus-aura", + "sp-runtime", + "sp-std", +] + [[package]] name = "cumulus-primitives-core" version = "0.1.0" @@ -3646,7 +3665,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.23", + "syn 2.0.25", "termcolor", "walkdir", ] @@ -3841,7 +3860,7 @@ checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -3852,7 +3871,7 @@ checksum = "48016319042fb7c87b78d2993084a831793a897a5cd1a2a67cab9d1eeb4b7d76" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -4001,7 +4020,7 @@ dependencies = [ "fs-err", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -4172,7 +4191,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", ] @@ -4195,7 +4214,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-support-procedural", @@ -4220,7 +4239,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "Inflector", "array-bytes", @@ -4268,18 +4287,18 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -4296,7 +4315,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-system", @@ -4325,7 +4344,7 @@ dependencies = [ [[package]] name = "frame-remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-recursion", "futures", @@ -4346,7 +4365,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "bitflags", "environmental", @@ -4380,7 +4399,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "Inflector", "cfg-expr", @@ -4392,35 +4411,35 @@ dependencies = [ "proc-macro-warning", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "cfg-if", "frame-support", @@ -4439,7 +4458,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -4454,7 +4473,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "sp-api", @@ -4463,7 +4482,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "parity-scale-codec", @@ -4583,7 +4602,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -5611,7 +5630,7 @@ checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" [[package]] name = "kusama-runtime" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bitvec", "frame-benchmarking", @@ -5711,7 +5730,7 @@ dependencies = [ [[package]] name = "kusama-runtime-constants" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "frame-support", "polkadot-primitives", @@ -6445,7 +6464,7 @@ dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -6458,7 +6477,7 @@ dependencies = [ "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -6469,7 +6488,7 @@ checksum = "93d7d9e6e234c040dafc745c7592738d56a03ad04b1fa04ab60821deb597466a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -6480,7 +6499,7 @@ checksum = "ffd19f13cfd2bfbd83692adfef8c244fe5109b3eb822a1fb4e0a6253b406cd81" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -6650,7 +6669,7 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "futures", "log", @@ -6669,7 +6688,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "anyhow", "jsonrpsee", @@ -7160,7 +7179,7 @@ dependencies = [ [[package]] name = "pallet-alliance" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "frame-benchmarking", @@ -7181,7 +7200,7 @@ dependencies = [ [[package]] name = "pallet-asset-conversion" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7199,7 +7218,7 @@ dependencies = [ [[package]] name = "pallet-asset-conversion-tx-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-system", @@ -7213,7 +7232,7 @@ dependencies = [ [[package]] name = "pallet-asset-tx-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7231,7 +7250,7 @@ dependencies = [ [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7246,7 +7265,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-system", @@ -7262,7 +7281,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-system", @@ -7278,7 +7297,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-system", @@ -7292,7 +7311,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7316,7 +7335,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7336,7 +7355,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7351,7 +7370,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-system", @@ -7370,7 +7389,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "binary-merkle-tree", @@ -7394,7 +7413,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7500,7 +7519,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7544,7 +7563,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7561,7 +7580,7 @@ dependencies = [ [[package]] name = "pallet-contracts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "bitflags", "environmental", @@ -7590,7 +7609,7 @@ dependencies = [ [[package]] name = "pallet-contracts-primitives" version = "24.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "bitflags", "parity-scale-codec", @@ -7603,17 +7622,17 @@ dependencies = [ [[package]] name = "pallet-contracts-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7630,7 +7649,7 @@ dependencies = [ [[package]] name = "pallet-core-fellowship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7648,7 +7667,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7666,7 +7685,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7689,7 +7708,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7702,7 +7721,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7721,7 +7740,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "docify", "frame-benchmarking", @@ -7740,7 +7759,7 @@ dependencies = [ [[package]] name = "pallet-glutton" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "blake2", "frame-benchmarking", @@ -7758,7 +7777,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7781,7 +7800,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7797,7 +7816,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7817,7 +7836,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7834,7 +7853,7 @@ dependencies = [ [[package]] name = "pallet-insecure-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-system", @@ -7848,7 +7867,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7865,7 +7884,7 @@ dependencies = [ [[package]] name = "pallet-message-queue" version = "7.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7884,7 +7903,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7901,7 +7920,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7917,7 +7936,7 @@ dependencies = [ [[package]] name = "pallet-nft-fractionalization" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7934,7 +7953,7 @@ dependencies = [ [[package]] name = "pallet-nfts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7952,7 +7971,7 @@ dependencies = [ [[package]] name = "pallet-nfts-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "pallet-nfts", @@ -7963,7 +7982,7 @@ dependencies = [ [[package]] name = "pallet-nis" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7979,7 +7998,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-system", @@ -7996,7 +8015,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8016,7 +8035,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -8027,7 +8046,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-system", @@ -8044,7 +8063,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8083,7 +8102,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8100,7 +8119,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8115,7 +8134,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8133,7 +8152,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8148,7 +8167,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "assert_matches", "frame-benchmarking", @@ -8167,7 +8186,7 @@ dependencies = [ [[package]] name = "pallet-salary" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8185,7 +8204,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8202,7 +8221,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-system", @@ -8223,7 +8242,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8239,7 +8258,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8258,7 +8277,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8281,18 +8300,18 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "log", "sp-arithmetic", @@ -8301,7 +8320,7 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "sp-api", @@ -8310,7 +8329,7 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8327,7 +8346,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8342,7 +8361,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8360,7 +8379,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8379,7 +8398,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-support", "frame-system", @@ -8395,7 +8414,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -8411,7 +8430,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -8423,7 +8442,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8440,7 +8459,7 @@ dependencies = [ [[package]] name = "pallet-uniques" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8455,7 +8474,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8471,7 +8490,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8486,7 +8505,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8501,7 +8520,7 @@ dependencies = [ [[package]] name = "pallet-xcm" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -8522,7 +8541,7 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "frame-benchmarking", "frame-support", @@ -8547,6 +8566,8 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", + "sp-runtime", + "sp-std", ] [[package]] @@ -8564,6 +8585,7 @@ dependencies = [ "cumulus-relay-chain-interface", "frame-benchmarking", "frame-benchmarking-cli", + "futures", "jsonrpsee", "log", "pallet-transaction-payment-rpc", @@ -8579,6 +8601,7 @@ dependencies = [ "sc-executor", "sc-network", "sc-network-sync", + "sc-offchain", "sc-rpc", "sc-service", "sc-sysinfo", @@ -9135,7 +9158,7 @@ dependencies = [ [[package]] name = "polkadot-approval-distribution" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "futures", "futures-timer", @@ -9153,7 +9176,7 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "futures", "futures-timer", @@ -9168,7 +9191,7 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "derive_more", "fatality", @@ -9191,7 +9214,7 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "fatality", "futures", @@ -9212,7 +9235,7 @@ dependencies = [ [[package]] name = "polkadot-cli" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "clap", "frame-benchmarking-cli", @@ -9241,7 +9264,7 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "always-assert", "bitvec", @@ -9263,7 +9286,7 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "parity-scale-codec", "scale-info", @@ -9275,7 +9298,7 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "derive_more", "fatality", @@ -9300,7 +9323,7 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -9314,7 +9337,7 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "futures", "futures-timer", @@ -9334,7 +9357,7 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "always-assert", "async-trait", @@ -9357,7 +9380,7 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "futures", "parity-scale-codec", @@ -9375,7 +9398,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bitvec", "derive_more", @@ -9404,7 +9427,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bitvec", "futures", @@ -9426,7 +9449,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bitvec", "fatality", @@ -9445,7 +9468,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "futures", "polkadot-node-subsystem", @@ -9460,7 +9483,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "async-trait", "futures", @@ -9480,7 +9503,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "futures", "polkadot-node-metrics", @@ -9495,7 +9518,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "futures", "futures-timer", @@ -9512,7 +9535,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "fatality", "futures", @@ -9531,7 +9554,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "async-trait", "futures", @@ -9548,7 +9571,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bitvec", "fatality", @@ -9566,7 +9589,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "always-assert", "futures", @@ -9597,7 +9620,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "futures", "polkadot-node-primitives", @@ -9613,7 +9636,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-common" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "cpu-time", "futures", @@ -9637,7 +9660,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-execute-worker" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "cpu-time", "futures", @@ -9657,7 +9680,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-prepare-worker" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "futures", "libc", @@ -9680,7 +9703,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "futures", "lru 0.9.0", @@ -9695,7 +9718,7 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "lazy_static", "log", @@ -9713,7 +9736,7 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bs58", "futures", @@ -9732,7 +9755,7 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "async-channel", "async-trait", @@ -9755,7 +9778,7 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bounded-vec", "futures", @@ -9777,7 +9800,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -9787,7 +9810,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-test-helpers" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "async-trait", "futures", @@ -9805,7 +9828,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "async-trait", "derive_more", @@ -9817,6 +9840,7 @@ dependencies = [ "polkadot-primitives", "polkadot-statement-table", "sc-network", + "sc-transaction-pool-api", "smallvec", "sp-api", "sp-authority-discovery", @@ -9828,7 +9852,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "async-trait", "derive_more", @@ -9861,7 +9885,7 @@ dependencies = [ [[package]] name = "polkadot-overseer" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "async-trait", "futures", @@ -9884,7 +9908,7 @@ dependencies = [ [[package]] name = "polkadot-parachain" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bounded-collections", "derive_more", @@ -9983,7 +10007,7 @@ dependencies = [ [[package]] name = "polkadot-performance-test" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "env_logger 0.9.0", "kusama-runtime", @@ -10001,7 +10025,7 @@ dependencies = [ [[package]] name = "polkadot-primitives" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bitvec", "hex-literal 0.4.1", @@ -10027,7 +10051,7 @@ dependencies = [ [[package]] name = "polkadot-rpc" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "jsonrpsee", "mmr-rpc", @@ -10059,7 +10083,7 @@ dependencies = [ [[package]] name = "polkadot-runtime" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bitvec", "frame-benchmarking", @@ -10154,7 +10178,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bitvec", "frame-benchmarking", @@ -10200,7 +10224,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-constants" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "frame-support", "polkadot-primitives", @@ -10214,7 +10238,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bs58", "parity-scale-codec", @@ -10226,7 +10250,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bitflags", "bitvec", @@ -10271,7 +10295,7 @@ dependencies = [ [[package]] name = "polkadot-service" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "async-trait", "frame-benchmarking", @@ -10353,6 +10377,7 @@ dependencies = [ "sc-sysinfo", "sc-telemetry", "sc-transaction-pool", + "sc-transaction-pool-api", "serde", "serde_json", "sp-api", @@ -10388,7 +10413,7 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "arrayvec 0.5.2", "fatality", @@ -10410,7 +10435,7 @@ dependencies = [ [[package]] name = "polkadot-statement-table" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -10420,7 +10445,7 @@ dependencies = [ [[package]] name = "polkadot-test-client" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "frame-benchmarking", "parity-scale-codec", @@ -10448,7 +10473,7 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bitvec", "frame-election-provider-support", @@ -10509,7 +10534,7 @@ dependencies = [ [[package]] name = "polkadot-test-service" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "frame-system", "futures", @@ -10674,7 +10699,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ceca8aaf45b5c46ec7ed39fff75f57290368c1846d33d24a122ca81416ab058" dependencies = [ "proc-macro2", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -10750,14 +10775,14 @@ checksum = "70550716265d1ec349c41f70dd4f964b4fd88394efe4405f0c1da679c4799a07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" dependencies = [ "unicode-ident", ] @@ -11288,7 +11313,7 @@ dependencies = [ [[package]] name = "rococo-runtime" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "binary-merkle-tree", "frame-benchmarking", @@ -11375,7 +11400,7 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "frame-support", "polkadot-primitives", @@ -11644,7 +11669,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "log", "sp-core", @@ -11655,7 +11680,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "futures", @@ -11683,7 +11708,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "futures", "futures-timer", @@ -11706,7 +11731,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -11721,7 +11746,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -11740,18 +11765,18 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "chrono", @@ -11790,7 +11815,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "fnv", "futures", @@ -11806,7 +11831,6 @@ dependencies = [ "sp-core", "sp-database", "sp-externalities", - "sp-keystore", "sp-runtime", "sp-state-machine", "sp-statement-store", @@ -11817,7 +11841,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "hash-db", "kvdb", @@ -11843,7 +11867,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "futures", @@ -11868,7 +11892,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "futures", @@ -11897,7 +11921,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "fork-tree", @@ -11913,6 +11937,7 @@ dependencies = [ "sc-consensus-epochs", "sc-consensus-slots", "sc-telemetry", + "sc-transaction-pool-api", "scale-info", "sp-api", "sp-application-crypto", @@ -11932,7 +11957,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "futures", "jsonrpsee", @@ -11954,7 +11979,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "async-channel", @@ -11988,7 +12013,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "futures", "jsonrpsee", @@ -12007,7 +12032,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "fork-tree", "parity-scale-codec", @@ -12020,7 +12045,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "ahash 0.8.2", "array-bytes", @@ -12042,6 +12067,7 @@ dependencies = [ "sc-network-common", "sc-network-gossip", "sc-telemetry", + "sc-transaction-pool-api", "sc-utils", "serde_json", "sp-api", @@ -12060,7 +12086,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "finality-grandpa", "futures", @@ -12080,7 +12106,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "futures", @@ -12103,7 +12129,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", @@ -12125,7 +12151,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -12137,7 +12163,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "anyhow", "cfg-if", @@ -12154,7 +12180,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "ansi_term", "futures", @@ -12170,7 +12196,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "parking_lot 0.12.1", @@ -12184,7 +12210,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "async-channel", @@ -12225,7 +12251,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-channel", "cid", @@ -12245,7 +12271,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "bitflags", @@ -12262,7 +12288,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "ahash 0.8.2", "futures", @@ -12280,7 +12306,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "async-channel", @@ -12301,7 +12327,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "async-channel", @@ -12335,7 +12361,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "futures", @@ -12353,7 +12379,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "bytes", @@ -12363,6 +12389,7 @@ dependencies = [ "hyper", "hyper-rustls 0.24.0", "libp2p", + "log", "num_cpus", "once_cell", "parity-scale-codec", @@ -12370,9 +12397,13 @@ dependencies = [ "rand 0.8.5", "sc-client-api", "sc-network", + "sc-network-common", + "sc-transaction-pool-api", "sc-utils", "sp-api", "sp-core", + "sp-externalities", + "sp-keystore", "sp-offchain", "sp-runtime", "threadpool", @@ -12382,7 +12413,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -12391,7 +12422,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "futures", "jsonrpsee", @@ -12422,7 +12453,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12441,7 +12472,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "http", "jsonrpsee", @@ -12456,7 +12487,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "futures", @@ -12482,7 +12513,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "directories", @@ -12509,7 +12540,6 @@ dependencies = [ "sc-network-light", "sc-network-sync", "sc-network-transactions", - "sc-offchain", "sc-rpc", "sc-rpc-server", "sc-rpc-spec-v2", @@ -12547,7 +12577,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "log", "parity-scale-codec", @@ -12558,7 +12588,7 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "clap", "fs4", @@ -12572,7 +12602,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12591,7 +12621,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "futures", "libc", @@ -12610,7 +12640,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "chrono", "futures", @@ -12629,7 +12659,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "ansi_term", "atty", @@ -12658,18 +12688,18 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "futures", @@ -12695,7 +12725,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "futures", @@ -12711,7 +12741,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-channel", "futures", @@ -12974,29 +13004,29 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.167" +version = "1.0.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daf513456463b42aa1d94cff7e0c24d682b429f020b9afa4f5ba5c40a22b237" +checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.167" +version = "1.0.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b69b106b68bc8054f0e974e70d19984040f8a5cf9215ca82626ea4853f82c4b9" +checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "serde_json" -version = "1.0.100" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" +checksum = "b5062a995d481b2308b6064e9af76011f2921c35f97b0468811ed9f6cd91dfed" dependencies = [ "itoa 1.0.4", "ryu", @@ -13192,7 +13222,7 @@ checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" [[package]] name = "slot-range-helper" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "enumn", "parity-scale-codec", @@ -13269,7 +13299,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "hash-db", "log", @@ -13277,6 +13307,7 @@ dependencies = [ "scale-info", "sp-api-proc-macro", "sp-core", + "sp-externalities", "sp-metadata-ir", "sp-runtime", "sp-state-machine", @@ -13289,7 +13320,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "Inflector", "blake2", @@ -13297,13 +13328,13 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "sp-application-crypto" version = "23.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "scale-info", @@ -13316,7 +13347,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "16.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "integer-sqrt", "num-traits", @@ -13330,7 +13361,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "scale-info", @@ -13343,7 +13374,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "sp-api", "sp-inherents", @@ -13354,7 +13385,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "futures", "log", @@ -13372,7 +13403,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "futures", @@ -13387,7 +13418,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "parity-scale-codec", @@ -13404,7 +13435,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "parity-scale-codec", @@ -13423,7 +13454,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "lazy_static", "parity-scale-codec", @@ -13442,7 +13473,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "finality-grandpa", "log", @@ -13460,7 +13491,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "scale-info", @@ -13472,7 +13503,7 @@ dependencies = [ [[package]] name = "sp-core" version = "21.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "bitflags", @@ -13510,13 +13541,14 @@ dependencies = [ "substrate-bip39", "thiserror", "tiny-bip39", + "tracing", "zeroize", ] [[package]] name = "sp-core-hashing" version = "9.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "blake2b_simd", "byteorder", @@ -13529,17 +13561,17 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "9.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "quote", "sp-core-hashing", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -13548,17 +13580,17 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "sp-externalities" version = "0.19.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "environmental", "parity-scale-codec", @@ -13569,7 +13601,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -13583,7 +13615,7 @@ dependencies = [ [[package]] name = "sp-io" version = "23.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "bytes", "ed25519", @@ -13608,7 +13640,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "24.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "lazy_static", "sp-core", @@ -13619,7 +13651,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.27.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", @@ -13631,7 +13663,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "thiserror", "zstd 0.12.3+zstd.1.5.2", @@ -13640,7 +13672,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -13651,7 +13683,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -13669,7 +13701,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "scale-info", @@ -13683,7 +13715,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "sp-api", "sp-core", @@ -13693,7 +13725,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "backtrace", "lazy_static", @@ -13703,7 +13735,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "rustc-hash", "serde", @@ -13713,7 +13745,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "24.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "either", "hash256-std-hasher", @@ -13735,7 +13767,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "17.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -13753,24 +13785,25 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "11.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "Inflector", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", "sp-core", + "sp-keystore", "sp-runtime", "sp-staking", "sp-std", @@ -13779,7 +13812,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -13793,7 +13826,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.28.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "hash-db", "log", @@ -13814,7 +13847,7 @@ dependencies = [ [[package]] name = "sp-statement-store" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "scale-info", @@ -13831,12 +13864,12 @@ dependencies = [ [[package]] name = "sp-std" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" [[package]] name = "sp-storage" version = "13.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "impl-serde", "parity-scale-codec", @@ -13849,7 +13882,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "parity-scale-codec", @@ -13862,7 +13895,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "10.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "sp-std", @@ -13874,7 +13907,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "sp-api", "sp-runtime", @@ -13883,7 +13916,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "parity-scale-codec", @@ -13898,7 +13931,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "22.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "ahash 0.8.2", "hash-db", @@ -13921,7 +13954,7 @@ dependencies = [ [[package]] name = "sp-version" version = "22.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "impl-serde", "parity-scale-codec", @@ -13938,18 +13971,18 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "sp-wasm-interface" version = "14.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -13962,7 +13995,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "20.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "parity-scale-codec", "scale-info", @@ -14160,12 +14193,12 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -14184,7 +14217,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "hyper", "log", @@ -14196,7 +14229,7 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "jsonrpsee", @@ -14209,7 +14242,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -14226,7 +14259,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "array-bytes", "async-trait", @@ -14252,7 +14285,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "futures", "substrate-test-utils-derive", @@ -14262,18 +14295,18 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "ansi_term", "build-helper", @@ -14316,9 +14349,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.23" +version = "2.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" +checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" dependencies = [ "proc-macro2", "quote", @@ -14402,7 +14435,7 @@ checksum = "13a4ec180a2de59b57434704ccfad967f789b12737738798fa08798cd5824c16" [[package]] name = "test-runtime-constants" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "frame-support", "polkadot-primitives", @@ -14430,7 +14463,7 @@ checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -14611,7 +14644,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -14804,7 +14837,7 @@ dependencies = [ [[package]] name = "tracing-gum" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "polkadot-node-jaeger", "polkadot-primitives", @@ -14815,13 +14848,13 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "expander 2.0.0", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -14945,7 +14978,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#6d28d2eb6fa1589105e970ff1b97555d91a1495b" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-v1.0.0#948fbd2fd1233dc26dbb9f9bbc1d2cca2c03945d" dependencies = [ "async-trait", "clap", @@ -15861,7 +15894,7 @@ dependencies = [ [[package]] name = "westend-runtime" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bitvec", "frame-benchmarking", @@ -15954,7 +15987,7 @@ dependencies = [ [[package]] name = "westend-runtime-constants" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "frame-support", "polkadot-primitives", @@ -16345,7 +16378,7 @@ dependencies = [ [[package]] name = "xcm" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "bounded-collections", "derivative", @@ -16361,7 +16394,7 @@ dependencies = [ [[package]] name = "xcm-builder" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "frame-support", "frame-system", @@ -16415,7 +16448,7 @@ dependencies = [ [[package]] name = "xcm-executor" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "environmental", "frame-benchmarking", @@ -16435,12 +16468,12 @@ dependencies = [ [[package]] name = "xcm-procedural" version = "1.0.0" -source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#1ed6e2e50a4ce61f6cda46a730efc11a07b6ebb3" +source = "git+https://github.com/paritytech/polkadot?branch=release-v1.0.0#c9ec8c5a15959ce711bb60aa79add58f560d61e9" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index a376d06f806..149a4d345e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,6 +30,7 @@ members = [ "pallets/xcmp-queue", "parachain-template/node", "parachain-template/runtime", + "primitives/aura", "primitives/core", "primitives/parachain-inherent", "primitives/timestamp", @@ -74,3 +75,4 @@ opt-level = 3 inherits = "release" lto = true codegen-units = 1 + diff --git a/README.md b/README.md index b9ebebfe3a7..72e3ad8d3dc 100644 --- a/README.md +++ b/README.md @@ -153,13 +153,13 @@ cargo build --release --bin polkadot-parachain ./target/release/polkadot-parachain export-genesis-wasm > genesis-wasm # Collator1 -./target/release/polkadot-parachain --collator --alice --force-authoring --tmp --port 40335 --ws-port 9946 -- --execution wasm --chain ../polkadot/rococo-local-cfde.json --port 30335 +./target/release/polkadot-parachain --collator --alice --force-authoring --tmp --port 40335 --rpc-port 9946 -- --chain ../polkadot/rococo-local-cfde.json --port 30335 # Collator2 -./target/release/polkadot-parachain --collator --bob --force-authoring --tmp --port 40336 --ws-port 9947 -- --execution wasm --chain ../polkadot/rococo-local-cfde.json --port 30336 +./target/release/polkadot-parachain --collator --bob --force-authoring --tmp --port 40336 --rpc-port 9947 -- --chain ../polkadot/rococo-local-cfde.json --port 30336 # Parachain Full Node 1 -./target/release/polkadot-parachain --tmp --port 40337 --ws-port 9948 -- --execution wasm --chain ../polkadot/rococo-local-cfde.json --port 30337 +./target/release/polkadot-parachain --tmp --port 40337 --rpc-port 9948 -- --chain ../polkadot/rococo-local-cfde.json --port 30337 ``` #### Register the parachain @@ -267,5 +267,5 @@ docker build --tag $OWNER/$IMAGE_NAME --file ./docker/polkadot-parachain_builder You may then run your new container: ```bash -docker run --rm -it $OWNER/$IMAGE_NAME --collator --tmp --execution wasm --chain /specs/westmint.json +docker run --rm -it $OWNER/$IMAGE_NAME --collator --tmp --chain /specs/westmint.json ``` diff --git a/bridges/bin/runtime-common/src/integrity.rs b/bridges/bin/runtime-common/src/integrity.rs index aa698b0b95e..a0af3b981f3 100644 --- a/bridges/bin/runtime-common/src/integrity.rs +++ b/bridges/bin/runtime-common/src/integrity.rs @@ -30,7 +30,7 @@ use pallet_bridge_messages::WeightInfoExt as _; use sp_runtime::traits::SignedExtension; /// Macro that ensures that the runtime configuration and chain primitives crate are sharing -/// the same types (index, block number, hash, hasher, account id and header). +/// the same types (nonce, block number, hash, hasher, account id and header). #[macro_export] macro_rules! assert_chain_types( ( runtime: $r:path, this_chain: $this:path ) => { @@ -38,15 +38,15 @@ macro_rules! assert_chain_types( // if one of asserts fail, then either bridge isn't configured properly (or alternatively - non-standard // configuration is used), or something has broke existing configuration (meaning that all bridged chains // and relays will stop functioning) - use frame_system::Config as SystemConfig; + use frame_system::{Config as SystemConfig, pallet_prelude::{BlockNumberFor, HeaderFor}}; use static_assertions::assert_type_eq_all; - assert_type_eq_all!(<$r as SystemConfig>::Index, bp_runtime::IndexOf<$this>); - assert_type_eq_all!(<$r as SystemConfig>::BlockNumber, bp_runtime::BlockNumberOf<$this>); + assert_type_eq_all!(<$r as SystemConfig>::Nonce, bp_runtime::NonceOf<$this>); + assert_type_eq_all!(BlockNumberFor<$r>, bp_runtime::BlockNumberOf<$this>); assert_type_eq_all!(<$r as SystemConfig>::Hash, bp_runtime::HashOf<$this>); assert_type_eq_all!(<$r as SystemConfig>::Hashing, bp_runtime::HasherOf<$this>); assert_type_eq_all!(<$r as SystemConfig>::AccountId, bp_runtime::AccountIdOf<$this>); - assert_type_eq_all!(<$r as SystemConfig>::Header, bp_runtime::HeaderOf<$this>); + assert_type_eq_all!(HeaderFor<$r>, bp_runtime::HeaderOf<$this>); } } ); diff --git a/bridges/bin/runtime-common/src/mock.rs b/bridges/bin/runtime-common/src/mock.rs index 4542ad39b62..6b5edabc886 100644 --- a/bridges/bin/runtime-common/src/mock.rs +++ b/bridges/bin/runtime-common/src/mock.rs @@ -66,9 +66,7 @@ pub type ThisChainCallOrigin = RuntimeOrigin; /// Header of `ThisChain`. pub type ThisChainHeader = sp_runtime::generic::Header; /// Block of `ThisChain`. -pub type ThisChainBlock = frame_system::mocking::MockBlock; -/// Unchecked extrinsic of `ThisChain`. -pub type ThisChainUncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; +pub type ThisChainBlock = frame_system::mocking::MockBlockU32; /// Account identifier at the `BridgedChain`. pub type BridgedChainAccountId = u128; @@ -108,12 +106,9 @@ pub const BRIDGED_CHAIN_MAX_EXTRINSIC_WEIGHT: usize = 2048; pub const BRIDGED_CHAIN_MAX_EXTRINSIC_SIZE: u32 = 1024; frame_support::construct_runtime! { - pub enum TestRuntime where - Block = ThisChainBlock, - NodeBlock = ThisChainBlock, - UncheckedExtrinsic = ThisChainUncheckedExtrinsic, + pub enum TestRuntime { - System: frame_system::{Pallet, Call, Config, Storage, Event}, + System: frame_system::{Pallet, Call, Config, Storage, Event}, Utility: pallet_utility, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, @@ -148,14 +143,13 @@ parameter_types! { impl frame_system::Config for TestRuntime { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type RuntimeCall = RuntimeCall; - type BlockNumber = ThisChainBlockNumber; type Hash = ThisChainHash; type Hashing = ThisChainHasher; type AccountId = ThisChainAccountId; type Lookup = IdentityLookup; - type Header = ThisChainHeader; + type Block = ThisChainBlock; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU32<250>; type Version = (); @@ -324,7 +318,7 @@ impl Chain for ThisUnderlyingChain { type Header = ThisChainHeader; type AccountId = ThisChainAccountId; type Balance = ThisChainBalance; - type Index = u32; + type Nonce = u32; type Signature = sp_runtime::MultiSignature; fn max_extrinsic_size() -> u32 { @@ -364,7 +358,7 @@ impl Chain for BridgedUnderlyingChain { type Header = BridgedChainHeader; type AccountId = BridgedChainAccountId; type Balance = BridgedChainBalance; - type Index = u32; + type Nonce = u32; type Signature = sp_runtime::MultiSignature; fn max_extrinsic_size() -> u32 { @@ -390,7 +384,7 @@ impl Chain for BridgedUnderlyingParachain { type Header = BridgedChainHeader; type AccountId = BridgedChainAccountId; type Balance = BridgedChainBalance; - type Index = u32; + type Nonce = u32; type Signature = sp_runtime::MultiSignature; fn max_extrinsic_size() -> u32 { diff --git a/bridges/modules/grandpa/src/call_ext.rs b/bridges/modules/grandpa/src/call_ext.rs index b57aebb1ac1..c83e88b7b56 100644 --- a/bridges/modules/grandpa/src/call_ext.rs +++ b/bridges/modules/grandpa/src/call_ext.rs @@ -179,7 +179,9 @@ pub(crate) fn submit_finality_proof_info_from_args, I: 'static>( /// Returns maximal expected size of `submit_finality_proof` call arguments. fn max_expected_call_size, I: 'static>(required_precommits: u32) -> u32 { let max_expected_justification_size = - GrandpaJustification::max_reasonable_size::(required_precommits); + GrandpaJustification::>::max_reasonable_size::( + required_precommits, + ); // call arguments are header and justification T::BridgedChain::MAX_HEADER_SIZE.saturating_add(max_expected_justification_size) diff --git a/bridges/modules/grandpa/src/lib.rs b/bridges/modules/grandpa/src/lib.rs index f9c3ab68a06..eb49849ac88 100644 --- a/bridges/modules/grandpa/src/lib.rs +++ b/bridges/modules/grandpa/src/lib.rs @@ -39,13 +39,12 @@ pub use storage_types::StoredAuthoritySet; use bp_header_chain::{ - justification::GrandpaJustification, ChainWithGrandpa, HeaderChain, InitializationData, - StoredHeaderData, StoredHeaderDataBuilder, + justification::GrandpaJustification, ChainWithGrandpa, GrandpaConsensusLogReader, HeaderChain, + InitializationData, StoredHeaderData, StoredHeaderDataBuilder, }; use bp_runtime::{BlockNumberOf, HashOf, HasherOf, HeaderId, HeaderOf, OwnedBridgeModule}; use finality_grandpa::voter_set::VoterSet; use frame_support::{dispatch::PostDispatchInfo, ensure, DefaultNoBound}; -use sp_consensus_grandpa::{ConsensusLog, GRANDPA_ENGINE_ID}; use sp_runtime::{ traits::{Header as HeaderT, Zero}, SaturatedConversion, @@ -380,7 +379,7 @@ pub mod pallet { } #[pallet::genesis_build] - impl, I: 'static> GenesisBuild for GenesisConfig { + impl, I: 'static> BuildGenesisConfig for GenesisConfig { fn build(&self) { if let Some(ref owner) = self.owner { >::put(owner); @@ -443,11 +442,17 @@ pub mod pallet { // We don't support forced changes - at that point governance intervention is required. ensure!( - super::find_forced_change(header).is_none(), + GrandpaConsensusLogReader::>::find_forced_change( + header.digest() + ) + .is_none(), >::UnsupportedScheduledChange ); - if let Some(change) = super::find_scheduled_change(header) { + if let Some(change) = + GrandpaConsensusLogReader::>::find_scheduled_change( + header.digest(), + ) { // GRANDPA only includes a `delay` for forced changes, so this isn't valid. ensure!(change.delay == Zero::zero(), >::UnsupportedScheduledChange); @@ -616,42 +621,6 @@ impl, I: 'static> HeaderChain> for GrandpaChainH } } -pub(crate) fn find_scheduled_change( - header: &H, -) -> Option> { - use sp_runtime::generic::OpaqueDigestItemId; - - let id = OpaqueDigestItemId::Consensus(&GRANDPA_ENGINE_ID); - - let filter_log = |log: ConsensusLog| match log { - ConsensusLog::ScheduledChange(change) => Some(change), - _ => None, - }; - - // find the first consensus digest with the right ID which converts to - // the right kind of consensus log. - header.digest().convert_first(|l| l.try_to(id).and_then(filter_log)) -} - -/// Checks the given header for a consensus digest signaling a **forced** scheduled change and -/// extracts it. -pub(crate) fn find_forced_change( - header: &H, -) -> Option<(H::Number, sp_consensus_grandpa::ScheduledChange)> { - use sp_runtime::generic::OpaqueDigestItemId; - - let id = OpaqueDigestItemId::Consensus(&GRANDPA_ENGINE_ID); - - let filter_log = |log: ConsensusLog| match log { - ConsensusLog::ForcedChange(delay, change) => Some((delay, change)), - _ => None, - }; - - // find the first consensus digest with the right ID which converts to - // the right kind of consensus log. - header.digest().convert_first(|l| l.try_to(id).and_then(filter_log)) -} - /// (Re)initialize bridge with given header for using it in `pallet-bridge-messages` benchmarks. #[cfg(feature = "runtime-benchmarks")] pub fn initialize_for_benchmarks, I: 'static>(header: BridgedHeader) { @@ -685,6 +654,7 @@ mod tests { storage::generator::StorageValue, }; use frame_system::{EventRecord, Phase}; + use sp_consensus_grandpa::{ConsensusLog, GRANDPA_ENGINE_ID}; use sp_core::Get; use sp_runtime::{Digest, DigestItem, DispatchError}; diff --git a/bridges/modules/grandpa/src/mock.rs b/bridges/modules/grandpa/src/mock.rs index 0ebbc0bccbb..bd305dfef9d 100644 --- a/bridges/modules/grandpa/src/mock.rs +++ b/bridges/modules/grandpa/src/mock.rs @@ -26,29 +26,25 @@ use frame_support::{ }; use sp_core::sr25519::Signature; use sp_runtime::{ - testing::{Header, H256}, + testing::H256, traits::{BlakeTwo256, IdentityLookup}, Perbill, }; pub type AccountId = u64; -pub type TestHeader = crate::BridgedHeader; -pub type TestNumber = crate::BridgedBlockNumber; +pub type TestHeader = sp_runtime::testing::Header; +pub type TestNumber = u64; type Block = frame_system::mocking::MockBlock; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; pub const MAX_BRIDGED_AUTHORITIES: u32 = 5; use crate as grandpa; construct_runtime! { - pub enum TestRuntime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum TestRuntime { - System: frame_system::{Pallet, Call, Config, Storage, Event}, + System: frame_system::{Pallet, Call, Config, Storage, Event}, Grandpa: grandpa::{Pallet, Call, Event}, } } @@ -61,14 +57,13 @@ parameter_types! { impl frame_system::Config for TestRuntime { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type RuntimeCall = RuntimeCall; - type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type Version = (); @@ -105,14 +100,14 @@ impl grandpa::Config for TestRuntime { pub struct TestBridgedChain; impl Chain for TestBridgedChain { - type BlockNumber = ::BlockNumber; + type BlockNumber = TestNumber; type Hash = ::Hash; type Hasher = ::Hashing; - type Header = ::Header; + type Header = TestHeader; type AccountId = AccountId; type Balance = u64; - type Index = u64; + type Nonce = u64; type Signature = Signature; fn max_extrinsic_size() -> u32 { diff --git a/bridges/modules/messages/src/lib.rs b/bridges/modules/messages/src/lib.rs index 51e6857d777..3bfd5bc7e98 100644 --- a/bridges/modules/messages/src/lib.rs +++ b/bridges/modules/messages/src/lib.rs @@ -188,9 +188,9 @@ pub mod pallet { #[pallet::hooks] impl, I: 'static> Hooks> for Pallet where - u32: TryFrom<::BlockNumber>, + u32: TryFrom>, { - fn on_idle(_block: T::BlockNumber, remaining_weight: Weight) -> Weight { + fn on_idle(_block: BlockNumberFor, remaining_weight: Weight) -> Weight { // we'll need at least to read outbound lane state, kill a message and update lane state let db_weight = T::DbWeight::get(); if !remaining_weight.all_gte(db_weight.reads_writes(1, 2)) { @@ -597,7 +597,7 @@ pub mod pallet { } #[pallet::genesis_build] - impl, I: 'static> GenesisBuild for GenesisConfig { + impl, I: 'static> BuildGenesisConfig for GenesisConfig { fn build(&self) { PalletOperatingMode::::put(self.operating_mode); if let Some(ref owner) = self.owner { diff --git a/bridges/modules/messages/src/mock.rs b/bridges/modules/messages/src/mock.rs index 8716c5bc3ac..62bc76c5e01 100644 --- a/bridges/modules/messages/src/mock.rs +++ b/bridges/modules/messages/src/mock.rs @@ -39,9 +39,8 @@ use frame_support::{ use scale_info::TypeInfo; use sp_core::H256; use sp_runtime::{ - testing::Header as SubstrateHeader, traits::{BlakeTwo256, ConstU32, IdentityLookup}, - Perbill, + BuildStorage, Perbill, }; use std::{ collections::{BTreeMap, VecDeque}, @@ -71,17 +70,13 @@ pub type TestRelayer = u64; pub type TestDispatchLevelResult = (); type Block = frame_system::mocking::MockBlock; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; use crate as pallet_bridge_messages; frame_support::construct_runtime! { - pub enum TestRuntime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum TestRuntime { - System: frame_system::{Pallet, Call, Config, Storage, Event}, + System: frame_system::{Pallet, Call, Config, Storage, Event}, Balances: pallet_balances::{Pallet, Call, Event}, Messages: pallet_bridge_messages::{Pallet, Call, Event}, } @@ -98,14 +93,13 @@ pub type DbWeight = RocksDbWeight; impl frame_system::Config for TestRuntime { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type RuntimeCall = RuntimeCall; - type BlockNumber = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = SubstrateHeader; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = ConstU64<250>; type Version = (); @@ -487,7 +481,7 @@ pub fn inbound_unrewarded_relayers_state(lane: bp_messages::LaneId) -> Unrewarde /// Return test externalities to use in tests. pub fn new_test_ext() -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); pallet_balances::GenesisConfig:: { balances: vec![(ENDOWED_ACCOUNT, 1_000_000)] } .assimilate_storage(&mut t) .unwrap(); diff --git a/bridges/modules/parachains/src/lib.rs b/bridges/modules/parachains/src/lib.rs index 52b436b8207..4f78a45d4b7 100644 --- a/bridges/modules/parachains/src/lib.rs +++ b/bridges/modules/parachains/src/lib.rs @@ -623,7 +623,7 @@ pub mod pallet { } #[pallet::genesis_build] - impl, I: 'static> GenesisBuild for GenesisConfig { + impl, I: 'static> BuildGenesisConfig for GenesisConfig { fn build(&self) { PalletOperatingMode::::put(self.operating_mode); if let Some(ref owner) = self.owner { diff --git a/bridges/modules/parachains/src/mock.rs b/bridges/modules/parachains/src/mock.rs index 0a61d91d7b2..a7030f0ae03 100644 --- a/bridges/modules/parachains/src/mock.rs +++ b/bridges/modules/parachains/src/mock.rs @@ -19,7 +19,7 @@ use bp_polkadot_core::parachains::ParaId; use bp_runtime::{Chain, Parachain}; use frame_support::{construct_runtime, parameter_types, traits::ConstU32, weights::Weight}; use sp_runtime::{ - testing::{Header, H256}, + testing::H256, traits::{BlakeTwo256, Header as HeaderT, IdentityLookup}, MultiSignature, Perbill, }; @@ -33,7 +33,6 @@ pub type RelayBlockHeader = sp_runtime::generic::Header; type Block = frame_system::mocking::MockBlock; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; pub const PARAS_PALLET_NAME: &str = "Paras"; pub const UNTRACKED_PARACHAIN_ID: u32 = 10; @@ -55,7 +54,7 @@ impl Chain for Parachain1 { type Header = RegularParachainHeader; type AccountId = u64; type Balance = u64; - type Index = u64; + type Nonce = u64; type Signature = MultiSignature; fn max_extrinsic_size() -> u32 { @@ -79,7 +78,7 @@ impl Chain for Parachain2 { type Header = RegularParachainHeader; type AccountId = u64; type Balance = u64; - type Index = u64; + type Nonce = u64; type Signature = MultiSignature; fn max_extrinsic_size() -> u32 { @@ -103,7 +102,7 @@ impl Chain for Parachain3 { type Header = RegularParachainHeader; type AccountId = u64; type Balance = u64; - type Index = u64; + type Nonce = u64; type Signature = MultiSignature; fn max_extrinsic_size() -> u32 { @@ -128,7 +127,7 @@ impl Chain for BigParachain { type Header = BigParachainHeader; type AccountId = u64; type Balance = u64; - type Index = u64; + type Nonce = u64; type Signature = MultiSignature; fn max_extrinsic_size() -> u32 { @@ -144,12 +143,9 @@ impl Parachain for BigParachain { } construct_runtime! { - pub enum TestRuntime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum TestRuntime { - System: frame_system::{Pallet, Call, Config, Storage, Event}, + System: frame_system::{Pallet, Call, Config, Storage, Event}, Grandpa1: pallet_bridge_grandpa::::{Pallet, Event}, Grandpa2: pallet_bridge_grandpa::::{Pallet, Event}, Parachains: pallet_bridge_parachains::{Call, Pallet, Event}, @@ -165,14 +161,13 @@ parameter_types! { impl frame_system::Config for TestRuntime { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type RuntimeCall = RuntimeCall; - type BlockNumber = TestNumber; + type Block = Block; type Hash = H256; type Hashing = RegularParachainHasher; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -270,7 +265,7 @@ impl Chain for TestBridgedChain { type AccountId = AccountId; type Balance = u32; - type Index = u32; + type Nonce = u32; type Signature = sp_runtime::testing::TestSignature; fn max_extrinsic_size() -> u32 { @@ -301,7 +296,7 @@ impl Chain for OtherBridgedChain { type AccountId = AccountId; type Balance = u32; - type Index = u32; + type Nonce = u32; type Signature = sp_runtime::testing::TestSignature; fn max_extrinsic_size() -> u32 { diff --git a/bridges/modules/relayers/src/lib.rs b/bridges/modules/relayers/src/lib.rs index 54b888cf29d..a71c218443b 100644 --- a/bridges/modules/relayers/src/lib.rs +++ b/bridges/modules/relayers/src/lib.rs @@ -66,7 +66,7 @@ pub mod pallet { /// Pay rewards scheme. type PaymentProcedure: PaymentProcedure; /// Stake and slash scheme. - type StakeAndSlash: StakeAndSlash; + type StakeAndSlash: StakeAndSlash, Self::Reward>; /// Pallet call weights. type WeightInfo: WeightInfoExt; } @@ -117,7 +117,7 @@ pub mod pallet { /// Registration allows relayer to get priority boost for its message delivery transactions. #[pallet::call_index(1)] #[pallet::weight(T::WeightInfo::register())] - pub fn register(origin: OriginFor, valid_till: T::BlockNumber) -> DispatchResult { + pub fn register(origin: OriginFor, valid_till: BlockNumberFor) -> DispatchResult { let relayer = ensure_signed(origin)?; // valid till must be larger than the current block number and the lease must be larger @@ -330,10 +330,10 @@ pub mod pallet { } /// Return required registration lease. - pub(crate) fn required_registration_lease() -> T::BlockNumber { + pub(crate) fn required_registration_lease() -> BlockNumberFor { , T::Reward, >>::RequiredRegistrationLease::get() } @@ -342,7 +342,7 @@ pub mod pallet { pub(crate) fn required_stake() -> T::Reward { , T::Reward, >>::RequiredStake::get() } @@ -383,7 +383,7 @@ pub mod pallet { /// Relayer account that has been registered. relayer: T::AccountId, /// Relayer registration. - registration: Registration, + registration: Registration, T::Reward>, }, /// Relayer has been `deregistered`. Deregistered { @@ -395,7 +395,7 @@ pub mod pallet { /// Relayer account that has been `deregistered`. relayer: T::AccountId, /// Registration that was removed. - registration: Registration, + registration: Registration, T::Reward>, }, } @@ -445,7 +445,7 @@ pub mod pallet { _, Blake2_128Concat, T::AccountId, - Registration, + Registration, T::Reward>, OptionQuery, >; } diff --git a/bridges/modules/relayers/src/mock.rs b/bridges/modules/relayers/src/mock.rs index d8c5bd90967..b3fcb24cdd2 100644 --- a/bridges/modules/relayers/src/mock.rs +++ b/bridges/modules/relayers/src/mock.rs @@ -25,8 +25,8 @@ use bp_relayers::{ use frame_support::{parameter_types, traits::fungible::Mutate, weights::RuntimeDbWeight}; use sp_core::H256; use sp_runtime::{ - testing::Header as SubstrateHeader, traits::{BlakeTwo256, ConstU32, IdentityLookup}, + BuildStorage, }; pub type AccountId = u64; @@ -43,15 +43,11 @@ pub type TestStakeAndSlash = pallet_bridge_relayers::StakeAndSlashNamed< >; type Block = frame_system::mocking::MockBlock; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; frame_support::construct_runtime! { - pub enum TestRuntime where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum TestRuntime { - System: frame_system::{Pallet, Call, Config, Storage, Event}, + System: frame_system::{Pallet, Call, Config, Storage, Event}, Balances: pallet_balances::{Pallet, Event}, Relayers: pallet_bridge_relayers::{Pallet, Call, Event}, } @@ -67,14 +63,13 @@ parameter_types! { impl frame_system::Config for TestRuntime { type RuntimeOrigin = RuntimeOrigin; - type Index = u64; + type Nonce = u64; type RuntimeCall = RuntimeCall; - type BlockNumber = BlockNumber; + type Block = Block; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = SubstrateHeader; type RuntimeEvent = RuntimeEvent; type BlockHashCount = frame_support::traits::ConstU64<250>; type Version = (); @@ -170,7 +165,7 @@ impl PaymentProcedure for TestPaymentProcedure { /// Return test externalities to use in tests. pub fn new_test_ext() -> sp_io::TestExternalities { - let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let t = frame_system::GenesisConfig::::default().build_storage().unwrap(); sp_io::TestExternalities::new(t) } diff --git a/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs b/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs index 8ff096d077f..525b2e62cea 100644 --- a/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs +++ b/bridges/primitives/chain-bridge-hub-cumulus/src/lib.rs @@ -18,7 +18,7 @@ pub use bp_polkadot_core::{ AccountId, AccountInfoStorageMapKeyProvider, AccountPublic, Balance, BlockNumber, Hash, Hasher, - Hashing, Header, Index, Nonce, Perbill, Signature, SignedBlock, UncheckedExtrinsic, + Hashing, Header, Nonce, Perbill, Signature, SignedBlock, UncheckedExtrinsic, EXTRA_STORAGE_PROOF_SIZE, TX_EXTRA_BYTES, }; @@ -53,7 +53,7 @@ pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75); /// This is a copy-paste from the cumulus repo's `parachains-common` crate. const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(constants::WEIGHT_REF_TIME_PER_SECOND, 0) .saturating_div(2) - .set_proof_size(polkadot_primitives::MAX_POV_SIZE as u64); + .set_proof_size(polkadot_primitives::v5::MAX_POV_SIZE as u64); /// All cumulus bridge hubs assume that about 5 percent of the block weight is consumed by /// `on_initialize` handlers. This is used to limit the maximal weight of a single extrinsic. @@ -140,7 +140,7 @@ pub type SignedExtra = ( CheckTxVersion, CheckGenesis, CheckEra, - CheckNonce, + CheckNonce, CheckWeight, ChargeTransactionPayment, BridgeRejectObsoleteHeadersAndMessages, @@ -159,12 +159,12 @@ pub trait BridgeHubSignedExtension { transaction_version: u32, era: bp_runtime::TransactionEra, genesis_hash: Hash, - nonce: Index, + nonce: Nonce, tip: Balance, ) -> Self; /// Return transaction nonce. - fn nonce(&self) -> Index; + fn nonce(&self) -> Nonce; /// Return transaction tip. fn tip(&self) -> Balance; @@ -177,7 +177,7 @@ impl BridgeHubSignedExtension for SignedExtension { transaction_version: u32, era: bp_runtime::TransactionEra, genesis_hash: Hash, - nonce: Index, + nonce: Nonce, tip: Balance, ) -> Self { GenericSignedExtension::new( @@ -209,7 +209,7 @@ impl BridgeHubSignedExtension for SignedExtension { } /// Return transaction nonce. - fn nonce(&self) -> Index { + fn nonce(&self) -> Nonce { self.payload.5 .0 } diff --git a/bridges/primitives/chain-bridge-hub-kusama/src/lib.rs b/bridges/primitives/chain-bridge-hub-kusama/src/lib.rs index 00b6c8301e4..7405f561fb2 100644 --- a/bridges/primitives/chain-bridge-hub-kusama/src/lib.rs +++ b/bridges/primitives/chain-bridge-hub-kusama/src/lib.rs @@ -43,7 +43,7 @@ impl Chain for BridgeHubKusama { type AccountId = AccountId; type Balance = Balance; - type Index = Index; + type Nonce = Nonce; type Signature = Signature; fn max_extrinsic_size() -> u32 { diff --git a/bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs b/bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs index 8bd9167b618..e1fc0d7bc47 100644 --- a/bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs +++ b/bridges/primitives/chain-bridge-hub-polkadot/src/lib.rs @@ -39,7 +39,7 @@ impl Chain for BridgeHubPolkadot { type AccountId = AccountId; type Balance = Balance; - type Index = Index; + type Nonce = Nonce; type Signature = Signature; fn max_extrinsic_size() -> u32 { diff --git a/bridges/primitives/chain-bridge-hub-rococo/src/lib.rs b/bridges/primitives/chain-bridge-hub-rococo/src/lib.rs index 936e4d1beb7..50206c8e6b3 100644 --- a/bridges/primitives/chain-bridge-hub-rococo/src/lib.rs +++ b/bridges/primitives/chain-bridge-hub-rococo/src/lib.rs @@ -43,7 +43,7 @@ impl Chain for BridgeHubRococo { type AccountId = AccountId; type Balance = Balance; - type Index = Index; + type Nonce = Nonce; type Signature = Signature; fn max_extrinsic_size() -> u32 { diff --git a/bridges/primitives/chain-bridge-hub-wococo/src/lib.rs b/bridges/primitives/chain-bridge-hub-wococo/src/lib.rs index 00704995c5e..7d14460c737 100644 --- a/bridges/primitives/chain-bridge-hub-wococo/src/lib.rs +++ b/bridges/primitives/chain-bridge-hub-wococo/src/lib.rs @@ -39,7 +39,7 @@ impl Chain for BridgeHubWococo { type AccountId = AccountId; type Balance = Balance; - type Index = Index; + type Nonce = Nonce; type Signature = Signature; fn max_extrinsic_size() -> u32 { diff --git a/bridges/primitives/chain-kusama/src/lib.rs b/bridges/primitives/chain-kusama/src/lib.rs index 5cef6ae0ee6..229905a3d4a 100644 --- a/bridges/primitives/chain-kusama/src/lib.rs +++ b/bridges/primitives/chain-kusama/src/lib.rs @@ -35,7 +35,7 @@ impl Chain for Kusama { type AccountId = ::AccountId; type Balance = ::Balance; - type Index = ::Index; + type Nonce = ::Nonce; type Signature = ::Signature; fn max_extrinsic_size() -> u32 { diff --git a/bridges/primitives/chain-polkadot/src/lib.rs b/bridges/primitives/chain-polkadot/src/lib.rs index 51d9f6f0233..628634bb46f 100644 --- a/bridges/primitives/chain-polkadot/src/lib.rs +++ b/bridges/primitives/chain-polkadot/src/lib.rs @@ -35,7 +35,7 @@ impl Chain for Polkadot { type AccountId = ::AccountId; type Balance = ::Balance; - type Index = ::Index; + type Nonce = ::Nonce; type Signature = ::Signature; fn max_extrinsic_size() -> u32 { diff --git a/bridges/primitives/chain-rococo/src/lib.rs b/bridges/primitives/chain-rococo/src/lib.rs index 0cb0b1d41e6..a825c8b3978 100644 --- a/bridges/primitives/chain-rococo/src/lib.rs +++ b/bridges/primitives/chain-rococo/src/lib.rs @@ -35,7 +35,7 @@ impl Chain for Rococo { type AccountId = ::AccountId; type Balance = ::Balance; - type Index = ::Index; + type Nonce = ::Nonce; type Signature = ::Signature; fn max_extrinsic_size() -> u32 { diff --git a/bridges/primitives/chain-wococo/src/lib.rs b/bridges/primitives/chain-wococo/src/lib.rs index 2df019496ab..fb63613427d 100644 --- a/bridges/primitives/chain-wococo/src/lib.rs +++ b/bridges/primitives/chain-wococo/src/lib.rs @@ -38,7 +38,7 @@ impl Chain for Wococo { type AccountId = ::AccountId; type Balance = ::Balance; - type Index = ::Index; + type Nonce = ::Nonce; type Signature = ::Signature; fn max_extrinsic_size() -> u32 { diff --git a/bridges/primitives/header-chain/src/justification.rs b/bridges/primitives/header-chain/src/justification.rs index 8433107fce2..714546a42ef 100644 --- a/bridges/primitives/header-chain/src/justification.rs +++ b/bridges/primitives/header-chain/src/justification.rs @@ -21,10 +21,10 @@ use crate::ChainWithGrandpa; -use bp_runtime::{BlockNumberOf, Chain, HashOf}; +use bp_runtime::{BlockNumberOf, Chain, HashOf, HeaderId}; use codec::{Decode, Encode, MaxEncodedLen}; use finality_grandpa::voter_set::VoterSet; -use frame_support::RuntimeDebug; +use frame_support::{RuntimeDebug, RuntimeDebugNoBound}; use scale_info::TypeInfo; use sp_consensus_grandpa::{AuthorityId, AuthoritySignature, SetId}; use sp_runtime::{traits::Header as HeaderT, SaturatedConversion}; @@ -38,7 +38,7 @@ use sp_std::{ /// /// This particular proof is used to prove that headers on a bridged chain /// (so not our chain) have been finalized correctly. -#[derive(Encode, Decode, Clone, PartialEq, Eq, TypeInfo)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, TypeInfo, RuntimeDebugNoBound)] pub struct GrandpaJustification { /// The round (voting period) this justification is valid for. pub round: u64, @@ -49,25 +49,6 @@ pub struct GrandpaJustification { pub votes_ancestries: Vec
, } -// TODO: remove and use `RuntimeDebug` (https://github.com/paritytech/parity-bridges-common/issues/2136) -impl sp_std::fmt::Debug for GrandpaJustification
{ - fn fmt(&self, fmt: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result { - #[cfg(feature = "std")] - { - fmt.debug_struct("GrandpaJustification") - .field("round", &self.round) - .field("commit", &self.commit) - .field("votes_ancestries", &self.votes_ancestries) - .finish() - } - - #[cfg(not(feature = "std"))] - { - fmt.write_str("") - } - } -} - impl GrandpaJustification { /// Returns reasonable size of justification using constants from the provided chain. /// @@ -75,7 +56,7 @@ impl GrandpaJustification { /// any precise calculations - that's just an estimation. pub fn max_reasonable_size(required_precommits: u32) -> u32 where - C: Chain
+ ChainWithGrandpa, + C: Chain + ChainWithGrandpa, { // we don't need precise results here - just estimations, so some details // are removed from computations (e.g. bytes required to encode vector length) @@ -103,6 +84,10 @@ impl GrandpaJustification { 8u32.saturating_add(max_expected_signed_commit_size) .saturating_add(max_expected_votes_ancestries_size) } + + pub fn commit_target_id(&self) -> HeaderId { + HeaderId(self.commit.target_number, self.commit.target_hash) + } } impl crate::FinalityProof for GrandpaJustification { @@ -128,12 +113,12 @@ pub enum Error { InvalidAuthoritySignature, /// The justification contains precommit for header that is not a descendant of the commit /// header. - PrecommitIsNotCommitDescendant, + UnrelatedAncestryVote, /// The cumulative weight of all votes in the justification is not enough to justify commit /// header finalization. TooLowCumulativeWeight, /// The justification contains extra (unused) headers in its `votes_ancestries` field. - ExtraHeadersInVotesAncestries, + RedundantVotesAncestries, } /// Given GRANDPA authorities set size, return number of valid authorities votes that the @@ -158,20 +143,22 @@ pub fn verify_and_optimize_justification( finalized_target: (Header::Hash, Header::Number), authorities_set_id: SetId, authorities_set: &VoterSet, - justification: GrandpaJustification
, -) -> Result, Error> -where - Header::Number: finality_grandpa::BlockNumberOps, -{ - let mut optimizer = OptimizationCallbacks(Vec::new()); + justification: &mut GrandpaJustification
, +) -> Result<(), Error> { + let mut optimizer = OptimizationCallbacks { + extra_precommits: vec![], + redundant_votes_ancestries: Default::default(), + }; verify_justification_with_callbacks( finalized_target, authorities_set_id, authorities_set, - &justification, + justification, &mut optimizer, )?; - Ok(optimizer.optimize(justification)) + optimizer.optimize(justification); + + Ok(()) } /// Verify that justification, that is generated by given authority set, finalizes given header. @@ -180,10 +167,7 @@ pub fn verify_justification( authorities_set_id: SetId, authorities_set: &VoterSet, justification: &GrandpaJustification
, -) -> Result<(), Error> -where - Header::Number: finality_grandpa::BlockNumberOps, -{ +) -> Result<(), Error> { verify_justification_with_callbacks( finalized_target, authorities_set_id, @@ -194,19 +178,28 @@ where } /// Verification callbacks. -trait VerificationCallbacks { +trait VerificationCallbacks { /// Called when we see a precommit from unknown authority. fn on_unkown_authority(&mut self, precommit_idx: usize) -> Result<(), Error>; /// Called when we see a precommit with duplicate vote from known authority. fn on_duplicate_authority_vote(&mut self, precommit_idx: usize) -> Result<(), Error>; + /// Called when we see a precommit with an invalid signature. + fn on_invalid_authority_signature(&mut self, precommit_idx: usize) -> Result<(), Error>; /// Called when we see a precommit after we've collected enough votes from authorities. fn on_redundant_authority_vote(&mut self, precommit_idx: usize) -> Result<(), Error>; + /// Called when we see a precommit that is not a descendant of the commit target. + fn on_unrelated_ancestry_vote(&mut self, precommit_idx: usize) -> Result<(), Error>; + /// Called when there are redundant headers in the votes ancestries. + fn on_redundant_votes_ancestries( + &mut self, + redundant_votes_ancestries: BTreeSet, + ) -> Result<(), Error>; } /// Verification callbacks that reject all unknown, duplicate or redundant votes. struct StrictVerificationCallbacks; -impl VerificationCallbacks for StrictVerificationCallbacks { +impl VerificationCallbacks
for StrictVerificationCallbacks { fn on_unkown_authority(&mut self, _precommit_idx: usize) -> Result<(), Error> { Err(Error::UnknownAuthorityVote) } @@ -215,61 +208,95 @@ impl VerificationCallbacks for StrictVerificationCallbacks { Err(Error::DuplicateAuthorityVote) } + fn on_invalid_authority_signature(&mut self, _precommit_idx: usize) -> Result<(), Error> { + Err(Error::InvalidAuthoritySignature) + } + fn on_redundant_authority_vote(&mut self, _precommit_idx: usize) -> Result<(), Error> { Err(Error::RedundantVotesInJustification) } + + fn on_unrelated_ancestry_vote(&mut self, _precommit_idx: usize) -> Result<(), Error> { + Err(Error::UnrelatedAncestryVote) + } + + fn on_redundant_votes_ancestries( + &mut self, + _redundant_votes_ancestries: BTreeSet, + ) -> Result<(), Error> { + Err(Error::RedundantVotesAncestries) + } } /// Verification callbacks for justification optimization. -struct OptimizationCallbacks(Vec); - -impl OptimizationCallbacks { - fn optimize( - self, - mut justification: GrandpaJustification
, - ) -> GrandpaJustification
{ - for invalid_precommit_idx in self.0.into_iter().rev() { +struct OptimizationCallbacks { + extra_precommits: Vec, + redundant_votes_ancestries: BTreeSet, +} + +impl OptimizationCallbacks
{ + fn optimize(self, justification: &mut GrandpaJustification
) { + for invalid_precommit_idx in self.extra_precommits.into_iter().rev() { justification.commit.precommits.remove(invalid_precommit_idx); } - justification + if !self.redundant_votes_ancestries.is_empty() { + justification + .votes_ancestries + .retain(|header| !self.redundant_votes_ancestries.contains(&header.hash())) + } } } -impl VerificationCallbacks for OptimizationCallbacks { +impl VerificationCallbacks
for OptimizationCallbacks
{ fn on_unkown_authority(&mut self, precommit_idx: usize) -> Result<(), Error> { - self.0.push(precommit_idx); + self.extra_precommits.push(precommit_idx); Ok(()) } fn on_duplicate_authority_vote(&mut self, precommit_idx: usize) -> Result<(), Error> { - self.0.push(precommit_idx); + self.extra_precommits.push(precommit_idx); + Ok(()) + } + + fn on_invalid_authority_signature(&mut self, precommit_idx: usize) -> Result<(), Error> { + self.extra_precommits.push(precommit_idx); Ok(()) } fn on_redundant_authority_vote(&mut self, precommit_idx: usize) -> Result<(), Error> { - self.0.push(precommit_idx); + self.extra_precommits.push(precommit_idx); + Ok(()) + } + + fn on_unrelated_ancestry_vote(&mut self, precommit_idx: usize) -> Result<(), Error> { + self.extra_precommits.push(precommit_idx); + Ok(()) + } + + fn on_redundant_votes_ancestries( + &mut self, + redundant_votes_ancestries: BTreeSet, + ) -> Result<(), Error> { + self.redundant_votes_ancestries = redundant_votes_ancestries; Ok(()) } } /// Verify that justification, that is generated by given authority set, finalizes given header. -fn verify_justification_with_callbacks( +fn verify_justification_with_callbacks>( finalized_target: (Header::Hash, Header::Number), authorities_set_id: SetId, authorities_set: &VoterSet, justification: &GrandpaJustification
, callbacks: &mut C, -) -> Result<(), Error> -where - Header::Number: finality_grandpa::BlockNumberOps, -{ +) -> Result<(), Error> { // ensure that it is justification for the expected header if (justification.commit.target_hash, justification.commit.target_number) != finalized_target { return Err(Error::InvalidJustificationTarget) } - let threshold = authorities_set.threshold().0.into(); - let mut chain = AncestryChain::new(&justification.votes_ancestries); + let threshold = authorities_set.threshold().get(); + let mut chain = AncestryChain::new(justification); let mut signature_buffer = Vec::new(); let mut votes = BTreeSet::new(); let mut cumulative_weight = 0u64; @@ -296,34 +323,20 @@ where // there's a lot of code in `validate_commit` and `import_precommit` functions inside // `finality-grandpa` crate (mostly related to reporting equivocations). But the only thing // that we care about is that only first vote from the authority is accepted - if !votes.insert(signed.id.clone()) { + if votes.contains(&signed.id) { callbacks.on_duplicate_authority_vote(precommit_idx)?; continue } - // everything below this line can't just `continue`, because state is already altered - - // precommits aren't allowed for block lower than the target - if signed.precommit.target_number < justification.commit.target_number { - return Err(Error::PrecommitIsNotCommitDescendant) - } - // all precommits must be descendants of target block - chain = chain - .ensure_descendant(&justification.commit.target_hash, &signed.precommit.target_hash)?; - // since we know now that the precommit target is the descendant of the justification - // target, we may increase 'weight' of the justification target - // - // there's a lot of code in the `VoteGraph::insert` method inside `finality-grandpa` crate, - // but in the end it is only used to find GHOST, which we don't care about. The only thing - // that we care about is that the justification target has enough weight - cumulative_weight = cumulative_weight.checked_add(authority_info.weight().0.into()).expect( - "sum of weights of ALL authorities is expected not to overflow - this is guaranteed by\ - existence of VoterSet;\ - the order of loop conditions guarantees that we can account vote from same authority\ - multiple times;\ - thus we'll never overflow the u64::MAX;\ - qed", - ); + // all precommits must be descendants of the target block + let route = + match chain.ancestry(&signed.precommit.target_hash, &signed.precommit.target_number) { + Some(route) => route, + None => { + callbacks.on_unrelated_ancestry_vote(precommit_idx)?; + continue + }, + }; // verify authority signature if !sp_consensus_grandpa::check_message_signature_with_buffer( @@ -334,76 +347,98 @@ where authorities_set_id, &mut signature_buffer, ) { - return Err(Error::InvalidAuthoritySignature) + callbacks.on_invalid_authority_signature(precommit_idx)?; + continue } + + // now we can count the vote since we know that it is valid + votes.insert(signed.id.clone()); + chain.mark_route_as_visited(route); + cumulative_weight = cumulative_weight.saturating_add(authority_info.weight().get()); } - // check that there are no extra headers in the justification - if !chain.unvisited.is_empty() { - return Err(Error::ExtraHeadersInVotesAncestries) + // check that the cumulative weight of validators that voted for the justification target (or + // one of its descendents) is larger than the required threshold. + if cumulative_weight < threshold { + return Err(Error::TooLowCumulativeWeight) } - // check that the cumulative weight of validators voted for the justification target (or one - // of its descendents) is larger than required threshold. - if cumulative_weight >= threshold { - Ok(()) - } else { - Err(Error::TooLowCumulativeWeight) + // check that there are no extra headers in the justification + if !chain.is_fully_visited() { + callbacks.on_redundant_votes_ancestries(chain.unvisited)?; } + + Ok(()) } /// Votes ancestries with useful methods. #[derive(RuntimeDebug)] pub struct AncestryChain { + /// We expect all forks in the ancestry chain to be descendants of base. + base: HeaderId, /// Header hash => parent header hash mapping. pub parents: BTreeMap, - /// Hashes of headers that were not visited by `is_ancestor` method. + /// Hashes of headers that were not visited by `ancestry()`. pub unvisited: BTreeSet, } impl AncestryChain
{ /// Create new ancestry chain. - pub fn new(ancestry: &[Header]) -> AncestryChain
{ + pub fn new(justification: &GrandpaJustification
) -> AncestryChain
{ let mut parents = BTreeMap::new(); let mut unvisited = BTreeSet::new(); - for ancestor in ancestry { + for ancestor in &justification.votes_ancestries { let hash = ancestor.hash(); let parent_hash = *ancestor.parent_hash(); parents.insert(hash, parent_hash); unvisited.insert(hash); } - AncestryChain { parents, unvisited } + AncestryChain { base: justification.commit_target_id(), parents, unvisited } } - /// Returns `Ok(_)` if `precommit_target` is a descendant of the `commit_target` block and - /// `Err(_)` otherwise. - pub fn ensure_descendant( - mut self, - commit_target: &Header::Hash, - precommit_target: &Header::Hash, - ) -> Result { - let mut current_hash = *precommit_target; + /// Returns a route if the precommit target block is a descendant of the `base` block. + pub fn ancestry( + &self, + precommit_target_hash: &Header::Hash, + precommit_target_number: &Header::Number, + ) -> Option> { + if precommit_target_number < &self.base.number() { + return None + } + + let mut route = vec![]; + let mut current_hash = *precommit_target_hash; loop { - if current_hash == *commit_target { + if current_hash == self.base.hash() { break } - let is_visited_before = !self.unvisited.remove(¤t_hash); current_hash = match self.parents.get(¤t_hash) { Some(parent_hash) => { + let is_visited_before = self.unvisited.get(¤t_hash).is_none(); if is_visited_before { - // `Some(parent_hash)` means that the `current_hash` is in the `parents` - // container `is_visited_before` means that it has been visited before in - // some of previous calls => since we assume that previous call has finished - // with `true`, this also will be finished with `true` - return Ok(self) + // If the current header has been visited in a previous call, it is a + // descendent of `base` (we assume that the previous call was successful). + return Some(route) } + route.push(current_hash); *parent_hash }, - None => return Err(Error::PrecommitIsNotCommitDescendant), + None => return None, }; } - Ok(self) + + Some(route) + } + + fn mark_route_as_visited(&mut self, route: Vec) { + for hash in route { + self.unvisited.remove(&hash); + } + } + + fn is_fully_visited(&self) -> bool { + self.unvisited.is_empty() } } diff --git a/bridges/primitives/header-chain/src/lib.rs b/bridges/primitives/header-chain/src/lib.rs index cf08a936234..5268e7d5c5f 100644 --- a/bridges/primitives/header-chain/src/lib.rs +++ b/bridges/primitives/header-chain/src/lib.rs @@ -139,7 +139,7 @@ pub trait ConsensusLogReader { pub struct GrandpaConsensusLogReader(sp_std::marker::PhantomData); impl GrandpaConsensusLogReader { - pub fn find_authorities_change( + pub fn find_scheduled_change( digest: &Digest, ) -> Option> { // find the first consensus digest with the right ID which converts to @@ -151,11 +151,24 @@ impl GrandpaConsensusLogReader { _ => None, }) } + + pub fn find_forced_change( + digest: &Digest, + ) -> Option<(Number, sp_consensus_grandpa::ScheduledChange)> { + // find the first consensus digest with the right ID which converts to + // the right kind of consensus log. + digest + .convert_first(|log| log.consensus_try_to(&GRANDPA_ENGINE_ID)) + .and_then(|log| match log { + ConsensusLog::ForcedChange(delay, change) => Some((delay, change)), + _ => None, + }) + } } impl ConsensusLogReader for GrandpaConsensusLogReader { fn schedules_authorities_change(digest: &Digest) -> bool { - GrandpaConsensusLogReader::::find_authorities_change(digest).is_some() + GrandpaConsensusLogReader::::find_scheduled_change(digest).is_some() } } diff --git a/bridges/primitives/header-chain/tests/implementation_match.rs b/bridges/primitives/header-chain/tests/implementation_match.rs index 22f690b8cb2..d5e42e21497 100644 --- a/bridges/primitives/header-chain/tests/implementation_match.rs +++ b/bridges/primitives/header-chain/tests/implementation_match.rs @@ -38,8 +38,8 @@ type TestNumber = ::Number; struct AncestryChain(bp_header_chain::justification::AncestryChain); impl AncestryChain { - fn new(ancestry: &[TestHeader]) -> Self { - Self(bp_header_chain::justification::AncestryChain::new(ancestry)) + fn new(justification: &GrandpaJustification) -> Self { + Self(bp_header_chain::justification::AncestryChain::new(justification)) } } @@ -55,9 +55,9 @@ impl finality_grandpa::Chain for AncestryChain { if current_hash == base { break } - match self.0.parents.get(¤t_hash).cloned() { + match self.0.parents.get(¤t_hash) { Some(parent_hash) => { - current_hash = parent_hash; + current_hash = *parent_hash; route.push(current_hash); }, _ => return Err(finality_grandpa::Error::NotDescendent), @@ -124,7 +124,7 @@ fn same_result_when_precommit_target_has_lower_number_than_commit_target() { &full_voter_set(), &justification, ), - Err(Error::PrecommitIsNotCommitDescendant), + Err(Error::UnrelatedAncestryVote), ); // original implementation returns `Ok(validation_result)` @@ -132,7 +132,7 @@ fn same_result_when_precommit_target_has_lower_number_than_commit_target() { let result = finality_grandpa::validate_commit( &justification.commit, &full_voter_set(), - &AncestryChain::new(&justification.votes_ancestries), + &AncestryChain::new(&justification), ) .unwrap(); @@ -157,7 +157,7 @@ fn same_result_when_precommit_target_is_not_descendant_of_commit_target() { &full_voter_set(), &justification, ), - Err(Error::PrecommitIsNotCommitDescendant), + Err(Error::UnrelatedAncestryVote), ); // original implementation returns `Ok(validation_result)` @@ -165,7 +165,7 @@ fn same_result_when_precommit_target_is_not_descendant_of_commit_target() { let result = finality_grandpa::validate_commit( &justification.commit, &full_voter_set(), - &AncestryChain::new(&justification.votes_ancestries), + &AncestryChain::new(&justification), ) .unwrap(); @@ -198,7 +198,7 @@ fn same_result_when_there_are_not_enough_cumulative_weight_to_finalize_commit_ta let result = finality_grandpa::validate_commit( &justification.commit, &full_voter_set(), - &AncestryChain::new(&justification.votes_ancestries), + &AncestryChain::new(&justification), ) .unwrap(); @@ -236,7 +236,7 @@ fn different_result_when_justification_contains_duplicate_vote() { let result = finality_grandpa::validate_commit( &justification.commit, &full_voter_set(), - &AncestryChain::new(&justification.votes_ancestries), + &AncestryChain::new(&justification), ) .unwrap(); @@ -277,7 +277,7 @@ fn different_results_when_authority_equivocates_once_in_a_round() { let result = finality_grandpa::validate_commit( &justification.commit, &full_voter_set(), - &AncestryChain::new(&justification.votes_ancestries), + &AncestryChain::new(&justification), ) .unwrap(); @@ -330,7 +330,7 @@ fn different_results_when_authority_equivocates_twice_in_a_round() { let result = finality_grandpa::validate_commit( &justification.commit, &full_voter_set(), - &AncestryChain::new(&justification.votes_ancestries), + &AncestryChain::new(&justification), ) .unwrap(); @@ -369,7 +369,7 @@ fn different_results_when_there_are_more_than_enough_votes() { let result = finality_grandpa::validate_commit( &justification.commit, &full_voter_set(), - &AncestryChain::new(&justification.votes_ancestries), + &AncestryChain::new(&justification), ) .unwrap(); @@ -410,7 +410,7 @@ fn different_results_when_there_is_a_vote_of_unknown_authority() { let result = finality_grandpa::validate_commit( &justification.commit, &full_voter_set(), - &AncestryChain::new(&justification.votes_ancestries), + &AncestryChain::new(&justification), ) .unwrap(); diff --git a/bridges/primitives/header-chain/tests/justification.rs b/bridges/primitives/header-chain/tests/justification.rs index 3cd63b935d0..26ed67fa65f 100644 --- a/bridges/primitives/header-chain/tests/justification.rs +++ b/bridges/primitives/header-chain/tests/justification.rs @@ -21,6 +21,8 @@ use bp_header_chain::justification::{ Error, }; use bp_test_utils::*; +use finality_grandpa::SignedPrecommit; +use sp_consensus_grandpa::AuthoritySignature; type TestHeader = sp_runtime::testing::Header; @@ -133,7 +135,7 @@ fn justification_with_invalid_commit_rejected() { &voter_set(), &justification, ), - Err(Error::ExtraHeadersInVotesAncestries), + Err(Error::TooLowCumulativeWeight), ); } @@ -166,7 +168,7 @@ fn justification_with_invalid_precommit_ancestry() { &voter_set(), &justification, ), - Err(Error::ExtraHeadersInVotesAncestries), + Err(Error::RedundantVotesAncestries), ); } @@ -197,14 +199,14 @@ fn justification_is_invalid_if_we_dont_meet_threshold() { #[test] fn optimizer_does_noting_with_minimal_justification() { - let justification = make_default_justification::(&test_header(1)); + let mut justification = make_default_justification::(&test_header(1)); let num_precommits_before = justification.commit.precommits.len(); - let justification = verify_and_optimize_justification::( + verify_and_optimize_justification::( header_id::(1), TEST_GRANDPA_SET_ID, &voter_set(), - justification, + &mut justification, ) .unwrap(); let num_precommits_after = justification.commit.precommits.len(); @@ -223,11 +225,11 @@ fn unknown_authority_votes_are_removed_by_optimizer() { )); let num_precommits_before = justification.commit.precommits.len(); - let justification = verify_and_optimize_justification::( + verify_and_optimize_justification::( header_id::(1), TEST_GRANDPA_SET_ID, &voter_set(), - justification, + &mut justification, ) .unwrap(); let num_precommits_after = justification.commit.precommits.len(); @@ -244,11 +246,42 @@ fn duplicate_authority_votes_are_removed_by_optimizer() { .push(justification.commit.precommits.first().cloned().unwrap()); let num_precommits_before = justification.commit.precommits.len(); - let justification = verify_and_optimize_justification::( + verify_and_optimize_justification::( header_id::(1), TEST_GRANDPA_SET_ID, &voter_set(), - justification, + &mut justification, + ) + .unwrap(); + let num_precommits_after = justification.commit.precommits.len(); + + assert_eq!(num_precommits_before - 1, num_precommits_after); +} + +#[test] +fn invalid_authority_signatures_are_removed_by_optimizer() { + let mut justification = make_default_justification::(&test_header(1)); + + let target = header_id::(1); + let invalid_raw_signature: Vec = ALICE.sign(b"").to_bytes().into(); + justification.commit.precommits.insert( + 0, + SignedPrecommit { + precommit: finality_grandpa::Precommit { + target_hash: target.0, + target_number: target.1, + }, + signature: AuthoritySignature::try_from(invalid_raw_signature).unwrap(), + id: ALICE.into(), + }, + ); + + let num_precommits_before = justification.commit.precommits.len(); + verify_and_optimize_justification::( + header_id::(1), + TEST_GRANDPA_SET_ID, + &voter_set(), + &mut justification, ) .unwrap(); let num_precommits_after = justification.commit.precommits.len(); @@ -267,14 +300,58 @@ fn redundant_authority_votes_are_removed_by_optimizer() { )); let num_precommits_before = justification.commit.precommits.len(); - let justification = verify_and_optimize_justification::( + verify_and_optimize_justification::( header_id::(1), TEST_GRANDPA_SET_ID, &voter_set(), - justification, + &mut justification, ) .unwrap(); let num_precommits_after = justification.commit.precommits.len(); assert_eq!(num_precommits_before - 1, num_precommits_after); } + +#[test] +fn unrelated_ancestry_votes_are_removed_by_optimizer() { + let mut justification = make_default_justification::(&test_header(2)); + justification.commit.precommits.insert( + 0, + signed_precommit::( + &ALICE, + header_id::(1), + justification.round, + TEST_GRANDPA_SET_ID, + ), + ); + + let num_precommits_before = justification.commit.precommits.len(); + verify_and_optimize_justification::( + header_id::(2), + TEST_GRANDPA_SET_ID, + &voter_set(), + &mut justification, + ) + .unwrap(); + let num_precommits_after = justification.commit.precommits.len(); + + assert_eq!(num_precommits_before - 1, num_precommits_after); +} + +#[test] +fn redundant_votes_ancestries_are_removed_by_optimizer() { + let mut justification = make_default_justification::(&test_header(1)); + justification.votes_ancestries.push(test_header(100)); + + let num_votes_ancestries_before = justification.votes_ancestries.len(); + verify_and_optimize_justification::( + header_id::(1), + TEST_GRANDPA_SET_ID, + &voter_set(), + &mut justification, + ) + .unwrap(); + let num_votes_ancestries_after = justification.votes_ancestries.len(); + + assert_eq!(num_votes_ancestries_before - 1, num_votes_ancestries_after); +} diff --git a/bridges/primitives/messages/src/lib.rs b/bridges/primitives/messages/src/lib.rs index 3df039d7eb8..cb3a14572d7 100644 --- a/bridges/primitives/messages/src/lib.rs +++ b/bridges/primitives/messages/src/lib.rs @@ -30,6 +30,7 @@ use frame_support::{PalletError, RuntimeDebug}; // Weight is reexported to avoid additional frame-support dependencies in related crates. pub use frame_support::weights::Weight; use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; use source_chain::RelayersRewards; use sp_core::TypeId; use sp_std::{collections::vec_deque::VecDeque, ops::RangeInclusive, prelude::*}; @@ -49,8 +50,8 @@ pub mod target_chain; RuntimeDebug, TypeInfo, MaxEncodedLen, - serde::Serialize, - serde::Deserialize, + Serialize, + Deserialize, )] pub enum MessagesOperatingMode { /// Basic operating mode (Normal/Halted) diff --git a/bridges/primitives/polkadot-core/src/lib.rs b/bridges/primitives/polkadot-core/src/lib.rs index 3774d283fc4..ffd48d8a389 100644 --- a/bridges/primitives/polkadot-core/src/lib.rs +++ b/bridges/primitives/polkadot-core/src/lib.rs @@ -181,9 +181,6 @@ pub type BlockNumber = u32; /// Hash type used in Polkadot-like chains. pub type Hash = ::Out; -/// Account Index (a.k.a. nonce). -pub type Index = u32; - /// Hashing type. pub type Hashing = BlakeTwo256; @@ -205,7 +202,7 @@ pub type AccountId = ::AccountId; /// Address of account on Polkadot-like chains. pub type AccountAddress = MultiAddress; -/// Index of a transaction on the Polkadot-like chains. +/// Nonce of a transaction on the Polkadot-like chains. pub type Nonce = u32; /// Block type of Polkadot-like chains. @@ -236,7 +233,7 @@ impl Chain for PolkadotLike { type AccountId = AccountId; type Balance = Balance; - type Index = Index; + type Nonce = Nonce; type Signature = Signature; fn max_extrinsic_size() -> u32 { diff --git a/bridges/primitives/runtime/src/chain.rs b/bridges/primitives/runtime/src/chain.rs index c79058cea90..8c47662a7c1 100644 --- a/bridges/primitives/runtime/src/chain.rs +++ b/bridges/primitives/runtime/src/chain.rs @@ -170,8 +170,8 @@ pub trait Chain: Send + Sync + 'static { + Zero + TryFrom + MaxEncodedLen; - /// Index of a transaction used by the chain. - type Index: Parameter + /// Nonce of a transaction used by the chain. + type Nonce: Parameter + Member + MaybeSerialize + Debug @@ -206,7 +206,7 @@ where type Header = ::Header; type AccountId = ::AccountId; type Balance = ::Balance; - type Index = ::Index; + type Nonce = ::Nonce; type Signature = ::Signature; fn max_extrinsic_size() -> u32 { @@ -261,8 +261,8 @@ pub type AccountIdOf = ::AccountId; /// Balance type used by the chain. pub type BalanceOf = ::Balance; -/// Transaction index type used by the chain. -pub type IndexOf = ::Index; +/// Transaction nonce type used by the chain. +pub type NonceOf = ::Nonce; /// Signature type used by the chain. pub type SignatureOf = ::Signature; diff --git a/bridges/primitives/runtime/src/lib.rs b/bridges/primitives/runtime/src/lib.rs index 1ce1b7a0eed..c394af37fa4 100644 --- a/bridges/primitives/runtime/src/lib.rs +++ b/bridges/primitives/runtime/src/lib.rs @@ -25,13 +25,14 @@ use frame_support::{ }; use frame_system::RawOrigin; use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; use sp_core::storage::StorageKey; use sp_runtime::traits::{BadOrigin, Header as HeaderT, UniqueSaturatedInto}; use sp_std::{convert::TryFrom, fmt::Debug, ops::RangeInclusive, vec, vec::Vec}; pub use chain::{ AccountIdOf, AccountPublicOf, BalanceOf, BlockNumberOf, Chain, EncodedOrDecodedCall, HashOf, - HasherOf, HeaderOf, IndexOf, Parachain, ParachainIdOf, SignatureOf, TransactionEraOf, + HasherOf, HeaderOf, NonceOf, Parachain, ParachainIdOf, SignatureOf, TransactionEraOf, UnderlyingChainOf, UnderlyingChainProvider, }; pub use frame_support::storage::storage_prefix as storage_value_final_key; @@ -383,8 +384,8 @@ pub trait OperatingMode: Send + Copy + Debug + FullCodec { RuntimeDebug, TypeInfo, MaxEncodedLen, - serde::Serialize, - serde::Deserialize, + Serialize, + Deserialize, )] pub enum BasicOperatingMode { /// Normal mode, when all operations are allowed. diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml index 729d8d13a68..761ce43e2fc 100644 --- a/client/cli/Cargo.toml +++ b/client/cli/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Parity Technologies "] edition = "2021" [dependencies] -clap = { version = "4.3.11", features = ["derive"] } +clap = { version = "4.3.12", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0" } url = "2.4.0" diff --git a/client/collator/src/service.rs b/client/collator/src/service.rs index 7724b0a68a6..3125fea4248 100644 --- a/client/collator/src/service.rs +++ b/client/collator/src/service.rs @@ -58,12 +58,18 @@ pub trait ServiceInterface { candidate: ParachainCandidate, ) -> Option<(Collation, ParachainBlockData)>; - /// Inform networking systems that the block should be announced after an appropriate - /// signal has been received. This returns the sending half of the signal. + /// Inform networking systems that the block should be announced after a signal has + /// been received to indicate the block has been seconded by a relay-chain validator. + /// + /// This sets up the barrier and returns the sending side of a channel, for the signal + /// to be passed through. fn announce_with_barrier( &self, block_hash: Block::Hash, ) -> oneshot::Sender; + + /// Directly announce a block on the network. + fn announce_block(&self, block_hash: Block::Hash, data: Option>); } /// The [`CollatorService`] provides common utilities for parachain consensus and authoring. @@ -74,6 +80,7 @@ pub trait ServiceInterface { pub struct CollatorService { block_status: Arc, wait_to_announce: Arc>>, + announce_block: Arc>) + Send + Sync>, runtime_api: Arc, } @@ -82,6 +89,7 @@ impl Clone for CollatorService { Self { block_status: self.block_status.clone(), wait_to_announce: self.wait_to_announce.clone(), + announce_block: self.announce_block.clone(), runtime_api: self.runtime_api.clone(), } } @@ -101,9 +109,10 @@ where announce_block: Arc>) + Send + Sync>, runtime_api: Arc, ) -> Self { - let wait_to_announce = Arc::new(Mutex::new(WaitToAnnounce::new(spawner, announce_block))); + let wait_to_announce = + Arc::new(Mutex::new(WaitToAnnounce::new(spawner, announce_block.clone()))); - Self { block_status, wait_to_announce, runtime_api } + Self { block_status, wait_to_announce, announce_block, runtime_api } } /// Checks the status of the given block hash in the Parachain. @@ -315,4 +324,8 @@ where ) -> oneshot::Sender { CollatorService::announce_with_barrier(self, block_hash) } + + fn announce_block(&self, block_hash: Block::Hash, data: Option>) { + (self.announce_block)(block_hash, data) + } } diff --git a/client/consensus/aura/Cargo.toml b/client/consensus/aura/Cargo.toml index 4ba9ed74a74..c647b258028 100644 --- a/client/consensus/aura/Cargo.toml +++ b/client/consensus/aura/Cargo.toml @@ -10,11 +10,13 @@ async-trait = "0.1.71" codec = { package = "parity-scale-codec", version = "3.0.0", features = [ "derive" ] } futures = "0.3.28" tracing = "0.1.37" +lru = "0.10.0" # Substrate sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +sc-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } sc-consensus-slots = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } @@ -35,6 +37,7 @@ substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate cumulus-client-consensus-common = { path = "../common" } cumulus-relay-chain-interface = { path = "../../relay-chain-interface" } cumulus-client-consensus-proposer = { path = "../proposer" } +cumulus-primitives-aura = { path = "../../../primitives/aura" } cumulus-primitives-core = { path = "../../../primitives/core" } cumulus-primitives-parachain-inherent = { path = "../../../primitives/parachain-inherent" } cumulus-client-collator = { path = "../../collator" } diff --git a/client/consensus/aura/src/collator.rs b/client/consensus/aura/src/collator.rs new file mode 100644 index 00000000000..aa990ae6d3a --- /dev/null +++ b/client/consensus/aura/src/collator.rs @@ -0,0 +1,363 @@ +// Copyright 2023 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! The core collator logic for Aura - slot claiming, block proposing, and collation +//! packaging. +//! +//! The [`Collator`] struct exposed here is meant to be a component of higher-level logic +//! which actually manages the control flow of the collator - which slots to claim, how +//! many collations to build, when to work, etc. +//! +//! This module also exposes some standalone functions for common operations when building +//! aura-based collators. + +use codec::{Decode, Encode}; +use cumulus_client_collator::service::ServiceInterface as CollatorServiceInterface; +use cumulus_client_consensus_common::{ + self as consensus_common, ParachainBlockImportMarker, ParachainCandidate, +}; +use cumulus_client_consensus_proposer::ProposerInterface; +use cumulus_primitives_core::{ + relay_chain::Hash as PHash, DigestItem, ParachainBlockData, PersistedValidationData, +}; +use cumulus_primitives_parachain_inherent::ParachainInherentData; +use cumulus_relay_chain_interface::RelayChainInterface; + +use polkadot_node_primitives::{Collation, MaybeCompressedPoV}; +use polkadot_primitives::{Header as PHeader, Id as ParaId}; + +use futures::prelude::*; +use sc_consensus::{BlockImport, BlockImportParams, ForkChoiceStrategy, StateAction}; +use sc_consensus_aura::standalone as aura_internal; +use sp_api::ProvideRuntimeApi; +use sp_application_crypto::AppPublic; +use sp_consensus::BlockOrigin; +use sp_consensus_aura::{AuraApi, Slot, SlotDuration}; +use sp_core::crypto::Pair; +use sp_inherents::{CreateInherentDataProviders, InherentData, InherentDataProvider}; +use sp_keystore::KeystorePtr; +use sp_runtime::{ + generic::Digest, + traits::{Block as BlockT, HashFor, Header as HeaderT, Member}, +}; +use sp_state_machine::StorageChanges; +use sp_timestamp::Timestamp; +use std::{convert::TryFrom, error::Error, hash::Hash, sync::Arc, time::Duration}; + +/// Parameters for instantiating a [`Collator`]. +pub struct Params { + /// A builder for inherent data builders. + pub create_inherent_data_providers: CIDP, + /// The block import handle. + pub block_import: BI, + /// An interface to the relay-chain client. + pub relay_client: Arc, + /// The keystore handle used for accessing parachain key material. + pub keystore: KeystorePtr, + /// The identifier of the parachain within the relay-chain. + pub para_id: ParaId, + /// The block proposer used for building blocks. + pub proposer: Proposer, + /// The collator service used for bundling proposals into collations and announcing + /// to the network. + pub collator_service: CS, +} + +/// A utility struct for writing collation logic that makes use of Aura entirely +/// or in part. See module docs for more details. +pub struct Collator { + create_inherent_data_providers: CIDP, + block_import: BI, + relay_client: Arc, + keystore: KeystorePtr, + para_id: ParaId, + proposer: Proposer, + collator_service: CS, + _marker: std::marker::PhantomData<(Block, P)>, +} + +impl Collator +where + Block: BlockT, + RClient: RelayChainInterface, + CIDP: CreateInherentDataProviders + 'static, + BI: BlockImport + ParachainBlockImportMarker + Send + Sync + 'static, + Proposer: ProposerInterface, + Proposer::Transaction: Sync, + CS: CollatorServiceInterface, + P: Pair + Send + Sync, + P::Public: AppPublic + Hash + Member + Encode + Decode, + P::Signature: TryFrom> + Hash + Member + Encode + Decode, +{ + /// Instantiate a new instance of the `Aura` manager. + pub fn new(params: Params) -> Self { + Collator { + create_inherent_data_providers: params.create_inherent_data_providers, + block_import: params.block_import, + relay_client: params.relay_client, + keystore: params.keystore, + para_id: params.para_id, + proposer: params.proposer, + collator_service: params.collator_service, + _marker: std::marker::PhantomData, + } + } + + /// Explicitly creates the inherent data for parachain block authoring and overrides + /// the timestamp inherent data with the one provided, if any. + pub async fn create_inherent_data( + &self, + relay_parent: PHash, + validation_data: &PersistedValidationData, + parent_hash: Block::Hash, + timestamp: impl Into>, + ) -> Result<(ParachainInherentData, InherentData), Box> { + let paras_inherent_data = ParachainInherentData::create_at( + relay_parent, + &self.relay_client, + validation_data, + self.para_id, + ) + .await; + + let paras_inherent_data = match paras_inherent_data { + Some(p) => p, + None => + return Err( + format!("Could not create paras inherent data at {:?}", relay_parent).into() + ), + }; + + let mut other_inherent_data = self + .create_inherent_data_providers + .create_inherent_data_providers(parent_hash, ()) + .map_err(|e| e as Box) + .await? + .create_inherent_data() + .await + .map_err(Box::new)?; + + if let Some(timestamp) = timestamp.into() { + other_inherent_data.replace_data(sp_timestamp::INHERENT_IDENTIFIER, ×tamp); + } + + Ok((paras_inherent_data, other_inherent_data)) + } + + /// Propose, seal, and import a block, packaging it into a collation. + /// + /// Provide the slot to build at as well as any other necessary pre-digest logs, + /// the inherent data, and the proposal duration and PoV size limits. + /// + /// The Aura pre-digest should not be explicitly provided and is set internally. + /// + /// This does not announce the collation to the parachain network or the relay chain. + pub async fn collate( + &mut self, + parent_header: &Block::Header, + slot_claim: &SlotClaim, + additional_pre_digest: impl Into>>, + inherent_data: (ParachainInherentData, InherentData), + proposal_duration: Duration, + max_pov_size: usize, + ) -> Result<(Collation, ParachainBlockData, Block::Hash), Box> { + let mut digest = additional_pre_digest.into().unwrap_or_default(); + digest.push(slot_claim.pre_digest.clone()); + + let proposal = self + .proposer + .propose( + &parent_header, + &inherent_data.0, + inherent_data.1, + Digest { logs: digest }, + proposal_duration, + Some(max_pov_size), + ) + .await + .map_err(|e| Box::new(e))?; + + let sealed_importable = seal::<_, _, P>( + proposal.block, + proposal.storage_changes, + &slot_claim.author_pub, + &self.keystore, + )?; + + let post_hash = sealed_importable.post_hash(); + let block = Block::new( + sealed_importable.post_header(), + sealed_importable + .body + .as_ref() + .expect("body always created with this `propose` fn; qed") + .clone(), + ); + + self.block_import.import_block(sealed_importable).await?; + + if let Some((collation, block_data)) = self.collator_service.build_collation( + parent_header, + post_hash, + ParachainCandidate { block, proof: proposal.proof }, + ) { + tracing::info!( + target: crate::LOG_TARGET, + "PoV size {{ header: {}kb, extrinsics: {}kb, storage_proof: {}kb }}", + block_data.header().encode().len() as f64 / 1024f64, + block_data.extrinsics().encode().len() as f64 / 1024f64, + block_data.storage_proof().encode().len() as f64 / 1024f64, + ); + + if let MaybeCompressedPoV::Compressed(ref pov) = collation.proof_of_validity { + tracing::info!( + target: crate::LOG_TARGET, + "Compressed PoV size: {}kb", + pov.block_data.0.len() as f64 / 1024f64, + ); + } + + Ok((collation, block_data, post_hash)) + } else { + Err("Unable to produce collation".to_string().into()) + } + } + + /// Get the underlying collator service. + pub fn collator_service(&self) -> &CS { + &self.collator_service + } +} + +/// A claim on an Aura slot. +pub struct SlotClaim { + author_pub: Pub, + pre_digest: DigestItem, + timestamp: Timestamp, +} + +impl SlotClaim { + /// Create a slot-claim from the given author public key, slot, and timestamp. + /// + /// This does not check whether the author actually owns the slot or the timestamp + /// falls within the slot. + pub fn unchecked

(author_pub: Pub, slot: Slot, timestamp: Timestamp) -> Self + where + P: Pair, + P::Public: Encode + Decode, + P::Signature: Encode + Decode, + { + SlotClaim { author_pub, timestamp, pre_digest: aura_internal::pre_digest::

(slot) } + } + + /// Get the author's public key. + pub fn author_pub(&self) -> &Pub { + &self.author_pub + } + + /// Get the Aura pre-digest for this slot. + pub fn pre_digest(&self) -> &DigestItem { + &self.pre_digest + } + + /// Get the timestamp corresponding to the relay-chain slot this claim was + /// generated against. + pub fn timestamp(&self) -> Timestamp { + self.timestamp + } +} + +/// Attempt to claim a slot derived from the given relay-parent header's slot. +pub async fn claim_slot( + client: &C, + parent_hash: B::Hash, + relay_parent_header: &PHeader, + slot_duration: SlotDuration, + relay_chain_slot_duration: SlotDuration, + keystore: &KeystorePtr, +) -> Result>, Box> +where + B: BlockT, + C: ProvideRuntimeApi + Send + Sync + 'static, + C::Api: AuraApi, + P: Pair, + P::Public: Encode + Decode, + P::Signature: Encode + Decode, +{ + // load authorities + let authorities = client.runtime_api().authorities(parent_hash).map_err(Box::new)?; + + // Determine the current slot and timestamp based on the relay-parent's. + let (slot_now, timestamp) = match consensus_common::relay_slot_and_timestamp( + relay_parent_header, + relay_chain_slot_duration, + ) { + Some((_, t)) => (Slot::from_timestamp(t, slot_duration), t), + None => return Ok(None), + }; + + // Try to claim the slot locally. + let author_pub = { + let res = aura_internal::claim_slot::

(slot_now, &authorities, keystore).await; + match res { + Some(p) => p, + None => return Ok(None), + } + }; + + Ok(Some(SlotClaim::unchecked::

(author_pub, slot_now, timestamp))) +} + +/// Seal a block with a signature in the header. +pub fn seal( + pre_sealed: B, + storage_changes: StorageChanges>, + author_pub: &P::Public, + keystore: &KeystorePtr, +) -> Result, Box> +where + P: Pair, + P::Signature: Encode + Decode + TryFrom>, + P::Public: AppPublic, +{ + let (pre_header, body) = pre_sealed.deconstruct(); + let pre_hash = pre_header.hash(); + let block_number = *pre_header.number(); + + // seal the block. + let block_import_params = { + let seal_digest = + aura_internal::seal::<_, P>(&pre_hash, &author_pub, keystore).map_err(Box::new)?; + let mut block_import_params = BlockImportParams::new(BlockOrigin::Own, pre_header); + block_import_params.post_digests.push(seal_digest); + block_import_params.body = Some(body.clone()); + block_import_params.state_action = + StateAction::ApplyChanges(sc_consensus::StorageChanges::Changes(storage_changes)); + block_import_params.fork_choice = Some(ForkChoiceStrategy::LongestChain); + block_import_params + }; + let post_hash = block_import_params.post_hash(); + + tracing::info!( + target: crate::LOG_TARGET, + "🔖 Pre-sealed block for proposal at {}. Hash now {:?}, previously {:?}.", + block_number, + post_hash, + pre_hash, + ); + + Ok(block_import_params) +} diff --git a/client/consensus/aura/src/collators/basic.rs b/client/consensus/aura/src/collators/basic.rs new file mode 100644 index 00000000000..e0ba76ac075 --- /dev/null +++ b/client/consensus/aura/src/collators/basic.rs @@ -0,0 +1,200 @@ +// Copyright 2023 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! This provides the option to run a basic relay-chain driven Aura implementation. +//! +//! This collator only builds on top of the most recently included block, limiting the +//! block time to a maximum of two times the relay-chain block time, and requiring the +//! block to be built and distributed to validators between two relay-chain blocks. +//! +//! For more information about AuRa, the Substrate crate should be checked. + +use codec::{Decode, Encode}; +use cumulus_client_collator::service::ServiceInterface as CollatorServiceInterface; +use cumulus_client_consensus_common::ParachainBlockImportMarker; +use cumulus_client_consensus_proposer::ProposerInterface; +use cumulus_primitives_core::{relay_chain::BlockId as RBlockId, CollectCollationInfo}; +use cumulus_relay_chain_interface::RelayChainInterface; + +use polkadot_node_primitives::CollationResult; +use polkadot_overseer::Handle as OverseerHandle; +use polkadot_primitives::{CollatorPair, Id as ParaId}; + +use futures::prelude::*; +use sc_client_api::{backend::AuxStore, BlockBackend, BlockOf}; +use sc_consensus::BlockImport; +use sp_api::ProvideRuntimeApi; +use sp_application_crypto::AppPublic; +use sp_blockchain::HeaderBackend; +use sp_consensus::SyncOracle; +use sp_consensus_aura::{AuraApi, SlotDuration}; +use sp_core::crypto::Pair; +use sp_inherents::CreateInherentDataProviders; +use sp_keystore::KeystorePtr; +use sp_runtime::traits::{Block as BlockT, Header as HeaderT, Member}; +use std::{convert::TryFrom, hash::Hash, sync::Arc, time::Duration}; + +use crate::collator as collator_util; + +/// Parameters for [`run`]. +pub struct Params { + pub create_inherent_data_providers: CIDP, + pub block_import: BI, + pub para_client: Arc, + pub relay_client: Arc, + pub sync_oracle: SO, + pub keystore: KeystorePtr, + pub key: CollatorPair, + pub para_id: ParaId, + pub overseer_handle: OverseerHandle, + pub slot_duration: SlotDuration, + pub relay_chain_slot_duration: SlotDuration, + pub proposer: Proposer, + pub collator_service: CS, +} + +/// Run bare Aura consensus as a relay-chain-driven collator. +pub async fn run( + params: Params, +) where + Block: BlockT, + Client: ProvideRuntimeApi + + BlockOf + + AuxStore + + HeaderBackend + + BlockBackend + + Send + + Sync + + 'static, + Client::Api: AuraApi + CollectCollationInfo, + RClient: RelayChainInterface, + CIDP: CreateInherentDataProviders + 'static, + BI: BlockImport + ParachainBlockImportMarker + Send + Sync + 'static, + SO: SyncOracle + Send + Sync + Clone + 'static, + Proposer: ProposerInterface, + Proposer::Transaction: Sync, + CS: CollatorServiceInterface, + P: Pair + Send + Sync, + P::Public: AppPublic + Hash + Member + Encode + Decode, + P::Signature: TryFrom> + Hash + Member + Encode + Decode, +{ + let mut collation_requests = cumulus_client_collator::relay_chain_driven::init( + params.key, + params.para_id, + params.overseer_handle, + ) + .await; + + let mut collator = { + let params = collator_util::Params { + create_inherent_data_providers: params.create_inherent_data_providers, + block_import: params.block_import, + relay_client: params.relay_client.clone(), + keystore: params.keystore.clone(), + para_id: params.para_id, + proposer: params.proposer, + collator_service: params.collator_service, + }; + + collator_util::Collator::::new(params) + }; + + while let Some(request) = collation_requests.next().await { + macro_rules! reject_with_error { + ($err:expr) => {{ + request.complete(None); + tracing::error!(target: crate::LOG_TARGET, err = ?{ $err }); + continue; + }}; + } + + macro_rules! try_request { + ($x:expr) => {{ + match $x { + Ok(x) => x, + Err(e) => reject_with_error!(e), + } + }}; + } + + let validation_data = request.persisted_validation_data(); + + let parent_header = + try_request!(Block::Header::decode(&mut &validation_data.parent_head.0[..])); + + let parent_hash = parent_header.hash(); + + if !collator.collator_service().check_block_status(parent_hash, &parent_header) { + continue + } + + let relay_parent_header = + match params.relay_client.header(RBlockId::hash(*request.relay_parent())).await { + Err(e) => reject_with_error!(e), + Ok(None) => continue, // sanity: would be inconsistent to get `None` here + Ok(Some(h)) => h, + }; + + let claim = match collator_util::claim_slot::<_, _, P>( + &*params.para_client, + parent_hash, + &relay_parent_header, + params.slot_duration, + params.relay_chain_slot_duration, + ¶ms.keystore, + ) + .await + { + Ok(None) => continue, + Ok(Some(c)) => c, + Err(e) => reject_with_error!(e), + }; + + let (parachain_inherent_data, other_inherent_data) = try_request!( + collator + .create_inherent_data( + *request.relay_parent(), + &validation_data, + parent_hash, + claim.timestamp(), + ) + .await + ); + + let (collation, _, post_hash) = try_request!( + collator + .collate( + &parent_header, + &claim, + None, + (parachain_inherent_data, other_inherent_data), + // TODO [https://github.com/paritytech/cumulus/issues/2439] + // We should call out to a pluggable interface that provides + // the proposal duration. + Duration::from_millis(500), + // Set the block limit to 50% of the maximum PoV size. + // + // TODO: If we got benchmarking that includes the proof size, + // we should be able to use the maximum pov size. + (validation_data.max_pov_size / 2) as usize, + ) + .await + ); + + let result_sender = Some(collator.collator_service().announce_with_barrier(post_hash)); + request.complete(Some(CollationResult { collation, result_sender })); + } +} diff --git a/client/consensus/aura/src/collators/lookahead.rs b/client/consensus/aura/src/collators/lookahead.rs new file mode 100644 index 00000000000..50fdb8b34ba --- /dev/null +++ b/client/consensus/aura/src/collators/lookahead.rs @@ -0,0 +1,346 @@ +// Copyright 2023 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! A collator for Aura that looks ahead of the most recently included parachain block +//! when determining what to build upon. +//! +//! This collator also builds additional blocks when the maximum backlog is not saturated. +//! The size of the backlog is determined by invoking a runtime API. If that runtime API +//! is not supported, this assumes a maximum backlog size of 1. +//! +//! This takes more advantage of asynchronous backing, though not complete advantage. +//! When the backlog is not saturated, this approach lets the backlog temporarily 'catch up' +//! with periods of higher throughput. When the backlog is saturated, we typically +//! fall back to the limited cadence of a single parachain block per relay-chain block. +//! +//! Despite this, the fact that there is a backlog at all allows us to spend more time +//! building the block, as there is some buffer before it can get posted to the relay-chain. +//! The main limitation is block propagation time - i.e. the new blocks created by an author +//! must be propagated to the next author before their turn. + +use codec::{Decode, Encode}; +use cumulus_client_collator::service::ServiceInterface as CollatorServiceInterface; +use cumulus_client_consensus_common::{ + self as consensus_common, ParachainBlockImportMarker, ParentSearchParams, +}; +use cumulus_client_consensus_proposer::ProposerInterface; +use cumulus_primitives_aura::AuraUnincludedSegmentApi; +use cumulus_primitives_core::{ + relay_chain::Hash as PHash, CollectCollationInfo, PersistedValidationData, +}; +use cumulus_relay_chain_interface::RelayChainInterface; + +use polkadot_overseer::Handle as OverseerHandle; +use polkadot_primitives::{CollatorPair, Id as ParaId, OccupiedCoreAssumption}; + +use futures::prelude::*; +use sc_client_api::{backend::AuxStore, BlockBackend, BlockOf}; +use sc_consensus::BlockImport; +use sc_consensus_aura::standalone as aura_internal; +use sp_api::ProvideRuntimeApi; +use sp_application_crypto::AppPublic; +use sp_blockchain::HeaderBackend; +use sp_consensus::SyncOracle; +use sp_consensus_aura::{AuraApi, Slot, SlotDuration}; +use sp_core::crypto::Pair; +use sp_inherents::CreateInherentDataProviders; +use sp_keystore::KeystorePtr; +use sp_runtime::traits::{Block as BlockT, Header as HeaderT, Member}; +use sp_timestamp::Timestamp; +use std::{convert::TryFrom, hash::Hash, sync::Arc, time::Duration}; + +use crate::collator::{self as collator_util, SlotClaim}; + +/// Parameters for [`run`]. +pub struct Params { + pub create_inherent_data_providers: CIDP, + pub block_import: BI, + pub para_client: Arc, + pub para_backend: Arc, + pub relay_client: Arc, + pub sync_oracle: SO, + pub keystore: KeystorePtr, + pub key: CollatorPair, + pub para_id: ParaId, + pub overseer_handle: OverseerHandle, + pub slot_duration: SlotDuration, + pub relay_chain_slot_duration: SlotDuration, + pub proposer: Proposer, + pub collator_service: CS, + pub authoring_duration: Duration, +} + +/// Run async-backing-friendly Aura. +pub async fn run( + params: Params, +) where + Block: BlockT, + Client: ProvideRuntimeApi + + BlockOf + + AuxStore + + HeaderBackend + + BlockBackend + + Send + + Sync + + 'static, + Client::Api: + AuraApi + CollectCollationInfo + AuraUnincludedSegmentApi, + Backend: sp_blockchain::Backend, + RClient: RelayChainInterface, + CIDP: CreateInherentDataProviders + 'static, + BI: BlockImport + ParachainBlockImportMarker + Send + Sync + 'static, + SO: SyncOracle + Send + Sync + Clone + 'static, + Proposer: ProposerInterface, + Proposer::Transaction: Sync, + CS: CollatorServiceInterface, + P: Pair + Send + Sync, + P::Public: AppPublic + Hash + Member + Encode + Decode, + P::Signature: TryFrom> + Hash + Member + Encode + Decode, +{ + // This is an arbitrary value which is likely guaranteed to exceed any reasonable + // limit, as it would correspond to 10 non-included blocks. + // + // Since we only search for parent blocks which have already been imported, + // we can guarantee that all imported blocks respect the unincluded segment + // rules specified by the parachain's runtime and thus will never be too deep. + const PARENT_SEARCH_DEPTH: usize = 10; + + let mut import_notifications = match params.relay_client.import_notification_stream().await { + Ok(s) => s, + Err(err) => { + tracing::error!( + target: crate::LOG_TARGET, + ?err, + "Failed to initialize consensus: no relay chain import notification stream" + ); + + return + }, + }; + + let mut collator = { + let params = collator_util::Params { + create_inherent_data_providers: params.create_inherent_data_providers, + block_import: params.block_import, + relay_client: params.relay_client.clone(), + keystore: params.keystore.clone(), + para_id: params.para_id, + proposer: params.proposer, + collator_service: params.collator_service, + }; + + collator_util::Collator::::new(params) + }; + + while let Some(relay_parent_header) = import_notifications.next().await { + let relay_parent = relay_parent_header.hash(); + + let max_pov_size = match params + .relay_client + .persisted_validation_data( + relay_parent, + params.para_id, + OccupiedCoreAssumption::Included, + ) + .await + { + Ok(None) => continue, + Ok(Some(pvd)) => pvd.max_pov_size, + Err(err) => { + tracing::error!(target: crate::LOG_TARGET, ?err, "Failed to gather information from relay-client"); + continue + }, + }; + + let (slot_now, timestamp) = match consensus_common::relay_slot_and_timestamp( + &relay_parent_header, + params.relay_chain_slot_duration, + ) { + None => continue, + Some((_, t)) => (Slot::from_timestamp(t, params.slot_duration), t), + }; + + let parent_search_params = ParentSearchParams { + relay_parent, + para_id: params.para_id, + ancestry_lookback: max_ancestry_lookback(relay_parent, ¶ms.relay_client).await, + max_depth: PARENT_SEARCH_DEPTH, + ignore_alternative_branches: true, + }; + + let potential_parents = cumulus_client_consensus_common::find_potential_parents::( + parent_search_params, + &*params.para_backend, + ¶ms.relay_client, + ) + .await; + + let mut potential_parents = match potential_parents { + Err(e) => { + tracing::error!( + target: crate::LOG_TARGET, + ?relay_parent, + err = ?e, + "Could not fetch potential parents to build upon" + ); + + continue + }, + Ok(x) => x, + }; + + let included_block = match potential_parents.iter().find(|x| x.depth == 0) { + None => continue, // also serves as an `is_empty` check. + Some(b) => b.hash, + }; + + let para_client = &*params.para_client; + let keystore = ¶ms.keystore; + let can_build_upon = |block_hash| { + can_build_upon::<_, _, P>( + slot_now, + timestamp, + block_hash, + included_block, + para_client, + &keystore, + ) + }; + + // Sort by depth, ascending, to choose the longest chain. + // + // If the longest chain has space, build upon that. Otherwise, don't + // build at all. + potential_parents.sort_by_key(|a| a.depth); + let initial_parent = match potential_parents.pop() { + None => continue, + Some(p) => p, + }; + + // Build in a loop until not allowed. Note that the authorities can change + // at any block, so we need to re-claim our slot every time. + let mut parent_hash = initial_parent.hash; + let mut parent_header = initial_parent.header; + loop { + let slot_claim = match can_build_upon(parent_hash).await { + None => break, + Some(c) => c, + }; + + let validation_data = PersistedValidationData { + parent_head: parent_header.encode().into(), + relay_parent_number: *relay_parent_header.number(), + relay_parent_storage_root: *relay_parent_header.state_root(), + max_pov_size, + }; + + // Build and announce collations recursively until + // `can_build_upon` fails or building a collation fails. + let (parachain_inherent_data, other_inherent_data) = match collator + .create_inherent_data( + relay_parent, + &validation_data, + parent_hash, + slot_claim.timestamp(), + ) + .await + { + Err(err) => { + tracing::error!(target: crate::LOG_TARGET, ?err); + break + }, + Ok(x) => x, + }; + + match collator + .collate( + &parent_header, + &slot_claim, + None, + (parachain_inherent_data, other_inherent_data), + params.authoring_duration, + // Set the block limit to 50% of the maximum PoV size. + // + // TODO: If we got benchmarking that includes the proof size, + // we should be able to use the maximum pov size. + (validation_data.max_pov_size / 2) as usize, + ) + .await + { + Ok((_collation, block_data, new_block_hash)) => { + parent_hash = new_block_hash; + parent_header = block_data.into_header(); + + // Here we are assuming that the import logic protects against equivocations + // and provides sybil-resistance, as it should. + collator.collator_service().announce_block(new_block_hash, None); + + // TODO [https://github.com/paritytech/polkadot/issues/5056]: + // announce collation to relay-chain validators. + }, + Err(err) => { + tracing::error!(target: crate::LOG_TARGET, ?err); + break + }, + } + } + } +} + +// Checks if we own the slot at the given block and whether there +// is space in the unincluded segment. +async fn can_build_upon( + slot: Slot, + timestamp: Timestamp, + parent_hash: Block::Hash, + included_block: Block::Hash, + client: &Client, + keystore: &KeystorePtr, +) -> Option> +where + Client: ProvideRuntimeApi, + Client::Api: AuraApi + AuraUnincludedSegmentApi, + P: Pair, + P::Public: Encode + Decode, + P::Signature: Encode + Decode, +{ + let runtime_api = client.runtime_api(); + let authorities = runtime_api.authorities(parent_hash).ok()?; + let author_pub = aura_internal::claim_slot::

(slot, &authorities, keystore).await?; + + // Here we lean on the property that building on an empty unincluded segment must always + // be legal. Skipping the runtime API query here allows us to seamlessly run this + // collator against chains which have not yet upgraded their runtime. + if parent_hash != included_block { + runtime_api.can_build_upon(parent_hash, included_block, slot).ok()?; + } + + Some(SlotClaim::unchecked::

(author_pub, slot, timestamp)) +} + +async fn max_ancestry_lookback( + _relay_parent: PHash, + _relay_client: &impl RelayChainInterface, +) -> usize { + // TODO [https://github.com/paritytech/cumulus/issues/2706] + // We need to read the relay-chain state to know what the maximum + // age truly is, but that depends on those pallets existing. + // + // For now, just provide the conservative value of '2'. + // Overestimating can cause problems, as we'd be building on forks of the + // chain that can never get included. Underestimating is less of an issue. + 2 +} diff --git a/client/consensus/aura/src/collators/mod.rs b/client/consensus/aura/src/collators/mod.rs new file mode 100644 index 00000000000..55128dfdc85 --- /dev/null +++ b/client/consensus/aura/src/collators/mod.rs @@ -0,0 +1,24 @@ +// Copyright 2023 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Stock, pure Aura collators. +//! +//! This includes the [`basic`] collator, which only builds on top of the most recently +//! included parachain block, as well as the [`lookahead`] collator, which prospectively +//! builds on parachain blocks which have not yet been included in the relay chain. + +pub mod basic; +pub mod lookahead; diff --git a/client/consensus/aura/src/equivocation_import_queue.rs b/client/consensus/aura/src/equivocation_import_queue.rs new file mode 100644 index 00000000000..b39fa73117f --- /dev/null +++ b/client/consensus/aura/src/equivocation_import_queue.rs @@ -0,0 +1,249 @@ +// Copyright 2023 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +/// An import queue which provides some equivocation resistance with lenient trait bounds. +/// +/// Equivocation resistance in general is a hard problem, as different nodes in the network +/// may see equivocations in a different order, and therefore may not agree on which blocks +/// should be thrown out and which ones should be kept. +use codec::{Decode, Encode}; +use cumulus_client_consensus_common::ParachainBlockImportMarker; +use lru::LruCache; + +use sc_consensus::{ + import_queue::{BasicQueue, Verifier as VerifierT}, + BlockImport, BlockImportParams, ForkChoiceStrategy, +}; +use sc_consensus_aura::standalone as aura_internal; +use sc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_DEBUG, CONSENSUS_TRACE}; +use sp_api::ProvideRuntimeApi; +use sp_block_builder::BlockBuilder as BlockBuilderApi; +use sp_consensus::error::Error as ConsensusError; +use sp_consensus_aura::{AuraApi, Slot, SlotDuration}; +use sp_core::crypto::Pair; +use sp_inherents::{CreateInherentDataProviders, InherentDataProvider}; +use sp_runtime::traits::{Block as BlockT, Header as HeaderT}; +use std::{fmt::Debug, num::NonZeroUsize, sync::Arc}; + +const LRU_WINDOW: usize = 256; +const EQUIVOCATION_LIMIT: usize = 16; + +struct NaiveEquivocationDefender { + cache: LruCache, +} + +impl Default for NaiveEquivocationDefender { + fn default() -> Self { + NaiveEquivocationDefender { + cache: LruCache::new(NonZeroUsize::new(LRU_WINDOW).expect("window > 0; qed")), + } + } +} + +impl NaiveEquivocationDefender { + // return `true` if equivocation is beyond the limit. + fn insert_and_check(&mut self, slot: Slot) -> bool { + let val = self.cache.get_or_insert_mut(*slot, || 0); + if *val == EQUIVOCATION_LIMIT { + true + } else { + *val += 1; + false + } + } +} + +struct Verifier { + client: Arc, + create_inherent_data_providers: CIDP, + slot_duration: SlotDuration, + defender: NaiveEquivocationDefender, + telemetry: Option, + _marker: std::marker::PhantomData<(Block, P)>, +} + +#[async_trait::async_trait] +impl VerifierT for Verifier +where + P: Pair, + P::Signature: Encode + Decode, + P::Public: Encode + Decode + PartialEq + Clone + Debug, + Block: BlockT, + Client: ProvideRuntimeApi + Send + Sync, + >::Api: BlockBuilderApi + AuraApi, + + CIDP: CreateInherentDataProviders, +{ + async fn verify( + &mut self, + mut block_params: BlockImportParams, + ) -> Result, String> { + // Skip checks that include execution, if being told so, or when importing only state. + // + // This is done for example when gap syncing and it is expected that the block after the gap + // was checked/chosen properly, e.g. by warp syncing to this block using a finality proof. + if block_params.state_action.skip_execution_checks() || block_params.with_state() { + return Ok(block_params) + } + + let post_hash = block_params.header.hash(); + let parent_hash = *block_params.header.parent_hash(); + + // check seal and update pre-hash/post-hash + { + let authorities = aura_internal::fetch_authorities(self.client.as_ref(), parent_hash) + .map_err(|e| { + format!("Could not fetch authorities at {:?}: {}", parent_hash, e) + })?; + + let slot_now = slot_now(self.slot_duration); + let res = aura_internal::check_header_slot_and_seal::( + slot_now, + block_params.header, + &authorities, + ); + + match res { + Ok((pre_header, slot, seal_digest)) => { + telemetry!( + self.telemetry; + CONSENSUS_TRACE; + "aura.checked_and_importing"; + "pre_header" => ?pre_header, + ); + + block_params.header = pre_header; + block_params.post_digests.push(seal_digest); + block_params.fork_choice = Some(ForkChoiceStrategy::LongestChain); + block_params.post_hash = Some(post_hash); + + // Check for and reject egregious amounts of equivocations. + if self.defender.insert_and_check(slot) { + return Err(format!( + "Rejecting block {:?} due to excessive equivocations at slot", + post_hash, + )) + } + }, + Err(aura_internal::SealVerificationError::Deferred(hdr, slot)) => { + telemetry!( + self.telemetry; + CONSENSUS_DEBUG; + "aura.header_too_far_in_future"; + "hash" => ?post_hash, + "a" => ?hdr, + "b" => ?slot, + ); + + return Err(format!( + "Rejecting block ({:?}) from future slot {:?}", + post_hash, slot + )) + }, + Err(e) => + return Err(format!( + "Rejecting block ({:?}) with invalid seal ({:?})", + post_hash, e + )), + } + } + + // check inherents. + if let Some(body) = block_params.body.clone() { + let block = Block::new(block_params.header.clone(), body); + let create_inherent_data_providers = self + .create_inherent_data_providers + .create_inherent_data_providers(parent_hash, ()) + .await + .map_err(|e| format!("Could not create inherent data {:?}", e))?; + + let inherent_data = create_inherent_data_providers + .create_inherent_data() + .await + .map_err(|e| format!("Could not create inherent data {:?}", e))?; + + let inherent_res = self + .client + .runtime_api() + .check_inherents(parent_hash, block, inherent_data) + .map_err(|e| format!("Unable to check block inherents {:?}", e))?; + + if !inherent_res.ok() { + for (i, e) in inherent_res.into_errors() { + match create_inherent_data_providers.try_handle_error(&i, &e).await { + Some(res) => res.map_err(|e| format!("Inherent Error {:?}", e))?, + None => + return Err(format!( + "Unknown inherent error, source {:?}", + String::from_utf8_lossy(&i[..]) + )), + } + } + } + } + + Ok(block_params) + } +} + +fn slot_now(slot_duration: SlotDuration) -> Slot { + let timestamp = sp_timestamp::InherentDataProvider::from_system_time().timestamp(); + Slot::from_timestamp(timestamp, slot_duration) +} + +/// Start an import queue for a Cumulus node which checks blocks' seals and inherent data. +/// +/// Pass in only inherent data providers which don't include aura or parachain consensus inherents, +/// e.g. things like timestamp and custom inherents for the runtime. +/// +/// The others are generated explicitly internally. +/// +/// This should only be used for runtimes where the runtime does not check all inherents and +/// seals in `execute_block` (see ) +pub fn fully_verifying_import_queue( + client: Arc, + block_import: I, + create_inherent_data_providers: CIDP, + slot_duration: SlotDuration, + spawner: &impl sp_core::traits::SpawnEssentialNamed, + registry: Option<&substrate_prometheus_endpoint::Registry>, + telemetry: Option, +) -> BasicQueue +where + P: Pair, + P::Signature: Encode + Decode, + P::Public: Encode + Decode + PartialEq + Clone + Debug, + I: BlockImport + + ParachainBlockImportMarker + + Send + + Sync + + 'static, + I::Transaction: Send, + Client: ProvideRuntimeApi + Send + Sync + 'static, + >::Api: BlockBuilderApi + AuraApi, + CIDP: CreateInherentDataProviders + 'static, +{ + let verifier = Verifier:: { + client, + create_inherent_data_providers, + defender: NaiveEquivocationDefender::default(), + slot_duration, + telemetry, + _marker: std::marker::PhantomData, + }; + + BasicQueue::new(verifier, Box::new(block_import), None, spawner, registry) +} diff --git a/client/consensus/aura/src/lib.rs b/client/consensus/aura/src/lib.rs index 416ae776da1..51d54bf5714 100644 --- a/client/consensus/aura/src/lib.rs +++ b/client/consensus/aura/src/lib.rs @@ -50,7 +50,9 @@ pub use import_queue::{build_verifier, import_queue, BuildVerifierParams, Import pub use sc_consensus_aura::{slot_duration, AuraVerifier, BuildAuraWorkerParams, SlotProportion}; pub use sc_consensus_slots::InherentDataProviderExt; -pub mod unstable_reimpl; +pub mod collator; +pub mod collators; +pub mod equivocation_import_queue; const LOG_TARGET: &str = "aura::cumulus"; diff --git a/client/consensus/aura/src/unstable_reimpl.rs b/client/consensus/aura/src/unstable_reimpl.rs deleted file mode 100644 index f9602a363bf..00000000000 --- a/client/consensus/aura/src/unstable_reimpl.rs +++ /dev/null @@ -1,529 +0,0 @@ -// Copyright 2023 Parity Technologies (UK) Ltd. -// This file is part of Cumulus. - -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . - -//! The AuRa consensus algorithm for parachains. -//! -//! This extends the Substrate provided AuRa consensus implementation to make it compatible for -//! parachains. This provides the option to run a "bare" relay-chain driven Aura implementation, -//! but also exposes the core functionalities separately to be composed into more complex implementations. -//! -//! For more information about AuRa, the Substrate crate should be checked. - -use codec::{Decode, Encode}; -use cumulus_client_collator::service::ServiceInterface as CollatorServiceInterface; -use cumulus_client_consensus_common::{ParachainBlockImportMarker, ParachainCandidate}; -use cumulus_client_consensus_proposer::ProposerInterface; -use cumulus_primitives_core::{ - relay_chain::Hash as PHash, CollectCollationInfo, PersistedValidationData, -}; -use cumulus_primitives_parachain_inherent::ParachainInherentData; -use cumulus_relay_chain_interface::RelayChainInterface; - -use polkadot_node_primitives::{CollationResult, MaybeCompressedPoV}; -use polkadot_overseer::Handle as OverseerHandle; -use polkadot_primitives::{CollatorPair, Id as ParaId}; - -use futures::prelude::*; -use sc_client_api::{backend::AuxStore, BlockBackend, BlockOf}; -use sc_consensus::{ - import_queue::{BasicQueue, Verifier as VerifierT}, - BlockImport, BlockImportParams, ForkChoiceStrategy, StateAction, -}; -use sc_consensus_aura::standalone as aura_internal; -use sc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_DEBUG, CONSENSUS_TRACE}; -use sp_api::ProvideRuntimeApi; -use sp_application_crypto::AppPublic; -use sp_block_builder::BlockBuilder as BlockBuilderApi; -use sp_blockchain::HeaderBackend; -use sp_consensus::{error::Error as ConsensusError, BlockOrigin, SyncOracle}; -use sp_consensus_aura::{AuraApi, Slot, SlotDuration}; -use sp_core::crypto::Pair; -use sp_inherents::{CreateInherentDataProviders, InherentData, InherentDataProvider}; -use sp_keystore::KeystorePtr; -use sp_runtime::{ - generic::Digest, - traits::{Block as BlockT, HashFor, Header as HeaderT, Member}, -}; -use sp_state_machine::StorageChanges; -use std::{convert::TryFrom, error::Error, fmt::Debug, hash::Hash, sync::Arc, time::Duration}; - -/// Parameters for [`run_bare_relay_driven`]. -pub struct Params { - pub create_inherent_data_providers: CIDP, - pub block_import: BI, - pub para_client: Arc, - pub relay_client: Arc, - pub sync_oracle: SO, - pub keystore: KeystorePtr, - pub key: CollatorPair, - pub para_id: ParaId, - pub overseer_handle: OverseerHandle, - pub slot_duration: SlotDuration, - pub proposer: Proposer, - pub collator_service: CS, -} - -/// Run bare Aura consensus as a relay-chain-driven collator. -pub async fn run_bare_relay_driven( - params: Params, -) where - Block: BlockT, - Client: ProvideRuntimeApi - + BlockOf - + AuxStore - + HeaderBackend - + BlockBackend - + Send - + Sync - + 'static, - Client::Api: AuraApi + CollectCollationInfo, - RClient: RelayChainInterface, - CIDP: CreateInherentDataProviders + 'static, - BI: BlockImport + ParachainBlockImportMarker + Send + Sync + 'static, - SO: SyncOracle + Send + Sync + Clone + 'static, - Proposer: ProposerInterface, - Proposer::Transaction: Sync, - CS: CollatorServiceInterface, - P: Pair + Send + Sync, - P::Public: AppPublic + Hash + Member + Encode + Decode, - P::Signature: TryFrom> + Hash + Member + Encode + Decode, -{ - let mut proposer = params.proposer; - let mut block_import = params.block_import; - - let mut collation_requests = cumulus_client_collator::relay_chain_driven::init( - params.key, - params.para_id, - params.overseer_handle, - ) - .await; - - while let Some(request) = collation_requests.next().await { - macro_rules! reject_with_error { - ($err:expr) => {{ - request.complete(None); - tracing::error!(target: crate::LOG_TARGET, err = ?{ $err }); - continue; - }}; - } - - let validation_data = request.persisted_validation_data(); - - let parent_header = match Block::Header::decode(&mut &validation_data.parent_head.0[..]) { - Ok(x) => x, - Err(e) => reject_with_error!(e), - }; - - let parent_hash = parent_header.hash(); - - if !params.collator_service.check_block_status(parent_hash, &parent_header) { - continue - } - - let claim = match claim_slot::<_, _, P>( - &*params.para_client, - parent_hash, - params.slot_duration, - ¶ms.keystore, - ) - .await - { - Ok(None) => continue, - Ok(Some(c)) => c, - Err(e) => reject_with_error!(e), - }; - - let (parachain_inherent_data, other_inherent_data) = match create_inherent_data( - *request.relay_parent(), - &validation_data, - parent_hash, - params.para_id, - ¶ms.relay_client, - ¶ms.create_inherent_data_providers, - ) - .await - { - Ok(x) => x, - Err(e) => reject_with_error!(e), - }; - - let proposal = match proposer - .propose( - &parent_header, - ¶chain_inherent_data, - other_inherent_data, - Digest { logs: vec![claim.pre_digest] }, - // TODO [https://github.com/paritytech/cumulus/issues/2439] - // We should call out to a pluggable interface that provides - // the proposal duration. - Duration::from_millis(500), - // Set the block limit to 50% of the maximum PoV size. - // - // TODO: If we got benchmarking that includes the proof size, - // we should be able to use the maximum pov size. - Some((validation_data.max_pov_size / 2) as usize), - ) - .await - { - Ok(p) => p, - Err(e) => reject_with_error!(e), - }; - - let sealed_importable = match seal::<_, _, P>( - proposal.block, - proposal.storage_changes, - &claim.author_pub, - ¶ms.keystore, - ) { - Ok(s) => s, - Err(e) => reject_with_error!(e), - }; - - let post_hash = sealed_importable.post_hash(); - let block = Block::new( - sealed_importable.post_header(), - sealed_importable - .body - .as_ref() - .expect("body always created with this `propose` fn; qed") - .clone(), - ); - - if let Err(e) = block_import.import_block(sealed_importable).await { - reject_with_error!(e); - } - - let response = if let Some((collation, b)) = params.collator_service.build_collation( - &parent_header, - post_hash, - ParachainCandidate { block, proof: proposal.proof }, - ) { - tracing::info!( - target: crate::LOG_TARGET, - "PoV size {{ header: {}kb, extrinsics: {}kb, storage_proof: {}kb }}", - b.header().encode().len() as f64 / 1024f64, - b.extrinsics().encode().len() as f64 / 1024f64, - b.storage_proof().encode().len() as f64 / 1024f64, - ); - - if let MaybeCompressedPoV::Compressed(ref pov) = collation.proof_of_validity { - tracing::info!( - target: crate::LOG_TARGET, - "Compressed PoV size: {}kb", - pov.block_data.0.len() as f64 / 1024f64, - ); - } - - let result_sender = params.collator_service.announce_with_barrier(post_hash); - Some(CollationResult { collation, result_sender: Some(result_sender) }) - } else { - None - }; - - request.complete(response); - } -} - -fn slot_now(slot_duration: SlotDuration) -> Slot { - let timestamp = sp_timestamp::InherentDataProvider::from_system_time().timestamp(); - Slot::from_timestamp(timestamp, slot_duration) -} - -/// A claim on an Aura slot. -struct SlotClaim { - author_pub: Pub, - pre_digest: sp_runtime::DigestItem, -} - -async fn claim_slot( - client: &C, - parent_hash: B::Hash, - slot_duration: SlotDuration, - keystore: &KeystorePtr, -) -> Result>, Box> -where - B: BlockT, - C: ProvideRuntimeApi + Send + Sync + 'static, - C::Api: AuraApi, - P: Pair, - P::Public: Encode + Decode, - P::Signature: Encode + Decode, -{ - // load authorities - let authorities = client.runtime_api().authorities(parent_hash).map_err(Box::new)?; - - // Determine the current slot. - let slot_now = slot_now(slot_duration); - - // Try to claim the slot locally. - let author_pub = { - let res = aura_internal::claim_slot::

(slot_now, &authorities, keystore).await; - match res { - Some(p) => p, - None => return Ok(None), - } - }; - - // Produce the pre-digest. - let pre_digest = aura_internal::pre_digest::

(slot_now); - - Ok(Some(SlotClaim { author_pub, pre_digest })) -} - -async fn create_inherent_data( - relay_parent: PHash, - validation_data: &PersistedValidationData, - parent_hash: B::Hash, - para_id: ParaId, - relay_chain_interface: &impl RelayChainInterface, - create_inherent_data_providers: &impl CreateInherentDataProviders, -) -> Result<(ParachainInherentData, InherentData), Box> { - let paras_inherent_data = ParachainInherentData::create_at( - relay_parent, - relay_chain_interface, - validation_data, - para_id, - ) - .await; - - let paras_inherent_data = match paras_inherent_data { - Some(p) => p, - None => - return Err(format!("Could not create paras inherent data at {:?}", relay_parent).into()), - }; - - let other_inherent_data = create_inherent_data_providers - .create_inherent_data_providers(parent_hash, ()) - .map_err(|e| e as Box) - .await? - .create_inherent_data() - .await - .map_err(Box::new)?; - - Ok((paras_inherent_data, other_inherent_data)) -} - -fn seal( - pre_sealed: B, - storage_changes: StorageChanges>, - author_pub: &P::Public, - keystore: &KeystorePtr, -) -> Result, Box> -where - P: Pair, - P::Signature: Encode + Decode + TryFrom>, - P::Public: AppPublic, -{ - let (pre_header, body) = pre_sealed.deconstruct(); - let pre_hash = pre_header.hash(); - let block_number = *pre_header.number(); - - // seal the block. - let block_import_params = { - let seal_digest = - aura_internal::seal::<_, P>(&pre_hash, &author_pub, keystore).map_err(Box::new)?; - let mut block_import_params = BlockImportParams::new(BlockOrigin::Own, pre_header); - block_import_params.post_digests.push(seal_digest); - block_import_params.body = Some(body.clone()); - block_import_params.state_action = - StateAction::ApplyChanges(sc_consensus::StorageChanges::Changes(storage_changes)); - block_import_params.fork_choice = Some(ForkChoiceStrategy::LongestChain); - block_import_params - }; - let post_hash = block_import_params.post_hash(); - - tracing::info!( - target: crate::LOG_TARGET, - "🔖 Pre-sealed block for proposal at {}. Hash now {:?}, previously {:?}.", - block_number, - post_hash, - pre_hash, - ); - - Ok(block_import_params) -} - -struct Verifier { - client: Arc, - create_inherent_data_providers: CIDP, - slot_duration: SlotDuration, - telemetry: Option, - _marker: std::marker::PhantomData<(Block, P)>, -} - -#[async_trait::async_trait] -impl VerifierT for Verifier -where - P: Pair, - P::Signature: Encode + Decode, - P::Public: Encode + Decode + PartialEq + Clone + Debug, - Block: BlockT, - Client: ProvideRuntimeApi + Send + Sync, - >::Api: BlockBuilderApi + AuraApi, - - CIDP: CreateInherentDataProviders, -{ - async fn verify( - &mut self, - mut block_params: BlockImportParams, - ) -> Result, String> { - // Skip checks that include execution, if being told so, or when importing only state. - // - // This is done for example when gap syncing and it is expected that the block after the gap - // was checked/chosen properly, e.g. by warp syncing to this block using a finality proof. - if block_params.state_action.skip_execution_checks() || block_params.with_state() { - return Ok(block_params) - } - - let post_hash = block_params.header.hash(); - let parent_hash = *block_params.header.parent_hash(); - - // check seal and update pre-hash/post-hash - { - let authorities = aura_internal::fetch_authorities(self.client.as_ref(), parent_hash) - .map_err(|e| { - format!("Could not fetch authorities at {:?}: {}", parent_hash, e) - })?; - - let slot_now = slot_now(self.slot_duration); - let res = aura_internal::check_header_slot_and_seal::( - slot_now, - block_params.header, - &authorities, - ); - - match res { - Ok((pre_header, _slot, seal_digest)) => { - telemetry!( - self.telemetry; - CONSENSUS_TRACE; - "aura.checked_and_importing"; - "pre_header" => ?pre_header, - ); - - block_params.header = pre_header; - block_params.post_digests.push(seal_digest); - block_params.fork_choice = Some(ForkChoiceStrategy::LongestChain); - block_params.post_hash = Some(post_hash); - }, - Err(aura_internal::SealVerificationError::Deferred(hdr, slot)) => { - telemetry!( - self.telemetry; - CONSENSUS_DEBUG; - "aura.header_too_far_in_future"; - "hash" => ?post_hash, - "a" => ?hdr, - "b" => ?slot, - ); - - return Err(format!( - "Rejecting block ({:?}) from future slot {:?}", - post_hash, slot - )) - }, - Err(e) => - return Err(format!( - "Rejecting block ({:?}) with invalid seal ({:?})", - post_hash, e - )), - } - } - - // check inherents. - if let Some(body) = block_params.body.clone() { - let block = Block::new(block_params.header.clone(), body); - let create_inherent_data_providers = self - .create_inherent_data_providers - .create_inherent_data_providers(parent_hash, ()) - .await - .map_err(|e| format!("Could not create inherent data {:?}", e))?; - - let inherent_data = create_inherent_data_providers - .create_inherent_data() - .await - .map_err(|e| format!("Could not create inherent data {:?}", e))?; - - let inherent_res = self - .client - .runtime_api() - .check_inherents_with_context( - parent_hash, - block_params.origin.into(), - block, - inherent_data, - ) - .map_err(|e| format!("Unable to check block inherents {:?}", e))?; - - if !inherent_res.ok() { - for (i, e) in inherent_res.into_errors() { - match create_inherent_data_providers.try_handle_error(&i, &e).await { - Some(res) => res.map_err(|e| format!("Inherent Error {:?}", e))?, - None => - return Err(format!( - "Unknown inherent error, source {:?}", - String::from_utf8_lossy(&i[..]) - )), - } - } - } - } - - Ok(block_params) - } -} - -/// Start an import queue for a Cumulus node which checks blocks' seals and inherent data. -/// -/// Pass in only inherent data providers which don't include aura or parachain consensus inherents, -/// e.g. things like timestamp and custom inherents for the runtime. -/// -/// The others are generated explicitly internally. -/// -/// This should only be used for runtimes where the runtime does not check all inherents and -/// seals in `execute_block` (see ) -pub fn fully_verifying_import_queue( - client: Arc, - block_import: I, - create_inherent_data_providers: CIDP, - slot_duration: SlotDuration, - spawner: &impl sp_core::traits::SpawnEssentialNamed, - registry: Option<&substrate_prometheus_endpoint::Registry>, - telemetry: Option, -) -> BasicQueue -where - P: Pair, - P::Signature: Encode + Decode, - P::Public: Encode + Decode + PartialEq + Clone + Debug, - I: BlockImport - + ParachainBlockImportMarker - + Send - + Sync - + 'static, - I::Transaction: Send, - Client: ProvideRuntimeApi + Send + Sync + 'static, - >::Api: BlockBuilderApi + AuraApi, - CIDP: CreateInherentDataProviders + 'static, -{ - let verifier = Verifier:: { - client, - create_inherent_data_providers, - slot_duration, - telemetry, - _marker: std::marker::PhantomData, - }; - - BasicQueue::new(verifier, Box::new(block_import), None, spawner, registry) -} diff --git a/client/consensus/common/Cargo.toml b/client/consensus/common/Cargo.toml index c41aa8f6d40..b7f1d5ae04f 100644 --- a/client/consensus/common/Cargo.toml +++ b/client/consensus/common/Cargo.toml @@ -16,10 +16,13 @@ tracing = "0.1.37" # Substrate sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +sc-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +sp-consensus-slots = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } diff --git a/client/consensus/common/src/lib.rs b/client/consensus/common/src/lib.rs index f3ef4a3023a..48ac4e96344 100644 --- a/client/consensus/common/src/lib.rs +++ b/client/consensus/common/src/lib.rs @@ -14,11 +14,22 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see . -use polkadot_primitives::{Hash as PHash, PersistedValidationData}; +use codec::Decode; +use polkadot_primitives::{ + Block as PBlock, Hash as PHash, Header as PHeader, PersistedValidationData, +}; + +use cumulus_primitives_core::{ + relay_chain::{BlockId as RBlockId, OccupiedCoreAssumption}, + ParaId, +}; +use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface}; use sc_client_api::Backend; use sc_consensus::{shared_data::SharedData, BlockImport, ImportResult}; +use sp_consensus_slots::{Slot, SlotDuration}; use sp_runtime::traits::{Block as BlockT, Header as HeaderT}; +use sp_timestamp::Timestamp; use std::sync::Arc; @@ -181,3 +192,193 @@ where pub trait ParachainBlockImportMarker {} impl ParachainBlockImportMarker for ParachainBlockImport {} + +/// Parameters when searching for suitable parents to build on top of. +pub struct ParentSearchParams { + /// The relay-parent that is intended to be used. + pub relay_parent: PHash, + /// The ID of the parachain. + pub para_id: ParaId, + /// A limitation on the age of relay parents for parachain blocks that are being + /// considered. This is relative to the `relay_parent` number. + pub ancestry_lookback: usize, + /// How "deep" parents can be relative to the included parachain block at the relay-parent. + /// The included block has depth 0. + pub max_depth: usize, + /// Whether to only ignore "alternative" branches, i.e. branches of the chain + /// which do not contain the block pending availability. + pub ignore_alternative_branches: bool, +} + +/// A potential parent block returned from [`find_potential_parents`] +pub struct PotentialParent { + /// The hash of the block. + pub hash: B::Hash, + /// The header of the block. + pub header: B::Header, + /// The depth of the block. + pub depth: usize, + /// Whether the block is the included block, is itself pending on-chain, or descends + /// from the block pending availability. + pub aligned_with_pending: bool, +} + +/// Perform a recursive search through blocks to find potential +/// parent blocks for a new block. +/// +/// This accepts a relay-chain block to be used as an anchor and a maximum search depth, +/// along with some arguments for filtering parachain blocks and performs a recursive search +/// for parachain blocks. The search begins at the last included parachain block and returns +/// a set of [`PotentialParent`]s which could be potential parents of a new block with this +/// relay-parent according to the search parameters. +/// +/// A parachain block is a potential parent if it is either the last included parachain block, the pending +/// parachain block (when `max_depth` >= 1), or all of the following hold: +/// * its parent is a potential parent +/// * its relay-parent is within `ancestry_lookback` of the targeted relay-parent. +/// * the block number is within `max_depth` blocks of the included block +pub async fn find_potential_parents( + params: ParentSearchParams, + client: &impl sp_blockchain::Backend, + relay_client: &impl RelayChainInterface, +) -> Result>, RelayChainError> { + // 1. Build up the ancestry record of the relay chain to compare against. + let rp_ancestry = { + let mut ancestry = Vec::with_capacity(params.ancestry_lookback + 1); + let mut current_rp = params.relay_parent; + while ancestry.len() <= params.ancestry_lookback { + let header = match relay_client.header(RBlockId::hash(current_rp)).await? { + None => break, + Some(h) => h, + }; + + ancestry.push((current_rp, *header.state_root())); + current_rp = *header.parent_hash(); + + // don't iterate back into the genesis block. + if header.number == 1 { + break + } + } + + ancestry + }; + + let is_hash_in_ancestry = |hash| rp_ancestry.iter().any(|x| x.0 == hash); + let is_root_in_ancestry = |root| rp_ancestry.iter().any(|x| x.1 == root); + + // 2. Get the included and pending availability blocks. + let included_header = relay_client + .persisted_validation_data( + params.relay_parent, + params.para_id, + OccupiedCoreAssumption::TimedOut, + ) + .await?; + + let included_header = match included_header { + Some(pvd) => pvd.parent_head, + None => return Ok(Vec::new()), // this implies the para doesn't exist. + }; + + let pending_header = relay_client + .persisted_validation_data( + params.relay_parent, + params.para_id, + OccupiedCoreAssumption::Included, + ) + .await? + .and_then(|x| if x.parent_head != included_header { Some(x.parent_head) } else { None }); + + let included_header = match B::Header::decode(&mut &included_header.0[..]).ok() { + None => return Ok(Vec::new()), + Some(x) => x, + }; + // Silently swallow if pending block can't decode. + let pending_header = pending_header.and_then(|p| B::Header::decode(&mut &p.0[..]).ok()); + let included_hash = included_header.hash(); + let pending_hash = pending_header.as_ref().map(|hdr| hdr.hash()); + + let mut frontier = vec![PotentialParent:: { + hash: included_hash, + header: included_header, + depth: 0, + aligned_with_pending: true, + }]; + + // Recursive search through descendants of the included block which have acceptable + // relay parents. + let mut potential_parents = Vec::new(); + while let Some(entry) = frontier.pop() { + let is_pending = + entry.depth == 1 && pending_hash.as_ref().map_or(false, |h| &entry.hash == h); + let is_included = entry.depth == 0; + + // note: even if the pending block or included block have a relay parent + // outside of the expected part of the relay chain, they are always allowed + // because they have already been posted on chain. + let is_potential = is_pending || is_included || { + let digest = entry.header.digest(); + cumulus_primitives_core::extract_relay_parent(digest).map_or(false, is_hash_in_ancestry) || + cumulus_primitives_core::rpsr_digest::extract_relay_parent_storage_root(digest) + .map(|(r, _n)| r) + .map_or(false, is_root_in_ancestry) + }; + + let parent_aligned_with_pending = entry.aligned_with_pending; + let child_depth = entry.depth + 1; + let hash = entry.hash; + + if is_potential { + potential_parents.push(entry); + } + + if !is_potential || child_depth > params.max_depth { + continue + } + + // push children onto search frontier. + for child in client.children(hash).ok().into_iter().flatten() { + let aligned_with_pending = parent_aligned_with_pending && + if child_depth == 1 { + pending_hash.as_ref().map_or(true, |h| &child == h) + } else { + true + }; + + if params.ignore_alternative_branches && !aligned_with_pending { + continue + } + + let header = match client.header(child) { + Ok(Some(h)) => h, + Ok(None) => continue, + Err(_) => continue, + }; + + frontier.push(PotentialParent { + hash: child, + header, + depth: child_depth, + aligned_with_pending, + }); + } + } + + Ok(potential_parents) +} + +/// Get the relay-parent slot and timestamp from a header. +pub fn relay_slot_and_timestamp( + relay_parent_header: &PHeader, + relay_chain_slot_duration: SlotDuration, +) -> Option<(Slot, Timestamp)> { + sc_consensus_babe::find_pre_digest::(relay_parent_header) + .map(|babe_pre_digest| { + let slot = babe_pre_digest.slot(); + let t = Timestamp::new(relay_chain_slot_duration.as_millis() * *slot); + + (slot, t) + }) + .ok() +} diff --git a/client/consensus/common/src/tests.rs b/client/consensus/common/src/tests.rs index ffb9aaee779..c13f839ad82 100644 --- a/client/consensus/common/src/tests.rs +++ b/client/consensus/common/src/tests.rs @@ -186,7 +186,7 @@ impl RelayChainInterface for Relaychain { } async fn wait_for_block(&self, _: PHash) -> RelayChainResult<()> { - unimplemented!("Not needed for test") + Ok(()) } async fn new_best_notification_stream( diff --git a/client/network/src/lib.rs b/client/network/src/lib.rs index e226170d7c5..7783ba13b6c 100644 --- a/client/network/src/lib.rs +++ b/client/network/src/lib.rs @@ -17,7 +17,7 @@ //! Parachain specific networking //! //! Provides a custom block announcement implementation for parachains -//! that use the relay chain provided consensus. See [`BlockAnnounceValidator`] +//! that use the relay chain provided consensus. See [`RequireSecondedInBlockAnnounce`] //! and [`WaitToAnnounce`] for more information about this implementation. use sp_consensus::block_validation::{ @@ -185,8 +185,17 @@ impl TryFrom<&'_ CollationSecondedSignal> for BlockAnnounceData { } } +/// A type alias for the [`RequireSecondedInBlockAnnounce`] validator. +#[deprecated = "This has been renamed to RequireSecondedInBlockAnnounce"] +pub type BlockAnnounceValidator = + RequireSecondedInBlockAnnounce; + /// Parachain specific block announce validator. /// +/// This is not required when the collation mechanism itself is sybil-resistant, as it is a spam protection +/// mechanism used to prevent nodes from dealing with unbounded numbers of blocks. For sybil-resistant +/// collation mechanisms, this will only slow things down. +/// /// This block announce validator is required if the parachain is running /// with the relay chain provided consensus to make sure each node only /// imports a reasonable number of blocks per round. The relay chain provided @@ -213,23 +222,23 @@ impl TryFrom<&'_ CollationSecondedSignal> for BlockAnnounceData { /// it. However, if the announcement is for a block below the tip the announcement is accepted /// as it probably comes from a node that is currently syncing the chain. #[derive(Clone)] -pub struct BlockAnnounceValidator { +pub struct RequireSecondedInBlockAnnounce { phantom: PhantomData, relay_chain_interface: RCInterface, para_id: ParaId, } -impl BlockAnnounceValidator +impl RequireSecondedInBlockAnnounce where RCInterface: Clone, { - /// Create a new [`BlockAnnounceValidator`]. + /// Create a new [`RequireSecondedInBlockAnnounce`]. pub fn new(relay_chain_interface: RCInterface, para_id: ParaId) -> Self { Self { phantom: Default::default(), relay_chain_interface, para_id } } } -impl BlockAnnounceValidator +impl RequireSecondedInBlockAnnounce where RCInterface: RelayChainInterface + Clone, { @@ -314,7 +323,7 @@ where } impl BlockAnnounceValidatorT - for BlockAnnounceValidator + for RequireSecondedInBlockAnnounce where RCInterface: RelayChainInterface + Clone + 'static, { @@ -452,3 +461,51 @@ async fn wait_to_announce( ); } } + +/// A [`BlockAnnounceValidator`] which accepts all block announcements, as it assumes +/// sybil resistance is handled elsewhere. +#[derive(Debug, Clone)] +pub struct AssumeSybilResistance(bool); + +impl AssumeSybilResistance { + /// Instantiate this block announcement validator while permissively allowing (but ignoring) + /// announcements which come tagged with seconded messages. + /// + /// This is useful for backwards compatibility when upgrading nodes: old nodes will continue + /// to broadcast announcements with seconded messages, so these announcements shouldn't be rejected + /// and the peers not punished. + pub fn allow_seconded_messages() -> Self { + AssumeSybilResistance(true) + } + + /// Instantiate this block announcement validator while rejecting announcements that come with + /// data. + pub fn reject_seconded_messages() -> Self { + AssumeSybilResistance(false) + } +} + +impl BlockAnnounceValidatorT for AssumeSybilResistance { + fn validate( + &mut self, + _header: &Block::Header, + data: &[u8], + ) -> Pin> + Send>> { + let allow_seconded_messages = self.0; + let data = data.to_vec(); + + async move { + Ok(if data.is_empty() { + Validation::Success { is_new_best: false } + } else if !allow_seconded_messages { + Validation::Failure { disconnect: false } + } else { + match BlockAnnounceData::decode_all(&mut data.as_slice()) { + Ok(_) => Validation::Success { is_new_best: false }, + Err(_) => Validation::Failure { disconnect: true }, + } + }) + } + .boxed() + } +} diff --git a/client/network/src/tests.rs b/client/network/src/tests.rs index d2def635b5c..e1bb961c75f 100644 --- a/client/network/src/tests.rs +++ b/client/network/src/tests.rs @@ -255,11 +255,13 @@ impl RelayChainInterface for DummyRelayChainInterface { } } -fn make_validator_and_api( -) -> (BlockAnnounceValidator>, Arc) { +fn make_validator_and_api() -> ( + RequireSecondedInBlockAnnounce>, + Arc, +) { let relay_chain_interface = Arc::new(DummyRelayChainInterface::new()); ( - BlockAnnounceValidator::new(relay_chain_interface.clone(), ParaId::from(56)), + RequireSecondedInBlockAnnounce::new(relay_chain_interface.clone(), ParaId::from(56)), relay_chain_interface, ) } diff --git a/client/relay-chain-inprocess-interface/src/lib.rs b/client/relay-chain-inprocess-interface/src/lib.rs index 54b0362a475..77a523b3407 100644 --- a/client/relay-chain-inprocess-interface/src/lib.rs +++ b/client/relay-chain-inprocess-interface/src/lib.rs @@ -72,11 +72,7 @@ impl RelayChainInterface for RelayChainInProcessInterface { para_id: ParaId, relay_parent: PHash, ) -> RelayChainResult> { - Ok(self.full_client.runtime_api().dmq_contents_with_context( - relay_parent, - sp_core::ExecutionContext::Importing, - para_id, - )?) + Ok(self.full_client.runtime_api().dmq_contents(relay_parent, para_id)?) } async fn retrieve_all_inbound_hrmp_channel_contents( @@ -84,11 +80,10 @@ impl RelayChainInterface for RelayChainInProcessInterface { para_id: ParaId, relay_parent: PHash, ) -> RelayChainResult>> { - Ok(self.full_client.runtime_api().inbound_hrmp_channels_contents_with_context( - relay_parent, - sp_core::ExecutionContext::Importing, - para_id, - )?) + Ok(self + .full_client + .runtime_api() + .inbound_hrmp_channels_contents(relay_parent, para_id)?) } async fn header(&self, block_id: BlockId) -> RelayChainResult> { @@ -342,8 +337,8 @@ mod tests { use polkadot_primitives::Block as PBlock; use polkadot_test_client::{ construct_transfer_extrinsic, BlockBuilderExt, Client, ClientBlockImportExt, - DefaultTestClientBuilderExt, ExecutionStrategy, InitPolkadotBlockBuilder, - TestClientBuilder, TestClientBuilderExt, + DefaultTestClientBuilderExt, InitPolkadotBlockBuilder, TestClientBuilder, + TestClientBuilderExt, }; use sp_consensus::{BlockOrigin, SyncOracle}; use sp_runtime::traits::Block as BlockT; @@ -364,8 +359,7 @@ mod tests { } fn build_client_backend_and_block() -> (Arc, PBlock, RelayChainInProcessInterface) { - let builder = - TestClientBuilder::new().set_execution_strategy(ExecutionStrategy::NativeWhenPossible); + let builder = TestClientBuilder::new(); let backend = builder.backend(); let client = Arc::new(builder.build()); diff --git a/client/relay-chain-interface/src/lib.rs b/client/relay-chain-interface/src/lib.rs index 9f7156f90e4..a0258e20632 100644 --- a/client/relay-chain-interface/src/lib.rs +++ b/client/relay-chain-interface/src/lib.rs @@ -111,7 +111,7 @@ pub trait RelayChainInterface: Send + Sync { /// Get the hash of the current best block. async fn best_block_hash(&self) -> RelayChainResult; - /// Fetch the block header of a given height + /// Fetch the block header of a given hash or height, if it exists. async fn header(&self, block_id: BlockId) -> RelayChainResult>; /// Get the hash of the finalized block. diff --git a/client/relay-chain-rpc-interface/Cargo.toml b/client/relay-chain-rpc-interface/Cargo.toml index 870e4b3700f..0d7b9af2c60 100644 --- a/client/relay-chain-rpc-interface/Cargo.toml +++ b/client/relay-chain-rpc-interface/Cargo.toml @@ -30,6 +30,6 @@ jsonrpsee = { version = "0.16.2", features = ["ws-client"] } tracing = "0.1.37" async-trait = "0.1.71" url = "2.4.0" -serde_json = "1.0.100" -serde = "1.0.167" +serde_json = "1.0.102" +serde = "1.0.171" lru = "0.9.0" diff --git a/client/service/src/lib.rs b/client/service/src/lib.rs index 42b9916d468..117e203d1ab 100644 --- a/client/service/src/lib.rs +++ b/client/service/src/lib.rs @@ -20,7 +20,7 @@ use cumulus_client_cli::CollatorOptions; use cumulus_client_consensus_common::ParachainConsensus; -use cumulus_client_network::BlockAnnounceValidator; +use cumulus_client_network::RequireSecondedInBlockAnnounce; use cumulus_client_pov_recovery::{PoVRecovery, RecoveryDelayRange, RecoveryHandle}; use cumulus_primitives_core::{CollectCollationInfo, ParaId}; use cumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain; @@ -361,7 +361,8 @@ where _ => None, }; - let block_announce_validator = BlockAnnounceValidator::new(relay_chain_interface, para_id); + let block_announce_validator = + RequireSecondedInBlockAnnounce::new(relay_chain_interface, para_id); let block_announce_validator_builder = move |_| Box::new(block_announce_validator) as Box<_>; sc_service::build_network(sc_service::BuildNetworkParams { diff --git a/pallets/aura-ext/src/lib.rs b/pallets/aura-ext/src/lib.rs index 15e82edeefe..35892571f6f 100644 --- a/pallets/aura-ext/src/lib.rs +++ b/pallets/aura-ext/src/lib.rs @@ -85,11 +85,14 @@ pub mod pallet { >; #[pallet::genesis_config] - #[derive(Default)] - pub struct GenesisConfig; + #[derive(frame_support::DefaultNoBound)] + pub struct GenesisConfig { + #[serde(skip)] + pub _config: sp_std::marker::PhantomData, + } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { let authorities = Aura::::authorities(); diff --git a/pallets/collator-selection/src/benchmarking.rs b/pallets/collator-selection/src/benchmarking.rs index 715135daf0b..816e2cd1d72 100644 --- a/pallets/collator-selection/src/benchmarking.rs +++ b/pallets/collator-selection/src/benchmarking.rs @@ -28,7 +28,7 @@ use frame_support::{ dispatch::DispatchResult, traits::{Currency, EnsureOrigin, Get, ReservableCurrency}, }; -use frame_system::{EventRecord, RawOrigin}; +use frame_system::{pallet_prelude::BlockNumberFor, EventRecord, RawOrigin}; use pallet_authorship::EventHandler; use pallet_session::{self as session, SessionManager}; use sp_std::prelude::*; @@ -289,7 +289,7 @@ benchmarks! { T::Currency::minimum_balance() * 4u32.into(), ); let author = account("author", 0, SEED); - let new_block: T::BlockNumber = 10u32.into(); + let new_block: BlockNumberFor = 10u32.into(); frame_system::Pallet::::set_block_number(new_block); assert!(T::Currency::free_balance(&author) == 0u32.into()); @@ -312,8 +312,8 @@ benchmarks! { register_validators::(c); register_candidates::(c); - let new_block: T::BlockNumber = 1800u32.into(); - let zero_block: T::BlockNumber = 0u32.into(); + let new_block: BlockNumberFor = 1800u32.into(); + let zero_block: BlockNumberFor = 0u32.into(); let candidates = >::get(); let non_removals = c.saturating_sub(r); diff --git a/pallets/collator-selection/src/lib.rs b/pallets/collator-selection/src/lib.rs index b71ce980a74..539a4d8bd95 100644 --- a/pallets/collator-selection/src/lib.rs +++ b/pallets/collator-selection/src/lib.rs @@ -143,7 +143,7 @@ pub mod pallet { type MaxInvulnerables: Get; // Will be kicked if block is not produced in threshold. - type KickThreshold: Get; + type KickThreshold: Get>; /// A stable ID for a validator. type ValidatorId: Member + Parameter; @@ -195,7 +195,7 @@ pub mod pallet { #[pallet::storage] #[pallet::getter(fn last_authored_block)] pub type LastAuthoredBlock = - StorageMap<_, Twox64Concat, T::AccountId, T::BlockNumber, ValueQuery>; + StorageMap<_, Twox64Concat, T::AccountId, BlockNumberFor, ValueQuery>; /// Desired number of candidates. /// @@ -220,7 +220,7 @@ pub mod pallet { } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { let duplicate_invulnerables = self .invulnerables @@ -648,7 +648,7 @@ pub mod pallet { /// Keep track of number of authored blocks per authority, uncles are counted as well since /// they're a valid proof of being online. impl - pallet_authorship::EventHandler for Pallet + pallet_authorship::EventHandler> for Pallet { fn note_author(author: T::AccountId) { let pot = Self::account_id(); diff --git a/pallets/collator-selection/src/mock.rs b/pallets/collator-selection/src/mock.rs index 373970d52fe..7e8b1595d2c 100644 --- a/pallets/collator-selection/src/mock.rs +++ b/pallets/collator-selection/src/mock.rs @@ -17,27 +17,23 @@ use super::*; use crate as collator_selection; use frame_support::{ ord_parameter_types, parameter_types, - traits::{ConstBool, ConstU32, ConstU64, FindAuthor, GenesisBuild, ValidatorRegistration}, + traits::{ConstBool, ConstU32, ConstU64, FindAuthor, ValidatorRegistration}, PalletId, }; use frame_system as system; use frame_system::EnsureSignedBy; use sp_core::H256; use sp_runtime::{ - testing::{Header, UintAuthorityId}, + testing::UintAuthorityId, traits::{BlakeTwo256, IdentityLookup, OpaqueKeys}, - RuntimeAppPublic, + BuildStorage, RuntimeAppPublic, }; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { System: frame_system, Timestamp: pallet_timestamp, @@ -61,13 +57,12 @@ impl system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = u64; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -214,7 +209,7 @@ impl Config for Test { pub fn new_test_ext() -> sp_io::TestExternalities { sp_tracing::try_init_simple(); - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); let invulnerables = vec![2, 1]; // unsorted let balances = vec![(1, 100), (2, 100), (3, 100), (4, 100), (5, 100)]; diff --git a/pallets/collator-selection/src/tests.rs b/pallets/collator-selection/src/tests.rs index deefb5bd2d0..cbfbde743f0 100644 --- a/pallets/collator-selection/src/tests.rs +++ b/pallets/collator-selection/src/tests.rs @@ -17,10 +17,10 @@ use crate as collator_selection; use crate::{mock::*, CandidateInfo, Error}; use frame_support::{ assert_noop, assert_ok, - traits::{Currency, GenesisBuild, OnInitialize}, + traits::{Currency, OnInitialize}, }; use pallet_balances::Error as BalancesError; -use sp_runtime::{testing::UintAuthorityId, traits::BadOrigin}; +use sp_runtime::{testing::UintAuthorityId, traits::BadOrigin, BuildStorage}; #[test] fn basic_setup_works() { @@ -627,7 +627,7 @@ fn should_kick_invulnerables_from_candidates_on_session_change() { #[should_panic = "duplicate invulnerables in genesis."] fn cannot_set_genesis_value_twice() { sp_tracing::try_init_simple(); - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); let invulnerables = vec![1, 1]; let collator_selection = collator_selection::GenesisConfig:: { diff --git a/pallets/dmp-queue/src/lib.rs b/pallets/dmp-queue/src/lib.rs index aaa9af7a6a9..627124da994 100644 --- a/pallets/dmp-queue/src/lib.rs +++ b/pallets/dmp-queue/src/lib.rs @@ -139,7 +139,7 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { - fn on_idle(_now: T::BlockNumber, max_weight: Weight) -> Weight { + fn on_idle(_now: BlockNumberFor, max_weight: Weight) -> Weight { // on_idle processes additional messages with any remaining block weight. Self::service_queue(max_weight) } @@ -414,25 +414,21 @@ mod tests { use frame_support::{assert_noop, parameter_types, traits::OnIdle}; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, DispatchError::BadOrigin, }; use sp_version::RuntimeVersion; use std::cell::RefCell; use xcm::latest::{MultiLocation, OriginKind}; - type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; type Xcm = xcm::latest::Xcm; frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, + System: frame_system::{Pallet, Call, Config, Storage, Event}, DmpQueue: dmp_queue::{Pallet, Call, Storage, Event}, } ); @@ -459,13 +455,12 @@ mod tests { impl frame_system::Config for Test { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockLength = (); @@ -542,7 +537,7 @@ mod tests { } pub(crate) fn new_test_ext() -> sp_io::TestExternalities { - frame_system::GenesisConfig::default().build_storage::().unwrap().into() + frame_system::GenesisConfig::::default().build_storage().unwrap().into() } fn enqueue(enqueued: &[Xcm]) { diff --git a/pallets/parachain-system/proc-macro/Cargo.toml b/pallets/parachain-system/proc-macro/Cargo.toml index acf2d9808e4..c75ac23d619 100644 --- a/pallets/parachain-system/proc-macro/Cargo.toml +++ b/pallets/parachain-system/proc-macro/Cargo.toml @@ -9,8 +9,8 @@ description = "Proc macros provided by the parachain-system pallet" proc-macro = true [dependencies] -syn = "2.0.23" -proc-macro2 = "1.0.63" +syn = "2.0.25" +proc-macro2 = "1.0.64" quote = "1.0.29" proc-macro-crate = "1.3.1" diff --git a/pallets/parachain-system/src/lib.rs b/pallets/parachain-system/src/lib.rs index cda0ffe6b3d..0bfc07d1841 100644 --- a/pallets/parachain-system/src/lib.rs +++ b/pallets/parachain-system/src/lib.rs @@ -44,7 +44,7 @@ use frame_support::{ weights::Weight, RuntimeDebug, }; -use frame_system::{ensure_none, ensure_root}; +use frame_system::{ensure_none, ensure_root, pallet_prelude::HeaderFor}; use polkadot_parachain::primitives::RelayChainBlockNumber; use scale_info::TypeInfo; use sp_runtime::{ @@ -197,7 +197,7 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { - fn on_finalize(_: T::BlockNumber) { + fn on_finalize(_: BlockNumberFor) { >::kill(); >::kill(); @@ -281,7 +281,7 @@ pub mod pallet { HrmpOutboundMessages::::put(outbound_messages); } - fn on_initialize(_n: T::BlockNumber) -> Weight { + fn on_initialize(_n: BlockNumberFor) -> Weight { let mut weight = Weight::zero(); // To prevent removing `NewValidationCode` that was set by another `on_initialize` @@ -714,11 +714,14 @@ pub mod pallet { } #[pallet::genesis_config] - #[derive(Default)] - pub struct GenesisConfig; + #[derive(frame_support::DefaultNoBound)] + pub struct GenesisConfig { + #[serde(skip)] + pub _config: sp_std::marker::PhantomData, + } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { // TODO: Remove after https://github.com/paritytech/cumulus/issues/479 sp_io::storage::set(b":c", &[]); @@ -1013,7 +1016,7 @@ impl Pallet { /// /// This is expected to be used by the /// [`CollectCollationInfo`](cumulus_primitives_core::CollectCollationInfo) runtime api. - pub fn collect_collation_info(header: &T::Header) -> CollationInfo { + pub fn collect_collation_info(header: &HeaderFor) -> CollationInfo { CollationInfo { hrmp_watermark: HrmpWatermark::::get(), horizontal_messages: HrmpOutboundMessages::::get(), diff --git a/pallets/parachain-system/src/tests.rs b/pallets/parachain-system/src/tests.rs index d1dd6a83736..5d259eabb72 100755 --- a/pallets/parachain-system/src/tests.rs +++ b/pallets/parachain-system/src/tests.rs @@ -29,31 +29,26 @@ use frame_support::{ traits::{OnFinalize, OnInitialize}, weights::Weight, }; -use frame_system::RawOrigin; +use frame_system::{pallet_prelude::BlockNumberFor, RawOrigin}; use hex_literal::hex; use relay_chain::HrmpChannelId; use sp_core::{blake2_256, H256}; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, - DispatchErrorWithPostInfo, + BuildStorage, DispatchErrorWithPostInfo, }; use sp_version::RuntimeVersion; use std::cell::RefCell; use crate as parachain_system; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, - ParachainSystem: parachain_system::{Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned}, + System: frame_system::{Pallet, Call, Config, Storage, Event}, + ParachainSystem: parachain_system::{Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned}, } ); @@ -76,13 +71,12 @@ parameter_types! { impl frame_system::Config for Test { type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = u64; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockLength = (); @@ -181,7 +175,7 @@ fn new_test_ext() -> sp_io::TestExternalities { HANDLED_DMP_MESSAGES.with(|m| m.borrow_mut().clear()); HANDLED_XCMP_MESSAGES.with(|m| m.borrow_mut().clear()); - frame_system::GenesisConfig::default().build_storage::().unwrap().into() + frame_system::GenesisConfig::::default().build_storage().unwrap().into() } struct ReadRuntimeVersion(Vec); @@ -212,7 +206,7 @@ fn wasm_ext() -> sp_io::TestExternalities { } struct BlockTest { - n: ::BlockNumber, + n: BlockNumberFor, within_block: Box, after_block: Option>, } @@ -243,7 +237,7 @@ impl BlockTests { self } - fn add(self, n: ::BlockNumber, within_block: F) -> Self + fn add(self, n: BlockNumberFor, within_block: F) -> Self where F: 'static + Fn(), { @@ -252,7 +246,7 @@ impl BlockTests { fn add_with_post_test( self, - n: ::BlockNumber, + n: BlockNumberFor, within_block: F1, after_block: F2, ) -> Self diff --git a/pallets/parachain-system/src/validate_block/tests.rs b/pallets/parachain-system/src/validate_block/tests.rs index 4801b62e7b5..eab3ed6d213 100644 --- a/pallets/parachain-system/src/validate_block/tests.rs +++ b/pallets/parachain-system/src/validate_block/tests.rs @@ -56,10 +56,7 @@ fn call_validate_block( } fn create_test_client() -> (Client, Header) { - let client = TestClientBuilder::new() - // NOTE: this allows easier debugging - .set_execution_strategy(sc_client_api::ExecutionStrategy::NativeWhenPossible) - .build(); + let client = TestClientBuilder::new().build(); let genesis_header = client .header(client.chain_info().genesis_hash) diff --git a/pallets/xcmp-queue/src/lib.rs b/pallets/xcmp-queue/src/lib.rs index 12ee6dae25a..b7b3c64f218 100644 --- a/pallets/xcmp-queue/src/lib.rs +++ b/pallets/xcmp-queue/src/lib.rs @@ -115,7 +115,7 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { - fn on_idle(_now: T::BlockNumber, max_weight: Weight) -> Weight { + fn on_idle(_now: BlockNumberFor, max_weight: Weight) -> Weight { // on_idle processes additional messages with any remaining block weight. Self::service_xcmp_queue(max_weight) } diff --git a/pallets/xcmp-queue/src/mock.rs b/pallets/xcmp-queue/src/mock.rs index d06da91bee3..2c27568115f 100644 --- a/pallets/xcmp-queue/src/mock.rs +++ b/pallets/xcmp-queue/src/mock.rs @@ -25,27 +25,23 @@ use frame_support::{ use frame_system::EnsureRoot; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; use xcm::prelude::*; use xcm_builder::{CurrencyAdapter, FixedWeightBounds, IsConcrete, NativeAsset, ParentIsPreset}; use xcm_executor::traits::ConvertOrigin; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, + System: frame_system::{Pallet, Call, Config, Storage, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, }, XcmpQueue: xcmp_queue::{Pallet, Call, Storage, Event}, } @@ -65,13 +61,12 @@ impl frame_system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -213,6 +208,6 @@ impl Config for Test { } pub fn new_test_ext() -> sp_io::TestExternalities { - let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let t = frame_system::GenesisConfig::::default().build_storage().unwrap(); t.into() } diff --git a/parachain-template/node/Cargo.toml b/parachain-template/node/Cargo.toml index 94184dc1a2c..d46092db40b 100644 --- a/parachain-template/node/Cargo.toml +++ b/parachain-template/node/Cargo.toml @@ -10,11 +10,12 @@ edition = "2021" build = "build.rs" [dependencies] -clap = { version = "4.3.11", features = ["derive"] } +clap = { version = "4.3.12", features = ["derive"] } log = "0.4.19" codec = { package = "parity-scale-codec", version = "3.0.0" } -serde = { version = "1.0.167", features = ["derive"] } +serde = { version = "1.0.171", features = ["derive"] } jsonrpsee = { version = "0.16.2", features = ["server"] } +futures = "0.3.28" # Local parachain-template-runtime = { path = "../runtime" } @@ -27,6 +28,7 @@ sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +sc-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } diff --git a/parachain-template/node/src/chain_spec.rs b/parachain-template/node/src/chain_spec.rs index 68588c28494..0ca3c51900f 100644 --- a/parachain-template/node/src/chain_spec.rs +++ b/parachain-template/node/src/chain_spec.rs @@ -190,11 +190,15 @@ fn testnet_genesis( code: parachain_template_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: parachain_template_runtime::BalancesConfig { balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), }, - parachain_info: parachain_template_runtime::ParachainInfoConfig { parachain_id: id }, + parachain_info: parachain_template_runtime::ParachainInfoConfig { + parachain_id: id, + ..Default::default() + }, collator_selection: parachain_template_runtime::CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: EXISTENTIAL_DEPOSIT * 16, @@ -219,6 +223,7 @@ fn testnet_genesis( parachain_system: Default::default(), polkadot_xcm: parachain_template_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, transaction_payment: Default::default(), sudo: parachain_template_runtime::SudoConfig { key: Some(root) }, diff --git a/parachain-template/node/src/rpc.rs b/parachain-template/node/src/rpc.rs index 2bc5ccccf72..b5ca484fa48 100644 --- a/parachain-template/node/src/rpc.rs +++ b/parachain-template/node/src/rpc.rs @@ -7,7 +7,7 @@ use std::sync::Arc; -use parachain_template_runtime::{opaque::Block, AccountId, Balance, Index as Nonce}; +use parachain_template_runtime::{opaque::Block, AccountId, Balance, Nonce}; use sc_client_api::AuxStore; pub use sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor}; diff --git a/parachain-template/node/src/service.rs b/parachain-template/node/src/service.rs index fb311a48b48..9ad3c1ad3cc 100644 --- a/parachain-template/node/src/service.rs +++ b/parachain-template/node/src/service.rs @@ -21,6 +21,7 @@ use cumulus_relay_chain_interface::RelayChainInterface; // Substrate Imports use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE; +use sc_client_api::Backend; use sc_consensus::ImportQueue; use sc_executor::{ HeapAllocStrategy, NativeElseWasmExecutor, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY, @@ -29,6 +30,7 @@ use sc_network::NetworkBlock; use sc_network_sync::SyncingService; use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; +use sc_transaction_pool_api::OffchainTransactionPoolFactory; use sp_keystore::KeystorePtr; use substrate_prometheus_endpoint::Registry; @@ -194,11 +196,25 @@ async fn start_node_impl( .await?; if parachain_config.offchain_worker.enabled { - sc_service::build_offchain_workers( - ¶chain_config, - task_manager.spawn_handle(), - client.clone(), - network.clone(), + use futures::FutureExt; + + task_manager.spawn_handle().spawn( + "offchain-workers-runner", + "offchain-work", + sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions { + runtime_api_provider: client.clone(), + keystore: Some(params.keystore_container.keystore()), + offchain_db: backend.offchain_storage(), + transaction_pool: Some(OffchainTransactionPoolFactory::new( + transaction_pool.clone(), + )), + network_provider: network.clone(), + is_validator: parachain_config.role.is_authority(), + enable_http_requests: false, + custom_extensions: move |_| vec![], + }) + .run(client.clone(), task_manager.spawn_handle()) + .boxed(), ); } diff --git a/parachain-template/pallets/template/src/mock.rs b/parachain-template/pallets/template/src/mock.rs index 099c0af8acd..8fae1019f42 100644 --- a/parachain-template/pallets/template/src/mock.rs +++ b/parachain-template/pallets/template/src/mock.rs @@ -2,21 +2,17 @@ use frame_support::{parameter_types, traits::Everything}; use frame_system as system; use sp_core::H256; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, + BuildStorage, }; -type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; // Configure a mock runtime to test the pallet. frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, + System: frame_system::{Pallet, Call, Config, Storage, Event}, TemplateModule: crate::{Pallet, Call, Storage, Event}, } ); @@ -33,13 +29,12 @@ impl system::Config for Test { type DbWeight = (); type RuntimeOrigin = RuntimeOrigin; type RuntimeCall = RuntimeCall; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = u64; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type Version = (); @@ -59,5 +54,5 @@ impl crate::Config for Test { // Build genesis storage according to the mock runtime. pub fn new_test_ext() -> sp_io::TestExternalities { - system::GenesisConfig::default().build_storage::().unwrap().into() + system::GenesisConfig::::default().build_storage().unwrap().into() } diff --git a/parachain-template/runtime/src/lib.rs b/parachain-template/runtime/src/lib.rs index c767092329e..761a3944afb 100644 --- a/parachain-template/runtime/src/lib.rs +++ b/parachain-template/runtime/src/lib.rs @@ -71,7 +71,7 @@ pub type AccountId = <::Signer as IdentifyAccount>::Account pub type Balance = u128; /// Index of a transaction in the chain. -pub type Index = u32; +pub type Nonce = u32; /// A hash of some data used by the chain. pub type Hash = sp_core::H256; @@ -269,15 +269,13 @@ impl frame_system::Config for Runtime { /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The index type for blocks. - type BlockNumber = BlockNumber; + type Nonce = Nonce; /// The type for hashing blocks and tries. type Hash = Hash; /// The hashing algorithm used. type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; + /// The block type. + type Block = Block; /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. @@ -467,10 +465,7 @@ impl pallet_parachain_template::Config for Runtime { // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = opaque::Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { // System support stuff. System: frame_system = 0, @@ -604,8 +599,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/parachains/common/src/impls.rs b/parachains/common/src/impls.rs index 79be9524503..4a1f4f90d05 100644 --- a/parachains/common/src/impls.rs +++ b/parachains/common/src/impls.rs @@ -131,23 +131,18 @@ mod tests { use polkadot_primitives::AccountId; use sp_core::{ConstU64, H256}; use sp_runtime::{ - testing::Header, traits::{BlakeTwo256, IdentityLookup}, - Perbill, + BuildStorage, Perbill, }; use xcm::prelude::*; - type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; const TEST_ACCOUNT: AccountId = AccountId::new([1; 32]); frame_support::construct_runtime!( - pub enum Test where - Block = Block, - NodeBlock = Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Test { - System: frame_system::{Pallet, Call, Config, Storage, Event}, + System: frame_system::{Pallet, Call, Config, Storage, Event}, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event}, } @@ -163,14 +158,13 @@ mod tests { impl frame_system::Config for Test { type BaseCallFilter = frame_support::traits::Everything; type RuntimeOrigin = RuntimeOrigin; - type Index = u64; - type BlockNumber = u64; + type Nonce = u64; type RuntimeCall = RuntimeCall; type Hash = H256; type Hashing = BlakeTwo256; type AccountId = AccountId; type Lookup = IdentityLookup; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type BlockHashCount = BlockHashCount; type BlockLength = BlockLength; @@ -245,7 +239,7 @@ mod tests { } pub fn new_test_ext() -> sp_io::TestExternalities { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); // We use default for brevity, but you can configure as desired if needed. pallet_balances::GenesisConfig::::default() .assimilate_storage(&mut t) diff --git a/parachains/common/src/lib.rs b/parachains/common/src/lib.rs index 46a8af0fb2e..0a9686bf8a3 100644 --- a/parachains/common/src/lib.rs +++ b/parachains/common/src/lib.rs @@ -43,7 +43,7 @@ mod types { pub type Balance = u128; /// Index of a transaction in the chain. - pub type Index = u32; + pub type Nonce = u32; /// A hash of some data used by the chain. pub type Hash = sp_core::H256; diff --git a/parachains/integration-tests/emulated/common/src/constants.rs b/parachains/integration-tests/emulated/common/src/constants.rs index 197db0b9392..7c3eaba5956 100644 --- a/parachains/integration-tests/emulated/common/src/constants.rs +++ b/parachains/integration-tests/emulated/common/src/constants.rs @@ -155,6 +155,7 @@ pub mod polkadot { let genesis_config = polkadot_runtime::RuntimeGenesisConfig { system: polkadot_runtime::SystemConfig { code: polkadot_runtime::WASM_BINARY.unwrap().to_vec(), + ..Default::default() }, balances: polkadot_runtime::BalancesConfig { balances: accounts::init_balances() @@ -202,6 +203,7 @@ pub mod polkadot { babe: polkadot_runtime::BabeConfig { authorities: Default::default(), epoch_config: Some(polkadot_runtime::BABE_GENESIS_EPOCH_CONFIG), + ..Default::default() }, configuration: polkadot_runtime::ConfigurationConfig { config: get_host_config() }, ..Default::default() @@ -252,6 +254,7 @@ pub mod westend { let genesis_config = westend_runtime::RuntimeGenesisConfig { system: westend_runtime::SystemConfig { code: westend_runtime::WASM_BINARY.unwrap().to_vec(), + ..Default::default() }, balances: westend_runtime::BalancesConfig { balances: accounts::init_balances() @@ -299,6 +302,7 @@ pub mod westend { babe: westend_runtime::BabeConfig { authorities: Default::default(), epoch_config: Some(westend_runtime::BABE_GENESIS_EPOCH_CONFIG), + ..Default::default() }, configuration: westend_runtime::ConfigurationConfig { config: get_host_config() }, ..Default::default() @@ -349,6 +353,7 @@ pub mod kusama { let genesis_config = kusama_runtime::RuntimeGenesisConfig { system: kusama_runtime::SystemConfig { code: kusama_runtime::WASM_BINARY.unwrap().to_vec(), + ..Default::default() }, balances: kusama_runtime::BalancesConfig { balances: accounts::init_balances() @@ -395,6 +400,7 @@ pub mod kusama { babe: kusama_runtime::BabeConfig { authorities: Default::default(), epoch_config: Some(kusama_runtime::BABE_GENESIS_EPOCH_CONFIG), + ..Default::default() }, configuration: kusama_runtime::ConfigurationConfig { config: get_host_config() }, ..Default::default() @@ -445,6 +451,7 @@ pub mod rococo { let genesis_config = rococo_runtime::RuntimeGenesisConfig { system: rococo_runtime::SystemConfig { code: rococo_runtime::WASM_BINARY.unwrap().to_vec(), + ..Default::default() }, balances: rococo_runtime::BalancesConfig { balances: accounts::init_balances() @@ -476,6 +483,7 @@ pub mod rococo { babe: rococo_runtime::BabeConfig { authorities: Default::default(), epoch_config: Some(rococo_runtime::BABE_GENESIS_EPOCH_CONFIG), + ..Default::default() }, sudo: rococo_runtime::SudoConfig { key: Some(get_account_id_from_seed::("Alice")), @@ -483,6 +491,7 @@ pub mod rococo { configuration: rococo_runtime::ConfigurationConfig { config: get_host_config() }, registrar: rococo_runtime::RegistrarConfig { next_free_para_id: polkadot_primitives::LOWEST_PUBLIC_ID, + ..Default::default() }, ..Default::default() }; @@ -503,6 +512,7 @@ pub mod asset_hub_polkadot { code: asset_hub_polkadot_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: asset_hub_polkadot_runtime::BalancesConfig { balances: accounts::init_balances() @@ -513,6 +523,7 @@ pub mod asset_hub_polkadot { }, parachain_info: asset_hub_polkadot_runtime::ParachainInfoConfig { parachain_id: PARA_ID.into(), + ..Default::default() }, collator_selection: asset_hub_polkadot_runtime::CollatorSelectionConfig { invulnerables: collators::invulnerables_asset_hub_polkadot() @@ -537,6 +548,7 @@ pub mod asset_hub_polkadot { }, polkadot_xcm: asset_hub_polkadot_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, ..Default::default() }; @@ -557,6 +569,7 @@ pub mod asset_hub_westend { code: asset_hub_westend_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: asset_hub_westend_runtime::BalancesConfig { balances: accounts::init_balances() @@ -567,6 +580,7 @@ pub mod asset_hub_westend { }, parachain_info: asset_hub_westend_runtime::ParachainInfoConfig { parachain_id: PARA_ID.into(), + ..Default::default() }, collator_selection: asset_hub_westend_runtime::CollatorSelectionConfig { invulnerables: collators::invulnerables() @@ -591,6 +605,7 @@ pub mod asset_hub_westend { }, polkadot_xcm: asset_hub_westend_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, ..Default::default() }; @@ -611,6 +626,7 @@ pub mod asset_hub_kusama { code: asset_hub_kusama_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: asset_hub_kusama_runtime::BalancesConfig { balances: accounts::init_balances() @@ -621,6 +637,7 @@ pub mod asset_hub_kusama { }, parachain_info: asset_hub_kusama_runtime::ParachainInfoConfig { parachain_id: PARA_ID.into(), + ..Default::default() }, collator_selection: asset_hub_kusama_runtime::CollatorSelectionConfig { invulnerables: collators::invulnerables() @@ -645,6 +662,7 @@ pub mod asset_hub_kusama { }, polkadot_xcm: asset_hub_kusama_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, ..Default::default() }; @@ -665,6 +683,7 @@ pub mod penpal { code: penpal_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: penpal_runtime::BalancesConfig { balances: accounts::init_balances() @@ -673,7 +692,10 @@ pub mod penpal { .map(|k| (k, ED * 4096)) .collect(), }, - parachain_info: penpal_runtime::ParachainInfoConfig { parachain_id: para_id.into() }, + parachain_info: penpal_runtime::ParachainInfoConfig { + parachain_id: para_id.into(), + ..Default::default() + }, collator_selection: penpal_runtime::CollatorSelectionConfig { invulnerables: collators::invulnerables() .iter() @@ -697,6 +719,7 @@ pub mod penpal { }, polkadot_xcm: penpal_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, sudo: penpal_runtime::SudoConfig { key: Some(get_account_id_from_seed::("Alice")), @@ -720,6 +743,7 @@ pub mod collectives { code: collectives_polkadot_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: collectives_polkadot_runtime::BalancesConfig { balances: accounts::init_balances() @@ -730,6 +754,7 @@ pub mod collectives { }, parachain_info: collectives_polkadot_runtime::ParachainInfoConfig { parachain_id: PARA_ID.into(), + ..Default::default() }, collator_selection: collectives_polkadot_runtime::CollatorSelectionConfig { invulnerables: collators::invulnerables() @@ -754,6 +779,7 @@ pub mod collectives { }, polkadot_xcm: collectives_polkadot_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, ..Default::default() }; @@ -774,6 +800,7 @@ pub mod bridge_hub_kusama { code: bridge_hub_kusama_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: bridge_hub_kusama_runtime::BalancesConfig { balances: accounts::init_balances() @@ -784,6 +811,7 @@ pub mod bridge_hub_kusama { }, parachain_info: bridge_hub_kusama_runtime::ParachainInfoConfig { parachain_id: PARA_ID.into(), + ..Default::default() }, collator_selection: bridge_hub_kusama_runtime::CollatorSelectionConfig { invulnerables: collators::invulnerables() @@ -808,6 +836,7 @@ pub mod bridge_hub_kusama { }, polkadot_xcm: bridge_hub_kusama_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, ..Default::default() }; @@ -828,6 +857,7 @@ pub mod bridge_hub_polkadot { code: bridge_hub_polkadot_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: bridge_hub_polkadot_runtime::BalancesConfig { balances: accounts::init_balances() @@ -838,6 +868,7 @@ pub mod bridge_hub_polkadot { }, parachain_info: bridge_hub_polkadot_runtime::ParachainInfoConfig { parachain_id: PARA_ID.into(), + ..Default::default() }, collator_selection: bridge_hub_polkadot_runtime::CollatorSelectionConfig { invulnerables: collators::invulnerables() @@ -862,6 +893,7 @@ pub mod bridge_hub_polkadot { }, polkadot_xcm: bridge_hub_polkadot_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, ..Default::default() }; @@ -882,6 +914,7 @@ pub mod bridge_hub_rococo { code: bridge_hub_rococo_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: bridge_hub_rococo_runtime::BalancesConfig { balances: accounts::init_balances() @@ -892,6 +925,7 @@ pub mod bridge_hub_rococo { }, parachain_info: bridge_hub_rococo_runtime::ParachainInfoConfig { parachain_id: PARA_ID.into(), + ..Default::default() }, collator_selection: bridge_hub_rococo_runtime::CollatorSelectionConfig { invulnerables: collators::invulnerables() @@ -916,6 +950,7 @@ pub mod bridge_hub_rococo { }, polkadot_xcm: bridge_hub_rococo_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, bridge_wococo_grandpa: bridge_hub_rococo_runtime::BridgeWococoGrandpaConfig { owner: Some(get_account_id_from_seed::("Alice")), diff --git a/parachains/pallets/parachain-info/Cargo.toml b/parachains/pallets/parachain-info/Cargo.toml index c14164c0ffe..c522ba9673b 100644 --- a/parachains/pallets/parachain-info/Cargo.toml +++ b/parachains/pallets/parachain-info/Cargo.toml @@ -11,6 +11,9 @@ scale-info = { version = "2.9.0", default-features = false, features = ["derive" frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } +sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v1.0.0" } + cumulus-primitives-core = { path = "../../../primitives/core", default-features = false } [features] diff --git a/parachains/pallets/parachain-info/src/lib.rs b/parachains/pallets/parachain-info/src/lib.rs index 1910d6cf241..6a9707365c3 100644 --- a/parachains/pallets/parachain-info/src/lib.rs +++ b/parachains/pallets/parachain-info/src/lib.rs @@ -39,18 +39,20 @@ pub mod pallet { impl Pallet {} #[pallet::genesis_config] - pub struct GenesisConfig { + pub struct GenesisConfig { + #[serde(skip)] + pub _config: sp_std::marker::PhantomData, pub parachain_id: ParaId, } - impl Default for GenesisConfig { + impl Default for GenesisConfig { fn default() -> Self { - Self { parachain_id: 100.into() } + Self { parachain_id: 100.into(), _config: Default::default() } } } #[pallet::genesis_build] - impl GenesisBuild for GenesisConfig { + impl BuildGenesisConfig for GenesisConfig { fn build(&self) { >::put(self.parachain_id); } diff --git a/parachains/pallets/ping/src/lib.rs b/parachains/pallets/ping/src/lib.rs index 0260f05dad2..7425b5bd52f 100644 --- a/parachains/pallets/ping/src/lib.rs +++ b/parachains/pallets/ping/src/lib.rs @@ -72,7 +72,7 @@ pub mod pallet { /// The sent pings. #[pallet::storage] pub(super) type Pings = - StorageMap<_, Blake2_128Concat, u32, T::BlockNumber, OptionQuery>; + StorageMap<_, Blake2_128Concat, u32, BlockNumberFor, OptionQuery>; #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] @@ -80,7 +80,7 @@ pub mod pallet { PingSent(ParaId, u32, Vec, XcmHash, MultiAssets), Pinged(ParaId, u32, Vec), PongSent(ParaId, u32, Vec, XcmHash, MultiAssets), - Ponged(ParaId, u32, Vec, T::BlockNumber), + Ponged(ParaId, u32, Vec, BlockNumberFor), ErrorSendingPing(SendError, ParaId, u32, Vec), ErrorSendingPong(SendError, ParaId, u32, Vec), UnknownPong(ParaId, u32, Vec), @@ -96,7 +96,7 @@ pub mod pallet { #[pallet::hooks] impl Hooks> for Pallet { - fn on_finalize(n: T::BlockNumber) { + fn on_finalize(n: BlockNumberFor) { for (para, payload) in Targets::::get().into_iter() { let seq = PingCount::::mutate(|seq| { *seq += 1; diff --git a/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs b/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs index ee8358ea5e3..87c9f71db9d 100644 --- a/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/lib.rs @@ -67,8 +67,8 @@ use pallet_nfts::PalletFeatures; pub use parachains_common as common; use parachains_common::{ impls::{AssetsToBlockAuthor, DealWithFees}, - opaque, AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, BlockNumber, Hash, Header, - Index, Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, + AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, BlockNumber, Hash, Header, Nonce, + Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use xcm_config::{ @@ -165,11 +165,10 @@ impl frame_system::Config for Runtime { type AccountId = AccountId; type RuntimeCall = RuntimeCall; type Lookup = AccountIdLookup; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type RuntimeOrigin = RuntimeOrigin; type BlockHashCount = BlockHashCount; @@ -736,19 +735,16 @@ impl pallet_nfts::Config for Runtime { // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = opaque::Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, + System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, } = 1, // RandomnessCollectiveFlip = 2 removed Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, + ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, // Monetary stuff. Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, @@ -760,11 +756,11 @@ construct_runtime!( CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, + PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 33, @@ -939,8 +935,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs b/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs index e8cc6ba07b3..4ecf0f6466b 100644 --- a/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs +++ b/parachains/runtimes/assets/asset-hub-polkadot/src/lib.rs @@ -102,9 +102,9 @@ use pallet_nfts::PalletFeatures; pub use parachains_common as common; use parachains_common::{ impls::{AssetsToBlockAuthor, DealWithFees}, - opaque, AccountId, AssetHubPolkadotAuraId as AuraId, AssetIdForTrustBackedAssets, Balance, - BlockNumber, Hash, Header, Index, Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, - MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, + AccountId, AssetHubPolkadotAuraId as AuraId, AssetIdForTrustBackedAssets, Balance, BlockNumber, + Hash, Header, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, + NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use xcm_config::{ DotLocation, FellowshipLocation, ForeignAssetsConvertedConcreteId, GovernanceLocation, @@ -183,11 +183,10 @@ impl frame_system::Config for Runtime { type AccountId = AccountId; type RuntimeCall = RuntimeCall; type Lookup = AccountIdLookup; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type RuntimeOrigin = RuntimeOrigin; type BlockHashCount = BlockHashCount; @@ -723,19 +722,16 @@ impl pallet_nfts::Config for Runtime { // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = opaque::Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, + System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, } = 1, // RandomnessCollectiveFlip = 2 removed Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, + ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, // Monetary stuff. Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, @@ -747,11 +743,11 @@ construct_runtime!( CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, + PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 33, @@ -921,8 +917,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/parachains/runtimes/assets/asset-hub-westend/src/lib.rs index 35842d650e3..15164b53823 100644 --- a/parachains/runtimes/assets/asset-hub-westend/src/lib.rs +++ b/parachains/runtimes/assets/asset-hub-westend/src/lib.rs @@ -52,9 +52,9 @@ use pallet_asset_conversion_tx_payment::AssetConversionAdapter; use pallet_nfts::PalletFeatures; pub use parachains_common as common; use parachains_common::{ - impls::DealWithFees, opaque, AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, - BlockNumber, Hash, Header, Index, Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, - MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, + impls::DealWithFees, AccountId, AssetIdForTrustBackedAssets, AuraId, Balance, BlockNumber, + Hash, Header, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, + NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use sp_api::impl_runtime_apis; use sp_core::{crypto::KeyTypeId, OpaqueMetadata}; @@ -147,11 +147,10 @@ impl frame_system::Config for Runtime { type AccountId = AccountId; type RuntimeCall = RuntimeCall; type Lookup = AccountIdLookup; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type RuntimeOrigin = RuntimeOrigin; type BlockHashCount = BlockHashCount; @@ -761,19 +760,16 @@ impl pallet_nfts::Config for Runtime { // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = opaque::Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, + System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, } = 1, // RandomnessCollectiveFlip = 2 removed Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, + ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, // Monetary stuff. Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, @@ -786,11 +782,11 @@ construct_runtime!( CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, + PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 33, @@ -970,8 +966,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml index 0631a161054..3525c5be975 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/Cargo.toml @@ -13,7 +13,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = hex-literal = { version = "0.4.1" } log = { version = "0.4.19", default-features = false } scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.167", optional = true, features = ["derive"] } +serde = { version = "1.0.171", optional = true, features = ["derive"] } smallvec = "1.11.0" # Substrate diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs index eceaee09ea5..d2836bec59c 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-kusama/src/lib.rs @@ -69,7 +69,7 @@ use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; use parachains_common::{ - impls::DealWithFees, opaque, AccountId, Balance, BlockNumber, Hash, Header, Index, Signature, + impls::DealWithFees, AccountId, Balance, BlockNumber, Hash, Header, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; @@ -180,15 +180,13 @@ impl frame_system::Config for Runtime { /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The index type for blocks. - type BlockNumber = BlockNumber; + type Nonce = Nonce; /// The type for hashing blocks and tries. type Hash = Hash; /// The hashing algorithm used. type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; + /// The block type. + type Block = Block; /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. @@ -400,18 +398,15 @@ impl pallet_utility::Config for Runtime { // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = opaque::Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, + System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, } = 1, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, + ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, // Monetary stuff. Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, @@ -422,11 +417,11 @@ construct_runtime!( CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin, Config} = 31, + PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin, Config} = 31, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 33, @@ -547,8 +542,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/Cargo.toml index e71b53b9534..539e4bed2a5 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/Cargo.toml @@ -13,7 +13,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = hex-literal = { version = "0.4.1" } log = { version = "0.4.19", default-features = false } scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.167", optional = true, features = ["derive"] } +serde = { version = "1.0.171", optional = true, features = ["derive"] } smallvec = "1.11.0" # Substrate diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs index 713927c2249..403df659bba 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -70,7 +70,7 @@ use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; use parachains_common::{ - impls::DealWithFees, opaque, AccountId, Balance, BlockNumber, Hash, Header, Index, Signature, + impls::DealWithFees, AccountId, Balance, BlockNumber, Hash, Header, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; // XCM Imports @@ -180,15 +180,13 @@ impl frame_system::Config for Runtime { /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The index type for blocks. - type BlockNumber = BlockNumber; + type Nonce = Nonce; /// The type for hashing blocks and tries. type Hash = Hash; /// The hashing algorithm used. type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; + /// The block type. + type Block = Block; /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. @@ -400,18 +398,15 @@ impl pallet_utility::Config for Runtime { // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = opaque::Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, + System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, } = 1, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, + ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, // Monetary stuff. Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, @@ -422,11 +417,11 @@ construct_runtime!( CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin, Config} = 31, + PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin, Config} = 31, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 33, @@ -547,8 +542,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index 8052dacb7fb..56d766dd07c 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -13,7 +13,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0", default-features = hex-literal = { version = "0.4.1" } log = { version = "0.4.19", default-features = false } scale-info = { version = "2.9.0", default-features = false, features = ["derive"] } -serde = { version = "1.0.167", optional = true, features = ["derive"] } +serde = { version = "1.0.171", optional = true, features = ["derive"] } smallvec = "1.11.0" # Substrate diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 313e7226489..460d6be6b97 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -87,7 +87,7 @@ use bridge_runtime_common::{ messages_xcm_extension::{XcmAsPlainPayload, XcmBlobMessageDispatch}, }; use parachains_common::{ - impls::DealWithFees, opaque, AccountId, Balance, BlockNumber, Hash, Header, Index, Signature, + impls::DealWithFees, AccountId, Balance, BlockNumber, Hash, Header, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; use xcm_executor::XcmExecutor; @@ -194,15 +194,13 @@ impl frame_system::Config for Runtime { /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The index type for blocks. - type BlockNumber = BlockNumber; + type Nonce = Nonce; /// The type for hashing blocks and tries. type Hash = Hash; /// The hashing algorithm used. type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; + /// The block type. + type Block = Block; /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. @@ -545,18 +543,15 @@ impl pallet_bridge_relayers::Config for Runtime { // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = opaque::Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, + System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, } = 1, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, + ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, // Monetary stuff. Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, @@ -567,11 +562,11 @@ construct_runtime!( CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin, Config} = 31, + PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin, Config} = 31, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 33, @@ -728,8 +723,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs index 6a1ec2793f2..eb12e7742dc 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs @@ -27,6 +27,7 @@ use bridge_hub_rococo_runtime::{ }; use codec::{Decode, Encode}; use frame_support::parameter_types; +use frame_system::pallet_prelude::HeaderFor; use parachains_common::{AccountId, AuraId, Balance}; use sp_keyring::AccountKeyring::Alice; use sp_runtime::{ @@ -81,7 +82,7 @@ fn construct_and_apply_extrinsic( r.unwrap() } -fn executive_init_block(header: &::Header) { +fn executive_init_block(header: &HeaderFor) { Executive::initialize_block(header) } diff --git a/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs b/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs index e20767ccde6..03be3f28619 100644 --- a/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs +++ b/parachains/runtimes/bridge-hubs/test-utils/src/test_cases.rs @@ -38,6 +38,7 @@ use frame_support::{ assert_ok, traits::{Get, OriginTrait, PalletInfoAccess}, }; +use frame_system::pallet_prelude::{BlockNumberFor, HeaderFor}; use pallet_bridge_grandpa::BridgedHeader; use parachains_runtimes_test_utils::{ mock_open_hrmp_channel, AccountIdOf, BalanceOf, CollatorSessionKeys, ExtBuilder, RuntimeHelper, @@ -590,7 +591,7 @@ pub fn complex_relay_extrinsic_works, - executive_init_block: fn(&::Header), + executive_init_block: fn(&HeaderFor), construct_and_apply_extrinsic: fn( sp_keyring::AccountKeyring, pallet_utility::Call:: @@ -653,10 +654,9 @@ pub fn complex_relay_extrinsic_works::BlockNumber = 0u32.into(); + let zero: BlockNumberFor = 0u32.into(); let genesis_hash = frame_system::Pallet::::block_hash(zero); - let mut header: ::Header = - bp_test_utils::test_header(1u32.into()); + let mut header: HeaderFor = bp_test_utils::test_header(1u32.into()); header.set_parent_hash(genesis_hash); executive_init_block(&header); diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs index 8ceb1c403b0..fb30551b9ca 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/fellowship/migration.rs @@ -165,7 +165,7 @@ pub mod tests { use pallet_ranked_collective::Rank; use parachains_common::AccountId; use sp_core::crypto::Ss58Codec; - use sp_runtime::AccountId32; + use sp_runtime::{AccountId32, BuildStorage}; #[test] fn check_fellowship_addresses() { @@ -236,7 +236,7 @@ pub mod tests { use super::import_kusama_fellowship::Migration; use pallet_ranked_collective::{IdToIndex, IndexToId, MemberCount, MemberRecord, Members}; - let t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let t = frame_system::GenesisConfig::::default().build_storage().unwrap(); let mut ext = sp_io::TestExternalities::new(t); ext.execute_with(|| System::set_block_number(1)); ext.execute_with(|| { diff --git a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs index 4fe1b4425b5..16494268158 100644 --- a/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs +++ b/parachains/runtimes/collectives/collectives-polkadot/src/lib.rs @@ -80,9 +80,9 @@ use frame_system::{ }; pub use parachains_common as common; use parachains_common::{ - impls::DealWithFees, opaque, AccountId, AuraId, Balance, BlockNumber, Hash, Header, Index, - Signature, AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, MINUTES, - NORMAL_DISPATCH_RATIO, SLOT_DURATION, + impls::DealWithFees, AccountId, AuraId, Balance, BlockNumber, Hash, Header, Nonce, Signature, + AVERAGE_ON_INITIALIZE_RATIO, DAYS, HOURS, MAXIMUM_BLOCK_WEIGHT, MINUTES, NORMAL_DISPATCH_RATIO, + SLOT_DURATION, }; use xcm_config::{GovernanceLocation, XcmConfig, XcmOriginToTransactDispatchOrigin}; @@ -159,11 +159,10 @@ impl frame_system::Config for Runtime { type AccountId = AccountId; type RuntimeCall = RuntimeCall; type Lookup = AccountIdLookup; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type RuntimeOrigin = RuntimeOrigin; type BlockHashCount = BlockHashCount; @@ -551,18 +550,15 @@ impl pallet_preimage::Config for Runtime { // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = opaque::Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, + System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, } = 1, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, + ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, // Monetary stuff. Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, @@ -573,11 +569,11 @@ construct_runtime!( CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, + PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 33, @@ -765,8 +761,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/parachains/runtimes/contracts/contracts-rococo/src/lib.rs b/parachains/runtimes/contracts/contracts-rococo/src/lib.rs index bd722e2c28f..a21d0360d0d 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/lib.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/lib.rs @@ -57,7 +57,7 @@ use frame_support::{ use frame_system::limits::{BlockLength, BlockWeights}; pub use parachains_common as common; use parachains_common::{ - impls::DealWithFees, opaque, AccountId, BlockNumber, Hash, Header, Index, Signature, + impls::DealWithFees, AccountId, BlockNumber, Hash, Header, Nonce, Signature, AVERAGE_ON_INITIALIZE_RATIO, MAXIMUM_BLOCK_WEIGHT, MINUTES, NORMAL_DISPATCH_RATIO, SLOT_DURATION, }; @@ -174,11 +174,10 @@ impl frame_system::Config for Runtime { type AccountId = AccountId; type RuntimeCall = RuntimeCall; type Lookup = AccountIdLookup; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type RuntimeOrigin = RuntimeOrigin; type BlockHashCount = BlockHashCount; @@ -337,19 +336,16 @@ impl pallet_sudo::Config for Runtime { // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = opaque::Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, + System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, } = 1, RandomnessCollectiveFlip: pallet_insecure_randomness_collective_flip::{Pallet, Storage} = 2, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 3, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, + ParachainInfo: parachain_info::{Pallet, Storage, Config} = 4, // Monetary stuff. Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, @@ -360,11 +356,11 @@ construct_runtime!( CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, + PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event, Origin, Config} = 31, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 33, @@ -488,8 +484,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/parachains/runtimes/glutton/glutton-kusama/src/lib.rs b/parachains/runtimes/glutton/glutton-kusama/src/lib.rs index 3db1f4552a4..d7db1d28801 100644 --- a/parachains/runtimes/glutton/glutton-kusama/src/lib.rs +++ b/parachains/runtimes/glutton/glutton-kusama/src/lib.rs @@ -142,11 +142,10 @@ impl frame_system::Config for Runtime { type AccountId = AccountId; type RuntimeCall = RuntimeCall; type Lookup = AccountIdLookup; - type Index = Index; - type BlockNumber = BlockNumber; + type Nonce = Nonce; type Hash = Hash; type Hashing = BlakeTwo256; - type Header = generic::Header; + type Block = Block; type RuntimeEvent = RuntimeEvent; type RuntimeOrigin = RuntimeOrigin; type BlockHashCount = BlockHashCount; @@ -197,22 +196,19 @@ impl pallet_sudo::Config for Runtime { } construct_runtime! { - pub enum Runtime where - Block = Block, - NodeBlock = generic::Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event} = 0, + System: frame_system::{Pallet, Call, Storage, Config, Event} = 0, ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, } = 1, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 2, + ParachainInfo: parachain_info::{Pallet, Storage, Config} = 2, // DMP handler. CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Storage, Event, Origin} = 10, // The main stage. - Glutton: pallet_glutton::{Pallet, Call, Storage, Event, Config} = 20, + Glutton: pallet_glutton::{Pallet, Call, Storage, Event, Config} = 20, // Sudo. Sudo: pallet_sudo::{Pallet, Call, Storage, Event, Config} = 255, @@ -220,7 +216,7 @@ construct_runtime! { } /// Index of a transaction in the chain. -pub type Index = u32; +pub type Nonce = u32; /// A hash of some data used by the chain. pub type Hash = sp_core::H256; /// An index to a block. @@ -352,8 +348,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/parachains/runtimes/starters/seedling/src/lib.rs b/parachains/runtimes/starters/seedling/src/lib.rs index 1f8dea110fb..cc62e609a63 100644 --- a/parachains/runtimes/starters/seedling/src/lib.rs +++ b/parachains/runtimes/starters/seedling/src/lib.rs @@ -125,15 +125,13 @@ impl frame_system::Config for Runtime { /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The index type for blocks. - type BlockNumber = BlockNumber; + type Nonce = Nonce; /// The type for hashing blocks and tries. type Hash = Hash; /// The hashing algorithm used. type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; + /// The block type. + type Block = Block; /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. @@ -182,24 +180,21 @@ impl cumulus_pallet_parachain_system::Config for Runtime { impl parachain_info::Config for Runtime {} construct_runtime! { - pub enum Runtime where - Block = Block, - NodeBlock = generic::Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, + System: frame_system::{Pallet, Call, Storage, Config, Event}, Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event}, ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, }, - ParachainInfo: parachain_info::{Pallet, Storage, Config}, + ParachainInfo: parachain_info::{Pallet, Storage, Config}, SoloToPara: cumulus_pallet_solo_to_para::{Pallet, Call, Storage, Event}, } } /// Index of a transaction in the chain. -pub type Index = u32; +pub type Nonce = u32; /// A hash of some data used by the chain. pub type Hash = sp_core::H256; /// An index to a block. diff --git a/parachains/runtimes/starters/shell/src/lib.rs b/parachains/runtimes/starters/shell/src/lib.rs index cbd9185b3bc..aa14c83fef0 100644 --- a/parachains/runtimes/starters/shell/src/lib.rs +++ b/parachains/runtimes/starters/shell/src/lib.rs @@ -133,15 +133,13 @@ impl frame_system::Config for Runtime { /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The index type for blocks. - type BlockNumber = BlockNumber; + type Nonce = Nonce; /// The type for hashing blocks and tries. type Hash = Hash; /// The hashing algorithm used. type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; + /// The block type. + type Block = Block; /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. @@ -185,16 +183,13 @@ impl cumulus_pallet_parachain_system::Config for Runtime { impl parachain_info::Config for Runtime {} construct_runtime! { - pub enum Runtime where - Block = Block, - NodeBlock = generic::Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, + System: frame_system::{Pallet, Call, Storage, Config, Event}, ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, }, - ParachainInfo: parachain_info::{Pallet, Storage, Config}, + ParachainInfo: parachain_info::{Pallet, Storage, Config}, // DMP handler. CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Storage, Event, Origin}, @@ -237,7 +232,7 @@ impl sp_runtime::traits::SignedExtension for DisallowSigned { } /// Index of a transaction in the chain. -pub type Index = u32; +pub type Nonce = u32; /// A hash of some data used by the chain. pub type Hash = sp_core::H256; /// An index to a block. diff --git a/parachains/runtimes/test-utils/src/lib.rs b/parachains/runtimes/test-utils/src/lib.rs index 8ff85438b3f..9328ac492d3 100644 --- a/parachains/runtimes/test-utils/src/lib.rs +++ b/parachains/runtimes/test-utils/src/lib.rs @@ -22,14 +22,14 @@ use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; use frame_support::{ dispatch::{DispatchResult, RawOrigin, UnfilteredDispatchable}, inherent::{InherentData, ProvideInherent}, - traits::{GenesisBuild, OriginTrait}, + traits::OriginTrait, weights::Weight, }; use parachains_common::AccountId; use polkadot_parachain::primitives::{HrmpChannelId, RelayChainBlockNumber, XcmpMessageFormat}; use sp_consensus_aura::AURA_ENGINE_ID; use sp_core::Encode; -use sp_runtime::{Digest, DigestItem}; +use sp_runtime::{BuildStorage, Digest, DigestItem}; use xcm::{ latest::{MultiAsset, MultiLocation, XcmContext, XcmHash}, prelude::*, @@ -161,20 +161,22 @@ impl< pallet_collator_selection::Config + pallet_balances::Config + pallet_session::Config, ValidatorIdOf: From>, { - let mut t = frame_system::GenesisConfig::default().build_storage::().unwrap(); + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); - >::assimilate_storage( - &pallet_xcm::GenesisConfig { safe_xcm_version: self.safe_xcm_version }, - &mut t, - ) + pallet_xcm::GenesisConfig:: { + safe_xcm_version: self.safe_xcm_version, + ..Default::default() + } + .assimilate_storage(&mut t) .unwrap(); if let Some(para_id) = self.para_id { - >::assimilate_storage( - ¶chain_info::GenesisConfig { parachain_id: para_id }, - &mut t, - ) - .unwrap(); + parachain_info::GenesisConfig:: { + parachain_id: para_id, + ..Default::default() + } + .assimilate_storage(&mut t) + .unwrap(); } pallet_balances::GenesisConfig:: { balances: self.balances } diff --git a/parachains/runtimes/testing/penpal/src/lib.rs b/parachains/runtimes/testing/penpal/src/lib.rs index fff54a849fd..cdd559777ed 100644 --- a/parachains/runtimes/testing/penpal/src/lib.rs +++ b/parachains/runtimes/testing/penpal/src/lib.rs @@ -83,7 +83,7 @@ use xcm_executor::XcmExecutor; pub type Balance = u128; /// Index of a transaction in the chain. -pub type Index = u32; +pub type Nonce = u32; /// A hash of some data used by the chain. pub type Hash = sp_core::H256; @@ -317,15 +317,13 @@ impl frame_system::Config for Runtime { /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The index type for blocks. - type BlockNumber = BlockNumber; + type Nonce = Nonce; /// The type for hashing blocks and tries. type Hash = Hash; /// The hashing algorithm used. type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; + /// The block type. + type Block = Block; /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. @@ -551,18 +549,15 @@ impl pallet_sudo::Config for Runtime { // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( - pub enum Runtime where - Block = Block, - NodeBlock = opaque::Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { // System support stuff. - System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, + System: frame_system::{Pallet, Call, Config, Storage, Event} = 0, ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, } = 1, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 2, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, + ParachainInfo: parachain_info::{Pallet, Storage, Config} = 3, // Monetary stuff. Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 10, @@ -574,11 +569,11 @@ construct_runtime!( CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event, Config} = 21, Session: pallet_session::{Pallet, Call, Storage, Event, Config} = 22, Aura: pallet_aura::{Pallet, Storage, Config} = 23, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, + AuraExt: cumulus_pallet_aura_ext::{Pallet, Storage, Config} = 24, // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 30, - PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin, Config} = 31, + PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin, Config} = 31, CumulusXcm: cumulus_pallet_xcm::{Pallet, Event, Origin} = 32, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 33, @@ -694,8 +689,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/parachains/runtimes/testing/rococo-parachain/src/lib.rs b/parachains/runtimes/testing/rococo-parachain/src/lib.rs index c8ca0533407..0c5ac5129a8 100644 --- a/parachains/runtimes/testing/rococo-parachain/src/lib.rs +++ b/parachains/runtimes/testing/rococo-parachain/src/lib.rs @@ -178,15 +178,13 @@ impl frame_system::Config for Runtime { /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = AccountIdLookup; /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The index type for blocks. - type BlockNumber = BlockNumber; + type Nonce = Nonce; /// The type for hashing blocks and tries. type Hash = Hash; /// The hashing algorithm used. type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; + /// The block type. + type Block = Block; /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. @@ -558,30 +556,27 @@ impl pallet_aura::Config for Runtime { } construct_runtime! { - pub enum Runtime where - Block = Block, - NodeBlock = generic::Block, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { - System: frame_system::{Pallet, Call, Storage, Config, Event}, + System: frame_system::{Pallet, Call, Storage, Config, Event}, Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent}, Sudo: pallet_sudo::{Pallet, Call, Storage, Config, Event}, TransactionPayment: pallet_transaction_payment::{Pallet, Storage, Event}, ParachainSystem: cumulus_pallet_parachain_system::{ - Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, + Pallet, Call, Config, Storage, Inherent, Event, ValidateUnsigned, } = 20, - ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21, + ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21, Balances: pallet_balances::{Pallet, Call, Storage, Config, Event} = 30, Assets: pallet_assets::{Pallet, Call, Storage, Event} = 31, Aura: pallet_aura::{Pallet, Config}, - AuraExt: cumulus_pallet_aura_ext::{Pallet, Config}, + AuraExt: cumulus_pallet_aura_ext::{Pallet, Config}, // XCM helpers. XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event} = 50, - PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin, Config} = 51, + PolkadotXcm: pallet_xcm::{Pallet, Call, Event, Origin, Config} = 51, CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event, Origin} = 52, DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event} = 53, @@ -592,7 +587,7 @@ construct_runtime! { /// Balance of an account. pub type Balance = u128; /// Index of a transaction in the chain. -pub type Index = u32; +pub type Nonce = u32; /// A hash of some data used by the chain. pub type Hash = sp_core::H256; /// An index to a block. @@ -729,8 +724,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/polkadot-parachain/Cargo.toml b/polkadot-parachain/Cargo.toml index 7c01d6f32bc..f4cc976f91c 100644 --- a/polkadot-parachain/Cargo.toml +++ b/polkadot-parachain/Cargo.toml @@ -12,13 +12,13 @@ path = "src/main.rs" [dependencies] async-trait = "0.1.71" -clap = { version = "4.3.11", features = ["derive"] } +clap = { version = "4.3.12", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0" } futures = "0.3.28" hex-literal = "0.4.1" log = "0.4.19" -serde = { version = "1.0.167", features = ["derive"] } -serde_json = "1.0.100" +serde = { version = "1.0.171", features = ["derive"] } +serde_json = "1.0.102" # Local rococo-parachain-runtime = { path = "../parachains/runtimes/testing/rococo-parachain" } diff --git a/polkadot-parachain/src/chain_spec/asset_hubs.rs b/polkadot-parachain/src/chain_spec/asset_hubs.rs index 1d6d501277c..0523c3b7e65 100644 --- a/polkadot-parachain/src/chain_spec/asset_hubs.rs +++ b/polkadot-parachain/src/chain_spec/asset_hubs.rs @@ -219,6 +219,7 @@ fn asset_hub_polkadot_genesis( code: asset_hub_polkadot_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: asset_hub_polkadot_runtime::BalancesConfig { balances: endowed_accounts @@ -227,7 +228,10 @@ fn asset_hub_polkadot_genesis( .map(|k| (k, ASSET_HUB_POLKADOT_ED * 4096)) .collect(), }, - parachain_info: asset_hub_polkadot_runtime::ParachainInfoConfig { parachain_id: id }, + parachain_info: asset_hub_polkadot_runtime::ParachainInfoConfig { + parachain_id: id, + ..Default::default() + }, collator_selection: asset_hub_polkadot_runtime::CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: ASSET_HUB_POLKADOT_ED * 16, @@ -252,6 +256,7 @@ fn asset_hub_polkadot_genesis( parachain_system: Default::default(), polkadot_xcm: asset_hub_polkadot_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, } } @@ -408,6 +413,7 @@ fn asset_hub_kusama_genesis( code: asset_hub_kusama_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: asset_hub_kusama_runtime::BalancesConfig { balances: endowed_accounts @@ -416,7 +422,10 @@ fn asset_hub_kusama_genesis( .map(|k| (k, ASSET_HUB_KUSAMA_ED * 524_288)) .collect(), }, - parachain_info: asset_hub_kusama_runtime::ParachainInfoConfig { parachain_id: id }, + parachain_info: asset_hub_kusama_runtime::ParachainInfoConfig { + parachain_id: id, + ..Default::default() + }, collator_selection: asset_hub_kusama_runtime::CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: ASSET_HUB_KUSAMA_ED * 16, @@ -439,6 +448,7 @@ fn asset_hub_kusama_genesis( parachain_system: Default::default(), polkadot_xcm: asset_hub_kusama_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, } } @@ -592,6 +602,7 @@ fn asset_hub_westend_genesis( code: asset_hub_westend_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: asset_hub_westend_runtime::BalancesConfig { balances: endowed_accounts @@ -600,7 +611,10 @@ fn asset_hub_westend_genesis( .map(|k| (k, ASSET_HUB_WESTEND_ED * 4096)) .collect(), }, - parachain_info: asset_hub_westend_runtime::ParachainInfoConfig { parachain_id: id }, + parachain_info: asset_hub_westend_runtime::ParachainInfoConfig { + parachain_id: id, + ..Default::default() + }, collator_selection: asset_hub_westend_runtime::CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: ASSET_HUB_WESTEND_ED * 16, @@ -625,6 +639,7 @@ fn asset_hub_westend_genesis( parachain_system: Default::default(), polkadot_xcm: asset_hub_westend_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, } } diff --git a/polkadot-parachain/src/chain_spec/bridge_hubs.rs b/polkadot-parachain/src/chain_spec/bridge_hubs.rs index 1a025e08f73..911368073d5 100644 --- a/polkadot-parachain/src/chain_spec/bridge_hubs.rs +++ b/polkadot-parachain/src/chain_spec/bridge_hubs.rs @@ -274,11 +274,15 @@ pub mod rococo { code: bridge_hub_rococo_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: bridge_hub_rococo_runtime::BalancesConfig { balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), }, - parachain_info: bridge_hub_rococo_runtime::ParachainInfoConfig { parachain_id: id }, + parachain_info: bridge_hub_rococo_runtime::ParachainInfoConfig { + parachain_id: id, + ..Default::default() + }, collator_selection: bridge_hub_rococo_runtime::CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: BRIDGE_HUB_ROCOCO_ED * 16, @@ -301,6 +305,7 @@ pub mod rococo { parachain_system: Default::default(), polkadot_xcm: bridge_hub_rococo_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, bridge_wococo_grandpa: bridge_hub_rococo_runtime::BridgeWococoGrandpaConfig { owner: bridges_pallet_owner.clone(), @@ -440,6 +445,7 @@ pub mod kusama { code: bridge_hub_kusama_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: bridge_hub_kusama_runtime::BalancesConfig { balances: endowed_accounts @@ -448,7 +454,10 @@ pub mod kusama { .map(|k| (k, BRIDGE_HUB_KUSAMA_ED * 524_288)) .collect(), }, - parachain_info: bridge_hub_kusama_runtime::ParachainInfoConfig { parachain_id: id }, + parachain_info: bridge_hub_kusama_runtime::ParachainInfoConfig { + parachain_id: id, + ..Default::default() + }, collator_selection: bridge_hub_kusama_runtime::CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: BRIDGE_HUB_KUSAMA_ED * 16, @@ -471,6 +480,7 @@ pub mod kusama { parachain_system: Default::default(), polkadot_xcm: bridge_hub_kusama_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, } } @@ -572,6 +582,7 @@ pub mod polkadot { code: bridge_hub_polkadot_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: bridge_hub_polkadot_runtime::BalancesConfig { balances: endowed_accounts @@ -580,7 +591,10 @@ pub mod polkadot { .map(|k| (k, BRIDGE_HUB_POLKADOT_ED * 4096)) .collect(), }, - parachain_info: bridge_hub_polkadot_runtime::ParachainInfoConfig { parachain_id: id }, + parachain_info: bridge_hub_polkadot_runtime::ParachainInfoConfig { + parachain_id: id, + ..Default::default() + }, collator_selection: bridge_hub_polkadot_runtime::CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: BRIDGE_HUB_POLKADOT_ED * 16, @@ -603,6 +617,7 @@ pub mod polkadot { parachain_system: Default::default(), polkadot_xcm: bridge_hub_polkadot_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, } } diff --git a/polkadot-parachain/src/chain_spec/collectives.rs b/polkadot-parachain/src/chain_spec/collectives.rs index bc322924c20..82c925c5d49 100644 --- a/polkadot-parachain/src/chain_spec/collectives.rs +++ b/polkadot-parachain/src/chain_spec/collectives.rs @@ -138,6 +138,7 @@ fn collectives_polkadot_genesis( code: collectives_polkadot_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: collectives_polkadot_runtime::BalancesConfig { balances: endowed_accounts @@ -146,7 +147,10 @@ fn collectives_polkadot_genesis( .map(|k| (k, COLLECTIVES_POLKADOT_ED * 4096)) .collect(), }, - parachain_info: collectives_polkadot_runtime::ParachainInfoConfig { parachain_id: id }, + parachain_info: collectives_polkadot_runtime::ParachainInfoConfig { + parachain_id: id, + ..Default::default() + }, collator_selection: collectives_polkadot_runtime::CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: COLLECTIVES_POLKADOT_ED * 16, @@ -171,6 +175,7 @@ fn collectives_polkadot_genesis( parachain_system: Default::default(), polkadot_xcm: collectives_polkadot_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, alliance: Default::default(), alliance_motion: Default::default(), diff --git a/polkadot-parachain/src/chain_spec/contracts.rs b/polkadot-parachain/src/chain_spec/contracts.rs index 75d3951824f..b8af83a0d70 100644 --- a/polkadot-parachain/src/chain_spec/contracts.rs +++ b/polkadot-parachain/src/chain_spec/contracts.rs @@ -240,11 +240,15 @@ fn contracts_rococo_genesis( code: contracts_rococo_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: contracts_rococo_runtime::BalancesConfig { balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), }, - parachain_info: contracts_rococo_runtime::ParachainInfoConfig { parachain_id: id }, + parachain_info: contracts_rococo_runtime::ParachainInfoConfig { + parachain_id: id, + ..Default::default() + }, collator_selection: contracts_rococo_runtime::CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: CONTRACTS_ROCOCO_ED * 16, @@ -269,6 +273,7 @@ fn contracts_rococo_genesis( parachain_system: Default::default(), polkadot_xcm: contracts_rococo_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, sudo: contracts_rococo_runtime::SudoConfig { key: Some( diff --git a/polkadot-parachain/src/chain_spec/glutton.rs b/polkadot-parachain/src/chain_spec/glutton.rs index d6fddde0adc..5ea51c3a918 100644 --- a/polkadot-parachain/src/chain_spec/glutton.rs +++ b/polkadot-parachain/src/chain_spec/glutton.rs @@ -84,13 +84,15 @@ fn glutton_genesis(parachain_id: ParaId) -> glutton_runtime::RuntimeGenesisConfi code: glutton_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, - parachain_info: glutton_runtime::ParachainInfoConfig { parachain_id }, + parachain_info: glutton_runtime::ParachainInfoConfig { parachain_id, ..Default::default() }, parachain_system: Default::default(), glutton: glutton_runtime::GluttonConfig { compute: Default::default(), storage: Default::default(), trash_data_count: Default::default(), + ..Default::default() }, sudo: glutton_runtime::SudoConfig { key: Some(get_account_id_from_seed::("Alice")), diff --git a/polkadot-parachain/src/chain_spec/penpal.rs b/polkadot-parachain/src/chain_spec/penpal.rs index 7373c4d9f6f..264898991eb 100644 --- a/polkadot-parachain/src/chain_spec/penpal.rs +++ b/polkadot-parachain/src/chain_spec/penpal.rs @@ -90,6 +90,7 @@ fn penpal_testnet_genesis( code: penpal_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: penpal_runtime::BalancesConfig { balances: endowed_accounts @@ -98,7 +99,10 @@ fn penpal_testnet_genesis( .map(|k| (k, penpal_runtime::EXISTENTIAL_DEPOSIT * 4096)) .collect(), }, - parachain_info: penpal_runtime::ParachainInfoConfig { parachain_id: id }, + parachain_info: penpal_runtime::ParachainInfoConfig { + parachain_id: id, + ..Default::default() + }, collator_selection: penpal_runtime::CollatorSelectionConfig { invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), candidacy_bond: penpal_runtime::EXISTENTIAL_DEPOSIT * 16, @@ -123,6 +127,7 @@ fn penpal_testnet_genesis( parachain_system: Default::default(), polkadot_xcm: penpal_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, sudo: penpal_runtime::SudoConfig { key: Some(get_account_id_from_seed::("Alice")), diff --git a/polkadot-parachain/src/chain_spec/rococo_parachain.rs b/polkadot-parachain/src/chain_spec/rococo_parachain.rs index 67af1e876cd..1ed1a3e35fb 100644 --- a/polkadot-parachain/src/chain_spec/rococo_parachain.rs +++ b/polkadot-parachain/src/chain_spec/rococo_parachain.rs @@ -105,17 +105,22 @@ pub(crate) fn testnet_genesis( code: rococo_parachain_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, balances: rococo_parachain_runtime::BalancesConfig { balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), }, sudo: rococo_parachain_runtime::SudoConfig { key: Some(root_key) }, - parachain_info: rococo_parachain_runtime::ParachainInfoConfig { parachain_id: id }, + parachain_info: rococo_parachain_runtime::ParachainInfoConfig { + parachain_id: id, + ..Default::default() + }, aura: rococo_parachain_runtime::AuraConfig { authorities: initial_authorities }, aura_ext: Default::default(), parachain_system: Default::default(), polkadot_xcm: rococo_parachain_runtime::PolkadotXcmConfig { safe_xcm_version: Some(SAFE_XCM_VERSION), + ..Default::default() }, } } diff --git a/polkadot-parachain/src/chain_spec/seedling.rs b/polkadot-parachain/src/chain_spec/seedling.rs index 996ab662b12..4a43b4cf476 100644 --- a/polkadot-parachain/src/chain_spec/seedling.rs +++ b/polkadot-parachain/src/chain_spec/seedling.rs @@ -53,9 +53,13 @@ fn seedling_testnet_genesis( code: seedling_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, sudo: seedling_runtime::SudoConfig { key: Some(root_key) }, - parachain_info: seedling_runtime::ParachainInfoConfig { parachain_id }, + parachain_info: seedling_runtime::ParachainInfoConfig { + parachain_id, + ..Default::default() + }, parachain_system: Default::default(), } } diff --git a/polkadot-parachain/src/chain_spec/shell.rs b/polkadot-parachain/src/chain_spec/shell.rs index ae2bd6942c0..eca605b10df 100644 --- a/polkadot-parachain/src/chain_spec/shell.rs +++ b/polkadot-parachain/src/chain_spec/shell.rs @@ -43,8 +43,9 @@ fn shell_testnet_genesis(parachain_id: ParaId) -> shell_runtime::RuntimeGenesisC code: shell_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, - parachain_info: shell_runtime::ParachainInfoConfig { parachain_id }, + parachain_info: shell_runtime::ParachainInfoConfig { parachain_id, ..Default::default() }, parachain_system: Default::default(), } } diff --git a/polkadot-parachain/src/rpc.rs b/polkadot-parachain/src/rpc.rs index c2eeaf38608..7c885ee1537 100644 --- a/polkadot-parachain/src/rpc.rs +++ b/polkadot-parachain/src/rpc.rs @@ -20,7 +20,7 @@ use std::sync::Arc; -use parachains_common::{AccountId, Balance, Block, Index as Nonce}; +use parachains_common::{AccountId, Balance, Block, Nonce}; use sc_client_api::AuxStore; pub use sc_rpc::{DenyUnsafe, SubscriptionTaskExecutor}; use sc_transaction_pool_api::TransactionPool; diff --git a/polkadot-parachain/src/service.rs b/polkadot-parachain/src/service.rs index 552c6b4a832..826fa886121 100644 --- a/polkadot-parachain/src/service.rs +++ b/polkadot-parachain/src/service.rs @@ -34,7 +34,7 @@ use sp_core::Pair; use jsonrpsee::RpcModule; use crate::rpc; -pub use parachains_common::{AccountId, Balance, Block, BlockNumber, Hash, Header, Index as Nonce}; +pub use parachains_common::{AccountId, Balance, Block, BlockNumber, Hash, Header, Nonce}; use cumulus_client_consensus_relay_chain::Verifier as RelayChainVerifier; use futures::lock::Mutex; diff --git a/primitives/aura/Cargo.toml b/primitives/aura/Cargo.toml new file mode 100644 index 00000000000..5d3862b18fd --- /dev/null +++ b/primitives/aura/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "cumulus-primitives-aura" +version = "0.1.0" +authors = ["Parity Technologies "] +edition = "2021" + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive" ] } + +# Substrate +sp-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-consensus-aura = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } +sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v1.0.0" } + +# Polkadot +polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v1.0.0" } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v1.0.0" } + +[features] +default = [ "std" ] +std = [ + "codec/std", + "sp-api/std", + "sp-consensus-aura/std", + "sp-runtime/std", + "sp-std/std", + "polkadot-core-primitives/std", + "polkadot-primitives/std", +] diff --git a/primitives/aura/src/lib.rs b/primitives/aura/src/lib.rs new file mode 100644 index 00000000000..a0d7a0206a6 --- /dev/null +++ b/primitives/aura/src/lib.rs @@ -0,0 +1,50 @@ +// Copyright 2023 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Substrate is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Substrate is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Core primitives for Aura in Cumulus. +//! +//! In particular, this exposes the [`AuraUnincludedSegmentApi`] which is used to regulate +//! the behavior of Aura within a parachain context. + +#![cfg_attr(not(feature = "std"), no_std)] + +pub use sp_consensus_aura::Slot; + +sp_api::decl_runtime_apis! { + /// This runtime API is used to inform potential block authors whether they will + /// have the right to author at a slot, assuming they have claimed the slot. + /// + /// In particular, this API allows Aura-based parachains to regulate their "unincluded segment", + /// which is the section of the head of the chain which has not yet been made available in the + /// relay chain. + /// + /// When the unincluded segment is short, Aura chains will allow authors to create multiple + /// blocks per slot in order to build a backlog. When it is saturated, this API will limit + /// the amount of blocks that can be created. + pub trait AuraUnincludedSegmentApi { + /// Whether it is legal to extend the chain, assuming the given block is the most + /// recently included one as-of the relay parent that will be built against, and + /// the given slot. + /// + /// This should be consistent with the logic the runtime uses when validating blocks to + /// avoid issues. + /// + /// When the unincluded segment is empty, i.e. `included_hash == at`, where at is the block + /// whose state we are querying against, this must always return `true` as long as the slot + /// is more recent than the included block itself. + fn can_build_upon(included_hash: Block::Hash, slot: Slot) -> bool; + } +} diff --git a/scripts/benchmarks-ci.sh b/scripts/benchmarks-ci.sh index fcf0cc61984..0456ad4c425 100755 --- a/scripts/benchmarks-ci.sh +++ b/scripts/benchmarks-ci.sh @@ -41,7 +41,6 @@ do $artifactsDir/polkadot-parachain benchmark pallet \ $extra_args \ --chain=$benchmarkRuntimeName \ - --execution=wasm \ --wasm-execution=compiled \ --pallet=$pallet \ --extrinsic='*' \ diff --git a/test/runtime/src/lib.rs b/test/runtime/src/lib.rs index 25841acb11b..7e2fd9695fd 100644 --- a/test/runtime/src/lib.rs +++ b/test/runtime/src/lib.rs @@ -185,15 +185,13 @@ impl frame_system::Config for Runtime { /// The lookup mechanism to get account ID from whatever is passed in dispatchers. type Lookup = IdentityLookup; /// The index type for storing how many extrinsics an account has signed. - type Index = Index; - /// The index type for blocks. - type BlockNumber = BlockNumber; + type Nonce = Nonce; /// The type for hashing blocks and tries. type Hash = Hash; /// The hashing algorithm used. type Hashing = BlakeTwo256; - /// The header type. - type Header = generic::Header; + /// The block type. + type Block = Block; /// The ubiquitous event type. type RuntimeEvent = RuntimeEvent; /// The ubiquitous origin type. @@ -294,10 +292,7 @@ parameter_types! { impl test_pallet::Config for Runtime {} construct_runtime! { - pub enum Runtime where - Block = Block, - NodeBlock = NodeBlock, - UncheckedExtrinsic = UncheckedExtrinsic, + pub enum Runtime { System: frame_system, ParachainSystem: cumulus_pallet_parachain_system, @@ -311,7 +306,7 @@ construct_runtime! { } /// Index of a transaction in the chain. -pub type Index = u32; +pub type Nonce = u32; /// A hash of some data used by the chain. pub type Hash = sp_core::H256; /// Balance of an account. @@ -408,8 +403,8 @@ impl_runtime_apis! { } } - impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { - fn account_nonce(account: AccountId) -> Index { + impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { + fn account_nonce(account: AccountId) -> Nonce { System::account_nonce(account) } } diff --git a/test/service/Cargo.toml b/test/service/Cargo.toml index 89feaa53b47..0c930fb6523 100644 --- a/test/service/Cargo.toml +++ b/test/service/Cargo.toml @@ -10,12 +10,12 @@ path = "src/main.rs" [dependencies] async-trait = "0.1.71" -clap = { version = "4.3.11", features = ["derive"] } +clap = { version = "4.3.12", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0" } criterion = { version = "0.5.1", features = [ "async_tokio" ] } jsonrpsee = { version = "0.16.2", features = ["server"] } rand = "0.8.5" -serde = { version = "1.0.167", features = ["derive"] } +serde = { version = "1.0.171", features = ["derive"] } tokio = { version = "1.29.1", features = ["macros"] } tracing = "0.1.37" url = "2.4.0" diff --git a/test/service/benches/validate_block.rs b/test/service/benches/validate_block.rs index 3f4c39e5aa9..f3b4d0b1214 100644 --- a/test/service/benches/validate_block.rs +++ b/test/service/benches/validate_block.rs @@ -79,8 +79,7 @@ fn benchmark_block_validation(c: &mut Criterion) { // Each account should only be included in one transfer. let (src_accounts, dst_accounts, account_ids) = utils::create_benchmark_accounts(); - let mut test_client_builder = TestClientBuilder::with_default_backend() - .set_execution_strategy(sc_client_api::ExecutionStrategy::AlwaysWasm); + let mut test_client_builder = TestClientBuilder::with_default_backend(); let genesis_init = test_client_builder.genesis_init_mut(); *genesis_init = cumulus_test_client::GenesisParameters { endowed_accounts: account_ids }; let client = test_client_builder.build_with_native_executor(None).0; diff --git a/test/service/benches/validate_block_glutton.rs b/test/service/benches/validate_block_glutton.rs index 5f5fda07168..0e049d8665d 100644 --- a/test/service/benches/validate_block_glutton.rs +++ b/test/service/benches/validate_block_glutton.rs @@ -61,8 +61,7 @@ fn benchmark_block_validation(c: &mut Criterion) { let runtime = tokio::runtime::Runtime::new().expect("creating tokio runtime doesn't fail; qed"); let endowed_accounts = vec![AccountId::from(Alice.public())]; - let mut test_client_builder = TestClientBuilder::with_default_backend() - .set_execution_strategy(sc_client_api::ExecutionStrategy::NativeElseWasm); + let mut test_client_builder = TestClientBuilder::with_default_backend(); let genesis_init = test_client_builder.genesis_init_mut(); *genesis_init = cumulus_test_client::GenesisParameters { endowed_accounts }; diff --git a/test/service/src/chain_spec.rs b/test/service/src/chain_spec.rs index 90972aa865f..3d72d0db3ab 100644 --- a/test/service/src/chain_spec.rs +++ b/test/service/src/chain_spec.rs @@ -143,6 +143,7 @@ pub fn testnet_genesis( code: cumulus_test_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), + ..Default::default() }, glutton: Default::default(), parachain_system: Default::default(), diff --git a/test/service/src/lib.rs b/test/service/src/lib.rs index e45ba47f6eb..d597997c276 100644 --- a/test/service/src/lib.rs +++ b/test/service/src/lib.rs @@ -55,7 +55,6 @@ use polkadot_node_subsystem::{errors::RecoveryError, messages::AvailabilityRecov use polkadot_overseer::Handle as OverseerHandle; use polkadot_primitives::{CollatorPair, Hash as PHash, PersistedValidationData}; use polkadot_service::ProvideRuntimeApi; -use sc_client_api::execution_extensions::ExecutionStrategies; use sc_consensus::ImportQueue; use sc_network::{ config::{FullNetworkConfiguration, TransportConfig}, @@ -758,13 +757,6 @@ pub fn node_config( wasm_method: WasmExecutionMethod::Compiled { instantiation_strategy: sc_executor_wasmtime::InstantiationStrategy::PoolingCopyOnWrite, }, - execution_strategies: ExecutionStrategies { - syncing: sc_client_api::ExecutionStrategy::AlwaysWasm, - importing: sc_client_api::ExecutionStrategy::AlwaysWasm, - block_construction: sc_client_api::ExecutionStrategy::AlwaysWasm, - offchain_worker: sc_client_api::ExecutionStrategy::AlwaysWasm, - other: sc_client_api::ExecutionStrategy::AlwaysWasm, - }, rpc_addr: None, rpc_max_connections: Default::default(), rpc_cors: None,