diff --git a/Cargo.lock b/Cargo.lock
index ee12ffeaf1c6..57c59c25b0fa 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -506,16 +506,28 @@ version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+[[package]]
+name = "bitvec"
+version = "0.20.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848"
+dependencies = [
+ "funty 1.1.0",
+ "radium 0.6.2",
+ "tap",
+ "wyz 0.2.0",
+]
+
[[package]]
name = "bitvec"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c"
dependencies = [
- "funty",
- "radium",
+ "funty 2.0.0",
+ "radium 0.7.0",
"tap",
- "wyz",
+ "wyz 0.5.0",
]
[[package]]
@@ -625,7 +637,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a071c348a5ef6da1d3a87166b408170b46002382b1dda83992b5c2208cefb370"
dependencies = [
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
]
@@ -2214,7 +2226,7 @@ dependencies = [
"futures-timer",
"log",
"num-traits",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"scale-info",
]
@@ -2297,7 +2309,7 @@ name = "fork-tree"
version = "3.0.0"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
]
[[package]]
@@ -2325,7 +2337,7 @@ dependencies = [
"frame-system",
"linregress",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"paste",
"scale-info",
"serde",
@@ -2359,7 +2371,7 @@ dependencies = [
"lazy_static",
"linked-hash-map",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"rand 0.8.5",
"rand_pcg",
"sc-block-builder",
@@ -2406,7 +2418,7 @@ dependencies = [
"frame-election-provider-solution-type",
"frame-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-arithmetic",
"sp-core",
@@ -2423,7 +2435,7 @@ dependencies = [
"frame-support",
"frame-system",
"frame-try-runtime",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-io",
@@ -2439,7 +2451,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df6bb8542ef006ef0de09a5c4420787d79823c0ed7924225822362fd2bf2ff2d"
dependencies = [
"cfg-if",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
]
@@ -2451,7 +2463,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"futures",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"serde",
"sp-core",
"sp-io",
@@ -2473,7 +2485,7 @@ dependencies = [
"k256",
"log",
"once_cell",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"paste",
"scale-info",
"serde",
@@ -2539,7 +2551,7 @@ dependencies = [
"frame-support",
"frame-support-test-pallet",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"pretty_assertions",
"rustversion",
"scale-info",
@@ -2561,7 +2573,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"frame-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
]
@@ -2572,7 +2584,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"frame-support",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-core",
@@ -2591,7 +2603,7 @@ dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-runtime",
@@ -2603,7 +2615,7 @@ name = "frame-system-rpc-runtime-api"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sp-api",
]
@@ -2613,7 +2625,7 @@ version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
"frame-support",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sp-api",
"sp-runtime",
"sp-std",
@@ -2652,6 +2664,12 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394"
+[[package]]
+name = "funty"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7"
+
[[package]]
name = "funty"
version = "2.0.0"
@@ -3284,7 +3302,7 @@ version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
]
[[package]]
@@ -3586,7 +3604,7 @@ checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7"
name = "kusama-runtime"
version = "0.9.39"
dependencies = [
- "bitvec",
+ "bitvec 1.0.1",
"frame-benchmarking",
"frame-election-provider-support",
"frame-executive",
@@ -3646,7 +3664,7 @@ dependencies = [
"pallet-whitelist",
"pallet-xcm",
"pallet-xcm-benchmarks",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-primitives",
"polkadot-runtime-common",
"polkadot-runtime-parachains",
@@ -4575,7 +4593,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"futures",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sc-client-api",
"sc-offchain",
"sp-api",
@@ -4594,7 +4612,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"anyhow",
"jsonrpsee",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"serde",
"sp-api",
"sp-blockchain",
@@ -5157,7 +5175,7 @@ dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-runtime",
@@ -5172,7 +5190,7 @@ dependencies = [
"frame-support",
"frame-system",
"pallet-session",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-application-crypto",
"sp-authority-discovery",
@@ -5188,7 +5206,7 @@ dependencies = [
"frame-support",
"frame-system",
"impl-trait-for-tuples",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-runtime",
"sp-std",
@@ -5206,7 +5224,7 @@ dependencies = [
"pallet-authorship",
"pallet-session",
"pallet-timestamp",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-application-crypto",
"sp-consensus-babe",
@@ -5229,7 +5247,7 @@ dependencies = [
"frame-system",
"log",
"pallet-balances",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-io",
@@ -5266,7 +5284,7 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-runtime",
"sp-std",
@@ -5281,7 +5299,7 @@ dependencies = [
"frame-system",
"pallet-authorship",
"pallet-session",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-consensus-beefy",
@@ -5304,7 +5322,7 @@ dependencies = [
"pallet-beefy",
"pallet-mmr",
"pallet-session",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-api",
@@ -5325,7 +5343,7 @@ dependencies = [
"frame-system",
"log",
"pallet-treasury",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-io",
@@ -5344,7 +5362,7 @@ dependencies = [
"log",
"pallet-bounties",
"pallet-treasury",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-io",
@@ -5361,7 +5379,7 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-io",
@@ -5378,7 +5396,7 @@ dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-io",
@@ -5395,7 +5413,7 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-core",
@@ -5415,7 +5433,7 @@ dependencies = [
"frame-system",
"log",
"pallet-election-provider-support-benchmarking",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"rand 0.8.5",
"scale-info",
"sp-arithmetic",
@@ -5435,7 +5453,7 @@ dependencies = [
"frame-benchmarking",
"frame-election-provider-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sp-npos-elections",
"sp-runtime",
]
@@ -5449,7 +5467,7 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-io",
@@ -5468,7 +5486,7 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-io",
"sp-runtime",
@@ -5487,7 +5505,7 @@ dependencies = [
"log",
"pallet-authorship",
"pallet-session",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-application-crypto",
"sp-consensus-grandpa",
@@ -5508,7 +5526,7 @@ dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-io",
"sp-runtime",
@@ -5525,7 +5543,7 @@ dependencies = [
"frame-system",
"log",
"pallet-authorship",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-application-crypto",
"sp-core",
@@ -5543,7 +5561,7 @@ dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-io",
@@ -5561,7 +5579,7 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-io",
@@ -5577,7 +5595,7 @@ dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-io",
@@ -5595,7 +5613,7 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-io",
"sp-runtime",
@@ -5610,7 +5628,7 @@ dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-arithmetic",
"sp-core",
@@ -5626,7 +5644,7 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-io",
@@ -5647,7 +5665,7 @@ dependencies = [
"pallet-bags-list",
"pallet-nomination-pools",
"pallet-staking",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-runtime",
"sp-runtime-interface",
@@ -5661,7 +5679,7 @@ version = "1.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
"pallet-nomination-pools",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sp-api",
"sp-std",
]
@@ -5675,7 +5693,7 @@ dependencies = [
"frame-system",
"log",
"pallet-balances",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-runtime",
@@ -5700,7 +5718,7 @@ dependencies = [
"pallet-offences",
"pallet-session",
"pallet-staking",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-runtime",
"sp-staking",
@@ -5716,7 +5734,7 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-io",
@@ -5732,7 +5750,7 @@ dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-io",
"sp-runtime",
@@ -5748,7 +5766,7 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-arithmetic",
"sp-core",
@@ -5765,7 +5783,7 @@ dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-io",
"sp-runtime",
@@ -5782,7 +5800,7 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-arithmetic",
@@ -5800,7 +5818,7 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-io",
"sp-runtime",
@@ -5818,7 +5836,7 @@ dependencies = [
"impl-trait-for-tuples",
"log",
"pallet-timestamp",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-io",
@@ -5852,7 +5870,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"frame-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"rand_chacha 0.2.2",
"scale-info",
"sp-runtime",
@@ -5871,7 +5889,7 @@ dependencies = [
"log",
"pallet-authorship",
"pallet-session",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"rand_chacha 0.2.2",
"scale-info",
"serde",
@@ -5907,7 +5925,7 @@ name = "pallet-staking-runtime-api"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sp-api",
]
@@ -5920,7 +5938,7 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-io",
@@ -5935,7 +5953,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"frame-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-io",
"sp-runtime",
@@ -5951,7 +5969,7 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-inherents",
"sp-io",
@@ -5970,7 +5988,7 @@ dependencies = [
"frame-system",
"log",
"pallet-treasury",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-core",
@@ -5986,7 +6004,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"frame-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-core",
@@ -6002,7 +6020,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"jsonrpsee",
"pallet-transaction-payment-rpc-runtime-api",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sp-api",
"sp-blockchain",
"sp-core",
@@ -6017,7 +6035,7 @@ version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
"pallet-transaction-payment",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sp-api",
"sp-runtime",
"sp-weights",
@@ -6033,7 +6051,7 @@ dependencies = [
"frame-system",
"impl-trait-for-tuples",
"pallet-balances",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-runtime",
@@ -6049,7 +6067,7 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-runtime",
"sp-std",
@@ -6063,7 +6081,7 @@ dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-io",
@@ -6080,7 +6098,7 @@ dependencies = [
"frame-support",
"frame-system",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-runtime",
"sp-std",
@@ -6094,7 +6112,7 @@ dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-api",
"sp-runtime",
@@ -6111,7 +6129,7 @@ dependencies = [
"frame-system",
"log",
"pallet-balances",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-parachain",
"polkadot-runtime-parachains",
"scale-info",
@@ -6136,7 +6154,7 @@ dependencies = [
"pallet-assets",
"pallet-balances",
"pallet-xcm",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-primitives",
"polkadot-runtime-common",
"scale-info",
@@ -6170,6 +6188,19 @@ dependencies = [
"snap",
]
+[[package]]
+name = "parity-scale-codec"
+version = "2.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909"
+dependencies = [
+ "arrayvec 0.7.2",
+ "bitvec 0.20.4",
+ "byte-slice-cast",
+ "impl-trait-for-tuples",
+ "serde",
+]
+
[[package]]
name = "parity-scale-codec"
version = "3.3.0"
@@ -6177,7 +6208,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3840933452adf7b3b9145e27086a5a3376c619dca1a21b1e5a5af0d54979bed"
dependencies = [
"arrayvec 0.7.2",
- "bitvec",
+ "bitvec 1.0.1",
"byte-slice-cast",
"bytes",
"impl-trait-for-tuples",
@@ -6476,8 +6507,9 @@ dependencies = [
name = "polkadot-availability-bitfield-distribution"
version = "0.9.39"
dependencies = [
+ "always-assert",
"assert_matches",
- "bitvec",
+ "bitvec 1.0.1",
"env_logger 0.9.0",
"futures",
"log",
@@ -6507,7 +6539,7 @@ dependencies = [
"futures",
"futures-timer",
"lru 0.9.0",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-erasure-coding",
"polkadot-node-network-protocol",
"polkadot-node-primitives",
@@ -6537,7 +6569,7 @@ dependencies = [
"futures-timer",
"log",
"lru 0.9.0",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-erasure-coding",
"polkadot-node-network-protocol",
"polkadot-node-primitives",
@@ -6633,13 +6665,13 @@ version = "0.9.39"
dependencies = [
"always-assert",
"assert_matches",
- "bitvec",
+ "bitvec 1.0.1",
"env_logger 0.9.0",
"fatality",
"futures",
"futures-timer",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-node-network-protocol",
"polkadot-node-primitives",
"polkadot-node-subsystem",
@@ -6647,6 +6679,7 @@ dependencies = [
"polkadot-node-subsystem-util",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
+ "sc-keystore",
"sc-network",
"sp-core",
"sp-keyring",
@@ -6660,7 +6693,7 @@ dependencies = [
name = "polkadot-core-primitives"
version = "0.9.39"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-runtime",
@@ -6680,7 +6713,7 @@ dependencies = [
"indexmap",
"lazy_static",
"lru 0.9.0",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-erasure-coding",
"polkadot-node-network-protocol",
"polkadot-node-primitives",
@@ -6704,7 +6737,7 @@ name = "polkadot-erasure-coding"
version = "0.9.39"
dependencies = [
"criterion",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-node-primitives",
"polkadot-primitives",
"reed-solomon-novelpoly",
@@ -6751,7 +6784,7 @@ dependencies = [
"fatality",
"futures",
"futures-timer",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"polkadot-node-metrics",
"polkadot-node-network-protocol",
@@ -6774,7 +6807,7 @@ name = "polkadot-node-collation-generation"
version = "0.9.39"
dependencies = [
"futures",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-erasure-coding",
"polkadot-node-primitives",
"polkadot-node-subsystem",
@@ -6794,7 +6827,7 @@ version = "0.9.39"
dependencies = [
"assert_matches",
"async-trait",
- "bitvec",
+ "bitvec 1.0.1",
"derive_more",
"futures",
"futures-timer",
@@ -6802,7 +6835,7 @@ dependencies = [
"kvdb-memorydb",
"lru 0.9.0",
"merlin",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"polkadot-node-jaeger",
"polkadot-node-primitives",
@@ -6832,14 +6865,14 @@ name = "polkadot-node-core-av-store"
version = "0.9.39"
dependencies = [
"assert_matches",
- "bitvec",
+ "bitvec 1.0.1",
"env_logger 0.9.0",
"futures",
"futures-timer",
"kvdb",
"kvdb-memorydb",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"polkadot-erasure-coding",
"polkadot-node-primitives",
@@ -6861,7 +6894,7 @@ name = "polkadot-node-core-backing"
version = "0.9.39"
dependencies = [
"assert_matches",
- "bitvec",
+ "bitvec 1.0.1",
"fatality",
"futures",
"polkadot-erasure-coding",
@@ -6906,7 +6939,7 @@ dependencies = [
"async-trait",
"futures",
"futures-timer",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-node-core-pvf",
"polkadot-node-metrics",
"polkadot-node-primitives",
@@ -6928,7 +6961,7 @@ version = "0.9.39"
dependencies = [
"futures",
"maplit",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-node-metrics",
"polkadot-node-primitives",
"polkadot-node-subsystem",
@@ -6950,7 +6983,7 @@ dependencies = [
"futures-timer",
"kvdb",
"kvdb-memorydb",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"polkadot-node-primitives",
"polkadot-node-subsystem",
@@ -6973,7 +7006,7 @@ dependencies = [
"kvdb",
"kvdb-memorydb",
"lru 0.9.0",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-node-primitives",
"polkadot-node-subsystem",
"polkadot-node-subsystem-test-helpers",
@@ -7006,11 +7039,36 @@ dependencies = [
"tracing-gum",
]
+[[package]]
+name = "polkadot-node-core-prospective-parachains"
+version = "0.9.16"
+dependencies = [
+ "assert_matches",
+ "bitvec 1.0.1",
+ "fatality",
+ "futures",
+ "parity-scale-codec 2.3.1",
+ "polkadot-node-primitives",
+ "polkadot-node-subsystem",
+ "polkadot-node-subsystem-test-helpers",
+ "polkadot-node-subsystem-types",
+ "polkadot-node-subsystem-util",
+ "polkadot-primitives",
+ "polkadot-primitives-test-helpers",
+ "sc-keystore",
+ "sp-application-crypto",
+ "sp-core",
+ "sp-keyring",
+ "sp-keystore",
+ "thiserror",
+ "tracing-gum",
+]
+
[[package]]
name = "polkadot-node-core-provisioner"
version = "0.9.39"
dependencies = [
- "bitvec",
+ "bitvec 1.0.1",
"fatality",
"futures",
"futures-timer",
@@ -7038,7 +7096,7 @@ dependencies = [
"futures-timer",
"hex-literal",
"libc",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"pin-project",
"polkadot-core-primitives",
"polkadot-node-metrics",
@@ -7116,7 +7174,7 @@ dependencies = [
"lazy_static",
"log",
"mick-jaeger",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"polkadot-node-primitives",
"polkadot-primitives",
@@ -7136,7 +7194,7 @@ dependencies = [
"futures-timer",
"hyper",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-primitives",
"polkadot-test-service",
"prioritized-metered-channel",
@@ -7158,11 +7216,12 @@ name = "polkadot-node-network-protocol"
version = "0.9.39"
dependencies = [
"async-trait",
+ "bitvec 1.0.1",
"derive_more",
"fatality",
"futures",
"hex",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-node-jaeger",
"polkadot-node-primitives",
"polkadot-primitives",
@@ -7181,7 +7240,7 @@ version = "0.9.39"
dependencies = [
"bounded-vec",
"futures",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-erasure-coding",
"polkadot-parachain",
"polkadot-primitives",
@@ -7266,7 +7325,7 @@ dependencies = [
"log",
"lru 0.9.0",
"parity-db",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.11.2",
"pin-project",
"polkadot-node-jaeger",
@@ -7321,7 +7380,7 @@ dependencies = [
"bounded-collections",
"derive_more",
"frame-support",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-core-primitives",
"scale-info",
"serde",
@@ -7349,9 +7408,9 @@ dependencies = [
name = "polkadot-primitives"
version = "0.9.39"
dependencies = [
- "bitvec",
+ "bitvec 1.0.1",
"hex-literal",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-core-primitives",
"polkadot-parachain",
"scale-info",
@@ -7417,7 +7476,7 @@ dependencies = [
name = "polkadot-runtime"
version = "0.9.39"
dependencies = [
- "bitvec",
+ "bitvec 1.0.1",
"frame-benchmarking",
"frame-election-provider-support",
"frame-executive",
@@ -7469,7 +7528,7 @@ dependencies = [
"pallet-utility",
"pallet-vesting",
"pallet-xcm",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-primitives",
"polkadot-runtime-common",
"polkadot-runtime-constants",
@@ -7514,7 +7573,7 @@ dependencies = [
name = "polkadot-runtime-common"
version = "0.9.39"
dependencies = [
- "bitvec",
+ "bitvec 1.0.1",
"frame-benchmarking",
"frame-election-provider-support",
"frame-support",
@@ -7536,7 +7595,7 @@ dependencies = [
"pallet-transaction-payment",
"pallet-treasury",
"pallet-vesting",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
"polkadot-runtime-parachains",
@@ -7578,7 +7637,7 @@ name = "polkadot-runtime-metrics"
version = "0.9.39"
dependencies = [
"bs58",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-primitives",
"sp-std",
"sp-tracing",
@@ -7590,7 +7649,7 @@ version = "0.9.39"
dependencies = [
"assert_matches",
"bitflags",
- "bitvec",
+ "bitvec 1.0.1",
"derive_more",
"frame-benchmarking",
"frame-support",
@@ -7607,7 +7666,7 @@ dependencies = [
"pallet-staking",
"pallet-timestamp",
"pallet-vesting",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-parachain",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
@@ -7680,6 +7739,7 @@ dependencies = [
"polkadot-node-core-chain-selection",
"polkadot-node-core-dispute-coordinator",
"polkadot-node-core-parachains-inherent",
+ "polkadot-node-core-prospective-parachains",
"polkadot-node-core-provisioner",
"polkadot-node-core-pvf-checker",
"polkadot-node-core-runtime-api",
@@ -7759,18 +7819,21 @@ version = "0.9.39"
dependencies = [
"arrayvec 0.5.2",
"assert_matches",
+ "bitvec 1.0.1",
"fatality",
"futures",
"futures-timer",
"indexmap",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-node-network-protocol",
"polkadot-node-primitives",
"polkadot-node-subsystem",
"polkadot-node-subsystem-test-helpers",
+ "polkadot-node-subsystem-types",
"polkadot-node-subsystem-util",
"polkadot-primitives",
"polkadot-primitives-test-helpers",
+ "rand_chacha 0.3.1",
"sc-keystore",
"sc-network",
"sp-application-crypto",
@@ -7788,7 +7851,7 @@ dependencies = [
name = "polkadot-statement-table"
version = "0.9.39"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-primitives",
"sp-core",
]
@@ -7798,7 +7861,7 @@ name = "polkadot-test-client"
version = "0.9.39"
dependencies = [
"futures",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-node-subsystem",
"polkadot-primitives",
"polkadot-test-runtime",
@@ -7851,7 +7914,7 @@ dependencies = [
name = "polkadot-test-runtime"
version = "0.9.39"
dependencies = [
- "bitvec",
+ "bitvec 1.0.1",
"frame-election-provider-support",
"frame-executive",
"frame-support",
@@ -7875,7 +7938,7 @@ dependencies = [
"pallet-transaction-payment-rpc-runtime-api",
"pallet-vesting",
"pallet-xcm",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-parachain",
"polkadot-primitives",
"polkadot-runtime-common",
@@ -8351,6 +8414,12 @@ dependencies = [
"proc-macro2",
]
+[[package]]
+name = "radium"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb"
+
[[package]]
name = "radium"
version = "0.7.0"
@@ -8759,7 +8828,7 @@ dependencies = [
"pallet-vesting",
"pallet-xcm",
"pallet-xcm-benchmarks",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-parachain",
"polkadot-primitives",
"polkadot-runtime-common",
@@ -9035,7 +9104,7 @@ dependencies = [
"ip_network",
"libp2p",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"prost",
"prost-build",
"rand 0.8.5",
@@ -9060,7 +9129,7 @@ dependencies = [
"futures",
"futures-timer",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sc-block-builder",
"sc-client-api",
"sc-proposer-metrics",
@@ -9080,7 +9149,7 @@ name = "sc-block-builder"
version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sc-client-api",
"sp-api",
"sp-block-builder",
@@ -9133,7 +9202,7 @@ dependencies = [
"libp2p",
"log",
"names",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"rand 0.8.5",
"regex",
"rpassword",
@@ -9168,7 +9237,7 @@ dependencies = [
"fnv",
"futures",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"sc-executor",
"sc-transaction-pool-api",
@@ -9198,7 +9267,7 @@ dependencies = [
"linked-hash-map",
"log",
"parity-db",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"sc-client-api",
"sc-state-db",
@@ -9250,7 +9319,7 @@ dependencies = [
"num-bigint",
"num-rational",
"num-traits",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"sc-client-api",
"sc-consensus",
@@ -9308,7 +9377,7 @@ dependencies = [
"fnv",
"futures",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"sc-client-api",
"sc-consensus",
@@ -9341,7 +9410,7 @@ dependencies = [
"futures",
"jsonrpsee",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"sc-consensus-beefy",
"sc-rpc",
@@ -9358,7 +9427,7 @@ version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
"fork-tree",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sc-client-api",
"sc-consensus",
"sp-blockchain",
@@ -9379,7 +9448,7 @@ dependencies = [
"futures",
"futures-timer",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"rand 0.8.5",
"sc-block-builder",
@@ -9414,7 +9483,7 @@ dependencies = [
"futures",
"jsonrpsee",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sc-client-api",
"sc-consensus-grandpa",
"sc-rpc",
@@ -9434,7 +9503,7 @@ dependencies = [
"futures",
"futures-timer",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sc-client-api",
"sc-consensus",
"sc-telemetry",
@@ -9454,7 +9523,7 @@ version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
"lru 0.8.1",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"sc-executor-common",
"sc-executor-wasmi",
@@ -9567,7 +9636,7 @@ dependencies = [
"log",
"lru 0.8.1",
"mockall",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"pin-project",
"rand 0.8.5",
@@ -9623,7 +9692,7 @@ dependencies = [
"futures",
"futures-timer",
"libp2p",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"prost-build",
"sc-consensus",
"sc-peerset",
@@ -9667,7 +9736,7 @@ dependencies = [
"futures",
"libp2p",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"prost",
"prost-build",
"sc-client-api",
@@ -9694,7 +9763,7 @@ dependencies = [
"log",
"lru 0.8.1",
"mockall",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"prost",
"prost-build",
"sc-client-api",
@@ -9723,7 +9792,7 @@ dependencies = [
"futures",
"libp2p",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"pin-project",
"sc-network",
"sc-network-common",
@@ -9749,7 +9818,7 @@ dependencies = [
"libp2p",
"num_cpus",
"once_cell",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"rand 0.8.5",
"sc-client-api",
@@ -9795,7 +9864,7 @@ dependencies = [
"futures",
"jsonrpsee",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"sc-block-builder",
"sc-chain-spec",
@@ -9823,7 +9892,7 @@ version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
"jsonrpsee",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sc-chain-spec",
"sc-transaction-pool-api",
"scale-info",
@@ -9862,7 +9931,7 @@ dependencies = [
"hex",
"jsonrpsee",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"sc-chain-spec",
"sc-client-api",
@@ -9889,7 +9958,7 @@ dependencies = [
"futures-timer",
"jsonrpsee",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"pin-project",
"rand 0.8.5",
@@ -9949,7 +10018,7 @@ version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"sp-core",
]
@@ -9976,7 +10045,7 @@ version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
"jsonrpsee",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sc-chain-spec",
"sc-client-api",
"sc-consensus-babe",
@@ -10080,7 +10149,7 @@ dependencies = [
"linked-hash-map",
"log",
"num-traits",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"sc-client-api",
"sc-transaction-pool-api",
@@ -10131,10 +10200,10 @@ version = "2.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c46be926081c9f4dd5dd9b6f1d3e3229f2360bc6502dd8836f84a93b7c75e99a"
dependencies = [
- "bitvec",
+ "bitvec 1.0.1",
"cfg-if",
"derive_more",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info-derive",
"serde",
]
@@ -10554,7 +10623,7 @@ name = "slot-range-helper"
version = "0.9.39"
dependencies = [
"enumn",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"paste",
"sp-runtime",
"sp-std",
@@ -10632,7 +10701,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"hash-db",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sp-api-proc-macro",
"sp-core",
"sp-runtime",
@@ -10662,7 +10731,7 @@ name = "sp-application-crypto"
version = "7.0.0"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-core",
@@ -10677,7 +10746,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"integer-sqrt",
"num-traits",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-std",
@@ -10689,7 +10758,7 @@ name = "sp-authority-discovery"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-api",
"sp-application-crypto",
@@ -10702,7 +10771,7 @@ name = "sp-block-builder"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sp-api",
"sp-inherents",
"sp-runtime",
@@ -10717,7 +10786,7 @@ dependencies = [
"futures",
"log",
"lru 0.8.1",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"sp-api",
"sp-consensus",
@@ -10748,7 +10817,7 @@ version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
"async-trait",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-api",
"sp-application-crypto",
@@ -10767,7 +10836,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"async-trait",
"merlin",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-api",
@@ -10789,7 +10858,7 @@ version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
"lazy_static",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-api",
@@ -10809,7 +10878,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"finality-grandpa",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-api",
@@ -10825,7 +10894,7 @@ name = "sp-consensus-slots"
version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-std",
@@ -10837,7 +10906,7 @@ name = "sp-consensus-vrf"
version = "0.10.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"schnorrkel",
"sp-core",
@@ -10865,7 +10934,7 @@ dependencies = [
"libsecp256k1",
"log",
"merlin",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"primitive-types",
"rand 0.8.5",
@@ -10938,7 +11007,7 @@ version = "0.13.0"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
"environmental",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sp-std",
"sp-storage",
]
@@ -10950,7 +11019,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"async-trait",
"impl-trait-for-tuples",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-runtime",
@@ -10969,7 +11038,7 @@ dependencies = [
"futures",
"libsecp256k1",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"secp256k1",
"sp-core",
"sp-externalities",
@@ -11001,7 +11070,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"futures",
"merlin",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"schnorrkel",
"serde",
@@ -11026,7 +11095,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"ckb-merkle-mountain-range",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-api",
@@ -11042,7 +11111,7 @@ name = "sp-npos-elections"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-arithmetic",
@@ -11090,7 +11159,7 @@ dependencies = [
"hash256-std-hasher",
"impl-trait-for-tuples",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"paste",
"rand 0.8.5",
"scale-info",
@@ -11110,7 +11179,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"bytes",
"impl-trait-for-tuples",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"primitive-types",
"sp-externalities",
"sp-runtime-interface-proc-macro",
@@ -11138,7 +11207,7 @@ name = "sp-session"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-api",
"sp-core",
@@ -11152,7 +11221,7 @@ name = "sp-staking"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-runtime",
@@ -11166,7 +11235,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"hash-db",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"rand 0.8.5",
"smallvec",
@@ -11190,7 +11259,7 @@ version = "7.0.0"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
"impl-serde",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"ref-cast",
"serde",
"sp-debug-derive",
@@ -11205,7 +11274,7 @@ dependencies = [
"async-trait",
"futures-timer",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sp-inherents",
"sp-runtime",
"sp-std",
@@ -11217,7 +11286,7 @@ name = "sp-tracing"
version = "6.0.0"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sp-std",
"tracing",
"tracing-core",
@@ -11240,7 +11309,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"async-trait",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"sp-core",
"sp-inherents",
@@ -11260,7 +11329,7 @@ dependencies = [
"lazy_static",
"memory-db",
"nohash-hasher",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parking_lot 0.12.1",
"scale-info",
"schnellru",
@@ -11278,7 +11347,7 @@ version = "5.0.0"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
"impl-serde",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"parity-wasm",
"scale-info",
"serde",
@@ -11294,7 +11363,7 @@ name = "sp-version-proc-macro"
version = "4.0.0-dev"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"proc-macro2",
"quote",
"syn",
@@ -11308,7 +11377,7 @@ dependencies = [
"anyhow",
"impl-trait-for-tuples",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sp-std",
"wasmi",
"wasmtime",
@@ -11319,7 +11388,7 @@ name = "sp-weights"
version = "4.0.0"
source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134d8c7870396cb04bca63a674abfd5"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"smallvec",
@@ -11385,7 +11454,7 @@ dependencies = [
"pallet-election-provider-multi-phase",
"pallet-staking",
"pallet-transaction-payment",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"paste",
"polkadot-core-primitives",
"polkadot-runtime",
@@ -11551,7 +11620,7 @@ dependencies = [
"futures",
"jsonrpsee",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sc-rpc-api",
"sc-transaction-pool-api",
"sp-api",
@@ -11593,7 +11662,7 @@ source = "git+https://github.com/paritytech/substrate?branch=master#9d2d020c5134
dependencies = [
"jsonrpsee",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sc-client-api",
"sc-rpc-api",
"scale-info",
@@ -11613,7 +11682,7 @@ dependencies = [
"array-bytes",
"async-trait",
"futures",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sc-client-api",
"sc-client-db",
"sc-consensus",
@@ -11806,7 +11875,7 @@ name = "test-parachain-adder"
version = "0.9.39"
dependencies = [
"dlmalloc",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-parachain",
"sp-io",
"sp-std",
@@ -11822,7 +11891,7 @@ dependencies = [
"futures",
"futures-timer",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-cli",
"polkadot-node-core-pvf",
"polkadot-node-primitives",
@@ -11853,7 +11922,7 @@ version = "0.9.39"
dependencies = [
"dlmalloc",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-parachain",
"sp-io",
"sp-std",
@@ -11869,7 +11938,7 @@ dependencies = [
"futures",
"futures-timer",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-cli",
"polkadot-node-core-pvf",
"polkadot-node-primitives",
@@ -11891,7 +11960,7 @@ dependencies = [
name = "test-parachains"
version = "0.9.39"
dependencies = [
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sp-core",
"test-parachain-adder",
"test-parachain-halt",
@@ -12464,7 +12533,7 @@ dependencies = [
"frame-try-runtime",
"hex",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sc-cli",
"sc-executor",
"sc-service",
@@ -13400,7 +13469,7 @@ dependencies = [
name = "westend-runtime"
version = "0.9.39"
dependencies = [
- "bitvec",
+ "bitvec 1.0.1",
"frame-benchmarking",
"frame-election-provider-support",
"frame-executive",
@@ -13454,7 +13523,7 @@ dependencies = [
"pallet-vesting",
"pallet-xcm",
"pallet-xcm-benchmarks",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-parachain",
"polkadot-primitives",
"polkadot-runtime-common",
@@ -13725,6 +13794,12 @@ dependencies = [
"winapi",
]
+[[package]]
+name = "wyz"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214"
+
[[package]]
name = "wyz"
version = "0.5.0"
@@ -13803,7 +13878,7 @@ dependencies = [
"hex-literal",
"impl-trait-for-tuples",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"scale-info",
"serde",
"sp-io",
@@ -13823,7 +13898,7 @@ dependencies = [
"pallet-balances",
"pallet-transaction-payment",
"pallet-xcm",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-parachain",
"polkadot-runtime-parachains",
"primitive-types",
@@ -13845,7 +13920,7 @@ dependencies = [
"frame-support",
"impl-trait-for-tuples",
"log",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"sp-arithmetic",
"sp-core",
"sp-io",
@@ -13890,7 +13965,7 @@ name = "xcm-simulator"
version = "0.9.39"
dependencies = [
"frame-support",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"paste",
"polkadot-core-primitives",
"polkadot-parachain",
@@ -13911,7 +13986,7 @@ dependencies = [
"pallet-balances",
"pallet-uniques",
"pallet-xcm",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-core-primitives",
"polkadot-parachain",
"polkadot-runtime-parachains",
@@ -13937,7 +14012,7 @@ dependencies = [
"honggfuzz",
"pallet-balances",
"pallet-xcm",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"polkadot-core-primitives",
"polkadot-parachain",
"polkadot-runtime-parachains",
@@ -14002,7 +14077,7 @@ version = "0.9.39"
dependencies = [
"futures-util",
"lazy_static",
- "parity-scale-codec",
+ "parity-scale-codec 3.3.0",
"reqwest",
"serde",
"serde_json",
diff --git a/Cargo.toml b/Cargo.toml
index 5ec0a74d5cac..b3b081fbe853 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -78,6 +78,7 @@ members = [
"node/core/chain-selection",
"node/core/dispute-coordinator",
"node/core/parachains-inherent",
+ "node/core/prospective-parachains",
"node/core/provisioner",
"node/core/pvf",
"node/core/pvf-checker",
@@ -207,6 +208,7 @@ fast-runtime = [ "polkadot-cli/fast-runtime" ]
runtime-metrics = [ "polkadot-cli/runtime-metrics" ]
pyroscope = ["polkadot-cli/pyroscope"]
jemalloc-allocator = ["polkadot-node-core-pvf/jemalloc-allocator", "polkadot-overseer/jemalloc-allocator"]
+network-protocol-staging = ["polkadot-cli/network-protocol-staging"]
# Configuration for building a .deb package - for use with `cargo-deb`
[package.metadata.deb]
diff --git a/cli/Cargo.toml b/cli/Cargo.toml
index 01247bbc996f..0edf56d90cef 100644
--- a/cli/Cargo.toml
+++ b/cli/Cargo.toml
@@ -75,3 +75,4 @@ rococo-native = ["service/rococo-native"]
malus = ["full-node", "service/malus"]
runtime-metrics = ["service/runtime-metrics", "polkadot-node-metrics/runtime-metrics"]
+network-protocol-staging = ["service/network-protocol-staging"]
diff --git a/node/collation-generation/src/lib.rs b/node/collation-generation/src/lib.rs
index b3d728f70a48..7e5605b46a92 100644
--- a/node/collation-generation/src/lib.rs
+++ b/node/collation-generation/src/lib.rs
@@ -15,6 +15,19 @@
// along with Polkadot. If not, see .
//! The collation generation subsystem is the interface between polkadot and the collators.
+//!
+//! # Protocol
+//!
+//! On every `ActiveLeavesUpdate`:
+//!
+//! * If there is no collation generation config, ignore.
+//! * Otherwise, for each `activated` head in the update:
+//! * Determine if the para is scheduled on any core by fetching the `availability_cores` Runtime API.
+//! * Determine an occupied core assumption to make about the para. Scheduled cores can make [`OccupiedCoreAssumption::Free`].
+//! * TODO: What does this mean?
+//! * Use the Runtime API subsystem to fetch the full validation data.
+//! * Invoke the `collator`, and use its outputs to produce a [`CandidateReceipt`], signed with the configuration's `key`.
+//! * Dispatch a [`CollatorProtocolMessage::DistributeCollation`](receipt, pov)`.
#![deny(missing_docs)]
@@ -198,15 +211,15 @@ async fn handle_new_activations(
let (scheduled_core, assumption) = match core {
CoreState::Scheduled(scheduled_core) =>
(scheduled_core, OccupiedCoreAssumption::Free),
- CoreState::Occupied(_occupied_core) => {
- // TODO: https://github.com/paritytech/polkadot/issues/1573
- gum::trace!(
- target: LOG_TARGET,
- core_idx = %core_idx,
- relay_parent = ?relay_parent,
- "core is occupied. Keep going.",
- );
- continue
+ CoreState::Occupied(occupied_core) => {
+ // TODO [now]: this assumes that next up == current.
+ // in practice we should only set `OccupiedCoreAssumption::Included`
+ // when the candidate occupying the core is also of the same para.
+ if let Some(scheduled) = occupied_core.next_up_on_available {
+ (scheduled, OccupiedCoreAssumption::Included)
+ } else {
+ continue
+ }
},
CoreState::Free => {
gum::trace!(
@@ -286,6 +299,7 @@ async fn handle_new_activations(
"collation-builder",
Box::pin(async move {
let persisted_validation_data_hash = validation_data.hash();
+ let parent_head_data_hash = validation_data.parent_head.hash();
let (collation, result_sender) =
match (task_config.collator)(relay_parent, &validation_data).await {
@@ -385,8 +399,13 @@ async fn handle_new_activations(
if let Err(err) = task_sender
.send(
- CollatorProtocolMessage::DistributeCollation(ccr, pov, result_sender)
- .into(),
+ CollatorProtocolMessage::DistributeCollation(
+ ccr,
+ parent_head_data_hash,
+ pov,
+ result_sender,
+ )
+ .into(),
)
.await
{
diff --git a/node/core/approval-voting/src/criteria.rs b/node/core/approval-voting/src/criteria.rs
index 3b76941fde40..b9fb686a3063 100644
--- a/node/core/approval-voting/src/criteria.rs
+++ b/node/core/approval-voting/src/criteria.rs
@@ -274,7 +274,7 @@ pub(crate) fn compute_assignments(
// Ignore any cores where the assigned group is our own.
let leaving_cores = leaving_cores
.into_iter()
- .filter(|&(_, _, ref g)| !is_in_backing_group(&config.validator_groups, index, *g))
+ .filter(|(_, _, g)| !is_in_backing_group(&config.validator_groups, index, *g))
.map(|(c_hash, core, _)| (c_hash, core))
.collect::>();
@@ -496,7 +496,7 @@ pub(crate) fn check_assignment_cert(
return Err(InvalidAssignment(Reason::IsInBackingGroup))
}
- let &(ref vrf_output, ref vrf_proof) = &assignment.vrf;
+ let (vrf_output, vrf_proof) = &assignment.vrf;
match assignment.kind {
AssignmentCertKind::RelayVRFModulo { sample } => {
if sample >= config.relay_vrf_modulo_samples {
diff --git a/node/core/approval-voting/src/lib.rs b/node/core/approval-voting/src/lib.rs
index 59db8732a429..7793a3c58bb1 100644
--- a/node/core/approval-voting/src/lib.rs
+++ b/node/core/approval-voting/src/lib.rs
@@ -486,7 +486,7 @@ impl Wakeups {
.collect();
let mut pruned_wakeups = BTreeMap::new();
- self.reverse_wakeups.retain(|&(ref h, ref c_h), tick| {
+ self.reverse_wakeups.retain(|(h, c_h), tick| {
let live = !pruned_blocks.contains(h);
if !live {
pruned_wakeups.entry(*tick).or_insert_with(HashSet::new).insert((*h, *c_h));
diff --git a/node/core/approval-voting/src/ops.rs b/node/core/approval-voting/src/ops.rs
index 37f564c34f71..c0d6ce0e6054 100644
--- a/node/core/approval-voting/src/ops.rs
+++ b/node/core/approval-voting/src/ops.rs
@@ -62,7 +62,7 @@ fn visit_and_remove_block_entry(
};
overlayed_db.delete_block_entry(&block_hash);
- for &(_, ref candidate_hash) in block_entry.candidates() {
+ for (_, candidate_hash) in block_entry.candidates() {
let candidate = match visited_candidates.entry(*candidate_hash) {
Entry::Occupied(e) => e.into_mut(),
Entry::Vacant(e) => {
@@ -227,7 +227,7 @@ pub fn add_block_entry(
// read and write all updated entries.
{
- for &(_, ref candidate_hash) in entry.candidates() {
+ for (_, candidate_hash) in entry.candidates() {
let NewCandidateInfo { candidate, backing_group, our_assignment } =
match candidate_info(candidate_hash) {
None => return Ok(Vec::new()),
diff --git a/node/core/backing/src/error.rs b/node/core/backing/src/error.rs
index 36d4f859a0a8..fbb4c0ef1be3 100644
--- a/node/core/backing/src/error.rs
+++ b/node/core/backing/src/error.rs
@@ -17,9 +17,9 @@
use fatality::Nested;
use futures::channel::{mpsc, oneshot};
-use polkadot_node_subsystem::{messages::ValidationFailed, SubsystemError};
-use polkadot_node_subsystem_util::Error as UtilError;
-use polkadot_primitives::BackedCandidate;
+use polkadot_node_subsystem::{messages::ValidationFailed, RuntimeApiError, SubsystemError};
+use polkadot_node_subsystem_util::{runtime, Error as UtilError};
+use polkadot_primitives::{BackedCandidate, ValidationCodeHash};
use crate::LOG_TARGET;
@@ -30,6 +30,18 @@ pub type FatalResult = std::result::Result;
#[allow(missing_docs)]
#[fatality::fatality(splitable)]
pub enum Error {
+ #[fatal]
+ #[error("Failed to spawn background task")]
+ FailedToSpawnBackgroundTask,
+
+ #[fatal(forward)]
+ #[error("Error while accessing runtime information")]
+ Runtime(#[from] runtime::Error),
+
+ #[fatal]
+ #[error(transparent)]
+ BackgroundValidationMpsc(#[from] mpsc::SendError),
+
#[error("Candidate is not found")]
CandidateNotFound,
@@ -42,16 +54,27 @@ pub enum Error {
#[error("FetchPoV failed")]
FetchPoV,
- #[fatal]
- #[error("Failed to spawn background task")]
- FailedToSpawnBackgroundTask,
+ #[error("Fetching validation code by hash failed {0:?}, {1:?}")]
+ FetchValidationCode(ValidationCodeHash, RuntimeApiError),
+
+ #[error("Fetching Runtime API version failed {0:?}")]
+ FetchRuntimeApiVersion(RuntimeApiError),
+
+ #[error("No validation code {0:?}")]
+ NoValidationCode(ValidationCodeHash),
+
+ #[error("Candidate rejected by prospective parachains subsystem")]
+ RejectedByProspectiveParachains,
- #[error("ValidateFromChainState channel closed before receipt")]
- ValidateFromChainState(#[source] oneshot::Canceled),
+ #[error("ValidateFromExhaustive channel closed before receipt")]
+ ValidateFromExhaustive(#[source] oneshot::Canceled),
#[error("StoreAvailableData channel closed before receipt")]
StoreAvailableData(#[source] oneshot::Canceled),
+ #[error("RuntimeAPISubsystem channel closed before receipt")]
+ RuntimeApiUnavailable(#[source] oneshot::Canceled),
+
#[error("a channel was closed before receipt in try_join!")]
JoinMultiple(#[source] oneshot::Canceled),
@@ -61,10 +84,6 @@ pub enum Error {
#[error(transparent)]
ValidationFailed(#[from] ValidationFailed),
- #[fatal]
- #[error(transparent)]
- BackgroundValidationMpsc(#[from] mpsc::SendError),
-
#[error(transparent)]
UtilError(#[from] UtilError),
diff --git a/node/core/backing/src/lib.rs b/node/core/backing/src/lib.rs
index 32a6bb79037b..7a32a633d380 100644
--- a/node/core/backing/src/lib.rs
+++ b/node/core/backing/src/lib.rs
@@ -14,43 +14,98 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see .
-//! Implements a `CandidateBackingSubsystem`.
+//! Implements the `CandidateBackingSubsystem`.
+//!
+//! This subsystem maintains the entire responsibility of tracking parachain
+//! candidates which can be backed, as well as the issuance of statements
+//! about candidates when run on a validator node.
+//!
+//! There are two types of statements: `Seconded` and `Valid`.
+//! `Seconded` implies `Valid`, and nothing should be stated as
+//! `Valid` unless its already been `Seconded`.
+//!
+//! Validators may only second candidates which fall under their own group
+//! assignment, and they may only second one candidate per depth per active leaf.
+//! Candidates which are stated as either `Second` or `Valid` by a majority of the
+//! assigned group of validators may be backed on-chain and proceed to the availability
+//! stage.
+//!
+//! Depth is a concept relating to asynchronous backing, by which validators
+//! short sub-chains of candidates are backed and extended off-chain, and then placed
+//! asynchronously into blocks of the relay chain as those are authored and as the
+//! relay-chain state becomes ready for them. Asynchronous backing allows parachains to
+//! grow mostly independently from the state of the relay chain, which gives more time for
+//! parachains to be validated and thereby increases performance.
+//!
+//! Most of the work of asynchronous backing is handled by the Prospective Parachains
+//! subsystem. The 'depth' of a parachain block with respect to a relay chain block is
+//! a measure of how many parachain blocks are between the most recent included parachain block
+//! in the post-state of the relay-chain block and the candidate. For instance,
+//! a candidate that descends directly from the most recent parachain block in the relay-chain
+//! state has depth 0. The child of that candidate would have depth 1. And so on.
+//!
+//! The candidate backing subsystem keeps track of a set of 'active leaves' which are the
+//! most recent blocks in the relay-chain (which is in fact a tree) which could be built
+//! upon. Depth is always measured against active leaves, and the valid relay-parent that
+//! each candidate can have is determined by the active leaves. The Prospective Parachains
+//! subsystem enforces that the relay-parent increases monotonically, so that logic
+//! is not handled here. By communicating with the Prospective Parachains subsystem,
+//! this subsystem extrapolates an "implicit view" from the set of currently active leaves,
+//! which determines the set of all recent relay-chain block hashes which could be relay-parents
+//! for candidates backed in children of the active leaves.
+//!
+//! In fact, this subsystem relies on the Statement Distribution subsystem to prevent spam
+//! by enforcing the rule that each validator may second at most one candidate per depth per
+//! active leaf. This bounds the number of candidates that the system needs to consider and
+//! is not handled within this subsystem, except for candidates seconded locally.
+//!
+//! This subsystem also handles relay-chain heads which don't support asynchronous backing.
+//! For such active leaves, the only valid relay-parent is the leaf hash itself and the only
+//! allowed depth is 0.
#![deny(unused_crate_dependencies)]
use std::{
- collections::{HashMap, HashSet},
+ collections::{BTreeMap, HashMap, HashSet},
sync::Arc,
};
use bitvec::vec::BitVec;
use futures::{
channel::{mpsc, oneshot},
- FutureExt, SinkExt, StreamExt,
+ future::BoxFuture,
+ stream::FuturesOrdered,
+ FutureExt, SinkExt, StreamExt, TryFutureExt,
};
use error::{Error, FatalResult};
use polkadot_node_primitives::{
- AvailableData, InvalidCandidate, PoV, SignedFullStatement, Statement, ValidationResult,
+ minimum_votes, AvailableData, InvalidCandidate, PoV, SignedFullStatementWithPVD,
+ StatementWithPVD, ValidationResult,
};
use polkadot_node_subsystem::{
- jaeger,
messages::{
- AvailabilityDistributionMessage, AvailabilityStoreMessage, CandidateBackingMessage,
- CandidateValidationMessage, CollatorProtocolMessage, ProvisionableData, ProvisionerMessage,
+ AvailabilityDistributionMessage, AvailabilityStoreMessage, CanSecondRequest,
+ CandidateBackingMessage, CandidateValidationMessage, CollatorProtocolMessage,
+ HypotheticalCandidate, HypotheticalFrontierRequest, IntroduceCandidateRequest,
+ ProspectiveParachainsMessage, ProvisionableData, ProvisionerMessage, RuntimeApiMessage,
RuntimeApiRequest, StatementDistributionMessage,
},
- overseer, ActiveLeavesUpdate, FromOrchestra, OverseerSignal, PerLeafSpan, SpawnedSubsystem,
- Stage, SubsystemError,
+ overseer, ActiveLeavesUpdate, FromOrchestra, OverseerSignal, SpawnedSubsystem, SubsystemError,
};
use polkadot_node_subsystem_util::{
- self as util, request_from_runtime, request_session_index_for_child, request_validator_groups,
- request_validators, Validator,
+ self as util,
+ backing_implicit_view::{FetchError as ImplicitViewFetchError, View as ImplicitView},
+ request_from_runtime, request_session_index_for_child, request_validator_groups,
+ request_validators,
+ runtime::{prospective_parachains_mode, ProspectiveParachainsMode},
+ Validator,
};
use polkadot_primitives::{
- BackedCandidate, CandidateCommitments, CandidateHash, CandidateReceipt, CollatorId,
- CommittedCandidateReceipt, CoreIndex, CoreState, Hash, Id as ParaId, PvfExecTimeoutKind,
- SigningContext, ValidatorId, ValidatorIndex, ValidatorSignature, ValidityAttestation,
+ BackedCandidate, CandidateCommitments, CandidateHash, CandidateReceipt,
+ CommittedCandidateReceipt, CoreIndex, CoreState, Hash, Id as ParaId, PersistedValidationData,
+ PvfExecTimeoutKind, SigningContext, ValidationCode, ValidatorId, ValidatorIndex,
+ ValidatorSignature, ValidityAttestation,
};
use sp_keystore::KeystorePtr;
use statement_table::{
@@ -59,7 +114,7 @@ use statement_table::{
SignedStatement as TableSignedStatement, Statement as TableStatement,
Summary as TableSummary,
},
- Context as TableContextTrait, Table,
+ Config as TableConfig, Context as TableContextTrait, Table,
};
mod error;
@@ -107,9 +162,9 @@ impl std::fmt::Debug for ValidatedCandidateCommand {
impl ValidatedCandidateCommand {
fn candidate_hash(&self) -> CandidateHash {
match *self {
- ValidatedCandidateCommand::Second(Ok((ref candidate, _, _))) => candidate.hash(),
+ ValidatedCandidateCommand::Second(Ok(ref outputs)) => outputs.candidate.hash(),
ValidatedCandidateCommand::Second(Err(ref candidate)) => candidate.hash(),
- ValidatedCandidateCommand::Attest(Ok((ref candidate, _, _))) => candidate.hash(),
+ ValidatedCandidateCommand::Attest(Ok(ref outputs)) => outputs.candidate.hash(),
ValidatedCandidateCommand::Attest(Err(ref candidate)) => candidate.hash(),
ValidatedCandidateCommand::AttestNoPoV(candidate_hash) => candidate_hash,
}
@@ -146,6 +201,98 @@ where
}
}
+struct PerRelayParentState {
+ prospective_parachains_mode: ProspectiveParachainsMode,
+ /// The hash of the relay parent on top of which this job is doing it's work.
+ parent: Hash,
+ /// The `ParaId` assigned to the local validator at this relay parent.
+ assignment: Option,
+ /// The candidates that are backed by enough validators in their group, by hash.
+ backed: HashSet,
+ /// The table of candidates and statements under this relay-parent.
+ table: Table,
+ /// The table context, including groups.
+ table_context: TableContext,
+ /// We issued `Seconded` or `Valid` statements on about these candidates.
+ issued_statements: HashSet,
+ /// These candidates are undergoing validation in the background.
+ awaiting_validation: HashSet,
+ /// Data needed for retrying in case of `ValidatedCandidateCommand::AttestNoPoV`.
+ fallbacks: HashMap,
+}
+
+struct PerCandidateState {
+ persisted_validation_data: PersistedValidationData,
+ seconded_locally: bool,
+ para_id: ParaId,
+ relay_parent: Hash,
+}
+
+struct ActiveLeafState {
+ prospective_parachains_mode: ProspectiveParachainsMode,
+ /// The candidates seconded at various depths under this active
+ /// leaf with respect to parachain id. A candidate can only be
+ /// seconded when its hypothetical frontier under every active leaf
+ /// has an empty entry in this map.
+ ///
+ /// When prospective parachains are disabled, the only depth
+ /// which is allowed is 0.
+ seconded_at_depth: HashMap>,
+}
+
+/// The state of the subsystem.
+struct State {
+ /// The utility for managing the implicit and explicit views in a consistent way.
+ ///
+ /// We only feed leaves which have prospective parachains enabled to this view.
+ implicit_view: ImplicitView,
+ /// State tracked for all active leaves, whether or not they have prospective parachains
+ /// enabled.
+ per_leaf: HashMap,
+ /// State tracked for all relay-parents backing work is ongoing for. This includes
+ /// all active leaves.
+ ///
+ /// relay-parents fall into one of 3 categories.
+ /// 1. active leaves which do support prospective parachains
+ /// 2. active leaves which do not support prospective parachains
+ /// 3. relay-chain blocks which are ancestors of an active leaf and
+ /// do support prospective parachains.
+ ///
+ /// Relay-chain blocks which don't support prospective parachains are
+ /// never included in the fragment trees of active leaves which do.
+ ///
+ /// While it would be technically possible to support such leaves in
+ /// fragment trees, it only benefits the transition period when asynchronous
+ /// backing is being enabled and complicates code complexity.
+ per_relay_parent: HashMap,
+ /// State tracked for all candidates relevant to the implicit view.
+ ///
+ /// This is guaranteed to have an entry for each candidate with a relay parent in the implicit
+ /// or explicit view for which a `Seconded` statement has been successfully imported.
+ per_candidate: HashMap,
+ /// A cloneable sender which is dispatched to background candidate validation tasks to inform
+ /// the main task of the result.
+ background_validation_tx: mpsc::Sender<(Hash, ValidatedCandidateCommand)>,
+ /// The handle to the keystore used for signing.
+ keystore: KeystorePtr,
+}
+
+impl State {
+ fn new(
+ background_validation_tx: mpsc::Sender<(Hash, ValidatedCandidateCommand)>,
+ keystore: KeystorePtr,
+ ) -> Self {
+ State {
+ implicit_view: ImplicitView::default(),
+ per_leaf: HashMap::default(),
+ per_relay_parent: HashMap::default(),
+ per_candidate: HashMap::new(),
+ background_validation_tx,
+ keystore,
+ }
+ }
+}
+
#[overseer::contextbounds(CandidateBacking, prefix = self::overseer)]
async fn run(
mut ctx: Context,
@@ -153,18 +300,11 @@ async fn run(
metrics: Metrics,
) -> FatalResult<()> {
let (background_validation_tx, mut background_validation_rx) = mpsc::channel(16);
- let mut jobs = HashMap::new();
+ let mut state = State::new(background_validation_tx, keystore);
loop {
- let res = run_iteration(
- &mut ctx,
- keystore.clone(),
- &metrics,
- &mut jobs,
- background_validation_tx.clone(),
- &mut background_validation_rx,
- )
- .await;
+ let res =
+ run_iteration(&mut ctx, &mut state, &metrics, &mut background_validation_rx).await;
match res {
Ok(()) => break,
@@ -178,10 +318,8 @@ async fn run(
#[overseer::contextbounds(CandidateBacking, prefix = self::overseer)]
async fn run_iteration(
ctx: &mut Context,
- keystore: KeystorePtr,
+ state: &mut State,
metrics: &Metrics,
- jobs: &mut HashMap>,
- background_validation_tx: mpsc::Sender<(Hash, ValidatedCandidateCommand)>,
background_validation_rx: &mut mpsc::Receiver<(Hash, ValidatedCandidateCommand)>,
) -> Result<(), Error> {
loop {
@@ -190,9 +328,10 @@ async fn run_iteration(
if let Some((relay_parent, command)) = validated_command {
handle_validated_candidate_command(
&mut *ctx,
- jobs,
+ state,
relay_parent,
command,
+ metrics,
).await?;
} else {
panic!("background_validation_tx always alive at this point; qed");
@@ -200,240 +339,24 @@ async fn run_iteration(
}
from_overseer = ctx.recv().fuse() => {
match from_overseer? {
- FromOrchestra::Signal(OverseerSignal::ActiveLeaves(update)) => handle_active_leaves_update(
- &mut *ctx,
- update,
- jobs,
- &keystore,
- &background_validation_tx,
- &metrics,
- ).await?,
+ FromOrchestra::Signal(OverseerSignal::ActiveLeaves(update)) => {
+ handle_active_leaves_update(
+ &mut *ctx,
+ update,
+ state,
+ ).await?;
+ }
FromOrchestra::Signal(OverseerSignal::BlockFinalized(..)) => {}
FromOrchestra::Signal(OverseerSignal::Conclude) => return Ok(()),
- FromOrchestra::Communication { msg } => handle_communication(&mut *ctx, jobs, msg).await?,
+ FromOrchestra::Communication { msg } => {
+ handle_communication(&mut *ctx, state, msg, metrics).await?;
+ }
}
}
)
}
}
-#[overseer::contextbounds(CandidateBacking, prefix = self::overseer)]
-async fn handle_validated_candidate_command(
- ctx: &mut Context,
- jobs: &mut HashMap>,
- relay_parent: Hash,
- command: ValidatedCandidateCommand,
-) -> Result<(), Error> {
- if let Some(job) = jobs.get_mut(&relay_parent) {
- job.job.handle_validated_candidate_command(&job.span, ctx, command).await?;
- } else {
- // simple race condition; can be ignored - this relay-parent
- // is no longer relevant.
- }
-
- Ok(())
-}
-
-#[overseer::contextbounds(CandidateBacking, prefix = self::overseer)]
-async fn handle_communication(
- ctx: &mut Context,
- jobs: &mut HashMap>,
- message: CandidateBackingMessage,
-) -> Result<(), Error> {
- match message {
- CandidateBackingMessage::Second(relay_parent, candidate, pov) => {
- if let Some(job) = jobs.get_mut(&relay_parent) {
- job.job.handle_second_msg(&job.span, ctx, candidate, pov).await?;
- }
- },
- CandidateBackingMessage::Statement(relay_parent, statement) => {
- if let Some(job) = jobs.get_mut(&relay_parent) {
- job.job.handle_statement_message(&job.span, ctx, statement).await?;
- }
- },
- CandidateBackingMessage::GetBackedCandidates(relay_parent, requested_candidates, tx) =>
- if let Some(job) = jobs.get_mut(&relay_parent) {
- job.job.handle_get_backed_candidates_message(requested_candidates, tx)?;
- },
- }
-
- Ok(())
-}
-
-#[overseer::contextbounds(CandidateBacking, prefix = self::overseer)]
-async fn handle_active_leaves_update(
- ctx: &mut Context,
- update: ActiveLeavesUpdate,
- jobs: &mut HashMap>,
- keystore: &KeystorePtr,
- background_validation_tx: &mpsc::Sender<(Hash, ValidatedCandidateCommand)>,
- metrics: &Metrics,
-) -> Result<(), Error> {
- for deactivated in update.deactivated {
- jobs.remove(&deactivated);
- }
-
- let leaf = match update.activated {
- None => return Ok(()),
- Some(a) => a,
- };
-
- macro_rules! try_runtime_api {
- ($x: expr) => {
- match $x {
- Ok(x) => x,
- Err(e) => {
- gum::warn!(
- target: LOG_TARGET,
- err = ?e,
- "Failed to fetch runtime API data for job",
- );
-
- // We can't do candidate validation work if we don't have the
- // requisite runtime API data. But these errors should not take
- // down the node.
- return Ok(());
- }
- }
- }
- }
-
- let parent = leaf.hash;
- let span = PerLeafSpan::new(leaf.span, "backing");
- let _span = span.child("runtime-apis");
-
- let (validators, groups, session_index, cores) = futures::try_join!(
- request_validators(parent, ctx.sender()).await,
- request_validator_groups(parent, ctx.sender()).await,
- request_session_index_for_child(parent, ctx.sender()).await,
- request_from_runtime(parent, ctx.sender(), |tx| {
- RuntimeApiRequest::AvailabilityCores(tx)
- },)
- .await,
- )
- .map_err(Error::JoinMultiple)?;
-
- let validators: Vec<_> = try_runtime_api!(validators);
- let (validator_groups, group_rotation_info) = try_runtime_api!(groups);
- let session_index = try_runtime_api!(session_index);
- let cores = try_runtime_api!(cores);
-
- drop(_span);
- let _span = span.child("validator-construction");
-
- let signing_context = SigningContext { parent_hash: parent, session_index };
- let validator =
- match Validator::construct(&validators, signing_context.clone(), keystore.clone()) {
- Ok(v) => Some(v),
- Err(util::Error::NotAValidator) => None,
- Err(e) => {
- gum::warn!(
- target: LOG_TARGET,
- err = ?e,
- "Cannot participate in candidate backing",
- );
-
- return Ok(())
- },
- };
-
- drop(_span);
- let mut assignments_span = span.child("compute-assignments");
-
- let mut groups = HashMap::new();
-
- let n_cores = cores.len();
-
- let mut assignment = None;
-
- for (idx, core) in cores.into_iter().enumerate() {
- // Ignore prospective assignments on occupied cores for the time being.
- if let CoreState::Scheduled(scheduled) = core {
- let core_index = CoreIndex(idx as _);
- let group_index = group_rotation_info.group_for_core(core_index, n_cores);
- if let Some(g) = validator_groups.get(group_index.0 as usize) {
- if validator.as_ref().map_or(false, |v| g.contains(&v.index())) {
- assignment = Some((scheduled.para_id, scheduled.collator));
- }
- groups.insert(scheduled.para_id, g.clone());
- }
- }
- }
-
- let table_context = TableContext { groups, validators, validator };
-
- let (assignment, required_collator) = match assignment {
- None => {
- assignments_span.add_string_tag("assigned", "false");
- (None, None)
- },
- Some((assignment, required_collator)) => {
- assignments_span.add_string_tag("assigned", "true");
- assignments_span.add_para_id(assignment);
- (Some(assignment), required_collator)
- },
- };
-
- drop(assignments_span);
- let _span = span.child("wait-for-job");
-
- let job = CandidateBackingJob {
- parent,
- assignment,
- required_collator,
- issued_statements: HashSet::new(),
- awaiting_validation: HashSet::new(),
- fallbacks: HashMap::new(),
- seconded: None,
- unbacked_candidates: HashMap::new(),
- backed: HashSet::new(),
- keystore: keystore.clone(),
- table: Table::default(),
- table_context,
- background_validation_tx: background_validation_tx.clone(),
- metrics: metrics.clone(),
- _marker: std::marker::PhantomData,
- };
-
- jobs.insert(parent, JobAndSpan { job, span });
-
- Ok(())
-}
-
-struct JobAndSpan {
- job: CandidateBackingJob,
- span: PerLeafSpan,
-}
-
-/// Holds all data needed for candidate backing job operation.
-struct CandidateBackingJob {
- /// The hash of the relay parent on top of which this job is doing it's work.
- parent: Hash,
- /// The `ParaId` assigned to this validator
- assignment: Option,
- /// The collator required to author the candidate, if any.
- required_collator: Option,
- /// Spans for all candidates that are not yet backable.
- unbacked_candidates: HashMap,
- /// We issued `Seconded`, `Valid` or `Invalid` statements on about these candidates.
- issued_statements: HashSet,
- /// These candidates are undergoing validation in the background.
- awaiting_validation: HashSet,
- /// Data needed for retrying in case of `ValidatedCandidateCommand::AttestNoPoV`.
- fallbacks: HashMap)>,
- /// `Some(h)` if this job has already issued `Seconded` statement for some candidate with `h` hash.
- seconded: Option,
- /// The candidates that are includable, by hash. Each entry here indicates
- /// that we've sent the provisioner the backed candidate.
- backed: HashSet,
- keystore: KeystorePtr,
- table: Table,
- table_context: TableContext,
- background_validation_tx: mpsc::Sender<(Hash, ValidatedCandidateCommand)>,
- metrics: Metrics,
- _marker: std::marker::PhantomData,
-}
-
/// In case a backing validator does not provide a PoV, we need to retry with other backing
/// validators.
///
@@ -451,13 +374,6 @@ struct AttestingData {
backing: Vec,
}
-/// How many votes we need to consider a candidate backed.
-///
-/// WARNING: This has to be kept in sync with the runtime check in the inclusion module.
-fn minimum_votes(n_validators: usize) -> usize {
- std::cmp::min(2, n_validators)
-}
-
#[derive(Default)]
struct TableContext {
validator: Option,
@@ -493,10 +409,10 @@ struct InvalidErasureRoot;
// It looks like it's not possible to do an `impl From` given the current state of
// the code. So this does the necessary conversion.
-fn primitive_statement_to_table(s: &SignedFullStatement) -> TableSignedStatement {
+fn primitive_statement_to_table(s: &SignedFullStatementWithPVD) -> TableSignedStatement {
let statement = match s.payload() {
- Statement::Seconded(c) => TableStatement::Seconded(c.clone()),
- Statement::Valid(h) => TableStatement::Valid(*h),
+ StatementWithPVD::Seconded(c, _) => TableStatement::Seconded(c.clone()),
+ StatementWithPVD::Valid(h) => TableStatement::Valid(*h),
};
TableSignedStatement {
@@ -580,21 +496,17 @@ async fn store_available_data(
//
// This will compute the erasure root internally and compare it to the expected erasure root.
// This returns `Err()` iff there is an internal error. Otherwise, it returns either `Ok(Ok(()))` or `Ok(Err(_))`.
-
async fn make_pov_available(
sender: &mut impl overseer::CandidateBackingSenderTrait,
n_validators: usize,
pov: Arc,
candidate_hash: CandidateHash,
- validation_data: polkadot_primitives::PersistedValidationData,
+ validation_data: PersistedValidationData,
expected_erasure_root: Hash,
- span: Option<&jaeger::Span>,
) -> Result, Error> {
let available_data = AvailableData { pov, validation_data };
{
- let _span = span.as_ref().map(|s| s.child("erasure-coding").with_candidate(candidate_hash));
-
let chunks = erasure_coding::obtain_chunks_v1(n_validators, &available_data)?;
let branches = erasure_coding::branches(chunks.as_ref());
@@ -606,8 +518,6 @@ async fn make_pov_available(
}
{
- let _span = span.as_ref().map(|s| s.child("store-data").with_candidate(candidate_hash));
-
store_available_data(sender, n_validators as u32, candidate_hash, available_data).await?;
}
@@ -640,13 +550,17 @@ async fn request_pov(
async fn request_candidate_validation(
sender: &mut impl overseer::CandidateBackingSenderTrait,
+ pvd: PersistedValidationData,
+ code: ValidationCode,
candidate_receipt: CandidateReceipt,
pov: Arc,
) -> Result {
let (tx, rx) = oneshot::channel();
sender
- .send_message(CandidateValidationMessage::ValidateFromChainState(
+ .send_message(CandidateValidationMessage::ValidateFromExhaustive(
+ pvd,
+ code,
candidate_receipt,
pov,
PvfExecTimeoutKind::Backing,
@@ -657,21 +571,26 @@ async fn request_candidate_validation(
match rx.await {
Ok(Ok(validation_result)) => Ok(validation_result),
Ok(Err(err)) => Err(Error::ValidationFailed(err)),
- Err(err) => Err(Error::ValidateFromChainState(err)),
+ Err(err) => Err(Error::ValidateFromExhaustive(err)),
}
}
-type BackgroundValidationResult =
- Result<(CandidateReceipt, CandidateCommitments, Arc), CandidateReceipt>;
+struct BackgroundValidationOutputs {
+ candidate: CandidateReceipt,
+ commitments: CandidateCommitments,
+ persisted_validation_data: PersistedValidationData,
+}
+
+type BackgroundValidationResult = Result;
struct BackgroundValidationParams {
sender: S,
tx_command: mpsc::Sender<(Hash, ValidatedCandidateCommand)>,
candidate: CandidateReceipt,
relay_parent: Hash,
+ persisted_validation_data: PersistedValidationData,
pov: PoVData,
n_validators: usize,
- span: Option,
make_command: F,
}
@@ -686,16 +605,33 @@ async fn validate_and_make_available(
mut tx_command,
candidate,
relay_parent,
+ persisted_validation_data,
pov,
n_validators,
- span,
make_command,
} = params;
+ let validation_code = {
+ let validation_code_hash = candidate.descriptor().validation_code_hash;
+ let (tx, rx) = oneshot::channel();
+ sender
+ .send_message(RuntimeApiMessage::Request(
+ relay_parent,
+ RuntimeApiRequest::ValidationCodeByHash(validation_code_hash, tx),
+ ))
+ .await;
+
+ let code = rx.await.map_err(Error::RuntimeApiUnavailable)?;
+ match code {
+ Err(e) => return Err(Error::FetchValidationCode(validation_code_hash, e)),
+ Ok(None) => return Err(Error::NoValidationCode(validation_code_hash)),
+ Ok(Some(c)) => c,
+ }
+ };
+
let pov = match pov {
PoVData::Ready(pov) => pov,
- PoVData::FetchFromValidator { from_validator, candidate_hash, pov_hash } => {
- let _span = span.as_ref().map(|s| s.child("request-pov"));
+ PoVData::FetchFromValidator { from_validator, candidate_hash, pov_hash } =>
match request_pov(
&mut sender,
relay_parent,
@@ -718,17 +654,18 @@ async fn validate_and_make_available(
},
Err(err) => return Err(err),
Ok(pov) => pov,
- }
- },
+ },
};
let v = {
- let _span = span.as_ref().map(|s| {
- s.child("request-validation")
- .with_pov(&pov)
- .with_para_id(candidate.descriptor().para_id)
- });
- request_candidate_validation(&mut sender, candidate.clone(), pov.clone()).await?
+ request_candidate_validation(
+ &mut sender,
+ persisted_validation_data,
+ validation_code,
+ candidate.clone(),
+ pov.clone(),
+ )
+ .await?
};
let res = match v {
@@ -744,14 +681,17 @@ async fn validate_and_make_available(
n_validators,
pov.clone(),
candidate.hash(),
- validation_data,
+ validation_data.clone(),
candidate.descriptor.erasure_root,
- span.as_ref(),
)
.await?;
match erasure_valid {
- Ok(()) => Ok((candidate, commitments, pov.clone())),
+ Ok(()) => Ok(BackgroundValidationOutputs {
+ candidate,
+ commitments,
+ persisted_validation_data: validation_data,
+ }),
Err(InvalidErasureRoot) => {
gum::debug!(
target: LOG_TARGET,
@@ -787,556 +727,1283 @@ async fn validate_and_make_available(
}
#[overseer::contextbounds(CandidateBacking, prefix = self::overseer)]
-impl CandidateBackingJob {
- async fn handle_validated_candidate_command(
- &mut self,
- root_span: &jaeger::Span,
- ctx: &mut Context,
- command: ValidatedCandidateCommand,
- ) -> Result<(), Error> {
- let candidate_hash = command.candidate_hash();
- self.awaiting_validation.remove(&candidate_hash);
-
- match command {
- ValidatedCandidateCommand::Second(res) => {
- match res {
- Ok((candidate, commitments, _)) => {
- // sanity check.
- if self.seconded.is_none() &&
- !self.issued_statements.contains(&candidate_hash)
- {
- self.seconded = Some(candidate_hash);
- self.issued_statements.insert(candidate_hash);
- self.metrics.on_candidate_seconded();
-
- let statement = Statement::Seconded(CommittedCandidateReceipt {
- descriptor: candidate.descriptor.clone(),
- commitments,
- });
- if let Some(stmt) = self
- .sign_import_and_distribute_statement(ctx, statement, root_span)?
- {
- // Break cycle - bounded as there is only one candidate to
- // second per block.
- ctx.send_unbounded_message(CollatorProtocolMessage::Seconded(
- self.parent,
- stmt,
- ));
- }
- }
- },
- Err(candidate) => {
- // Break cycle - bounded as there is only one candidate to
- // second per block.
- ctx.send_unbounded_message(CollatorProtocolMessage::Invalid(
- self.parent,
- candidate,
- ));
- },
- }
- },
- ValidatedCandidateCommand::Attest(res) => {
- // We are done - avoid new validation spawns:
- self.fallbacks.remove(&candidate_hash);
- // sanity check.
- if !self.issued_statements.contains(&candidate_hash) {
- if res.is_ok() {
- let statement = Statement::Valid(candidate_hash);
- self.sign_import_and_distribute_statement(ctx, statement, &root_span)?;
- }
- self.issued_statements.insert(candidate_hash);
- }
- },
- ValidatedCandidateCommand::AttestNoPoV(candidate_hash) => {
- if let Some((attesting, span)) = self.fallbacks.get_mut(&candidate_hash) {
- if let Some(index) = attesting.backing.pop() {
- attesting.from_validator = index;
- // Ok, another try:
- let c_span = span.as_ref().map(|s| s.child("try"));
- let attesting = attesting.clone();
- self.kick_off_validation_work(ctx, attesting, c_span).await?
- }
- } else {
- gum::warn!(
- target: LOG_TARGET,
- "AttestNoPoV was triggered without fallback being available."
- );
- debug_assert!(false);
- }
+async fn handle_communication(
+ ctx: &mut Context,
+ state: &mut State,
+ message: CandidateBackingMessage,
+ metrics: &Metrics,
+) -> Result<(), Error> {
+ match message {
+ CandidateBackingMessage::Second(_relay_parent, candidate, pvd, pov) => {
+ handle_second_message(ctx, state, candidate, pvd, pov, metrics).await?;
+ },
+ CandidateBackingMessage::Statement(relay_parent, statement) => {
+ handle_statement_message(ctx, state, relay_parent, statement, metrics).await?;
+ },
+ CandidateBackingMessage::GetBackedCandidates(relay_parent, requested_candidates, tx) =>
+ if let Some(rp_state) = state.per_relay_parent.get(&relay_parent) {
+ handle_get_backed_candidates_message(rp_state, requested_candidates, tx, metrics)?;
+ } else {
+ gum::debug!(
+ target: LOG_TARGET,
+ ?relay_parent,
+ "Received `GetBackedCandidates` for an unknown relay parent."
+ );
},
- }
-
- Ok(())
+ CandidateBackingMessage::CanSecond(request, tx) =>
+ handle_can_second_request(ctx, state, request, tx).await,
}
- async fn background_validate_and_make_available(
- &mut self,
- ctx: &mut Context,
- params: BackgroundValidationParams<
- impl overseer::CandidateBackingSenderTrait,
- impl Fn(BackgroundValidationResult) -> ValidatedCandidateCommand + Send + 'static + Sync,
- >,
- ) -> Result<(), Error> {
- let candidate_hash = params.candidate.hash();
- if self.awaiting_validation.insert(candidate_hash) {
- // spawn background task.
- let bg = async move {
- if let Err(e) = validate_and_make_available(params).await {
- if let Error::BackgroundValidationMpsc(error) = e {
- gum::debug!(
- target: LOG_TARGET,
- ?error,
- "Mpsc background validation mpsc died during validation- leaf no longer active?"
- );
- } else {
- gum::error!(
- target: LOG_TARGET,
- "Failed to validate and make available: {:?}",
- e
- );
- }
- }
- };
+ Ok(())
+}
- ctx.spawn("backing-validation", bg.boxed())
- .map_err(|_| Error::FailedToSpawnBackgroundTask)?;
- }
+#[overseer::contextbounds(CandidateBacking, prefix = self::overseer)]
+async fn handle_active_leaves_update(
+ ctx: &mut Context,
+ update: ActiveLeavesUpdate,
+ state: &mut State,
+) -> Result<(), Error> {
+ enum LeafHasProspectiveParachains {
+ Enabled(Result),
+ Disabled,
+ }
+
+ // Activate in implicit view before deactivate, per the docs
+ // on ImplicitView, this is more efficient.
+ let res = if let Some(leaf) = update.activated {
+ // Only activate in implicit view if prospective
+ // parachains are enabled.
+ let mode = prospective_parachains_mode(ctx.sender(), leaf.hash).await?;
+
+ let leaf_hash = leaf.hash;
+ Some((
+ leaf,
+ match mode {
+ ProspectiveParachainsMode::Disabled => LeafHasProspectiveParachains::Disabled,
+ ProspectiveParachainsMode::Enabled { .. } => LeafHasProspectiveParachains::Enabled(
+ state.implicit_view.activate_leaf(ctx.sender(), leaf_hash).await.map(|_| mode),
+ ),
+ },
+ ))
+ } else {
+ None
+ };
- Ok(())
+ for deactivated in update.deactivated {
+ state.per_leaf.remove(&deactivated);
+ state.implicit_view.deactivate_leaf(deactivated);
}
- /// Kick off background validation with intent to second.
- async fn validate_and_second(
- &mut self,
- parent_span: &jaeger::Span,
- root_span: &jaeger::Span,
- ctx: &mut Context,
- candidate: &CandidateReceipt,
- pov: Arc,
- ) -> Result<(), Error> {
- // Check that candidate is collated by the right collator.
- if self
- .required_collator
- .as_ref()
- .map_or(false, |c| c != &candidate.descriptor().collator)
- {
- // Break cycle - bounded as there is only one candidate to
- // second per block.
- ctx.send_unbounded_message(CollatorProtocolMessage::Invalid(
- self.parent,
- candidate.clone(),
- ));
+ // clean up `per_relay_parent` according to ancestry
+ // of leaves. we do this so we can clean up candidates right after
+ // as a result.
+ //
+ // when prospective parachains are disabled, the implicit view is empty,
+ // which means we'll clean up everything. This is correct.
+ {
+ let remaining: HashSet<_> = state.implicit_view.all_allowed_relay_parents().collect();
+ state.per_relay_parent.retain(|r, _| remaining.contains(&r));
+ }
+
+ // clean up `per_candidate` according to which relay-parents
+ // are known.
+ //
+ // when prospective parachains are disabled, we clean up all candidates
+ // because we've cleaned up all relay parents. this is correct.
+ state
+ .per_candidate
+ .retain(|_, pc| state.per_relay_parent.contains_key(&pc.relay_parent));
+
+ // Get relay parents which might be fresh but might be known already
+ // that are explicit or implicit from the new active leaf.
+ let (fresh_relay_parents, leaf_mode) = match res {
+ None => return Ok(()),
+ Some((leaf, LeafHasProspectiveParachains::Disabled)) => {
+ // defensive in this case - for enabled, this manifests as an error.
+ if state.per_leaf.contains_key(&leaf.hash) {
+ return Ok(())
+ }
+
+ state.per_leaf.insert(
+ leaf.hash,
+ ActiveLeafState {
+ prospective_parachains_mode: ProspectiveParachainsMode::Disabled,
+ // This is empty because the only allowed relay-parent and depth
+ // when prospective parachains are disabled is the leaf hash and 0,
+ // respectively. We've just learned about the leaf hash, so we cannot
+ // have any candidates seconded with it as a relay-parent yet.
+ seconded_at_depth: HashMap::new(),
+ },
+ );
+
+ (vec![leaf.hash], ProspectiveParachainsMode::Disabled)
+ },
+ Some((leaf, LeafHasProspectiveParachains::Enabled(Ok(prospective_parachains_mode)))) => {
+ let fresh_relay_parents =
+ state.implicit_view.known_allowed_relay_parents_under(&leaf.hash, None);
+
+ // At this point, all candidates outside of the implicit view
+ // have been cleaned up. For all which remain, which we've seconded,
+ // we ask the prospective parachains subsystem where they land in the fragment
+ // tree for the given active leaf. This comprises our `seconded_at_depth`.
+
+ let remaining_seconded = state
+ .per_candidate
+ .iter()
+ .filter(|(_, cd)| cd.seconded_locally)
+ .map(|(c_hash, cd)| (*c_hash, cd.para_id));
+
+ // one-to-one correspondence to remaining_seconded
+ let mut membership_answers = FuturesOrdered::new();
+
+ for (candidate_hash, para_id) in remaining_seconded {
+ let (tx, rx) = oneshot::channel();
+ membership_answers
+ .push_back(rx.map_ok(move |membership| (para_id, candidate_hash, membership)));
+
+ ctx.send_message(ProspectiveParachainsMessage::GetTreeMembership(
+ para_id,
+ candidate_hash,
+ tx,
+ ))
+ .await;
+ }
+
+ let mut seconded_at_depth = HashMap::new();
+ if let Some(response) = membership_answers.next().await {
+ match response {
+ Err(oneshot::Canceled) => {
+ gum::warn!(
+ target: LOG_TARGET,
+ "Prospective parachains subsystem unreachable for membership request",
+ );
+ },
+ Ok((para_id, candidate_hash, membership)) => {
+ // This request gives membership in all fragment trees. We have some
+ // wasted data here, and it can be optimized if it proves
+ // relevant to performance.
+ if let Some((_, depths)) =
+ membership.into_iter().find(|(leaf_hash, _)| leaf_hash == &leaf.hash)
+ {
+ let para_entry: &mut BTreeMap =
+ seconded_at_depth.entry(para_id).or_default();
+ for depth in depths {
+ para_entry.insert(depth, candidate_hash);
+ }
+ }
+ },
+ }
+ }
+
+ state.per_leaf.insert(
+ leaf.hash,
+ ActiveLeafState { prospective_parachains_mode, seconded_at_depth },
+ );
+
+ let fresh_relay_parent = match fresh_relay_parents {
+ Some(f) => f.to_vec(),
+ None => {
+ gum::warn!(
+ target: LOG_TARGET,
+ leaf_hash = ?leaf.hash,
+ "Implicit view gave no relay-parents"
+ );
+
+ vec![leaf.hash]
+ },
+ };
+ (fresh_relay_parent, prospective_parachains_mode)
+ },
+ Some((leaf, LeafHasProspectiveParachains::Enabled(Err(e)))) => {
+ gum::debug!(
+ target: LOG_TARGET,
+ leaf_hash = ?leaf.hash,
+ err = ?e,
+ "Failed to load implicit view for leaf."
+ );
+
return Ok(())
+ },
+ };
+
+ // add entries in `per_relay_parent`. for all new relay-parents.
+ for maybe_new in fresh_relay_parents {
+ if state.per_relay_parent.contains_key(&maybe_new) {
+ continue
}
- let candidate_hash = candidate.hash();
- let mut span = self.get_unbacked_validation_child(
- root_span,
- candidate_hash,
- candidate.descriptor().para_id,
- );
+ let mode = match state.per_leaf.get(&maybe_new) {
+ None => {
+ // If the relay-parent isn't a leaf itself,
+ // then it is guaranteed by the prospective parachains
+ // subsystem that it is an ancestor of a leaf which
+ // has prospective parachains enabled and that the
+ // block itself did.
+ leaf_mode
+ },
+ Some(l) => l.prospective_parachains_mode,
+ };
- span.as_mut().map(|span| span.add_follows_from(parent_span));
+ // construct a `PerRelayParent` from the runtime API
+ // and insert it.
+ let per = construct_per_relay_parent_state(ctx, maybe_new, &state.keystore, mode).await?;
- gum::debug!(
- target: LOG_TARGET,
- candidate_hash = ?candidate_hash,
- candidate_receipt = ?candidate,
- "Validate and second candidate",
- );
+ if let Some(per) = per {
+ state.per_relay_parent.insert(maybe_new, per);
+ }
+ }
- let bg_sender = ctx.sender().clone();
- self.background_validate_and_make_available(
- ctx,
- BackgroundValidationParams {
- sender: bg_sender,
- tx_command: self.background_validation_tx.clone(),
- candidate: candidate.clone(),
- relay_parent: self.parent,
- pov: PoVData::Ready(pov),
- n_validators: self.table_context.validators.len(),
- span,
- make_command: ValidatedCandidateCommand::Second,
+ Ok(())
+}
+
+/// Load the data necessary to do backing work on top of a relay-parent.
+#[overseer::contextbounds(CandidateBacking, prefix = self::overseer)]
+async fn construct_per_relay_parent_state(
+ ctx: &mut Context,
+ relay_parent: Hash,
+ keystore: &KeystorePtr,
+ mode: ProspectiveParachainsMode,
+) -> Result