diff --git a/Cargo.lock b/Cargo.lock index e314c9213bd6..4ddbbbab8905 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1109,7 +1109,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "fork-tree" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1117,7 +1117,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -1131,7 +1131,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1142,7 +1142,7 @@ dependencies = [ [[package]] name = "frame-support" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "bitmask 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "frame-metadata 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -1166,7 +1166,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support-procedural-tools 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1177,7 +1177,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support-procedural-tools-derive 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1189,7 +1189,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1199,7 +1199,7 @@ dependencies = [ [[package]] name = "frame-system" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "impl-trait-for-tuples 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1216,7 +1216,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -1529,7 +1529,7 @@ dependencies = [ [[package]] name = "grafana-data-source" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "async-std 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1613,6 +1613,11 @@ dependencies = [ "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "hashbrown" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "hashbrown" version = "0.6.3" @@ -2567,6 +2572,14 @@ dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "lru" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hashbrown 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "lru" version = "0.4.0" @@ -2890,7 +2903,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -2908,7 +2921,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -2925,7 +2938,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -2946,7 +2959,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -2960,7 +2973,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -2976,7 +2989,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -2991,7 +3004,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3004,7 +3017,7 @@ dependencies = [ [[package]] name = "pallet-finality-tracker" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3020,7 +3033,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3038,7 +3051,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "enumflags2 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3053,7 +3066,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3072,7 +3085,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3089,7 +3102,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3103,7 +3116,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3117,7 +3130,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3132,7 +3145,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3145,7 +3158,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3164,7 +3177,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3184,7 +3197,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3195,7 +3208,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3211,7 +3224,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3224,7 +3237,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "jsonrpc-core 14.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-core-client 14.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3241,7 +3254,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3254,7 +3267,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-support 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "frame-system 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -3669,6 +3682,7 @@ dependencies = [ "polkadot-validation 0.7.9", "sc-client 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sc-network 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", + "sc-network-gossip 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sp-api 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sp-blockchain 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sp-core 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -4392,7 +4406,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4416,7 +4430,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -4430,7 +4444,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "impl-trait-for-tuples 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "sc-chain-spec-derive 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -4445,7 +4459,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4456,7 +4470,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", "app_dirs 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4491,7 +4505,7 @@ dependencies = [ [[package]] name = "sc-client" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4524,7 +4538,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4555,7 +4569,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "kvdb 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4580,7 +4594,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "fork-tree 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -4620,7 +4634,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4639,7 +4653,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "sc-client-api 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -4653,7 +4667,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "cranelift-codegen 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", "cranelift-entity 0.50.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4685,12 +4699,13 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "finality-grandpa 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "fork-tree 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-timer 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4699,6 +4714,7 @@ dependencies = [ "sc-client-api 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sc-keystore 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sc-network 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", + "sc-network-gossip 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sc-telemetry 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", "sp-blockchain 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -4708,14 +4724,12 @@ dependencies = [ "sp-finality-tracker 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sp-inherents 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sp-runtime 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", - "tokio-executor 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "sc-keystore" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4730,7 +4744,7 @@ dependencies = [ [[package]] name = "sc-network" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4772,10 +4786,26 @@ dependencies = [ "zeroize 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "sc-network-gossip" +version = "2.0.0" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" +dependencies = [ + "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-timer 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libp2p 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", + "lru 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sc-network 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", + "sp-runtime 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", +] + [[package]] name = "sc-offchain" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4802,7 +4832,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "libp2p 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4813,7 +4843,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4842,7 +4872,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4864,7 +4894,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "jsonrpc-core 14.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "jsonrpc-http-server 14.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4879,7 +4909,7 @@ dependencies = [ [[package]] name = "sc-service" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "exit-future 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4926,7 +4956,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4937,7 +4967,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4959,7 +4989,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "erased-serde 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "grafana-data-source 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -4975,7 +5005,7 @@ dependencies = [ [[package]] name = "sc-transaction-graph" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -4990,7 +5020,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5275,7 +5305,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "sp-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api-proc-macro 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -5289,7 +5319,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5301,7 +5331,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5313,7 +5343,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5326,7 +5356,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -5338,7 +5368,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-inherents 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -5349,7 +5379,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-api 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -5361,7 +5391,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5377,7 +5407,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5396,7 +5426,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "schnorrkel 0.8.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5412,7 +5442,7 @@ dependencies = [ [[package]] name = "sp-core" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "base58 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "blake2-rfc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5451,7 +5481,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "proc-macro2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5461,7 +5491,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "environmental 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "sp-std 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -5471,7 +5501,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5484,7 +5514,7 @@ dependencies = [ [[package]] name = "sp-finality-tracker" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-inherents 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -5494,7 +5524,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5506,7 +5536,7 @@ dependencies = [ [[package]] name = "sp-io" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "libsecp256k1 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5523,7 +5553,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -5534,7 +5564,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "sp-api 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sp-runtime 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -5543,7 +5573,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "backtrace 0.3.40 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5552,7 +5582,7 @@ dependencies = [ [[package]] name = "sp-phragmen" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "sp-runtime 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -5562,7 +5592,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "sp-core 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -5571,7 +5601,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "impl-trait-for-tuples 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5590,7 +5620,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "environmental 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5605,7 +5635,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "Inflector 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", "proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5617,7 +5647,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.41 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5626,7 +5656,7 @@ dependencies = [ [[package]] name = "sp-session" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "sp-api 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "sp-runtime 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -5636,7 +5666,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "sp-runtime 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", @@ -5646,7 +5676,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5665,12 +5695,12 @@ dependencies = [ [[package]] name = "sp-std" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" [[package]] name = "sp-storage" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.102 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5681,7 +5711,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "impl-trait-for-tuples 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5694,7 +5724,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "derive_more 0.99.2 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5708,7 +5738,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", "memory-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5722,7 +5752,7 @@ dependencies = [ [[package]] name = "sp-version" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "impl-serde 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "parity-scale-codec 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5734,7 +5764,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "impl-trait-for-tuples 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "wasmi 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -5838,7 +5868,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#c6fc2e6240edeb31233b07748c6bf968c7c15553" +source = "git+https://github.com/paritytech/substrate?branch=polkadot-master#40a16efefc070faf5a25442bc3ae1d0ea2478eee" dependencies = [ "frame-system-rpc-runtime-api 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)", "futures 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -7145,6 +7175,7 @@ dependencies = [ "checksum hash-db 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" "checksum hash256-std-hasher 0.15.2 (registry+https://github.com/rust-lang/crates.io-index)" = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" "checksum hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3bae29b6653b3412c2e71e9d486db9f9df5d701941d86683005efb9f2d28e3da" +"checksum hashbrown 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e1de41fb8dba9714efd92241565cdff73f78508c95697dd56787d3cba27e2353" "checksum hashbrown 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" "checksum heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" @@ -7225,6 +7256,7 @@ dependencies = [ "checksum lock_api 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f8912e782533a93a167888781b836336a6ca5da6175c05944c86cf28c31104dc" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +"checksum lru 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "5d8f669d42c72d18514dfca8115689c5f6370a17d980cb5bd777a67f404594c8" "checksum lru 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "26b0dca4ac5b5083c5169ab12205e6473df1c7659940e4978b94f363c6b54b22" "checksum mach 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "86dd2487cdfea56def77b88438a2c915fb45113c5319bfe7e14306ca4cd0b0e1" "checksum malloc_size_of_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e37c5d4cd9473c5f4c9c111f033f15d4df9bd378fdf615944e360a4f55a05f0b" @@ -7389,6 +7421,7 @@ dependencies = [ "checksum sc-finality-grandpa 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)" = "" "checksum sc-keystore 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)" = "" "checksum sc-network 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)" = "" +"checksum sc-network-gossip 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)" = "" "checksum sc-offchain 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)" = "" "checksum sc-peerset 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)" = "" "checksum sc-rpc 2.0.0 (git+https://github.com/paritytech/substrate?branch=polkadot-master)" = "" diff --git a/collator/src/lib.rs b/collator/src/lib.rs index 20a17a216691..7afd5e100e8b 100644 --- a/collator/src/lib.rs +++ b/collator/src/lib.rs @@ -65,7 +65,7 @@ use polkadot_cli::{ Worker, IntoExit, ProvideRuntimeApi, AbstractService, CustomConfiguration, ParachainHost, }; use polkadot_network::validation::{LeafWorkParams, ValidationNetwork}; -use polkadot_network::{PolkadotNetworkService, PolkadotProtocol}; +use polkadot_network::PolkadotProtocol; use polkadot_runtime::RuntimeApi; pub use polkadot_cli::VersionInfo; @@ -90,7 +90,7 @@ pub trait Network: Send + Sync { fn checked_statements(&self, relay_parent: Hash) -> Box>; } -impl Network for ValidationNetwork where +impl Network for ValidationNetwork where P: 'static + Send + Sync, E: 'static + Send + Sync, SP: 'static + Spawn + Clone + Send + Sync, @@ -231,7 +231,7 @@ pub async fn collate( /// Polkadot-api context. struct ApiContext { - network: Arc>, + network: Arc>, parent_hash: Hash, validators: Vec, } @@ -347,12 +347,12 @@ impl Worker for CollationNode where let message_validator = polkadot_network::gossip::register_validator( network.clone(), (is_known, client.clone()), + &spawner ); let validation_network = Arc::new(ValidationNetwork::new( - network.clone(), - exit.clone(), message_validator, + exit.clone(), client.clone(), spawner.clone(), )); diff --git a/network/Cargo.toml b/network/Cargo.toml index 0718898dab14..21387dce3ce2 100644 --- a/network/Cargo.toml +++ b/network/Cargo.toml @@ -14,6 +14,7 @@ polkadot-primitives = { path = "../primitives" } polkadot-erasure-coding = { path = "../erasure-coding" } codec = { package = "parity-scale-codec", version = "1.1.0", default-features = false, features = ["derive"] } sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } +sc-network-gossip = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-master" } futures = "0.3.1" diff --git a/network/src/gossip.rs b/network/src/gossip.rs index 77d964e2a91a..e8cb4a6bfb22 100644 --- a/network/src/gossip.rs +++ b/network/src/gossip.rs @@ -51,10 +51,10 @@ use sp_runtime::{generic::BlockId, traits::{ProvideRuntimeApi, BlakeTwo256, Hash as HashT}}; use sp_blockchain::Error as ClientError; -use sc_network::{config::Roles, PeerId, ReputationChange}; -use sc_network::consensus_gossip::{ - self as network_gossip, ValidationResult as GossipValidationResult, - ValidatorContext, MessageIntent, ConsensusMessage, +use sc_network::{config::Roles, Context, PeerId, ReputationChange}; +use sc_network_gossip::{ + ValidationResult as GossipValidationResult, + ValidatorContext, MessageIntent, }; use polkadot_validation::{SignedStatement}; use polkadot_primitives::{Block, Hash}; @@ -68,11 +68,12 @@ use std::collections::HashMap; use std::sync::Arc; use arrayvec::ArrayVec; +use futures::prelude::*; use parking_lot::RwLock; use log::warn; use super::PolkadotNetworkService; -use crate::router::attestation_topic; +use crate::{GossipMessageStream, NetworkService, PolkadotProtocol, router::attestation_topic}; use attestation::{View as AttestationView, PeerData as AttestationPeerData}; use message_routing::{View as MessageRoutingView}; @@ -133,7 +134,7 @@ mod cost { } /// A gossip message. -#[derive(Encode, Decode, Clone)] +#[derive(Encode, Decode, Clone, PartialEq)] pub enum GossipMessage { /// A packet sent to a neighbor but not relayed. #[codec(index = "1")] @@ -151,15 +152,6 @@ pub enum GossipMessage { ErasureChunk(ErasureChunkMessage), } -impl GossipMessage { - fn to_consensus_message(&self) -> ConsensusMessage { - ConsensusMessage { - data: self.encode(), - engine_id: POLKADOT_ENGINE_ID, - } - } -} - impl From for GossipMessage { fn from(packet: NeighborPacket) -> Self { GossipMessage::Neighbor(VersionedNeighborPacket::V1(packet)) @@ -179,7 +171,7 @@ impl From for GossipMessage { } /// A gossip message containing a statement. -#[derive(Encode, Decode, Clone)] +#[derive(Encode, Decode, Clone, PartialEq)] pub struct GossipStatement { /// The block hash of the relay chain being referred to. In context, this should /// be a leaf. @@ -200,7 +192,7 @@ impl GossipStatement { /// A gossip message containing one erasure chunk of a candidate block. /// For each chunk of block erasure encoding one of this messages is constructed. -#[derive(Encode, Decode, Clone, Debug)] +#[derive(Encode, Decode, Clone, Debug, PartialEq)] pub struct ErasureChunkMessage { /// The chunk itself. pub chunk: PrimitiveChunk, @@ -221,7 +213,7 @@ impl From for GossipMessage { /// These are all the messages posted from one parachain to another during the /// execution of a single parachain block. Since this parachain block may have been /// included in many forks of the relay chain, there is no relay-chain leaf parameter. -#[derive(Encode, Decode, Clone)] +#[derive(Encode, Decode, Clone, PartialEq)] pub struct GossipParachainMessages { /// The root of the message queue. pub queue_root: Hash, @@ -241,7 +233,7 @@ impl GossipParachainMessages { } /// A versioned neighbor message. -#[derive(Encode, Decode, Clone)] +#[derive(Encode, Decode, Clone, PartialEq)] pub enum VersionedNeighborPacket { #[codec(index = "1")] V1(NeighborPacket), @@ -249,13 +241,13 @@ pub enum VersionedNeighborPacket { /// Contains information on which chain heads the peer is /// accepting messages for. -#[derive(Encode, Decode, Clone)] +#[derive(Encode, Decode, Clone, PartialEq)] pub struct NeighborPacket { chain_heads: Vec, } /// whether a block is known. -#[derive(Clone, Copy)] +#[derive(Clone, Copy, PartialEq)] pub enum Known { /// The block is a known leaf. Leaf, @@ -318,6 +310,7 @@ impl ChainContext for (F, P) where pub fn register_validator( service: Arc, chain: C, + executor: &impl futures::task::Spawn, ) -> RegisteredMessageValidator { let s = service.clone(); @@ -338,19 +331,26 @@ pub fn register_validator( }); let gossip_side = validator.clone(); - service.with_gossip(|gossip, ctx| - gossip.register_validator(ctx, POLKADOT_ENGINE_ID, gossip_side) + let gossip_engine = sc_network_gossip::GossipEngine::new( + service.clone(), + executor, + POLKADOT_ENGINE_ID, + gossip_side, ); - RegisteredMessageValidator { inner: validator as _ } + RegisteredMessageValidator { + inner: validator as _, + service: Some(service), + gossip_engine: Some(gossip_engine), + } } #[derive(PartialEq)] enum NewLeafAction { // (who, message) - TargetedMessage(PeerId, ConsensusMessage), + TargetedMessage(PeerId, GossipMessage), // (topic, message) - Multicast(Hash, ConsensusMessage), + Multicast(Hash, GossipMessage), } /// Actions to take after noting a new block-DAG leaf. @@ -365,15 +365,14 @@ impl NewLeafActions { /// Perform the queued actions, feeding into gossip. pub fn perform( self, - gossip: &mut dyn crate::GossipService, - ctx: &mut dyn sc_network::Context, + gossip: &dyn crate::NetworkService, ) { for action in self.actions { match action { NewLeafAction::TargetedMessage(who, message) - => gossip.send_message(ctx, &who, message), + => gossip.send_message(who, message), NewLeafAction::Multicast(topic, message) - => gossip.multicast(ctx, &topic, message), + => gossip.gossip_message(topic, message), } } } @@ -385,6 +384,10 @@ impl NewLeafActions { #[derive(Clone)] pub struct RegisteredMessageValidator { inner: Arc>, + // Note: this is always `Some` in real code and `None` in tests. + service: Option>, + // Note: this is always `Some` in real code and `None` in tests. + gossip_engine: Option>, } impl RegisteredMessageValidator { @@ -395,7 +398,11 @@ impl RegisteredMessageValidator { ) -> Self { let validator = Arc::new(MessageValidator::new_test(chain, report_handle)); - RegisteredMessageValidator { inner: validator as _ } + RegisteredMessageValidator { + inner: validator as _, + service: None, + gossip_engine: None, + } } pub fn register_availability_store(&mut self, availability_store: av_store::Store) { @@ -449,7 +456,7 @@ impl RegisteredMessageValidator { let message = GossipMessage::from(GossipParachainMessages { queue_root: *queue_root, messages, - }).to_consensus_message(); + }); actions.push(NewLeafAction::Multicast(*topic, message)); @@ -463,6 +470,49 @@ impl RegisteredMessageValidator { } } +impl NetworkService for RegisteredMessageValidator { + fn gossip_messages_for(&self, topic: Hash) -> GossipMessageStream { + let topic_stream = if let Some(gossip_engine) = self.gossip_engine.as_ref() { + gossip_engine.messages_for(topic) + } else { + log::error!("Called gossip_messages_for on a test engine"); + futures::channel::mpsc::unbounded().1 + }; + + GossipMessageStream::new(topic_stream.boxed()) + } + + fn gossip_message(&self, topic: Hash, message: GossipMessage) { + if let Some(gossip_engine) = self.gossip_engine.as_ref() { + gossip_engine.gossip_message( + topic, + message.encode(), + false, + ); + } else { + log::error!("Called gossip_message on a test engine"); + } + } + + fn send_message(&self, who: PeerId, message: GossipMessage) { + if let Some(gossip_engine) = self.gossip_engine.as_ref() { + gossip_engine.send_message(vec![who], message.encode()); + } else { + log::error!("Called send_message on a test engine"); + } + } + + fn with_spec(&self, with: F) + where F: FnOnce(&mut PolkadotProtocol, &mut dyn Context) + { + if let Some(service) = self.service.as_ref() { + service.with_spec(with) + } else { + log::error!("Called with_spec on a test engine"); + } + } +} + /// The data needed for validating gossip messages. #[derive(Default)] pub(crate) struct MessageValidationData { @@ -585,13 +635,13 @@ impl Inner { } } - fn multicast_neighbor_packet( + fn multicast_neighbor_packet( &self, mut send_neighbor_packet: F, ) { let neighbor_packet = GossipMessage::from(NeighborPacket { chain_heads: self.attestation_view.neighbor_info().collect(), - }).to_consensus_message(); + }); for peer in self.peers.keys() { send_neighbor_packet(peer, neighbor_packet.clone()) @@ -628,7 +678,7 @@ impl MessageValidator { } } -impl network_gossip::Validator for MessageValidator { +impl sc_network_gossip::Validator for MessageValidator { fn new_peer(&self, _context: &mut dyn ValidatorContext, who: &PeerId, _roles: Roles) { let mut inner = self.inner.write(); inner.peers.insert(who.clone(), PeerData::default()); @@ -746,7 +796,7 @@ impl network_gossip::Validator for MessageValid #[cfg(test)] mod tests { use super::*; - use sc_network::consensus_gossip::Validator as ValidatorT; + use sc_network_gossip::Validator as ValidatorT; use std::sync::mpsc; use parking_lot::Mutex; use polkadot_primitives::parachain::{CandidateReceipt, HeadData}; @@ -776,7 +826,7 @@ mod tests { } } - impl network_gossip::ValidatorContext for MockValidatorContext { + impl sc_network_gossip::ValidatorContext for MockValidatorContext { fn broadcast_topic(&mut self, topic: Hash, force: bool) { self.events.push(ContextEvent::BroadcastTopic(topic, force)); } @@ -792,12 +842,12 @@ mod tests { } impl NewLeafActions { - fn has_message(&self, who: PeerId, message: ConsensusMessage) -> bool { + fn has_message(&self, who: PeerId, message: GossipMessage) -> bool { let x = NewLeafAction::TargetedMessage(who, message); self.actions.iter().find(|&m| m == &x).is_some() } - fn has_multicast(&self, topic: Hash, message: ConsensusMessage) -> bool { + fn has_multicast(&self, topic: Hash, message: GossipMessage) -> bool { let x = NewLeafAction::Multicast(topic, message); self.actions.iter().find(|&m| m == &x).is_some() } @@ -1082,12 +1132,12 @@ mod tests { assert!(actions.has_message(peer_a.clone(), GossipMessage::from(NeighborPacket { chain_heads: vec![hash_a], - }).to_consensus_message())); + }))); assert!(actions.has_multicast(root_a_topic, GossipMessage::from(GossipParachainMessages { queue_root: root_a, messages: root_a_messages.clone(), - }).to_consensus_message())); + }))); } // ensure that we are allowed to multicast to a peer with same chain head, @@ -1154,12 +1204,12 @@ mod tests { assert!(actions.has_message(peer_a.clone(), GossipMessage::from(NeighborPacket { chain_heads: vec![hash_a], - }).to_consensus_message())); + }))); assert!(actions.has_multicast(root_a_topic, GossipMessage::from(GossipParachainMessages { queue_root: root_a, messages: root_a_messages.clone(), - }).to_consensus_message())); + }))); } // ensure that we are not allowed to multicast to either peer, as they @@ -1168,12 +1218,12 @@ mod tests { let message = GossipMessage::from(GossipParachainMessages { queue_root: root_a, messages: root_a_messages.clone(), - }).encode(); + }); let mut allowed = validator.inner.message_allowed(); let intent = MessageIntent::Broadcast; - assert!(!allowed(&peer_a, intent, &root_a_topic, &message[..])); - assert!(!allowed(&peer_b, intent, &root_a_topic, &message[..])); + assert!(!allowed(&peer_a, intent, &root_a_topic, &message.encode())); + assert!(!allowed(&peer_b, intent, &root_a_topic, &message.encode())); } // peer A gets updated to the chain head. now we'll attempt to broadcast @@ -1259,17 +1309,17 @@ mod tests { let queue_messages = GossipMessage::from(GossipParachainMessages { queue_root: root_a, messages: root_a_messages.clone(), - }).to_consensus_message(); + }); let not_queue_messages = GossipMessage::from(GossipParachainMessages { queue_root: root_a, messages: not_root_a_messages.clone(), - }).encode(); + }); let queue_messages_wrong_root = GossipMessage::from(GossipParachainMessages { queue_root: not_root_a, messages: root_a_messages.clone(), - }).encode(); + }); // ensure that we attempt to multicast all relevant queues after noting a leaf. { @@ -1281,7 +1331,7 @@ mod tests { assert!(actions.has_message(peer_a.clone(), GossipMessage::from(NeighborPacket { chain_heads: vec![hash_a], - }).to_consensus_message())); + }))); // we don't know this queue! no broadcast :( assert!(!actions.has_multicast(root_a_topic, queue_messages.clone())); @@ -1292,7 +1342,7 @@ mod tests { let res = validator.inner.validate( &mut validator_context, &peer_a, - &queue_messages_wrong_root[..], + &queue_messages_wrong_root.encode(), ); match res { @@ -1308,7 +1358,7 @@ mod tests { let res = validator.inner.validate( &mut validator_context, &peer_a, - ¬_queue_messages[..], + ¬_queue_messages.encode(), ); match res { @@ -1324,7 +1374,7 @@ mod tests { let res = validator.inner.validate( &mut validator_context, &peer_a, - &queue_messages.data[..], + &queue_messages.encode(), ); match res { @@ -1333,7 +1383,7 @@ mod tests { } assert_eq!(validator_context.events, vec![ - ContextEvent::BroadcastMessage(root_a_topic, queue_messages.data.clone(), false), + ContextEvent::BroadcastMessage(root_a_topic, queue_messages.encode(), false), ]); } } diff --git a/network/src/gossip/attestation.rs b/network/src/gossip/attestation.rs index 677bfe1e0bd8..d8fc4c50a1fc 100644 --- a/network/src/gossip/attestation.rs +++ b/network/src/gossip/attestation.rs @@ -30,7 +30,7 @@ //! a `Candidate` we are aware of. Otherwise, it is possible we could be forced to //! consider an infinite amount of attestations produced by a misbehaving validator. -use sc_network::consensus_gossip::{ValidationResult as GossipValidationResult}; +use sc_network_gossip::{ValidationResult as GossipValidationResult}; use sc_network::ReputationChange; use polkadot_validation::GenericStatement; use polkadot_primitives::Hash; diff --git a/network/src/lib.rs b/network/src/lib.rs index 65f7315b3e99..0e80e04f259a 100644 --- a/network/src/lib.rs +++ b/network/src/lib.rs @@ -26,7 +26,7 @@ pub mod validation; pub mod gossip; use codec::{Decode, Encode}; -use futures::channel::{oneshot, mpsc}; +use futures::channel::oneshot; use futures::prelude::*; use polkadot_primitives::{Block, Hash, Header}; use polkadot_primitives::parachain::{ @@ -37,9 +37,7 @@ use sc_network::{ PeerId, RequestId, Context, StatusMessage as GenericFullStatus, specialization::NetworkSpecialization as Specialization, }; -use sc_network::consensus_gossip::{ - self, TopicNotification, MessageRecipient as GossipMessageRecipient, ConsensusMessage, -}; +use sc_network_gossip::TopicNotification; use self::validation::{LiveValidationLeaves, RecentValidatorIds, InsertedRecentKey}; use self::collator_pool::{CollatorPool, Role, Action}; use self::local_collations::LocalCollations; @@ -49,7 +47,7 @@ use std::collections::{HashMap, HashSet}; use std::pin::Pin; use std::task::{Context as PollContext, Poll}; -use crate::gossip::{POLKADOT_ENGINE_ID, GossipMessage, ErasureChunkMessage}; +use crate::gossip::{GossipMessage, ErasureChunkMessage, RegisteredMessageValidator}; #[cfg(test)] mod tests; @@ -90,13 +88,12 @@ pub trait NetworkService: Send + Sync + 'static { /// Gossip a message on given topic. fn gossip_message(&self, topic: Hash, message: GossipMessage); - /// Execute a closure with the gossip service. - fn with_gossip(&self, with: F) - where F: FnOnce(&mut dyn GossipService, &mut dyn Context); + /// Send a message to a specific peer we're connected to. + fn send_message(&self, who: PeerId, message: GossipMessage); /// Execute a closure with the polkadot protocol. fn with_spec(&self, with: F) - where F: FnOnce(&mut PolkadotProtocol, &mut dyn Context); + where Self: Sized, F: FnOnce(&mut PolkadotProtocol, &mut dyn Context); } /// This is a newtype that implements a [`ProvideGossipMessages`] shim trait. @@ -106,11 +103,10 @@ pub trait NetworkService: Send + Sync + 'static { /// /// [`NetworkService`]: ./trait.NetworkService.html /// [`ProvideGossipMessages`]: ../polkadot_availability_store/trait.ProvideGossipMessages.html -pub struct AvailabilityNetworkShim(pub std::sync::Arc); +#[derive(Clone)] +pub struct AvailabilityNetworkShim(pub RegisteredMessageValidator); -impl av_store::ProvideGossipMessages for AvailabilityNetworkShim - where T: NetworkService -{ +impl av_store::ProvideGossipMessages for AvailabilityNetworkShim { fn gossip_messages_for(&self, topic: Hash) -> Pin + Send>> { @@ -145,67 +141,6 @@ impl av_store::ProvideGossipMessages for AvailabilityNetworkShim } } -impl Clone for AvailabilityNetworkShim { - fn clone(&self) -> Self { - AvailabilityNetworkShim(self.0.clone()) - } -} - -impl NetworkService for PolkadotNetworkService { - fn gossip_messages_for(&self, topic: Hash) -> GossipMessageStream { - let (tx, rx) = std::sync::mpsc::channel(); - - PolkadotNetworkService::with_gossip(self, move |gossip, _| { - let inner_rx = gossip.messages_for(POLKADOT_ENGINE_ID, topic); - let _ = tx.send(inner_rx); - }); - - let topic_stream = match rx.recv() { - Ok(rx) => rx, - Err(_) => mpsc::unbounded().1, // return empty channel. - }; - - GossipMessageStream::new(topic_stream.boxed()) - } - - fn gossip_message(&self, topic: Hash, message: GossipMessage) { - self.gossip_consensus_message( - topic, - POLKADOT_ENGINE_ID, - message.encode(), - GossipMessageRecipient::BroadcastToAll, - ); - } - - fn with_gossip(&self, with: F) - where F: FnOnce(&mut dyn GossipService, &mut dyn Context) - { - PolkadotNetworkService::with_gossip(self, move |gossip, ctx| with(gossip, ctx)) - } - - fn with_spec(&self, with: F) - where F: FnOnce(&mut PolkadotProtocol, &mut dyn Context) - { - PolkadotNetworkService::with_spec(self, with) - } -} - -/// A gossip network subservice. -pub trait GossipService { - fn send_message(&mut self, ctx: &mut dyn Context, who: &PeerId, message: ConsensusMessage); - fn multicast(&mut self, ctx: &mut dyn Context, topic: &Hash, message: ConsensusMessage); -} - -impl GossipService for consensus_gossip::ConsensusGossip { - fn send_message(&mut self, ctx: &mut dyn Context, who: &PeerId, message: ConsensusMessage) { - consensus_gossip::ConsensusGossip::send_message(self, ctx, who, message) - } - - fn multicast(&mut self, ctx: &mut dyn Context, topic: &Hash, message: ConsensusMessage) { - consensus_gossip::ConsensusGossip::multicast(self, ctx, *topic, message, false) - } -} - /// A stream of gossip messages and an optional sender for a topic. pub struct GossipMessageStream { topic_stream: Pin + Send>>, diff --git a/network/src/router.rs b/network/src/router.rs index ae1667bab7fa..235e3e0b6d01 100644 --- a/network/src/router.rs +++ b/network/src/router.rs @@ -72,18 +72,18 @@ pub(crate) fn checked_statements(network: &N, topic: Hash) -> } /// Table routing implementation. -pub struct Router { +pub struct Router { table: Arc, attestation_topic: Hash, - fetcher: LeafWorkDataFetcher, + fetcher: LeafWorkDataFetcher, deferred_statements: Arc>, message_validator: RegisteredMessageValidator, } -impl Router { +impl Router { pub(crate) fn new( table: Arc, - fetcher: LeafWorkDataFetcher, + fetcher: LeafWorkDataFetcher, message_validator: RegisteredMessageValidator, ) -> Self { let parent_hash = fetcher.parent_hash(); @@ -103,19 +103,19 @@ impl Router { /// dropped when it is not required anymore. Otherwise, it will stick around in memory /// infinitely. pub(crate) fn checked_statements(&self) -> impl Stream { - checked_statements(&**self.network(), self.attestation_topic) + checked_statements(&*self.network(), self.attestation_topic) } fn parent_hash(&self) -> Hash { self.fetcher.parent_hash() } - fn network(&self) -> &Arc { + fn network(&self) -> &RegisteredMessageValidator { self.fetcher.network() } } -impl Clone for Router { +impl Clone for Router { fn clone(&self) -> Self { Router { table: self.table.clone(), @@ -127,9 +127,8 @@ impl Clone for Router { } } -impl Router where +impl Router where P::Api: ParachainHost, - N: NetworkService, T: Clone + Executor + Send + 'static, E: Future + Clone + Send + Unpin + 'static, { @@ -226,9 +225,8 @@ impl Router w } } -impl TableRouter for Router where +impl TableRouter for Router where P::Api: ParachainHost, - N: NetworkService, T: Clone + Executor + Send + 'static, E: Future + Clone + Send + 'static, { @@ -284,7 +282,7 @@ impl TableRouter for Router wh } } -impl Drop for Router { +impl Drop for Router { fn drop(&mut self) { let parent_hash = self.parent_hash(); self.network().with_spec(move |spec, _| { spec.remove_validation_session(parent_hash); }); diff --git a/network/src/tests/validation.rs b/network/src/tests/validation.rs index 463ab50d599e..3ffa1ab909d8 100644 --- a/network/src/tests/validation.rs +++ b/network/src/tests/validation.rs @@ -19,11 +19,11 @@ #![allow(unused)] use crate::gossip::GossipMessage; -use sc_network::Context as NetContext; -use sc_network::consensus_gossip::TopicNotification; +use sc_network::{Context as NetContext, PeerId}; +use sc_network_gossip::TopicNotification; use sp_core::{NativeOrEncoded, ExecutionContext}; use sp_keyring::Sr25519Keyring; -use crate::{GossipService, PolkadotProtocol, NetworkService, GossipMessageStream}; +use crate::{PolkadotProtocol, NetworkService, GossipMessageStream}; use polkadot_validation::{SharedTable, Network}; use polkadot_primitives::{Block, BlockNumber, Hash, Header, BlockId}; @@ -124,17 +124,15 @@ impl NetworkService for TestNetwork { GossipMessageStream::new(rx.boxed()) } + fn send_message(&self, _: PeerId, _: GossipMessage) { + unimplemented!() + } + fn gossip_message(&self, topic: Hash, message: GossipMessage) { let notification = TopicNotification { message: message.encode(), sender: None }; let _ = self.gossip.send_message.unbounded_send((topic, notification)); } - fn with_gossip(&self, with: F) - where F: FnOnce(&mut dyn GossipService, &mut dyn NetContext) - { - unimplemented!() - } - fn with_spec(&self, with: F) where F: FnOnce(&mut PolkadotProtocol, &mut dyn NetContext) { @@ -310,7 +308,6 @@ impl ParachainHost for RuntimeApi { type TestValidationNetwork = crate::validation::ValidationNetwork< TestApi, NeverExit, - TestNetwork, TaskExecutor, >; @@ -337,9 +334,8 @@ fn build_network(n: usize, executor: TaskExecutor) -> Built { ); TestValidationNetwork::new( - net, - NeverExit, message_val, + NeverExit, runtime_api.clone(), executor.clone(), ) diff --git a/network/src/validation.rs b/network/src/validation.rs index 1a7da20e6495..4ba4f002dc5c 100644 --- a/network/src/validation.rs +++ b/network/src/validation.rs @@ -62,44 +62,40 @@ pub struct LeafWorkParams { } /// Wrapper around the network service -pub struct ValidationNetwork { - network: Arc, +pub struct ValidationNetwork { api: Arc

, executor: T, - message_validator: RegisteredMessageValidator, + network: RegisteredMessageValidator, exit: E, } -impl ValidationNetwork { +impl ValidationNetwork { /// Create a new consensus networking object. pub fn new( - network: Arc, + network: RegisteredMessageValidator, exit: E, - message_validator: RegisteredMessageValidator, api: Arc

, executor: T, ) -> Self { - ValidationNetwork { network, exit, message_validator, api, executor } + ValidationNetwork { network, exit, api, executor } } } -impl Clone for ValidationNetwork { +impl Clone for ValidationNetwork { fn clone(&self) -> Self { ValidationNetwork { network: self.network.clone(), exit: self.exit.clone(), api: self.api.clone(), executor: self.executor.clone(), - message_validator: self.message_validator.clone(), } } } -impl ValidationNetwork where +impl ValidationNetwork where P: ProvideRuntimeApi + Send + Sync + 'static, P::Api: ParachainHost, E: Clone + Future + Send + Sync + 'static, - N: NetworkService, T: Clone + Executor + Send + Sync + 'static, { /// Instantiate block-DAG leaf work @@ -117,27 +113,26 @@ impl ValidationNetwork where /// leaf-work instances safely, but they should all be coordinated on which session keys /// are being used. pub fn instantiate_leaf_work(&self, params: LeafWorkParams) - -> oneshot::Receiver> + -> oneshot::Receiver> { let parent_hash = params.parent_hash; let network = self.network.clone(); let api = self.api.clone(); let task_executor = self.executor.clone(); let exit = self.exit.clone(); - let message_validator = self.message_validator.clone(); let authorities = params.authorities.clone(); let (tx, rx) = oneshot::channel(); self.network.with_spec(move |spec, ctx| { - let actions = message_validator.new_local_leaf( + let actions = network.new_local_leaf( parent_hash, MessageValidationData { authorities }, |queue_root| spec.availability_store.as_ref() .and_then(|store| store.queue_by_root(queue_root)) ); - network.with_gossip(move |gossip, ctx| actions.perform(gossip, ctx)); + actions.perform(&network); let work = spec.new_validation_leaf_work(ctx, params); let _ = tx.send(LeafWorkDataFetcher { @@ -147,7 +142,6 @@ impl ValidationNetwork where parent_hash, knowledge: work.knowledge().clone(), exit, - message_validator, }); }); @@ -155,7 +149,7 @@ impl ValidationNetwork where } } -impl ValidationNetwork where N: NetworkService { +impl ValidationNetwork { /// Convert the given `CollatorId` to a `PeerId`. pub fn collator_id_to_peer_id(&self, collator_id: CollatorId) -> impl Future> + Send @@ -177,20 +171,19 @@ impl ValidationNetwork where N: NetworkService { /// dropped when it is not required anymore. Otherwise, it will stick around in memory /// infinitely. pub fn checked_statements(&self, relay_parent: Hash) -> impl Stream { - crate::router::checked_statements(&*self.network, crate::router::attestation_topic(relay_parent)) + crate::router::checked_statements(&self.network, crate::router::attestation_topic(relay_parent)) } } /// A long-lived network which can create parachain statement routing processes on demand. -impl ParachainNetwork for ValidationNetwork where +impl ParachainNetwork for ValidationNetwork where P: ProvideRuntimeApi + Send + Sync + 'static, P::Api: ParachainHost, E: Clone + Future + Send + Sync + Unpin + 'static, - N: NetworkService, T: Clone + Executor + Send + Sync + 'static, { type Error = String; - type TableRouter = Router; + type TableRouter = Router; type BuildTableRouter = Box> + Send + Unpin>; fn communication_for( @@ -207,16 +200,16 @@ impl ParachainNetwork for ValidationNetwork where parent_hash, authorities: authorities.to_vec(), }); - let message_validator = self.message_validator.clone(); let executor = self.executor.clone(); + let network = self.network.clone(); let work = build_fetcher .map_err(|e| format!("{:?}", e)) .map_ok(move |fetcher| { let table_router = Router::new( table, fetcher, - message_validator, + network, ); let table_router_clone = table_router.clone(); @@ -241,10 +234,9 @@ impl ParachainNetwork for ValidationNetwork where #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub struct NetworkDown; -impl Collators for ValidationNetwork where +impl Collators for ValidationNetwork where P: ProvideRuntimeApi + Send + Sync + 'static, P::Api: ParachainHost, - N: NetworkService, { type Error = NetworkDown; type Collation = Pin> + Send>>; @@ -526,17 +518,16 @@ impl LiveValidationLeaves { } /// Can fetch data for a given validation leaf-work instance. -pub struct LeafWorkDataFetcher { - network: Arc, +pub struct LeafWorkDataFetcher { + network: RegisteredMessageValidator, api: Arc

, exit: E, task_executor: T, knowledge: Arc>, parent_hash: Hash, - message_validator: RegisteredMessageValidator, } -impl LeafWorkDataFetcher { +impl LeafWorkDataFetcher { /// Get the parent hash. pub(crate) fn parent_hash(&self) -> Hash { self.parent_hash @@ -553,7 +544,7 @@ impl LeafWorkDataFetcher { } /// Get the network service. - pub(crate) fn network(&self) -> &Arc { + pub(crate) fn network(&self) -> &RegisteredMessageValidator { &self.network } @@ -568,7 +559,7 @@ impl LeafWorkDataFetcher { } } -impl Clone for LeafWorkDataFetcher { +impl Clone for LeafWorkDataFetcher { fn clone(&self) -> Self { LeafWorkDataFetcher { network: self.network.clone(), @@ -577,14 +568,12 @@ impl Clone for LeafWorkDataFetcher LeafWorkDataFetcher where +impl LeafWorkDataFetcher where P::Api: ParachainHost, - N: NetworkService, T: Clone + Executor + Send + 'static, E: Future + Clone + Send + 'static, { diff --git a/runtime/src/crowdfund.rs b/runtime/src/crowdfund.rs index df3f5d31e5e3..1928e2d594df 100644 --- a/runtime/src/crowdfund.rs +++ b/runtime/src/crowdfund.rs @@ -464,24 +464,34 @@ impl Module { .collect() } + /// Child trie unique id for a crowdfund is built from the hash part of the fund id. + pub fn trie_unique_id(fund_id: &[u8]) -> child::ChildInfo { + let start = CHILD_STORAGE_KEY_PREFIX.len() + b"default:".len(); + child::ChildInfo::new_default(&fund_id[start..]) + } + pub fn contribution_put(index: FundIndex, who: &T::AccountId, balance: &BalanceOf) { let id = Self::id_from_index(index); - who.using_encoded(|b| child::put(id.as_ref(), b, balance)); + who.using_encoded(|b| child::put(id.as_ref(), Self::trie_unique_id(id.as_ref()), b, balance)); } pub fn contribution_get(index: FundIndex, who: &T::AccountId) -> BalanceOf { let id = Self::id_from_index(index); - who.using_encoded(|b| child::get_or_default::>(id.as_ref(), b)) + who.using_encoded(|b| child::get_or_default::>( + id.as_ref(), + Self::trie_unique_id(id.as_ref()), + b, + )) } pub fn contribution_kill(index: FundIndex, who: &T::AccountId) { let id = Self::id_from_index(index); - who.using_encoded(|b| child::kill(id.as_ref(), b)); + who.using_encoded(|b| child::kill(id.as_ref(), Self::trie_unique_id(id.as_ref()), b)); } pub fn crowdfund_kill(index: FundIndex) { let id = Self::id_from_index(index); - child::kill_storage(id.as_ref()); + child::kill_storage(id.as_ref(), Self::trie_unique_id(id.as_ref())); } } diff --git a/service/src/lib.rs b/service/src/lib.rs index 13c4ad11595e..c391787d001d 100644 --- a/service/src/lib.rs +++ b/service/src/lib.rs @@ -238,6 +238,7 @@ pub fn new_full(config: Configuration) let mut gossip_validator = network_gossip::register_validator( service.network(), (is_known, client.clone()), + &service.spawn_task_handle(), ); if participates_in_consensus { @@ -247,7 +248,7 @@ pub fn new_full(config: Configuration) let mut path = PathBuf::from(db_path); path.push("availability"); - let gossip = polkadot_network::AvailabilityNetworkShim(service.network()); + let gossip = polkadot_network::AvailabilityNetworkShim(gossip_validator.clone()); #[cfg(not(target_os = "unknown"))] { @@ -275,9 +276,8 @@ pub fn new_full(config: Configuration) // collator connections and validation network both fulfilled by this let validation_network = ValidationNetwork::new( - service.network(), - service.on_exit(), gossip_validator, + service.on_exit(), service.client(), WrappedExecutor(service.spawn_task_handle()), ); @@ -374,6 +374,7 @@ pub fn new_full(config: Configuration) on_exit: service.on_exit(), telemetry_on_connect: Some(service.telemetry_on_connect_stream()), voting_rule: grandpa::VotingRulesBuilder::default().build(), + executor: service.spawn_task_handle(), }; service.spawn_essential_task(grandpa::run_grandpa_voter(grandpa_config)?); } else {