From 29343718108ff06bf885ad53f35c9adbef40737e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Thu, 11 Feb 2021 16:07:41 +0100 Subject: [PATCH 1/9] Move consensus to consensus-common crate --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- client/consensus/{ => common}/Cargo.toml | 8 ++++---- client/consensus/{ => common}/src/import_queue.rs | 0 client/consensus/{ => common}/src/lib.rs | 0 client/service/Cargo.toml | 2 +- client/service/src/lib.rs | 2 +- rococo-parachains/Cargo.toml | 2 +- rococo-parachains/src/service.rs | 2 +- test/service/Cargo.toml | 2 +- test/service/src/lib.rs | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) rename client/consensus/{ => common}/Cargo.toml (87%) rename client/consensus/{ => common}/src/import_queue.rs (100%) rename client/consensus/{ => common}/src/lib.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 7df4185a1b5..f5506b6f6b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1106,7 +1106,7 @@ dependencies = [ ] [[package]] -name = "cumulus-client-consensus" +name = "cumulus-client-consensus-common" version = "0.1.0" dependencies = [ "cumulus-test-client", @@ -1164,7 +1164,7 @@ name = "cumulus-client-service" version = "0.1.0" dependencies = [ "cumulus-client-collator", - "cumulus-client-consensus", + "cumulus-client-consensus-common", "cumulus-primitives-core", "futures 0.3.12", "parity-scale-codec", @@ -1378,7 +1378,7 @@ dependencies = [ name = "cumulus-test-service" version = "0.1.0" dependencies = [ - "cumulus-client-consensus", + "cumulus-client-consensus-common", "cumulus-client-network", "cumulus-client-service", "cumulus-primitives-core", @@ -6897,7 +6897,7 @@ version = "0.1.0" dependencies = [ "assert_cmd", "cumulus-client-collator", - "cumulus-client-consensus", + "cumulus-client-consensus-common", "cumulus-client-network", "cumulus-client-service", "cumulus-primitives-core", diff --git a/Cargo.toml b/Cargo.toml index 67ab581a54e..c2cd0c1332b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] members = [ - "client/consensus", + "client/consensus/common", "client/network", "client/service", "pallets/parachain-system", diff --git a/client/consensus/Cargo.toml b/client/consensus/common/Cargo.toml similarity index 87% rename from client/consensus/Cargo.toml rename to client/consensus/common/Cargo.toml index 47067d43cdb..17cd99b8cae 100644 --- a/client/consensus/Cargo.toml +++ b/client/consensus/common/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "cumulus-client-consensus" -description = "Proxy Polkadot's consensus as a consensus engine for Substrate" +name = "cumulus-client-consensus-common" +description = "Cumulus specific common consensus implementations" version = "0.1.0" authors = ["Parity Technologies "] edition = "2018" @@ -32,8 +32,8 @@ tracing = "0.1.22" sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" } # Cumulus dependencies -cumulus-test-runtime = { path = "../../test/runtime" } -cumulus-test-client = { path = "../../test/client" } +cumulus-test-runtime = { path = "../../../test/runtime" } +cumulus-test-client = { path = "../../../test/client" } # Other deps futures-timer = "3.0.2" diff --git a/client/consensus/src/import_queue.rs b/client/consensus/common/src/import_queue.rs similarity index 100% rename from client/consensus/src/import_queue.rs rename to client/consensus/common/src/import_queue.rs diff --git a/client/consensus/src/lib.rs b/client/consensus/common/src/lib.rs similarity index 100% rename from client/consensus/src/lib.rs rename to client/consensus/common/src/lib.rs diff --git a/client/service/Cargo.toml b/client/service/Cargo.toml index 4d1e575a1fe..ddee4895060 100644 --- a/client/service/Cargo.toml +++ b/client/service/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dependencies] # Cumulus dependencies -cumulus-client-consensus = { path = "../consensus" } +cumulus-client-consensus-common = { path = "../consensus/common" } cumulus-client-collator = { path = "../collator" } cumulus-primitives-core = { path = "../../primitives/core" } diff --git a/client/service/src/lib.rs b/client/service/src/lib.rs index 9bafb063bac..b1dad8744ff 100644 --- a/client/service/src/lib.rs +++ b/client/service/src/lib.rs @@ -291,7 +291,7 @@ where Api: RuntimeApiCollection, PClient: AbstractClient + 'static, { - let consensus = cumulus_client_consensus::run_parachain_consensus( + let consensus = cumulus_client_consensus_common::run_parachain_consensus( self.para_id, self.client, client, diff --git a/rococo-parachains/Cargo.toml b/rococo-parachains/Cargo.toml index 253022518bb..e7d144423cb 100644 --- a/rococo-parachains/Cargo.toml +++ b/rococo-parachains/Cargo.toml @@ -56,7 +56,7 @@ sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "maste jsonrpc-core = "15.1.0" # Cumulus dependencies -cumulus-client-consensus = { path = "../client/consensus" } +cumulus-client-consensus-common = { path = "../client/consensus/common" } cumulus-client-collator = { path = "../client/collator" } cumulus-client-service = { path = "../client/service" } cumulus-client-network = { path = "../client/network" } diff --git a/rococo-parachains/src/service.rs b/rococo-parachains/src/service.rs index 16aebc21d5e..c3b4b292d7a 100644 --- a/rococo-parachains/src/service.rs +++ b/rococo-parachains/src/service.rs @@ -70,7 +70,7 @@ pub fn new_partial( client.clone(), ); - let import_queue = cumulus_client_consensus::import_queue::import_queue( + let import_queue = cumulus_client_consensus_common::import_queue::import_queue( client.clone(), client.clone(), inherent_data_providers.clone(), diff --git a/test/service/Cargo.toml b/test/service/Cargo.toml index 768d9c6eabf..132c18165b5 100644 --- a/test/service/Cargo.toml +++ b/test/service/Cargo.toml @@ -43,7 +43,7 @@ polkadot-test-service = { git = "https://github.com/paritytech/polkadot", branch polkadot-overseer = { git = "https://github.com/paritytech/polkadot", branch = "master" } # Cumulus -cumulus-client-consensus = { path = "../../client/consensus" } +cumulus-client-consensus-common = { path = "../../client/consensus/common" } cumulus-client-network = { path = "../../client/network" } cumulus-client-service = { path = "../../client/service" } cumulus-primitives-core = { path = "../../primitives/core" } diff --git a/test/service/src/lib.rs b/test/service/src/lib.rs index 6f17a38c8fc..9f35eda93a1 100644 --- a/test/service/src/lib.rs +++ b/test/service/src/lib.rs @@ -93,7 +93,7 @@ pub fn new_partial( client.clone(), ); - let import_queue = cumulus_client_consensus::import_queue::import_queue( + let import_queue = cumulus_client_consensus_common::import_queue::import_queue( client.clone(), client.clone(), inherent_data_providers.clone(), From b9a3832622e70f61ae190e755b3a0c879d358b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Thu, 11 Feb 2021 20:30:21 +0100 Subject: [PATCH 2/9] Move the parachain consensus out of the collator --- Cargo.lock | 325 +---------------------- client/collator/Cargo.toml | 11 +- client/collator/src/lib.rs | 404 +++++++---------------------- client/consensus/common/Cargo.toml | 2 + client/consensus/common/src/lib.rs | 35 ++- client/service/src/lib.rs | 108 +++----- rococo-parachains/src/service.rs | 2 +- test/service/src/lib.rs | 30 +-- 8 files changed, 182 insertions(+), 735 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f5506b6f6b4..cd6a7ecefda 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1073,42 +1073,40 @@ dependencies = [ name = "cumulus-client-collator" version = "0.1.0" dependencies = [ + "async-trait", + "cumulus-client-consensus-common", "cumulus-client-network", "cumulus-primitives-core", - "cumulus-primitives-parachain-inherent", "cumulus-test-client", "cumulus-test-runtime", "env_logger", "futures 0.3.12", - "log", "parity-scale-codec", "parking_lot 0.9.0", "polkadot-node-primitives", "polkadot-node-subsystem", - "polkadot-node-subsystem-test-helpers", "polkadot-overseer", "polkadot-parachain", "polkadot-primitives", - "polkadot-service", - "polkadot-test-client", "sc-cli", "sc-client-api", "sp-api", "sp-blockchain", "sp-consensus", "sp-core", - "sp-inherents", "sp-io", "sp-keyring", "sp-runtime", "sp-state-machine", "substrate-test-client", + "tracing", ] [[package]] name = "cumulus-client-consensus-common" version = "0.1.0" dependencies = [ + "async-trait", "cumulus-test-client", "cumulus-test-runtime", "futures 0.3.12", @@ -1125,6 +1123,7 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-tracing", + "sp-trie", "substrate-prometheus-endpoint", "tokio 0.1.22", "tracing", @@ -3808,15 +3807,6 @@ dependencies = [ "parity-util-mem", ] -[[package]] -name = "memory-lru" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beeb98b3d1ed2c0054bd81b5ba949a0243c3ccad751d45ea898fa8059fa2860a" -dependencies = [ - "lru", -] - [[package]] name = "memory_units" version = "0.3.0" @@ -5246,75 +5236,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "989d43012e2ca1c4a02507c67282691a0a3207f9dc67cec596b43fe925b3d325" -[[package]] -name = "polkadot-approval-distribution" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "futures 0.3.12", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "tracing", - "tracing-futures", -] - -[[package]] -name = "polkadot-availability-bitfield-distribution" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "futures 0.3.12", - "parity-scale-codec", - "polkadot-node-network-protocol", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "tracing", - "tracing-futures", -] - -[[package]] -name = "polkadot-availability-distribution" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "futures 0.3.12", - "parity-scale-codec", - "polkadot-erasure-coding", - "polkadot-node-network-protocol", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-core", - "sp-keystore", - "thiserror", - "tracing", - "tracing-futures", -] - -[[package]] -name = "polkadot-availability-recovery" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "futures 0.3.12", - "futures-timer 3.0.2", - "lru", - "polkadot-erasure-coding", - "polkadot-node-network-protocol", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "rand 0.8.3", - "streamunordered", - "thiserror", - "tracing", - "tracing-futures", -] - [[package]] name = "polkadot-cli" version = "0.8.28" @@ -5335,21 +5256,6 @@ dependencies = [ "tracing-futures", ] -[[package]] -name = "polkadot-collator-protocol" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "futures 0.3.12", - "polkadot-node-network-protocol", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "thiserror", - "tracing", - "tracing-futures", -] - [[package]] name = "polkadot-core-primitives" version = "0.7.30" @@ -5375,41 +5281,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "polkadot-network-bridge" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "async-trait", - "futures 0.3.12", - "parity-scale-codec", - "polkadot-node-network-protocol", - "polkadot-node-subsystem", - "polkadot-primitives", - "sc-authority-discovery", - "sc-network", - "strum", - "tracing", - "tracing-futures", -] - -[[package]] -name = "polkadot-node-collation-generation" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "futures 0.3.12", - "polkadot-erasure-coding", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-core", - "thiserror", - "tracing", - "tracing-futures", -] - [[package]] name = "polkadot-node-core-av-store" version = "0.1.0" @@ -5432,87 +5303,6 @@ dependencies = [ "tracing-futures", ] -[[package]] -name = "polkadot-node-core-backing" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "bitvec", - "futures 0.3.12", - "polkadot-erasure-coding", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "polkadot-statement-table", - "sp-keystore", - "thiserror", - "tracing", - "tracing-futures", -] - -[[package]] -name = "polkadot-node-core-bitfield-signing" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "futures 0.3.12", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-keystore", - "thiserror", - "tracing", - "tracing-futures", - "wasm-timer", -] - -[[package]] -name = "polkadot-node-core-candidate-selection" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "futures 0.3.12", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-keystore", - "thiserror", - "tracing", - "tracing-futures", -] - -[[package]] -name = "polkadot-node-core-candidate-validation" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "futures 0.3.12", - "parity-scale-codec", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-parachain", - "polkadot-primitives", - "sp-core", - "tracing", - "tracing-futures", -] - -[[package]] -name = "polkadot-node-core-chain-api" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "futures 0.3.12", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-blockchain", - "tracing", - "tracing-futures", -] - [[package]] name = "polkadot-node-core-proposer" version = "0.1.0" @@ -5537,39 +5327,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "polkadot-node-core-provisioner" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "bitvec", - "futures 0.3.12", - "futures-timer 3.0.2", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "thiserror", - "tracing", - "tracing-futures", -] - -[[package]] -name = "polkadot-node-core-runtime-api" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "futures 0.3.12", - "memory-lru", - "parity-util-mem", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-api", - "sp-core", - "tracing", - "tracing-futures", -] - [[package]] name = "polkadot-node-jaeger" version = "0.1.0" @@ -5647,29 +5404,6 @@ dependencies = [ "tracing-futures", ] -[[package]] -name = "polkadot-node-subsystem-test-helpers" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "async-trait", - "futures 0.3.12", - "futures-timer 3.0.2", - "parity-scale-codec", - "parking_lot 0.11.1", - "pin-project 1.0.4", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "polkadot-statement-table", - "sc-network", - "smallvec 1.6.1", - "sp-core", - "tracing", - "tracing-futures", -] - [[package]] name = "polkadot-node-subsystem-util" version = "0.1.0" @@ -5738,21 +5472,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "polkadot-pov-distribution" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "futures 0.3.12", - "polkadot-node-network-protocol", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "thiserror", - "tracing", - "tracing-futures", -] - [[package]] name = "polkadot-primitives" version = "0.8.28" @@ -5963,32 +5682,16 @@ dependencies = [ "pallet-im-online", "pallet-staking", "pallet-transaction-payment-rpc-runtime-api", - "polkadot-approval-distribution", - "polkadot-availability-bitfield-distribution", - "polkadot-availability-distribution", - "polkadot-availability-recovery", - "polkadot-collator-protocol", - "polkadot-network-bridge", - "polkadot-node-collation-generation", "polkadot-node-core-av-store", - "polkadot-node-core-backing", - "polkadot-node-core-bitfield-signing", - "polkadot-node-core-candidate-selection", - "polkadot-node-core-candidate-validation", - "polkadot-node-core-chain-api", "polkadot-node-core-proposer", - "polkadot-node-core-provisioner", - "polkadot-node-core-runtime-api", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-parachain", - "polkadot-pov-distribution", "polkadot-primitives", "polkadot-rpc", "polkadot-runtime", "polkadot-runtime-parachains", - "polkadot-statement-distribution", "rococo-runtime", "sc-authority-discovery", "sc-block-builder", @@ -6031,24 +5734,6 @@ dependencies = [ "westend-runtime", ] -[[package]] -name = "polkadot-statement-distribution" -version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" -dependencies = [ - "arrayvec 0.5.2", - "futures 0.3.12", - "indexmap", - "polkadot-node-network-protocol", - "polkadot-node-primitives", - "polkadot-node-subsystem", - "polkadot-node-subsystem-util", - "polkadot-primitives", - "sp-staking", - "tracing", - "tracing-futures", -] - [[package]] name = "polkadot-statement-table" version = "0.8.28" diff --git a/client/collator/Cargo.toml b/client/collator/Cargo.toml index 87a4ce6b7e7..e2dcff7bb3f 100644 --- a/client/collator/Cargo.toml +++ b/client/collator/Cargo.toml @@ -10,14 +10,12 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" } # Polkadot dependencies -polkadot-service = { git = "https://github.com/paritytech/polkadot", features = [ "real-overseer" ], branch = "master" } polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "master" } polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master" } polkadot-node-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master" } @@ -26,14 +24,14 @@ polkadot-node-subsystem = { git = "https://github.com/paritytech/polkadot", bran # Cumulus dependencies cumulus-client-network = { path = "../network" } +cumulus-client-consensus-common = { path = "../consensus/common" } cumulus-primitives-core = { path = "../../primitives/core" } -cumulus-primitives-parachain-inherent = { path = "../../primitives/parachain-inherent" } # Other dependencies -log = "0.4.8" codec = { package = "parity-scale-codec", version = "2.0.0", features = [ "derive" ] } futures = { version = "0.3.1", features = ["compat"] } parking_lot = "0.9" +tracing = "0.1.22" [dev-dependencies] # Cumulus dependencies @@ -46,9 +44,6 @@ sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "mas sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "master" } substrate-test-client = { git = "https://github.com/paritytech/substrate", branch = "master" } -# Polkadot dependencies -polkadot-test-client = { git = "https://github.com/paritytech/polkadot", branch = "master" } -polkadot-node-subsystem-test-helpers = { git = "https://github.com/paritytech/polkadot", branch = "master" } - # Other dependencies env_logger = "0.7.1" +async-trait = "0.1.42" diff --git a/client/collator/src/lib.rs b/client/collator/src/lib.rs index ae9af02418c..c0072ae7fd5 100644 --- a/client/collator/src/lib.rs +++ b/client/collator/src/lib.rs @@ -20,7 +20,6 @@ use cumulus_client_network::WaitToAnnounce; use cumulus_primitives_core::{ well_known_keys, OutboundHrmpMessage, ParachainBlockData, PersistedValidationData, }; -use cumulus_primitives_parachain_inherent::ParachainInherentData; use sc_client_api::{BlockBackend, StateBackend}; use sp_consensus::{ @@ -28,13 +27,13 @@ use sp_consensus::{ ForkChoiceStrategy, Proposal, Proposer, RecordProof, }; use sp_core::traits::SpawnNamed; -use sp_inherents::{InherentData, InherentDataProviders}; use sp_runtime::{ generic::BlockId, traits::{BlakeTwo256, Block as BlockT, Header as HeaderT, Zero}, }; use sp_state_machine::InspectState; +use cumulus_client_consensus_common::ParachainConsensus; use polkadot_node_primitives::{Collation, CollationGenerationConfig}; use polkadot_node_subsystem::messages::{CollationGenerationMessage, CollatorProtocolMessage}; use polkadot_overseer::OverseerHandler; @@ -42,12 +41,9 @@ use polkadot_primitives::v1::{ Block as PBlock, BlockData, BlockNumber as PBlockNumber, CollatorPair, Hash as PHash, HeadData, Id as ParaId, PoV, UpwardMessage, }; -use polkadot_service::RuntimeApiCollection; use codec::{Decode, Encode}; -use log::{debug, error, info, trace}; - use futures::prelude::*; use std::{marker::PhantomData, sync::Arc, time::Duration}; @@ -61,73 +57,39 @@ type TransactionFor = const LOG_TARGET: &str = "cumulus-collator"; /// The implementation of the Cumulus `Collator`. -pub struct Collator { - para_id: ParaId, - proposer_factory: Arc>, - _phantom: PhantomData<(Block, PBackend)>, - inherent_data_providers: InherentDataProviders, - block_import: Arc>, +pub struct Collator { block_status: Arc, + parachain_consensus: Arc, wait_to_announce: Arc>>, backend: Arc, - polkadot_client: Arc, - polkadot_backend: Arc, } -impl Clone - for Collator -{ +impl Clone for Collator { fn clone(&self) -> Self { Self { - para_id: self.para_id.clone(), - proposer_factory: self.proposer_factory.clone(), - inherent_data_providers: self.inherent_data_providers.clone(), - _phantom: PhantomData, - block_import: self.block_import.clone(), block_status: self.block_status.clone(), wait_to_announce: self.wait_to_announce.clone(), backend: self.backend.clone(), - polkadot_client: self.polkadot_client.clone(), - polkadot_backend: self.polkadot_backend.clone(), + parachain_consensus: self.parachain_consensus.clone(), } } } -impl - Collator +impl Collator where Block: BlockT, - PF: Environment + 'static + Send, - PF::Proposer: Send, - BI: BlockImport< - Block, - Error = ConsensusError, - Transaction = >::Transaction, - > + Send - + Sync - + 'static, BS: BlockBackend, Backend: sc_client_api::Backend + 'static, - PBackend: sc_client_api::Backend + 'static, - PBackend::State: StateBackend, - PApi: RuntimeApiCollection, - PClient: polkadot_service::AbstractClient + 'static, - PBackend2: sc_client_api::Backend + 'static, - PBackend2::State: StateBackend, + PC: ParachainConsensus, { /// Create a new instance. fn new( - para_id: ParaId, - proposer_factory: PF, - inherent_data_providers: InherentDataProviders, overseer_handler: OverseerHandler, - block_import: BI, block_status: Arc, spawner: Arc, announce_block: Arc) + Send + Sync>, backend: Arc, - polkadot_client: Arc, - polkadot_backend: Arc, + parachain_consensus: PC, ) -> Self { let wait_to_announce = Arc::new(Mutex::new(WaitToAnnounce::new( spawner, @@ -136,108 +98,65 @@ where ))); Self { - para_id, - proposer_factory: Arc::new(Mutex::new(proposer_factory)), - inherent_data_providers, - _phantom: PhantomData, - block_import: Arc::new(Mutex::new(block_import)), block_status, wait_to_announce, backend, - polkadot_client, - polkadot_backend, + parachain_consensus: Arc::new(parachain_consensus), } } - /// Get the inherent data with validation function parameters injected - fn inherent_data( - &mut self, - validation_data: &PersistedValidationData, - relay_parent: PHash, - ) -> Option { - let mut inherent_data = self - .inherent_data_providers - .create_inherent_data() - .map_err(|e| { - error!( - target: LOG_TARGET, - "Failed to create inherent data: {:?}", e, - ) - }) - .ok()?; - - let parachain_inherent_data = ParachainInherentData::create_at( - relay_parent, - &*self.polkadot_client, - &*self.polkadot_backend, - validation_data, - self.para_id, - )?; - - inherent_data - .put_data( - cumulus_primitives_parachain_inherent::INHERENT_IDENTIFIER, - ¶chain_inherent_data, - ) - .map_err(|e| { - error!( - target: LOG_TARGET, - "Failed to put the system inherent into inherent data: {:?}", e, - ) - }) - .ok()?; - - Some(inherent_data) - } - /// Checks the status of the given block hash in the Parachain. /// /// Returns `true` if the block could be found and is good to be build on. fn check_block_status(&self, hash: Block::Hash, header: &Block::Header) -> bool { match self.block_status.block_status(&BlockId::Hash(hash)) { Ok(BlockStatus::Queued) => { - debug!( + tracing::debug!( target: LOG_TARGET, - "Skipping candidate production, because block `{:?}` is still queued for import.", - hash, + block_hash = ?hash, + "Skipping candidate production, because block is still queued for import.", ); false } Ok(BlockStatus::InChainWithState) => true, Ok(BlockStatus::InChainPruned) => { - error!( + tracing::error!( target: LOG_TARGET, - "Skipping candidate production, because block `{:?}` is already pruned!", hash, + "Skipping candidate production, because block `{:?}` is already pruned!", + hash, ); false } Ok(BlockStatus::KnownBad) => { - error!( + tracing::error!( target: LOG_TARGET, - "Block `{}` is tagged as known bad and is included in the relay chain! Skipping candidate production!", - hash, + block_hash = ?hash, + "Block is tagged as known bad and is included in the relay chain! Skipping candidate production!", ); false } Ok(BlockStatus::Unknown) => { if header.number().is_zero() { - error!( + tracing::error!( target: LOG_TARGET, - "Could not find the header `{:?}` of the genesis block in the database!", - hash, + block_hash = ?hash, + "Could not find the header of the genesis block in the database!", ); } else { - debug!( + tracing::debug!( target: LOG_TARGET, - "Skipping candidate production, because block `{:?}` is unknown.", hash, + block_hash = ?hash, + "Skipping candidate production, because block is unknown.", ); } false } Err(e) => { - error!( + tracing::error!( target: LOG_TARGET, - "Failed to get block status of `{:?}`: {:?}", hash, e, + block_hash = ?hash, + error = ?e, + "Failed to get block status.", ); false } @@ -257,9 +176,10 @@ where let state = match self.backend.state_at(BlockId::Hash(block_hash)) { Ok(state) => state, Err(e) => { - error!( + tracing::error!( target: LOG_TARGET, - "Failed to get state of the freshly built block: {:?}", e + error = ?e, + "Failed to get state of the freshly built block.", ); return None; } @@ -271,9 +191,10 @@ where match upward_messages.map(|v| Vec::::decode(&mut &v[..])) { Some(Ok(msgs)) => msgs, Some(Err(e)) => { - error!( + tracing::error!( target: LOG_TARGET, - "Failed to decode upward messages from the build block: {:?}", e + error = ?e, + "Failed to decode upward messages from the build block.", ); return None; } @@ -288,9 +209,10 @@ where match processed_downward_messages.map(|v| u32::decode(&mut &v[..])) { Some(Ok(processed_cnt)) => processed_cnt, Some(Err(e)) => { - error!( + tracing::error!( target: LOG_TARGET, - "Failed to decode the count of processed downward messages: {:?}", e + error = ?e, + "Failed to decode the count of processed downward message.", ); return None; } @@ -303,9 +225,10 @@ where { Some(Ok(horizontal_messages)) => horizontal_messages, Some(Err(e)) => { - error!( + tracing::error!( target: LOG_TARGET, - "Failed to decode the horizontal messages: {:?}", e + error = ?e, + "Failed to decode the horizontal messages.", ); return None; } @@ -316,9 +239,10 @@ where let hrmp_watermark = match hrmp_watermark.map(|v| PBlockNumber::decode(&mut &v[..])) { Some(Ok(hrmp_watermark)) => hrmp_watermark, Some(Err(e)) => { - error!( + tracing::error!( target: LOG_TARGET, - "Failed to decode the HRMP watermark: {:?}", e + error = ?e, + "Failed to decode the HRMP watermark." ); return None; } @@ -348,14 +272,15 @@ where relay_parent: PHash, validation_data: PersistedValidationData, ) -> Option { - trace!(target: LOG_TARGET, "Producing candidate"); + tracing::trace!(target: LOG_TARGET, "Producing candidate"); let last_head = match Block::Header::decode(&mut &validation_data.parent_head.0[..]) { Ok(x) => x, Err(e) => { - error!( + tracing::error!( target: LOG_TARGET, - "Could not decode the head data: {:?}", e + error = ?e, + "Could not decode the head data." ); return None; } @@ -366,78 +291,24 @@ where return None; } - info!( + tracing::info!( target: LOG_TARGET, - "Starting collation for relay parent {:?} on parent {:?}.", - relay_parent, - last_head_hash, + relay_parent = ?relay_parent, + at = ?last_head_hash, + "Starting collation.", ); - let proposer_future = self.proposer_factory.lock().init(&last_head); - - let proposer = proposer_future - .await - .map_err(|e| error!(target: LOG_TARGET, "Could not create proposer: {:?}", e,)) - .ok()?; - - let inherent_data = self.inherent_data(&validation_data, relay_parent)?; - - let Proposal { - block, - storage_changes, - proof, - } = proposer - .propose( - inherent_data, - Default::default(), - //TODO: Fix this. - Duration::from_millis(500), - RecordProof::Yes, - ) - .await - .map_err(|e| error!(target: LOG_TARGET, "Proposing failed: {:?}", e,)) - .ok()?; - - let proof = match proof { - Some(proof) => proof, - None => { - error!( - target: LOG_TARGET, - "Proposer did not return the requested proof.", - ); + let candidate = self + .parachain_consensus + .produce_candidate(&last_head, relay_parent, &validation_data) + .await?; - return None; - } - }; - - let (header, extrinsics) = block.deconstruct(); - let block_hash = header.hash(); + let (header, extrinsics) = candidate.block.deconstruct(); // Create the parachain block data for the validators. - let b = ParachainBlockData::::new(header.clone(), extrinsics, proof); - - let mut block_import_params = BlockImportParams::new(BlockOrigin::Own, header); - block_import_params.body = Some(b.extrinsics().to_vec()); - // Best block is determined by the relay chain. - block_import_params.fork_choice = Some(ForkChoiceStrategy::Custom(false)); - block_import_params.storage_changes = Some(storage_changes); - - if let Err(err) = self - .block_import - .lock() - .import_block(block_import_params, Default::default()) - { - error!( - target: LOG_TARGET, - "Error importing build block (at {:?}): {:?}", - b.header().parent_hash(), - err, - ); + let b = ParachainBlockData::::new(header, extrinsics, candidate.proof); - return None; - } - - trace!( + tracing::debug!( target: LOG_TARGET, "PoV size {{ header: {}kb, extrinsics: {}kb, storage_proof: {}kb }}", b.header().encode().len() as f64 / 1024f64, @@ -445,6 +316,7 @@ where b.storage_proof().encode().len() as f64 / 1024f64, ); + let block_hash = b.header().hash(); let collation = self.build_collation(b, block_hash, validation_data.relay_parent_number)?; let pov_hash = collation.proof_of_validity.hash(); @@ -452,9 +324,11 @@ where .lock() .wait_to_announce(block_hash, pov_hash); - info!( + tracing::info!( target: LOG_TARGET, - "Produced proof-of-validity candidate {:?} from block {:?}.", pov_hash, block_hash, + pov_hash = ?pov_hash, + ?block_hash, + "Produced proof-of-validity candidate.", ); Some(collation) @@ -462,76 +336,44 @@ where } /// Parameters for [`start_collator`]. -pub struct StartCollatorParams { - pub proposer_factory: PF, - pub inherent_data_providers: InherentDataProviders, +pub struct StartCollatorParams { + pub para_id: ParaId, pub backend: Arc, - pub block_import: BI, pub block_status: Arc, pub announce_block: Arc) + Send + Sync>, pub overseer_handler: OverseerHandler, pub spawner: Spawner, - pub para_id: ParaId, pub key: CollatorPair, - pub polkadot_client: Arc, - pub polkadot_backend: Arc, + pub parachain_consensus: PS, } -pub async fn start_collator< - Block: BlockT, - PF, - BI, - Backend, - BS, - Spawner, - PClient, - PBackend, - PBackend2, - PApi, ->( +/// Start the collator. +pub async fn start_collator( StartCollatorParams { - proposer_factory, - inherent_data_providers, - backend, - block_import, + para_id, block_status, announce_block, mut overseer_handler, spawner, - para_id, key, - polkadot_client, - polkadot_backend, - }: StartCollatorParams, -) -> Result<(), String> + parachain_consensus, + backend, + }: StartCollatorParams, +) where - PF: Environment + Send + 'static, - BI: BlockImport> - + Send - + Sync - + 'static, + Block: BlockT, Backend: sc_client_api::Backend + 'static, BS: BlockBackend + Send + Sync + 'static, Spawner: SpawnNamed + Clone + Send + Sync + 'static, - PBackend: sc_client_api::Backend + 'static, - PBackend::State: StateBackend, - PApi: RuntimeApiCollection, - PClient: polkadot_service::AbstractClient + 'static, - PBackend2: sc_client_api::Backend + 'static, - PBackend2::State: StateBackend, + PS: ParachainConsensus + Send + Sync + 'static, { let collator = Collator::new( - para_id, - proposer_factory, - inherent_data_providers, overseer_handler.clone(), - block_import, block_status, Arc::new(spawner), announce_block, backend, - polkadot_client, - polkadot_backend, + parachain_consensus, ); let config = CollationGenerationConfig { @@ -552,8 +394,6 @@ where overseer_handler .send_msg(CollatorProtocolMessage::CollateOn(para_id)) .await; - - Ok(()) } #[cfg(test)] @@ -565,61 +405,28 @@ mod tests { use sp_inherents::InherentData; use sp_runtime::traits::DigestFor; + use cumulus_client_consensus_common::ParachainCandidate; use cumulus_test_client::{ Client, DefaultTestClientBuilderExt, InitBlockBuilder, TestClientBuilder, TestClientBuilderExt, }; use cumulus_test_runtime::{Block, Header}; - use polkadot_node_subsystem::messages::CollationGenerationMessage; - use polkadot_node_subsystem_test_helpers::ForwardSubsystem; - use polkadot_overseer::{AllSubsystems, Overseer}; - use futures::{channel::mpsc, executor::block_on, future}; - #[derive(Debug)] - struct Error; - - impl From for Error { - fn from(_: sp_consensus::Error) -> Self { - unimplemented!("Not required in tests") - } - } - - struct DummyFactory(Arc); - - impl Environment for DummyFactory { - type Proposer = DummyProposer; - type Error = Error; - type CreateProposer = Pin< - Box> + Send + Unpin + 'static>, - >; - - fn init(&mut self, header: &Header) -> Self::CreateProposer { - Box::pin(future::ready(Ok(DummyProposer { - client: self.0.clone(), - header: header.clone(), - }))) - } - } - - struct DummyProposer { + struct DummyParachainConsensus { client: Arc, header: Header, } - impl Proposer for DummyProposer { - type Error = Error; - type Proposal = future::Ready, Error>>; - type Transaction = sc_client_api::TransactionFor; - - fn propose( - self, - _: InherentData, - _: DigestFor, - _: Duration, - _: RecordProof, - ) -> Self::Proposal { + #[async_trait::async_trait] + impl ParachainConsensus for DummyParachainConsensus { + async fn produce_candidate( + &self, + parent: &B::Header, + relay_parent: PHash, + validation_data: &PersistedValidationData, + ) -> Option> { let block_id = BlockId::Hash(self.header.hash()); let builder = self .client @@ -628,11 +435,14 @@ mod tests { let (block, storage_changes, proof) = builder.build().expect("Creates block").into_inner(); - future::ready(Ok(Proposal { + client + .import(BlockOrigin::Own, block) + .expect("Imports the block"); + + ParachainCandidate { block, - storage_changes, - proof, - })) + proof: proof.expect("Proof is returned"), + } } } @@ -657,40 +467,20 @@ mod tests { spawner.spawn("overseer", overseer.run().then(|_| async { () }).boxed()); - let (polkadot_client, polkadot_backend, relay_parent) = { - // Create a polkadot client with a block imported. - use polkadot_test_client::{ - ClientBlockImportExt as _, DefaultTestClientBuilderExt as _, - InitPolkadotBlockBuilder as _, TestClientBuilderExt as _, - }; - - let client_builder = polkadot_test_client::TestClientBuilder::new(); - let polkadot_backend = client_builder.backend(); - let mut client = client_builder.build(); - let block_builder = client.init_polkadot_block_builder(); - let block = block_builder.build().expect("Finalizes the block").block; - let hash = block.header().hash(); - client - .import_as_best(BlockOrigin::Own, block) - .expect("Imports the block"); - (client, polkadot_backend, hash) - }; - let collator_start = start_collator::<_, _, _, _, _, _, _, polkadot_service::FullBackend, _, _>( StartCollatorParams { - proposer_factory: DummyFactory(client.clone()), - inherent_data_providers: Default::default(), backend, - block_import: client.clone(), block_status: client.clone(), announce_block: Arc::new(announce_block), overseer_handler: handler, spawner, para_id, key: CollatorPair::generate().0, - polkadot_client: Arc::new(polkadot_client), - polkadot_backend, + parachain_consensus: DummyParachainConsensus { + client: client.clone(), + header, + }, }, ); block_on(collator_start).expect("Should start collator"); diff --git a/client/consensus/common/Cargo.toml b/client/consensus/common/Cargo.toml index 17cd99b8cae..74fd292ab1c 100644 --- a/client/consensus/common/Cargo.toml +++ b/client/consensus/common/Cargo.toml @@ -15,6 +15,7 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" } substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "master" } # Polkadot deps @@ -26,6 +27,7 @@ futures = { version = "0.3.8", features = ["compat"] } tokio = "0.1.22" codec = { package = "parity-scale-codec", version = "2.0.0", features = [ "derive" ] } tracing = "0.1.22" +async-trait = "0.1.42" [dev-dependencies] # Substrate deps diff --git a/client/consensus/common/src/lib.rs b/client/consensus/common/src/lib.rs index b7cfadcd1a3..ea04de6dc5a 100644 --- a/client/consensus/common/src/lib.rs +++ b/client/consensus/common/src/lib.rs @@ -29,7 +29,8 @@ use sp_runtime::{ }; use polkadot_primitives::v1::{ - Block as PBlock, Id as ParaId, OccupiedCoreAssumption, ParachainHost, + Block as PBlock, Hash as PHash, Id as ParaId, OccupiedCoreAssumption, ParachainHost, + PersistedValidationData, }; use codec::Decode; @@ -511,6 +512,38 @@ where } } +/// The result of [`ParachainConsensus::produce_candidate`]. +pub struct ParachainCandidate { + /// The block that was build for this candidate. + pub block: B, + /// The proof that was recorded while building the block. + pub proof: sp_trie::StorageProof, +} + +/// A specific parachain consensus implementation that can be used by a collator to produce candidates. +/// +/// The collator will call [`Self::produce_candidate`] every time there is a free core for the parachain +/// this collator is collating for. It is the job of the consensus implementation to decide if this +/// specific collator should build candidate for the given relay chain block. The consensus +/// implementation could for example check if this specific collator is part of the validator. +#[async_trait::async_trait] +pub trait ParachainConsensus { + /// Produce a new candidate at the given parent block. + /// + /// Should return `None` if the consensus implementation decided that it shouldn't build a + /// candidate or if there occurred any error. + /// + /// # NOTE + /// + /// It is expected that the block is + async fn produce_candidate( + &self, + parent: &B::Header, + relay_parent: PHash, + validation_data: &PersistedValidationData, + ) -> Option>; +} + #[cfg(test)] mod tests { use super::*; diff --git a/client/service/src/lib.rs b/client/service/src/lib.rs index b1dad8744ff..f5b952ed91b 100644 --- a/client/service/src/lib.rs +++ b/client/service/src/lib.rs @@ -18,6 +18,7 @@ //! //! Provides functions for starting a collator node or a normal full node. +use cumulus_client_consensus_common::ParachainConsensus; use cumulus_primitives_core::ParaId; use futures::{Future, FutureExt}; use polkadot_overseer::OverseerHandler; @@ -36,35 +37,21 @@ use std::{marker::PhantomData, sync::Arc}; pub mod genesis; -/// Polkadot full node handles. -type PFullNode = polkadot_service::NewFull; +/// Relay chain full node handles. +type RFullNode = polkadot_service::NewFull; /// Parameters given to [`start_collator`]. -pub struct StartCollatorParams< - 'a, - Block: BlockT, - PF, - BI, - BS, - Client, - Backend, - Spawner, - PClient, - PBackend, -> { - pub proposer_factory: PF, - pub inherent_data_providers: InherentDataProviders, +pub struct StartCollatorParams<'a, Block: BlockT, BS, Client, Backend, Spawner, RClient, PC> { pub backend: Arc, - pub block_import: BI, pub block_status: Arc, pub client: Arc, pub announce_block: Arc) + Send + Sync>, pub spawner: Spawner, pub para_id: ParaId, pub collator_key: CollatorPair, - pub polkadot_full_node: PFullNode, + pub relay_chain_full_node: RFullNode, pub task_manager: &'a mut TaskManager, - pub polkadot_backend: Arc, + pub parachain_consensus: PC, } /// Start a collator node for a parachain. @@ -72,33 +59,22 @@ pub struct StartCollatorParams< /// A collator is similar to a validator in a normal blockchain. /// It is responsible for producing blocks and sending the blocks to a /// parachain validator for validation and inclusion into the relay chain. -pub async fn start_collator<'a, Block, PF, BI, BS, Client, Backend, Spawner, PClient, PBackend>( +pub async fn start_collator<'a, Block, BS, Client, Backend, Spawner, RClient, PC>( StartCollatorParams { - proposer_factory, - inherent_data_providers, backend, - block_import, block_status, client, announce_block, spawner, para_id, collator_key, - polkadot_full_node, task_manager, - polkadot_backend, - }: StartCollatorParams<'a, Block, PF, BI, BS, Client, Backend, Spawner, PClient, PBackend>, + relay_chain_full_node, + parachain_consensus, + }: StartCollatorParams<'a, Block, BS, Client, Backend, Spawner, RClient, PC>, ) -> sc_service::error::Result<()> where Block: BlockT, - PF: Environment + Send + 'static, - BI: BlockImport< - Block, - Error = ConsensusError, - Transaction = >::Transaction, - > + Send - + Sync - + 'static, BS: BlockBackend + Send + Sync + 'static, Client: Finalizer + UsageProvider @@ -111,11 +87,10 @@ where for<'b> &'b Client: BlockImport, Backend: BackendT + 'static, Spawner: SpawnNamed + Clone + Send + Sync + 'static, - PClient: ClientHandle, - PBackend: BackendT + 'static, - PBackend::State: StateBackend, + PC: ParachainConsensus + Send + Sync + 'static, + RClient: ClientHandle, { - polkadot_full_node.client.execute_with(StartConsensus { + relay_chain_full_node.client.execute_with(StartConsensus { para_id, announce_block: announce_block.clone(), client: client.clone(), @@ -123,26 +98,21 @@ where _phantom: PhantomData, })?; - polkadot_full_node - .client - .execute_with(StartCollator { - proposer_factory, - inherent_data_providers, - backend, - announce_block, - overseer_handler: polkadot_full_node - .overseer_handler - .ok_or_else(|| "Polkadot full node did not provided an `OverseerHandler`!")?, - spawner, - para_id, - collator_key, - block_import, - block_status, - polkadot_backend, - }) - .await?; + cumulus_client_collator::start_collator(cumulus_client_collator::StartCollatorParams { + backend, + block_status, + announce_block, + overseer_handler: relay_chain_full_node + .overseer_handler + .ok_or_else(|| "Polkadot full node did not provided an `OverseerHandler`!")?, + spawner, + para_id, + key: collator_key, + parachain_consensus, + }) + .await; - task_manager.add_child(polkadot_full_node.task_manager); + task_manager.add_child(relay_chain_full_node.task_manager); Ok(()) } @@ -189,25 +159,7 @@ where Api: RuntimeApiCollection, PClient: AbstractClient + 'static, { - async move { - cumulus_client_collator::start_collator(cumulus_client_collator::StartCollatorParams { - proposer_factory: self.proposer_factory, - inherent_data_providers: self.inherent_data_providers, - backend: self.backend, - block_import: self.block_import, - block_status: self.block_status, - announce_block: self.announce_block, - overseer_handler: self.overseer_handler, - spawner: self.spawner, - para_id: self.para_id, - key: self.collator_key, - polkadot_client: client, - polkadot_backend: self.polkadot_backend, - }) - .await - .map_err(Into::into) - } - .boxed() + async move { Ok(()) }.boxed() } } @@ -215,7 +167,7 @@ where pub struct StartFullNodeParams<'a, Block: BlockT, Client, PClient> { pub para_id: ParaId, pub client: Arc, - pub polkadot_full_node: PFullNode, + pub polkadot_full_node: RFullNode, pub task_manager: &'a mut TaskManager, pub announce_block: Arc) + Send + Sync>, } @@ -330,7 +282,7 @@ pub fn prepare_node_config(mut parachain_config: Configuration) -> Configuration pub fn build_polkadot_full_node( config: Configuration, collator_id: CollatorId, -) -> Result, polkadot_service::Error> { +) -> Result, polkadot_service::Error> { let is_light = matches!(config.role, Role::Light); if is_light { Err(polkadot_service::Error::Sub( diff --git a/rococo-parachains/src/service.rs b/rococo-parachains/src/service.rs index c3b4b292d7a..933c7f7d6b4 100644 --- a/rococo-parachains/src/service.rs +++ b/rococo-parachains/src/service.rs @@ -200,7 +200,7 @@ where client: client.clone(), task_manager: &mut task_manager, collator_key, - polkadot_full_node, + relay_chain_full_node: polkadot_full_node, spawner, backend, polkadot_backend, diff --git a/test/service/src/lib.rs b/test/service/src/lib.rs index 9f35eda93a1..69beb492834 100644 --- a/test/service/src/lib.rs +++ b/test/service/src/lib.rs @@ -155,7 +155,7 @@ where let transaction_pool = params.transaction_pool.clone(); let mut task_manager = params.task_manager; - let polkadot_full_node = polkadot_test_service::new_full( + let relay_chain_full_node = polkadot_test_service::new_full( polkadot_config, polkadot_service::IsCollator::Yes(collator_key.public()), ) @@ -167,11 +167,11 @@ where let client = params.client.clone(); let backend = params.backend.clone(); let block_announce_validator = BlockAnnounceValidator::new( - polkadot_full_node.client.clone(), + relay_chain_full_node.client.clone(), para_id, - Box::new(polkadot_full_node.network.clone()), - polkadot_full_node.backend.clone(), - polkadot_full_node.client.clone(), + Box::new(relay_chain_full_node.network.clone()), + relay_chain_full_node.backend.clone(), + relay_chain_full_node.client.clone(), ); let block_announce_validator_builder = move |_| Box::new(block_announce_validator) as Box<_>; @@ -214,21 +214,11 @@ where Arc::new(move |hash, data| network.announce_block(hash, Some(data))) }; - let polkadot_full_node = polkadot_full_node.with_client(polkadot_test_service::TestClient); + let relay_chain_full_node = relay_chain_full_node.with_client(polkadot_test_service::TestClient); if is_collator { - let proposer_factory = sc_basic_authorship::ProposerFactory::new( - task_manager.spawn_handle(), - client.clone(), - transaction_pool, - prometheus_registry.as_ref(), - ); - - let polkadot_backend = polkadot_full_node.backend.clone(); + let polkadot_backend = relay_chain_full_node.backend.clone(); let params = StartCollatorParams { - proposer_factory, - inherent_data_providers: params.inherent_data_providers, backend: params.backend, - block_import: client.clone(), block_status: client.clone(), announce_block, client: client.clone(), @@ -236,8 +226,8 @@ where task_manager: &mut task_manager, para_id, collator_key, - polkadot_full_node, - polkadot_backend, + parachain_consensus: todo!(), + relay_chain_full_node, }; start_collator(params).await?; @@ -247,7 +237,7 @@ where announce_block, task_manager: &mut task_manager, para_id, - polkadot_full_node, + polkadot_full_node: relay_chain_full_node, }; start_full_node(params)?; From b0ffe4c3fe2dcef5885bae14dd81c8099510072b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Thu, 11 Feb 2021 20:30:55 +0100 Subject: [PATCH 3/9] Add first relay chain consensus stuff --- client/consensus/relay-chain/Cargo.toml | 23 +++ .../consensus/relay-chain/src/import_queue.rs | 131 +++++++++++++ client/consensus/relay-chain/src/lib.rs | 174 ++++++++++++++++++ 3 files changed, 328 insertions(+) create mode 100644 client/consensus/relay-chain/Cargo.toml create mode 100644 client/consensus/relay-chain/src/import_queue.rs create mode 100644 client/consensus/relay-chain/src/lib.rs diff --git a/client/consensus/relay-chain/Cargo.toml b/client/consensus/relay-chain/Cargo.toml new file mode 100644 index 00000000000..8ae43403ff5 --- /dev/null +++ b/client/consensus/relay-chain/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "cumulus-client-consensus-relay-chain" +description = "The relay-chain provided consensus algorithm" +version = "0.1.0" +authors = ["Parity Technologies "] +edition = "2018" + +[dependencies] +# Substrate deps +sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "master" } + +# Cumulus dependencies +cumulus-client-consensus-common = { path = "../common" } +cumulus-primitives-core = { path = "../../../primitives/core" } +cumulus-primitives-parachain-inherent = { path = "../../../primitives/parachain-inherent" } + +# Other deps +futures = { version = "0.3.8", features = ["compat"] } +tokio = "0.1.22" +codec = { package = "parity-scale-codec", version = "2.0.0", features = [ "derive" ] } +tracing = "0.1.22" +async-trait = "0.1.42" diff --git a/client/consensus/relay-chain/src/import_queue.rs b/client/consensus/relay-chain/src/import_queue.rs new file mode 100644 index 00000000000..eeb6a0a95a5 --- /dev/null +++ b/client/consensus/relay-chain/src/import_queue.rs @@ -0,0 +1,131 @@ +// Copyright 2019 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 . + +use std::{marker::PhantomData, sync::Arc}; + +use sp_api::ProvideRuntimeApi; +use sp_block_builder::BlockBuilder as BlockBuilderApi; +use sp_blockchain::Result as ClientResult; +use sp_consensus::{ + error::Error as ConsensusError, + import_queue::{BasicQueue, CacheKeyId, Verifier as VerifierT}, + BlockImport, BlockImportParams, BlockOrigin, ForkChoiceStrategy, +}; +use sp_inherents::InherentDataProviders; +use sp_runtime::{ + generic::BlockId, + traits::{Block as BlockT, Header as HeaderT}, + Justification, +}; + +/// A verifier that just checks the inherents. +struct Verifier { + client: Arc, + inherent_data_providers: InherentDataProviders, + _marker: PhantomData, +} + +impl VerifierT for Verifier +where + Block: BlockT, + Client: ProvideRuntimeApi + Send + Sync, + >::Api: BlockBuilderApi, +{ + fn verify( + &mut self, + origin: BlockOrigin, + header: Block::Header, + justification: Option, + mut body: Option>, + ) -> Result< + ( + BlockImportParams, + Option)>>, + ), + String, + > { + if let Some(inner_body) = body.take() { + let inherent_data = self + .inherent_data_providers + .create_inherent_data() + .map_err(|e| e.into_string())?; + + let block = Block::new(header.clone(), inner_body); + + let inherent_res = self + .client + .runtime_api() + .check_inherents( + &BlockId::Hash(*header.parent_hash()), + block.clone(), + inherent_data, + ) + .map_err(|e| format!("{:?}", e))?; + + if !inherent_res.ok() { + inherent_res.into_errors().try_for_each(|(i, e)| { + Err(self.inherent_data_providers.error_to_string(&i, &e)) + })?; + } + + let (_, inner_body) = block.deconstruct(); + body = Some(inner_body); + } + + let post_hash = Some(header.hash()); + let mut block_import_params = BlockImportParams::new(origin, header); + block_import_params.body = body; + block_import_params.justification = justification; + + // Best block is determined by the relay chain, or if we are doing the intial sync + // we import all blocks as new best. + block_import_params.fork_choice = Some(ForkChoiceStrategy::Custom( + origin == BlockOrigin::NetworkInitialSync, + )); + block_import_params.post_hash = post_hash; + + Ok((block_import_params, None)) + } +} + +/// Start an import queue for a Cumulus collator that does not uses any special authoring logic. +pub fn import_queue( + client: Arc, + block_import: I, + inherent_data_providers: InherentDataProviders, + spawner: &impl sp_core::traits::SpawnNamed, + registry: Option<&substrate_prometheus_endpoint::Registry>, +) -> ClientResult> +where + I: BlockImport + Send + Sync + 'static, + I::Transaction: Send, + Client: ProvideRuntimeApi + Send + Sync + 'static, + >::Api: BlockBuilderApi, +{ + let verifier = Verifier { + client, + inherent_data_providers, + _marker: PhantomData, + }; + + Ok(BasicQueue::new( + verifier, + Box::new(block_import), + None, + spawner, + registry, + )) +} diff --git a/client/consensus/relay-chain/src/lib.rs b/client/consensus/relay-chain/src/lib.rs new file mode 100644 index 00000000000..58941cff7ca --- /dev/null +++ b/client/consensus/relay-chain/src/lib.rs @@ -0,0 +1,174 @@ +// Copyright 2021 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 relay-chain provided consensus algoritm for parachains. +//! +//! This is the simplest consensus algorithm you can use when developing a parachain. It is a +//! permission-less consensus algorithm that doesn't require any staking or similar to join as a +//! collator. In this algorithm the consensus is provided by the relay-chain. This works in the +//! following way. +//! +//! 1. Each node that sees itself as a collator is free to build a parachain candidate. +//! +//! 2. This parachain candidate is send to the parachain validators that are part of the relay chain. +//! +//! 3. The parachain validators validate at most X different parachain candidates, where X is the +//! total number of parachain validators. +//! +//! 4. The parachain candidate with the highest number of approvals is choosen by the relay-chain +//! block producer to be backed. +//! +//! 5. After the parachain candidate got backed and included, all collators start at 1. + +use cumulus_client_consensus_common::{ParachainConsensus, ParachainCandidate}; +use sp_runtime::traits::Block as BlockT; +use sp_consensus::{ + BlockImport, BlockImportParams, BlockOrigin, BlockStatus, Environment, Error as ConsensusError, + ForkChoiceStrategy, Proposal, Proposer, RecordProof, +}; +use cumulus_primitives_core::relay_chain::v1::Hash as PHash; +use cumulus_primitives_parachain_inherent::ParachainInherentData; +use sp_inherents::{InherentData, InherentDataProviders}; + +const LOG_TARGET: &str = "cumulus-consensus-relay-chain"; + +/// The implementation of the relay-chain provided consensus for parachains. +pub struct RelayChainConsensus { + para_id: ParaId, + _phantom: PhantomData<(Block, PBackend)>, + proposer_factory: Arc>, + inherent_data_providers: InherentDataProviders, + block_import: Arc>, + polkadot_client: Arc, + polkadot_backend: Arc, +} + +impl ParachainConsensus { + /// Get the inherent data with validation function parameters injected + fn inherent_data( + &mut self, + validation_data: &PersistedValidationData, + relay_parent: PHash, + ) -> Option { + let mut inherent_data = self + .inherent_data_providers + .create_inherent_data() + .map_err(|e| { + tracing::error!( + target: LOG_TARGET, + error = ?e, + "Failed to create inherent data.", + ) + }) + .ok()?; + + let parachain_inherent_data = ParachainInherentData::create_at( + relay_parent, + &*self.polkadot_client, + &*self.polkadot_backend, + validation_data, + self.para_id, + )?; + + inherent_data + .put_data( + cumulus_primitives_parachain_inherent::INHERENT_IDENTIFIER, + ¶chain_inherent_data, + ) + .map_err(|e| { + error!( + target: LOG_TARGET, + "Failed to put the system inherent into inherent data: {:?}", e, + ) + }) + .ok()?; + + Some(inherent_data) + } +} + +#[async_trait::async_trait] +impl ParachainConsensus for RelayChainConsensus { + async fn produce_candidate( + &self, + parent: &B::Header, + relay_parent: PHash, + validation_data: &PersistedValidationData, + ) -> ParachainCandidate { + let proposer_future = self.proposer_factory.lock().init(&parent); + + let proposer = proposer_future + .await + .map_err(|e| + tracing::error!(target: LOG_TARGET, error = ?e, "Could not create proposer.") + ).ok()?; + + let inherent_data = self.inherent_data(&validation_data, relay_parent)?; + + let Proposal { + block, + storage_changes, + proof, + } = proposer + .propose( + inherent_data, + Default::default(), + //TODO: Fix this. + Duration::from_millis(500), + RecordProof::Yes, + ) + .await + .map_err(|e| tracing::error!(target: LOG_TARGET, error = ?e, "Proposing failed.")) + .ok()?; + + let proof = match proof { + Some(proof) => proof, + None => { + tracing::error!( + target: LOG_TARGET, + "Proposer did not return the requested proof.", + ); + + return None; + } + }; + + let (header, extrinsics) = block.clone().deconstruct(); + + let mut block_import_params = BlockImportParams::new(BlockOrigin::Own, header); + block_import_params.body = Some(extrinsics); + // Best block is determined by the relay chain. + block_import_params.fork_choice = Some(ForkChoiceStrategy::Custom(false)); + block_import_params.storage_changes = Some(storage_changes); + + if let Err(err) = self + .block_import + .lock() + .import_block(block_import_params, Default::default()) + { + tracing::error!( + target: LOG_TARGET, + at = ?parent.hash(), + error = ?err, + "Error importing build block.", + ); + + return None; + } + + Some(ParachainCandidate { block, proof }) + } +} From 2ba1466f6ccfdbccf8a5a42f34a99b501e5ea71f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 12 Feb 2021 01:02:07 +0100 Subject: [PATCH 4/9] Remove some warnings --- client/collator/src/lib.rs | 23 ++++++++--------------- test/service/src/lib.rs | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/client/collator/src/lib.rs b/client/collator/src/lib.rs index c0072ae7fd5..62b22966970 100644 --- a/client/collator/src/lib.rs +++ b/client/collator/src/lib.rs @@ -21,15 +21,12 @@ use cumulus_primitives_core::{ well_known_keys, OutboundHrmpMessage, ParachainBlockData, PersistedValidationData, }; -use sc_client_api::{BlockBackend, StateBackend}; -use sp_consensus::{ - BlockImport, BlockImportParams, BlockOrigin, BlockStatus, Environment, Error as ConsensusError, - ForkChoiceStrategy, Proposal, Proposer, RecordProof, -}; +use sc_client_api::BlockBackend; +use sp_consensus::BlockStatus; use sp_core::traits::SpawnNamed; use sp_runtime::{ generic::BlockId, - traits::{BlakeTwo256, Block as BlockT, Header as HeaderT, Zero}, + traits::{Block as BlockT, Header as HeaderT, Zero}, }; use sp_state_machine::InspectState; @@ -38,21 +35,18 @@ use polkadot_node_primitives::{Collation, CollationGenerationConfig}; use polkadot_node_subsystem::messages::{CollationGenerationMessage, CollatorProtocolMessage}; use polkadot_overseer::OverseerHandler; use polkadot_primitives::v1::{ - Block as PBlock, BlockData, BlockNumber as PBlockNumber, CollatorPair, Hash as PHash, HeadData, - Id as ParaId, PoV, UpwardMessage, + BlockData, BlockNumber as PBlockNumber, CollatorPair, Hash as PHash, HeadData, Id as ParaId, + PoV, UpwardMessage, }; use codec::{Decode, Encode}; -use futures::prelude::*; +use futures::FutureExt; -use std::{marker::PhantomData, sync::Arc, time::Duration}; +use std::sync::Arc; use parking_lot::Mutex; -type TransactionFor = - <>::Proposer as Proposer>::Transaction; - /// The logging target. const LOG_TARGET: &str = "cumulus-collator"; @@ -359,8 +353,7 @@ pub async fn start_collator( parachain_consensus, backend, }: StartCollatorParams, -) -where +) where Block: BlockT, Backend: sc_client_api::Backend + 'static, BS: BlockBackend + Send + Sync + 'static, diff --git a/test/service/src/lib.rs b/test/service/src/lib.rs index 69beb492834..f4644fa03cc 100644 --- a/test/service/src/lib.rs +++ b/test/service/src/lib.rs @@ -123,7 +123,7 @@ pub fn new_partial( async fn start_node_impl( parachain_config: Configuration, collator_key: CollatorPair, - polkadot_config: Configuration, + relay_chain_config: Configuration, para_id: ParaId, is_collator: bool, rpc_ext_builder: RB, @@ -156,7 +156,7 @@ where let mut task_manager = params.task_manager; let relay_chain_full_node = polkadot_test_service::new_full( - polkadot_config, + relay_chain_config, polkadot_service::IsCollator::Yes(collator_key.public()), ) .map_err(|e| match e { @@ -271,9 +271,9 @@ pub async fn run_test_node( task_executor: TaskExecutor, key: Sr25519Keyring, parachain_storage_update_func: impl Fn(), - polkadot_storage_update_func: impl Fn(), + relay_chain_storage_update_func: impl Fn(), parachain_boot_nodes: Vec, - polkadot_boot_nodes: Vec, + relay_chain_boot_nodes: Vec, para_id: ParaId, is_collator: bool, ) -> CumulusTestNode { @@ -287,22 +287,22 @@ pub async fn run_test_node( is_collator, ) .expect("could not generate Configuration"); - let mut polkadot_config = polkadot_test_service::node_config( - polkadot_storage_update_func, + let mut relay_chain_config = polkadot_test_service::node_config( + relay_chain_storage_update_func, task_executor.clone(), key, - polkadot_boot_nodes, + relay_chain_boot_nodes, false, ); - polkadot_config.network.node_name = - format!("{} (relay chain)", polkadot_config.network.node_name); + relay_chain_config.network.node_name = + format!("{} (relay chain)", relay_chain_config.network.node_name); let multiaddr = parachain_config.network.listen_addresses[0].clone(); let (task_manager, client, network, rpc_handlers) = start_node_impl( parachain_config, collator_key, - polkadot_config, + relay_chain_config, para_id, is_collator, |_| Default::default(), From 7aa6978d28a64ba48994d861b72c45bebde12dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 12 Feb 2021 10:27:59 +0100 Subject: [PATCH 5/9] Fix more stuff --- Cargo.lock | 316 ++++++++++++++++++++++++ Cargo.toml | 1 + client/collator/Cargo.toml | 3 + client/collator/src/lib.rs | 13 +- client/consensus/relay-chain/Cargo.toml | 12 +- client/consensus/relay-chain/src/lib.rs | 90 +++++-- pallets/parachain-system/Cargo.toml | 2 +- rococo-parachains/Cargo.toml | 2 +- test/service/Cargo.toml | 3 +- test/service/src/lib.rs | 35 ++- 10 files changed, 438 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cd6a7ecefda..0e8f8d00df1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1129,6 +1129,30 @@ dependencies = [ "tracing", ] +[[package]] +name = "cumulus-client-consensus-relay-chain" +version = "0.1.0" +dependencies = [ + "async-trait", + "cumulus-client-consensus-common", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "futures 0.3.12", + "parity-scale-codec", + "parking_lot 0.9.0", + "polkadot-service", + "sc-client-api", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-inherents", + "sp-runtime", + "substrate-prometheus-endpoint", + "tracing", +] + [[package]] name = "cumulus-client-network" version = "0.1.0" @@ -1378,6 +1402,7 @@ name = "cumulus-test-service" version = "0.1.0" dependencies = [ "cumulus-client-consensus-common", + "cumulus-client-consensus-relay-chain", "cumulus-client-network", "cumulus-client-service", "cumulus-primitives-core", @@ -3807,6 +3832,15 @@ dependencies = [ "parity-util-mem", ] +[[package]] +name = "memory-lru" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "beeb98b3d1ed2c0054bd81b5ba949a0243c3ccad751d45ea898fa8059fa2860a" +dependencies = [ + "lru", +] + [[package]] name = "memory_units" version = "0.3.0" @@ -5236,6 +5270,75 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "989d43012e2ca1c4a02507c67282691a0a3207f9dc67cec596b43fe925b3d325" +[[package]] +name = "polkadot-approval-distribution" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +dependencies = [ + "futures 0.3.12", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "tracing", + "tracing-futures", +] + +[[package]] +name = "polkadot-availability-bitfield-distribution" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +dependencies = [ + "futures 0.3.12", + "parity-scale-codec", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "tracing", + "tracing-futures", +] + +[[package]] +name = "polkadot-availability-distribution" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +dependencies = [ + "futures 0.3.12", + "parity-scale-codec", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-core", + "sp-keystore", + "thiserror", + "tracing", + "tracing-futures", +] + +[[package]] +name = "polkadot-availability-recovery" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +dependencies = [ + "futures 0.3.12", + "futures-timer 3.0.2", + "lru", + "polkadot-erasure-coding", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "rand 0.8.3", + "streamunordered", + "thiserror", + "tracing", + "tracing-futures", +] + [[package]] name = "polkadot-cli" version = "0.8.28" @@ -5256,6 +5359,21 @@ dependencies = [ "tracing-futures", ] +[[package]] +name = "polkadot-collator-protocol" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +dependencies = [ + "futures 0.3.12", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "thiserror", + "tracing", + "tracing-futures", +] + [[package]] name = "polkadot-core-primitives" version = "0.7.30" @@ -5281,6 +5399,41 @@ dependencies = [ "thiserror", ] +[[package]] +name = "polkadot-network-bridge" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +dependencies = [ + "async-trait", + "futures 0.3.12", + "parity-scale-codec", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-primitives", + "sc-authority-discovery", + "sc-network", + "strum", + "tracing", + "tracing-futures", +] + +[[package]] +name = "polkadot-node-collation-generation" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +dependencies = [ + "futures 0.3.12", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-core", + "thiserror", + "tracing", + "tracing-futures", +] + [[package]] name = "polkadot-node-core-av-store" version = "0.1.0" @@ -5303,6 +5456,87 @@ dependencies = [ "tracing-futures", ] +[[package]] +name = "polkadot-node-core-backing" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +dependencies = [ + "bitvec", + "futures 0.3.12", + "polkadot-erasure-coding", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "polkadot-statement-table", + "sp-keystore", + "thiserror", + "tracing", + "tracing-futures", +] + +[[package]] +name = "polkadot-node-core-bitfield-signing" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +dependencies = [ + "futures 0.3.12", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-keystore", + "thiserror", + "tracing", + "tracing-futures", + "wasm-timer", +] + +[[package]] +name = "polkadot-node-core-candidate-selection" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +dependencies = [ + "futures 0.3.12", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-keystore", + "thiserror", + "tracing", + "tracing-futures", +] + +[[package]] +name = "polkadot-node-core-candidate-validation" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +dependencies = [ + "futures 0.3.12", + "parity-scale-codec", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-parachain", + "polkadot-primitives", + "sp-core", + "tracing", + "tracing-futures", +] + +[[package]] +name = "polkadot-node-core-chain-api" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +dependencies = [ + "futures 0.3.12", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-blockchain", + "tracing", + "tracing-futures", +] + [[package]] name = "polkadot-node-core-proposer" version = "0.1.0" @@ -5327,6 +5561,39 @@ dependencies = [ "tracing", ] +[[package]] +name = "polkadot-node-core-provisioner" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +dependencies = [ + "bitvec", + "futures 0.3.12", + "futures-timer 3.0.2", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "thiserror", + "tracing", + "tracing-futures", +] + +[[package]] +name = "polkadot-node-core-runtime-api" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +dependencies = [ + "futures 0.3.12", + "memory-lru", + "parity-util-mem", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-api", + "sp-core", + "tracing", + "tracing-futures", +] + [[package]] name = "polkadot-node-jaeger" version = "0.1.0" @@ -5472,6 +5739,21 @@ dependencies = [ "thiserror", ] +[[package]] +name = "polkadot-pov-distribution" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +dependencies = [ + "futures 0.3.12", + "polkadot-node-network-protocol", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "thiserror", + "tracing", + "tracing-futures", +] + [[package]] name = "polkadot-primitives" version = "0.8.28" @@ -5682,16 +5964,32 @@ dependencies = [ "pallet-im-online", "pallet-staking", "pallet-transaction-payment-rpc-runtime-api", + "polkadot-approval-distribution", + "polkadot-availability-bitfield-distribution", + "polkadot-availability-distribution", + "polkadot-availability-recovery", + "polkadot-collator-protocol", + "polkadot-network-bridge", + "polkadot-node-collation-generation", "polkadot-node-core-av-store", + "polkadot-node-core-backing", + "polkadot-node-core-bitfield-signing", + "polkadot-node-core-candidate-selection", + "polkadot-node-core-candidate-validation", + "polkadot-node-core-chain-api", "polkadot-node-core-proposer", + "polkadot-node-core-provisioner", + "polkadot-node-core-runtime-api", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-parachain", + "polkadot-pov-distribution", "polkadot-primitives", "polkadot-rpc", "polkadot-runtime", "polkadot-runtime-parachains", + "polkadot-statement-distribution", "rococo-runtime", "sc-authority-discovery", "sc-block-builder", @@ -5734,6 +6032,24 @@ dependencies = [ "westend-runtime", ] +[[package]] +name = "polkadot-statement-distribution" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +dependencies = [ + "arrayvec 0.5.2", + "futures 0.3.12", + "indexmap", + "polkadot-node-network-protocol", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "sp-staking", + "tracing", + "tracing-futures", +] + [[package]] name = "polkadot-statement-table" version = "0.8.28" diff --git a/Cargo.toml b/Cargo.toml index c2cd0c1332b..f6ee7c08e77 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace] members = [ "client/consensus/common", + "client/consensus/relay-chain", "client/network", "client/service", "pallets/parachain-system", diff --git a/client/collator/Cargo.toml b/client/collator/Cargo.toml index e2dcff7bb3f..c02fe64c409 100644 --- a/client/collator/Cargo.toml +++ b/client/collator/Cargo.toml @@ -34,6 +34,9 @@ parking_lot = "0.9" tracing = "0.1.22" [dev-dependencies] +# Polkadot dependencies +polkadot-node-subsystem-test-helpers = { git = "https://github.com/paritytech/polkadot", branch = "master" } + # Cumulus dependencies cumulus-test-runtime = { path = "../../test/runtime" } cumulus-test-client = { path = "../../test/client" } diff --git a/client/collator/src/lib.rs b/client/collator/src/lib.rs index 62b22966970..dfedeeaa744 100644 --- a/client/collator/src/lib.rs +++ b/client/collator/src/lib.rs @@ -395,7 +395,6 @@ mod tests { use std::{pin::Pin, time::Duration}; use sp_core::{testing::TaskExecutor, Pair}; - use sp_inherents::InherentData; use sp_runtime::traits::DigestFor; use cumulus_client_consensus_common::ParachainCandidate; @@ -404,6 +403,8 @@ mod tests { TestClientBuilderExt, }; use cumulus_test_runtime::{Block, Header}; + use polkadot_overseer::{Overseer, AllSubsystems}; + use polkadot_node_subsystem_test_helpers::ForwardSubsystem; use futures::{channel::mpsc, executor::block_on, future}; @@ -416,14 +417,14 @@ mod tests { impl ParachainConsensus for DummyParachainConsensus { async fn produce_candidate( &self, - parent: &B::Header, - relay_parent: PHash, + parent: &Header, + _: PHash, validation_data: &PersistedValidationData, - ) -> Option> { + ) -> Option> { let block_id = BlockId::Hash(self.header.hash()); let builder = self .client - .init_block_builder_at(&block_id, None, Default::default()); + .init_block_builder_at(&block_id, Some(validation_data.clone()), Default::default()); let (block, storage_changes, proof) = builder.build().expect("Creates block").into_inner(); @@ -461,7 +462,7 @@ mod tests { spawner.spawn("overseer", overseer.run().then(|_| async { () }).boxed()); let collator_start = - start_collator::<_, _, _, _, _, _, _, polkadot_service::FullBackend, _, _>( + start_collator( StartCollatorParams { backend, block_status: client.clone(), diff --git a/client/consensus/relay-chain/Cargo.toml b/client/consensus/relay-chain/Cargo.toml index 8ae43403ff5..b02eef94965 100644 --- a/client/consensus/relay-chain/Cargo.toml +++ b/client/consensus/relay-chain/Cargo.toml @@ -9,6 +9,16 @@ edition = "2018" # Substrate deps sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } +substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "master" } + +# Polkadot dependencies +polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "master", features = [ "real-overseer" ] } # Cumulus dependencies cumulus-client-consensus-common = { path = "../common" } @@ -17,7 +27,7 @@ cumulus-primitives-parachain-inherent = { path = "../../../primitives/parachain- # Other deps futures = { version = "0.3.8", features = ["compat"] } -tokio = "0.1.22" codec = { package = "parity-scale-codec", version = "2.0.0", features = [ "derive" ] } tracing = "0.1.22" async-trait = "0.1.42" +parking_lot = "0.9" diff --git a/client/consensus/relay-chain/src/lib.rs b/client/consensus/relay-chain/src/lib.rs index 58941cff7ca..ee5aae0d896 100644 --- a/client/consensus/relay-chain/src/lib.rs +++ b/client/consensus/relay-chain/src/lib.rs @@ -33,33 +33,69 @@ //! //! 5. After the parachain candidate got backed and included, all collators start at 1. -use cumulus_client_consensus_common::{ParachainConsensus, ParachainCandidate}; -use sp_runtime::traits::Block as BlockT; -use sp_consensus::{ - BlockImport, BlockImportParams, BlockOrigin, BlockStatus, Environment, Error as ConsensusError, - ForkChoiceStrategy, Proposal, Proposer, RecordProof, +use cumulus_client_consensus_common::{ParachainCandidate, ParachainConsensus}; +use cumulus_primitives_core::{ + relay_chain::v1::{Block as PBlock, Hash as PHash, ParachainHost}, + ParaId, PersistedValidationData, }; -use cumulus_primitives_core::relay_chain::v1::Hash as PHash; use cumulus_primitives_parachain_inherent::ParachainInherentData; +use parking_lot::Mutex; +use sc_client_api::Backend; +use sp_api::ProvideRuntimeApi; +use sp_consensus::{ + BlockImport, BlockImportParams, BlockOrigin, Environment, ForkChoiceStrategy, Proposal, + Proposer, RecordProof, +}; use sp_inherents::{InherentData, InherentDataProviders}; +use sp_runtime::traits::{Block as BlockT, Header as HeaderT}; +use std::{marker::PhantomData, sync::Arc, time::Duration}; +pub use import_queue::import_queue; + +mod import_queue; const LOG_TARGET: &str = "cumulus-consensus-relay-chain"; /// The implementation of the relay-chain provided consensus for parachains. -pub struct RelayChainConsensus { +pub struct RelayChainConsensus { para_id: ParaId, - _phantom: PhantomData<(Block, PBackend)>, - proposer_factory: Arc>, + _phantom: PhantomData, + proposer_factory: Mutex, inherent_data_providers: InherentDataProviders, - block_import: Arc>, - polkadot_client: Arc, - polkadot_backend: Arc, + block_import: Mutex, + polkadot_client: Arc, + polkadot_backend: Arc, } -impl ParachainConsensus { +impl RelayChainConsensus +where + B: BlockT, + RClient: ProvideRuntimeApi, + RClient::Api: ParachainHost, + RBackend: Backend, +{ + /// Create a new instance of relay-chain provided consensus. + pub fn new( + para_id: ParaId, + proposer_factory: PF, + inherent_data_providers: InherentDataProviders, + block_import: BI, + polkadot_client: Arc, + polkadot_backend: Arc, + ) -> Self { + Self { + para_id, + proposer_factory: Mutex::new(proposer_factory), + inherent_data_providers, + block_import: Mutex::new(block_import), + polkadot_backend, + polkadot_client, + _phantom: PhantomData, + } + } + /// Get the inherent data with validation function parameters injected fn inherent_data( - &mut self, + &self, validation_data: &PersistedValidationData, relay_parent: PHash, ) -> Option { @@ -89,9 +125,10 @@ impl ParachainConsensus { ¶chain_inherent_data, ) .map_err(|e| { - error!( + tracing::error!( target: LOG_TARGET, - "Failed to put the system inherent into inherent data: {:?}", e, + error = ?e, + "Failed to put the system inherent into inherent data.", ) }) .ok()?; @@ -101,20 +138,31 @@ impl ParachainConsensus { } #[async_trait::async_trait] -impl ParachainConsensus for RelayChainConsensus { +impl ParachainConsensus + for RelayChainConsensus +where + B: BlockT, + RClient: ProvideRuntimeApi + Send + Sync, + RClient::Api: ParachainHost, + RBackend: Backend, + BI: BlockImport + Send + Sync, + PF: Environment + Send + Sync, + PF::Proposer: Proposer, +{ async fn produce_candidate( &self, parent: &B::Header, relay_parent: PHash, validation_data: &PersistedValidationData, - ) -> ParachainCandidate { + ) -> Option> { let proposer_future = self.proposer_factory.lock().init(&parent); let proposer = proposer_future .await - .map_err(|e| - tracing::error!(target: LOG_TARGET, error = ?e, "Could not create proposer.") - ).ok()?; + .map_err( + |e| tracing::error!(target: LOG_TARGET, error = ?e, "Could not create proposer."), + ) + .ok()?; let inherent_data = self.inherent_data(&validation_data, relay_parent)?; diff --git a/pallets/parachain-system/Cargo.toml b/pallets/parachain-system/Cargo.toml index 36b14d2216a..ffc1ddeaf06 100644 --- a/pallets/parachain-system/Cargo.toml +++ b/pallets/parachain-system/Cargo.toml @@ -16,7 +16,7 @@ polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-f # Substrate dependencies frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-balances = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } -sp-core = { git = "https://github.com/paritytech/substrate", version = "2.0.0-rc5", default-features = false, branch = "master" } +sp-core = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-inherents = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-io = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } diff --git a/rococo-parachains/Cargo.toml b/rococo-parachains/Cargo.toml index e7d144423cb..1f0b75c376b 100644 --- a/rococo-parachains/Cargo.toml +++ b/rococo-parachains/Cargo.toml @@ -41,7 +41,7 @@ sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "mast sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-basic-authorship = { git = "https://github.com/paritytech/substrate", version = "0.8.0-rc5", branch = "master" } +sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/test/service/Cargo.toml b/test/service/Cargo.toml index 132c18165b5..94dcfea69a3 100644 --- a/test/service/Cargo.toml +++ b/test/service/Cargo.toml @@ -10,7 +10,7 @@ rand = "0.7.3" serde = { version = "1.0.101", features = ["derive"] } # Substrate -sc-basic-authorship = { git = "https://github.com/paritytech/substrate", version = "0.8.0-rc5", branch = "master" } +sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } @@ -44,6 +44,7 @@ polkadot-overseer = { git = "https://github.com/paritytech/polkadot", branch = " # Cumulus cumulus-client-consensus-common = { path = "../../client/consensus/common" } +cumulus-client-consensus-relay-chain = { path = "../../client/consensus/relay-chain" } cumulus-client-network = { path = "../../client/network" } cumulus-client-service = { path = "../../client/service" } cumulus-primitives-core = { path = "../../primitives/core" } diff --git a/test/service/src/lib.rs b/test/service/src/lib.rs index f4644fa03cc..ffd839ac23d 100644 --- a/test/service/src/lib.rs +++ b/test/service/src/lib.rs @@ -27,10 +27,10 @@ pub use genesis::*; use core::future::Future; use cumulus_client_network::BlockAnnounceValidator; -use cumulus_primitives_core::ParaId; use cumulus_client_service::{ prepare_node_config, start_collator, start_full_node, StartCollatorParams, StartFullNodeParams, }; +use cumulus_primitives_core::ParaId; use cumulus_test_runtime::{NodeBlock as Block, RuntimeApi}; use polkadot_primitives::v1::CollatorPair; use sc_client_api::execution_extensions::ExecutionStrategies; @@ -39,8 +39,8 @@ pub use sc_executor::NativeExecutor; use sc_network::{config::TransportConfig, multiaddr, NetworkService}; use sc_service::{ config::{ - DatabaseConfig, KeystoreConfig, MultiaddrWithPeerId, NetworkConfiguration, - OffchainWorkerConfig, KeepBlocks, TransactionStorageMode, PruningMode, WasmExecutionMethod, + DatabaseConfig, KeepBlocks, KeystoreConfig, MultiaddrWithPeerId, NetworkConfiguration, + OffchainWorkerConfig, PruningMode, TransactionStorageMode, WasmExecutionMethod, }, BasePath, ChainSpec, Configuration, Error as ServiceError, PartialComponents, Role, RpcHandlers, TFullBackend, TFullClient, TaskExecutor, TaskManager, @@ -135,8 +135,8 @@ async fn start_node_impl( )> where RB: Fn( - Arc>, - ) -> jsonrpc_core::IoHandler + Arc>, + ) -> jsonrpc_core::IoHandler + Send + 'static, { @@ -214,9 +214,25 @@ where Arc::new(move |hash, data| network.announce_block(hash, Some(data))) }; - let relay_chain_full_node = relay_chain_full_node.with_client(polkadot_test_service::TestClient); if is_collator { - let polkadot_backend = relay_chain_full_node.backend.clone(); + let proposer_factory = sc_basic_authorship::ProposerFactory::new( + task_manager.spawn_handle(), + client.clone(), + transaction_pool, + prometheus_registry.as_ref(), + ); + let parachain_consensus = cumulus_client_consensus_relay_chain::RelayChainConsensus::new( + para_id, + proposer_factory, + params.inherent_data_providers, + client.clone(), + relay_chain_full_node.client.clone(), + relay_chain_full_node.backend.clone(), + ); + + let relay_chain_full_node = + relay_chain_full_node.with_client(polkadot_test_service::TestClient); + let params = StartCollatorParams { backend: params.backend, block_status: client.clone(), @@ -226,12 +242,15 @@ where task_manager: &mut task_manager, para_id, collator_key, - parachain_consensus: todo!(), + parachain_consensus, relay_chain_full_node, }; start_collator(params).await?; } else { + let relay_chain_full_node = + relay_chain_full_node.with_client(polkadot_test_service::TestClient); + let params = StartFullNodeParams { client: client.clone(), announce_block, From c3b086c634f3c141000fe96f8e2a0ea1976d2801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 12 Feb 2021 10:52:45 +0100 Subject: [PATCH 6/9] Fix collator test --- Cargo.lock | 1000 +++++++++++++++++++----------------- client/collator/Cargo.toml | 3 - client/collator/src/lib.rs | 71 ++- 3 files changed, 564 insertions(+), 510 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e8f8d00df1..51b1f44ed63 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,7 +16,7 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" dependencies = [ - "gimli 0.23.0", + "gimli", ] [[package]] @@ -371,7 +371,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.22.0", + "object", "rustc-demangle", ] @@ -816,6 +816,16 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" +[[package]] +name = "cpp_demangle" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44919ecaf6f99e8e737bc239408931c9a01e9a6c74814fee8242dd2506b65390" +dependencies = [ + "cfg-if 1.0.0", + "glob", +] + [[package]] name = "cpuid-bool" version = "0.1.2" @@ -830,25 +840,25 @@ checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" [[package]] name = "cranelift-bforest" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dcc286b052ee24a1e5a222e7c1125e6010ad35b0f248709b9b3737a8fedcfdf" +checksum = "4066fd63b502d73eb8c5fa6bcab9c7962b05cd580f6b149ee83a8e730d8ce7fb" dependencies = [ "cranelift-entity", ] [[package]] name = "cranelift-codegen" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9badfe36176cb653506091693bc2bb1970c9bddfcd6ec7fac404f7eaec6f38" +checksum = "1a54e4beb833a3c873a18a8fe735d73d732044004c7539a072c8faa35ccb0c60" dependencies = [ "byteorder", "cranelift-bforest", "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", - "gimli 0.21.0", + "gimli", "log", "regalloc", "serde", @@ -859,9 +869,9 @@ dependencies = [ [[package]] name = "cranelift-codegen-meta" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3f460031861e4f4ad510be62b2ae50bba6cc886b598a36f9c0a970feab9598" +checksum = "c54cac7cacb443658d8f0ff36a3545822613fa202c946c0891897843bc933810" dependencies = [ "cranelift-codegen-shared", "cranelift-entity", @@ -869,24 +879,24 @@ dependencies = [ [[package]] name = "cranelift-codegen-shared" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ad12409e922e7697cd0bdc7dc26992f64a77c31880dfe5e3c7722f4710206d" +checksum = "a109760aff76788b2cdaeefad6875a73c2b450be13906524f6c2a81e05b8d83c" [[package]] name = "cranelift-entity" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97cdc58972ea065d107872cfb9079f4c92ade78a8af85aaff519a65b5d13f71" +checksum = "3b044234aa32531f89a08b487630ddc6744696ec04c8123a1ad388de837f5de3" dependencies = [ "serde", ] [[package]] name = "cranelift-frontend" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ef419efb4f94ecc02e5d9fbcc910d2bb7f0040e2de570e63a454f883bc891d6" +checksum = "5452b3e4e97538ee5ef2cc071301c69a86c7adf2770916b9d04e9727096abd93" dependencies = [ "cranelift-codegen", "log", @@ -896,9 +906,9 @@ dependencies = [ [[package]] name = "cranelift-native" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e69d44d59826eef6794066ac2c0f4ad3975f02d97030c60dbc04e3886adf36e" +checksum = "f68035c10b2e80f26cc29c32fa824380877f38483504c2a47b54e7da311caaf3" dependencies = [ "cranelift-codegen", "raw-cpuid", @@ -907,17 +917,19 @@ dependencies = [ [[package]] name = "cranelift-wasm" -version = "0.66.0" +version = "0.69.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "979df666b1304624abe99738e9e0e7c7479ee5523ba4b8b237df9ff49996acbb" +checksum = "a530eb9d1c95b3309deb24c3d179d8b0ba5837ed98914a429787c395f614949d" dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", + "itertools", "log", "serde", + "smallvec 1.6.1", "thiserror", - "wasmparser 0.59.0", + "wasmparser", ] [[package]] @@ -1085,12 +1097,10 @@ dependencies = [ "parking_lot 0.9.0", "polkadot-node-primitives", "polkadot-node-subsystem", + "polkadot-node-subsystem-test-helpers", "polkadot-overseer", - "polkadot-parachain", "polkadot-primitives", - "sc-cli", "sc-client-api", - "sp-api", "sp-blockchain", "sp-consensus", "sp-core", @@ -1261,7 +1271,7 @@ dependencies = [ name = "cumulus-primitives-core" version = "0.1.0" dependencies = [ - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "parity-scale-codec", "polkadot-core-primitives", "polkadot-parachain", @@ -1348,7 +1358,7 @@ dependencies = [ "sp-std", "sp-transaction-pool", "sp-version", - "substrate-wasm-builder 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-wasm-builder 3.0.0", "xcm", "xcm-builder", "xcm-executor", @@ -1394,7 +1404,7 @@ dependencies = [ "sp-std", "sp-transaction-pool", "sp-version", - "substrate-wasm-builder 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-wasm-builder 3.0.0", ] [[package]] @@ -1552,21 +1562,21 @@ dependencies = [ [[package]] name = "directories" -version = "2.0.2" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" +checksum = "f8fed639d60b58d0f53498ab13d26f621fd77569cc6edb031f4cc36a2ad9da0f" dependencies = [ - "cfg-if 0.1.10", "dirs-sys", ] [[package]] -name = "directories" -version = "3.0.1" +name = "directories-next" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fed639d60b58d0f53498ab13d26f621fd77569cc6edb031f4cc36a2ad9da0f" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" dependencies = [ - "dirs-sys", + "cfg-if 1.0.0", + "dirs-sys-next", ] [[package]] @@ -1576,7 +1586,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" dependencies = [ "libc", - "redox_users", + "redox_users 0.3.5", + "winapi 0.3.9", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users 0.4.0", "winapi 0.3.9", ] @@ -1910,8 +1931,8 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "parity-scale-codec", ] @@ -1928,8 +1949,8 @@ dependencies = [ [[package]] name = "frame-benchmarking" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -1946,8 +1967,8 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "Inflector", "chrono", @@ -1969,8 +1990,8 @@ dependencies = [ [[package]] name = "frame-executive" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -1985,8 +2006,8 @@ dependencies = [ [[package]] name = "frame-metadata" -version = "12.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "13.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "parity-scale-codec", "serde", @@ -1996,13 +2017,13 @@ dependencies = [ [[package]] name = "frame-support" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "bitflags", "frame-metadata", "frame-support-procedural", - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "log", "once_cell", "parity-scale-codec", @@ -2022,8 +2043,8 @@ dependencies = [ [[package]] name = "frame-support-procedural" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "Inflector", "frame-support-procedural-tools", @@ -2034,8 +2055,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2046,8 +2067,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "proc-macro2 1.0.24", "quote 1.0.8", @@ -2056,11 +2077,11 @@ dependencies = [ [[package]] name = "frame-system" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "parity-scale-codec", "serde", "sp-core", @@ -2072,8 +2093,8 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "parity-scale-codec", "sp-api", @@ -2367,21 +2388,15 @@ dependencies = [ [[package]] name = "gimli" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc8e0c9bce37868955864dbecd2b1ab2bdf967e6f28066d65aaac620444b65c" +checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" dependencies = [ "fallible-iterator", "indexmap", "stable_deref_trait", ] -[[package]] -name = "gimli" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" - [[package]] name = "glob" version = "0.3.0" @@ -2799,17 +2814,6 @@ dependencies = [ "serde", ] -[[package]] -name = "impl-trait-for-tuples" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef5550a42e3740a0e71f909d4c861056a284060af885ae7aa6242820f920d9d" -dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.8", - "syn 1.0.60", -] - [[package]] name = "impl-trait-for-tuples" version = "0.2.1" @@ -3061,7 +3065,7 @@ dependencies = [ [[package]] name = "kusama-runtime" version = "0.8.28" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "bitvec", "frame-executive", @@ -3122,7 +3126,7 @@ dependencies = [ "sp-transaction-pool", "sp-version", "static_assertions", - "substrate-wasm-builder 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-wasm-builder 3.0.0", ] [[package]] @@ -3871,7 +3875,7 @@ dependencies = [ [[package]] name = "metered-channel" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "futures 0.3.12", "futures-timer 3.0.2", @@ -4233,27 +4237,14 @@ dependencies = [ [[package]] name = "object" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cbca9424c482ee628fa549d9c812e2cd22f1180b9222c9200fdfa6eb31aecb2" - -[[package]] -name = "object" -version = "0.20.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" +checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" dependencies = [ "crc32fast", "indexmap", - "wasmparser 0.57.0", ] -[[package]] -name = "object" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" - [[package]] name = "once_cell" version = "1.5.2" @@ -4307,8 +4298,8 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4323,12 +4314,12 @@ dependencies = [ [[package]] name = "pallet-authorship" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "parity-scale-codec", "sp-authorship", "sp-inherents", @@ -4338,8 +4329,8 @@ dependencies = [ [[package]] name = "pallet-babe" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-benchmarking", "frame-support", @@ -4363,8 +4354,8 @@ dependencies = [ [[package]] name = "pallet-balances" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-benchmarking", "frame-support", @@ -4377,8 +4368,8 @@ dependencies = [ [[package]] name = "pallet-bounties" -version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4391,8 +4382,8 @@ dependencies = [ [[package]] name = "pallet-collective" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4406,8 +4397,8 @@ dependencies = [ [[package]] name = "pallet-democracy" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-benchmarking", "frame-support", @@ -4422,7 +4413,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4435,8 +4426,8 @@ dependencies = [ [[package]] name = "pallet-grandpa" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-benchmarking", "frame-support", @@ -4456,8 +4447,8 @@ dependencies = [ [[package]] name = "pallet-identity" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "enumflags2", "frame-benchmarking", @@ -4472,8 +4463,8 @@ dependencies = [ [[package]] name = "pallet-im-online" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4490,8 +4481,8 @@ dependencies = [ [[package]] name = "pallet-indices" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4506,8 +4497,8 @@ dependencies = [ [[package]] name = "pallet-membership" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4520,8 +4511,8 @@ dependencies = [ [[package]] name = "pallet-multisig" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4535,8 +4526,8 @@ dependencies = [ [[package]] name = "pallet-nicks" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4549,8 +4540,8 @@ dependencies = [ [[package]] name = "pallet-offences" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4564,8 +4555,8 @@ dependencies = [ [[package]] name = "pallet-proxy" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4579,8 +4570,8 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4592,8 +4583,8 @@ dependencies = [ [[package]] name = "pallet-recovery" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "enumflags2", "frame-support", @@ -4607,8 +4598,8 @@ dependencies = [ [[package]] name = "pallet-scheduler" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-benchmarking", "frame-support", @@ -4622,12 +4613,12 @@ dependencies = [ [[package]] name = "pallet-session" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", - "impl-trait-for-tuples 0.1.3", + "impl-trait-for-tuples", "pallet-timestamp", "parity-scale-codec", "serde", @@ -4642,8 +4633,8 @@ dependencies = [ [[package]] name = "pallet-society" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4656,8 +4647,8 @@ dependencies = [ [[package]] name = "pallet-staking" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4676,8 +4667,8 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.24", @@ -4687,8 +4678,8 @@ dependencies = [ [[package]] name = "pallet-sudo" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4701,13 +4692,13 @@ dependencies = [ [[package]] name = "pallet-timestamp" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "parity-scale-codec", "serde", "sp-inherents", @@ -4718,8 +4709,8 @@ dependencies = [ [[package]] name = "pallet-tips" -version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4732,8 +4723,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4748,8 +4739,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4765,8 +4756,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -4776,12 +4767,12 @@ dependencies = [ [[package]] name = "pallet-treasury" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "pallet-balances", "parity-scale-codec", "serde", @@ -4791,8 +4782,8 @@ dependencies = [ [[package]] name = "pallet-utility" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-support", "frame-system", @@ -4806,8 +4797,8 @@ dependencies = [ [[package]] name = "pallet-vesting" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "enumflags2", "frame-support", @@ -4922,7 +4913,7 @@ dependencies = [ "cfg-if 1.0.0", "ethereum-types", "hashbrown", - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "lru", "parity-util-mem-derive", "parking_lot 0.11.1", @@ -5273,7 +5264,7 @@ checksum = "989d43012e2ca1c4a02507c67282691a0a3207f9dc67cec596b43fe925b3d325" [[package]] name = "polkadot-approval-distribution" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "futures 0.3.12", "polkadot-node-network-protocol", @@ -5288,7 +5279,7 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "futures 0.3.12", "parity-scale-codec", @@ -5303,7 +5294,7 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "futures 0.3.12", "parity-scale-codec", @@ -5322,7 +5313,7 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "futures 0.3.12", "futures-timer 3.0.2", @@ -5342,7 +5333,7 @@ dependencies = [ [[package]] name = "polkadot-cli" version = "0.8.28" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "frame-benchmarking-cli", "futures 0.3.12", @@ -5362,7 +5353,7 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "futures 0.3.12", "polkadot-node-network-protocol", @@ -5377,7 +5368,7 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" version = "0.7.30" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "parity-scale-codec", "parity-util-mem", @@ -5389,7 +5380,7 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" version = "0.8.28" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -5402,7 +5393,7 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "async-trait", "futures 0.3.12", @@ -5420,7 +5411,7 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "futures 0.3.12", "polkadot-erasure-coding", @@ -5437,7 +5428,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "bitvec", "futures 0.3.12", @@ -5459,7 +5450,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "bitvec", "futures 0.3.12", @@ -5478,7 +5469,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "futures 0.3.12", "polkadot-node-subsystem", @@ -5494,7 +5485,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-selection" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "futures 0.3.12", "polkadot-node-subsystem", @@ -5509,7 +5500,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "futures 0.3.12", "parity-scale-codec", @@ -5526,7 +5517,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "futures 0.3.12", "polkadot-node-subsystem", @@ -5540,7 +5531,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-proposer" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "futures 0.3.12", "futures-timer 3.0.2", @@ -5564,7 +5555,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "bitvec", "futures 0.3.12", @@ -5580,7 +5571,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "futures 0.3.12", "memory-lru", @@ -5589,6 +5580,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "sp-api", + "sp-consensus-babe", "sp-core", "tracing", "tracing-futures", @@ -5597,7 +5589,7 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "async-std", "lazy_static", @@ -5613,7 +5605,7 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "futures 0.3.12", "parity-scale-codec", @@ -5629,22 +5621,25 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "futures 0.3.12", "parity-scale-codec", "polkadot-primitives", "polkadot-statement-table", - "sp-consensus-slots", + "schnorrkel", + "sp-application-crypto", + "sp-consensus-babe", "sp-consensus-vrf", "sp-core", "sp-runtime", + "thiserror", ] [[package]] name = "polkadot-node-subsystem" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "async-std", "async-trait", @@ -5671,10 +5666,33 @@ dependencies = [ "tracing-futures", ] +[[package]] +name = "polkadot-node-subsystem-test-helpers" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" +dependencies = [ + "async-trait", + "futures 0.3.12", + "futures-timer 3.0.2", + "parity-scale-codec", + "parking_lot 0.11.1", + "pin-project 1.0.4", + "polkadot-node-primitives", + "polkadot-node-subsystem", + "polkadot-node-subsystem-util", + "polkadot-primitives", + "polkadot-statement-table", + "sc-network", + "smallvec 1.6.1", + "sp-core", + "tracing", + "tracing-futures", +] + [[package]] name = "polkadot-node-subsystem-util" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "async-trait", "futures 0.3.12", @@ -5683,6 +5701,7 @@ dependencies = [ "parity-scale-codec", "pin-project 1.0.4", "polkadot-node-jaeger", + "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-primitives", @@ -5700,7 +5719,7 @@ dependencies = [ [[package]] name = "polkadot-overseer" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "async-trait", "futures 0.3.12", @@ -5718,7 +5737,7 @@ dependencies = [ [[package]] name = "polkadot-parachain" version = "0.8.28" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "derive_more 0.99.11", "futures 0.3.12", @@ -5742,7 +5761,7 @@ dependencies = [ [[package]] name = "polkadot-pov-distribution" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "futures 0.3.12", "polkadot-node-network-protocol", @@ -5757,7 +5776,7 @@ dependencies = [ [[package]] name = "polkadot-primitives" version = "0.8.28" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "bitvec", "frame-system", @@ -5785,7 +5804,7 @@ dependencies = [ [[package]] name = "polkadot-rpc" version = "0.8.28" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "jsonrpc-core", "pallet-transaction-payment-rpc", @@ -5815,7 +5834,7 @@ dependencies = [ [[package]] name = "polkadot-runtime" version = "0.8.28" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "bitvec", "frame-executive", @@ -5874,13 +5893,13 @@ dependencies = [ "sp-transaction-pool", "sp-version", "static_assertions", - "substrate-wasm-builder 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-wasm-builder 3.0.0", ] [[package]] name = "polkadot-runtime-common" version = "0.8.28" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "bitvec", "frame-support", @@ -5916,7 +5935,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" version = "0.8.0" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "bitvec", "derive_more 0.99.11", @@ -5953,7 +5972,7 @@ dependencies = [ [[package]] name = "polkadot-service" version = "0.8.3" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "frame-benchmarking", "frame-system-rpc-runtime-api", @@ -6035,7 +6054,7 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot?branch=master#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "arrayvec 0.5.2", "futures 0.3.12", @@ -6053,7 +6072,7 @@ dependencies = [ [[package]] name = "polkadot-statement-table" version = "0.8.28" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -6063,7 +6082,7 @@ dependencies = [ [[package]] name = "polkadot-test-client" version = "0.8.28" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "parity-scale-codec", "polkadot-node-subsystem", @@ -6087,7 +6106,7 @@ dependencies = [ [[package]] name = "polkadot-test-runtime" version = "0.8.28" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "bitvec", "frame-executive", @@ -6135,13 +6154,13 @@ dependencies = [ "sp-std", "sp-transaction-pool", "sp-version", - "substrate-wasm-builder 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-wasm-builder 3.0.0", ] [[package]] name = "polkadot-test-service" version = "0.8.28" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "frame-benchmarking", "frame-system", @@ -6398,6 +6417,15 @@ dependencies = [ "prost", ] +[[package]] +name = "psm" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3abf49e5417290756acfd26501536358560c4a5cc4a0934d390939acb3e7083a" +dependencies = [ + "cc", +] + [[package]] name = "pwasm-utils" version = "0.14.0" @@ -6687,9 +6715,9 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "7.0.4" +version = "8.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beb71f708fe39b2c5e98076204c3cc094ee5a4c12c4cdb119a2b72dc34164f41" +checksum = "1fdf7d9dbd43f3d81d94a49c1c3df73cc2b3827995147e6cf7f89d4ec5483e73" dependencies = [ "bitflags", "cc", @@ -6762,6 +6790,16 @@ dependencies = [ "rust-argon2", ] +[[package]] +name = "redox_users" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +dependencies = [ + "getrandom 0.2.1", + "redox_syscall 0.2.4", +] + [[package]] name = "reed-solomon-erasure" version = "4.0.2" @@ -6793,9 +6831,9 @@ dependencies = [ [[package]] name = "regalloc" -version = "0.0.27" +version = "0.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ba8aaf5fe7cf307c6dbdaeed85478961d29e25e3bee5169e11b92fa9f027a8" +checksum = "571f7f397d61c4755285cd37853fe8e03271c243424a907415909379659381c5" dependencies = [ "log", "rustc-hash", @@ -6968,7 +7006,7 @@ dependencies = [ [[package]] name = "rococo-runtime" version = "0.8.28" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "frame-executive", "frame-support", @@ -7012,7 +7050,7 @@ dependencies = [ "sp-std", "sp-transaction-pool", "sp-version", - "substrate-wasm-builder 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-wasm-builder 3.0.0", "xcm", "xcm-builder", "xcm-executor", @@ -7157,8 +7195,8 @@ dependencies = [ [[package]] name = "sc-authority-discovery" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "async-trait", "derive_more 0.99.11", @@ -7185,8 +7223,8 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "futures 0.3.12", "futures-timer 3.0.2", @@ -7208,8 +7246,8 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -7225,10 +7263,10 @@ dependencies = [ [[package]] name = "sc-chain-spec" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "parity-scale-codec", "sc-chain-spec-derive", "sc-consensus-babe", @@ -7246,8 +7284,8 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.24", @@ -7257,8 +7295,8 @@ dependencies = [ [[package]] name = "sc-cli" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "chrono", "fdlimit", @@ -7295,8 +7333,8 @@ dependencies = [ [[package]] name = "sc-client-api" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "derive_more 0.99.11", "fnv", @@ -7329,8 +7367,8 @@ dependencies = [ [[package]] name = "sc-client-db" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "blake2-rfc", "hash-db", @@ -7359,8 +7397,8 @@ dependencies = [ [[package]] name = "sc-consensus" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "sc-client-api", "sp-blockchain", @@ -7370,8 +7408,8 @@ dependencies = [ [[package]] name = "sc-consensus-babe" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "derive_more 0.99.11", "fork-tree", @@ -7416,8 +7454,8 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "derive_more 0.99.11", "futures 0.3.12", @@ -7440,8 +7478,8 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "fork-tree", "parity-scale-codec", @@ -7453,8 +7491,8 @@ dependencies = [ [[package]] name = "sc-consensus-slots" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "futures 0.3.12", "futures-timer 3.0.2", @@ -7479,8 +7517,8 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "log", "sc-client-api", @@ -7493,8 +7531,8 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "derive_more 0.99.11", "lazy_static", @@ -7522,8 +7560,8 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "derive_more 0.99.11", "parity-scale-codec", @@ -7538,8 +7576,8 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "log", "parity-scale-codec", @@ -7553,8 +7591,8 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "log", "parity-scale-codec", @@ -7571,8 +7609,8 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "derive_more 0.99.11", "finality-grandpa", @@ -7609,8 +7647,8 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "derive_more 0.99.11", "finality-grandpa", @@ -7634,7 +7672,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-warp-sync" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "derive_more 0.99.11", "futures 0.3.12", @@ -7653,8 +7691,8 @@ dependencies = [ [[package]] name = "sc-informant" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "ansi_term 0.12.1", "futures 0.3.12", @@ -7671,8 +7709,8 @@ dependencies = [ [[package]] name = "sc-keystore" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "async-trait", "derive_more 0.99.11", @@ -7691,8 +7729,8 @@ dependencies = [ [[package]] name = "sc-light" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "hash-db", "lazy_static", @@ -7710,8 +7748,8 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "async-std", "async-trait", @@ -7763,8 +7801,8 @@ dependencies = [ [[package]] name = "sc-network-gossip" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "futures 0.3.12", "futures-timer 3.0.2", @@ -7779,8 +7817,8 @@ dependencies = [ [[package]] name = "sc-offchain" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "bytes 0.5.6", "fnv", @@ -7806,8 +7844,8 @@ dependencies = [ [[package]] name = "sc-peerset" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "futures 0.3.12", "libp2p", @@ -7819,8 +7857,8 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -7828,8 +7866,8 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "futures 0.3.12", "hash-db", @@ -7862,8 +7900,8 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "derive_more 0.99.11", "futures 0.3.12", @@ -7886,8 +7924,8 @@ dependencies = [ [[package]] name = "sc-rpc-server" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "futures 0.1.30", "jsonrpc-core", @@ -7904,10 +7942,10 @@ dependencies = [ [[package]] name = "sc-service" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ - "directories 3.0.1", + "directories", "exit-future 0.2.0", "futures 0.1.30", "futures 0.3.12", @@ -7967,8 +8005,8 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "log", "parity-scale-codec", @@ -7982,8 +8020,8 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" -version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -8002,8 +8040,8 @@ dependencies = [ [[package]] name = "sc-telemetry" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "chrono", "futures 0.3.12", @@ -8024,8 +8062,8 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "ansi_term 0.12.1", "atty", @@ -8052,8 +8090,8 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" -version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.24", @@ -8063,8 +8101,8 @@ dependencies = [ [[package]] name = "sc-transaction-graph" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "derive_more 0.99.11", "futures 0.3.12", @@ -8085,8 +8123,8 @@ dependencies = [ [[package]] name = "sc-transaction-pool" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "futures 0.3.12", "futures-diagnose", @@ -8506,8 +8544,8 @@ dependencies = [ [[package]] name = "sp-allocator" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "log", "sp-core", @@ -8518,8 +8556,8 @@ dependencies = [ [[package]] name = "sp-api" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "hash-db", "parity-scale-codec", @@ -8534,8 +8572,8 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "blake2-rfc", "proc-macro-crate", @@ -8546,8 +8584,8 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "parity-scale-codec", "serde", @@ -8558,8 +8596,8 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "integer-sqrt", "num-traits 0.2.14", @@ -8571,8 +8609,8 @@ dependencies = [ [[package]] name = "sp-authority-discovery" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "parity-scale-codec", "sp-api", @@ -8583,8 +8621,8 @@ dependencies = [ [[package]] name = "sp-authorship" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "parity-scale-codec", "sp-inherents", @@ -8594,8 +8632,8 @@ dependencies = [ [[package]] name = "sp-block-builder" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "parity-scale-codec", "sp-api", @@ -8606,8 +8644,8 @@ dependencies = [ [[package]] name = "sp-blockchain" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "futures 0.3.12", "log", @@ -8624,8 +8662,8 @@ dependencies = [ [[package]] name = "sp-chain-spec" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "serde", "serde_json", @@ -8633,8 +8671,8 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "futures 0.3.12", "futures-timer 3.0.2", @@ -8659,8 +8697,8 @@ dependencies = [ [[package]] name = "sp-consensus-aura" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#93b231e79f5b4e551c34234e89fa4a2e5e9c1510" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "parity-scale-codec", "sp-api", @@ -8674,8 +8712,8 @@ dependencies = [ [[package]] name = "sp-consensus-babe" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "merlin", "parity-scale-codec", @@ -8694,8 +8732,8 @@ dependencies = [ [[package]] name = "sp-consensus-slots" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "parity-scale-codec", "sp-arithmetic", @@ -8704,8 +8742,8 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -8716,8 +8754,8 @@ dependencies = [ [[package]] name = "sp-core" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "base58", "blake2-rfc", @@ -8760,8 +8798,8 @@ dependencies = [ [[package]] name = "sp-database" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "kvdb", "parking_lot 0.11.1", @@ -8769,8 +8807,8 @@ dependencies = [ [[package]] name = "sp-debug-derive" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "proc-macro2 1.0.24", "quote 1.0.8", @@ -8779,8 +8817,8 @@ dependencies = [ [[package]] name = "sp-externalities" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "environmental", "parity-scale-codec", @@ -8790,8 +8828,8 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "finality-grandpa", "log", @@ -8807,8 +8845,8 @@ dependencies = [ [[package]] name = "sp-inherents" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "parity-scale-codec", "parking_lot 0.11.1", @@ -8819,8 +8857,8 @@ dependencies = [ [[package]] name = "sp-io" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "futures 0.3.12", "hash-db", @@ -8843,8 +8881,8 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "lazy_static", "sp-core", @@ -8854,8 +8892,8 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "async-trait", "derive_more 0.99.11", @@ -8871,8 +8909,8 @@ dependencies = [ [[package]] name = "sp-npos-elections" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "parity-scale-codec", "serde", @@ -8884,8 +8922,8 @@ dependencies = [ [[package]] name = "sp-npos-elections-compact" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.24", @@ -8895,8 +8933,8 @@ dependencies = [ [[package]] name = "sp-offchain" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "sp-api", "sp-core", @@ -8905,16 +8943,16 @@ dependencies = [ [[package]] name = "sp-panic-handler" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "backtrace", ] [[package]] name = "sp-rpc" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "serde", "sp-core", @@ -8922,12 +8960,12 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "either", "hash256-std-hasher", - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "log", "parity-scale-codec", "parity-util-mem", @@ -8943,10 +8981,10 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", "sp-externalities", @@ -8960,8 +8998,8 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "Inflector", "proc-macro-crate", @@ -8972,8 +9010,8 @@ dependencies = [ [[package]] name = "sp-serializer" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "serde", "serde_json", @@ -8981,8 +9019,8 @@ dependencies = [ [[package]] name = "sp-session" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "parity-scale-codec", "sp-api", @@ -8994,8 +9032,8 @@ dependencies = [ [[package]] name = "sp-staking" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -9004,8 +9042,8 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "hash-db", "log", @@ -9026,13 +9064,13 @@ dependencies = [ [[package]] name = "sp-std" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" [[package]] name = "sp-storage" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9044,8 +9082,8 @@ dependencies = [ [[package]] name = "sp-tasks" -version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "log", "sp-core", @@ -9058,7 +9096,7 @@ dependencies = [ [[package]] name = "sp-test-primitives" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#93b231e79f5b4e551c34234e89fa4a2e5e9c1510" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "parity-scale-codec", "parity-util-mem", @@ -9070,10 +9108,10 @@ dependencies = [ [[package]] name = "sp-timestamp" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "parity-scale-codec", "sp-api", "sp-inherents", @@ -9084,8 +9122,8 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "log", "parity-scale-codec", @@ -9097,8 +9135,8 @@ dependencies = [ [[package]] name = "sp-transaction-pool" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "derive_more 0.99.11", "futures 0.3.12", @@ -9113,8 +9151,8 @@ dependencies = [ [[package]] name = "sp-trie" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "hash-db", "memory-db", @@ -9127,8 +9165,8 @@ dependencies = [ [[package]] name = "sp-utils" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "futures 0.3.12", "futures-core", @@ -9139,8 +9177,8 @@ dependencies = [ [[package]] name = "sp-version" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "impl-serde", "parity-scale-codec", @@ -9151,10 +9189,10 @@ dependencies = [ [[package]] name = "sp-wasm-interface" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "parity-scale-codec", "sp-std", "wasmi", @@ -9284,16 +9322,16 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "platforms", ] [[package]] name = "substrate-frame-rpc-system" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.12", @@ -9315,8 +9353,8 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "async-std", "derive_more 0.99.11", @@ -9330,7 +9368,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#cc71cca1d3087bf62381a9d60b14ca6235b4b916" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "futures 0.1.30", "futures 0.3.12", @@ -9357,9 +9395,9 @@ dependencies = [ [[package]] name = "substrate-test-runtime" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#93b231e79f5b4e551c34234e89fa4a2e5e9c1510" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "frame-executive", "frame-support", "frame-system", @@ -9392,14 +9430,14 @@ dependencies = [ "sp-transaction-pool", "sp-trie", "sp-version", - "substrate-wasm-builder 3.0.0 (git+https://github.com/paritytech/substrate)", + "substrate-wasm-builder 4.0.0", "trie-db", ] [[package]] name = "substrate-test-runtime-client" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#93b231e79f5b4e551c34234e89fa4a2e5e9c1510" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "futures 0.3.12", "parity-scale-codec", @@ -9419,8 +9457,8 @@ dependencies = [ [[package]] name = "substrate-test-utils" -version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#93b231e79f5b4e551c34234e89fa4a2e5e9c1510" +version = "3.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "futures 0.3.12", "substrate-test-utils-derive", @@ -9429,8 +9467,8 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" -version = "0.8.1" -source = "git+https://github.com/paritytech/substrate#93b231e79f5b4e551c34234e89fa4a2e5e9c1510" +version = "0.9.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "proc-macro-crate", "quote 1.0.8", @@ -9455,8 +9493,8 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" -version = "3.0.0" -source = "git+https://github.com/paritytech/substrate#93b231e79f5b4e551c34234e89fa4a2e5e9c1510" +version = "4.0.0" +source = "git+https://github.com/paritytech/substrate#3957f43912e43fd28b624bb0736141ac24b51615" dependencies = [ "ansi_term 0.12.1", "atty", @@ -9528,9 +9566,9 @@ checksum = "36474e732d1affd3a6ed582781b3683df3d0563714c59c39591e8ff707cf078e" [[package]] name = "target-lexicon" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab0e7238dcc7b40a7be719a25365910f6807bd864f4cce6b2e6b873658e2b19d" +checksum = "4ee5a98e506fb7231a304c3a1bd7c132a55016cf65001e0282480665870dfcb9" [[package]] name = "tempfile" @@ -10105,7 +10143,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" dependencies = [ "cfg-if 0.1.10", - "rand 0.7.3", + "rand 0.6.5", "static_assertions", ] @@ -10447,33 +10485,31 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.57.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32fddd575d477c6e9702484139cf9f23dcd554b06d185ed0f56c857dd3a47aa6" - -[[package]] -name = "wasmparser" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a950e6a618f62147fd514ff445b2a0b53120d382751960797f85f058c7eda9b9" +checksum = "89a30c99437829ede826802bfcf28500cf58df00e66cb9114df98813bc145ff1" [[package]] name = "wasmtime" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd3c4f449382779ef6e0a7c3ec6752ae614e20a42e4100000c3efdc973100e2" +checksum = "7426055cb92bd9a1e9469b48154d8d6119cd8c498c8b70284e420342c05dc45d" dependencies = [ "anyhow", "backtrace", - "cfg-if 0.1.10", - "lazy_static", + "bincode", + "cfg-if 1.0.0", + "cpp_demangle", + "indexmap", "libc", "log", "region", "rustc-demangle", + "serde", "smallvec 1.6.1", "target-lexicon", - "wasmparser 0.59.0", + "wasmparser", + "wasmtime-cache", "wasmtime-environ", "wasmtime-jit", "wasmtime-profiling", @@ -10482,74 +10518,101 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "wasmtime-cache" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c01d9287e36921e46f5887a47007824ae5dbb9b7517a2d565660ab4471478709" +dependencies = [ + "anyhow", + "base64 0.13.0", + "bincode", + "directories-next", + "errno", + "file-per-thread-logger", + "libc", + "log", + "serde", + "sha2 0.9.2", + "toml", + "winapi 0.3.9", + "zstd", +] + +[[package]] +name = "wasmtime-cranelift" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4134ed3a4316cd0de0e546c6004850afe472b0fa3fcdc2f2c15f8d449562d962" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "cranelift-wasm", + "wasmtime-environ", +] + [[package]] name = "wasmtime-debug" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e634af9067a3af6cf2c7d33dc3b84767ddaf5d010ba68e80eecbcea73d4a349" +checksum = "e91fa931df6dd8af2b02606307674d3bad23f55473d5f4c809dddf7e4c4dc411" dependencies = [ "anyhow", - "gimli 0.21.0", + "gimli", "more-asserts", - "object 0.20.0", + "object", "target-lexicon", "thiserror", - "wasmparser 0.59.0", + "wasmparser", "wasmtime-environ", ] [[package]] name = "wasmtime-environ" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f85619a94ee4034bd5bb87fc3dcf71fd2237b81c840809da1201061eec9ab3" +checksum = "a1098871dc3120aaf8190d79153e470658bb79f63ee9ca31716711e123c28220" dependencies = [ "anyhow", - "base64 0.12.3", - "bincode", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "cranelift-codegen", "cranelift-entity", - "cranelift-frontend", "cranelift-wasm", - "directories 2.0.2", - "errno", - "file-per-thread-logger", + "gimli", "indexmap", - "libc", "log", "more-asserts", - "rayon", "serde", - "sha2 0.8.2", "thiserror", - "toml", - "wasmparser 0.59.0", - "winapi 0.3.9", - "zstd", + "wasmparser", ] [[package]] name = "wasmtime-jit" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e914c013c7a9f15f4e429d5431f2830fb8adb56e40567661b69c5ec1d645be23" +checksum = "738bfcd1561ede8bb174215776fd7d9a95d5f0a47ca3deabe0282c55f9a89f68" dependencies = [ + "addr2line", "anyhow", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "cranelift-codegen", "cranelift-entity", "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli 0.21.0", + "gimli", "log", "more-asserts", - "object 0.20.0", + "object", + "rayon", "region", + "serde", "target-lexicon", "thiserror", - "wasmparser 0.59.0", + "wasmparser", + "wasmtime-cranelift", "wasmtime-debug", "wasmtime-environ", "wasmtime-obj", @@ -10560,13 +10623,13 @@ dependencies = [ [[package]] name = "wasmtime-obj" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e81d8e02e9bc9fe2da9b6d48bbc217f96e089f7df613f11a28a3958abc44641e" +checksum = "3e96d77f1801131c5e86d93e42a3cf8a35402107332c202c245c83f34888a906" dependencies = [ "anyhow", "more-asserts", - "object 0.20.0", + "object", "target-lexicon", "wasmtime-debug", "wasmtime-environ", @@ -10574,16 +10637,16 @@ dependencies = [ [[package]] name = "wasmtime-profiling" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e8d4d1af8dd5f7096cfcc89dd668d358e52980c38cce199643372ffd6590e27" +checksum = "60bb672c9d894776d7b9250dd9b4fe890f8760201ee4f53e5f2da772b6c4debb" dependencies = [ "anyhow", - "cfg-if 0.1.10", - "gimli 0.21.0", + "cfg-if 1.0.0", + "gimli", "lazy_static", "libc", - "object 0.19.0", + "object", "scroll", "serde", "target-lexicon", @@ -10593,19 +10656,20 @@ dependencies = [ [[package]] name = "wasmtime-runtime" -version = "0.19.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a25f140bbbaadb07c531cba99ce1a966dba216138dc1b2a0ddecec851a01a93" +checksum = "a978086740949eeedfefcee667b57a9e98d9a7fc0de382fcfa0da30369e3530d" dependencies = [ "backtrace", "cc", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "indexmap", "lazy_static", "libc", "log", - "memoffset 0.5.6", + "memoffset 0.6.1", "more-asserts", + "psm", "region", "thiserror", "wasmtime-environ", @@ -10671,7 +10735,7 @@ dependencies = [ [[package]] name = "westend-runtime" version = "0.8.28" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "bitvec", "frame-executive", @@ -10732,7 +10796,7 @@ dependencies = [ "sp-transaction-pool", "sp-version", "static_assertions", - "substrate-wasm-builder 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "substrate-wasm-builder 3.0.0", ] [[package]] @@ -10827,7 +10891,7 @@ dependencies = [ [[package]] name = "xcm" version = "0.8.22" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "parity-scale-codec", ] @@ -10835,7 +10899,7 @@ dependencies = [ [[package]] name = "xcm-builder" version = "0.8.22" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "frame-support", "parity-scale-codec", @@ -10851,10 +10915,10 @@ dependencies = [ [[package]] name = "xcm-executor" version = "0.8.22" -source = "git+https://github.com/paritytech/polkadot#e526a15b1fa9bb7ac5378541d9f32667618e18c4" +source = "git+https://github.com/paritytech/polkadot?branch=master#35ea1c4b0651b93b61f918046c6fbc829429b867" dependencies = [ "frame-support", - "impl-trait-for-tuples 0.2.1", + "impl-trait-for-tuples", "parity-scale-codec", "sp-arithmetic", "sp-core", diff --git a/client/collator/Cargo.toml b/client/collator/Cargo.toml index c02fe64c409..1c0ff86eddc 100644 --- a/client/collator/Cargo.toml +++ b/client/collator/Cargo.toml @@ -11,12 +11,9 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-state-machine = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" } # Polkadot dependencies -polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "master" } polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master" } polkadot-node-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master" } polkadot-overseer = { git = "https://github.com/paritytech/polkadot", branch = "master" } diff --git a/client/collator/src/lib.rs b/client/collator/src/lib.rs index dfedeeaa744..79383c73a45 100644 --- a/client/collator/src/lib.rs +++ b/client/collator/src/lib.rs @@ -392,25 +392,20 @@ pub async fn start_collator( #[cfg(test)] mod tests { use super::*; - use std::{pin::Pin, time::Duration}; - - use sp_core::{testing::TaskExecutor, Pair}; - use sp_runtime::traits::DigestFor; - use cumulus_client_consensus_common::ParachainCandidate; use cumulus_test_client::{ - Client, DefaultTestClientBuilderExt, InitBlockBuilder, TestClientBuilder, - TestClientBuilderExt, + Client, ClientBlockImportExt, DefaultTestClientBuilderExt, InitBlockBuilder, + TestClientBuilder, TestClientBuilderExt, }; use cumulus_test_runtime::{Block, Header}; - use polkadot_overseer::{Overseer, AllSubsystems}; + use futures::{channel::mpsc, executor::block_on, StreamExt}; use polkadot_node_subsystem_test_helpers::ForwardSubsystem; - - use futures::{channel::mpsc, executor::block_on, future}; + use polkadot_overseer::{AllSubsystems, Overseer}; + use sp_consensus::BlockOrigin; + use sp_core::{testing::TaskExecutor, Pair}; struct DummyParachainConsensus { - client: Arc, - header: Header, + client: Mutex>, } #[async_trait::async_trait] @@ -421,22 +416,24 @@ mod tests { _: PHash, validation_data: &PersistedValidationData, ) -> Option> { - let block_id = BlockId::Hash(self.header.hash()); - let builder = self - .client - .init_block_builder_at(&block_id, Some(validation_data.clone()), Default::default()); + let block_id = BlockId::Hash(parent.hash()); + let mut client = self.client.lock(); + let builder = client.init_block_builder_at( + &block_id, + Some(validation_data.clone()), + Default::default(), + ); - let (block, storage_changes, proof) = - builder.build().expect("Creates block").into_inner(); + let (block, _, proof) = builder.build().expect("Creates block").into_inner(); client - .import(BlockOrigin::Own, block) + .import(BlockOrigin::Own, block.clone()) .expect("Imports the block"); - ParachainCandidate { + Some(ParachainCandidate { block, proof: proof.expect("Proof is returned"), - } + }) } } @@ -461,23 +458,19 @@ mod tests { spawner.spawn("overseer", overseer.run().then(|_| async { () }).boxed()); - let collator_start = - start_collator( - StartCollatorParams { - backend, - block_status: client.clone(), - announce_block: Arc::new(announce_block), - overseer_handler: handler, - spawner, - para_id, - key: CollatorPair::generate().0, - parachain_consensus: DummyParachainConsensus { - client: client.clone(), - header, - }, - }, - ); - block_on(collator_start).expect("Should start collator"); + let collator_start = start_collator(StartCollatorParams { + backend, + block_status: client.clone(), + announce_block: Arc::new(announce_block), + overseer_handler: handler, + spawner, + para_id, + key: CollatorPair::generate().0, + parachain_consensus: DummyParachainConsensus { + client: Mutex::new(client.clone()), + }, + }); + block_on(collator_start); let msg = block_on(sub_rx.into_future()) .0 @@ -490,7 +483,7 @@ mod tests { let mut validation_data = PersistedValidationData::default(); validation_data.parent_head = header.encode().into(); - let collation = block_on((config.collator)(relay_parent, &validation_data)) + let collation = block_on((config.collator)(Default::default(), &validation_data)) .expect("Collation is build"); let block_data = collation.proof_of_validity.block_data; From 58190b0fd74ae85b04f876bb64142525eaa2e3b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 12 Feb 2021 11:01:50 +0100 Subject: [PATCH 7/9] Change `ParachainConsensus` to take a mutable self --- client/collator/src/lib.rs | 22 +++++++++++----------- client/consensus/common/src/lib.rs | 2 +- client/consensus/relay-chain/src/lib.rs | 24 +++++++++++++++++++----- client/service/src/lib.rs | 2 +- 4 files changed, 32 insertions(+), 18 deletions(-) diff --git a/client/collator/src/lib.rs b/client/collator/src/lib.rs index 79383c73a45..6b7e1f5cf5b 100644 --- a/client/collator/src/lib.rs +++ b/client/collator/src/lib.rs @@ -53,12 +53,12 @@ const LOG_TARGET: &str = "cumulus-collator"; /// The implementation of the Cumulus `Collator`. pub struct Collator { block_status: Arc, - parachain_consensus: Arc, + parachain_consensus: PC, wait_to_announce: Arc>>, backend: Arc, } -impl Clone for Collator { +impl Clone for Collator { fn clone(&self) -> Self { Self { block_status: self.block_status.clone(), @@ -74,7 +74,7 @@ where Block: BlockT, BS: BlockBackend, Backend: sc_client_api::Backend + 'static, - PC: ParachainConsensus, + PC: ParachainConsensus + Clone, { /// Create a new instance. fn new( @@ -95,7 +95,7 @@ where block_status, wait_to_announce, backend, - parachain_consensus: Arc::new(parachain_consensus), + parachain_consensus, } } @@ -358,7 +358,7 @@ pub async fn start_collator( Backend: sc_client_api::Backend + 'static, BS: BlockBackend + Send + Sync + 'static, Spawner: SpawnNamed + Clone + Send + Sync + 'static, - PS: ParachainConsensus + Send + Sync + 'static, + PS: ParachainConsensus + Clone + Send + Sync + 'static, { let collator = Collator::new( overseer_handler.clone(), @@ -404,21 +404,21 @@ mod tests { use sp_consensus::BlockOrigin; use sp_core::{testing::TaskExecutor, Pair}; + #[derive(Clone)] struct DummyParachainConsensus { - client: Mutex>, + client: Arc, } #[async_trait::async_trait] impl ParachainConsensus for DummyParachainConsensus { async fn produce_candidate( - &self, + &mut self, parent: &Header, _: PHash, validation_data: &PersistedValidationData, ) -> Option> { let block_id = BlockId::Hash(parent.hash()); - let mut client = self.client.lock(); - let builder = client.init_block_builder_at( + let builder = self.client.init_block_builder_at( &block_id, Some(validation_data.clone()), Default::default(), @@ -426,7 +426,7 @@ mod tests { let (block, _, proof) = builder.build().expect("Creates block").into_inner(); - client + self.client .import(BlockOrigin::Own, block.clone()) .expect("Imports the block"); @@ -467,7 +467,7 @@ mod tests { para_id, key: CollatorPair::generate().0, parachain_consensus: DummyParachainConsensus { - client: Mutex::new(client.clone()), + client: client.clone(), }, }); block_on(collator_start); diff --git a/client/consensus/common/src/lib.rs b/client/consensus/common/src/lib.rs index ea04de6dc5a..98c62543beb 100644 --- a/client/consensus/common/src/lib.rs +++ b/client/consensus/common/src/lib.rs @@ -537,7 +537,7 @@ pub trait ParachainConsensus { /// /// It is expected that the block is async fn produce_candidate( - &self, + &mut self, parent: &B::Header, relay_parent: PHash, validation_data: &PersistedValidationData, diff --git a/client/consensus/relay-chain/src/lib.rs b/client/consensus/relay-chain/src/lib.rs index ee5aae0d896..8d98ebbeb4e 100644 --- a/client/consensus/relay-chain/src/lib.rs +++ b/client/consensus/relay-chain/src/lib.rs @@ -59,13 +59,27 @@ const LOG_TARGET: &str = "cumulus-consensus-relay-chain"; pub struct RelayChainConsensus { para_id: ParaId, _phantom: PhantomData, - proposer_factory: Mutex, + proposer_factory: Arc>, inherent_data_providers: InherentDataProviders, - block_import: Mutex, + block_import: Arc>, polkadot_client: Arc, polkadot_backend: Arc, } +impl Clone for RelayChainConsensus { + fn clone(&self) -> Self { + Self { + para_id: self.para_id, + _phantom: PhantomData, + proposer_factory: self.proposer_factory.clone(), + inherent_data_providers: self.inherent_data_providers.clone(), + block_import: self.block_import.clone(), + polkadot_backend: self.polkadot_backend.clone(), + polkadot_client: self.polkadot_client.clone(), + } + } +} + impl RelayChainConsensus where B: BlockT, @@ -84,9 +98,9 @@ where ) -> Self { Self { para_id, - proposer_factory: Mutex::new(proposer_factory), + proposer_factory: Arc::new(Mutex::new(proposer_factory)), inherent_data_providers, - block_import: Mutex::new(block_import), + block_import: Arc::new(Mutex::new(block_import)), polkadot_backend, polkadot_client, _phantom: PhantomData, @@ -150,7 +164,7 @@ where PF::Proposer: Proposer, { async fn produce_candidate( - &self, + &mut self, parent: &B::Header, relay_parent: PHash, validation_data: &PersistedValidationData, diff --git a/client/service/src/lib.rs b/client/service/src/lib.rs index f5b952ed91b..ef63f050beb 100644 --- a/client/service/src/lib.rs +++ b/client/service/src/lib.rs @@ -87,7 +87,7 @@ where for<'b> &'b Client: BlockImport, Backend: BackendT + 'static, Spawner: SpawnNamed + Clone + Send + Sync + 'static, - PC: ParachainConsensus + Send + Sync + 'static, + PC: ParachainConsensus + Clone + Send + Sync + 'static, RClient: ClientHandle, { relay_chain_full_node.client.execute_with(StartConsensus { From 80783846fbc3bcbe7bcd1eaf230fe3effab67e84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 15 Feb 2021 20:57:55 +0100 Subject: [PATCH 8/9] Make everything compile --- Cargo.lock | 6 +- client/collator/src/lib.rs | 24 ++-- client/consensus/common/Cargo.toml | 1 + client/consensus/common/src/import_queue.rs | 131 ----------------- client/consensus/common/src/lib.rs | 18 ++- client/consensus/relay-chain/src/lib.rs | 148 ++++++++++++++++++-- client/service/Cargo.toml | 2 - client/service/src/lib.rs | 63 +-------- rococo-parachains/Cargo.toml | 2 +- rococo-parachains/src/service.rs | 17 ++- test/service/Cargo.toml | 1 - test/service/src/lib.rs | 8 +- 12 files changed, 190 insertions(+), 231 deletions(-) delete mode 100644 client/consensus/common/src/import_queue.rs diff --git a/Cargo.lock b/Cargo.lock index 5719e23498a..0142420b2ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1119,6 +1119,7 @@ dependencies = [ "async-trait", "cumulus-test-client", "cumulus-test-runtime", + "dyn-clone", "futures 0.3.12", "futures-timer 3.0.2", "parity-scale-codec", @@ -1199,7 +1200,6 @@ dependencies = [ "cumulus-primitives-core", "futures 0.3.12", "parity-scale-codec", - "polkadot-overseer", "polkadot-primitives", "polkadot-service", "sc-chain-spec", @@ -1210,7 +1210,6 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-core", - "sp-inherents", "sp-runtime", "tracing", ] @@ -1409,7 +1408,6 @@ dependencies = [ name = "cumulus-test-service" version = "0.1.0" dependencies = [ - "cumulus-client-consensus-common", "cumulus-client-consensus-relay-chain", "cumulus-client-network", "cumulus-client-service", @@ -6936,7 +6934,7 @@ version = "0.1.0" dependencies = [ "assert_cmd", "cumulus-client-collator", - "cumulus-client-consensus-common", + "cumulus-client-consensus-relay-chain", "cumulus-client-network", "cumulus-client-service", "cumulus-primitives-core", diff --git a/client/collator/src/lib.rs b/client/collator/src/lib.rs index 7220562c094..7a783969135 100644 --- a/client/collator/src/lib.rs +++ b/client/collator/src/lib.rs @@ -51,14 +51,14 @@ use parking_lot::Mutex; const LOG_TARGET: &str = "cumulus-collator"; /// The implementation of the Cumulus `Collator`. -pub struct Collator { +pub struct Collator { block_status: Arc, - parachain_consensus: PC, + parachain_consensus: Box>, wait_to_announce: Arc>>, backend: Arc, } -impl Clone for Collator { +impl Clone for Collator { fn clone(&self) -> Self { Self { block_status: self.block_status.clone(), @@ -69,12 +69,11 @@ impl Clone for Collator Collator +impl Collator where Block: BlockT, BS: BlockBackend, Backend: sc_client_api::Backend + 'static, - PC: ParachainConsensus + Clone, { /// Create a new instance. fn new( @@ -82,7 +81,7 @@ where spawner: Arc, announce_block: Arc) + Send + Sync>, backend: Arc, - parachain_consensus: PC, + parachain_consensus: Box>, ) -> Self { let wait_to_announce = Arc::new(Mutex::new(WaitToAnnounce::new(spawner, announce_block))); @@ -330,7 +329,7 @@ where } /// Parameters for [`start_collator`]. -pub struct StartCollatorParams { +pub struct StartCollatorParams { pub para_id: ParaId, pub backend: Arc, pub block_status: Arc, @@ -338,11 +337,11 @@ pub struct StartCollatorParams { pub overseer_handler: OverseerHandler, pub spawner: Spawner, pub key: CollatorPair, - pub parachain_consensus: PS, + pub parachain_consensus: Box>, } /// Start the collator. -pub async fn start_collator( +pub async fn start_collator( StartCollatorParams { para_id, block_status, @@ -352,13 +351,12 @@ pub async fn start_collator( key, parachain_consensus, backend, - }: StartCollatorParams, + }: StartCollatorParams, ) where Block: BlockT, Backend: sc_client_api::Backend + 'static, BS: BlockBackend + Send + Sync + 'static, Spawner: SpawnNamed + Clone + Send + Sync + 'static, - PS: ParachainConsensus + Clone + Send + Sync + 'static, { let collator = Collator::new( block_status, @@ -465,9 +463,9 @@ mod tests { spawner, para_id, key: CollatorPair::generate().0, - parachain_consensus: DummyParachainConsensus { + parachain_consensus: Box::new(DummyParachainConsensus { client: client.clone(), - }, + }), }); block_on(collator_start); diff --git a/client/consensus/common/Cargo.toml b/client/consensus/common/Cargo.toml index 74fd292ab1c..75bc0875221 100644 --- a/client/consensus/common/Cargo.toml +++ b/client/consensus/common/Cargo.toml @@ -28,6 +28,7 @@ tokio = "0.1.22" codec = { package = "parity-scale-codec", version = "2.0.0", features = [ "derive" ] } tracing = "0.1.22" async-trait = "0.1.42" +dyn-clone = "1.0.4" [dev-dependencies] # Substrate deps diff --git a/client/consensus/common/src/import_queue.rs b/client/consensus/common/src/import_queue.rs deleted file mode 100644 index eeb6a0a95a5..00000000000 --- a/client/consensus/common/src/import_queue.rs +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2019 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 . - -use std::{marker::PhantomData, sync::Arc}; - -use sp_api::ProvideRuntimeApi; -use sp_block_builder::BlockBuilder as BlockBuilderApi; -use sp_blockchain::Result as ClientResult; -use sp_consensus::{ - error::Error as ConsensusError, - import_queue::{BasicQueue, CacheKeyId, Verifier as VerifierT}, - BlockImport, BlockImportParams, BlockOrigin, ForkChoiceStrategy, -}; -use sp_inherents::InherentDataProviders; -use sp_runtime::{ - generic::BlockId, - traits::{Block as BlockT, Header as HeaderT}, - Justification, -}; - -/// A verifier that just checks the inherents. -struct Verifier { - client: Arc, - inherent_data_providers: InherentDataProviders, - _marker: PhantomData, -} - -impl VerifierT for Verifier -where - Block: BlockT, - Client: ProvideRuntimeApi + Send + Sync, - >::Api: BlockBuilderApi, -{ - fn verify( - &mut self, - origin: BlockOrigin, - header: Block::Header, - justification: Option, - mut body: Option>, - ) -> Result< - ( - BlockImportParams, - Option)>>, - ), - String, - > { - if let Some(inner_body) = body.take() { - let inherent_data = self - .inherent_data_providers - .create_inherent_data() - .map_err(|e| e.into_string())?; - - let block = Block::new(header.clone(), inner_body); - - let inherent_res = self - .client - .runtime_api() - .check_inherents( - &BlockId::Hash(*header.parent_hash()), - block.clone(), - inherent_data, - ) - .map_err(|e| format!("{:?}", e))?; - - if !inherent_res.ok() { - inherent_res.into_errors().try_for_each(|(i, e)| { - Err(self.inherent_data_providers.error_to_string(&i, &e)) - })?; - } - - let (_, inner_body) = block.deconstruct(); - body = Some(inner_body); - } - - let post_hash = Some(header.hash()); - let mut block_import_params = BlockImportParams::new(origin, header); - block_import_params.body = body; - block_import_params.justification = justification; - - // Best block is determined by the relay chain, or if we are doing the intial sync - // we import all blocks as new best. - block_import_params.fork_choice = Some(ForkChoiceStrategy::Custom( - origin == BlockOrigin::NetworkInitialSync, - )); - block_import_params.post_hash = post_hash; - - Ok((block_import_params, None)) - } -} - -/// Start an import queue for a Cumulus collator that does not uses any special authoring logic. -pub fn import_queue( - client: Arc, - block_import: I, - inherent_data_providers: InherentDataProviders, - spawner: &impl sp_core::traits::SpawnNamed, - registry: Option<&substrate_prometheus_endpoint::Registry>, -) -> ClientResult> -where - I: BlockImport + Send + Sync + 'static, - I::Transaction: Send, - Client: ProvideRuntimeApi + Send + Sync + 'static, - >::Api: BlockBuilderApi, -{ - let verifier = Verifier { - client, - inherent_data_providers, - _marker: PhantomData, - }; - - Ok(BasicQueue::new( - verifier, - Box::new(block_import), - None, - spawner, - registry, - )) -} diff --git a/client/consensus/common/src/lib.rs b/client/consensus/common/src/lib.rs index 98c62543beb..e17fdf0f809 100644 --- a/client/consensus/common/src/lib.rs +++ b/client/consensus/common/src/lib.rs @@ -38,8 +38,6 @@ use futures::{future, select, FutureExt, Stream, StreamExt}; use std::{marker::PhantomData, sync::Arc}; -pub mod import_queue; - /// Errors that can occur while following the polkadot relay-chain. #[derive(Debug)] pub enum Error { @@ -527,7 +525,7 @@ pub struct ParachainCandidate { /// specific collator should build candidate for the given relay chain block. The consensus /// implementation could for example check if this specific collator is part of the validator. #[async_trait::async_trait] -pub trait ParachainConsensus { +pub trait ParachainConsensus: Send + Sync + dyn_clone::DynClone { /// Produce a new candidate at the given parent block. /// /// Should return `None` if the consensus implementation decided that it shouldn't build a @@ -544,6 +542,20 @@ pub trait ParachainConsensus { ) -> Option>; } +dyn_clone::clone_trait_object!( ParachainConsensus where B: BlockT); + +#[async_trait::async_trait] +impl ParachainConsensus for Box + Send + Sync> { + async fn produce_candidate( + &mut self, + parent: &B::Header, + relay_parent: PHash, + validation_data: &PersistedValidationData, + ) -> Option> { + (*self).produce_candidate(parent, relay_parent, validation_data).await + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/client/consensus/relay-chain/src/lib.rs b/client/consensus/relay-chain/src/lib.rs index 8d98ebbeb4e..d376b4c933a 100644 --- a/client/consensus/relay-chain/src/lib.rs +++ b/client/consensus/relay-chain/src/lib.rs @@ -39,7 +39,9 @@ use cumulus_primitives_core::{ ParaId, PersistedValidationData, }; use cumulus_primitives_parachain_inherent::ParachainInherentData; +pub use import_queue::import_queue; use parking_lot::Mutex; +use polkadot_service::ClientHandle; use sc_client_api::Backend; use sp_api::ProvideRuntimeApi; use sp_consensus::{ @@ -47,9 +49,8 @@ use sp_consensus::{ Proposer, RecordProof, }; use sp_inherents::{InherentData, InherentDataProviders}; -use sp_runtime::traits::{Block as BlockT, Header as HeaderT}; +use sp_runtime::traits::{Block as BlockT, HashFor, Header as HeaderT}; use std::{marker::PhantomData, sync::Arc, time::Duration}; -pub use import_queue::import_queue; mod import_queue; @@ -62,8 +63,8 @@ pub struct RelayChainConsensus { proposer_factory: Arc>, inherent_data_providers: InherentDataProviders, block_import: Arc>, - polkadot_client: Arc, - polkadot_backend: Arc, + relay_chain_client: Arc, + relay_chain_backend: Arc, } impl Clone for RelayChainConsensus { @@ -74,8 +75,8 @@ impl Clone for RelayChainConsensus { + pub para_id: ParaId, + pub proposer_factory: PF, + pub inherent_data_providers: InherentDataProviders, + pub block_import: BI, + pub relay_chain_client: polkadot_service::Client, + pub relay_chain_backend: Arc, +} + +/// Build the [`RelayChainConsensus`]. +/// +/// Returns a boxed [`ParachainConsensus`]. +pub fn build_relay_chain_consensus( + BuildRelayChainConsensusParams { + para_id, + proposer_factory, + inherent_data_providers, + block_import, + relay_chain_client, + relay_chain_backend, + }: BuildRelayChainConsensusParams, +) -> Box> +where + Block: BlockT, + PF: Environment + Send + Sync + 'static, + PF::Proposer: Proposer, + BI: BlockImport + Send + Sync + 'static, + RBackend: Backend + 'static, + // Rust bug: https://github.com/rust-lang/rust/issues/24159 + sc_client_api::StateBackendFor: sc_client_api::StateBackend>, +{ + RelayChainConsensusBuilder::new( + para_id, + proposer_factory, + block_import, + inherent_data_providers, + relay_chain_client, + relay_chain_backend, + ) + .build() +} + +/// Relay chain consensus builder. +/// +/// Builds a [`RelayChainConsensus`] for a parachain. As this requires +/// a concrete relay chain client instance, the builder takes a [`polkadot_service::Client`] +/// that wraps this concrete instanace. By using [`polkadot_service::ExecuteWithClient`] +/// the builder gets access to this concrete instance. +struct RelayChainConsensusBuilder { + para_id: ParaId, + _phantom: PhantomData, + proposer_factory: PF, + inherent_data_providers: InherentDataProviders, + block_import: BI, + relay_chain_backend: Arc, + relay_chain_client: polkadot_service::Client, +} + +impl RelayChainConsensusBuilder +where + Block: BlockT, + // Rust bug: https://github.com/rust-lang/rust/issues/24159 + sc_client_api::StateBackendFor: sc_client_api::StateBackend>, + PF: Environment + Send + Sync + 'static, + PF::Proposer: Proposer, + BI: BlockImport + Send + Sync + 'static, + RBackend: Backend + 'static, +{ + /// Create a new instance of the builder. + fn new( + para_id: ParaId, + proposer_factory: PF, + block_import: BI, + inherent_data_providers: InherentDataProviders, + relay_chain_client: polkadot_service::Client, + relay_chain_backend: Arc, + ) -> Self { + Self { + para_id, + _phantom: PhantomData, + proposer_factory, + block_import, + inherent_data_providers, + relay_chain_backend, + relay_chain_client, + } + } + + /// Build the relay chain consensus. + fn build(self) -> Box> { + self.relay_chain_client.clone().execute_with(self) + } +} + +impl polkadot_service::ExecuteWithClient + for RelayChainConsensusBuilder +where + Block: BlockT, + // Rust bug: https://github.com/rust-lang/rust/issues/24159 + sc_client_api::StateBackendFor: sc_client_api::StateBackend>, + PF: Environment + Send + Sync + 'static, + PF::Proposer: Proposer, + BI: BlockImport + Send + Sync + 'static, + RBackend: Backend + 'static, +{ + type Output = Box>; + + fn execute_with_client(self, client: Arc) -> Self::Output + where + >::StateBackend: sp_api::StateBackend>, + PBackend: Backend, + PBackend::State: sp_api::StateBackend, + Api: polkadot_service::RuntimeApiCollection, + PClient: polkadot_service::AbstractClient + 'static, + { + Box::new(RelayChainConsensus::new( + self.para_id, + self.proposer_factory, + self.inherent_data_providers, + self.block_import, + client.clone(), + self.relay_chain_backend, + )) + } +} diff --git a/client/service/Cargo.toml b/client/service/Cargo.toml index ddee4895060..428ebc4506c 100644 --- a/client/service/Cargo.toml +++ b/client/service/Cargo.toml @@ -19,13 +19,11 @@ sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "mast sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } # Polkadot dependencies polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master" } polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "master" } -polkadot-overseer = { git = "https://github.com/paritytech/polkadot", branch = "master" } # Other deps futures = "0.3.6" diff --git a/client/service/src/lib.rs b/client/service/src/lib.rs index ef63f050beb..a930438863e 100644 --- a/client/service/src/lib.rs +++ b/client/service/src/lib.rs @@ -20,18 +20,16 @@ use cumulus_client_consensus_common::ParachainConsensus; use cumulus_primitives_core::ParaId; -use futures::{Future, FutureExt}; -use polkadot_overseer::OverseerHandler; +use futures::FutureExt; use polkadot_primitives::v1::{Block as PBlock, CollatorId, CollatorPair}; use polkadot_service::{AbstractClient, Client as PClient, ClientHandle, RuntimeApiCollection}; use sc_client_api::{ - Backend as BackendT, BlockBackend, BlockchainEvents, Finalizer, StateBackend, UsageProvider, + Backend as BackendT, BlockBackend, BlockchainEvents, Finalizer, UsageProvider, }; use sc_service::{error::Result as ServiceResult, Configuration, Role, TaskManager}; use sp_blockchain::HeaderBackend; -use sp_consensus::{BlockImport, Environment, Error as ConsensusError, Proposer}; +use sp_consensus::BlockImport; use sp_core::traits::SpawnNamed; -use sp_inherents::InherentDataProviders; use sp_runtime::traits::{BlakeTwo256, Block as BlockT}; use std::{marker::PhantomData, sync::Arc}; @@ -41,7 +39,7 @@ pub mod genesis; type RFullNode = polkadot_service::NewFull; /// Parameters given to [`start_collator`]. -pub struct StartCollatorParams<'a, Block: BlockT, BS, Client, Backend, Spawner, RClient, PC> { +pub struct StartCollatorParams<'a, Block: BlockT, BS, Client, Backend, Spawner, RClient> { pub backend: Arc, pub block_status: Arc, pub client: Arc, @@ -51,7 +49,7 @@ pub struct StartCollatorParams<'a, Block: BlockT, BS, Client, Backend, Spawner, pub collator_key: CollatorPair, pub relay_chain_full_node: RFullNode, pub task_manager: &'a mut TaskManager, - pub parachain_consensus: PC, + pub parachain_consensus: Box>, } /// Start a collator node for a parachain. @@ -59,7 +57,7 @@ pub struct StartCollatorParams<'a, Block: BlockT, BS, Client, Backend, Spawner, /// A collator is similar to a validator in a normal blockchain. /// It is responsible for producing blocks and sending the blocks to a /// parachain validator for validation and inclusion into the relay chain. -pub async fn start_collator<'a, Block, BS, Client, Backend, Spawner, RClient, PC>( +pub async fn start_collator<'a, Block, BS, Client, Backend, Spawner, RClient>( StartCollatorParams { backend, block_status, @@ -71,7 +69,7 @@ pub async fn start_collator<'a, Block, BS, Client, Backend, Spawner, RClient, PC task_manager, relay_chain_full_node, parachain_consensus, - }: StartCollatorParams<'a, Block, BS, Client, Backend, Spawner, RClient, PC>, + }: StartCollatorParams<'a, Block, BS, Client, Backend, Spawner, RClient>, ) -> sc_service::error::Result<()> where Block: BlockT, @@ -87,7 +85,6 @@ where for<'b> &'b Client: BlockImport, Backend: BackendT + 'static, Spawner: SpawnNamed + Clone + Send + Sync + 'static, - PC: ParachainConsensus + Clone + Send + Sync + 'static, RClient: ClientHandle, { relay_chain_full_node.client.execute_with(StartConsensus { @@ -117,52 +114,6 @@ where Ok(()) } -struct StartCollator { - proposer_factory: PF, - inherent_data_providers: InherentDataProviders, - backend: Arc, - block_import: BI, - block_status: Arc, - announce_block: Arc) + Send + Sync>, - overseer_handler: OverseerHandler, - spawner: Spawner, - para_id: ParaId, - collator_key: CollatorPair, - polkadot_backend: Arc, -} - -impl polkadot_service::ExecuteWithClient - for StartCollator -where - Block: BlockT, - PF: Environment + Send + 'static, - BI: BlockImport< - Block, - Error = ConsensusError, - Transaction = >::Transaction, - > + Send - + Sync - + 'static, - BS: BlockBackend + Send + Sync + 'static, - Backend: BackendT + 'static, - Spawner: SpawnNamed + Clone + Send + Sync + 'static, - PBackend2: sc_client_api::Backend + 'static, - PBackend2::State: sp_api::StateBackend, -{ - type Output = std::pin::Pin>>>; - - fn execute_with_client(self, client: Arc) -> Self::Output - where - >::StateBackend: sp_api::StateBackend, - PBackend: sc_client_api::Backend + 'static, - PBackend::State: sp_api::StateBackend, - Api: RuntimeApiCollection, - PClient: AbstractClient + 'static, - { - async move { Ok(()) }.boxed() - } -} - /// Parameters given to [`start_full_node`]. pub struct StartFullNodeParams<'a, Block: BlockT, Client, PClient> { pub para_id: ParaId, diff --git a/rococo-parachains/Cargo.toml b/rococo-parachains/Cargo.toml index 1f0b75c376b..023429820f2 100644 --- a/rococo-parachains/Cargo.toml +++ b/rococo-parachains/Cargo.toml @@ -56,7 +56,7 @@ sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "maste jsonrpc-core = "15.1.0" # Cumulus dependencies -cumulus-client-consensus-common = { path = "../client/consensus/common" } +cumulus-client-consensus-relay-chain = { path = "../client/consensus/relay-chain" } cumulus-client-collator = { path = "../client/collator" } cumulus-client-service = { path = "../client/service" } cumulus-client-network = { path = "../client/network" } diff --git a/rococo-parachains/src/service.rs b/rococo-parachains/src/service.rs index 933c7f7d6b4..bf6b507ee43 100644 --- a/rococo-parachains/src/service.rs +++ b/rococo-parachains/src/service.rs @@ -19,6 +19,7 @@ use cumulus_primitives_core::ParaId; use cumulus_client_service::{ prepare_node_config, start_collator, start_full_node, StartCollatorParams, StartFullNodeParams, }; +use cumulus_client_consensus_relay_chain::{build_relay_chain_consensus, BuildRelayChainConsensusParams}; use parachain_runtime::RuntimeApi; use polkadot_primitives::v0::CollatorPair; use rococo_parachain_primitives::Block; @@ -70,7 +71,7 @@ pub fn new_partial( client.clone(), ); - let import_queue = cumulus_client_consensus_common::import_queue::import_queue( + let import_queue = cumulus_client_consensus_relay_chain::import_queue( client.clone(), client.clone(), inherent_data_providers.clone(), @@ -188,13 +189,17 @@ where ); let spawner = task_manager.spawn_handle(); - let polkadot_backend = polkadot_full_node.backend.clone(); - - let params = StartCollatorParams { + let parachain_consensus = build_relay_chain_consensus(BuildRelayChainConsensusParams { para_id: id, - block_import: client.clone(), proposer_factory, inherent_data_providers: params.inherent_data_providers, + block_import: client.clone(), + relay_chain_client: polkadot_full_node.client.clone(), + relay_chain_backend: polkadot_full_node.backend.clone(), + }); + + let params = StartCollatorParams { + para_id: id, block_status: client.clone(), announce_block, client: client.clone(), @@ -203,7 +208,7 @@ where relay_chain_full_node: polkadot_full_node, spawner, backend, - polkadot_backend, + parachain_consensus, }; start_collator(params).await?; diff --git a/test/service/Cargo.toml b/test/service/Cargo.toml index 94dcfea69a3..8049994f70c 100644 --- a/test/service/Cargo.toml +++ b/test/service/Cargo.toml @@ -43,7 +43,6 @@ polkadot-test-service = { git = "https://github.com/paritytech/polkadot", branch polkadot-overseer = { git = "https://github.com/paritytech/polkadot", branch = "master" } # Cumulus -cumulus-client-consensus-common = { path = "../../client/consensus/common" } cumulus-client-consensus-relay-chain = { path = "../../client/consensus/relay-chain" } cumulus-client-network = { path = "../../client/network" } cumulus-client-service = { path = "../../client/service" } diff --git a/test/service/src/lib.rs b/test/service/src/lib.rs index ffd839ac23d..760750acda0 100644 --- a/test/service/src/lib.rs +++ b/test/service/src/lib.rs @@ -93,7 +93,7 @@ pub fn new_partial( client.clone(), ); - let import_queue = cumulus_client_consensus_common::import_queue::import_queue( + let import_queue = cumulus_client_consensus_relay_chain::import_queue( client.clone(), client.clone(), inherent_data_providers.clone(), @@ -135,8 +135,8 @@ async fn start_node_impl( )> where RB: Fn( - Arc>, - ) -> jsonrpc_core::IoHandler + Arc>, + ) -> jsonrpc_core::IoHandler + Send + 'static, { @@ -242,7 +242,7 @@ where task_manager: &mut task_manager, para_id, collator_key, - parachain_consensus, + parachain_consensus: Box::new(parachain_consensus), relay_chain_full_node, }; From 6839c6ce2048dc1784f4082f34ebb9cef513e0b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Tue, 16 Feb 2021 12:16:24 +0100 Subject: [PATCH 9/9] Feedback --- client/collator/src/lib.rs | 6 +++++- client/consensus/common/src/lib.rs | 2 +- client/consensus/relay-chain/src/lib.rs | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/client/collator/src/lib.rs b/client/collator/src/lib.rs index 7a783969135..ef3a9d0f45b 100644 --- a/client/collator/src/lib.rs +++ b/client/collator/src/lib.rs @@ -260,7 +260,11 @@ where relay_parent: PHash, validation_data: PersistedValidationData, ) -> Option { - tracing::trace!(target: LOG_TARGET, "Producing candidate"); + tracing::trace!( + target: LOG_TARGET, + relay_parent = ?relay_parent, + "Producing candidate", + ); let last_head = match Block::Header::decode(&mut &validation_data.parent_head.0[..]) { Ok(x) => x, diff --git a/client/consensus/common/src/lib.rs b/client/consensus/common/src/lib.rs index e17fdf0f809..b769e4f82dc 100644 --- a/client/consensus/common/src/lib.rs +++ b/client/consensus/common/src/lib.rs @@ -533,7 +533,7 @@ pub trait ParachainConsensus: Send + Sync + dyn_clone::DynClone { /// /// # NOTE /// - /// It is expected that the block is + /// It is expected that the block is already imported when the future resolves. async fn produce_candidate( &mut self, parent: &B::Header, diff --git a/client/consensus/relay-chain/src/lib.rs b/client/consensus/relay-chain/src/lib.rs index d376b4c933a..1fd6097e5f5 100644 --- a/client/consensus/relay-chain/src/lib.rs +++ b/client/consensus/relay-chain/src/lib.rs @@ -28,8 +28,8 @@ //! 3. The parachain validators validate at most X different parachain candidates, where X is the //! total number of parachain validators. //! -//! 4. The parachain candidate with the highest number of approvals is choosen by the relay-chain -//! block producer to be backed. +//! 4. The parachain candidate that is backed by the most validators is choosen by the relay-chain +//! block producer to be added as backed candidate on chain. //! //! 5. After the parachain candidate got backed and included, all collators start at 1.