From 980a3604ce7f8d67178af9ba91e87e6b2413c2e3 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Wed, 21 Oct 2020 13:43:38 +0200 Subject: [PATCH 01/62] add sub errors to SubSystemError --- Cargo.lock | 9 ++++---- node/subsystem/Cargo.toml | 1 + node/subsystem/src/lib.rs | 44 +++++++++++++++++---------------------- 3 files changed, 25 insertions(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 83add4090c73..df5c21872ead 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5142,6 +5142,7 @@ dependencies = [ "sc-network", "smallvec 1.4.2", "sp-core", + "thiserror", ] [[package]] @@ -8961,18 +8962,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08" +checksum = "318234ffa22e0920fe9a40d7b8369b5f649d490980cf7aadcf1eb91594869b42" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793" +checksum = "cae2447b6282786c3493999f40a9be2a6ad20cb8bd268b0a0dbf5a065535c0ab" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", diff --git a/node/subsystem/Cargo.toml b/node/subsystem/Cargo.toml index dfdac1e7cc12..55c45b7e3d1f 100644 --- a/node/subsystem/Cargo.toml +++ b/node/subsystem/Cargo.toml @@ -21,6 +21,7 @@ polkadot-statement-table = { path = "../../statement-table" } sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } smallvec = "1.4.1" sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } +thiserror = "1.0.21" [dev-dependencies] assert_matches = "1.3.0" diff --git a/node/subsystem/src/lib.rs b/node/subsystem/src/lib.rs index dea391c5b2c3..16a96a4af429 100644 --- a/node/subsystem/src/lib.rs +++ b/node/subsystem/src/lib.rs @@ -105,6 +105,8 @@ pub enum FromOverseer { }, } + +use thiserror::Error; /// An error type that describes faults that may happen /// /// These are: @@ -112,31 +114,23 @@ pub enum FromOverseer { /// * Subsystems dying when they are not expected to /// * Subsystems not dying when they are told to die /// * etc. -#[derive(Debug, PartialEq, Eq)] -pub struct SubsystemError; - -impl From for SubsystemError { - fn from(_: mpsc::SendError) -> Self { - Self - } -} - -impl From for SubsystemError { - fn from(_: oneshot::Canceled) -> Self { - Self - } -} - -impl From for SubsystemError { - fn from(_: futures::task::SpawnError) -> Self { - Self - } -} - -impl From for SubsystemError { - fn from(e: std::convert::Infallible) -> Self { - match e {} - } +#[derive(Error, Debug)] +pub enum SubsystemError { + /// A notification connection is no longer valid. + #[error(transparent)] + NotifyCancellation(#[from] oneshot::Canceled), + + /// Queue does not accept another item. + #[error(transparent)] + QueueError(#[from] mpsc::SendError), + + /// An attempt to spawn a futures task did not succeed. + #[error(transparent)] + TaskSpawn(#[from] futures::task::SpawnError), + + /// An infallable error. + #[error(transparent)] + Infallible(#[from] std::convert::Infallible), } /// An asynchronous subsystem task.. From f8ea7d8914b764e9d17855a1ef02d1e61df3b5b4 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Wed, 21 Oct 2020 15:02:13 +0200 Subject: [PATCH 02/62] step 2 --- node/overseer/src/lib.rs | 22 +++++++++++----------- node/subsystem/src/lib.rs | 6 ++++++ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/node/overseer/src/lib.rs b/node/overseer/src/lib.rs index e33a5756c80e..e7ba8da0b469 100644 --- a/node/overseer/src/lib.rs +++ b/node/overseer/src/lib.rs @@ -173,7 +173,7 @@ enum Event { enum ExternalRequest { WaitForActivation { hash: Hash, - response_channel: oneshot::Sender<()>, + response_channel: oneshot::Sender>, }, } @@ -208,7 +208,7 @@ impl OverseerHandler { /// Note that due the fact the overseer doesn't store the whole active-leaves set, only deltas, /// the response channel may never return if the hash was deactivated before this call. /// In this case, it's the caller's responsibility to ensure a timeout is set. - pub async fn wait_for_activation(&mut self, hash: Hash, response_channel: oneshot::Sender<()>) -> SubsystemResult<()> { + pub async fn wait_for_activation(&mut self, hash: Hash, response_channel: oneshot::Sender>) -> SubsystemResult<()> { self.events_tx.send(Event::ExternalRequest(ExternalRequest::WaitForActivation { hash, response_channel @@ -303,7 +303,7 @@ impl SubsystemContext for OverseerSubsystemContext { } async fn recv(&mut self) -> SubsystemResult> { - self.rx.next().await.ok_or(SubsystemError) + self.rx.next().await.ok_or(SubsystemError::Context("No next() rx message to process".to_owned())) } async fn spawn(&mut self, name: &'static str, s: Pin + Send>>) @@ -398,7 +398,7 @@ pub struct Overseer { s: S, /// Here we keep handles to spawned subsystems to be notified when they terminate. - running_subsystems: FuturesUnordered>, + running_subsystems: FuturesUnordered>>, /// Gather running subsystms' outbound streams into one. running_subsystems_rx: StreamUnordered>, @@ -407,7 +407,7 @@ pub struct Overseer { events_rx: mpsc::Receiver, /// External listeners waiting for a hash to be in the active-leave set. - activation_external_listeners: HashMap>>, + activation_external_listeners: HashMap>>>, /// A set of leaves that `Overseer` starts working with. /// @@ -1267,7 +1267,7 @@ where loop { select! { - _ = self.running_subsystems.next() => { + x = self.running_subsystems.next() => { if self.running_subsystems.is_empty() { break; } @@ -1331,7 +1331,7 @@ where if let Poll::Ready(Some(finished)) = poll!(self.running_subsystems.next()) { log::error!(target: LOG_TARGET, "Subsystem finished unexpectedly {:?}", finished); self.stop().await; - return Err(SubsystemError); + return finished; } // Looks like nothing is left to be polled, let's take a break. @@ -1541,7 +1541,7 @@ where if let Some(listeners) = self.activation_external_listeners.remove(hash) { for listener in listeners { // it's fine if the listener is no longer interested - let _ = listener.send(()); + let _ = listener.send(Ok(())); } } } @@ -1567,7 +1567,7 @@ where ExternalRequest::WaitForActivation { hash, response_channel } => { if self.active_leaves.get(&hash).is_some() { // it's fine if the listener is no longer interested - let _ = response_channel.send(()); + let _ = response_channel.send(Ok(())); } else { self.activation_external_listeners.entry(hash).or_default().push(response_channel); } @@ -1586,7 +1586,7 @@ where fn spawn( spawner: &mut S, - futures: &mut FuturesUnordered>, + futures: &mut FuturesUnordered>>, streams: &mut StreamUnordered>, s: impl Subsystem>, ) -> SubsystemResult> { @@ -1605,7 +1605,7 @@ fn spawn( spawner.spawn(name, fut); streams.push(from_rx); - futures.push(Box::pin(rx.map(|_| ()))); + futures.push(Box::pin(rx.map(|e| { log::warn!("Dropping error {:?}", e); Ok(()) }))); let instance = Some(SubsystemInstance { tx: to_tx, diff --git a/node/subsystem/src/lib.rs b/node/subsystem/src/lib.rs index 16a96a4af429..e3a4788f6704 100644 --- a/node/subsystem/src/lib.rs +++ b/node/subsystem/src/lib.rs @@ -131,6 +131,12 @@ pub enum SubsystemError { /// An infallable error. #[error(transparent)] Infallible(#[from] std::convert::Infallible), + + #[error("Failed to {0}")] + Context(String), + + #[error("xxx")] + UnexpectedTermination{subsystem: String, #[source] source: Option> }, } /// An asynchronous subsystem task.. From 172d88ff555d4560ed377ac03ae0bdb580335b9e Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Wed, 21 Oct 2020 16:29:15 +0200 Subject: [PATCH 03/62] step 3 --- node/core/chain-api/src/lib.rs | 2 +- node/core/proposer/src/lib.rs | 3 ++- node/subsystem/src/errors.rs | 4 ++++ node/subsystem/src/lib.rs | 3 +-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/node/core/chain-api/src/lib.rs b/node/core/chain-api/src/lib.rs index b41c017cda10..b2412de65e8f 100644 --- a/node/core/chain-api/src/lib.rs +++ b/node/core/chain-api/src/lib.rs @@ -112,7 +112,7 @@ where let maybe_header = subsystem.client.header(BlockId::Hash(hash)); match maybe_header { // propagate the error - Err(e) => Some(Err(e.to_string().into())), + Err(e) => Some(Err(e.into())), // fewer than `k` ancestors are available Ok(None) => None, Ok(Some(header)) => { diff --git a/node/core/proposer/src/lib.rs b/node/core/proposer/src/lib.rs index ed1a52230989..8aefe1c8bd39 100644 --- a/node/core/proposer/src/lib.rs +++ b/node/core/proposer/src/lib.rs @@ -206,7 +206,7 @@ where // It would have been more ergonomic to use thiserror to derive the // From implementations, Display, and std::error::Error, but unfortunately -// two of the wrapped errors (sp_inherents::Error, SubsystemError) also +// one of the wrapped errors (sp_inherents::Error) also // don't impl std::error::Error, which breaks the thiserror derive. #[derive(Debug)] pub enum Error { @@ -261,6 +261,7 @@ impl std::error::Error for Error { Self::Consensus(err) => Some(err), Self::Blockchain(err) => Some(err), Self::ClosedChannelFromProvisioner(err) => Some(err), + Self::Subsystem(err) => Some(err), _ => None } } diff --git a/node/subsystem/src/errors.rs b/node/subsystem/src/errors.rs index 40edb1b3c148..76aedd5a7fd8 100644 --- a/node/subsystem/src/errors.rs +++ b/node/subsystem/src/errors.rs @@ -32,6 +32,8 @@ impl core::fmt::Display for RuntimeApiError { } } +impl std::error::Error for RuntimeApiError {} + /// A description of an error causing the chain API request to be unservable. #[derive(Debug, Clone)] pub struct ChainApiError { @@ -55,3 +57,5 @@ impl core::fmt::Display for ChainApiError { write!(f, "{}", self.msg) } } + +impl std::error::Error for ChainApiError {} \ No newline at end of file diff --git a/node/subsystem/src/lib.rs b/node/subsystem/src/lib.rs index e3a4788f6704..43aa1309ba34 100644 --- a/node/subsystem/src/lib.rs +++ b/node/subsystem/src/lib.rs @@ -31,6 +31,7 @@ use futures::future::BoxFuture; use polkadot_primitives::v1::Hash; use async_trait::async_trait; use smallvec::SmallVec; +use thiserror::Error; use crate::messages::AllMessages; @@ -105,8 +106,6 @@ pub enum FromOverseer { }, } - -use thiserror::Error; /// An error type that describes faults that may happen /// /// These are: From 00aed7569b4d56aa724de31da35c67bf0ddd4f15 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Wed, 21 Oct 2020 17:58:18 +0200 Subject: [PATCH 04/62] step 4 --- Cargo.lock | 1908 +++++++++-------- node/core/av-store/Cargo.toml | 3 +- node/core/av-store/src/lib.rs | 11 +- node/core/backing/Cargo.toml | 3 +- node/core/backing/src/lib.rs | 16 +- node/core/bitfield-signing/Cargo.toml | 3 +- node/core/bitfield-signing/src/lib.rs | 17 +- node/core/candidate-selection/src/lib.rs | 15 +- node/core/candidate-validation/src/lib.rs | 5 +- node/core/chain-api/src/lib.rs | 3 +- .../availability-distribution/Cargo.toml | 1 + .../availability-distribution/src/lib.rs | 21 +- node/overseer/Cargo.toml | 2 + node/overseer/src/lib.rs | 7 +- node/subsystem-util/Cargo.toml | 1 + node/subsystem-util/src/lib.rs | 62 +- node/subsystem/src/lib.rs | 11 +- 17 files changed, 1173 insertions(+), 916 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index df5c21872ead..fc0f4e649f73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -21,9 +21,9 @@ dependencies = [ [[package]] name = "adler" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccc9a9dd069569f212bc4330af9f17c4afb5e8ce185e83dbb14f1349dda18b10" +checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" [[package]] name = "aead" @@ -31,14 +31,14 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" dependencies = [ - "generic-array 0.14.2", + "generic-array 0.14.4", ] [[package]] name = "aes" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7001367fde4c768a19d1029f0a8be5abd9308e1119846d5bd9ad26297b8faf5" +checksum = "dd2bc6d3f370b5666245ff421e231cba4353df936e26986d2918e61a8fd6aef6" dependencies = [ "aes-soft", "aesni", @@ -47,43 +47,43 @@ dependencies = [ [[package]] name = "aes-gcm" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f5007801316299f922a6198d1d09a0bae95786815d066d5880d13f7c45ead1" +checksum = "0301c9e9c443494d970a07885e8cf3e587bae8356a1d5abd0999068413f7205f" dependencies = [ "aead", "aes", "block-cipher", "ghash", - "subtle 2.2.3", + "subtle 2.3.0", ] [[package]] name = "aes-soft" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4925647ee64e5056cf231608957ce7c81e12d6d6e316b9ce1404778cc1d35fa7" +checksum = "63dd91889c49327ad7ef3b500fd1109dbd3c509a03db0d4a9ce413b79f575cb6" dependencies = [ "block-cipher", "byteorder 1.3.4", - "opaque-debug 0.2.3", + "opaque-debug 0.3.0", ] [[package]] name = "aesni" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050d39b0b7688b3a3254394c3e30a9d66c41dcf9b05b0e2dbdc623f6505d264" +checksum = "0a6fe808308bb07d393e2ea47780043ec47683fcf19cf5efc8ca51c50cc8c68a" dependencies = [ "block-cipher", - "opaque-debug 0.2.3", + "opaque-debug 0.3.0", ] [[package]] name = "ahash" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f33b5018f120946c1dcf279194f238a9f146725593ead1c08fa47ff22b0b5d3" +checksum = "29661b60bec623f0586702976ff4d0c9942dcb6723161c2df0eea78455cfedfb" dependencies = [ "const-random", ] @@ -96,9 +96,9 @@ checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" [[package]] name = "aho-corasick" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" +checksum = "b476ce7103678b0c6d3d395dbbae31d48ff910bd28be979ba5d48c6351131d0d" dependencies = [ "memchr", ] @@ -134,9 +134,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.31" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bb70cc08ec97ca5450e6eba421deeea5f172c0fc61f78b5357b2a8e8be195f" +checksum = "a1fd36ffbb1fb7c834eac128ea8d0e310c5aeb635548f9d58861e1308d46e71c" [[package]] name = "approx" @@ -190,7 +190,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d0864d84b8e07b145449be9a8537db86bf9de5ce03b913214694643b4743502" dependencies = [ "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -209,9 +209,9 @@ dependencies = [ [[package]] name = "assert_matches" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7deb0a829ca7bcfaf5da70b073a8d128619259a7be8216a355e23f00763059e5" +checksum = "695579f0f2520f3774bb40461e5adb066459d4e0af4d59d20175484fb8e9edf1" [[package]] name = "async-channel" @@ -230,10 +230,10 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90f47c78ea98277cb1f5e6f60ba4fc762f5eafe9f6511bc2f7dfd8b75c225650" dependencies = [ - "async-io 0.1.5", - "futures-lite 0.1.10", + "async-io 0.1.11", + "futures-lite 0.1.11", "multitask", - "parking 1.0.5", + "parking 1.0.6", "scoped-tls", "waker-fn", ] @@ -259,7 +259,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "124ac8c265e407641c3362b8f4d39cdb4e243885b71eef087be27199790f5a3a" dependencies = [ "async-executor 1.3.0", - "async-io 1.1.0", + "async-io 1.1.6", "futures-lite 1.11.2", "num_cpus", "once_cell 1.4.1", @@ -267,42 +267,39 @@ dependencies = [ [[package]] name = "async-io" -version = "0.1.5" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8126ef9fb99355c6fd27575d691be4887b884137a5b6f48c2d961f13590c51" +checksum = "3ae22a338d28c75b53702b66f77979062cb29675db376d99e451af4fa79dedb3" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "concurrent-queue", - "futures-lite 0.1.10", + "futures-lite 0.1.11", "libc", "once_cell 1.4.1", - "parking 1.0.5", + "parking 2.0.0", + "polling 0.1.9", "socket2", - "vec-arena 0.5.0", + "vec-arena 0.5.2", "wepoll-sys-stjepang", "winapi 0.3.9", ] [[package]] name = "async-io" -version = "1.1.0" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38628c78a34f111c5a6b98fc87dfc056cd1590b61afe748b145be4623c56d194" +checksum = "b5bfd63f6fc8fd2925473a147d3f4d252c712291efdde0d7057b25146563402c" dependencies = [ - "cfg-if", "concurrent-queue", "fastrand", "futures-lite 1.11.2", - "libc", "log 0.4.11", + "nb-connect", "once_cell 1.4.1", "parking 2.0.0", - "polling", - "socket2", + "polling 1.1.0", "vec-arena 1.0.0", "waker-fn", - "wepoll-sys-stjepang", - "winapi 0.3.9", ] [[package]] @@ -321,10 +318,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9fa76751505e8df1c7a77762f60486f60c71bbd9b8557f4da6ad47d083732ed" dependencies = [ "async-global-executor", - "async-io 1.1.0", + "async-io 1.1.6", "async-mutex", "blocking 1.0.2", - "crossbeam-utils", + "crossbeam-utils 0.7.2", "futures-channel", "futures-core", "futures-io", @@ -359,7 +356,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df097e3f506bec0e1a24f06bb3c962c228f36671de841ff579cb99f371772634" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "rustls", "webpki", "webpki-roots 0.19.0", @@ -367,13 +364,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.36" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a265e3abeffdce30b2e26b7a11b222fe37c6067404001b434101457d0385eb92" +checksum = "b246867b8b3b6ae56035f1eb1ed557c1d8eae97f0d53696138a50fa0e3a3b8c0" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -407,21 +404,21 @@ checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" [[package]] name = "autocfg" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.50" +version = "0.3.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293" +checksum = "707b586e0e2f247cbde68cdd2c3ce69ea7b7be43e1c5b426e37c9319c4b9838e" dependencies = [ "addr2line", - "cfg-if", + "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.20.0", + "object 0.21.1", "rustc-demangle", ] @@ -461,7 +458,7 @@ checksum = "66c0bb6167449588ff70803f4127f0684f9063097eca5016f37eb52b92c2cf36" dependencies = [ "bitflags", "cexpr", - "cfg-if", + "cfg-if 0.1.10", "clang-sys", "clap", "env_logger", @@ -469,7 +466,7 @@ dependencies = [ "lazycell", "log 0.4.11", "peeking_take_while", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", "regex", "rustc-hash", @@ -565,7 +562,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "block-padding", + "block-padding 0.1.5", "byte-tools", "byteorder 1.3.4", "generic-array 0.12.3", @@ -577,16 +574,17 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "generic-array 0.14.2", + "block-padding 0.2.1", + "generic-array 0.14.4", ] [[package]] name = "block-cipher" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa136449e765dc7faa244561ccae839c394048667929af599b5d931ebe7b7f10" +checksum = "f337a3e6da609650eb74e02bc9fac7b735049f7623ab12f2e4c719316fcc7e80" dependencies = [ - "generic-array 0.14.2", + "generic-array 0.14.4", ] [[package]] @@ -598,6 +596,12 @@ dependencies = [ "byte-tools", ] +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + [[package]] name = "blocking" version = "0.4.7" @@ -606,21 +610,21 @@ checksum = "d2468ff7bf85066b4a3678fede6fe66db31846d753ff0adfbfab2c6a6e81612b" dependencies = [ "async-channel", "atomic-waker", - "futures-lite 0.1.10", + "futures-lite 0.1.11", "once_cell 1.4.1", - "parking 1.0.5", + "parking 1.0.6", "waker-fn", ] [[package]] name = "blocking" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e94bf99b692f54c9d05f97454d3faf11134523fe5b180564a3fb6ed63bcc0a" +checksum = "ea5800d29218fea137b0880387e5948694a23c93fcdde157006966693a865c7c" dependencies = [ "async-channel", "atomic-waker", - "futures-lite 0.1.10", + "futures-lite 0.1.11", "once_cell 1.4.1", "waker-fn", ] @@ -647,9 +651,9 @@ checksum = "476e9cd489f9e121e02ffa6014a8ef220ecb15c05ed23fc34cca13925dc283fb" [[package]] name = "bstr" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931" +checksum = "473fc6b38233f9af7baa94fb5852dca389e3d95b8e21c8e3719301462c5d9faf" dependencies = [ "memchr", ] @@ -715,9 +719,9 @@ checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" [[package]] name = "cc" -version = "1.0.58" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" +checksum = "ed67cbde08356238e75fc4656be4749481eeffb09e19f320a25237d5221c985d" dependencies = [ "jobserver", ] @@ -737,40 +741,48 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "chacha20" -version = "0.4.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "086c0f07ac275808b7bf9a39f2fd013aae1498be83632814c8c4e0bd53f2dc58" +checksum = "244fbce0d47e97e8ef2f63b81d5e05882cb518c68531eb33194990d7b7e85845" dependencies = [ - "stream-cipher 0.4.1", + "stream-cipher", "zeroize", ] [[package]] name = "chacha20poly1305" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18b0c90556d8e3fec7cf18d84a2f53d27b21288f2fe481b830fadcf809e48205" +checksum = "9bf18d374d66df0c05cdddd528a7db98f78c28e2519b120855c4f84c5027b1f5" dependencies = [ "aead", "chacha20", "poly1305", - "stream-cipher 0.4.1", + "stream-cipher", "zeroize", ] [[package]] name = "chrono" -version = "0.4.13" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c74d84029116787153e02106bf53e66828452a4b325cc8652b788b5967c0a0b6" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" dependencies = [ "js-sys", + "libc", "num-integer", "num-traits 0.2.12", "time", "wasm-bindgen", + "winapi 0.3.9", ] [[package]] @@ -786,9 +798,9 @@ dependencies = [ [[package]] name = "clap" -version = "2.33.1" +version = "2.33.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" +checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" dependencies = [ "ansi_term 0.11.0", "atty", @@ -817,6 +829,32 @@ dependencies = [ "bitflags", ] +[[package]] +name = "color-eyre" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2a5123db5af8349c41c43ed0e5dca1cd56c911ea0c4ce6e6ff30f159fa5d27e" +dependencies = [ + "backtrace", + "color-spantrace", + "eyre", + "indenter", + "once_cell 1.4.1", + "owo-colors", + "tracing-error", +] + +[[package]] +name = "color-spantrace" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a99aa4aa18448eef4c7d3f86d2720d2d8cad5c860fe9ff9b279293efdc8f5be" +dependencies = [ + "ansi_term 0.11.0", + "tracing-core", + "tracing-error", +] + [[package]] name = "concurrent-queue" version = "1.2.2" @@ -832,7 +870,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "wasm-bindgen", ] @@ -848,9 +886,9 @@ dependencies = [ [[package]] name = "const-random" -version = "0.1.8" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f1af9ac737b2dd2d577701e59fd09ba34822f6f2ebdb30a7647405d9e55e16a" +checksum = "02dc82c12dc2ee6e1ded861cf7d582b46f66f796d1b6c93fa28b911ead95da02" dependencies = [ "const-random-macro", "proc-macro-hack", @@ -858,14 +896,20 @@ dependencies = [ [[package]] name = "const-random-macro" -version = "0.1.8" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25e4c606eb459dd29f7c57b2e0879f2b6f14ee130918c2b78ccb58a9624e6c7a" +checksum = "fc757bbb9544aa296c2ae00c679e81f886b37e28e59097defe0cf524306f6685" dependencies = [ - "getrandom", + "getrandom 0.2.0", "proc-macro-hack", ] +[[package]] +name = "const_fn" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2" + [[package]] name = "constant_time_eq" version = "0.1.5" @@ -890,9 +934,9 @@ checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] name = "cpuid-bool" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d375c433320f6c5057ae04a04376eef4d04ce2801448cf8863a78da99107be4" +checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" [[package]] name = "cranelift-bforest" @@ -988,11 +1032,21 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils 0.8.0", ] [[package]] @@ -1001,34 +1055,59 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", + "crossbeam-epoch 0.8.2", + "crossbeam-utils 0.7.2", "maybe-uninit", ] +[[package]] +name = "crossbeam-deque" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-epoch 0.9.0", + "crossbeam-utils 0.8.0", +] + [[package]] name = "crossbeam-epoch" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ - "autocfg 1.0.0", - "cfg-if", - "crossbeam-utils", + "autocfg 1.0.1", + "cfg-if 0.1.10", + "crossbeam-utils 0.7.2", "lazy_static", "maybe-uninit", "memoffset", "scopeguard 1.1.0", ] +[[package]] +name = "crossbeam-epoch" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0f606a85340376eef0d6d8fec399e6d4a544d648386c6645eb6d0653b27d9f" +dependencies = [ + "cfg-if 1.0.0", + "const_fn", + "crossbeam-utils 0.8.0", + "lazy_static", + "memoffset", + "scopeguard 1.1.0", +] + [[package]] name = "crossbeam-queue" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" dependencies = [ - "cfg-if", - "crossbeam-utils", + "cfg-if 0.1.10", + "crossbeam-utils 0.7.2", "maybe-uninit", ] @@ -1038,8 +1117,20 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "autocfg 1.0.0", - "cfg-if", + "autocfg 1.0.1", + "cfg-if 0.1.10", + "lazy_static", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec91540d98355f690a86367e566ecad2e9e579f230230eb7c21398372be73ea5" +dependencies = [ + "autocfg 1.0.1", + "cfg-if 1.0.0", + "const_fn", "lazy_static", ] @@ -1065,8 +1156,8 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.2", - "subtle 2.2.3", + "generic-array 0.14.4", + "subtle 2.3.0", ] [[package]] @@ -1097,15 +1188,28 @@ dependencies = [ "byteorder 1.3.4", "digest 0.8.1", "rand_core 0.5.1", - "subtle 2.2.3", + "subtle 2.3.0", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8492de420e9e60bc9a1d66e2dbb91825390b738a388606600663fc529b4b307" +dependencies = [ + "byteorder 1.3.4", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle 2.3.0", "zeroize", ] [[package]] name = "data-encoding" -version = "2.2.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72aa14c04dfae8dd7d8a2b1cb7ca2152618cd01336dbfe704b8dcbf8d41dbd69" +checksum = "d4d0e2d24e5ee3b23a01de38eefdcd978907890701f08ffffd4cb457ca4ee8d6" [[package]] name = "derive_more" @@ -1139,9 +1243,9 @@ version = "0.99.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41cb0e6161ad61ed084a36ba71fbba9e3ac5aee3606fb607fe08da6acbcf3d8c" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -1165,7 +1269,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.2", + "generic-array 0.14.4", ] [[package]] @@ -1174,7 +1278,7 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "dirs-sys", ] @@ -1230,16 +1334,16 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] name = "dyn-clone" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c53dc3a653e0f64081026e4bf048d48fec9fce90c66e8326ca7292df0ff2d82" +checksum = "d55796afa1b20c2945ca8eabfc421839f2b766619209f1ede813cf2484f31804" [[package]] name = "easy-parallel" @@ -1249,32 +1353,32 @@ checksum = "1dd4afd79212583ff429b913ad6605242ed7eec277e950b1438f300748f948f4" [[package]] name = "ed25519" -version = "1.0.1" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf038a7b6fd7ef78ad3348b63f3a17550877b0e28f8d68bcc94894d1412158bc" +checksum = "37c66a534cbb46ab4ea03477eae19d5c22c01da8258030280b7bd9d8433fb6ef" dependencies = [ "signature", ] [[package]] name = "ed25519-dalek" -version = "1.0.0-pre.4" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a8a37f4e8b35af971e6db5e3897e7a6344caa3f92f6544f88125a1f5f0035a" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ - "curve25519-dalek", + "curve25519-dalek 3.0.0", "ed25519", "rand 0.7.3", "serde", - "sha2 0.8.2", + "sha2 0.9.1", "zeroize", ] [[package]] name = "either" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56b59865bce947ac5958779cfa508f6c3b9497cc762b7e24a12d11ccde2c4f" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "enum_primitive" @@ -1300,9 +1404,9 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "946ee94e3dbf58fdd324f9ce245c7b238d46a66f00e86a020b71996349e46cce" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -1335,9 +1439,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b480f641ccf0faf324e20c1d3e53d81b7484c698b42ea677f6907ae4db195371" +checksum = "6eab5ee3df98a279d9b316b1af6ac95422127b1290317e6d18c1743c99418b01" dependencies = [ "errno-dragonfly", "libc", @@ -1378,7 +1482,17 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", +] + +[[package]] +name = "eyre" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c5cb4dc433c59f09df4b4450f649cbfed61e8a3505abe32e4154066439157e" +dependencies = [ + "indenter", + "once_cell 1.4.1", ] [[package]] @@ -1397,9 +1511,9 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", "synstructure", ] @@ -1435,24 +1549,25 @@ dependencies = [ [[package]] name = "femme" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b6b21baebbed15551f2170010ca4101b9ed3fdc05822791c8bd4631840eab81" +checksum = "2af1a24f391a5a94d756db5092c6576aad494b88a71a5a36b20c67b63e0df034" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "js-sys", "log 0.4.11", "serde", "serde_derive", + "serde_json", "wasm-bindgen", "web-sys", ] [[package]] name = "file-per-thread-logger" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b3937f028664bd0e13df401ba49a4567ccda587420365823242977f06609ed1" +checksum = "4fdbe0d94371f9ce939b555dd342d0686cc4c0cadbcd4b61d70af5ff97eb4126" dependencies = [ "env_logger", "log 0.4.11", @@ -1465,7 +1580,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8feb87a63249689640ac9c011742c33139204e3c134293d3054022276869133b" dependencies = [ "either", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 2.0.2", "log 0.4.11", "num-traits 0.2.12", @@ -1493,11 +1608,11 @@ checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" [[package]] name = "flate2" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68c90b0fc46cf89d227cc78b40e494ff81287a92dd07631e5af0d06fe3cf885e" +checksum = "da80be589a72651dcda34d8b35bcdc9b7254ad06325611074d9cc0fbb19f60ee" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "crc32fast", "libc", "libz-sys", @@ -1513,7 +1628,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "parity-scale-codec", ] @@ -1521,7 +1636,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-support", "frame-system", @@ -1539,7 +1654,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "chrono", "frame-benchmarking", @@ -1559,7 +1674,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-support", "frame-system", @@ -1575,7 +1690,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "12.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "parity-scale-codec", "serde", @@ -1586,7 +1701,7 @@ dependencies = [ [[package]] name = "frame-support" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "bitmask", "frame-metadata", @@ -1611,40 +1726,40 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-support-procedural-tools", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] name = "frame-support-procedural-tools" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] name = "frame-support-procedural-tools-derive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] name = "frame-system" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -1660,7 +1775,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -1674,7 +1789,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "parity-scale-codec", "sp-api", @@ -1694,9 +1809,9 @@ dependencies = [ [[package]] name = "fs_extra" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674" +checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" [[package]] name = "fuchsia-cprng" @@ -1722,15 +1837,15 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "futures" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" +checksum = "4c7e4c2612746b0df8fed4ce0c69156021b704c9aefa360311c04e6e9e002eed" [[package]] name = "futures" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613" +checksum = "5d8e3078b7b2a8a671cb7a3d17b4760e4181ea243227776ba83fd043b4ca034e" dependencies = [ "futures-channel", "futures-core", @@ -1743,9 +1858,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" +checksum = "a7a4d35f7401e948629c9c3d6638fb9bf94e0b2121e96c3b428cc4e631f3eb74" dependencies = [ "futures-core", "futures-sink", @@ -1762,9 +1877,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" +checksum = "d674eaa0056896d5ada519900dbf97ead2e46a7b6621e8160d79e2f2e1e2784b" [[package]] name = "futures-core-preview" @@ -1778,7 +1893,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" dependencies = [ - "futures 0.1.29", + "futures 0.1.30", "num_cpus", ] @@ -1788,21 +1903,21 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdcef58a173af8148b182684c9f2d5250875adbcaff7b5794073894f9d8634a9" dependencies = [ - "futures 0.1.29", - "futures 0.3.5", + "futures 0.1.30", + "futures 0.3.6", "lazy_static", "log 0.4.11", "parking_lot 0.9.0", - "pin-project", + "pin-project 0.4.27", "serde", "serde_json", ] [[package]] name = "futures-executor" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314" +checksum = "cc709ca1da6f66143b8c9bec8e6260181869893714e9b5a490b169b0414144ab" dependencies = [ "futures-core", "futures-task", @@ -1812,21 +1927,21 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" +checksum = "5fc94b64bb39543b4e432f1790b6bf18e3ee3b74653c5449f63310e9a74b123c" [[package]] name = "futures-lite" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe71459749b2e8e66fb95df721b22fa08661ad384a0c5b519e11d3893b4692a" +checksum = "97999970129b808f0ccba93211201d431fcc12d7e1ffae03a61b5cedd1a7ced2" dependencies = [ "fastrand", "futures-core", "futures-io", "memchr", - "parking 1.0.5", + "parking 2.0.0", "pin-project-lite", "waker-fn", ] @@ -1848,27 +1963,27 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39" +checksum = "f57ed14da4603b2554682e9f2ff3c65d7567b53188db96cb71538217fc64581b" dependencies = [ "proc-macro-hack", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] name = "futures-sink" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" +checksum = "0d8764258ed64ebc5d9ed185cf86a95db5cac810269c5d20ececb32e0088abbd" [[package]] name = "futures-task" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" +checksum = "4dd26820a9f3637f1302da8bceba3ff33adbe53464b54ca24d4e2d4f1db30f94" dependencies = [ "once_cell 1.4.1", ] @@ -1891,11 +2006,11 @@ dependencies = [ [[package]] name = "futures-util" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" +checksum = "8a894a0acddba51a2d49a6f4263b1e64b8c579ece8af50fa86503d52cd1eea34" dependencies = [ - "futures 0.1.29", + "futures 0.1.30", "futures-channel", "futures-core", "futures-io", @@ -1903,7 +2018,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project", + "pin-project 0.4.27", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -1929,9 +2044,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce54d63f8b0c75023ed920d46fd71d0cbbb830b0ee012726b5b4f506fb6dea5b" dependencies = [ "bytes 0.5.6", - "futures 0.3.5", + "futures 0.3.6", "memchr", - "pin-project", + "pin-project 0.4.27", ] [[package]] @@ -1951,9 +2066,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.2" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac746a5f3bbfdadd6106868134545e684693d54d9d44f6e9588a7d54af0bf980" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" dependencies = [ "typenum", "version_check", @@ -1983,16 +2098,27 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", - "wasi", + "wasi 0.9.0+wasi-snapshot-preview1", "wasm-bindgen", ] +[[package]] +name = "getrandom" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee8025cf36f917e6a52cce185b7c7177689b838b7ec138364e50cc2277a56cf4" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + [[package]] name = "ghash" version = "0.3.0" @@ -2027,9 +2153,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "globset" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ad1da430bd7281dde2576f44c84cc3f0f7b475e7202cd503042dff01a8c8120" +checksum = "c152169ef1e421390738366d2f796655fec62621dabbd0fd476f905934061e4a" dependencies = [ "aho-corasick", "bstr", @@ -2060,7 +2186,7 @@ dependencies = [ "byteorder 1.3.4", "bytes 0.4.12", "fnv", - "futures 0.1.29", + "futures 0.1.30", "http 0.1.21", "indexmap", "log 0.4.11", @@ -2071,9 +2197,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79b7246d7e4b979c03fa093da39cfb3617a96bbeee6310af63991668d7e843ff" +checksum = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53" dependencies = [ "bytes 0.5.6", "fnv", @@ -2082,10 +2208,10 @@ dependencies = [ "futures-util", "http 0.2.1", "indexmap", - "log 0.4.11", "slab", - "tokio 0.2.21", + "tokio 0.2.22", "tokio-util", + "tracing", ] [[package]] @@ -2119,20 +2245,26 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" dependencies = [ - "ahash 0.2.18", + "ahash 0.2.19", "autocfg 0.1.7", ] [[package]] name = "hashbrown" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab9b7860757ce258c89fd48d28b68c41713e597a7b09e793f6c6a6e2ea37c827" +checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25" dependencies = [ "ahash 0.3.8", - "autocfg 1.0.0", + "autocfg 1.0.1", ] +[[package]] +name = "hashbrown" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" + [[package]] name = "heck" version = "0.3.1" @@ -2144,9 +2276,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.15" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" +checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" dependencies = [ "libc", ] @@ -2238,7 +2370,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "http 0.1.21", "tokio-buf", ] @@ -2259,6 +2391,12 @@ version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +[[package]] +name = "httpdate" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" + [[package]] name = "humantime" version = "1.3.0" @@ -2275,7 +2413,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "futures-cpupool", "h2 0.1.26", "http 0.1.21", @@ -2300,25 +2438,25 @@ dependencies = [ [[package]] name = "hyper" -version = "0.13.6" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6e7655b9594024ad0ee439f3b5a7299369dc2a3f459b47c696f9ff676f9aa1f" +checksum = "2f3afcfae8af5ad0576a31e768415edb627824129e8e5a29b8bfccb2f234e835" dependencies = [ "bytes 0.5.6", "futures-channel", "futures-core", "futures-util", - "h2 0.2.5", + "h2 0.2.6", "http 0.2.1", "http-body 0.3.1", "httparse", + "httpdate", "itoa", - "log 0.4.11", - "pin-project", + "pin-project 0.4.27", "socket2", - "time", - "tokio 0.2.21", + "tokio 0.2.22", "tower-service", + "tracing", "want 0.3.0", ] @@ -2331,11 +2469,11 @@ dependencies = [ "bytes 0.5.6", "ct-logs", "futures-util", - "hyper 0.13.6", + "hyper 0.13.8", "log 0.4.11", "rustls", "rustls-native-certs", - "tokio 0.2.21", + "tokio 0.2.22", "tokio-rustls", "webpki", ] @@ -2386,32 +2524,45 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef5550a42e3740a0e71f909d4c861056a284060af885ae7aa6242820f920d9d" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] +[[package]] +name = "indenter" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0bd112d44d9d870a6819eb505d04dd92b5e4d94bb8c304924a0872ae7016fb5" + [[package]] name = "indexmap" -version = "1.4.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c398b2b113b55809ceb9ee3e753fcbac793f1956663f3c36549c1346015c2afe" +checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", + "hashbrown 0.9.1", "serde", ] [[package]] name = "instant" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b141fdc7836c525d4d594027d318c84161ca17aaf8113ab1f81ab93ae897485" +checksum = "63312a18f7ea8760cdd0a7c5aac1a619752a246b833545e3e36d1f81f7cd9e66" +dependencies = [ + "cfg-if 0.1.10", +] [[package]] name = "integer-sqrt" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f65877bf7d44897a473350b1046277941cee20b263397e90869c50b6e766088b" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits 0.2.12", +] [[package]] name = "intervalier" @@ -2419,7 +2570,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64fa110ec7b8f493f416eed552740d10e7030ad5f63b2308f82c9608ec2df275" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "futures-timer 2.0.2", ] @@ -2500,21 +2651,21 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.41" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4b9172132a62451e56142bff9afc91c8e4a4500aa5b847da36815b63bfda916" +checksum = "ca059e81d9486668f12d455a4ea6daa600bd408134cd17e3d3fb5a32d1f016f8" dependencies = [ "wasm-bindgen", ] [[package]] name = "jsonrpc-client-transports" -version = "15.0.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f7b1cdf66312002e15682a24430728bd13036c641163c016bc53fb686a7c2d" +checksum = "489b9c612e60c766f751ab40fcb43cbb55a1e10bb44a9b4307ed510ca598cbd7" dependencies = [ "failure", - "futures 0.1.29", + "futures 0.1.30", "jsonrpc-core", "jsonrpc-pubsub", "log 0.4.11", @@ -2525,11 +2676,11 @@ dependencies = [ [[package]] name = "jsonrpc-core" -version = "15.0.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b12567a31d48588a65b6cf870081e6ba1d7b2ae353977cb9820d512e69c70" +checksum = "0745a6379e3edc893c84ec203589790774e4247420033e71a76d3ab4687991fa" dependencies = [ - "futures 0.1.29", + "futures 0.1.30", "log 0.4.11", "serde", "serde_derive", @@ -2538,30 +2689,30 @@ dependencies = [ [[package]] name = "jsonrpc-core-client" -version = "15.0.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d175ca0cf77439b5495612bf216c650807d252d665b4b70ab2eebd895a88fac1" +checksum = "6f764902d7b891344a0acb65625f32f6f7c6db006952143bd650209fbe7d94db" dependencies = [ "jsonrpc-client-transports", ] [[package]] name = "jsonrpc-derive" -version = "15.0.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2cc6ea7f785232d9ca8786a44e9fa698f92149dcdc1acc4aa1fc69c4993d79e" +checksum = "99a847f9ec7bb52149b2786a17c9cb260d6effc6b8eeb8c16b343a487a7563a3" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] name = "jsonrpc-http-server" -version = "15.0.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9996b26c0c7a59626d0ed6c5ec8bf06218e62ce1474bd2849f9b9fd38a0158c0" +checksum = "4fb5c4513b7b542f42da107942b7b759f27120b5cc894729f88254b28dff44b7" dependencies = [ "hyper 0.12.35", "jsonrpc-core", @@ -2574,9 +2725,9 @@ dependencies = [ [[package]] name = "jsonrpc-ipc-server" -version = "15.0.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e8f2278fb2b277175b6e21b23e7ecf30e78daff5ee301d0a2a411d9a821a0a" +checksum = "cf50e53e4eea8f421a7316c5f63e395f7bc7c4e786a6dc54d76fab6ff7aa7ce7" dependencies = [ "jsonrpc-core", "jsonrpc-server-utils", @@ -2588,9 +2739,9 @@ dependencies = [ [[package]] name = "jsonrpc-pubsub" -version = "15.0.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f389c5cd1f3db258a99296892c21047e21ae73ff4c0e2d39650ea86fe994b4c7" +checksum = "639558e0604013be9787ae52f798506ae42bf4220fe587bdc5625871cc8b9c77" dependencies = [ "jsonrpc-core", "log 0.4.11", @@ -2601,9 +2752,9 @@ dependencies = [ [[package]] name = "jsonrpc-server-utils" -version = "15.0.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c623e1895d0d9110cb0ea7736cfff13191ff52335ad33b21bd5c775ea98b27af" +checksum = "72f1f3990650c033bd8f6bd46deac76d990f9bbfb5f8dc8c4767bf0a00392176" dependencies = [ "bytes 0.4.12", "globset", @@ -2617,9 +2768,9 @@ dependencies = [ [[package]] name = "jsonrpc-ws-server" -version = "15.0.0" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436a92034d0137ab3e3c64a7a6350b428f31cb4d7d1a89f284bcdbcd98a7bc56" +checksum = "6596fe75209b73a2a75ebe1dce4e60e03b88a2b25e8807b667597f6315150d22" dependencies = [ "jsonrpc-core", "jsonrpc-server-utils", @@ -2773,7 +2924,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2701a1369d6ea4f1b9f606db46e5e2a4a8e47f22530a07823d653f85ab1f6c34" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "js-sys", "kvdb", "kvdb-memorydb", @@ -2792,9 +2943,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lazycell" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "leb128" @@ -2832,7 +2983,7 @@ checksum = "571f5a4604c1a40d75651da141dfde29ad15329f537a779528803297d2220274" dependencies = [ "atomic", "bytes 0.5.6", - "futures 0.3.5", + "futures 0.3.6", "lazy_static", "libp2p-core", "libp2p-core-derive", @@ -2858,7 +3009,7 @@ dependencies = [ "multihash", "parity-multiaddr", "parking_lot 0.10.2", - "pin-project", + "pin-project 0.4.27", "smallvec 1.4.2", "wasm-timer", ] @@ -2874,7 +3025,7 @@ dependencies = [ "ed25519-dalek", "either", "fnv", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "lazy_static", "libsecp256k1", @@ -2883,7 +3034,7 @@ dependencies = [ "multistream-select", "parity-multiaddr", "parking_lot 0.10.2", - "pin-project", + "pin-project 0.4.27", "prost", "prost-build", "rand 0.7.3", @@ -2904,7 +3055,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f753d9324cd3ec14bf04b8a8cd0d269c87f294153d6bf2a84497a63a5ad22213" dependencies = [ "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -2914,7 +3065,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74029ae187f35f4b8ddf26b9779a68b340045d708528a103917cdca49a296db5" dependencies = [ "flate2", - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", ] @@ -2924,7 +3075,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cf319822e08dd65c8e060d2354e9f952895bbc433f5706c75ed010c152aee5e" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", "log 0.4.11", ] @@ -2937,7 +3088,7 @@ checksum = "d8a9acb43a3e4a4e413e0c4abe0fa49308df7c6335c88534757b647199cb8a51" dependencies = [ "cuckoofilter", "fnv", - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", "libp2p-swarm", "prost", @@ -2956,7 +3107,7 @@ dependencies = [ "byteorder 1.3.4", "bytes 0.5.6", "fnv", - "futures 0.3.5", + "futures 0.3.6", "futures_codec", "hex_fmt", "libp2p-core", @@ -2978,7 +3129,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56396ee63aa9164eacf40c2c5d2bda8c4133c2f57e1b0425d51d3a4e362583b1" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", "libp2p-swarm", "log 0.4.11", @@ -2998,7 +3149,7 @@ dependencies = [ "bytes 0.5.6", "either", "fnv", - "futures 0.3.5", + "futures 0.3.6", "futures_codec", "libp2p-core", "libp2p-swarm", @@ -3025,7 +3176,7 @@ dependencies = [ "data-encoding", "dns-parser", "either", - "futures 0.3.5", + "futures 0.3.6", "lazy_static", "libp2p-core", "libp2p-swarm", @@ -3045,7 +3196,7 @@ checksum = "8a73a799cc8410b36e40b8f4c4b6babbcb9efd3727111bf517876e4acfa612d3" dependencies = [ "bytes 0.5.6", "fnv", - "futures 0.3.5", + "futures 0.3.6", "futures_codec", "libp2p-core", "log 0.4.11", @@ -3060,8 +3211,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ef6c490042f549fb1025f2892dfe6083d97a77558f450c1feebe748ca9eb15a" dependencies = [ "bytes 0.5.6", - "curve25519-dalek", - "futures 0.3.5", + "curve25519-dalek 2.1.0", + "futures 0.3.6", "lazy_static", "libp2p-core", "log 0.4.11", @@ -3071,7 +3222,7 @@ dependencies = [ "sha2 0.8.2", "snow", "static_assertions", - "x25519-dalek", + "x25519-dalek 0.6.0", "zeroize", ] @@ -3081,7 +3232,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad063c21dfcea4518ac9e8bd4119d33a5b26c41e674f602f41f05617a368a5c8" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", "libp2p-swarm", "log 0.4.11", @@ -3097,7 +3248,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "903a12e99c72dbebefea258de887982adeacc7025baa1ceb10b7fa9928f54791" dependencies = [ "bytes 0.5.6", - "futures 0.3.5", + "futures 0.3.6", "futures_codec", "libp2p-core", "log 0.4.11", @@ -3110,13 +3261,13 @@ dependencies = [ [[package]] name = "libp2p-pnet" -version = "0.19.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d0db10e139d22d7af0b23ed7949449ec86262798aa0fd01595abdbcb02dc87" +checksum = "96b3c2d5d26a9500e959a0e19743897239a6c4be78dadf99b70414301a70c006" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "log 0.4.11", - "pin-project", + "pin-project 0.4.27", "rand 0.7.3", "salsa20", "sha3", @@ -3130,7 +3281,7 @@ checksum = "9c0c9e8a4cd69d97e9646c54313d007512f411aba8c5226cfcda16df6a6e84a3" dependencies = [ "async-trait", "bytes 0.5.6", - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", "libp2p-swarm", "log 0.4.11", @@ -3149,7 +3300,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7193e444210132237b81b755ec7fe53f1c4bd2f53cf719729b94c0c72eb6eaa1" dependencies = [ "either", - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", "log 0.4.11", "rand 0.7.3", @@ -3165,7 +3316,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44f42ec130d7a37a7e47bf4398026b7ad9185c08ed26972e2720f8b94112796f" dependencies = [ "async-std", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "get_if_addrs", "ipnet", @@ -3181,7 +3332,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dea7acb0a034f70d7db94c300eba3f65c0f6298820105624088a9609c9974d77" dependencies = [ "async-std", - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", "log 0.4.11", ] @@ -3192,7 +3343,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34c1faac6f92c21fbe155417957863ea822fba9e9fd5eb24c0912336a100e63f" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -3208,7 +3359,7 @@ checksum = "d650534ebd99f48f6fa292ed5db10d30df2444943afde4407ceeddab8e513fca" dependencies = [ "async-tls", "either", - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", "log 0.4.11", "quicksink", @@ -3226,7 +3377,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "781d9b9f043dcdabc40640807125368596b849fd4d96cdca2dcf052fdf6f33fd" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "libp2p-core", "parking_lot 0.11.0", "thiserror", @@ -3257,18 +3408,17 @@ dependencies = [ "hmac-drbg", "rand 0.7.3", "sha2 0.8.2", - "subtle 2.2.3", + "subtle 2.3.0", "typenum", ] [[package]] name = "libz-sys" -version = "1.0.25" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" +checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" dependencies = [ "cc", - "libc", "pkg-config", "vcpkg", ] @@ -3281,9 +3431,9 @@ checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" [[package]] name = "linked_hash_set" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7c91c4c7bbeb4f2f7c4e5be11e6a05bd6830bc37249c47ce1ad86ad453ff9c" +checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" dependencies = [ "linked-hash-map", ] @@ -3341,7 +3491,7 @@ version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", ] [[package]] @@ -3359,7 +3509,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "111b945ac72ec09eb7bc62a0fbdc3cc6e80555a7245f52a69d3921a75b53b153" dependencies = [ - "hashbrown 0.8.0", + "hashbrown 0.8.2", ] [[package]] @@ -3431,21 +3581,21 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c198b026e1bbf08a937e94c6c60f9ec4a2267f5b0d2eec9c1b21b061ce2be55f" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", ] [[package]] name = "memory-db" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0777fbb396f666701d939e9b3876c18ada6b3581257d88631f2590bc366d8ebe" +checksum = "36f36ddb0b2cdc25d38babba472108798e3477f02be5165f038c5e393e50c57a" dependencies = [ "hash-db", - "hashbrown 0.8.0", + "hashbrown 0.8.2", "parity-util-mem", ] @@ -3491,18 +3641,19 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c214bf3d90099b52f3e4b328ae0fe34837fd0fab683ad1e10fceb4629106df48" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] name = "miniz_oxide" -version = "0.4.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be0f75932c1f6cfae3c04000e40114adf955636e19040f9c0a2c380702aa1c7f" +checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" dependencies = [ "adler", + "autocfg 1.0.1", ] [[package]] @@ -3511,7 +3662,7 @@ version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "fuchsia-zircon", "fuchsia-zircon-sys", "iovec", @@ -3589,37 +3740,37 @@ checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" [[package]] name = "multihash" -version = "0.11.2" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f75db05d738947aa5389863aadafbcf2e509d7ba099dc2ddcdf4fc66bf7a9e03" +checksum = "567122ab6492f49b59def14ecc36e13e64dca4188196dd0cd41f9f3f979f3df6" dependencies = [ "blake2b_simd", "blake2s_simd", - "digest 0.8.1", - "sha-1", - "sha2 0.8.2", + "digest 0.9.0", + "sha-1 0.9.1", + "sha2 0.9.1", "sha3", - "unsigned-varint 0.3.3", + "unsigned-varint 0.5.1", ] [[package]] name = "multimap" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8883adfde9756c1d30b0f519c9b8c502a94b41ac62f696453c37c7fc0a958ce" +checksum = "1255076139a83bb467426e7f8d0134968a8118844faa755985e077cf31850333" [[package]] name = "multistream-select" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9157e87afbc2ef0d84cc0345423d715f445edde00141c93721c162de35a05e5" +checksum = "36a6aa6e32fbaf16795142335967214b8564a7a4661eb6dc846ef343a6e00ac1" dependencies = [ "bytes 0.5.6", - "futures 0.3.5", + "futures 0.3.6", "log 0.4.11", - "pin-project", + "pin-project 1.0.1", "smallvec 1.4.2", - "unsigned-varint 0.4.0", + "unsigned-varint 0.5.1", ] [[package]] @@ -3659,13 +3810,23 @@ dependencies = [ "rand 0.3.23", ] +[[package]] +name = "nb-connect" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8123a81538e457d44b933a02faf885d3fe8408806b23fa700e8f01c6c3a98998" +dependencies = [ + "libc", + "winapi 0.3.9", +] + [[package]] name = "net2" -version = "0.2.34" +version = "0.2.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" +checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", "winapi 0.3.9", ] @@ -3678,7 +3839,7 @@ checksum = "b7fd5681d13fda646462cfbd4e5f2051279a89a544d50eb98c365b507246839f" dependencies = [ "bitflags", "bytes 0.4.12", - "cfg-if", + "cfg-if 0.1.10", "gcc", "libc", "void", @@ -3692,7 +3853,7 @@ checksum = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363" dependencies = [ "bitflags", "cc", - "cfg-if", + "cfg-if 0.1.10", "libc", "void", ] @@ -3725,7 +3886,7 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", "num-integer", "num-traits 0.2.12", ] @@ -3736,7 +3897,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", "num-traits 0.2.12", ] @@ -3746,7 +3907,7 @@ version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", "num-traits 0.2.12", ] @@ -3756,7 +3917,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", "num-bigint", "num-integer", "num-traits 0.2.12", @@ -3777,7 +3938,7 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.0.1", "libm", ] @@ -3808,6 +3969,12 @@ dependencies = [ "wasmparser 0.57.0", ] +[[package]] +name = "object" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37fd5004feb2ce328a52b0b3d01dbf4ffff72583493900ed15f22d4111c51693" + [[package]] name = "once_cell" version = "0.1.8" @@ -3853,10 +4020,16 @@ dependencies = [ "stable_deref_trait", ] +[[package]] +name = "owo-colors" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a1250cdd103eef6bd542b5ae82989f931fc00a41a27f60377338241594410f3" + [[package]] name = "pallet-authority-discovery" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-support", "frame-system", @@ -3872,7 +4045,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-support", "frame-system", @@ -3887,7 +4060,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -3912,7 +4085,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -3926,7 +4099,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -3942,7 +4115,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -3957,7 +4130,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -3972,7 +4145,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -3993,7 +4166,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "enumflags2", "frame-benchmarking", @@ -4009,7 +4182,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -4029,7 +4202,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -4046,7 +4219,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-support", "frame-system", @@ -4060,7 +4233,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -4076,7 +4249,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-support", "frame-system", @@ -4090,7 +4263,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-support", "frame-system", @@ -4105,7 +4278,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -4126,7 +4299,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -4142,7 +4315,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-support", "frame-system", @@ -4155,7 +4328,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "enumflags2", "frame-support", @@ -4170,7 +4343,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -4185,7 +4358,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-support", "frame-system", @@ -4205,7 +4378,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -4221,7 +4394,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-support", "frame-system", @@ -4235,7 +4408,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -4257,18 +4430,18 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] name = "pallet-sudo" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-support", "frame-system", @@ -4282,7 +4455,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -4300,7 +4473,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-support", "frame-system", @@ -4317,7 +4490,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4335,7 +4508,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-support", "parity-scale-codec", @@ -4348,7 +4521,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -4363,7 +4536,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-benchmarking", "frame-support", @@ -4379,7 +4552,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "enumflags2", "frame-benchmarking", @@ -4407,9 +4580,9 @@ dependencies = [ [[package]] name = "parity-multiaddr" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2165a93382a93de55868dcbfa11e4a8f99676a9164eee6a2b4a9479ad319c257" +checksum = "4c7ad66970bbab360c97179b60906e2dc4aef1f7fca8ab4e5c5db8c97b16814a" dependencies = [ "arrayref", "bs58", @@ -4419,7 +4592,7 @@ dependencies = [ "percent-encoding 2.1.0", "serde", "static_assertions", - "unsigned-varint 0.4.0", + "unsigned-varint 0.5.1", "url 2.1.1", ] @@ -4443,9 +4616,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "198db82bb1c18fc00176004462dd809b2a6d851669550aa17af6dacd21ae0c14" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -4461,7 +4634,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e57fea504fea33f9fbb5f49f378359030e7e026a6ab849bb9e8f0787376f1bf" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "libc", "log 0.4.11", "mio-named-pipes", @@ -4479,8 +4652,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "297ff91fa36aec49ce183484b102f6b75b46776822bd81525bfc4cc9b0dd0f5c" dependencies = [ - "cfg-if", - "hashbrown 0.8.0", + "cfg-if 0.1.10", + "hashbrown 0.8.2", "impl-trait-for-tuples", "jemallocator", "parity-util-mem-derive", @@ -4496,8 +4669,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" dependencies = [ - "proc-macro2 1.0.18", - "syn 1.0.33", + "proc-macro2 1.0.24", + "syn 1.0.46", "synstructure", ] @@ -4520,16 +4693,16 @@ dependencies = [ "mio", "mio-extras", "rand 0.7.3", - "sha-1", + "sha-1 0.8.2", "slab", "url 2.1.1", ] [[package]] name = "parking" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d4a6da31f8144a32532fe38fe8fb439a6842e0ec633f0037f0144c14e7f907" +checksum = "6cb300f271742d4a2a66c01b6b2fa0c83dfebd2e0bf11addb879a3547b4ed87c" [[package]] name = "parking" @@ -4598,7 +4771,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "cloudabi 0.0.3", "libc", "redox_syscall", @@ -4613,7 +4786,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "cloudabi 0.0.3", "libc", "redox_syscall", @@ -4627,7 +4800,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "cloudabi 0.1.0", "instant", "libc", @@ -4702,29 +4875,49 @@ dependencies = [ [[package]] name = "pin-project" -version = "0.4.23" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffbc8e94b38ea3d2d8ba92aea2983b503cd75d0888d75b86bb37970b5698e15" +dependencies = [ + "pin-project-internal 0.4.27", +] + +[[package]] +name = "pin-project" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee41d838744f60d959d7074e3afb6b35c7456d0f61cad38a24e35e6553f73841" +dependencies = [ + "pin-project-internal 1.0.1", +] + +[[package]] +name = "pin-project-internal" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa" +checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895" dependencies = [ - "pin-project-internal", + "proc-macro2 1.0.24", + "quote 1.0.7", + "syn 1.0.46", ] [[package]] name = "pin-project-internal" -version = "0.4.23" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f" +checksum = "81a4ffa594b66bff340084d4081df649a7dc049ac8d7fc458d8e628bfbbb2f86" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] name = "pin-project-lite" -version = "0.1.7" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715" +checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b" [[package]] name = "pin-utils" @@ -4734,9 +4927,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.17" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" +checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "platforms" @@ -4749,7 +4942,7 @@ name = "polkadot" version = "0.8.25" dependencies = [ "assert_cmd", - "futures 0.3.5", + "futures 0.3.6", "nix 0.17.0", "parity-util-mem", "polkadot-cli", @@ -4764,7 +4957,7 @@ dependencies = [ "assert_matches", "bitvec", "env_logger", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log 0.4.11", "maplit", @@ -4795,7 +4988,7 @@ dependencies = [ "bitvec", "derive_more 0.99.11", "env_logger", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", @@ -4814,6 +5007,7 @@ dependencies = [ "sp-keyring", "sp-keystore", "streamunordered", + "thiserror", ] [[package]] @@ -4821,7 +5015,7 @@ name = "polkadot-cli" version = "0.8.25" dependencies = [ "frame-benchmarking-cli", - "futures 0.3.5", + "futures 0.3.6", "log 0.4.11", "polkadot-service", "sc-cli", @@ -4837,7 +5031,7 @@ dependencies = [ "structopt", "substrate-browser-utils", "substrate-build-script-utils", - "tokio 0.2.21", + "tokio 0.2.22", "wasm-bindgen", "wasm-bindgen-futures", ] @@ -4849,7 +5043,7 @@ dependencies = [ "assert_matches", "derive_more 0.99.11", "env_logger", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", @@ -4893,7 +5087,7 @@ version = "0.1.0" dependencies = [ "assert_matches", "async-trait", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", @@ -4915,7 +5109,7 @@ name = "polkadot-node-collation-generation" version = "0.1.0" dependencies = [ "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "log 0.4.11", "polkadot-erasure-coding", "polkadot-node-primitives", @@ -4932,7 +5126,7 @@ version = "0.1.0" dependencies = [ "assert_matches", "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "kvdb", "kvdb-memorydb", "kvdb-rocksdb", @@ -4945,6 +5139,7 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "sp-core", + "thiserror", ] [[package]] @@ -4954,7 +5149,7 @@ dependencies = [ "assert_matches", "bitvec", "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "log 0.4.11", "polkadot-erasure-coding", "polkadot-node-primitives", @@ -4971,6 +5166,7 @@ dependencies = [ "sp-core", "sp-keyring", "sp-keystore", + "thiserror", ] [[package]] @@ -4979,12 +5175,13 @@ version = "0.1.0" dependencies = [ "bitvec", "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "log 0.4.11", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", "sp-keystore", + "thiserror", "wasm-timer", ] @@ -4993,7 +5190,7 @@ name = "polkadot-node-core-candidate-selection" version = "0.1.0" dependencies = [ "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "log 0.4.11", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -5008,7 +5205,7 @@ version = "0.1.0" dependencies = [ "assert_matches", "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "log 0.4.11", "parity-scale-codec", "polkadot-node-primitives", @@ -5026,7 +5223,7 @@ dependencies = [ name = "polkadot-node-core-chain-api" version = "0.1.0" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "maplit", "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", @@ -5040,7 +5237,7 @@ dependencies = [ name = "polkadot-node-core-proposer" version = "0.1.0" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", @@ -5068,7 +5265,7 @@ version = "0.1.0" dependencies = [ "bitvec", "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "lazy_static", "log 0.4.11", @@ -5086,7 +5283,7 @@ dependencies = [ name = "polkadot-node-core-runtime-api" version = "0.1.0" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", @@ -5113,7 +5310,7 @@ dependencies = [ name = "polkadot-node-primitives" version = "0.1.0" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "parity-scale-codec", "polkadot-primitives", "polkadot-statement-table", @@ -5128,12 +5325,12 @@ dependencies = [ "assert_matches", "async-trait", "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", "parking_lot 0.10.2", - "pin-project", + "pin-project 0.4.27", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem-test-helpers", @@ -5151,12 +5348,12 @@ version = "0.1.0" dependencies = [ "async-trait", "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", "parking_lot 0.10.2", - "pin-project", + "pin-project 0.4.27", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -5176,12 +5373,12 @@ dependencies = [ "async-trait", "derive_more 0.99.11", "env_logger", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", "parking_lot 0.10.2", - "pin-project", + "pin-project 0.4.27", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", @@ -5194,6 +5391,7 @@ dependencies = [ "sp-keystore", "streamunordered", "substrate-prometheus-endpoint", + "thiserror", ] [[package]] @@ -5201,8 +5399,10 @@ name = "polkadot-overseer" version = "0.1.0" dependencies = [ "async-trait", + "color-eyre", + "eyre", "femme", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "kv-log-macro", "log 0.4.11", @@ -5221,7 +5421,7 @@ name = "polkadot-parachain" version = "0.8.25" dependencies = [ "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "log 0.4.11", "parity-scale-codec", "parking_lot 0.10.2", @@ -5242,7 +5442,7 @@ name = "polkadot-pov-distribution" version = "0.1.0" dependencies = [ "assert_matches", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", @@ -5439,7 +5639,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "futures 0.3.5", + "futures 0.3.6", "hex-literal 0.2.1", "libsecp256k1", "log 0.3.9", @@ -5486,7 +5686,7 @@ dependencies = [ "env_logger", "frame-benchmarking", "frame-system-rpc-runtime-api", - "futures 0.3.5", + "futures 0.3.6", "hex-literal 0.2.1", "kusama-runtime", "lazy_static", @@ -5548,7 +5748,7 @@ version = "0.1.0" dependencies = [ "arrayvec 0.5.1", "assert_matches", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "indexmap", "log 0.4.11", @@ -5642,7 +5842,7 @@ dependencies = [ name = "polkadot-test-runtime-client" version = "2.0.0" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "pallet-timestamp", "parity-scale-codec", "polkadot-primitives", @@ -5667,8 +5867,8 @@ version = "0.8.2" dependencies = [ "frame-benchmarking", "frame-system", - "futures 0.1.29", - "futures 0.3.5", + "futures 0.1.30", + "futures 0.3.6", "hex", "log 0.4.11", "pallet-balances", @@ -5708,7 +5908,7 @@ dependencies = [ "substrate-test-client", "substrate-test-utils", "tempfile", - "tokio 0.2.21", + "tokio 0.2.22", ] [[package]] @@ -5716,7 +5916,7 @@ name = "polkadot-validation" version = "0.8.25" dependencies = [ "derive_more 0.14.1", - "futures 0.3.5", + "futures 0.3.6", "log 0.4.11", "parity-scale-codec", "polkadot-parachain", @@ -5739,13 +5939,26 @@ dependencies = [ "substrate-prometheus-endpoint", ] +[[package]] +name = "polling" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fffa183f6bd5f1a8a3e1f60ce2f8d5621e350eed84a62d6daaa5b9d1aaf6fbd" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "log 0.4.11", + "wepoll-sys-stjepang", + "winapi 0.3.9", +] + [[package]] name = "polling" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0720e0b9ea9d52451cf29d3413ba8a9303f8815d9d9653ef70e03ff73e65566" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", "log 0.4.11", "wepoll-sys-stjepang", @@ -5754,34 +5967,34 @@ dependencies = [ [[package]] name = "poly1305" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b42192ab143ed7619bf888a7f9c6733a9a2153b218e2cd557cfdb52fbf9bb1" +checksum = "22ce46de8e53ee414ca4d02bfefac75d8c12fba948b76622a40b4be34dfce980" dependencies = [ "universal-hash", ] [[package]] name = "polyval" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9a50142b55ab3ed0e9f68dfb3709f1d90d29da24e91033f28b96330643107dc" +checksum = "a5884790f1ce3553ad55fec37b5aaac5882e0e845a2612df744d6c85c9bf046c" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "universal-hash", ] [[package]] name = "ppv-lite86" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" +checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" [[package]] name = "predicates" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "347a1b6f0b21e636bc9872fb60b83b8e185f6f5516298b8238699f7f9a531030" +checksum = "96bfead12e90dccead362d62bb2c90a5f6fc4584963645bc7f71a735e0b0735a" dependencies = [ "difference", "predicates-core", @@ -5827,44 +6040,42 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10d4b51f154c8a7fb96fd6dad097cb74b863943ec010ac94b9fd1be8861fe1e" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" dependencies = [ "toml", ] [[package]] name = "proc-macro-error" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc175e9777c3116627248584e8f8b3e2987405cabe1c0adf7d1dd28f09dc7880" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", "version_check", ] [[package]] name = "proc-macro-error-attr" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cc9795ca17eb581285ec44936da7fc2335a3f34f2ddd13118b6f4d515435c50" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", - "syn-mid", "version_check", ] [[package]] name = "proc-macro-hack" -version = "0.5.16" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e0456befd48169b9f13ef0f0ad46d492cf9d2dbb918bcf38e01eed4ce3ec5e4" +checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598" [[package]] name = "proc-macro-nested" @@ -5883,9 +6094,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.18" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" dependencies = [ "unicode-xid 0.2.1", ] @@ -5896,7 +6107,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30d70cf4412832bcac9cffe27906f4a66e450d323525e977168c70d1b36120ae" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "fnv", "lazy_static", "parking_lot 0.11.0", @@ -5940,9 +6151,9 @@ checksum = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72" dependencies = [ "anyhow", "itertools 0.8.2", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -5998,7 +6209,7 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", ] [[package]] @@ -6068,7 +6279,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom", + "getrandom 0.1.15", "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", @@ -6117,7 +6328,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom", + "getrandom 0.1.15", ] [[package]] @@ -6220,25 +6431,25 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.3.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f02856753d04e03e26929f820d0a0a337ebe71f849801eea335d464b349080" +checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" dependencies = [ - "autocfg 1.0.0", - "crossbeam-deque", + "autocfg 1.0.1", + "crossbeam-deque 0.8.0", "either", "rayon-core", ] [[package]] name = "rayon-core" -version = "1.7.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e92e15d89083484e11353891f1af602cc661426deb9564c298b270c726973280" +checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" dependencies = [ - "crossbeam-deque", - "crossbeam-queue", - "crossbeam-utils", + "crossbeam-channel", + "crossbeam-deque 0.8.0", + "crossbeam-utils 0.8.0", "lazy_static", "num_cpus", ] @@ -6254,17 +6465,17 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "redox_users" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" +checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" dependencies = [ - "getrandom", + "getrandom 0.1.15", "redox_syscall", "rust-argon2", ] @@ -6293,9 +6504,9 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d21b475ab879ef0e315ad99067fa25778c3b0377f57f1b00207448dac1a3144" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -6311,9 +6522,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.3.9" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" +checksum = "8963b85b8ce3074fecffde43b4b0dded83ce2f367dc8d363afc56679f3ee820b" dependencies = [ "aho-corasick", "memchr", @@ -6333,9 +6544,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" +checksum = "8cab7a364d15cde1e505267766a2d3c4e22a843e1a601f0fa7564c0f82ced11c" [[package]] name = "region" @@ -6448,21 +6659,21 @@ dependencies = [ [[package]] name = "rust-argon2" -version = "0.7.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" +checksum = "9dab61250775933275e84053ac235621dfb739556d5c54a2f2e9313b7cf43a19" dependencies = [ - "base64 0.11.0", + "base64 0.12.3", "blake2b_simd", "constant_time_eq", - "crossbeam-utils", + "crossbeam-utils 0.7.2", ] [[package]] name = "rustc-demangle" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" +checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" [[package]] name = "rustc-hash" @@ -6493,9 +6704,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cac94b333ee2aac3284c5b8a1b7fb4dd11cba88c244e3fe33cdbd047af0eb693" +checksum = "5d1126dcf58e93cee7d098dbda643b5f92ed724f1f6a63007c1116eed6700c81" dependencies = [ "base64 0.12.3", "log 0.4.11", @@ -6522,8 +6733,8 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ - "futures 0.3.5", - "pin-project", + "futures 0.3.6", + "pin-project 0.4.27", "static_assertions", ] @@ -6544,33 +6755,23 @@ dependencies = [ [[package]] name = "salsa20" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2324b0e8c3bb9a586a571fdb3136f70e7e2c748de00a78043f86e0cff91f91fe" -dependencies = [ - "byteorder 1.3.4", - "salsa20-core", - "stream-cipher 0.3.2", -] - -[[package]] -name = "salsa20-core" -version = "0.2.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fe6cc1b9f5a5867853ade63099de70f042f7679e408d1ffe52821c9248e6e69" +checksum = "c7f47b10fa80f6969bbbd9c8e7cc998f082979d402a9e10579e2303a87955395" dependencies = [ - "stream-cipher 0.3.2", + "stream-cipher", ] [[package]] name = "sc-authority-discovery" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ + "async-trait", "bytes 0.5.6", "derive_more 0.99.11", "either", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "libp2p", "log 0.4.11", @@ -6594,9 +6795,9 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", @@ -6618,7 +6819,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -6635,7 +6836,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -6656,18 +6857,18 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] name = "sc-cli" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "ansi_term 0.12.1", "atty", @@ -6675,7 +6876,7 @@ dependencies = [ "chrono", "derive_more 0.99.11", "fdlimit", - "futures 0.3.5", + "futures 0.3.6", "hex", "lazy_static", "libp2p", @@ -6712,7 +6913,7 @@ dependencies = [ "structopt", "substrate-prometheus-endpoint", "time", - "tokio 0.2.21", + "tokio 0.2.22", "tracing", "tracing-log", "tracing-subscriber", @@ -6721,22 +6922,22 @@ dependencies = [ [[package]] name = "sc-cli-proc-macro" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] name = "sc-client-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "derive_more 0.99.11", "fnv", - "futures 0.3.5", + "futures 0.3.6", "hash-db", "hex-literal 0.3.1", "kvdb", @@ -6769,7 +6970,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "blake2-rfc", "hash-db", @@ -6799,7 +7000,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "sc-client-api", "sp-blockchain", @@ -6810,11 +7011,11 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "derive_more 0.99.11", "fork-tree", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log 0.4.11", "merlin", @@ -6855,10 +7056,10 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -6879,7 +7080,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "fork-tree", "parity-scale-codec", @@ -6892,9 +7093,9 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", @@ -6915,7 +7116,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "log 0.4.11", "sc-client-api", @@ -6929,7 +7130,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "derive_more 0.99.11", "lazy_static", @@ -6958,7 +7159,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "derive_more 0.99.11", "log 0.4.11", @@ -6975,7 +7176,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "log 0.4.11", "parity-scale-codec", @@ -6990,7 +7191,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "log 0.4.11", "parity-scale-codec", @@ -7008,17 +7209,17 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "derive_more 0.99.11", "finality-grandpa", "fork-tree", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", "parking_lot 0.10.2", - "pin-project", + "pin-project 0.4.27", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -7045,11 +7246,11 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "derive_more 0.99.11", "finality-grandpa", - "futures 0.3.5", + "futures 0.3.6", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -7069,10 +7270,10 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "ansi_term 0.12.1", - "futures 0.3.5", + "futures 0.3.6", "log 0.4.11", "parity-util-mem", "sc-client-api", @@ -7087,11 +7288,11 @@ dependencies = [ [[package]] name = "sc-keystore" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "async-trait", "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "futures-util", "hex", "merlin", @@ -7101,13 +7302,13 @@ dependencies = [ "sp-application-crypto", "sp-core", "sp-keystore", - "subtle 2.2.3", + "subtle 2.3.0", ] [[package]] name = "sc-light" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "hash-db", "lazy_static", @@ -7126,7 +7327,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "async-std", "async-trait", @@ -7138,7 +7339,7 @@ dependencies = [ "erased-serde", "fnv", "fork-tree", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "futures_codec", "hex", @@ -7151,7 +7352,7 @@ dependencies = [ "nohash-hasher", "parity-scale-codec", "parking_lot 0.10.2", - "pin-project", + "pin-project 0.4.27", "prost", "prost-build", "rand 0.7.3", @@ -7180,9 +7381,9 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "libp2p", "log 0.4.11", @@ -7195,13 +7396,13 @@ dependencies = [ [[package]] name = "sc-offchain" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "bytes 0.5.6", "fnv", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", - "hyper 0.13.6", + "hyper 0.13.8", "hyper-rustls", "log 0.4.11", "num_cpus", @@ -7222,9 +7423,9 @@ dependencies = [ [[package]] name = "sc-peerset" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "libp2p", "log 0.4.11", "serde_json", @@ -7235,7 +7436,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "log 0.4.11", "substrate-prometheus-endpoint", @@ -7244,9 +7445,9 @@ dependencies = [ [[package]] name = "sc-rpc" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "hash-db", "jsonrpc-core", "jsonrpc-pubsub", @@ -7277,10 +7478,10 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -7301,9 +7502,9 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ - "futures 0.1.29", + "futures 0.1.30", "jsonrpc-core", "jsonrpc-http-server", "jsonrpc-ipc-server", @@ -7319,13 +7520,13 @@ dependencies = [ [[package]] name = "sc-service" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "derive_more 0.99.11", "directories", "exit-future", - "futures 0.1.29", - "futures 0.3.5", + "futures 0.1.30", + "futures 0.3.6", "futures-timer 3.0.2", "hash-db", "jsonrpc-core", @@ -7335,7 +7536,7 @@ dependencies = [ "parity-scale-codec", "parity-util-mem", "parking_lot 0.10.2", - "pin-project", + "pin-project 0.4.27", "rand 0.7.3", "sc-block-builder", "sc-chain-spec", @@ -7383,7 +7584,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "log 0.4.11", "parity-scale-codec", @@ -7397,7 +7598,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -7416,14 +7617,14 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "libp2p", "log 0.4.11", "parking_lot 0.10.2", - "pin-project", + "pin-project 0.4.27", "rand 0.7.3", "serde", "slog", @@ -7437,7 +7638,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "erased-serde", "log 0.4.11", @@ -7456,10 +7657,10 @@ dependencies = [ [[package]] name = "sc-transaction-graph" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "linked-hash-map", "log 0.4.11", "parity-util-mem", @@ -7477,10 +7678,10 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "futures-diagnose", "intervalier", "log 0.4.11", @@ -7518,13 +7719,13 @@ checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" dependencies = [ "arrayref", "arrayvec 0.5.1", - "curve25519-dalek", - "getrandom", + "curve25519-dalek 2.1.0", + "getrandom 0.1.15", "merlin", "rand 0.7.3", "rand_core 0.5.1", "sha2 0.8.2", - "subtle 2.2.3", + "subtle 2.3.0", "zeroize", ] @@ -7548,22 +7749,22 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "scroll" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb2332cb595d33f7edd5700f4cbf94892e680c7f0ae56adab58a35190b66cb1" +checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec" dependencies = [ "scroll_derive", ] [[package]] name = "scroll_derive" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e367622f934864ffa1c704ba2b82280aab856e3d8213c84c5720257eb34b15b9" +checksum = "6dfde5d1531034db129e95c76ac857e2baecea3443579d493d02224950b0fb6d" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -7623,12 +7824,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -[[package]] -name = "send_wrapper" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0eddf2e8f50ced781f288c19f18621fa72a3779e3cb58dbf23b07469b0abeb4" - [[package]] name = "send_wrapper" version = "0.3.0" @@ -7643,22 +7838,22 @@ checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" [[package]] name = "serde" -version = "1.0.114" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" +checksum = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.114" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" +checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -7684,6 +7879,19 @@ dependencies = [ "opaque-debug 0.2.3", ] +[[package]] +name = "sha-1" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a36ea86c864a3f16dd2687712dd6646f7019f301e57537c7f4dc9f5916770" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 0.1.10", + "cpuid-bool", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + [[package]] name = "sha2" version = "0.8.2" @@ -7703,7 +7911,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2933378ddfeda7ea26f48c555bdad8bb446bf8a3d17832dc83e380d444cfb8c1" dependencies = [ "block-buffer 0.9.0", - "cfg-if", + "cfg-if 0.1.10", "cpuid-bool", "digest 0.9.0", "opaque-debug 0.3.0", @@ -7711,15 +7919,14 @@ dependencies = [ [[package]] name = "sha3" -version = "0.8.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" +checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" dependencies = [ - "block-buffer 0.7.3", - "byte-tools", - "digest 0.8.1", + "block-buffer 0.9.0", + "digest 0.9.0", "keccak", - "opaque-debug 0.2.3", + "opaque-debug 0.3.0", ] [[package]] @@ -7737,7 +7944,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf3ab0cdff84d6c66fc9e268010ea6508e58ee942575afb66f2cf194bb218bb4" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "enum_primitive", "libc", "log 0.4.11", @@ -7769,9 +7976,9 @@ checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" [[package]] name = "signal-hook-registry" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" +checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035" dependencies = [ "arc-swap", "libc", @@ -7779,9 +7986,9 @@ dependencies = [ [[package]] name = "signature" -version = "1.1.0" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65211b7b6fc3f14ff9fc7a2011a434e3e6880585bd2e9e9396315ae24cbf7852" +checksum = "29f060a7d147e33490ec10da418795238fd7545bba241504d6b31a409f2e6210" [[package]] name = "slab" @@ -7828,9 +8035,9 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a945ec7f7ce853e89ffa36be1e27dce9a43e82ff9093bf3461c30d5da74ed11b" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -7877,11 +8084,11 @@ checksum = "67583f4ccc13bbb105a0752058d8ad66c47753d85445952809bcaca891954f83" dependencies = [ "async-channel", "async-executor 0.1.2", - "async-io 0.1.5", - "blocking 0.5.0", - "cfg-if", + "async-io 0.1.11", + "blocking 0.5.2", + "cfg-if 0.1.10", "easy-parallel", - "futures-lite 0.1.10", + "futures-lite 0.1.11", "num_cpus", ] @@ -7891,15 +8098,15 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "024818c1f00b80e8171ddcfcee33860134293aa3aced60c9cbd7a5a2d41db392" dependencies = [ - "pin-project", + "pin-project 0.4.27", "smol 0.1.18", ] [[package]] name = "snow" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32bf8474159a95551661246cda4976e89356999e3cbfef36f493dacc3fae1e8e" +checksum = "795dd7aeeee24468e5a32661f6d27f7b5cbed802031b2d7640c7b10f8fb2dd50" dependencies = [ "aes-gcm", "blake2", @@ -7909,17 +8116,17 @@ dependencies = [ "ring", "rustc_version", "sha2 0.9.1", - "subtle 2.2.3", - "x25519-dalek", + "subtle 2.3.0", + "x25519-dalek 1.1.0", ] [[package]] name = "socket2" -version = "0.3.12" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" +checksum = "b1fa70dc5c8104ec096f4fe7ede7a221d35ae13dcd19ba1ad9a81d2cab9a1c44" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", "redox_syscall", "winapi 0.3.9", @@ -7927,24 +8134,24 @@ dependencies = [ [[package]] name = "soketto" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85457366ae0c6ce56bf05a958aef14cd38513c236568618edbcd9a8c52cb80b0" +checksum = "b5c71ed3d54db0a699f4948e1bb3e45b450fa31fe602621dee6680361d569c88" dependencies = [ "base64 0.12.3", "bytes 0.5.6", "flate2", - "futures 0.3.5", + "futures 0.3.6", "httparse", "log 0.4.11", "rand 0.7.3", - "sha-1", + "sha-1 0.9.1", ] [[package]] name = "sp-allocator" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "derive_more 0.99.11", "log 0.4.11", @@ -7956,7 +8163,7 @@ dependencies = [ [[package]] name = "sp-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "hash-db", "parity-scale-codec", @@ -7971,19 +8178,19 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "blake2-rfc", "proc-macro-crate", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] name = "sp-application-crypto" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "parity-scale-codec", "serde", @@ -7995,7 +8202,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "integer-sqrt", "num-traits 0.2.12", @@ -8008,7 +8215,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "parity-scale-codec", "sp-api", @@ -8020,7 +8227,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "parity-scale-codec", "sp-inherents", @@ -8031,7 +8238,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "parity-scale-codec", "sp-api", @@ -8043,7 +8250,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "derive_more 0.99.11", "log 0.4.11", @@ -8060,7 +8267,7 @@ dependencies = [ [[package]] name = "sp-chain-spec" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "serde", "serde_json", @@ -8069,10 +8276,10 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "futures-timer 3.0.2", "libp2p", "log 0.4.11", @@ -8095,7 +8302,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "merlin", "parity-scale-codec", @@ -8115,7 +8322,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -8124,7 +8331,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -8136,14 +8343,14 @@ dependencies = [ [[package]] name = "sp-core" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "base58", "blake2-rfc", "byteorder 1.3.4", "dyn-clonable", "ed25519-dalek", - "futures 0.3.5", + "futures 0.3.6", "hash-db", "hash256-std-hasher", "hex", @@ -8179,7 +8386,7 @@ dependencies = [ [[package]] name = "sp-database" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "kvdb", "parking_lot 0.10.2", @@ -8188,17 +8395,17 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] name = "sp-externalities" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "environmental", "parity-scale-codec", @@ -8209,7 +8416,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "finality-grandpa", "log 0.4.11", @@ -8226,7 +8433,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "derive_more 0.99.11", "parity-scale-codec", @@ -8238,9 +8445,9 @@ dependencies = [ [[package]] name = "sp-io" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "hash-db", "libsecp256k1", "log 0.4.11", @@ -8262,7 +8469,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "lazy_static", "sp-core", @@ -8273,11 +8480,11 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "async-trait", "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "merlin", "parity-scale-codec", "parking_lot 0.10.2", @@ -8289,7 +8496,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "parity-scale-codec", "serde", @@ -8301,18 +8508,18 @@ dependencies = [ [[package]] name = "sp-npos-elections-compact" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] name = "sp-offchain" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "sp-api", "sp-core", @@ -8322,7 +8529,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "backtrace", "log 0.4.11", @@ -8331,7 +8538,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "serde", "sp-core", @@ -8340,7 +8547,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "either", "hash256-std-hasher", @@ -8362,7 +8569,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "parity-scale-codec", "primitive-types", @@ -8378,19 +8585,19 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "Inflector", "proc-macro-crate", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] name = "sp-serializer" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "serde", "serde_json", @@ -8399,7 +8606,7 @@ dependencies = [ [[package]] name = "sp-session" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "parity-scale-codec", "sp-api", @@ -8412,7 +8619,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -8422,7 +8629,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "hash-db", "log 0.4.11", @@ -8443,12 +8650,12 @@ dependencies = [ [[package]] name = "sp-std" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" [[package]] name = "sp-storage" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8461,7 +8668,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "log 0.4.11", "sp-core", @@ -8474,7 +8681,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -8488,7 +8695,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "log 0.4.11", "parity-scale-codec", @@ -8501,10 +8708,10 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "derive_more 0.99.11", - "futures 0.3.5", + "futures 0.3.6", "log 0.4.11", "parity-scale-codec", "serde", @@ -8516,7 +8723,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "hash-db", "memory-db", @@ -8530,9 +8737,9 @@ dependencies = [ [[package]] name = "sp-utils" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "futures-core", "futures-timer 3.0.2", "lazy_static", @@ -8542,7 +8749,7 @@ dependencies = [ [[package]] name = "sp-version" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8554,7 +8761,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -8570,9 +8777,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "stable_deref_trait" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "static_assertions" @@ -8591,20 +8798,12 @@ dependencies = [ [[package]] name = "stream-cipher" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8131256a5896cabcf5eb04f4d6dacbe1aefda854b0d9896e09cb58829ec5638c" -dependencies = [ - "generic-array 0.12.3", -] - -[[package]] -name = "stream-cipher" -version = "0.4.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f8ed9974042b8c3672ff3030a69fcc03b74c47c3d1ecb7755e8a3626011e88" +checksum = "c80e15f898d8d8f25db24c253ea615cc14acf418ff307822995814e7d42cfa89" dependencies = [ - "generic-array 0.14.2", + "block-cipher", + "generic-array 0.14.4", ] [[package]] @@ -8636,9 +8835,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "structopt" -version = "0.3.15" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de2f5e239ee807089b62adce73e48c625e0ed80df02c7ab3f068f5db5281065c" +checksum = "126d630294ec449fae0b16f964e35bf3c74f940da9dca17ee9b905f7b3112eb8" dependencies = [ "clap", "lazy_static", @@ -8647,15 +8846,15 @@ dependencies = [ [[package]] name = "structopt-derive" -version = "0.4.8" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "510413f9de616762a4fbeab62509bf15c729603b72d7cd71280fbca431b1c118" +checksum = "65e51c492f9e23a220534971ff5afc14037289de430e3c83f9daf6a1b6ae91e8" dependencies = [ "heck", "proc-macro-error", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -8674,9 +8873,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0054a7df764039a6cd8592b9de84be4bec368ff081d203a7d5371cbfa8e65c81" dependencies = [ "heck", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -8695,13 +8894,13 @@ dependencies = [ [[package]] name = "substrate-browser-utils" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "chrono", "console_error_panic_hook", "console_log", - "futures 0.1.29", - "futures 0.3.5", + "futures 0.1.30", + "futures 0.3.6", "futures-timer 3.0.2", "js-sys", "kvdb-web", @@ -8721,7 +8920,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "platforms", ] @@ -8729,10 +8928,10 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.5", + "futures 0.3.6", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -8752,24 +8951,24 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "async-std", "derive_more 0.99.11", "futures-util", - "hyper 0.13.6", + "hyper 0.13.8", "log 0.4.11", "prometheus", - "tokio 0.2.21", + "tokio 0.2.22", ] [[package]] name = "substrate-test-client" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ - "futures 0.1.29", - "futures 0.3.5", + "futures 0.1.30", + "futures 0.3.6", "hash-db", "hex", "parity-scale-codec", @@ -8793,21 +8992,21 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "substrate-test-utils-derive", - "tokio 0.2.21", + "tokio 0.2.22", ] [[package]] name = "substrate-test-utils-derive" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" +source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" dependencies = [ "proc-macro-crate", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -8824,9 +9023,9 @@ checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" [[package]] name = "subtle" -version = "2.2.3" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "502d53007c02d7605a05df1c1a73ee436952781653da5d0bf57ad608f66932c1" +checksum = "343f3f510c2915908f155e94f17220b19ccfacf2a64a2a5d8004f2c3e311e7fd" [[package]] name = "syn" @@ -8841,35 +9040,24 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.33" +version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d5d96e8cbb005d6959f119f773bfaebb5684296108fb32600c00cde305b2cd" +checksum = "5ad5de3220ea04da322618ded2c42233d02baca219d6f160a3e9c87cda16c942" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", "unicode-xid 0.2.1", ] -[[package]] -name = "syn-mid" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.33", -] - [[package]] name = "synstructure" version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", "unicode-xid 0.2.1", ] @@ -8891,7 +9079,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", "rand 0.7.3", "redox_syscall", @@ -8975,9 +9163,9 @@ version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cae2447b6282786c3493999f40a9be2a6ad20cb8bd268b0a0dbf5a065535c0ab" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -9000,11 +9188,12 @@ dependencies = [ [[package]] name = "time" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ "libc", + "wasi 0.10.0+wasi-snapshot-preview1", "winapi 0.3.9", ] @@ -9044,9 +9233,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" +checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" [[package]] name = "tokio" @@ -9055,7 +9244,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "mio", "num_cpus", "tokio-codec", @@ -9074,9 +9263,9 @@ dependencies = [ [[package]] name = "tokio" -version = "0.2.21" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d099fa27b9702bed751524694adbe393e18b36b204da91eb1cbbbbb4a5ee2d58" +checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" dependencies = [ "bytes 0.5.6", "fnv", @@ -9103,7 +9292,7 @@ checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" dependencies = [ "bytes 0.4.12", "either", - "futures 0.1.29", + "futures 0.1.30", ] [[package]] @@ -9113,7 +9302,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "tokio-io", ] @@ -9123,7 +9312,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" dependencies = [ - "futures 0.1.29", + "futures 0.1.30", "tokio-executor 0.1.10", ] @@ -9133,8 +9322,8 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" dependencies = [ - "crossbeam-utils", - "futures 0.1.29", + "crossbeam-utils 0.7.2", + "futures 0.1.30", ] [[package]] @@ -9154,7 +9343,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" dependencies = [ - "futures 0.1.29", + "futures 0.1.30", "tokio-io", "tokio-threadpool", ] @@ -9166,7 +9355,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "log 0.4.11", ] @@ -9176,9 +9365,9 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -9188,7 +9377,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d282d483052288b2308ba5ee795f5673b159c9bdf63c385a05609da782a5eae" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "mio", "mio-named-pipes", "tokio 0.1.22", @@ -9200,8 +9389,8 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" dependencies = [ - "crossbeam-utils", - "futures 0.1.29", + "crossbeam-utils 0.7.2", + "futures 0.1.30", "lazy_static", "log 0.4.11", "mio", @@ -9215,13 +9404,13 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "228139ddd4fea3fa345a29233009635235833e52807af7ea6448ead03890d6a9" +checksum = "e12831b255bcfa39dc0436b01e19fea231a37db570686c06ee72c423479f889a" dependencies = [ "futures-core", "rustls", - "tokio 0.2.21", + "tokio 0.2.22", "webpki", ] @@ -9231,7 +9420,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" dependencies = [ - "futures 0.1.29", + "futures 0.1.30", ] [[package]] @@ -9241,7 +9430,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" dependencies = [ "fnv", - "futures 0.1.29", + "futures 0.1.30", ] [[package]] @@ -9262,7 +9451,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "iovec", "mio", "tokio-io", @@ -9275,10 +9464,10 @@ version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" dependencies = [ - "crossbeam-deque", + "crossbeam-deque 0.7.3", "crossbeam-queue", - "crossbeam-utils", - "futures 0.1.29", + "crossbeam-utils 0.7.2", + "futures 0.1.30", "lazy_static", "log 0.4.11", "num_cpus", @@ -9292,8 +9481,8 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" dependencies = [ - "crossbeam-utils", - "futures 0.1.29", + "crossbeam-utils 0.7.2", + "futures 0.1.30", "slab", "tokio-executor 0.1.10", ] @@ -9305,7 +9494,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "log 0.4.11", "mio", "tokio-codec", @@ -9320,7 +9509,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0" dependencies = [ "bytes 0.4.12", - "futures 0.1.29", + "futures 0.1.30", "iovec", "libc", "log 0.4.11", @@ -9342,14 +9531,14 @@ dependencies = [ "futures-sink", "log 0.4.11", "pin-project-lite", - "tokio 0.2.21", + "tokio 0.2.22", ] [[package]] name = "toml" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" +checksum = "75cf45bb0bef80604d001caaec0d09da99611b3c0fd39d3080468875cdb65645" dependencies = [ "serde", ] @@ -9366,7 +9555,8 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0987850db3733619253fe60e17cb59b82d37c7e6c0236bb81e4d6b87c879f27" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", + "log 0.4.11", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -9378,9 +9568,9 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80e0ccfc3378da0cce270c946b676a376943f5cd16aeba64568e7939806f4ada" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", ] [[package]] @@ -9392,13 +9582,23 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "tracing-error" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4d7c0b83d4a500748fa5879461652b361edf5c9d51ede2a2ac03875ca185e24" +dependencies = [ + "tracing", + "tracing-subscriber", +] + [[package]] name = "tracing-futures" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab7bb6f14721aa00656086e9335d363c5c8747bae02ebe32ea2c7dece5689b4c" dependencies = [ - "pin-project", + "pin-project 0.4.27", "tracing", ] @@ -9453,12 +9653,12 @@ checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" [[package]] name = "trie-db" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f1a9a9252d38c5337cf0c5392988821a5cf1b2103245016968f2ab41de9e38" +checksum = "9e55f7ace33d6237e14137e386f4e1672e2a5c6bbc97fef9f438581a143971f0" dependencies = [ "hash-db", - "hashbrown 0.8.0", + "hashbrown 0.8.2", "log 0.4.11", "rustc-hex", "smallvec 1.4.2", @@ -9475,17 +9675,19 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "twox-hash" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bfd5b7557925ce778ff9b9ef90e3ade34c524b5ff10e239c69a42d546d2af56" +checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" dependencies = [ + "cfg-if 0.1.10", "rand 0.7.3", + "static_assertions", ] [[package]] @@ -9496,9 +9698,9 @@ checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" [[package]] name = "uint" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "173cd16430c206dc1a430af8a89a0e9c076cf15cb42b4aedb10e8cc8fee73681" +checksum = "9db035e67dfaf7edd9aebfe8676afcd63eed53c8a4044fed514c8cccf1835177" dependencies = [ "byteorder 1.3.4", "crunchy", @@ -9563,16 +9765,10 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" dependencies = [ - "generic-array 0.14.2", - "subtle 2.2.3", + "generic-array 0.14.4", + "subtle 2.3.0", ] -[[package]] -name = "unsigned-varint" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f67332660eb59a6f1eb24ff1220c9e8d01738a8503c6002e30bcfe4bd9f2b4a9" - [[package]] name = "unsigned-varint" version = "0.4.0" @@ -9631,9 +9827,9 @@ checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" [[package]] name = "vec-arena" -version = "0.5.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17dfb54bf57c9043f4616cb03dab30eff012cc26631b797d8354b916708db919" +checksum = "8cb18268690309760d59ee1a9b21132c126ba384f374c59a94db4bc03adeb561" [[package]] name = "vec-arena" @@ -9670,9 +9866,9 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9571542c2ce85ce642e6b58b3364da2fb53526360dfb7c211add4f5c23105ff7" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "want" @@ -9680,7 +9876,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" dependencies = [ - "futures 0.1.29", + "futures 0.1.30", "log 0.4.11", "try-lock", ] @@ -9701,13 +9897,19 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + [[package]] name = "wasm-bindgen" -version = "0.2.64" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a634620115e4a229108b71bde263bb4220c483b3f07f5ba514ee8d15064c4c2" +checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "serde", "serde_json", "wasm-bindgen-macro", @@ -9715,26 +9917,26 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.64" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e53963b583d18a5aa3aaae4b4c1cb535218246131ba22a71f05b518098571df" +checksum = "f22b422e2a757c35a73774860af8e112bff612ce6cb604224e8e47641a9e4f68" dependencies = [ "bumpalo", "lazy_static", "log 0.4.11", - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.14" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba48d66049d2a6cc8488702e7259ab7afc9043ad0dc5448444f46f2a453b362" +checksum = "b7866cab0aa01de1edf8b5d7936938a7e397ee50ce24119aef3e1eaa3b6171da" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "js-sys", "wasm-bindgen", "web-sys", @@ -9742,9 +9944,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.64" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fcfd5ef6eec85623b4c6e844293d4516470d8f19cd72d0d12246017eb9060b8" +checksum = "6b13312a745c08c469f0b292dd2fcd6411dba5f7160f593da6ef69b64e407038" dependencies = [ "quote 1.0.7", "wasm-bindgen-macro-support", @@ -9752,34 +9954,33 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.64" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9adff9ee0e94b926ca81b57f57f86d5545cdcb1d259e21ec9bdd95b901754c75" +checksum = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.64" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7b90ea6c632dd06fd765d44542e234d5e63d9bb917ecd64d79778a13bd79ae" +checksum = "1d649a3145108d7d3fbcde896a468d1bd636791823c9921135218ad89be08307" [[package]] name = "wasm-timer" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324c5e65a08699c9c4334ba136597ab22b85dccd4b65dd1e36ccf8f723a95b54" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "js-sys", - "parking_lot 0.9.0", + "parking_lot 0.11.0", "pin-utils", - "send_wrapper 0.2.0", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -9828,7 +10029,7 @@ checksum = "1cd3c4f449382779ef6e0a7c3ec6752ae614e20a42e4100000c3efdc973100e2" dependencies = [ "anyhow", "backtrace", - "cfg-if", + "cfg-if 0.1.10", "lazy_static", "libc", "log 0.4.11", @@ -9870,7 +10071,7 @@ dependencies = [ "anyhow", "base64 0.12.3", "bincode", - "cfg-if", + "cfg-if 0.1.10", "cranelift-codegen", "cranelift-entity", "cranelift-frontend", @@ -9899,7 +10100,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e914c013c7a9f15f4e429d5431f2830fb8adb56e40567661b69c5ec1d645be23" dependencies = [ "anyhow", - "cfg-if", + "cfg-if 0.1.10", "cranelift-codegen", "cranelift-entity", "cranelift-frontend", @@ -9942,7 +10143,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e8d4d1af8dd5f7096cfcc89dd668d358e52980c38cce199643372ffd6590e27" dependencies = [ "anyhow", - "cfg-if", + "cfg-if 0.1.10", "gimli 0.21.0", "lazy_static", "libc", @@ -9962,7 +10163,7 @@ checksum = "3a25f140bbbaadb07c531cba99ce1a966dba216138dc1b2a0ddecec851a01a93" dependencies = [ "backtrace", "cc", - "cfg-if", + "cfg-if 0.1.10", "indexmap", "lazy_static", "libc", @@ -9977,27 +10178,27 @@ dependencies = [ [[package]] name = "wast" -version = "21.0.0" +version = "26.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b1844f66a2bc8526d71690104c0e78a8e59ffa1597b7245769d174ebb91deb5" +checksum = "b3f174eed73e885ede6c8fcc3fbea8c3757afa521840676496cde56bb742ddab" dependencies = [ "leb128", ] [[package]] name = "wat" -version = "1.0.22" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce85d72b74242c340e9e3492cfb602652d7bb324c3172dd441b5577e39a2e18c" +checksum = "26b2dccbce4d0e14875091846e110a2369267b18ddd0d6423479b88dad914d71" dependencies = [ "wast", ] [[package]] name = "web-sys" -version = "0.3.41" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "863539788676619aac1a23e2df3655e96b32b0e05eb72ca34ba045ad573c625d" +checksum = "4bf6ef87ad7ae8008e15a355ce696bed26012b7caa21605188cfd8214ab51e2d" dependencies = [ "js-sys", "wasm-bindgen", @@ -10033,9 +10234,9 @@ dependencies = [ [[package]] name = "wepoll-sys-stjepang" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fd319e971980166b53e17b1026812ad66c6b54063be879eb182342b55284694" +checksum = "1fdfbb03f290ca0b27922e8d48a0997b4ceea12df33269b9f75e713311eb178d" dependencies = [ "cc", ] @@ -10184,7 +10385,18 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "637ff90c9540fa3073bb577e65033069e4bae7c79d49d74aa3ffdf5342a53217" dependencies = [ - "curve25519-dalek", + "curve25519-dalek 2.1.0", + "rand_core 0.5.1", + "zeroize", +] + +[[package]] +name = "x25519-dalek" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc614d95359fd7afc321b66d2107ede58b246b844cf5d8a0adcca413e439f088" +dependencies = [ + "curve25519-dalek 3.0.0", "rand_core 0.5.1", "zeroize", ] @@ -10232,7 +10444,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aeb8c4043cac71c3c299dff107171c220d179492350ea198e109a414981b83c" dependencies = [ - "futures 0.3.5", + "futures 0.3.6", "log 0.4.11", "nohash-hasher", "parking_lot 0.11.0", @@ -10242,22 +10454,22 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cbac2ed2ba24cc90f5e06485ac8c7c1e5449fe8911aef4d8877218af021a5b8" +checksum = "05f33972566adbd2d3588b0491eb94b98b43695c4ef897903470ede4f3f5a28a" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de251eec69fc7c1bc3923403d18ececb929380e016afe103da75f396704f8ca2" +checksum = "c3f369ddb18862aba61aa49bf31e74d29f0f162dec753063200e1dc084345d16" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2 1.0.24", "quote 1.0.7", - "syn 1.0.33", + "syn 1.0.46", "synstructure", ] diff --git a/node/core/av-store/Cargo.toml b/node/core/av-store/Cargo.toml index f1a2c5ade2ea..63bd810ab8b3 100644 --- a/node/core/av-store/Cargo.toml +++ b/node/core/av-store/Cargo.toml @@ -7,7 +7,8 @@ edition = "2018" [dependencies] derive_more = "0.99.9" futures = "0.3.5" -log = "0.4.8" +log = "0.4.11" +thiserror = "1.0.21" kvdb = "0.7.0" kvdb-rocksdb = "0.9.1" diff --git a/node/core/av-store/src/lib.rs b/node/core/av-store/src/lib.rs index e32b3c152665..ce20e7c7fa43 100644 --- a/node/core/av-store/src/lib.rs +++ b/node/core/av-store/src/lib.rs @@ -39,6 +39,7 @@ use polkadot_node_subsystem_util::{ metrics::{self, prometheus}, }; use polkadot_subsystem::messages::AvailabilityStoreMessage; +use thiserror::Error; const LOG_TARGET: &str = "availability"; @@ -47,15 +48,15 @@ mod columns { pub const NUM_COLUMNS: u32 = 1; } -#[derive(Debug, derive_more::From)] +#[derive(Debug, Error)] enum Error { - #[from] + #[error(transparent)] Erasure(erasure::Error), - #[from] + #[error(transparent)] Io(io::Error), - #[from] + #[error(transparent)] Oneshot(oneshot::Canceled), - #[from] + #[error(transparent)] Subsystem(SubsystemError), } diff --git a/node/core/backing/Cargo.toml b/node/core/backing/Cargo.toml index 722f3ce6ae67..e8b51de67285 100644 --- a/node/core/backing/Cargo.toml +++ b/node/core/backing/Cargo.toml @@ -18,7 +18,8 @@ erasure-coding = { package = "polkadot-erasure-coding", path = "../../../erasure statement-table = { package = "polkadot-statement-table", path = "../../../statement-table" } derive_more = "0.99.9" bitvec = { version = "0.17.4", default-features = false, features = ["alloc"] } -log = "0.4.8" +log = "0.4.11" +thiserror = "1.0.21" [dev-dependencies] sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/core/backing/src/lib.rs b/node/core/backing/src/lib.rs index 97be31107756..36eacf01d84c 100644 --- a/node/core/backing/src/lib.rs +++ b/node/core/backing/src/lib.rs @@ -65,21 +65,25 @@ use statement_table::{ SignedStatement as TableSignedStatement, Summary as TableSummary, }, }; +use thiserror::Error; -#[derive(Debug, derive_more::From)] +#[derive(Debug, Error)] enum Error { + #[error("Candidate is not found")] CandidateNotFound, + #[error("Signature is invalid")] InvalidSignature, + #[error("Storing data was not successful")] StoreFailed, - #[from] + #[error(transparent)] Erasure(erasure_coding::Error), - #[from] + #[error(transparent)] ValidationFailed(ValidationFailed), - #[from] + #[error(transparent)] Oneshot(oneshot::Canceled), - #[from] + #[error(transparent)] Mpsc(mpsc::SendError), - #[from] + #[error(transparent)] UtilError(util::Error), } diff --git a/node/core/bitfield-signing/Cargo.toml b/node/core/bitfield-signing/Cargo.toml index 634f8fd8f37e..1957ab69387c 100644 --- a/node/core/bitfield-signing/Cargo.toml +++ b/node/core/bitfield-signing/Cargo.toml @@ -8,9 +8,10 @@ edition = "2018" bitvec = "0.17.4" derive_more = "0.99.9" futures = "0.3.5" -log = "0.4.8" +log = "0.4.11" polkadot-primitives = { path = "../../../primitives" } polkadot-node-subsystem = { path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } wasm-timer = "0.2.4" +thiserror = "1.0.21" diff --git a/node/core/bitfield-signing/src/lib.rs b/node/core/bitfield-signing/src/lib.rs index a518469c9dfc..059cd07c7c4d 100644 --- a/node/core/bitfield-signing/src/lib.rs +++ b/node/core/bitfield-signing/src/lib.rs @@ -37,6 +37,7 @@ use polkadot_node_subsystem_util::{ use polkadot_primitives::v1::{AvailabilityBitfield, CoreState, Hash, ValidatorIndex}; use std::{convert::TryFrom, pin::Pin, time::Duration}; use wasm_timer::{Delay, Instant}; +use thiserror::Error; /// Delay between starting a bitfield signing job and its attempting to create a bitfield. const JOB_DELAY: Duration = Duration::from_millis(1500); @@ -112,28 +113,28 @@ impl TryFrom for FromJob { } /// Errors we may encounter in the course of executing the `BitfieldSigningSubsystem`. -#[derive(Debug, derive_more::From)] +#[derive(Debug, Error)] pub enum Error { /// error propagated from the utility subsystem - #[from] + #[error(transparent)] Util(util::Error), /// io error - #[from] + #[error(transparent)] Io(std::io::Error), /// a one shot channel was canceled - #[from] + #[error(transparent)] Oneshot(oneshot::Canceled), /// a mspc channel failed to send - #[from] + #[error(transparent)] MpscSend(mpsc::SendError), /// several errors collected into one - #[from] + #[error(transparent)] Multiple(Vec), /// the runtime API failed to return what we wanted - #[from] + #[error(transparent)] Runtime(RuntimeApiError), /// the keystore failed to process signing request - #[from] + #[error(transparent)] Keystore(KeystoreError), } diff --git a/node/core/candidate-selection/src/lib.rs b/node/core/candidate-selection/src/lib.rs index 667963d8afb2..84c1c9f1120d 100644 --- a/node/core/candidate-selection/src/lib.rs +++ b/node/core/candidate-selection/src/lib.rs @@ -39,6 +39,7 @@ use polkadot_primitives::v1::{ CandidateDescriptor, CandidateReceipt, CollatorId, Hash, Id as ParaId, PoV, }; use std::{convert::TryFrom, pin::Pin, sync::Arc}; +use thiserror::Error; const TARGET: &'static str = "candidate_selection"; @@ -116,17 +117,17 @@ impl TryFrom for FromJob { } } -#[derive(Debug, derive_more::From)] +#[derive(Debug, Error)] enum Error { - #[from] + #[error(transparent)] Sending(mpsc::SendError), - #[from] + #[error(transparent)] Util(util::Error), - #[from] + #[error(transparent)] OneshotRecv(oneshot::Canceled), - #[from] + #[error(transparent)] ChainApi(ChainApiError), - #[from] + #[error(transparent)] Runtime(RuntimeApiError), } @@ -154,7 +155,7 @@ impl JobTrait for CandidateSelectionJob { // it isn't necessary to break run_loop into its own function, // but it's convenient to separate the concerns in this way - job.run_loop().await + job.run_loop().await.map_err(|e| SubsystemError::with_origin(NAME, e)) } .boxed() } diff --git a/node/core/candidate-validation/src/lib.rs b/node/core/candidate-validation/src/lib.rs index 273df04c4dd5..396b9dff4a6c 100644 --- a/node/core/candidate-validation/src/lib.rs +++ b/node/core/candidate-validation/src/lib.rs @@ -116,9 +116,12 @@ impl Subsystem for CandidateValidationSubsystem where S: SpawnNamed + Clone + 'static, { fn start(self, ctx: C) -> SpawnedSubsystem { + let future = run(ctx, self.spawn, self.metrics) + .map_err(|e| SubsystemError::with_origin("candidate-validation", e)) + .map(|_| ()).boxed(); SpawnedSubsystem { name: "candidate-validation-subsystem", - future: run(ctx, self.spawn, self.metrics).map(|_| ()).boxed(), + future, } } } diff --git a/node/core/chain-api/src/lib.rs b/node/core/chain-api/src/lib.rs index b2412de65e8f..06b07703936d 100644 --- a/node/core/chain-api/src/lib.rs +++ b/node/core/chain-api/src/lib.rs @@ -61,8 +61,9 @@ impl Subsystem for ChainApiSubsystem where Context: SubsystemContext { fn start(self, ctx: Context) -> SpawnedSubsystem { + let future = run(ctx, self).map_err(|e| SubsystemError::with_origin("chain-api", e)).map(|_| ()).boxed(); SpawnedSubsystem { - future: run(ctx, self).map(|_| ()).boxed(), + future: , name: "chain-api-subsystem", } } diff --git a/node/network/availability-distribution/Cargo.toml b/node/network/availability-distribution/Cargo.toml index 0e8413d8aab2..a145b5026730 100644 --- a/node/network/availability-distribution/Cargo.toml +++ b/node/network/availability-distribution/Cargo.toml @@ -18,6 +18,7 @@ polkadot-node-network-protocol = { path = "../../network/protocol" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", features = ["std"] } sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } +thiserror = "1.0.21" [dev-dependencies] polkadot-subsystem-testhelpers = { package = "polkadot-node-subsystem-test-helpers", path = "../../subsystem-test-helpers" } diff --git a/node/network/availability-distribution/src/lib.rs b/node/network/availability-distribution/src/lib.rs index 2674460065d8..fc497e393b91 100644 --- a/node/network/availability-distribution/src/lib.rs +++ b/node/network/availability-distribution/src/lib.rs @@ -55,22 +55,27 @@ use polkadot_node_network_protocol::{ use std::collections::{HashMap, HashSet}; use std::io; use std::iter; - +use thiserror::Error; const TARGET: &'static str = "avad"; -#[derive(Debug, derive_more::From)] +#[derive(Debug, Error)] enum Error { - #[from] + #[error(transparent)] Erasure(polkadot_erasure_coding::Error), - #[from] + + #[error(transparent)] Io(io::Error), - #[from] + + #[error(transparent)] Oneshot(oneshot::Canceled), - #[from] + + #[error(transparent)] Subsystem(SubsystemError), - #[from] + + #[error(transparent)] RuntimeApi(RuntimeApiError), - #[from] + + #[error(transparent)] ChainApi(ChainApiError), } diff --git a/node/overseer/Cargo.toml b/node/overseer/Cargo.toml index bf0fd7785832..e2f0e359e768 100644 --- a/node/overseer/Cargo.toml +++ b/node/overseer/Cargo.toml @@ -15,6 +15,8 @@ polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../subsystem polkadot-node-subsystem-util = { path = "../subsystem-util" } polkadot-node-primitives = { package = "polkadot-node-primitives", path = "../primitives" } async-trait = "0.1" +eyre = "0.6.1" +color-eyre = "0.5.6" [dev-dependencies] sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/overseer/src/lib.rs b/node/overseer/src/lib.rs index e7ba8da0b469..47924efc93fb 100644 --- a/node/overseer/src/lib.rs +++ b/node/overseer/src/lib.rs @@ -96,6 +96,8 @@ const STOP_DELAY: u64 = 1; // Target for logs. const LOG_TARGET: &'static str = "overseer"; +/// A universal helper type for the overseer. +pub use eyre::Error as OverseerError; /// A type of messages that are sent from [`Subsystem`] to [`Overseer`]. /// @@ -160,7 +162,7 @@ impl From> for BlockInfo { } } -/// Some event from outer world. +/// Some event from the outer world. enum Event { BlockImported(BlockInfo), BlockFinalized(BlockInfo), @@ -303,7 +305,8 @@ impl SubsystemContext for OverseerSubsystemContext { } async fn recv(&mut self) -> SubsystemResult> { - self.rx.next().await.ok_or(SubsystemError::Context("No next() rx message to process".to_owned())) + // XXX TODO `eyre::eyre!("No more messages in rx queue to process")` + self.rx.next().await.ok_or(SubsystemError::Context("No more messages in rx queue to process".to_owned())) } async fn spawn(&mut self, name: &'static str, s: Pin + Send>>) diff --git a/node/subsystem-util/Cargo.toml b/node/subsystem-util/Cargo.toml index 68c6853485d5..aff26c1970ec 100644 --- a/node/subsystem-util/Cargo.toml +++ b/node/subsystem-util/Cargo.toml @@ -11,6 +11,7 @@ derive_more = "0.99.9" futures = "0.3.5" futures-timer = "3.0.2" log = "0.4.8" +thiserror = "1.0.21" parity-scale-codec = "1.3.4" parking_lot = { version = "0.10.0", optional = true } pin-project = "0.4.22" diff --git a/node/subsystem-util/src/lib.rs b/node/subsystem-util/src/lib.rs index efd55900b2b5..4c620b8595d5 100644 --- a/node/subsystem-util/src/lib.rs +++ b/node/subsystem-util/src/lib.rs @@ -63,6 +63,7 @@ use std::{ time::Duration, }; use streamunordered::{StreamUnordered, StreamYield}; +use thiserror::Error; pub mod validator_discovery; @@ -82,35 +83,38 @@ pub const JOB_GRACEFUL_STOP_DURATION: Duration = Duration::from_secs(1); /// Capacity of channels to and from individual jobs pub const JOB_CHANNEL_CAPACITY: usize = 64; - /// Utility errors -#[derive(Debug, derive_more::From)] +#[derive(Debug, Error)] pub enum Error { /// Attempted to send or receive on a oneshot channel which had been canceled - #[from] - Oneshot(oneshot::Canceled), + #[error(transparent)] + Oneshot(#[from] oneshot::Canceled), /// Attempted to send on a MPSC channel which has been canceled - #[from] - Mpsc(mpsc::SendError), + #[error(transparent)] + Mpsc(#[from] mpsc::SendError), /// A subsystem error - #[from] - Subsystem(SubsystemError), + #[error(transparent)] + Subsystem(#[from] SubsystemError), /// An error in the Chain API. - #[from] - ChainApi(ChainApiError), + #[error(transparent)] + ChainApi(#[from] ChainApiError), /// An error in the Runtime API. - #[from] - RuntimeApi(RuntimeApiError), + #[error(transparent)] + RuntimeApi(#[from] RuntimeApiError), /// The type system wants this even though it doesn't make sense - #[from] - Infallible(std::convert::Infallible), + #[error(transparent)] + Infallible(#[from] std::convert::Infallible), /// Attempted to convert from an AllMessages to a FromJob, and failed. + #[error("AllMessage not relevant to Job")] SenderConversion(String), /// The local node is not a validator. + #[error("Node is not a validator")] NotAValidator, /// The desired job is not present in the jobs list. + #[error("Relay parent {0} not of interest")] JobNotFound(Hash), /// Already forwarding errors to another sender + #[error("AlreadyForwarding")] AlreadyForwarding, } @@ -496,7 +500,7 @@ pub trait JobTrait: Unpin { /// Message type from the job. Typically a subset of AllMessages. type FromJob: 'static + Into + Send; /// Job runtime error. - type Error: 'static + std::fmt::Debug + Send; + type Error: 'static + std::fmt::Debug + std::error::Error + Send; /// Extra arguments this job needs to run properly. /// /// If no extra information is needed, it is perfectly acceptable to set it to `()`. @@ -538,12 +542,13 @@ pub trait JobTrait: Unpin { /// Error which can be returned by the jobs manager /// /// Wraps the utility error type and the job-specific error -#[derive(Debug, derive_more::From)] -pub enum JobsError { +#[derive(Debug, Error)] +pub enum JobsError { /// utility error - #[from] + #[error("Utility")] Utility(Error), /// internal job error + #[error("Internal")] Job(JobError), } @@ -830,7 +835,8 @@ where let metrics = metrics.clone(); if let Err(e) = jobs.spawn_job(hash, run_args.clone(), metrics) { log::error!("Failed to spawn a job: {:?}", e); - Self::fwd_err(Some(hash), e.into(), err_tx).await; + let e = JobsError::Utility(e); + Self::fwd_err(Some(hash), e, err_tx).await; return true; } } @@ -838,7 +844,8 @@ where for hash in deactivated { if let Err(e) = jobs.stop_job(hash).await { log::error!("Failed to stop a job: {:?}", e); - Self::fwd_err(Some(hash), e.into(), err_tx).await; + let e = JobsError::Utility(e); + Self::fwd_err(Some(hash), e, err_tx).await; return true; } } @@ -863,7 +870,8 @@ where .await { log::error!("failed to stop all jobs on conclude signal: {:?}", e); - Self::fwd_err(None, Error::from(e).into(), err_tx).await; + let e = Error::from(e); + Self::fwd_err(None, JobsError::Utility(e), err_tx).await; } return true; @@ -874,14 +882,16 @@ where Some(hash) => { if let Err(err) = jobs.send_msg(hash, to_job).await { log::error!("Failed to send a message to a job: {:?}", err); - Self::fwd_err(Some(hash), err.into(), err_tx).await; + let e = JobsError::Utility(err); + Self::fwd_err(Some(hash), e, err_tx).await; return true; } } None => { if let Err(err) = Job::handle_unanchored_msg(to_job) { log::error!("Failed to handle unhashed message: {:?}", err); - Self::fwd_err(None, JobsError::Job(err), err_tx).await; + let e = JobsError::Job(err); + Self::fwd_err(None, e, err_tx).await; return true; } } @@ -891,7 +901,8 @@ where Ok(Signal(BlockFinalized(_))) => {} Err(err) => { log::error!("error receiving message from subsystem context: {:?}", err); - Self::fwd_err(None, Error::from(err).into(), err_tx).await; + let e = JobsError::Utility(Error::from(err)); + Self::fwd_err(None, e, err_tx).await; return true; } } @@ -906,7 +917,8 @@ where ) { let msg = outgoing.expect("the Jobs stream never ends; qed"); if let Err(e) = ctx.send_message(msg.into()).await { - Self::fwd_err(None, Error::from(e).into(), err_tx).await; + let e = JobsError::Utility(e.into()); + Self::fwd_err(None, e, err_tx).await; } } } diff --git a/node/subsystem/src/lib.rs b/node/subsystem/src/lib.rs index 43aa1309ba34..6e6d539c81e5 100644 --- a/node/subsystem/src/lib.rs +++ b/node/subsystem/src/lib.rs @@ -106,6 +106,7 @@ pub enum FromOverseer { }, } + /// An error type that describes faults that may happen /// /// These are: @@ -134,8 +135,14 @@ pub enum SubsystemError { #[error("Failed to {0}")] Context(String), - #[error("xxx")] - UnexpectedTermination{subsystem: String, #[source] source: Option> }, + #[error("Error originated in {origin}")] + FromOrigin{ origin: &'static str, #[source] source: Box}, +} + +impl SubsystemError { + pub fn with_origin(origin: &'static str, err: impl Into) -> Self { + Self::FromOrigin{ origin, source: Box::new(err.into()) } + } } /// An asynchronous subsystem task.. From ae0d71583e0ce861621160223320b2a2da92df62 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Thu, 22 Oct 2020 09:50:17 +0200 Subject: [PATCH 05/62] nits --- node/subsystem-util/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node/subsystem-util/src/lib.rs b/node/subsystem-util/src/lib.rs index 4c620b8595d5..24d9a76fad89 100644 --- a/node/subsystem-util/src/lib.rs +++ b/node/subsystem-util/src/lib.rs @@ -500,7 +500,7 @@ pub trait JobTrait: Unpin { /// Message type from the job. Typically a subset of AllMessages. type FromJob: 'static + Into + Send; /// Job runtime error. - type Error: 'static + std::fmt::Debug + std::error::Error + Send; + type Error: 'static + std::error::Error + Send; /// Extra arguments this job needs to run properly. /// /// If no extra information is needed, it is perfectly acceptable to set it to `()`. @@ -546,10 +546,10 @@ pub trait JobTrait: Unpin { pub enum JobsError { /// utility error #[error("Utility")] - Utility(Error), + Utility(#[source] Error), /// internal job error #[error("Internal")] - Job(JobError), + Job(#[source] JobError), } /// Jobs manager for a subsystem From 1cdb5b784eb692bdc200d1a768005acca0ab7442 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Thu, 22 Oct 2020 11:18:21 +0200 Subject: [PATCH 06/62] fixes --- node/network/availability-distribution/src/lib.rs | 3 --- node/subsystem-util/src/lib.rs | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/node/network/availability-distribution/src/lib.rs b/node/network/availability-distribution/src/lib.rs index fc497e393b91..f7856b22912e 100644 --- a/node/network/availability-distribution/src/lib.rs +++ b/node/network/availability-distribution/src/lib.rs @@ -69,9 +69,6 @@ enum Error { #[error(transparent)] Oneshot(oneshot::Canceled), - #[error(transparent)] - Subsystem(SubsystemError), - #[error(transparent)] RuntimeApi(RuntimeApiError), diff --git a/node/subsystem-util/src/lib.rs b/node/subsystem-util/src/lib.rs index 24d9a76fad89..2ec12ebcbe07 100644 --- a/node/subsystem-util/src/lib.rs +++ b/node/subsystem-util/src/lib.rs @@ -543,7 +543,7 @@ pub trait JobTrait: Unpin { /// /// Wraps the utility error type and the job-specific error #[derive(Debug, Error)] -pub enum JobsError { +pub enum JobsError { /// utility error #[error("Utility")] Utility(#[source] Error), From 1fe0d65b2f445cf959dd27864e7962e0ea41bcde Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Thu, 22 Oct 2020 12:34:26 +0200 Subject: [PATCH 07/62] wrap subsystem errors --- node/core/proposer/src/lib.rs | 2 +- node/network/availability-distribution/src/lib.rs | 9 ++++++++- node/network/bitfield-distribution/src/lib.rs | 8 +++++++- node/network/bridge/src/lib.rs | 14 ++++++++++---- node/network/collator-protocol/src/lib.rs | 4 +++- node/network/pov-distribution/src/lib.rs | 6 +++++- node/network/protocol/src/lib.rs | 10 ++++++++++ node/subsystem/src/lib.rs | 10 +++++++++- 8 files changed, 53 insertions(+), 10 deletions(-) diff --git a/node/core/proposer/src/lib.rs b/node/core/proposer/src/lib.rs index 8aefe1c8bd39..07a3aff989e8 100644 --- a/node/core/proposer/src/lib.rs +++ b/node/core/proposer/src/lib.rs @@ -123,7 +123,7 @@ where let (sender, receiver) = futures::channel::oneshot::channel(); overseer.wait_for_activation(parent_header_hash, sender).await?; - receiver.await.map_err(Error::ClosedChannelFromProvisioner)?; + receiver.await.map_err(Error::ClosedChannelFromProvisioner)??; let (sender, receiver) = futures::channel::oneshot::channel(); // strictly speaking, we don't _have_ to .await this send_msg before opening the diff --git a/node/network/availability-distribution/src/lib.rs b/node/network/availability-distribution/src/lib.rs index f7856b22912e..0eb48a6f356a 100644 --- a/node/network/availability-distribution/src/lib.rs +++ b/node/network/availability-distribution/src/lib.rs @@ -768,9 +768,16 @@ where Context: SubsystemContext + Sync + Send, { fn start(self, ctx: Context) -> SpawnedSubsystem { + + let future = self.run(ctx) + .map_err(|e| { + SubsystemError::with_origin("availability-distribution", e) + }) + .map(|_| ()).boxed(); + SpawnedSubsystem { name: "availability-distribution-subsystem", - future: Box::pin(async move { self.run(ctx) }.map(|_| ())), + future, } } } diff --git a/node/network/bitfield-distribution/src/lib.rs b/node/network/bitfield-distribution/src/lib.rs index 3abe1e821487..d402a0132aa0 100644 --- a/node/network/bitfield-distribution/src/lib.rs +++ b/node/network/bitfield-distribution/src/lib.rs @@ -578,9 +578,15 @@ where C: SubsystemContext + Sync + Send, { fn start(self, ctx: C) -> SpawnedSubsystem { + let future = self.run(ctx) + .map_err(|e| { + SubsystemError::with_origin("bitfield-distribution", e) + }) + .map(|_| ()).boxed(); + SpawnedSubsystem { name: "bitfield-distribution-subsystem", - future: Box::pin(async move { Self::run(self, ctx) }.map(|_| ())), + future, } } } diff --git a/node/network/bridge/src/lib.rs b/node/network/bridge/src/lib.rs index a09b61e62407..c7212b55f9b3 100644 --- a/node/network/bridge/src/lib.rs +++ b/node/network/bridge/src/lib.rs @@ -219,13 +219,19 @@ impl Subsystem for NetworkBridge // Swallow error because failure is fatal to the node and we log with more precision // within `run_network`. let Self { network_service, authority_discovery_service } = self; - SpawnedSubsystem { - name: "network-bridge-subsystem", - future: run_network( + let future = run_network( network_service, authority_discovery_service, ctx, - ).map(|_| ()).boxed(), + ) + .map_err(|e| { + SubsystemError::with_origin("network-bridge", e) + }) + .map(|_| ()) + .boxed(); + SpawnedSubsystem { + name: "network-bridge-subsystem", + future, } } } diff --git a/node/network/collator-protocol/src/lib.rs b/node/network/collator-protocol/src/lib.rs index ef659051e621..f4bed40cd690 100644 --- a/node/network/collator-protocol/src/lib.rs +++ b/node/network/collator-protocol/src/lib.rs @@ -113,7 +113,9 @@ impl CollatorProtocolSubsystem { id, metrics, ).await, - } + }.map_err(|e| { + SubsystemError::with_origin("collator-protocol", e) + }) } } diff --git a/node/network/pov-distribution/src/lib.rs b/node/network/pov-distribution/src/lib.rs index ccce091c1af2..74aa110e4bb3 100644 --- a/node/network/pov-distribution/src/lib.rs +++ b/node/network/pov-distribution/src/lib.rs @@ -60,9 +60,13 @@ impl Subsystem for PoVDistribution fn start(self, ctx: C) -> SpawnedSubsystem { // Swallow error because failure is fatal to the node and we log with more precision // within `run`. + let future = self.run(ctx) + .map_err(|e| SubsystemError::with_origin("pov-distribution", e)) + .map(|_| ()) + .boxed(); SpawnedSubsystem { name: "pov-distribution-subsystem", - future: self.run(ctx).map(|_| ()).boxed(), + future, } } } diff --git a/node/network/protocol/src/lib.rs b/node/network/protocol/src/lib.rs index 7658048ca5c8..dbeea99f4a43 100644 --- a/node/network/protocol/src/lib.rs +++ b/node/network/protocol/src/lib.rs @@ -19,6 +19,7 @@ use polkadot_primitives::v1::Hash; use parity_scale_codec::{Encode, Decode}; use std::convert::TryFrom; +use std::fmt; pub use sc_network::{ReputationChange, PeerId}; @@ -32,6 +33,15 @@ pub type ProtocolVersion = u32; #[derive(Debug, Clone, Copy, PartialEq)] pub struct WrongVariant; +impl fmt::Display for WrongVariant { + fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(formatter, "Wrong message variant") + } +} + +impl std::error::Error for WrongVariant {} + + /// The peer-sets that the network manages. Different subsystems will use different peer-sets. #[derive(Debug, Clone, Copy, PartialEq)] pub enum PeerSet { diff --git a/node/subsystem/src/lib.rs b/node/subsystem/src/lib.rs index 6e6d539c81e5..cb220ce636c4 100644 --- a/node/subsystem/src/lib.rs +++ b/node/subsystem/src/lib.rs @@ -132,14 +132,22 @@ pub enum SubsystemError { #[error(transparent)] Infallible(#[from] std::convert::Infallible), + /// An other error lacking particular type information. #[error("Failed to {0}")] Context(String), + /// Per origin (or subsystem) annotations to wrap an error. #[error("Error originated in {origin}")] - FromOrigin{ origin: &'static str, #[source] source: Box}, + FromOrigin { + /// An additional anotation tag for the origin of `source`. + origin: &'static str, + /// The wrapped error. Marked as source for tracking the error chain. + #[source] source: Box + }, } impl SubsystemError { + /// Adds a `str` as `origin` to the given error `err`. pub fn with_origin(origin: &'static str, err: impl Into) -> Self { Self::FromOrigin{ origin, source: Box::new(err.into()) } } From e95d9509c075d463ccabf79909e9e4afe65d2d18 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Thu, 22 Oct 2020 14:21:25 +0200 Subject: [PATCH 08/62] more steps --- node/core/provisioner/src/lib.rs | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/node/core/provisioner/src/lib.rs b/node/core/provisioner/src/lib.rs index b8af4852a0dc..9c4f634b9fd4 100644 --- a/node/core/provisioner/src/lib.rs +++ b/node/core/provisioner/src/lib.rs @@ -42,6 +42,7 @@ use polkadot_primitives::v1::{ SignedAvailabilityBitfield, }; use std::{collections::HashMap, convert::TryFrom, pin::Pin}; +use thiserror::Error; struct ProvisioningJob { relay_parent: Hash, @@ -115,19 +116,25 @@ impl TryFrom for FromJob { } } -#[derive(Debug, derive_more::From)] +#[derive(Debug, Error)] enum Error { - #[from] - Sending(mpsc::SendError), - #[from] + #[error(transparent)] Util(util::Error), - #[from] + + #[error(transparent)] OneshotRecv(oneshot::Canceled), - #[from] + + #[error(transparent)] ChainApi(ChainApiError), - #[from] + + #[error(transparent)] Runtime(RuntimeApiError), - OneshotSend, + + #[error("Failed to send message to ChainAPI")] + ChainApiMessageSend(#[source] mpsc::SendError), + + #[error("Failed to send return message with Inherents")] + InherentDataReturnChannel(#[source] mpsc::SendError), } impl JobTrait for ProvisioningJob { @@ -299,7 +306,7 @@ async fn send_inherent_data( return_sender .send((bitfields, candidates)) - .map_err(|_| Error::OneshotSend)?; + .map_err(|e| Error::InherentDataReturnChannel(e))?; Ok(()) } @@ -423,7 +430,7 @@ async fn get_block_number_under_construction( tx, ))) .await - .map_err(|_| Error::OneshotSend)?; + .map_err(|e| Error::ChainApiMessageSend(e))?; match rx.await? { Ok(Some(n)) => Ok(n + 1), Ok(None) => Ok(0), @@ -801,7 +808,7 @@ mod tests { Delay::new(std::time::Duration::from_millis(50)).await; let result = select_candidates(&[], &[], &[], Default::default(), &mut tx).await; println!("{:?}", result); - assert!(std::matches!(result, Err(Error::OneshotSend))); + assert!(std::matches!(result, Err(Error::ChainApiMessageSend(_)))); }; test_harness(overseer, test); From 3927413b41b7845a9a1bc4739401eb10d56bec9b Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Thu, 22 Oct 2020 15:13:49 +0200 Subject: [PATCH 09/62] make subsystem errors more specific --- node/core/av-store/src/lib.rs | 8 ++++---- node/core/backing/src/lib.rs | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/node/core/av-store/src/lib.rs b/node/core/av-store/src/lib.rs index ce20e7c7fa43..cbc66a8a0c5a 100644 --- a/node/core/av-store/src/lib.rs +++ b/node/core/av-store/src/lib.rs @@ -51,13 +51,13 @@ mod columns { #[derive(Debug, Error)] enum Error { #[error(transparent)] - Erasure(erasure::Error), + Erasure(#[from]erasure::Error), #[error(transparent)] - Io(io::Error), + Io(#[from]io::Error), #[error(transparent)] - Oneshot(oneshot::Canceled), + Oneshot(#[from]oneshot::Canceled), #[error(transparent)] - Subsystem(SubsystemError), + Subsystem(#[from]SubsystemError), } /// An implementation of the Availability Store subsystem. diff --git a/node/core/backing/src/lib.rs b/node/core/backing/src/lib.rs index 36eacf01d84c..8a7d2847b6fe 100644 --- a/node/core/backing/src/lib.rs +++ b/node/core/backing/src/lib.rs @@ -73,15 +73,15 @@ enum Error { CandidateNotFound, #[error("Signature is invalid")] InvalidSignature, - #[error("Storing data was not successful")] - StoreFailed, - #[error(transparent)] - Erasure(erasure_coding::Error), + #[error("Storing data failed")] + StoreFailed(oneshot::Canceled), + #[error("Responding to backing request failed")] + BackingResponseChannel(oneshot::Canceled), + #[error("Obtaining erasure chunks failed")] + ObtainErasureChunks(#[from] #[source]erasure_coding::Error), #[error(transparent)] ValidationFailed(ValidationFailed), #[error(transparent)] - Oneshot(oneshot::Canceled), - #[error(transparent)] Mpsc(mpsc::SendError), #[error(transparent)] UtilError(util::Error), @@ -472,7 +472,7 @@ impl CandidateBackingJob { CandidateBackingMessage::GetBackedCandidates(_, tx) => { let backed = self.get_backed(); - tx.send(backed).map_err(|_| oneshot::Canceled)?; + tx.send(backed).map_err(|e| Error::BackingResponseChannel(e))?; } } @@ -643,7 +643,7 @@ impl CandidateBackingJob { ) ).await?; - rx.await?.map_err(|_| Error::StoreFailed)?; + rx.await?.map_err(|e| Error::StoreFailed(e))?; Ok(()) } From 48ac8ae114fa9beede7a0d06f37b11ffb2100f33 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Thu, 22 Oct 2020 16:55:52 +0200 Subject: [PATCH 10/62] avail-dist: expressive errors --- .../availability-distribution/src/lib.rs | 168 +++++++++++++----- node/subsystem/src/lib.rs | 6 +- 2 files changed, 122 insertions(+), 52 deletions(-) diff --git a/node/network/availability-distribution/src/lib.rs b/node/network/availability-distribution/src/lib.rs index 0eb48a6f356a..eae5b93d6e0c 100644 --- a/node/network/availability-distribution/src/lib.rs +++ b/node/network/availability-distribution/src/lib.rs @@ -22,8 +22,10 @@ //! peers. Verified in this context means, the erasure chunks contained merkle proof //! is checked. +#[deny(unused_extern_crates, unused_results, unused_qualifications)] + use codec::{Decode, Encode}; -use futures::{channel::oneshot, FutureExt}; +use futures::{channel::oneshot, FutureExt, TryFutureExt}; use sp_core::crypto::Public; use sp_keystore::{CryptoStore, SyncCryptoStorePtr}; @@ -53,27 +55,71 @@ use polkadot_node_network_protocol::{ NetworkBridgeEvent, }; use std::collections::{HashMap, HashSet}; -use std::io; use std::iter; use thiserror::Error; const TARGET: &'static str = "avad"; #[derive(Debug, Error)] enum Error { - #[error(transparent)] - Erasure(polkadot_erasure_coding::Error), - - #[error(transparent)] - Io(io::Error), + #[error("Sending PendingAvailability query failed")] + QueryPendingAvailabilitySendQuery(#[source] SubsystemError), + #[error("Response channel to obtain PendingAvailability failed")] + QueryPendingAvailabilityResponseChannel(#[source] oneshot::Canceled), + #[error("RuntimeAPI to obtain PendingAvailability failed")] + QueryPendingAvailability(#[source] RuntimeApiError), + + #[error("Sending StoreChunk query failed")] + StoreChunkSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain StoreChunk failed")] + StoreChunkResponseChannel(#[source] oneshot::Canceled), + + #[error("Sending QueryChunk query failed")] + QueryChunkSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain QueryChunk failed")] + QueryChunkResponseChannel(#[source] oneshot::Canceled), + + #[error("Sending QueryAncestors query failed")] + QueryAncestorsSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain QueryAncestors failed")] + QueryAncestorsResponseChannel(#[source] oneshot::Canceled), + #[error("RuntimeAPI to obtain QueryAncestors failed")] + QueryAncestors(#[source] ChainApiError), + + + #[error("Sending QuerySession query failed")] + QuerySessionSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain QuerySession failed")] + QuerySessionResponseChannel(#[source] oneshot::Canceled), + #[error("RuntimeAPI to obtain QuerySession failed")] + QuerySession(#[source] RuntimeApiError), + + #[error("Sending QueryValidators query failed")] + QueryValidatorsSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain QueryValidators failed")] + QueryValidatorsResponseChannel(#[source] oneshot::Canceled), + #[error("RuntimeAPI to obtain QueryValidators failed")] + QueryValidators(#[source] RuntimeApiError), + + #[error("Sending AvailabilityCores query failed")] + AvailabilityCoresSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain AvailabilityCores failed")] + AvailabilityCoresResponseChannel(#[source] oneshot::Canceled), + #[error("RuntimeAPI to obtain AvailabilityCores failed")] + AvailabilityCores(#[source] RuntimeApiError), + + #[error("Sending AvailabilityCores query failed")] + QueryAvailabilitySendQuery(#[source] SubsystemError), + #[error("Response channel to obtain AvailabilityCores failed")] + QueryAvailabilityResponseChannel(#[source] oneshot::Canceled), + + #[error("Sending out a peer report message")] + ReportPeerMessageSend(#[source] SubsystemError), - #[error(transparent)] - Oneshot(oneshot::Canceled), - - #[error(transparent)] - RuntimeApi(RuntimeApiError), + #[error("Sending a gossip message")] + TrackedGossipMessage(#[source] SubsystemError), - #[error(transparent)] - ChainApi(ChainApiError), + #[error("Receive channel closed")] + IncomingMessageChannel(#[source] SubsystemError), } type Result = std::result::Result; @@ -508,7 +554,7 @@ where ), )) .await - .map_err::(Into::into)?; + .map_err(|e| Error::TrackedGossipMessage(e))?; metrics.on_chunk_distributed(); } @@ -730,7 +776,10 @@ impl AvailabilityDistributionSubsystem { // work: process incoming messages from the overseer. let mut state = ProtocolState::default(); loop { - let message = ctx.recv().await.map_err::(Into::into)?; + let message = ctx + .recv() + .await + .map_err(|e| Error::IncomingMessageChannel(e))?; match message { FromOverseer::Communication { msg: AvailabilityDistributionMessage::NetworkBridgeUpdateV1(event), @@ -770,9 +819,9 @@ where fn start(self, ctx: Context) -> SpawnedSubsystem { let future = self.run(ctx) - .map_err(|e| { + .map_err(|e| SubsystemError::with_origin("availability-distribution", e) - }) + ) .map(|_| ()).boxed(); SpawnedSubsystem { @@ -881,14 +930,16 @@ where { let (tx, rx) = oneshot::channel(); ctx.send_message(AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::AvailabilityCores(tx), - ))) - .await - .map_err::(Into::into)?; + relay_parent, + RuntimeApiRequest::AvailabilityCores(tx), + ))) + .await + .map_err(|e| Error::AvailabilityCoresSendQuery(e))?; let all_para_ids: Vec<_> = rx - .await??; + .await + .map_err(|e| Error::AvailabilityCoresResponseChannel(e))? + .map_err(|e| Error::AvailabilityCores(e))?; let occupied_para_ids = all_para_ids .into_iter() @@ -915,10 +966,10 @@ where peer ); ctx.send_message(AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep), - )) - .await - .map_err::(Into::into) + NetworkBridgeMessage::ReportPeer(peer, rep), + )) + .await + .map_err(|e| Error::ReportPeerMessageSend(e)) } /// Query the proof of validity for a particular candidate hash. @@ -931,10 +982,14 @@ where { let (tx, rx) = oneshot::channel(); ctx.send_message(AllMessages::AvailabilityStore( - AvailabilityStoreMessage::QueryDataAvailability(candidate_hash, tx), - )) - .await?; - rx.await.map_err::(Into::into) + AvailabilityStoreMessage::QueryDataAvailability(candidate_hash, tx), + )) + .await + .map_err(|e| Error::QueryAvailabilitySendQuery(e)) + ?; + rx + .await + .map_err(|e| Error::QueryAvailabilityResponseChannel(e)) } @@ -950,8 +1005,10 @@ where ctx.send_message(AllMessages::AvailabilityStore( AvailabilityStoreMessage::QueryChunk(candidate_hash, validator_index, tx), )) - .await?; - rx.await.map_err::(Into::into) + .await + .map_err(|e| Error::QueryChunkSendQuery(e))?; + rx.await + .map_err(|e| Error::QueryChunkResponseChannel(e)) } @@ -966,9 +1023,13 @@ where { let (tx, rx) = oneshot::channel(); ctx.send_message(AllMessages::AvailabilityStore( - AvailabilityStoreMessage::StoreChunk(candidate_hash, validator_index, erasure_chunk, tx), - )).await?; - rx.await.map_err::(Into::into) + AvailabilityStoreMessage::StoreChunk(candidate_hash, validator_index, erasure_chunk, tx), + )) + .await + .map_err(|e| Error::StoreChunkSendQuery(e))?; + rx + .await + .map_err(|e| Error::StoreChunkResponseChannel(e)) } /// Request the head data for a particular para. @@ -985,9 +1046,12 @@ where relay_parent, RuntimeApiRequest::CandidatePendingAvailability(para, tx), ))) - .await?; - rx.await? - .map_err::(Into::into) + .await + .map_err(|e| Error::QueryPendingAvailabilitySendQuery(e))?; + + rx.await + .map_err(|e| Error::QueryPendingAvailabilityResponseChannel(e))? + .map_err(|e| Error::QueryPendingAvailability(e)) } /// Query the validator set. @@ -1005,9 +1069,11 @@ where )); ctx.send_message(query_validators) - .await?; - rx.await? - .map_err::(Into::into) + .await + .map_err(|e| Error::QueryValidatorsSendQuery(e))?; + rx.await + .map_err(|e| Error::QueryValidatorsResponseChannel(e))? + .map_err(|e| Error::QueryValidators(e)) } /// Query the hash of the `K` ancestors @@ -1027,9 +1093,11 @@ where }); ctx.send_message(query_ancestors) - .await?; - rx.await? - .map_err::(Into::into) + .await + .map_err(|e| Error::QueryAncestorsSendQuery(e))?; + rx.await + .map_err(|e| Error::QueryAncestorsResponseChannel(e))? + .map_err(|e| Error::QueryAncestors(e)) } /// Query the session index of a relay parent @@ -1047,9 +1115,11 @@ where )); ctx.send_message(query_session_idx_for_child) - .await?; - rx.await? - .map_err::(Into::into) + .await + .map_err(|e| Error::QuerySessionSendQuery(e))?; + rx.await + .map_err(|e| Error::QuerySessionResponseChannel(e))? + .map_err(|e| Error::QuerySession(e)) } /// Queries up to k ancestors with the constraints of equiv session diff --git a/node/subsystem/src/lib.rs b/node/subsystem/src/lib.rs index cb220ce636c4..126ff3a1f6e5 100644 --- a/node/subsystem/src/lib.rs +++ b/node/subsystem/src/lib.rs @@ -142,14 +142,14 @@ pub enum SubsystemError { /// An additional anotation tag for the origin of `source`. origin: &'static str, /// The wrapped error. Marked as source for tracking the error chain. - #[source] source: Box + #[source] source: Box }, } impl SubsystemError { /// Adds a `str` as `origin` to the given error `err`. - pub fn with_origin(origin: &'static str, err: impl Into) -> Self { - Self::FromOrigin{ origin, source: Box::new(err.into()) } + pub fn with_origin(origin: &'static str, err: E) -> Self { + Self::FromOrigin{ origin, source: Box::new(err) } } } From 3acbe56de9c2d42e940d70d876c9f57e3342ed80 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Thu, 22 Oct 2020 17:01:53 +0200 Subject: [PATCH 11/62] fixup cargo lock --- Cargo.lock | 1843 ++++++++++++++++++++++++---------------------------- 1 file changed, 848 insertions(+), 995 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fc0f4e649f73..aaa82766d524 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -21,9 +21,9 @@ dependencies = [ [[package]] name = "adler" -version = "0.2.3" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" +checksum = "ccc9a9dd069569f212bc4330af9f17c4afb5e8ce185e83dbb14f1349dda18b10" [[package]] name = "aead" @@ -31,14 +31,14 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" dependencies = [ - "generic-array 0.14.4", + "generic-array 0.14.2", ] [[package]] name = "aes" -version = "0.5.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd2bc6d3f370b5666245ff421e231cba4353df936e26986d2918e61a8fd6aef6" +checksum = "f7001367fde4c768a19d1029f0a8be5abd9308e1119846d5bd9ad26297b8faf5" dependencies = [ "aes-soft", "aesni", @@ -47,43 +47,43 @@ dependencies = [ [[package]] name = "aes-gcm" -version = "0.7.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0301c9e9c443494d970a07885e8cf3e587bae8356a1d5abd0999068413f7205f" +checksum = "86f5007801316299f922a6198d1d09a0bae95786815d066d5880d13f7c45ead1" dependencies = [ "aead", "aes", "block-cipher", "ghash", - "subtle 2.3.0", + "subtle 2.2.3", ] [[package]] name = "aes-soft" -version = "0.5.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63dd91889c49327ad7ef3b500fd1109dbd3c509a03db0d4a9ce413b79f575cb6" +checksum = "4925647ee64e5056cf231608957ce7c81e12d6d6e316b9ce1404778cc1d35fa7" dependencies = [ "block-cipher", "byteorder 1.3.4", - "opaque-debug 0.3.0", + "opaque-debug 0.2.3", ] [[package]] name = "aesni" -version = "0.8.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6fe808308bb07d393e2ea47780043ec47683fcf19cf5efc8ca51c50cc8c68a" +checksum = "d050d39b0b7688b3a3254394c3e30a9d66c41dcf9b05b0e2dbdc623f6505d264" dependencies = [ "block-cipher", - "opaque-debug 0.3.0", + "opaque-debug 0.2.3", ] [[package]] name = "ahash" -version = "0.2.19" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29661b60bec623f0586702976ff4d0c9942dcb6723161c2df0eea78455cfedfb" +checksum = "6f33b5018f120946c1dcf279194f238a9f146725593ead1c08fa47ff22b0b5d3" dependencies = [ "const-random", ] @@ -96,9 +96,9 @@ checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" [[package]] name = "aho-corasick" -version = "0.7.14" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b476ce7103678b0c6d3d395dbbae31d48ff910bd28be979ba5d48c6351131d0d" +checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" dependencies = [ "memchr", ] @@ -134,9 +134,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.33" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1fd36ffbb1fb7c834eac128ea8d0e310c5aeb635548f9d58861e1308d46e71c" +checksum = "85bb70cc08ec97ca5450e6eba421deeea5f172c0fc61f78b5357b2a8e8be195f" [[package]] name = "approx" @@ -190,7 +190,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d0864d84b8e07b145449be9a8537db86bf9de5ce03b913214694643b4743502" dependencies = [ "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -209,9 +209,9 @@ dependencies = [ [[package]] name = "assert_matches" -version = "1.4.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "695579f0f2520f3774bb40461e5adb066459d4e0af4d59d20175484fb8e9edf1" +checksum = "7deb0a829ca7bcfaf5da70b073a8d128619259a7be8216a355e23f00763059e5" [[package]] name = "async-channel" @@ -230,10 +230,10 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90f47c78ea98277cb1f5e6f60ba4fc762f5eafe9f6511bc2f7dfd8b75c225650" dependencies = [ - "async-io 0.1.11", - "futures-lite 0.1.11", + "async-io 0.1.5", + "futures-lite 0.1.10", "multitask", - "parking 1.0.6", + "parking 1.0.5", "scoped-tls", "waker-fn", ] @@ -259,7 +259,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "124ac8c265e407641c3362b8f4d39cdb4e243885b71eef087be27199790f5a3a" dependencies = [ "async-executor 1.3.0", - "async-io 1.1.6", + "async-io 1.1.0", "futures-lite 1.11.2", "num_cpus", "once_cell 1.4.1", @@ -267,39 +267,42 @@ dependencies = [ [[package]] name = "async-io" -version = "0.1.11" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae22a338d28c75b53702b66f77979062cb29675db376d99e451af4fa79dedb3" +checksum = "ca8126ef9fb99355c6fd27575d691be4887b884137a5b6f48c2d961f13590c51" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "concurrent-queue", - "futures-lite 0.1.11", + "futures-lite 0.1.10", "libc", "once_cell 1.4.1", - "parking 2.0.0", - "polling 0.1.9", + "parking 1.0.5", "socket2", - "vec-arena 0.5.2", + "vec-arena 0.5.0", "wepoll-sys-stjepang", "winapi 0.3.9", ] [[package]] name = "async-io" -version = "1.1.6" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5bfd63f6fc8fd2925473a147d3f4d252c712291efdde0d7057b25146563402c" +checksum = "38628c78a34f111c5a6b98fc87dfc056cd1590b61afe748b145be4623c56d194" dependencies = [ + "cfg-if", "concurrent-queue", "fastrand", "futures-lite 1.11.2", + "libc", "log 0.4.11", - "nb-connect", "once_cell 1.4.1", "parking 2.0.0", - "polling 1.1.0", + "polling", + "socket2", "vec-arena 1.0.0", "waker-fn", + "wepoll-sys-stjepang", + "winapi 0.3.9", ] [[package]] @@ -318,10 +321,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9fa76751505e8df1c7a77762f60486f60c71bbd9b8557f4da6ad47d083732ed" dependencies = [ "async-global-executor", - "async-io 1.1.6", + "async-io 1.1.0", "async-mutex", "blocking 1.0.2", - "crossbeam-utils 0.7.2", + "crossbeam-utils", "futures-channel", "futures-core", "futures-io", @@ -356,7 +359,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df097e3f506bec0e1a24f06bb3c962c228f36671de841ff579cb99f371772634" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "rustls", "webpki", "webpki-roots 0.19.0", @@ -364,13 +367,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.41" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b246867b8b3b6ae56035f1eb1ed557c1d8eae97f0d53696138a50fa0e3a3b8c0" +checksum = "a265e3abeffdce30b2e26b7a11b222fe37c6067404001b434101457d0385eb92" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -404,21 +407,21 @@ checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" [[package]] name = "autocfg" -version = "1.0.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" [[package]] name = "backtrace" -version = "0.3.53" +version = "0.3.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707b586e0e2f247cbde68cdd2c3ce69ea7b7be43e1c5b426e37c9319c4b9838e" +checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293" dependencies = [ "addr2line", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", - "object 0.21.1", + "object 0.20.0", "rustc-demangle", ] @@ -458,7 +461,7 @@ checksum = "66c0bb6167449588ff70803f4127f0684f9063097eca5016f37eb52b92c2cf36" dependencies = [ "bitflags", "cexpr", - "cfg-if 0.1.10", + "cfg-if", "clang-sys", "clap", "env_logger", @@ -466,7 +469,7 @@ dependencies = [ "lazycell", "log 0.4.11", "peeking_take_while", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", "regex", "rustc-hash", @@ -562,7 +565,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" dependencies = [ - "block-padding 0.1.5", + "block-padding", "byte-tools", "byteorder 1.3.4", "generic-array 0.12.3", @@ -574,17 +577,16 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "block-padding 0.2.1", - "generic-array 0.14.4", + "generic-array 0.14.2", ] [[package]] name = "block-cipher" -version = "0.8.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f337a3e6da609650eb74e02bc9fac7b735049f7623ab12f2e4c719316fcc7e80" +checksum = "fa136449e765dc7faa244561ccae839c394048667929af599b5d931ebe7b7f10" dependencies = [ - "generic-array 0.14.4", + "generic-array 0.14.2", ] [[package]] @@ -596,12 +598,6 @@ dependencies = [ "byte-tools", ] -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - [[package]] name = "blocking" version = "0.4.7" @@ -610,21 +606,21 @@ checksum = "d2468ff7bf85066b4a3678fede6fe66db31846d753ff0adfbfab2c6a6e81612b" dependencies = [ "async-channel", "atomic-waker", - "futures-lite 0.1.11", + "futures-lite 0.1.10", "once_cell 1.4.1", - "parking 1.0.6", + "parking 1.0.5", "waker-fn", ] [[package]] name = "blocking" -version = "0.5.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5800d29218fea137b0880387e5948694a23c93fcdde157006966693a865c7c" +checksum = "76e94bf99b692f54c9d05f97454d3faf11134523fe5b180564a3fb6ed63bcc0a" dependencies = [ "async-channel", "atomic-waker", - "futures-lite 0.1.11", + "futures-lite 0.1.10", "once_cell 1.4.1", "waker-fn", ] @@ -651,9 +647,9 @@ checksum = "476e9cd489f9e121e02ffa6014a8ef220ecb15c05ed23fc34cca13925dc283fb" [[package]] name = "bstr" -version = "0.2.14" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473fc6b38233f9af7baa94fb5852dca389e3d95b8e21c8e3719301462c5d9faf" +checksum = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931" dependencies = [ "memchr", ] @@ -719,9 +715,9 @@ checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" [[package]] name = "cc" -version = "1.0.61" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed67cbde08356238e75fc4656be4749481eeffb09e19f320a25237d5221c985d" +checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" dependencies = [ "jobserver", ] @@ -741,48 +737,40 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - [[package]] name = "chacha20" -version = "0.5.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "244fbce0d47e97e8ef2f63b81d5e05882cb518c68531eb33194990d7b7e85845" +checksum = "086c0f07ac275808b7bf9a39f2fd013aae1498be83632814c8c4e0bd53f2dc58" dependencies = [ - "stream-cipher", + "stream-cipher 0.4.1", "zeroize", ] [[package]] name = "chacha20poly1305" -version = "0.6.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bf18d374d66df0c05cdddd528a7db98f78c28e2519b120855c4f84c5027b1f5" +checksum = "18b0c90556d8e3fec7cf18d84a2f53d27b21288f2fe481b830fadcf809e48205" dependencies = [ "aead", "chacha20", "poly1305", - "stream-cipher", + "stream-cipher 0.4.1", "zeroize", ] [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "c74d84029116787153e02106bf53e66828452a4b325cc8652b788b5967c0a0b6" dependencies = [ "js-sys", - "libc", "num-integer", "num-traits 0.2.12", "time", "wasm-bindgen", - "winapi 0.3.9", ] [[package]] @@ -798,9 +786,9 @@ dependencies = [ [[package]] name = "clap" -version = "2.33.3" +version = "2.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" dependencies = [ "ansi_term 0.11.0", "atty", @@ -870,7 +858,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8d976903543e0c48546a91908f21588a680a8c8f984df9a5d69feccb2b2a211" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "wasm-bindgen", ] @@ -886,9 +874,9 @@ dependencies = [ [[package]] name = "const-random" -version = "0.1.11" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02dc82c12dc2ee6e1ded861cf7d582b46f66f796d1b6c93fa28b911ead95da02" +checksum = "2f1af9ac737b2dd2d577701e59fd09ba34822f6f2ebdb30a7647405d9e55e16a" dependencies = [ "const-random-macro", "proc-macro-hack", @@ -896,20 +884,14 @@ dependencies = [ [[package]] name = "const-random-macro" -version = "0.1.11" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc757bbb9544aa296c2ae00c679e81f886b37e28e59097defe0cf524306f6685" +checksum = "25e4c606eb459dd29f7c57b2e0879f2b6f14ee130918c2b78ccb58a9624e6c7a" dependencies = [ - "getrandom 0.2.0", + "getrandom", "proc-macro-hack", ] -[[package]] -name = "const_fn" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2" - [[package]] name = "constant_time_eq" version = "0.1.5" @@ -934,9 +916,9 @@ checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] name = "cpuid-bool" -version = "0.1.2" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" +checksum = "6d375c433320f6c5057ae04a04376eef4d04ce2801448cf8863a78da99107be4" [[package]] name = "cranelift-bforest" @@ -1032,21 +1014,11 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" +checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils 0.8.0", + "cfg-if", ] [[package]] @@ -1055,59 +1027,34 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" dependencies = [ - "crossbeam-epoch 0.8.2", - "crossbeam-utils 0.7.2", + "crossbeam-epoch", + "crossbeam-utils", "maybe-uninit", ] -[[package]] -name = "crossbeam-deque" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-epoch 0.9.0", - "crossbeam-utils 0.8.0", -] - [[package]] name = "crossbeam-epoch" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ - "autocfg 1.0.1", - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", + "autocfg 1.0.0", + "cfg-if", + "crossbeam-utils", "lazy_static", "maybe-uninit", "memoffset", "scopeguard 1.1.0", ] -[[package]] -name = "crossbeam-epoch" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0f606a85340376eef0d6d8fec399e6d4a544d648386c6645eb6d0653b27d9f" -dependencies = [ - "cfg-if 1.0.0", - "const_fn", - "crossbeam-utils 0.8.0", - "lazy_static", - "memoffset", - "scopeguard 1.1.0", -] - [[package]] name = "crossbeam-queue" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" dependencies = [ - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", + "cfg-if", + "crossbeam-utils", "maybe-uninit", ] @@ -1117,20 +1064,8 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "autocfg 1.0.1", - "cfg-if 0.1.10", - "lazy_static", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec91540d98355f690a86367e566ecad2e9e579f230230eb7c21398372be73ea5" -dependencies = [ - "autocfg 1.0.1", - "cfg-if 1.0.0", - "const_fn", + "autocfg 1.0.0", + "cfg-if", "lazy_static", ] @@ -1156,8 +1091,8 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.4", - "subtle 2.3.0", + "generic-array 0.14.2", + "subtle 2.2.3", ] [[package]] @@ -1188,28 +1123,15 @@ dependencies = [ "byteorder 1.3.4", "digest 0.8.1", "rand_core 0.5.1", - "subtle 2.3.0", - "zeroize", -] - -[[package]] -name = "curve25519-dalek" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8492de420e9e60bc9a1d66e2dbb91825390b738a388606600663fc529b4b307" -dependencies = [ - "byteorder 1.3.4", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle 2.3.0", + "subtle 2.2.3", "zeroize", ] [[package]] name = "data-encoding" -version = "2.3.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d0e2d24e5ee3b23a01de38eefdcd978907890701f08ffffd4cb457ca4ee8d6" +checksum = "72aa14c04dfae8dd7d8a2b1cb7ca2152618cd01336dbfe704b8dcbf8d41dbd69" [[package]] name = "derive_more" @@ -1243,9 +1165,9 @@ version = "0.99.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41cb0e6161ad61ed084a36ba71fbba9e3ac5aee3606fb607fe08da6acbcf3d8c" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -1269,7 +1191,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.4", + "generic-array 0.14.2", ] [[package]] @@ -1278,7 +1200,7 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "dirs-sys", ] @@ -1334,16 +1256,16 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] name = "dyn-clone" -version = "1.0.3" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d55796afa1b20c2945ca8eabfc421839f2b766619209f1ede813cf2484f31804" +checksum = "4c53dc3a653e0f64081026e4bf048d48fec9fce90c66e8326ca7292df0ff2d82" [[package]] name = "easy-parallel" @@ -1353,32 +1275,32 @@ checksum = "1dd4afd79212583ff429b913ad6605242ed7eec277e950b1438f300748f948f4" [[package]] name = "ed25519" -version = "1.0.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c66a534cbb46ab4ea03477eae19d5c22c01da8258030280b7bd9d8433fb6ef" +checksum = "bf038a7b6fd7ef78ad3348b63f3a17550877b0e28f8d68bcc94894d1412158bc" dependencies = [ "signature", ] [[package]] name = "ed25519-dalek" -version = "1.0.1" +version = "1.0.0-pre.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +checksum = "21a8a37f4e8b35af971e6db5e3897e7a6344caa3f92f6544f88125a1f5f0035a" dependencies = [ - "curve25519-dalek 3.0.0", + "curve25519-dalek", "ed25519", "rand 0.7.3", "serde", - "sha2 0.9.1", + "sha2 0.8.2", "zeroize", ] [[package]] name = "either" -version = "1.6.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "cd56b59865bce947ac5958779cfa508f6c3b9497cc762b7e24a12d11ccde2c4f" [[package]] name = "enum_primitive" @@ -1404,9 +1326,9 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "946ee94e3dbf58fdd324f9ce245c7b238d46a66f00e86a020b71996349e46cce" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -1439,9 +1361,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.2.6" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eab5ee3df98a279d9b316b1af6ac95422127b1290317e6d18c1743c99418b01" +checksum = "b480f641ccf0faf324e20c1d3e53d81b7484c698b42ea677f6907ae4db195371" dependencies = [ "errno-dragonfly", "libc", @@ -1482,7 +1404,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e43f2f1833d64e33f15592464d6fdd70f349dda7b1a53088eb83cd94014008c5" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", ] [[package]] @@ -1511,9 +1433,9 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", "synstructure", ] @@ -1549,25 +1471,24 @@ dependencies = [ [[package]] name = "femme" -version = "2.1.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2af1a24f391a5a94d756db5092c6576aad494b88a71a5a36b20c67b63e0df034" +checksum = "7b6b21baebbed15551f2170010ca4101b9ed3fdc05822791c8bd4631840eab81" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "js-sys", "log 0.4.11", "serde", "serde_derive", - "serde_json", "wasm-bindgen", "web-sys", ] [[package]] name = "file-per-thread-logger" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fdbe0d94371f9ce939b555dd342d0686cc4c0cadbcd4b61d70af5ff97eb4126" +checksum = "8b3937f028664bd0e13df401ba49a4567ccda587420365823242977f06609ed1" dependencies = [ "env_logger", "log 0.4.11", @@ -1580,7 +1501,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8feb87a63249689640ac9c011742c33139204e3c134293d3054022276869133b" dependencies = [ "either", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 2.0.2", "log 0.4.11", "num-traits 0.2.12", @@ -1608,11 +1529,11 @@ checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" [[package]] name = "flate2" -version = "1.0.18" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da80be589a72651dcda34d8b35bcdc9b7254ad06325611074d9cc0fbb19f60ee" +checksum = "68c90b0fc46cf89d227cc78b40e494ff81287a92dd07631e5af0d06fe3cf885e" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "crc32fast", "libc", "libz-sys", @@ -1628,7 +1549,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "parity-scale-codec", ] @@ -1636,7 +1557,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-support", "frame-system", @@ -1654,7 +1575,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "chrono", "frame-benchmarking", @@ -1674,7 +1595,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-support", "frame-system", @@ -1690,7 +1611,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "12.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "parity-scale-codec", "serde", @@ -1701,7 +1622,7 @@ dependencies = [ [[package]] name = "frame-support" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "bitmask", "frame-metadata", @@ -1726,40 +1647,40 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-support-procedural-tools", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] name = "frame-support-procedural-tools" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] name = "frame-support-procedural-tools-derive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] name = "frame-system" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -1775,7 +1696,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -1789,7 +1710,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "parity-scale-codec", "sp-api", @@ -1809,9 +1730,9 @@ dependencies = [ [[package]] name = "fs_extra" -version = "1.2.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" +checksum = "5f2a4a2034423744d2cc7ca2068453168dcdb82c438419e639a26bd87839c674" [[package]] name = "fuchsia-cprng" @@ -1837,15 +1758,15 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "futures" -version = "0.1.30" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7e4c2612746b0df8fed4ce0c69156021b704c9aefa360311c04e6e9e002eed" +checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" [[package]] name = "futures" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8e3078b7b2a8a671cb7a3d17b4760e4181ea243227776ba83fd043b4ca034e" +checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613" dependencies = [ "futures-channel", "futures-core", @@ -1858,9 +1779,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a4d35f7401e948629c9c3d6638fb9bf94e0b2121e96c3b428cc4e631f3eb74" +checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" dependencies = [ "futures-core", "futures-sink", @@ -1877,9 +1798,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d674eaa0056896d5ada519900dbf97ead2e46a7b6621e8160d79e2f2e1e2784b" +checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" [[package]] name = "futures-core-preview" @@ -1893,7 +1814,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" dependencies = [ - "futures 0.1.30", + "futures 0.1.29", "num_cpus", ] @@ -1903,21 +1824,21 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdcef58a173af8148b182684c9f2d5250875adbcaff7b5794073894f9d8634a9" dependencies = [ - "futures 0.1.30", - "futures 0.3.6", + "futures 0.1.29", + "futures 0.3.5", "lazy_static", "log 0.4.11", "parking_lot 0.9.0", - "pin-project 0.4.27", + "pin-project", "serde", "serde_json", ] [[package]] name = "futures-executor" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc709ca1da6f66143b8c9bec8e6260181869893714e9b5a490b169b0414144ab" +checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314" dependencies = [ "futures-core", "futures-task", @@ -1927,21 +1848,21 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc94b64bb39543b4e432f1790b6bf18e3ee3b74653c5449f63310e9a74b123c" +checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" [[package]] name = "futures-lite" -version = "0.1.11" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97999970129b808f0ccba93211201d431fcc12d7e1ffae03a61b5cedd1a7ced2" +checksum = "bbe71459749b2e8e66fb95df721b22fa08661ad384a0c5b519e11d3893b4692a" dependencies = [ "fastrand", "futures-core", "futures-io", "memchr", - "parking 2.0.0", + "parking 1.0.5", "pin-project-lite", "waker-fn", ] @@ -1963,27 +1884,27 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f57ed14da4603b2554682e9f2ff3c65d7567b53188db96cb71538217fc64581b" +checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39" dependencies = [ "proc-macro-hack", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] name = "futures-sink" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8764258ed64ebc5d9ed185cf86a95db5cac810269c5d20ececb32e0088abbd" +checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" [[package]] name = "futures-task" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd26820a9f3637f1302da8bceba3ff33adbe53464b54ca24d4e2d4f1db30f94" +checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" dependencies = [ "once_cell 1.4.1", ] @@ -2006,11 +1927,11 @@ dependencies = [ [[package]] name = "futures-util" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a894a0acddba51a2d49a6f4263b1e64b8c579ece8af50fa86503d52cd1eea34" +checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" dependencies = [ - "futures 0.1.30", + "futures 0.1.29", "futures-channel", "futures-core", "futures-io", @@ -2018,7 +1939,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project 0.4.27", + "pin-project", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -2044,9 +1965,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce54d63f8b0c75023ed920d46fd71d0cbbb830b0ee012726b5b4f506fb6dea5b" dependencies = [ "bytes 0.5.6", - "futures 0.3.6", + "futures 0.3.5", "memchr", - "pin-project 0.4.27", + "pin-project", ] [[package]] @@ -2066,9 +1987,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.4" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +checksum = "ac746a5f3bbfdadd6106868134545e684693d54d9d44f6e9588a7d54af0bf980" dependencies = [ "typenum", "version_check", @@ -2098,27 +2019,16 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.15" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" +checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] -[[package]] -name = "getrandom" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8025cf36f917e6a52cce185b7c7177689b838b7ec138364e50cc2277a56cf4" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - [[package]] name = "ghash" version = "0.3.0" @@ -2153,9 +2063,9 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] name = "globset" -version = "0.4.6" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c152169ef1e421390738366d2f796655fec62621dabbd0fd476f905934061e4a" +checksum = "7ad1da430bd7281dde2576f44c84cc3f0f7b475e7202cd503042dff01a8c8120" dependencies = [ "aho-corasick", "bstr", @@ -2186,7 +2096,7 @@ dependencies = [ "byteorder 1.3.4", "bytes 0.4.12", "fnv", - "futures 0.1.30", + "futures 0.1.29", "http 0.1.21", "indexmap", "log 0.4.11", @@ -2197,9 +2107,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.2.6" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53" +checksum = "79b7246d7e4b979c03fa093da39cfb3617a96bbeee6310af63991668d7e843ff" dependencies = [ "bytes 0.5.6", "fnv", @@ -2208,10 +2118,10 @@ dependencies = [ "futures-util", "http 0.2.1", "indexmap", + "log 0.4.11", "slab", - "tokio 0.2.22", + "tokio 0.2.21", "tokio-util", - "tracing", ] [[package]] @@ -2245,26 +2155,20 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e6073d0ca812575946eb5f35ff68dbe519907b25c42530389ff946dc84c6ead" dependencies = [ - "ahash 0.2.19", + "ahash 0.2.18", "autocfg 0.1.7", ] [[package]] name = "hashbrown" -version = "0.8.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25" +checksum = "ab9b7860757ce258c89fd48d28b68c41713e597a7b09e793f6c6a6e2ea37c827" dependencies = [ "ahash 0.3.8", - "autocfg 1.0.1", + "autocfg 1.0.0", ] -[[package]] -name = "hashbrown" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" - [[package]] name = "heck" version = "0.3.1" @@ -2276,9 +2180,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.17" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" +checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" dependencies = [ "libc", ] @@ -2370,7 +2274,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.29", "http 0.1.21", "tokio-buf", ] @@ -2391,12 +2295,6 @@ version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" -[[package]] -name = "httpdate" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" - [[package]] name = "humantime" version = "1.3.0" @@ -2413,7 +2311,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.29", "futures-cpupool", "h2 0.1.26", "http 0.1.21", @@ -2438,25 +2336,25 @@ dependencies = [ [[package]] name = "hyper" -version = "0.13.8" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f3afcfae8af5ad0576a31e768415edb627824129e8e5a29b8bfccb2f234e835" +checksum = "a6e7655b9594024ad0ee439f3b5a7299369dc2a3f459b47c696f9ff676f9aa1f" dependencies = [ "bytes 0.5.6", "futures-channel", "futures-core", "futures-util", - "h2 0.2.6", + "h2 0.2.5", "http 0.2.1", "http-body 0.3.1", "httparse", - "httpdate", "itoa", - "pin-project 0.4.27", + "log 0.4.11", + "pin-project", "socket2", - "tokio 0.2.22", + "time", + "tokio 0.2.21", "tower-service", - "tracing", "want 0.3.0", ] @@ -2469,11 +2367,11 @@ dependencies = [ "bytes 0.5.6", "ct-logs", "futures-util", - "hyper 0.13.8", + "hyper 0.13.6", "log 0.4.11", "rustls", "rustls-native-certs", - "tokio 0.2.22", + "tokio 0.2.21", "tokio-rustls", "webpki", ] @@ -2524,9 +2422,9 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef5550a42e3740a0e71f909d4c861056a284060af885ae7aa6242820f920d9d" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -2537,32 +2435,25 @@ checksum = "e0bd112d44d9d870a6819eb505d04dd92b5e4d94bb8c304924a0872ae7016fb5" [[package]] name = "indexmap" -version = "1.6.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" +checksum = "c398b2b113b55809ceb9ee3e753fcbac793f1956663f3c36549c1346015c2afe" dependencies = [ - "autocfg 1.0.1", - "hashbrown 0.9.1", + "autocfg 1.0.0", "serde", ] [[package]] name = "instant" -version = "0.1.7" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63312a18f7ea8760cdd0a7c5aac1a619752a246b833545e3e36d1f81f7cd9e66" -dependencies = [ - "cfg-if 0.1.10", -] +checksum = "5b141fdc7836c525d4d594027d318c84161ca17aaf8113ab1f81ab93ae897485" [[package]] name = "integer-sqrt" -version = "0.1.5" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" -dependencies = [ - "num-traits 0.2.12", -] +checksum = "f65877bf7d44897a473350b1046277941cee20b263397e90869c50b6e766088b" [[package]] name = "intervalier" @@ -2570,7 +2461,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64fa110ec7b8f493f416eed552740d10e7030ad5f63b2308f82c9608ec2df275" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "futures-timer 2.0.2", ] @@ -2651,21 +2542,21 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.45" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca059e81d9486668f12d455a4ea6daa600bd408134cd17e3d3fb5a32d1f016f8" +checksum = "c4b9172132a62451e56142bff9afc91c8e4a4500aa5b847da36815b63bfda916" dependencies = [ "wasm-bindgen", ] [[package]] name = "jsonrpc-client-transports" -version = "15.1.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489b9c612e60c766f751ab40fcb43cbb55a1e10bb44a9b4307ed510ca598cbd7" +checksum = "c6f7b1cdf66312002e15682a24430728bd13036c641163c016bc53fb686a7c2d" dependencies = [ "failure", - "futures 0.1.30", + "futures 0.1.29", "jsonrpc-core", "jsonrpc-pubsub", "log 0.4.11", @@ -2676,11 +2567,11 @@ dependencies = [ [[package]] name = "jsonrpc-core" -version = "15.1.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0745a6379e3edc893c84ec203589790774e4247420033e71a76d3ab4687991fa" +checksum = "f30b12567a31d48588a65b6cf870081e6ba1d7b2ae353977cb9820d512e69c70" dependencies = [ - "futures 0.1.30", + "futures 0.1.29", "log 0.4.11", "serde", "serde_derive", @@ -2689,30 +2580,30 @@ dependencies = [ [[package]] name = "jsonrpc-core-client" -version = "15.1.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f764902d7b891344a0acb65625f32f6f7c6db006952143bd650209fbe7d94db" +checksum = "d175ca0cf77439b5495612bf216c650807d252d665b4b70ab2eebd895a88fac1" dependencies = [ "jsonrpc-client-transports", ] [[package]] name = "jsonrpc-derive" -version = "15.1.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99a847f9ec7bb52149b2786a17c9cb260d6effc6b8eeb8c16b343a487a7563a3" +checksum = "c2cc6ea7f785232d9ca8786a44e9fa698f92149dcdc1acc4aa1fc69c4993d79e" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] name = "jsonrpc-http-server" -version = "15.1.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb5c4513b7b542f42da107942b7b759f27120b5cc894729f88254b28dff44b7" +checksum = "9996b26c0c7a59626d0ed6c5ec8bf06218e62ce1474bd2849f9b9fd38a0158c0" dependencies = [ "hyper 0.12.35", "jsonrpc-core", @@ -2725,9 +2616,9 @@ dependencies = [ [[package]] name = "jsonrpc-ipc-server" -version = "15.1.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf50e53e4eea8f421a7316c5f63e395f7bc7c4e786a6dc54d76fab6ff7aa7ce7" +checksum = "b8e8f2278fb2b277175b6e21b23e7ecf30e78daff5ee301d0a2a411d9a821a0a" dependencies = [ "jsonrpc-core", "jsonrpc-server-utils", @@ -2739,9 +2630,9 @@ dependencies = [ [[package]] name = "jsonrpc-pubsub" -version = "15.1.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639558e0604013be9787ae52f798506ae42bf4220fe587bdc5625871cc8b9c77" +checksum = "f389c5cd1f3db258a99296892c21047e21ae73ff4c0e2d39650ea86fe994b4c7" dependencies = [ "jsonrpc-core", "log 0.4.11", @@ -2752,9 +2643,9 @@ dependencies = [ [[package]] name = "jsonrpc-server-utils" -version = "15.1.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72f1f3990650c033bd8f6bd46deac76d990f9bbfb5f8dc8c4767bf0a00392176" +checksum = "c623e1895d0d9110cb0ea7736cfff13191ff52335ad33b21bd5c775ea98b27af" dependencies = [ "bytes 0.4.12", "globset", @@ -2768,9 +2659,9 @@ dependencies = [ [[package]] name = "jsonrpc-ws-server" -version = "15.1.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6596fe75209b73a2a75ebe1dce4e60e03b88a2b25e8807b667597f6315150d22" +checksum = "436a92034d0137ab3e3c64a7a6350b428f31cb4d7d1a89f284bcdbcd98a7bc56" dependencies = [ "jsonrpc-core", "jsonrpc-server-utils", @@ -2924,7 +2815,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2701a1369d6ea4f1b9f606db46e5e2a4a8e47f22530a07823d653f85ab1f6c34" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "js-sys", "kvdb", "kvdb-memorydb", @@ -2943,9 +2834,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lazycell" -version = "1.3.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" [[package]] name = "leb128" @@ -2983,7 +2874,7 @@ checksum = "571f5a4604c1a40d75651da141dfde29ad15329f537a779528803297d2220274" dependencies = [ "atomic", "bytes 0.5.6", - "futures 0.3.6", + "futures 0.3.5", "lazy_static", "libp2p-core", "libp2p-core-derive", @@ -3009,7 +2900,7 @@ dependencies = [ "multihash", "parity-multiaddr", "parking_lot 0.10.2", - "pin-project 0.4.27", + "pin-project", "smallvec 1.4.2", "wasm-timer", ] @@ -3025,7 +2916,7 @@ dependencies = [ "ed25519-dalek", "either", "fnv", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "lazy_static", "libsecp256k1", @@ -3034,7 +2925,7 @@ dependencies = [ "multistream-select", "parity-multiaddr", "parking_lot 0.10.2", - "pin-project 0.4.27", + "pin-project", "prost", "prost-build", "rand 0.7.3", @@ -3055,7 +2946,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f753d9324cd3ec14bf04b8a8cd0d269c87f294153d6bf2a84497a63a5ad22213" dependencies = [ "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -3065,7 +2956,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74029ae187f35f4b8ddf26b9779a68b340045d708528a103917cdca49a296db5" dependencies = [ "flate2", - "futures 0.3.6", + "futures 0.3.5", "libp2p-core", ] @@ -3075,7 +2966,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cf319822e08dd65c8e060d2354e9f952895bbc433f5706c75ed010c152aee5e" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "libp2p-core", "log 0.4.11", ] @@ -3088,7 +2979,7 @@ checksum = "d8a9acb43a3e4a4e413e0c4abe0fa49308df7c6335c88534757b647199cb8a51" dependencies = [ "cuckoofilter", "fnv", - "futures 0.3.6", + "futures 0.3.5", "libp2p-core", "libp2p-swarm", "prost", @@ -3107,7 +2998,7 @@ dependencies = [ "byteorder 1.3.4", "bytes 0.5.6", "fnv", - "futures 0.3.6", + "futures 0.3.5", "futures_codec", "hex_fmt", "libp2p-core", @@ -3129,7 +3020,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56396ee63aa9164eacf40c2c5d2bda8c4133c2f57e1b0425d51d3a4e362583b1" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "libp2p-core", "libp2p-swarm", "log 0.4.11", @@ -3149,7 +3040,7 @@ dependencies = [ "bytes 0.5.6", "either", "fnv", - "futures 0.3.6", + "futures 0.3.5", "futures_codec", "libp2p-core", "libp2p-swarm", @@ -3176,7 +3067,7 @@ dependencies = [ "data-encoding", "dns-parser", "either", - "futures 0.3.6", + "futures 0.3.5", "lazy_static", "libp2p-core", "libp2p-swarm", @@ -3196,7 +3087,7 @@ checksum = "8a73a799cc8410b36e40b8f4c4b6babbcb9efd3727111bf517876e4acfa612d3" dependencies = [ "bytes 0.5.6", "fnv", - "futures 0.3.6", + "futures 0.3.5", "futures_codec", "libp2p-core", "log 0.4.11", @@ -3211,8 +3102,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ef6c490042f549fb1025f2892dfe6083d97a77558f450c1feebe748ca9eb15a" dependencies = [ "bytes 0.5.6", - "curve25519-dalek 2.1.0", - "futures 0.3.6", + "curve25519-dalek", + "futures 0.3.5", "lazy_static", "libp2p-core", "log 0.4.11", @@ -3222,7 +3113,7 @@ dependencies = [ "sha2 0.8.2", "snow", "static_assertions", - "x25519-dalek 0.6.0", + "x25519-dalek", "zeroize", ] @@ -3232,7 +3123,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad063c21dfcea4518ac9e8bd4119d33a5b26c41e674f602f41f05617a368a5c8" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "libp2p-core", "libp2p-swarm", "log 0.4.11", @@ -3248,7 +3139,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "903a12e99c72dbebefea258de887982adeacc7025baa1ceb10b7fa9928f54791" dependencies = [ "bytes 0.5.6", - "futures 0.3.6", + "futures 0.3.5", "futures_codec", "libp2p-core", "log 0.4.11", @@ -3261,13 +3152,13 @@ dependencies = [ [[package]] name = "libp2p-pnet" -version = "0.19.2" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b3c2d5d26a9500e959a0e19743897239a6c4be78dadf99b70414301a70c006" +checksum = "37d0db10e139d22d7af0b23ed7949449ec86262798aa0fd01595abdbcb02dc87" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "log 0.4.11", - "pin-project 0.4.27", + "pin-project", "rand 0.7.3", "salsa20", "sha3", @@ -3281,7 +3172,7 @@ checksum = "9c0c9e8a4cd69d97e9646c54313d007512f411aba8c5226cfcda16df6a6e84a3" dependencies = [ "async-trait", "bytes 0.5.6", - "futures 0.3.6", + "futures 0.3.5", "libp2p-core", "libp2p-swarm", "log 0.4.11", @@ -3300,7 +3191,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7193e444210132237b81b755ec7fe53f1c4bd2f53cf719729b94c0c72eb6eaa1" dependencies = [ "either", - "futures 0.3.6", + "futures 0.3.5", "libp2p-core", "log 0.4.11", "rand 0.7.3", @@ -3316,7 +3207,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44f42ec130d7a37a7e47bf4398026b7ad9185c08ed26972e2720f8b94112796f" dependencies = [ "async-std", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "get_if_addrs", "ipnet", @@ -3332,7 +3223,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dea7acb0a034f70d7db94c300eba3f65c0f6298820105624088a9609c9974d77" dependencies = [ "async-std", - "futures 0.3.6", + "futures 0.3.5", "libp2p-core", "log 0.4.11", ] @@ -3343,7 +3234,7 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34c1faac6f92c21fbe155417957863ea822fba9e9fd5eb24c0912336a100e63f" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "js-sys", "libp2p-core", "parity-send-wrapper", @@ -3359,7 +3250,7 @@ checksum = "d650534ebd99f48f6fa292ed5db10d30df2444943afde4407ceeddab8e513fca" dependencies = [ "async-tls", "either", - "futures 0.3.6", + "futures 0.3.5", "libp2p-core", "log 0.4.11", "quicksink", @@ -3377,7 +3268,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "781d9b9f043dcdabc40640807125368596b849fd4d96cdca2dcf052fdf6f33fd" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "libp2p-core", "parking_lot 0.11.0", "thiserror", @@ -3408,17 +3299,18 @@ dependencies = [ "hmac-drbg", "rand 0.7.3", "sha2 0.8.2", - "subtle 2.3.0", + "subtle 2.2.3", "typenum", ] [[package]] name = "libz-sys" -version = "1.1.2" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" +checksum = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" dependencies = [ "cc", + "libc", "pkg-config", "vcpkg", ] @@ -3431,9 +3323,9 @@ checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" [[package]] name = "linked_hash_set" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47186c6da4d81ca383c7c47c1bfc80f4b95f4720514d860a5407aaf4233f9588" +checksum = "3c7c91c4c7bbeb4f2f7c4e5be11e6a05bd6830bc37249c47ce1ad86ad453ff9c" dependencies = [ "linked-hash-map", ] @@ -3491,7 +3383,7 @@ version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", ] [[package]] @@ -3509,7 +3401,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "111b945ac72ec09eb7bc62a0fbdc3cc6e80555a7245f52a69d3921a75b53b153" dependencies = [ - "hashbrown 0.8.2", + "hashbrown 0.8.0", ] [[package]] @@ -3581,21 +3473,21 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.5.6" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +checksum = "c198b026e1bbf08a937e94c6c60f9ec4a2267f5b0d2eec9c1b21b061ce2be55f" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.0.0", ] [[package]] name = "memory-db" -version = "0.24.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36f36ddb0b2cdc25d38babba472108798e3477f02be5165f038c5e393e50c57a" +checksum = "0777fbb396f666701d939e9b3876c18ada6b3581257d88631f2590bc366d8ebe" dependencies = [ "hash-db", - "hashbrown 0.8.2", + "hashbrown 0.8.0", "parity-util-mem", ] @@ -3641,19 +3533,18 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c214bf3d90099b52f3e4b328ae0fe34837fd0fab683ad1e10fceb4629106df48" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] name = "miniz_oxide" -version = "0.4.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" +checksum = "be0f75932c1f6cfae3c04000e40114adf955636e19040f9c0a2c380702aa1c7f" dependencies = [ "adler", - "autocfg 1.0.1", ] [[package]] @@ -3662,7 +3553,7 @@ version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "fuchsia-zircon", "fuchsia-zircon-sys", "iovec", @@ -3740,37 +3631,37 @@ checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" [[package]] name = "multihash" -version = "0.11.4" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567122ab6492f49b59def14ecc36e13e64dca4188196dd0cd41f9f3f979f3df6" +checksum = "f75db05d738947aa5389863aadafbcf2e509d7ba099dc2ddcdf4fc66bf7a9e03" dependencies = [ "blake2b_simd", "blake2s_simd", - "digest 0.9.0", - "sha-1 0.9.1", - "sha2 0.9.1", + "digest 0.8.1", + "sha-1", + "sha2 0.8.2", "sha3", - "unsigned-varint 0.5.1", + "unsigned-varint 0.3.3", ] [[package]] name = "multimap" -version = "0.8.2" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1255076139a83bb467426e7f8d0134968a8118844faa755985e077cf31850333" +checksum = "d8883adfde9756c1d30b0f519c9b8c502a94b41ac62f696453c37c7fc0a958ce" [[package]] name = "multistream-select" -version = "0.8.4" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36a6aa6e32fbaf16795142335967214b8564a7a4661eb6dc846ef343a6e00ac1" +checksum = "c9157e87afbc2ef0d84cc0345423d715f445edde00141c93721c162de35a05e5" dependencies = [ "bytes 0.5.6", - "futures 0.3.6", + "futures 0.3.5", "log 0.4.11", - "pin-project 1.0.1", + "pin-project", "smallvec 1.4.2", - "unsigned-varint 0.5.1", + "unsigned-varint 0.4.0", ] [[package]] @@ -3810,23 +3701,13 @@ dependencies = [ "rand 0.3.23", ] -[[package]] -name = "nb-connect" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8123a81538e457d44b933a02faf885d3fe8408806b23fa700e8f01c6c3a98998" -dependencies = [ - "libc", - "winapi 0.3.9", -] - [[package]] name = "net2" -version = "0.2.35" +version = "0.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" +checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "libc", "winapi 0.3.9", ] @@ -3839,7 +3720,7 @@ checksum = "b7fd5681d13fda646462cfbd4e5f2051279a89a544d50eb98c365b507246839f" dependencies = [ "bitflags", "bytes 0.4.12", - "cfg-if 0.1.10", + "cfg-if", "gcc", "libc", "void", @@ -3853,7 +3734,7 @@ checksum = "50e4785f2c3b7589a0d0c1dd60285e1188adac4006e8abd6dd578e1567027363" dependencies = [ "bitflags", "cc", - "cfg-if 0.1.10", + "cfg-if", "libc", "void", ] @@ -3886,7 +3767,7 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.0.0", "num-integer", "num-traits 0.2.12", ] @@ -3897,7 +3778,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.0.0", "num-traits 0.2.12", ] @@ -3907,7 +3788,7 @@ version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.0.0", "num-traits 0.2.12", ] @@ -3917,7 +3798,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.0.0", "num-bigint", "num-integer", "num-traits 0.2.12", @@ -3938,7 +3819,7 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" dependencies = [ - "autocfg 1.0.1", + "autocfg 1.0.0", "libm", ] @@ -3969,12 +3850,6 @@ dependencies = [ "wasmparser 0.57.0", ] -[[package]] -name = "object" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37fd5004feb2ce328a52b0b3d01dbf4ffff72583493900ed15f22d4111c51693" - [[package]] name = "once_cell" version = "0.1.8" @@ -4029,7 +3904,7 @@ checksum = "7a1250cdd103eef6bd542b5ae82989f931fc00a41a27f60377338241594410f3" [[package]] name = "pallet-authority-discovery" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-support", "frame-system", @@ -4045,7 +3920,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-support", "frame-system", @@ -4060,7 +3935,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4085,7 +3960,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4099,7 +3974,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4115,7 +3990,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4130,7 +4005,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4145,7 +4020,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4166,7 +4041,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "enumflags2", "frame-benchmarking", @@ -4182,7 +4057,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4202,7 +4077,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4219,7 +4094,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-support", "frame-system", @@ -4233,7 +4108,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4249,7 +4124,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-support", "frame-system", @@ -4263,7 +4138,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-support", "frame-system", @@ -4278,7 +4153,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4299,7 +4174,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4315,7 +4190,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-support", "frame-system", @@ -4328,7 +4203,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "enumflags2", "frame-support", @@ -4343,7 +4218,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4358,7 +4233,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-support", "frame-system", @@ -4378,7 +4253,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4394,7 +4269,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-support", "frame-system", @@ -4408,7 +4283,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4430,18 +4305,18 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] name = "pallet-sudo" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-support", "frame-system", @@ -4455,7 +4330,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4473,7 +4348,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-support", "frame-system", @@ -4490,7 +4365,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4508,7 +4383,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-support", "parity-scale-codec", @@ -4521,7 +4396,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4536,7 +4411,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-benchmarking", "frame-support", @@ -4552,7 +4427,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "enumflags2", "frame-benchmarking", @@ -4580,9 +4455,9 @@ dependencies = [ [[package]] name = "parity-multiaddr" -version = "0.9.3" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7ad66970bbab360c97179b60906e2dc4aef1f7fca8ab4e5c5db8c97b16814a" +checksum = "2165a93382a93de55868dcbfa11e4a8f99676a9164eee6a2b4a9479ad319c257" dependencies = [ "arrayref", "bs58", @@ -4592,7 +4467,7 @@ dependencies = [ "percent-encoding 2.1.0", "serde", "static_assertions", - "unsigned-varint 0.5.1", + "unsigned-varint 0.4.0", "url 2.1.1", ] @@ -4616,9 +4491,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "198db82bb1c18fc00176004462dd809b2a6d851669550aa17af6dacd21ae0c14" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -4634,7 +4509,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e57fea504fea33f9fbb5f49f378359030e7e026a6ab849bb9e8f0787376f1bf" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.29", "libc", "log 0.4.11", "mio-named-pipes", @@ -4652,8 +4527,8 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "297ff91fa36aec49ce183484b102f6b75b46776822bd81525bfc4cc9b0dd0f5c" dependencies = [ - "cfg-if 0.1.10", - "hashbrown 0.8.2", + "cfg-if", + "hashbrown 0.8.0", "impl-trait-for-tuples", "jemallocator", "parity-util-mem-derive", @@ -4669,8 +4544,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" dependencies = [ - "proc-macro2 1.0.24", - "syn 1.0.46", + "proc-macro2 1.0.18", + "syn 1.0.33", "synstructure", ] @@ -4693,16 +4568,16 @@ dependencies = [ "mio", "mio-extras", "rand 0.7.3", - "sha-1 0.8.2", + "sha-1", "slab", "url 2.1.1", ] [[package]] name = "parking" -version = "1.0.6" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb300f271742d4a2a66c01b6b2fa0c83dfebd2e0bf11addb879a3547b4ed87c" +checksum = "50d4a6da31f8144a32532fe38fe8fb439a6842e0ec633f0037f0144c14e7f907" [[package]] name = "parking" @@ -4771,7 +4646,7 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "cloudabi 0.0.3", "libc", "redox_syscall", @@ -4786,7 +4661,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "cloudabi 0.0.3", "libc", "redox_syscall", @@ -4800,7 +4675,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "cloudabi 0.1.0", "instant", "libc", @@ -4875,49 +4750,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "0.4.27" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffbc8e94b38ea3d2d8ba92aea2983b503cd75d0888d75b86bb37970b5698e15" +checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa" dependencies = [ - "pin-project-internal 0.4.27", -] - -[[package]] -name = "pin-project" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee41d838744f60d959d7074e3afb6b35c7456d0f61cad38a24e35e6553f73841" -dependencies = [ - "pin-project-internal 1.0.1", + "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "0.4.27" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895" +checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a4ffa594b66bff340084d4081df649a7dc049ac8d7fc458d8e628bfbbb2f86" -dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] name = "pin-project-lite" -version = "0.1.11" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b" +checksum = "282adbf10f2698a7a77f8e983a74b2d18176c19a7fd32a45446139ae7b02b715" [[package]] name = "pin-utils" @@ -4927,9 +4782,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.19" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" [[package]] name = "platforms" @@ -4942,7 +4797,7 @@ name = "polkadot" version = "0.8.25" dependencies = [ "assert_cmd", - "futures 0.3.6", + "futures 0.3.5", "nix 0.17.0", "parity-util-mem", "polkadot-cli", @@ -4957,7 +4812,7 @@ dependencies = [ "assert_matches", "bitvec", "env_logger", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", "maplit", @@ -4988,7 +4843,7 @@ dependencies = [ "bitvec", "derive_more 0.99.11", "env_logger", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", @@ -5015,7 +4870,7 @@ name = "polkadot-cli" version = "0.8.25" dependencies = [ "frame-benchmarking-cli", - "futures 0.3.6", + "futures 0.3.5", "log 0.4.11", "polkadot-service", "sc-cli", @@ -5031,7 +4886,7 @@ dependencies = [ "structopt", "substrate-browser-utils", "substrate-build-script-utils", - "tokio 0.2.22", + "tokio 0.2.21", "wasm-bindgen", "wasm-bindgen-futures", ] @@ -5043,7 +4898,7 @@ dependencies = [ "assert_matches", "derive_more 0.99.11", "env_logger", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", @@ -5087,7 +4942,7 @@ version = "0.1.0" dependencies = [ "assert_matches", "async-trait", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", @@ -5109,7 +4964,7 @@ name = "polkadot-node-collation-generation" version = "0.1.0" dependencies = [ "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "log 0.4.11", "polkadot-erasure-coding", "polkadot-node-primitives", @@ -5126,7 +4981,7 @@ version = "0.1.0" dependencies = [ "assert_matches", "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "kvdb", "kvdb-memorydb", "kvdb-rocksdb", @@ -5149,7 +5004,7 @@ dependencies = [ "assert_matches", "bitvec", "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "log 0.4.11", "polkadot-erasure-coding", "polkadot-node-primitives", @@ -5175,7 +5030,7 @@ version = "0.1.0" dependencies = [ "bitvec", "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "log 0.4.11", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -5190,7 +5045,7 @@ name = "polkadot-node-core-candidate-selection" version = "0.1.0" dependencies = [ "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "log 0.4.11", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -5205,7 +5060,7 @@ version = "0.1.0" dependencies = [ "assert_matches", "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "log 0.4.11", "parity-scale-codec", "polkadot-node-primitives", @@ -5223,7 +5078,7 @@ dependencies = [ name = "polkadot-node-core-chain-api" version = "0.1.0" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "maplit", "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", @@ -5237,7 +5092,7 @@ dependencies = [ name = "polkadot-node-core-proposer" version = "0.1.0" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", @@ -5265,7 +5120,7 @@ version = "0.1.0" dependencies = [ "bitvec", "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "lazy_static", "log 0.4.11", @@ -5283,7 +5138,7 @@ dependencies = [ name = "polkadot-node-core-runtime-api" version = "0.1.0" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", @@ -5310,7 +5165,7 @@ dependencies = [ name = "polkadot-node-primitives" version = "0.1.0" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "parity-scale-codec", "polkadot-primitives", "polkadot-statement-table", @@ -5325,12 +5180,12 @@ dependencies = [ "assert_matches", "async-trait", "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", "parking_lot 0.10.2", - "pin-project 0.4.27", + "pin-project", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem-test-helpers", @@ -5348,12 +5203,12 @@ version = "0.1.0" dependencies = [ "async-trait", "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", "parking_lot 0.10.2", - "pin-project 0.4.27", + "pin-project", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", @@ -5373,12 +5228,12 @@ dependencies = [ "async-trait", "derive_more 0.99.11", "env_logger", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", "parking_lot 0.10.2", - "pin-project 0.4.27", + "pin-project", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", @@ -5402,7 +5257,7 @@ dependencies = [ "color-eyre", "eyre", "femme", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "kv-log-macro", "log 0.4.11", @@ -5421,7 +5276,7 @@ name = "polkadot-parachain" version = "0.8.25" dependencies = [ "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "log 0.4.11", "parity-scale-codec", "parking_lot 0.10.2", @@ -5442,7 +5297,7 @@ name = "polkadot-pov-distribution" version = "0.1.0" dependencies = [ "assert_matches", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", @@ -5639,7 +5494,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "futures 0.3.6", + "futures 0.3.5", "hex-literal 0.2.1", "libsecp256k1", "log 0.3.9", @@ -5686,7 +5541,7 @@ dependencies = [ "env_logger", "frame-benchmarking", "frame-system-rpc-runtime-api", - "futures 0.3.6", + "futures 0.3.5", "hex-literal 0.2.1", "kusama-runtime", "lazy_static", @@ -5748,7 +5603,7 @@ version = "0.1.0" dependencies = [ "arrayvec 0.5.1", "assert_matches", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "indexmap", "log 0.4.11", @@ -5842,7 +5697,7 @@ dependencies = [ name = "polkadot-test-runtime-client" version = "2.0.0" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "pallet-timestamp", "parity-scale-codec", "polkadot-primitives", @@ -5867,8 +5722,8 @@ version = "0.8.2" dependencies = [ "frame-benchmarking", "frame-system", - "futures 0.1.30", - "futures 0.3.6", + "futures 0.1.29", + "futures 0.3.5", "hex", "log 0.4.11", "pallet-balances", @@ -5908,7 +5763,7 @@ dependencies = [ "substrate-test-client", "substrate-test-utils", "tempfile", - "tokio 0.2.22", + "tokio 0.2.21", ] [[package]] @@ -5916,7 +5771,7 @@ name = "polkadot-validation" version = "0.8.25" dependencies = [ "derive_more 0.14.1", - "futures 0.3.6", + "futures 0.3.5", "log 0.4.11", "parity-scale-codec", "polkadot-parachain", @@ -5939,26 +5794,13 @@ dependencies = [ "substrate-prometheus-endpoint", ] -[[package]] -name = "polling" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fffa183f6bd5f1a8a3e1f60ce2f8d5621e350eed84a62d6daaa5b9d1aaf6fbd" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "log 0.4.11", - "wepoll-sys-stjepang", - "winapi 0.3.9", -] - [[package]] name = "polling" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0720e0b9ea9d52451cf29d3413ba8a9303f8815d9d9653ef70e03ff73e65566" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "libc", "log 0.4.11", "wepoll-sys-stjepang", @@ -5967,34 +5809,34 @@ dependencies = [ [[package]] name = "poly1305" -version = "0.6.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ce46de8e53ee414ca4d02bfefac75d8c12fba948b76622a40b4be34dfce980" +checksum = "d9b42192ab143ed7619bf888a7f9c6733a9a2153b218e2cd557cfdb52fbf9bb1" dependencies = [ "universal-hash", ] [[package]] name = "polyval" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5884790f1ce3553ad55fec37b5aaac5882e0e845a2612df744d6c85c9bf046c" +checksum = "d9a50142b55ab3ed0e9f68dfb3709f1d90d29da24e91033f28b96330643107dc" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "universal-hash", ] [[package]] name = "ppv-lite86" -version = "0.2.9" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" +checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" [[package]] name = "predicates" -version = "1.0.5" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96bfead12e90dccead362d62bb2c90a5f6fc4584963645bc7f71a735e0b0735a" +checksum = "347a1b6f0b21e636bc9872fb60b83b8e185f6f5516298b8238699f7f9a531030" dependencies = [ "difference", "predicates-core", @@ -6040,42 +5882,44 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "0.1.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +checksum = "e10d4b51f154c8a7fb96fd6dad097cb74b863943ec010ac94b9fd1be8861fe1e" dependencies = [ "toml", ] [[package]] name = "proc-macro-error" -version = "1.0.4" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +checksum = "fc175e9777c3116627248584e8f8b3e2987405cabe1c0adf7d1dd28f09dc7880" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", "version_check", ] [[package]] name = "proc-macro-error-attr" -version = "1.0.4" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +checksum = "3cc9795ca17eb581285ec44936da7fc2335a3f34f2ddd13118b6f4d515435c50" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", + "syn 1.0.33", + "syn-mid", "version_check", ] [[package]] name = "proc-macro-hack" -version = "0.5.18" +version = "0.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598" +checksum = "7e0456befd48169b9f13ef0f0ad46d492cf9d2dbb918bcf38e01eed4ce3ec5e4" [[package]] name = "proc-macro-nested" @@ -6094,9 +5938,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.24" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" dependencies = [ "unicode-xid 0.2.1", ] @@ -6107,7 +5951,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30d70cf4412832bcac9cffe27906f4a66e450d323525e977168c70d1b36120ae" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "fnv", "lazy_static", "parking_lot 0.11.0", @@ -6151,9 +5995,9 @@ checksum = "537aa19b95acde10a12fec4301466386f757403de4cd4e5b4fa78fb5ecb18f72" dependencies = [ "anyhow", "itertools 0.8.2", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -6209,7 +6053,7 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", ] [[package]] @@ -6279,7 +6123,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom 0.1.15", + "getrandom", "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", @@ -6328,7 +6172,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom 0.1.15", + "getrandom", ] [[package]] @@ -6431,25 +6275,25 @@ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" [[package]] name = "rayon" -version = "1.5.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" +checksum = "62f02856753d04e03e26929f820d0a0a337ebe71f849801eea335d464b349080" dependencies = [ - "autocfg 1.0.1", - "crossbeam-deque 0.8.0", + "autocfg 1.0.0", + "crossbeam-deque", "either", "rayon-core", ] [[package]] name = "rayon-core" -version = "1.9.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" +checksum = "e92e15d89083484e11353891f1af602cc661426deb9564c298b270c726973280" dependencies = [ - "crossbeam-channel", - "crossbeam-deque 0.8.0", - "crossbeam-utils 0.8.0", + "crossbeam-deque", + "crossbeam-queue", + "crossbeam-utils", "lazy_static", "num_cpus", ] @@ -6465,17 +6309,17 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.1.57" +version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" +checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" [[package]] name = "redox_users" -version = "0.3.5" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" +checksum = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" dependencies = [ - "getrandom 0.1.15", + "getrandom", "redox_syscall", "rust-argon2", ] @@ -6504,9 +6348,9 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d21b475ab879ef0e315ad99067fa25778c3b0377f57f1b00207448dac1a3144" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -6522,9 +6366,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.4.1" +version = "1.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8963b85b8ce3074fecffde43b4b0dded83ce2f367dc8d363afc56679f3ee820b" +checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" dependencies = [ "aho-corasick", "memchr", @@ -6544,9 +6388,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.20" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cab7a364d15cde1e505267766a2d3c4e22a843e1a601f0fa7564c0f82ced11c" +checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" [[package]] name = "region" @@ -6659,21 +6503,21 @@ dependencies = [ [[package]] name = "rust-argon2" -version = "0.8.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dab61250775933275e84053ac235621dfb739556d5c54a2f2e9313b7cf43a19" +checksum = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" dependencies = [ - "base64 0.12.3", + "base64 0.11.0", "blake2b_simd", "constant_time_eq", - "crossbeam-utils 0.7.2", + "crossbeam-utils", ] [[package]] name = "rustc-demangle" -version = "0.1.18" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" +checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" [[package]] name = "rustc-hash" @@ -6704,9 +6548,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.18.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d1126dcf58e93cee7d098dbda643b5f92ed724f1f6a63007c1116eed6700c81" +checksum = "cac94b333ee2aac3284c5b8a1b7fb4dd11cba88c244e3fe33cdbd047af0eb693" dependencies = [ "base64 0.12.3", "log 0.4.11", @@ -6733,8 +6577,8 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4da5fcb054c46f5a5dff833b129285a93d3f0179531735e6c866e8cc307d2020" dependencies = [ - "futures 0.3.6", - "pin-project 0.4.27", + "futures 0.3.5", + "pin-project", "static_assertions", ] @@ -6755,23 +6599,33 @@ dependencies = [ [[package]] name = "salsa20" -version = "0.6.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f47b10fa80f6969bbbd9c8e7cc998f082979d402a9e10579e2303a87955395" +checksum = "2324b0e8c3bb9a586a571fdb3136f70e7e2c748de00a78043f86e0cff91f91fe" dependencies = [ - "stream-cipher", + "byteorder 1.3.4", + "salsa20-core", + "stream-cipher 0.3.2", +] + +[[package]] +name = "salsa20-core" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fe6cc1b9f5a5867853ade63099de70f042f7679e408d1ffe52821c9248e6e69" +dependencies = [ + "stream-cipher 0.3.2", ] [[package]] name = "sc-authority-discovery" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "async-trait", "bytes 0.5.6", "derive_more 0.99.11", "either", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "libp2p", "log 0.4.11", @@ -6795,9 +6649,9 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", @@ -6819,7 +6673,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -6836,7 +6690,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -6857,18 +6711,18 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] name = "sc-cli" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "ansi_term 0.12.1", "atty", @@ -6876,7 +6730,7 @@ dependencies = [ "chrono", "derive_more 0.99.11", "fdlimit", - "futures 0.3.6", + "futures 0.3.5", "hex", "lazy_static", "libp2p", @@ -6913,7 +6767,7 @@ dependencies = [ "structopt", "substrate-prometheus-endpoint", "time", - "tokio 0.2.22", + "tokio 0.2.21", "tracing", "tracing-log", "tracing-subscriber", @@ -6922,22 +6776,22 @@ dependencies = [ [[package]] name = "sc-cli-proc-macro" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] name = "sc-client-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "derive_more 0.99.11", "fnv", - "futures 0.3.6", + "futures 0.3.5", "hash-db", "hex-literal 0.3.1", "kvdb", @@ -6970,7 +6824,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "blake2-rfc", "hash-db", @@ -7000,7 +6854,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "sc-client-api", "sp-blockchain", @@ -7011,11 +6865,11 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "derive_more 0.99.11", "fork-tree", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", "merlin", @@ -7056,10 +6910,10 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -7080,7 +6934,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "fork-tree", "parity-scale-codec", @@ -7093,9 +6947,9 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", @@ -7116,7 +6970,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "log 0.4.11", "sc-client-api", @@ -7130,7 +6984,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "derive_more 0.99.11", "lazy_static", @@ -7159,7 +7013,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "derive_more 0.99.11", "log 0.4.11", @@ -7176,7 +7030,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "log 0.4.11", "parity-scale-codec", @@ -7191,7 +7045,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "log 0.4.11", "parity-scale-codec", @@ -7209,17 +7063,17 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "derive_more 0.99.11", "finality-grandpa", "fork-tree", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", "parking_lot 0.10.2", - "pin-project 0.4.27", + "pin-project", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -7246,11 +7100,11 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "derive_more 0.99.11", "finality-grandpa", - "futures 0.3.6", + "futures 0.3.5", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -7270,10 +7124,10 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "ansi_term 0.12.1", - "futures 0.3.6", + "futures 0.3.5", "log 0.4.11", "parity-util-mem", "sc-client-api", @@ -7288,11 +7142,11 @@ dependencies = [ [[package]] name = "sc-keystore" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "async-trait", "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "futures-util", "hex", "merlin", @@ -7302,13 +7156,13 @@ dependencies = [ "sp-application-crypto", "sp-core", "sp-keystore", - "subtle 2.3.0", + "subtle 2.2.3", ] [[package]] name = "sc-light" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "hash-db", "lazy_static", @@ -7327,7 +7181,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "async-std", "async-trait", @@ -7339,7 +7193,7 @@ dependencies = [ "erased-serde", "fnv", "fork-tree", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "futures_codec", "hex", @@ -7352,7 +7206,7 @@ dependencies = [ "nohash-hasher", "parity-scale-codec", "parking_lot 0.10.2", - "pin-project 0.4.27", + "pin-project", "prost", "prost-build", "rand 0.7.3", @@ -7381,9 +7235,9 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "libp2p", "log 0.4.11", @@ -7396,13 +7250,13 @@ dependencies = [ [[package]] name = "sc-offchain" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "bytes 0.5.6", "fnv", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", - "hyper 0.13.8", + "hyper 0.13.6", "hyper-rustls", "log 0.4.11", "num_cpus", @@ -7423,9 +7277,9 @@ dependencies = [ [[package]] name = "sc-peerset" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "libp2p", "log 0.4.11", "serde_json", @@ -7436,7 +7290,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "log 0.4.11", "substrate-prometheus-endpoint", @@ -7445,9 +7299,9 @@ dependencies = [ [[package]] name = "sc-rpc" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "hash-db", "jsonrpc-core", "jsonrpc-pubsub", @@ -7478,10 +7332,10 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -7502,9 +7356,9 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "futures 0.1.30", + "futures 0.1.29", "jsonrpc-core", "jsonrpc-http-server", "jsonrpc-ipc-server", @@ -7520,13 +7374,13 @@ dependencies = [ [[package]] name = "sc-service" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "derive_more 0.99.11", "directories", "exit-future", - "futures 0.1.30", - "futures 0.3.6", + "futures 0.1.29", + "futures 0.3.5", "futures-timer 3.0.2", "hash-db", "jsonrpc-core", @@ -7536,7 +7390,7 @@ dependencies = [ "parity-scale-codec", "parity-util-mem", "parking_lot 0.10.2", - "pin-project 0.4.27", + "pin-project", "rand 0.7.3", "sc-block-builder", "sc-chain-spec", @@ -7584,7 +7438,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "log 0.4.11", "parity-scale-codec", @@ -7598,7 +7452,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -7617,14 +7471,14 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "libp2p", "log 0.4.11", "parking_lot 0.10.2", - "pin-project 0.4.27", + "pin-project", "rand 0.7.3", "serde", "slog", @@ -7638,7 +7492,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "erased-serde", "log 0.4.11", @@ -7657,10 +7511,10 @@ dependencies = [ [[package]] name = "sc-transaction-graph" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "linked-hash-map", "log 0.4.11", "parity-util-mem", @@ -7678,10 +7532,10 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "futures-diagnose", "intervalier", "log 0.4.11", @@ -7719,13 +7573,13 @@ checksum = "021b403afe70d81eea68f6ea12f6b3c9588e5d536a94c3bf80f15e7faa267862" dependencies = [ "arrayref", "arrayvec 0.5.1", - "curve25519-dalek 2.1.0", - "getrandom 0.1.15", + "curve25519-dalek", + "getrandom", "merlin", "rand 0.7.3", "rand_core 0.5.1", "sha2 0.8.2", - "subtle 2.3.0", + "subtle 2.2.3", "zeroize", ] @@ -7749,22 +7603,22 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "scroll" -version = "0.10.2" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec" +checksum = "abb2332cb595d33f7edd5700f4cbf94892e680c7f0ae56adab58a35190b66cb1" dependencies = [ "scroll_derive", ] [[package]] name = "scroll_derive" -version = "0.10.3" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dfde5d1531034db129e95c76ac857e2baecea3443579d493d02224950b0fb6d" +checksum = "e367622f934864ffa1c704ba2b82280aab856e3d8213c84c5720257eb34b15b9" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -7824,6 +7678,12 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +[[package]] +name = "send_wrapper" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0eddf2e8f50ced781f288c19f18621fa72a3779e3cb58dbf23b07469b0abeb4" + [[package]] name = "send_wrapper" version = "0.3.0" @@ -7838,22 +7698,22 @@ checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" [[package]] name = "serde" -version = "1.0.117" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a" +checksum = "5317f7588f0a5078ee60ef675ef96735a1442132dc645eb1d12c018620ed8cd3" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.117" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e" +checksum = "2a0be94b04690fbaed37cddffc5c134bf537c8e3329d53e982fe04c374978f8e" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -7879,19 +7739,6 @@ dependencies = [ "opaque-debug 0.2.3", ] -[[package]] -name = "sha-1" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170a36ea86c864a3f16dd2687712dd6646f7019f301e57537c7f4dc9f5916770" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if 0.1.10", - "cpuid-bool", - "digest 0.9.0", - "opaque-debug 0.3.0", -] - [[package]] name = "sha2" version = "0.8.2" @@ -7911,7 +7758,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2933378ddfeda7ea26f48c555bdad8bb446bf8a3d17832dc83e380d444cfb8c1" dependencies = [ "block-buffer 0.9.0", - "cfg-if 0.1.10", + "cfg-if", "cpuid-bool", "digest 0.9.0", "opaque-debug 0.3.0", @@ -7919,14 +7766,15 @@ dependencies = [ [[package]] name = "sha3" -version = "0.9.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +checksum = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", + "block-buffer 0.7.3", + "byte-tools", + "digest 0.8.1", "keccak", - "opaque-debug 0.3.0", + "opaque-debug 0.2.3", ] [[package]] @@ -7944,7 +7792,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf3ab0cdff84d6c66fc9e268010ea6508e58ee942575afb66f2cf194bb218bb4" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "enum_primitive", "libc", "log 0.4.11", @@ -7976,9 +7824,9 @@ checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" [[package]] name = "signal-hook-registry" -version = "1.2.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035" +checksum = "94f478ede9f64724c5d173d7bb56099ec3e2d9fc2774aac65d34b8b890405f41" dependencies = [ "arc-swap", "libc", @@ -7986,9 +7834,9 @@ dependencies = [ [[package]] name = "signature" -version = "1.2.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29f060a7d147e33490ec10da418795238fd7545bba241504d6b31a409f2e6210" +checksum = "65211b7b6fc3f14ff9fc7a2011a434e3e6880585bd2e9e9396315ae24cbf7852" [[package]] name = "slab" @@ -8035,9 +7883,9 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a945ec7f7ce853e89ffa36be1e27dce9a43e82ff9093bf3461c30d5da74ed11b" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -8084,11 +7932,11 @@ checksum = "67583f4ccc13bbb105a0752058d8ad66c47753d85445952809bcaca891954f83" dependencies = [ "async-channel", "async-executor 0.1.2", - "async-io 0.1.11", - "blocking 0.5.2", - "cfg-if 0.1.10", + "async-io 0.1.5", + "blocking 0.5.0", + "cfg-if", "easy-parallel", - "futures-lite 0.1.11", + "futures-lite 0.1.10", "num_cpus", ] @@ -8098,15 +7946,15 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "024818c1f00b80e8171ddcfcee33860134293aa3aced60c9cbd7a5a2d41db392" dependencies = [ - "pin-project 0.4.27", + "pin-project", "smol 0.1.18", ] [[package]] name = "snow" -version = "0.7.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795dd7aeeee24468e5a32661f6d27f7b5cbed802031b2d7640c7b10f8fb2dd50" +checksum = "32bf8474159a95551661246cda4976e89356999e3cbfef36f493dacc3fae1e8e" dependencies = [ "aes-gcm", "blake2", @@ -8116,17 +7964,17 @@ dependencies = [ "ring", "rustc_version", "sha2 0.9.1", - "subtle 2.3.0", - "x25519-dalek 1.1.0", + "subtle 2.2.3", + "x25519-dalek", ] [[package]] name = "socket2" -version = "0.3.15" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1fa70dc5c8104ec096f4fe7ede7a221d35ae13dcd19ba1ad9a81d2cab9a1c44" +checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "libc", "redox_syscall", "winapi 0.3.9", @@ -8134,24 +7982,24 @@ dependencies = [ [[package]] name = "soketto" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5c71ed3d54db0a699f4948e1bb3e45b450fa31fe602621dee6680361d569c88" +checksum = "85457366ae0c6ce56bf05a958aef14cd38513c236568618edbcd9a8c52cb80b0" dependencies = [ "base64 0.12.3", "bytes 0.5.6", "flate2", - "futures 0.3.6", + "futures 0.3.5", "httparse", "log 0.4.11", "rand 0.7.3", - "sha-1 0.9.1", + "sha-1", ] [[package]] name = "sp-allocator" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "derive_more 0.99.11", "log 0.4.11", @@ -8163,7 +8011,7 @@ dependencies = [ [[package]] name = "sp-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "hash-db", "parity-scale-codec", @@ -8178,19 +8026,19 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "blake2-rfc", "proc-macro-crate", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] name = "sp-application-crypto" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "parity-scale-codec", "serde", @@ -8202,7 +8050,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "integer-sqrt", "num-traits 0.2.12", @@ -8215,7 +8063,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "parity-scale-codec", "sp-api", @@ -8227,7 +8075,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "parity-scale-codec", "sp-inherents", @@ -8238,7 +8086,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "parity-scale-codec", "sp-api", @@ -8250,7 +8098,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "derive_more 0.99.11", "log 0.4.11", @@ -8267,7 +8115,7 @@ dependencies = [ [[package]] name = "sp-chain-spec" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "serde", "serde_json", @@ -8276,10 +8124,10 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "futures-timer 3.0.2", "libp2p", "log 0.4.11", @@ -8302,7 +8150,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "merlin", "parity-scale-codec", @@ -8322,7 +8170,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -8331,7 +8179,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -8343,14 +8191,14 @@ dependencies = [ [[package]] name = "sp-core" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "base58", "blake2-rfc", "byteorder 1.3.4", "dyn-clonable", "ed25519-dalek", - "futures 0.3.6", + "futures 0.3.5", "hash-db", "hash256-std-hasher", "hex", @@ -8386,7 +8234,7 @@ dependencies = [ [[package]] name = "sp-database" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "kvdb", "parking_lot 0.10.2", @@ -8395,17 +8243,17 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] name = "sp-externalities" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "environmental", "parity-scale-codec", @@ -8416,7 +8264,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "finality-grandpa", "log 0.4.11", @@ -8433,7 +8281,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "derive_more 0.99.11", "parity-scale-codec", @@ -8445,9 +8293,9 @@ dependencies = [ [[package]] name = "sp-io" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "hash-db", "libsecp256k1", "log 0.4.11", @@ -8469,7 +8317,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "lazy_static", "sp-core", @@ -8480,11 +8328,11 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "async-trait", "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "merlin", "parity-scale-codec", "parking_lot 0.10.2", @@ -8496,7 +8344,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "parity-scale-codec", "serde", @@ -8508,18 +8356,18 @@ dependencies = [ [[package]] name = "sp-npos-elections-compact" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] name = "sp-offchain" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "sp-api", "sp-core", @@ -8529,7 +8377,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "backtrace", "log 0.4.11", @@ -8538,7 +8386,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "serde", "sp-core", @@ -8547,7 +8395,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "either", "hash256-std-hasher", @@ -8569,7 +8417,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "parity-scale-codec", "primitive-types", @@ -8585,19 +8433,19 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "Inflector", "proc-macro-crate", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] name = "sp-serializer" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "serde", "serde_json", @@ -8606,7 +8454,7 @@ dependencies = [ [[package]] name = "sp-session" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "parity-scale-codec", "sp-api", @@ -8619,7 +8467,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -8629,7 +8477,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "hash-db", "log 0.4.11", @@ -8650,12 +8498,12 @@ dependencies = [ [[package]] name = "sp-std" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" [[package]] name = "sp-storage" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8668,7 +8516,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "log 0.4.11", "sp-core", @@ -8681,7 +8529,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -8695,7 +8543,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "log 0.4.11", "parity-scale-codec", @@ -8708,10 +8556,10 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "derive_more 0.99.11", - "futures 0.3.6", + "futures 0.3.5", "log 0.4.11", "parity-scale-codec", "serde", @@ -8723,7 +8571,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "hash-db", "memory-db", @@ -8737,9 +8585,9 @@ dependencies = [ [[package]] name = "sp-utils" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "futures-core", "futures-timer 3.0.2", "lazy_static", @@ -8749,7 +8597,7 @@ dependencies = [ [[package]] name = "sp-version" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8761,7 +8609,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -8777,9 +8625,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "stable_deref_trait" -version = "1.2.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" [[package]] name = "static_assertions" @@ -8798,12 +8646,20 @@ dependencies = [ [[package]] name = "stream-cipher" -version = "0.7.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c80e15f898d8d8f25db24c253ea615cc14acf418ff307822995814e7d42cfa89" +checksum = "8131256a5896cabcf5eb04f4d6dacbe1aefda854b0d9896e09cb58829ec5638c" dependencies = [ - "block-cipher", - "generic-array 0.14.4", + "generic-array 0.12.3", +] + +[[package]] +name = "stream-cipher" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f8ed9974042b8c3672ff3030a69fcc03b74c47c3d1ecb7755e8a3626011e88" +dependencies = [ + "generic-array 0.14.2", ] [[package]] @@ -8835,9 +8691,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "structopt" -version = "0.3.20" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126d630294ec449fae0b16f964e35bf3c74f940da9dca17ee9b905f7b3112eb8" +checksum = "de2f5e239ee807089b62adce73e48c625e0ed80df02c7ab3f068f5db5281065c" dependencies = [ "clap", "lazy_static", @@ -8846,15 +8702,15 @@ dependencies = [ [[package]] name = "structopt-derive" -version = "0.4.13" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e51c492f9e23a220534971ff5afc14037289de430e3c83f9daf6a1b6ae91e8" +checksum = "510413f9de616762a4fbeab62509bf15c729603b72d7cd71280fbca431b1c118" dependencies = [ "heck", "proc-macro-error", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -8873,9 +8729,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0054a7df764039a6cd8592b9de84be4bec368ff081d203a7d5371cbfa8e65c81" dependencies = [ "heck", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -8894,13 +8750,13 @@ dependencies = [ [[package]] name = "substrate-browser-utils" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "chrono", "console_error_panic_hook", "console_log", - "futures 0.1.30", - "futures 0.3.6", + "futures 0.1.29", + "futures 0.3.5", "futures-timer 3.0.2", "js-sys", "kvdb-web", @@ -8920,7 +8776,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "platforms", ] @@ -8928,10 +8784,10 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "frame-system-rpc-runtime-api", - "futures 0.3.6", + "futures 0.3.5", "jsonrpc-core", "jsonrpc-core-client", "jsonrpc-derive", @@ -8951,24 +8807,24 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "async-std", "derive_more 0.99.11", "futures-util", - "hyper 0.13.8", + "hyper 0.13.6", "log 0.4.11", "prometheus", - "tokio 0.2.22", + "tokio 0.2.21", ] [[package]] name = "substrate-test-client" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "futures 0.1.30", - "futures 0.3.6", + "futures 0.1.29", + "futures 0.3.5", "hash-db", "hex", "parity-scale-codec", @@ -8992,21 +8848,21 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "substrate-test-utils-derive", - "tokio 0.2.22", + "tokio 0.2.21", ] [[package]] name = "substrate-test-utils-derive" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#27515376d0c500fad9ee4f803c126d9de1088942" +source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "proc-macro-crate", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -9023,9 +8879,9 @@ checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" [[package]] name = "subtle" -version = "2.3.0" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343f3f510c2915908f155e94f17220b19ccfacf2a64a2a5d8004f2c3e311e7fd" +checksum = "502d53007c02d7605a05df1c1a73ee436952781653da5d0bf57ad608f66932c1" [[package]] name = "syn" @@ -9040,24 +8896,35 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.46" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad5de3220ea04da322618ded2c42233d02baca219d6f160a3e9c87cda16c942" +checksum = "e8d5d96e8cbb005d6959f119f773bfaebb5684296108fb32600c00cde305b2cd" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", "unicode-xid 0.2.1", ] +[[package]] +name = "syn-mid" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a" +dependencies = [ + "proc-macro2 1.0.18", + "quote 1.0.7", + "syn 1.0.33", +] + [[package]] name = "synstructure" version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", "unicode-xid 0.2.1", ] @@ -9079,7 +8946,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "libc", "rand 0.7.3", "redox_syscall", @@ -9163,9 +9030,9 @@ version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cae2447b6282786c3493999f40a9be2a6ad20cb8bd268b0a0dbf5a065535c0ab" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -9188,12 +9055,11 @@ dependencies = [ [[package]] name = "time" -version = "0.1.44" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ "libc", - "wasi 0.10.0+wasi-snapshot-preview1", "winapi 0.3.9", ] @@ -9233,9 +9099,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "0.3.4" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" +checksum = "53953d2d3a5ad81d9f844a32f14ebb121f50b650cd59d0ee2a07cf13c617efed" [[package]] name = "tokio" @@ -9244,7 +9110,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.29", "mio", "num_cpus", "tokio-codec", @@ -9263,9 +9129,9 @@ dependencies = [ [[package]] name = "tokio" -version = "0.2.22" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" +checksum = "d099fa27b9702bed751524694adbe393e18b36b204da91eb1cbbbbb4a5ee2d58" dependencies = [ "bytes 0.5.6", "fnv", @@ -9292,7 +9158,7 @@ checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" dependencies = [ "bytes 0.4.12", "either", - "futures 0.1.30", + "futures 0.1.29", ] [[package]] @@ -9302,7 +9168,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.29", "tokio-io", ] @@ -9312,7 +9178,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" dependencies = [ - "futures 0.1.30", + "futures 0.1.29", "tokio-executor 0.1.10", ] @@ -9322,8 +9188,8 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" dependencies = [ - "crossbeam-utils 0.7.2", - "futures 0.1.30", + "crossbeam-utils", + "futures 0.1.29", ] [[package]] @@ -9343,7 +9209,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" dependencies = [ - "futures 0.1.30", + "futures 0.1.29", "tokio-io", "tokio-threadpool", ] @@ -9355,7 +9221,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.29", "log 0.4.11", ] @@ -9365,9 +9231,9 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -9377,7 +9243,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d282d483052288b2308ba5ee795f5673b159c9bdf63c385a05609da782a5eae" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.29", "mio", "mio-named-pipes", "tokio 0.1.22", @@ -9389,8 +9255,8 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" dependencies = [ - "crossbeam-utils 0.7.2", - "futures 0.1.30", + "crossbeam-utils", + "futures 0.1.29", "lazy_static", "log 0.4.11", "mio", @@ -9404,13 +9270,13 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.14.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12831b255bcfa39dc0436b01e19fea231a37db570686c06ee72c423479f889a" +checksum = "228139ddd4fea3fa345a29233009635235833e52807af7ea6448ead03890d6a9" dependencies = [ "futures-core", "rustls", - "tokio 0.2.22", + "tokio 0.2.21", "webpki", ] @@ -9420,7 +9286,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" dependencies = [ - "futures 0.1.30", + "futures 0.1.29", ] [[package]] @@ -9430,7 +9296,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" dependencies = [ "fnv", - "futures 0.1.30", + "futures 0.1.29", ] [[package]] @@ -9451,7 +9317,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.29", "iovec", "mio", "tokio-io", @@ -9464,10 +9330,10 @@ version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" dependencies = [ - "crossbeam-deque 0.7.3", + "crossbeam-deque", "crossbeam-queue", - "crossbeam-utils 0.7.2", - "futures 0.1.30", + "crossbeam-utils", + "futures 0.1.29", "lazy_static", "log 0.4.11", "num_cpus", @@ -9481,8 +9347,8 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" dependencies = [ - "crossbeam-utils 0.7.2", - "futures 0.1.30", + "crossbeam-utils", + "futures 0.1.29", "slab", "tokio-executor 0.1.10", ] @@ -9494,7 +9360,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.29", "log 0.4.11", "mio", "tokio-codec", @@ -9509,7 +9375,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0" dependencies = [ "bytes 0.4.12", - "futures 0.1.30", + "futures 0.1.29", "iovec", "libc", "log 0.4.11", @@ -9531,14 +9397,14 @@ dependencies = [ "futures-sink", "log 0.4.11", "pin-project-lite", - "tokio 0.2.22", + "tokio 0.2.21", ] [[package]] name = "toml" -version = "0.5.7" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cf45bb0bef80604d001caaec0d09da99611b3c0fd39d3080468875cdb65645" +checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" dependencies = [ "serde", ] @@ -9555,8 +9421,7 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0987850db3733619253fe60e17cb59b82d37c7e6c0236bb81e4d6b87c879f27" dependencies = [ - "cfg-if 0.1.10", - "log 0.4.11", + "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -9568,9 +9433,9 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80e0ccfc3378da0cce270c946b676a376943f5cd16aeba64568e7939806f4ada" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", ] [[package]] @@ -9598,7 +9463,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab7bb6f14721aa00656086e9335d363c5c8747bae02ebe32ea2c7dece5689b4c" dependencies = [ - "pin-project 0.4.27", + "pin-project", "tracing", ] @@ -9653,12 +9518,12 @@ checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" [[package]] name = "trie-db" -version = "0.22.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e55f7ace33d6237e14137e386f4e1672e2a5c6bbc97fef9f438581a143971f0" +checksum = "39f1a9a9252d38c5337cf0c5392988821a5cf1b2103245016968f2ab41de9e38" dependencies = [ "hash-db", - "hashbrown 0.8.2", + "hashbrown 0.8.0", "log 0.4.11", "rustc-hex", "smallvec 1.4.2", @@ -9675,19 +9540,17 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" [[package]] name = "twox-hash" -version = "1.6.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" +checksum = "3bfd5b7557925ce778ff9b9ef90e3ade34c524b5ff10e239c69a42d546d2af56" dependencies = [ - "cfg-if 0.1.10", "rand 0.7.3", - "static_assertions", ] [[package]] @@ -9698,9 +9561,9 @@ checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" [[package]] name = "uint" -version = "0.8.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9db035e67dfaf7edd9aebfe8676afcd63eed53c8a4044fed514c8cccf1835177" +checksum = "173cd16430c206dc1a430af8a89a0e9c076cf15cb42b4aedb10e8cc8fee73681" dependencies = [ "byteorder 1.3.4", "crunchy", @@ -9765,10 +9628,16 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" dependencies = [ - "generic-array 0.14.4", - "subtle 2.3.0", + "generic-array 0.14.2", + "subtle 2.2.3", ] +[[package]] +name = "unsigned-varint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f67332660eb59a6f1eb24ff1220c9e8d01738a8503c6002e30bcfe4bd9f2b4a9" + [[package]] name = "unsigned-varint" version = "0.4.0" @@ -9827,9 +9696,9 @@ checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" [[package]] name = "vec-arena" -version = "0.5.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cb18268690309760d59ee1a9b21132c126ba384f374c59a94db4bc03adeb561" +checksum = "17dfb54bf57c9043f4616cb03dab30eff012cc26631b797d8354b916708db919" [[package]] name = "vec-arena" @@ -9866,9 +9735,9 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "9571542c2ce85ce642e6b58b3364da2fb53526360dfb7c211add4f5c23105ff7" [[package]] name = "want" @@ -9876,7 +9745,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" dependencies = [ - "futures 0.1.30", + "futures 0.1.29", "log 0.4.11", "try-lock", ] @@ -9897,19 +9766,13 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasm-bindgen" -version = "0.2.68" +version = "0.2.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42" +checksum = "6a634620115e4a229108b71bde263bb4220c483b3f07f5ba514ee8d15064c4c2" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "serde", "serde_json", "wasm-bindgen-macro", @@ -9917,26 +9780,26 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.68" +version = "0.2.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f22b422e2a757c35a73774860af8e112bff612ce6cb604224e8e47641a9e4f68" +checksum = "3e53963b583d18a5aa3aaae4b4c1cb535218246131ba22a71f05b518098571df" dependencies = [ "bumpalo", "lazy_static", "log 0.4.11", - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.18" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7866cab0aa01de1edf8b5d7936938a7e397ee50ce24119aef3e1eaa3b6171da" +checksum = "dba48d66049d2a6cc8488702e7259ab7afc9043ad0dc5448444f46f2a453b362" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -9944,9 +9807,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.68" +version = "0.2.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b13312a745c08c469f0b292dd2fcd6411dba5f7160f593da6ef69b64e407038" +checksum = "3fcfd5ef6eec85623b4c6e844293d4516470d8f19cd72d0d12246017eb9060b8" dependencies = [ "quote 1.0.7", "wasm-bindgen-macro-support", @@ -9954,33 +9817,34 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.68" +version = "0.2.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe" +checksum = "9adff9ee0e94b926ca81b57f57f86d5545cdcb1d259e21ec9bdd95b901754c75" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.68" +version = "0.2.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d649a3145108d7d3fbcde896a468d1bd636791823c9921135218ad89be08307" +checksum = "7f7b90ea6c632dd06fd765d44542e234d5e63d9bb917ecd64d79778a13bd79ae" [[package]] name = "wasm-timer" -version = "0.2.5" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +checksum = "324c5e65a08699c9c4334ba136597ab22b85dccd4b65dd1e36ccf8f723a95b54" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "js-sys", - "parking_lot 0.11.0", + "parking_lot 0.9.0", "pin-utils", + "send_wrapper 0.2.0", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -10029,7 +9893,7 @@ checksum = "1cd3c4f449382779ef6e0a7c3ec6752ae614e20a42e4100000c3efdc973100e2" dependencies = [ "anyhow", "backtrace", - "cfg-if 0.1.10", + "cfg-if", "lazy_static", "libc", "log 0.4.11", @@ -10071,7 +9935,7 @@ dependencies = [ "anyhow", "base64 0.12.3", "bincode", - "cfg-if 0.1.10", + "cfg-if", "cranelift-codegen", "cranelift-entity", "cranelift-frontend", @@ -10100,7 +9964,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e914c013c7a9f15f4e429d5431f2830fb8adb56e40567661b69c5ec1d645be23" dependencies = [ "anyhow", - "cfg-if 0.1.10", + "cfg-if", "cranelift-codegen", "cranelift-entity", "cranelift-frontend", @@ -10143,7 +10007,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e8d4d1af8dd5f7096cfcc89dd668d358e52980c38cce199643372ffd6590e27" dependencies = [ "anyhow", - "cfg-if 0.1.10", + "cfg-if", "gimli 0.21.0", "lazy_static", "libc", @@ -10163,7 +10027,7 @@ checksum = "3a25f140bbbaadb07c531cba99ce1a966dba216138dc1b2a0ddecec851a01a93" dependencies = [ "backtrace", "cc", - "cfg-if 0.1.10", + "cfg-if", "indexmap", "lazy_static", "libc", @@ -10178,27 +10042,27 @@ dependencies = [ [[package]] name = "wast" -version = "26.0.1" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3f174eed73e885ede6c8fcc3fbea8c3757afa521840676496cde56bb742ddab" +checksum = "0b1844f66a2bc8526d71690104c0e78a8e59ffa1597b7245769d174ebb91deb5" dependencies = [ "leb128", ] [[package]] name = "wat" -version = "1.0.27" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b2dccbce4d0e14875091846e110a2369267b18ddd0d6423479b88dad914d71" +checksum = "ce85d72b74242c340e9e3492cfb602652d7bb324c3172dd441b5577e39a2e18c" dependencies = [ "wast", ] [[package]] name = "web-sys" -version = "0.3.45" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf6ef87ad7ae8008e15a355ce696bed26012b7caa21605188cfd8214ab51e2d" +checksum = "863539788676619aac1a23e2df3655e96b32b0e05eb72ca34ba045ad573c625d" dependencies = [ "js-sys", "wasm-bindgen", @@ -10234,9 +10098,9 @@ dependencies = [ [[package]] name = "wepoll-sys-stjepang" -version = "1.0.8" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fdfbb03f290ca0b27922e8d48a0997b4ceea12df33269b9f75e713311eb178d" +checksum = "6fd319e971980166b53e17b1026812ad66c6b54063be879eb182342b55284694" dependencies = [ "cc", ] @@ -10385,18 +10249,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "637ff90c9540fa3073bb577e65033069e4bae7c79d49d74aa3ffdf5342a53217" dependencies = [ - "curve25519-dalek 2.1.0", - "rand_core 0.5.1", - "zeroize", -] - -[[package]] -name = "x25519-dalek" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc614d95359fd7afc321b66d2107ede58b246b844cf5d8a0adcca413e439f088" -dependencies = [ - "curve25519-dalek 3.0.0", + "curve25519-dalek", "rand_core 0.5.1", "zeroize", ] @@ -10444,7 +10297,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aeb8c4043cac71c3c299dff107171c220d179492350ea198e109a414981b83c" dependencies = [ - "futures 0.3.6", + "futures 0.3.5", "log 0.4.11", "nohash-hasher", "parking_lot 0.11.0", @@ -10454,22 +10307,22 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.1.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f33972566adbd2d3588b0491eb94b98b43695c4ef897903470ede4f3f5a28a" +checksum = "3cbac2ed2ba24cc90f5e06485ac8c7c1e5449fe8911aef4d8877218af021a5b8" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.0.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3f369ddb18862aba61aa49bf31e74d29f0f162dec753063200e1dc084345d16" +checksum = "de251eec69fc7c1bc3923403d18ececb929380e016afe103da75f396704f8ca2" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.18", "quote 1.0.7", - "syn 1.0.46", + "syn 1.0.33", "synstructure", ] From a46f907b6f8935e3f477666558062574d3805814 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Fri, 23 Oct 2020 13:26:50 +0200 Subject: [PATCH 12/62] Update node/subsystem/src/lib.rs Co-authored-by: Andronik Ordian --- node/subsystem/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/subsystem/src/lib.rs b/node/subsystem/src/lib.rs index 126ff3a1f6e5..867ea568d87a 100644 --- a/node/subsystem/src/lib.rs +++ b/node/subsystem/src/lib.rs @@ -148,7 +148,7 @@ pub enum SubsystemError { impl SubsystemError { /// Adds a `str` as `origin` to the given error `err`. - pub fn with_origin(origin: &'static str, err: E) -> Self { + pub fn with_origin(origin: &'static str, err: E) -> Self { Self::FromOrigin{ origin, source: Box::new(err) } } } From d139597318f84e7c88863fc78de4109f8d270ec2 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Fri, 23 Oct 2020 13:27:01 +0200 Subject: [PATCH 13/62] Update node/subsystem/src/errors.rs Co-authored-by: Andronik Ordian --- node/subsystem/src/errors.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/subsystem/src/errors.rs b/node/subsystem/src/errors.rs index 76aedd5a7fd8..5af573c87fc1 100644 --- a/node/subsystem/src/errors.rs +++ b/node/subsystem/src/errors.rs @@ -58,4 +58,4 @@ impl core::fmt::Display for ChainApiError { } } -impl std::error::Error for ChainApiError {} \ No newline at end of file +impl std::error::Error for ChainApiError {} From 73c17e7c966fdbf6b5f30f16affeba942276a127 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Fri, 23 Oct 2020 13:27:15 +0200 Subject: [PATCH 14/62] Update node/overseer/src/lib.rs Co-authored-by: Andronik Ordian --- node/overseer/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/node/overseer/src/lib.rs b/node/overseer/src/lib.rs index 47924efc93fb..a420dd8481cd 100644 --- a/node/overseer/src/lib.rs +++ b/node/overseer/src/lib.rs @@ -305,7 +305,6 @@ impl SubsystemContext for OverseerSubsystemContext { } async fn recv(&mut self) -> SubsystemResult> { - // XXX TODO `eyre::eyre!("No more messages in rx queue to process")` self.rx.next().await.ok_or(SubsystemError::Context("No more messages in rx queue to process".to_owned())) } From c7f8f9e9ccbe28e4196d651319582fa3f1b8cfad Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Fri, 23 Oct 2020 13:27:30 +0200 Subject: [PATCH 15/62] Update node/overseer/Cargo.toml Co-authored-by: Andronik Ordian --- node/overseer/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/node/overseer/Cargo.toml b/node/overseer/Cargo.toml index e2f0e359e768..a05af75765a6 100644 --- a/node/overseer/Cargo.toml +++ b/node/overseer/Cargo.toml @@ -15,7 +15,6 @@ polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../subsystem polkadot-node-subsystem-util = { path = "../subsystem-util" } polkadot-node-primitives = { package = "polkadot-node-primitives", path = "../primitives" } async-trait = "0.1" -eyre = "0.6.1" color-eyre = "0.5.6" [dev-dependencies] From f1844c8225ba98c65035516ddfed56b32f660022 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Fri, 23 Oct 2020 13:28:45 +0200 Subject: [PATCH 16/62] Update node/subsystem/src/lib.rs Co-authored-by: Andronik Ordian --- node/subsystem/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/subsystem/src/lib.rs b/node/subsystem/src/lib.rs index 867ea568d87a..99f7b2c3cc90 100644 --- a/node/subsystem/src/lib.rs +++ b/node/subsystem/src/lib.rs @@ -149,7 +149,7 @@ pub enum SubsystemError { impl SubsystemError { /// Adds a `str` as `origin` to the given error `err`. pub fn with_origin(origin: &'static str, err: E) -> Self { - Self::FromOrigin{ origin, source: Box::new(err) } + Self::FromOrigin { origin, source: Box::new(err) } } } From 9ba05a5921bdaef5efff163bab7fdd5742a377ef Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Fri, 23 Oct 2020 13:41:44 +0200 Subject: [PATCH 17/62] Update node/overseer/src/lib.rs Co-authored-by: Andronik Ordian --- node/overseer/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/overseer/src/lib.rs b/node/overseer/src/lib.rs index a420dd8481cd..44c890773f1f 100644 --- a/node/overseer/src/lib.rs +++ b/node/overseer/src/lib.rs @@ -97,7 +97,7 @@ const STOP_DELAY: u64 = 1; const LOG_TARGET: &'static str = "overseer"; /// A universal helper type for the overseer. -pub use eyre::Error as OverseerError; +pub use color_eyre::eyre::Error as OverseerError; /// A type of messages that are sent from [`Subsystem`] to [`Overseer`]. /// From 73067cf245608f2b4f3d8d9c6f5f81f4eba8b0e7 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Fri, 23 Oct 2020 14:20:42 +0200 Subject: [PATCH 18/62] chore format --- .../availability-distribution/src/lib.rs | 1883 ++++++++--------- .../availability-distribution/src/tests.rs | 1700 +++++++-------- 2 files changed, 1784 insertions(+), 1799 deletions(-) diff --git a/node/network/availability-distribution/src/lib.rs b/node/network/availability-distribution/src/lib.rs index eae5b93d6e0c..195a1fb4cfac 100644 --- a/node/network/availability-distribution/src/lib.rs +++ b/node/network/availability-distribution/src/lib.rs @@ -23,7 +23,6 @@ //! is checked. #[deny(unused_extern_crates, unused_results, unused_qualifications)] - use codec::{Decode, Encode}; use futures::{channel::oneshot, FutureExt, TryFutureExt}; @@ -32,27 +31,22 @@ use sp_keystore::{CryptoStore, SyncCryptoStorePtr}; use log::{trace, warn}; use polkadot_erasure_coding::branch_hash; +use polkadot_node_network_protocol::{ + v1 as protocol_v1, NetworkBridgeEvent, PeerId, ReputationChange as Rep, View, +}; +use polkadot_node_subsystem_util::metrics::{self, prometheus}; use polkadot_primitives::v1::{ - PARACHAIN_KEY_TYPE_ID, - BlakeTwo256, CommittedCandidateReceipt, CoreState, ErasureChunk, - Hash as Hash, HashT, Id as ParaId, - ValidatorId, ValidatorIndex, SessionIndex, + BlakeTwo256, CommittedCandidateReceipt, CoreState, ErasureChunk, Hash, HashT, Id as ParaId, + SessionIndex, ValidatorId, ValidatorIndex, PARACHAIN_KEY_TYPE_ID, }; use polkadot_subsystem::messages::{ - AllMessages, AvailabilityDistributionMessage, NetworkBridgeMessage, RuntimeApiMessage, - RuntimeApiRequest, AvailabilityStoreMessage, ChainApiMessage, + AllMessages, AvailabilityDistributionMessage, AvailabilityStoreMessage, ChainApiMessage, + NetworkBridgeMessage, RuntimeApiMessage, RuntimeApiRequest, }; use polkadot_subsystem::{ - errors::{ChainApiError, RuntimeApiError}, - ActiveLeavesUpdate, FromOverseer, OverseerSignal, SpawnedSubsystem, Subsystem, - SubsystemContext, SubsystemError, -}; -use polkadot_node_subsystem_util::{ - metrics::{self, prometheus}, -}; -use polkadot_node_network_protocol::{ - v1 as protocol_v1, View, ReputationChange as Rep, PeerId, - NetworkBridgeEvent, + errors::{ChainApiError, RuntimeApiError}, + ActiveLeavesUpdate, FromOverseer, OverseerSignal, SpawnedSubsystem, Subsystem, + SubsystemContext, SubsystemError, }; use std::collections::{HashMap, HashSet}; use std::iter; @@ -61,65 +55,64 @@ const TARGET: &'static str = "avad"; #[derive(Debug, Error)] enum Error { - #[error("Sending PendingAvailability query failed")] - QueryPendingAvailabilitySendQuery(#[source] SubsystemError), - #[error("Response channel to obtain PendingAvailability failed")] - QueryPendingAvailabilityResponseChannel(#[source] oneshot::Canceled), - #[error("RuntimeAPI to obtain PendingAvailability failed")] - QueryPendingAvailability(#[source] RuntimeApiError), - - #[error("Sending StoreChunk query failed")] - StoreChunkSendQuery(#[source] SubsystemError), - #[error("Response channel to obtain StoreChunk failed")] - StoreChunkResponseChannel(#[source] oneshot::Canceled), - - #[error("Sending QueryChunk query failed")] - QueryChunkSendQuery(#[source] SubsystemError), - #[error("Response channel to obtain QueryChunk failed")] - QueryChunkResponseChannel(#[source] oneshot::Canceled), - - #[error("Sending QueryAncestors query failed")] - QueryAncestorsSendQuery(#[source] SubsystemError), - #[error("Response channel to obtain QueryAncestors failed")] - QueryAncestorsResponseChannel(#[source] oneshot::Canceled), - #[error("RuntimeAPI to obtain QueryAncestors failed")] - QueryAncestors(#[source] ChainApiError), - - - #[error("Sending QuerySession query failed")] - QuerySessionSendQuery(#[source] SubsystemError), - #[error("Response channel to obtain QuerySession failed")] - QuerySessionResponseChannel(#[source] oneshot::Canceled), - #[error("RuntimeAPI to obtain QuerySession failed")] - QuerySession(#[source] RuntimeApiError), - - #[error("Sending QueryValidators query failed")] - QueryValidatorsSendQuery(#[source] SubsystemError), - #[error("Response channel to obtain QueryValidators failed")] - QueryValidatorsResponseChannel(#[source] oneshot::Canceled), - #[error("RuntimeAPI to obtain QueryValidators failed")] - QueryValidators(#[source] RuntimeApiError), - - #[error("Sending AvailabilityCores query failed")] - AvailabilityCoresSendQuery(#[source] SubsystemError), - #[error("Response channel to obtain AvailabilityCores failed")] - AvailabilityCoresResponseChannel(#[source] oneshot::Canceled), - #[error("RuntimeAPI to obtain AvailabilityCores failed")] - AvailabilityCores(#[source] RuntimeApiError), - - #[error("Sending AvailabilityCores query failed")] - QueryAvailabilitySendQuery(#[source] SubsystemError), - #[error("Response channel to obtain AvailabilityCores failed")] - QueryAvailabilityResponseChannel(#[source] oneshot::Canceled), - - #[error("Sending out a peer report message")] - ReportPeerMessageSend(#[source] SubsystemError), - - #[error("Sending a gossip message")] - TrackedGossipMessage(#[source] SubsystemError), - - #[error("Receive channel closed")] - IncomingMessageChannel(#[source] SubsystemError), + #[error("Sending PendingAvailability query failed")] + QueryPendingAvailabilitySendQuery(#[source] SubsystemError), + #[error("Response channel to obtain PendingAvailability failed")] + QueryPendingAvailabilityResponseChannel(#[source] oneshot::Canceled), + #[error("RuntimeAPI to obtain PendingAvailability failed")] + QueryPendingAvailability(#[source] RuntimeApiError), + + #[error("Sending StoreChunk query failed")] + StoreChunkSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain StoreChunk failed")] + StoreChunkResponseChannel(#[source] oneshot::Canceled), + + #[error("Sending QueryChunk query failed")] + QueryChunkSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain QueryChunk failed")] + QueryChunkResponseChannel(#[source] oneshot::Canceled), + + #[error("Sending QueryAncestors query failed")] + QueryAncestorsSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain QueryAncestors failed")] + QueryAncestorsResponseChannel(#[source] oneshot::Canceled), + #[error("RuntimeAPI to obtain QueryAncestors failed")] + QueryAncestors(#[source] ChainApiError), + + #[error("Sending QuerySession query failed")] + QuerySessionSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain QuerySession failed")] + QuerySessionResponseChannel(#[source] oneshot::Canceled), + #[error("RuntimeAPI to obtain QuerySession failed")] + QuerySession(#[source] RuntimeApiError), + + #[error("Sending QueryValidators query failed")] + QueryValidatorsSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain QueryValidators failed")] + QueryValidatorsResponseChannel(#[source] oneshot::Canceled), + #[error("RuntimeAPI to obtain QueryValidators failed")] + QueryValidators(#[source] RuntimeApiError), + + #[error("Sending AvailabilityCores query failed")] + AvailabilityCoresSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain AvailabilityCores failed")] + AvailabilityCoresResponseChannel(#[source] oneshot::Canceled), + #[error("RuntimeAPI to obtain AvailabilityCores failed")] + AvailabilityCores(#[source] RuntimeApiError), + + #[error("Sending AvailabilityCores query failed")] + QueryAvailabilitySendQuery(#[source] SubsystemError), + #[error("Response channel to obtain AvailabilityCores failed")] + QueryAvailabilityResponseChannel(#[source] oneshot::Canceled), + + #[error("Sending out a peer report message")] + ReportPeerMessageSend(#[source] SubsystemError), + + #[error("Sending a gossip message")] + TrackedGossipMessage(#[source] SubsystemError), + + #[error("Receive channel closed")] + IncomingMessageChannel(#[source] SubsystemError), } type Result = std::result::Result; @@ -134,1036 +127,1026 @@ const BENEFIT_VALID_MESSAGE: Rep = Rep::new(10, "Valid message"); /// to other peers. #[derive(Encode, Decode, Debug, Clone, PartialEq, Eq, Hash)] pub struct AvailabilityGossipMessage { - /// Anchor hash of the candidate the `ErasureChunk` is associated to. - pub candidate_hash: Hash, - /// The erasure chunk, a encoded information part of `AvailabilityData`. - pub erasure_chunk: ErasureChunk, + /// Anchor hash of the candidate the `ErasureChunk` is associated to. + pub candidate_hash: Hash, + /// The erasure chunk, a encoded information part of `AvailabilityData`. + pub erasure_chunk: ErasureChunk, } /// Data used to track information of peers and relay parents the /// overseer ordered us to work on. #[derive(Default, Clone, Debug)] struct ProtocolState { - /// Track all active peers and their views - /// to determine what is relevant to them. - peer_views: HashMap, - - /// Our own view. - view: View, - - /// Caches a mapping of relay parents or ancestor to live candidate receipts. - /// Allows fast intersection of live candidates with views and consecutive unioning. - /// Maps relay parent / ancestor -> live candidate receipts + its hash. - receipts: HashMap>, - - /// Allow reverse caching of view checks. - /// Maps candidate hash -> relay parent for extracting meta information from `PerRelayParent`. - /// Note that the presence of this is not sufficient to determine if deletion is OK, i.e. - /// two histories could cover this. - reverse: HashMap, - - /// Keeps track of which candidate receipts are required due to ancestors of which relay parents - /// of our view. - /// Maps ancestor -> relay parents in view - ancestry: HashMap>, - - /// Track things needed to start and stop work on a particular relay parent. - per_relay_parent: HashMap, - - /// Track data that is specific to a candidate. - per_candidate: HashMap, + /// Track all active peers and their views + /// to determine what is relevant to them. + peer_views: HashMap, + + /// Our own view. + view: View, + + /// Caches a mapping of relay parents or ancestor to live candidate receipts. + /// Allows fast intersection of live candidates with views and consecutive unioning. + /// Maps relay parent / ancestor -> live candidate receipts + its hash. + receipts: HashMap>, + + /// Allow reverse caching of view checks. + /// Maps candidate hash -> relay parent for extracting meta information from `PerRelayParent`. + /// Note that the presence of this is not sufficient to determine if deletion is OK, i.e. + /// two histories could cover this. + reverse: HashMap, + + /// Keeps track of which candidate receipts are required due to ancestors of which relay parents + /// of our view. + /// Maps ancestor -> relay parents in view + ancestry: HashMap>, + + /// Track things needed to start and stop work on a particular relay parent. + per_relay_parent: HashMap, + + /// Track data that is specific to a candidate. + per_candidate: HashMap, } #[derive(Debug, Clone, Default)] struct PerCandidate { - /// A Candidate and a set of known erasure chunks in form of messages to be gossiped / distributed if the peer view wants that. - /// This is _across_ peers and not specific to a particular one. - /// candidate hash + erasure chunk index -> gossip message - message_vault: HashMap, + /// A Candidate and a set of known erasure chunks in form of messages to be gossiped / distributed if the peer view wants that. + /// This is _across_ peers and not specific to a particular one. + /// candidate hash + erasure chunk index -> gossip message + message_vault: HashMap, - /// Track received candidate hashes and chunk indices from peers. - received_messages: HashMap>, + /// Track received candidate hashes and chunk indices from peers. + received_messages: HashMap>, - /// Track already sent candidate hashes and the erasure chunk index to the peers. - sent_messages: HashMap>, + /// Track already sent candidate hashes and the erasure chunk index to the peers. + sent_messages: HashMap>, - /// The set of validators. - validators: Vec, + /// The set of validators. + validators: Vec, - /// If this node is a validator, note the index in the validator set. - validator_index: Option, + /// If this node is a validator, note the index in the validator set. + validator_index: Option, } #[derive(Debug, Clone, Default)] struct PerRelayParent { - /// Set of `K` ancestors for this relay parent. - ancestors: Vec, + /// Set of `K` ancestors for this relay parent. + ancestors: Vec, } impl ProtocolState { - /// Collects the relay_parents ancestors including the relay parents themselfes. - fn extend_with_ancestors<'a>( - &'a self, - relay_parents: impl IntoIterator + 'a, - ) -> HashSet { - relay_parents - .into_iter() - .map(|relay_parent| { - self.per_relay_parent - .get(relay_parent) - .into_iter() - .map(|per_relay_parent| per_relay_parent.ancestors.iter().cloned()) - .flatten() - .chain(iter::once(*relay_parent)) - }) - .flatten() - .collect::>() - } - - /// Unionize all cached entries for the given relay parents and its ancestors. - /// Ignores all non existent relay parents, so this can be used directly with a peers view. - /// Returns a map from candidate hash -> receipt - fn cached_live_candidates_unioned<'a>( - &'a self, - relay_parents: impl IntoIterator + 'a, - ) -> HashMap { - let relay_parents_and_ancestors = self.extend_with_ancestors(relay_parents); - relay_parents_and_ancestors - .into_iter() - .filter_map(|relay_parent_or_ancestor| self.receipts.get(&relay_parent_or_ancestor)) - .map(|receipt_set| receipt_set.into_iter()) - .flatten() - .map(|(receipt_hash, receipt)| (receipt_hash.clone(), receipt.clone())) - .collect::>() - } - - async fn add_relay_parent( - &mut self, - ctx: &mut Context, - relay_parent: Hash, - validators: Vec, - validator_index: Option, - ) -> Result<()> - where - Context: SubsystemContext, - { - let candidates = - query_live_candidates(ctx, self, std::iter::once(relay_parent)).await?; - - // register the relation of relay_parent to candidate.. - // ..and the reverse association. - for (relay_parent_or_ancestor, (receipt_hash, receipt)) in candidates.clone() { - self - .reverse - .insert(receipt_hash.clone(), relay_parent_or_ancestor.clone()); - let per_candidate = self.per_candidate.entry(receipt_hash.clone()) - .or_default(); - per_candidate.validator_index = validator_index.clone(); - per_candidate.validators = validators.clone(); - - self - .receipts - .entry(relay_parent_or_ancestor) - .or_default() - .insert((receipt_hash, receipt)); - } - - // collect the ancestors again from the hash map - let ancestors = candidates - .iter() - .filter_map(|(ancestor_or_relay_parent, _receipt)| { - if ancestor_or_relay_parent == &relay_parent { - None - } else { - Some(*ancestor_or_relay_parent) - } - }) - .collect::>(); - - // mark all the ancestors as "needed" by this newly added relay parent - for ancestor in ancestors.iter() { - self.ancestry - .entry(ancestor.clone()) - .or_default() - .insert(relay_parent); - } - - self - .per_relay_parent - .entry(relay_parent) - .or_default() - .ancestors = ancestors; - - Ok(()) - } - - fn remove_relay_parent(&mut self, relay_parent: &Hash) -> Result<()> { - // we might be ancestor of some other relay_parent - if let Some(ref mut descendants) = self.ancestry.get_mut(relay_parent) { - // if we were the last user, and it is - // not explicitly set to be worked on by the overseer - if descendants.is_empty() { - // remove from the ancestry index - self.ancestry.remove(relay_parent); - // and also remove the actual receipt - self.receipts.remove(relay_parent); - self.per_candidate.remove(relay_parent); - } - } - if let Some(per_relay_parent) = self.per_relay_parent.remove(relay_parent) { - // remove all "references" from the hash maps and sets for all ancestors - for ancestor in per_relay_parent.ancestors { - // one of our decendants might be ancestor of some other relay_parent - if let Some(ref mut descendants) = self.ancestry.get_mut(&ancestor) { - // we do not need this descendant anymore - descendants.remove(&relay_parent); - // if we were the last user, and it is - // not explicitly set to be worked on by the overseer - if descendants.is_empty() && !self.per_relay_parent.contains_key(&ancestor) { - // remove from the ancestry index - self.ancestry.remove(&ancestor); - // and also remove the actual receipt - self.receipts.remove(&ancestor); - self.per_candidate.remove(&ancestor); - } - } - } - } - Ok(()) - } + /// Collects the relay_parents ancestors including the relay parents themselfes. + fn extend_with_ancestors<'a>( + &'a self, + relay_parents: impl IntoIterator + 'a, + ) -> HashSet { + relay_parents + .into_iter() + .map(|relay_parent| { + self.per_relay_parent + .get(relay_parent) + .into_iter() + .map(|per_relay_parent| per_relay_parent.ancestors.iter().cloned()) + .flatten() + .chain(iter::once(*relay_parent)) + }) + .flatten() + .collect::>() + } + + /// Unionize all cached entries for the given relay parents and its ancestors. + /// Ignores all non existent relay parents, so this can be used directly with a peers view. + /// Returns a map from candidate hash -> receipt + fn cached_live_candidates_unioned<'a>( + &'a self, + relay_parents: impl IntoIterator + 'a, + ) -> HashMap { + let relay_parents_and_ancestors = self.extend_with_ancestors(relay_parents); + relay_parents_and_ancestors + .into_iter() + .filter_map(|relay_parent_or_ancestor| self.receipts.get(&relay_parent_or_ancestor)) + .map(|receipt_set| receipt_set.into_iter()) + .flatten() + .map(|(receipt_hash, receipt)| (receipt_hash.clone(), receipt.clone())) + .collect::>() + } + + async fn add_relay_parent( + &mut self, + ctx: &mut Context, + relay_parent: Hash, + validators: Vec, + validator_index: Option, + ) -> Result<()> + where + Context: SubsystemContext, + { + let candidates = query_live_candidates(ctx, self, std::iter::once(relay_parent)).await?; + + // register the relation of relay_parent to candidate.. + // ..and the reverse association. + for (relay_parent_or_ancestor, (receipt_hash, receipt)) in candidates.clone() { + self.reverse + .insert(receipt_hash.clone(), relay_parent_or_ancestor.clone()); + let per_candidate = self.per_candidate.entry(receipt_hash.clone()).or_default(); + per_candidate.validator_index = validator_index.clone(); + per_candidate.validators = validators.clone(); + + self.receipts + .entry(relay_parent_or_ancestor) + .or_default() + .insert((receipt_hash, receipt)); + } + + // collect the ancestors again from the hash map + let ancestors = candidates + .iter() + .filter_map(|(ancestor_or_relay_parent, _receipt)| { + if ancestor_or_relay_parent == &relay_parent { + None + } else { + Some(*ancestor_or_relay_parent) + } + }) + .collect::>(); + + // mark all the ancestors as "needed" by this newly added relay parent + for ancestor in ancestors.iter() { + self.ancestry + .entry(ancestor.clone()) + .or_default() + .insert(relay_parent); + } + + self.per_relay_parent + .entry(relay_parent) + .or_default() + .ancestors = ancestors; + + Ok(()) + } + + fn remove_relay_parent(&mut self, relay_parent: &Hash) -> Result<()> { + // we might be ancestor of some other relay_parent + if let Some(ref mut descendants) = self.ancestry.get_mut(relay_parent) { + // if we were the last user, and it is + // not explicitly set to be worked on by the overseer + if descendants.is_empty() { + // remove from the ancestry index + self.ancestry.remove(relay_parent); + // and also remove the actual receipt + self.receipts.remove(relay_parent); + self.per_candidate.remove(relay_parent); + } + } + if let Some(per_relay_parent) = self.per_relay_parent.remove(relay_parent) { + // remove all "references" from the hash maps and sets for all ancestors + for ancestor in per_relay_parent.ancestors { + // one of our decendants might be ancestor of some other relay_parent + if let Some(ref mut descendants) = self.ancestry.get_mut(&ancestor) { + // we do not need this descendant anymore + descendants.remove(&relay_parent); + // if we were the last user, and it is + // not explicitly set to be worked on by the overseer + if descendants.is_empty() && !self.per_relay_parent.contains_key(&ancestor) { + // remove from the ancestry index + self.ancestry.remove(&ancestor); + // and also remove the actual receipt + self.receipts.remove(&ancestor); + self.per_candidate.remove(&ancestor); + } + } + } + } + Ok(()) + } } /// Deal with network bridge updates and track what needs to be tracked /// which depends on the message type received. async fn handle_network_msg( - ctx: &mut Context, - keystore: &SyncCryptoStorePtr, - state: &mut ProtocolState, - metrics: &Metrics, - bridge_message: NetworkBridgeEvent, + ctx: &mut Context, + keystore: &SyncCryptoStorePtr, + state: &mut ProtocolState, + metrics: &Metrics, + bridge_message: NetworkBridgeEvent, ) -> Result<()> where - Context: SubsystemContext, + Context: SubsystemContext, { - match bridge_message { - NetworkBridgeEvent::PeerConnected(peerid, _role) => { - // insert if none already present - state.peer_views.entry(peerid).or_default(); - } - NetworkBridgeEvent::PeerDisconnected(peerid) => { - // get rid of superfluous data - state.peer_views.remove(&peerid); - } - NetworkBridgeEvent::PeerViewChange(peerid, view) => { - handle_peer_view_change(ctx, state, peerid, view, metrics).await?; - } - NetworkBridgeEvent::OurViewChange(view) => { - handle_our_view_change(ctx, keystore, state, view, metrics).await?; - } - NetworkBridgeEvent::PeerMessage(remote, msg) => { - let gossiped_availability = match msg { - protocol_v1::AvailabilityDistributionMessage::Chunk(candidate_hash, chunk) => - AvailabilityGossipMessage { candidate_hash, erasure_chunk: chunk } - }; - - process_incoming_peer_message(ctx, state, remote, gossiped_availability, metrics).await?; - } - } - Ok(()) + match bridge_message { + NetworkBridgeEvent::PeerConnected(peerid, _role) => { + // insert if none already present + state.peer_views.entry(peerid).or_default(); + } + NetworkBridgeEvent::PeerDisconnected(peerid) => { + // get rid of superfluous data + state.peer_views.remove(&peerid); + } + NetworkBridgeEvent::PeerViewChange(peerid, view) => { + handle_peer_view_change(ctx, state, peerid, view, metrics).await?; + } + NetworkBridgeEvent::OurViewChange(view) => { + handle_our_view_change(ctx, keystore, state, view, metrics).await?; + } + NetworkBridgeEvent::PeerMessage(remote, msg) => { + let gossiped_availability = match msg { + protocol_v1::AvailabilityDistributionMessage::Chunk(candidate_hash, chunk) => { + AvailabilityGossipMessage { + candidate_hash, + erasure_chunk: chunk, + } + } + }; + + process_incoming_peer_message(ctx, state, remote, gossiped_availability, metrics) + .await?; + } + } + Ok(()) } - /// Handle the changes necessary when our view changes. async fn handle_our_view_change( - ctx: &mut Context, - keystore: &SyncCryptoStorePtr, - state: &mut ProtocolState, - view: View, - metrics: &Metrics, + ctx: &mut Context, + keystore: &SyncCryptoStorePtr, + state: &mut ProtocolState, + view: View, + metrics: &Metrics, ) -> Result<()> where - Context: SubsystemContext, + Context: SubsystemContext, { - let old_view = std::mem::replace(&mut (state.view), view); - - // needed due to borrow rules - let view = state.view.clone(); - let added = view.difference(&old_view).collect::>(); - - // add all the relay parents and fill the cache - for added in added.iter() { - let added = **added; - let validators = query_validators(ctx, added).await?; - let validator_index = obtain_our_validator_index( - &validators, - keystore.clone(), - ).await; - state.add_relay_parent(ctx, added, validators, validator_index).await?; - } - - // handle all candidates - for (candidate_hash, _receipt) in state.cached_live_candidates_unioned(added) { - let per_candidate = state - .per_candidate - .entry(candidate_hash) - .or_default(); - - // assure the node has the validator role - if per_candidate.validator_index.is_none() { - continue; - }; - - // check if the availability is present in the store exists - if !query_data_availability(ctx, candidate_hash).await? { - continue; - } - - let validator_count = per_candidate.validators.len(); - - // obtain interested peers in the candidate hash - let peers: Vec = state - .peer_views - .clone() - .into_iter() - .filter(|(_peer, view)| { - // collect all direct interests of a peer w/o ancestors - state - .cached_live_candidates_unioned(view.0.iter()) - .contains_key(&candidate_hash) - }) - .map(|(peer, _view)| peer.clone()) - .collect(); - - // distribute all erasure messages to interested peers - for chunk_index in 0u32..(validator_count as u32) { - - // only the peers which did not receive this particular erasure chunk - let per_candidate = state - .per_candidate - .entry(candidate_hash) - .or_default(); - - // obtain the chunks from the cache, if not fallback - // and query the availability store - let message_id = (candidate_hash, chunk_index); - let erasure_chunk = if let Some(message) = per_candidate.message_vault.get(&chunk_index) { - message.erasure_chunk.clone() - } else if let Some(erasure_chunk) = query_chunk(ctx, candidate_hash, chunk_index as ValidatorIndex).await? { - erasure_chunk - } else { - continue; - }; - - debug_assert_eq!(erasure_chunk.index, chunk_index); - - let peers = peers - .iter() - .filter(|peer| { - // only pick those which were not sent before - !per_candidate - .sent_messages - .get(*peer) - .filter(|set| { - set.contains(&message_id) - }) - .is_some() - }) - .map(|peer| peer.clone()) - .collect::>(); - let message = AvailabilityGossipMessage { - candidate_hash, - erasure_chunk, - }; - - send_tracked_gossip_message_to_peers(ctx, per_candidate, metrics, peers, message).await?; - } - } - - // cleanup the removed relay parents and their states - let removed = old_view.difference(&view).collect::>(); - for removed in removed { - state.remove_relay_parent(&removed)?; - } - Ok(()) + let old_view = std::mem::replace(&mut (state.view), view); + + // needed due to borrow rules + let view = state.view.clone(); + let added = view.difference(&old_view).collect::>(); + + // add all the relay parents and fill the cache + for added in added.iter() { + let added = **added; + let validators = query_validators(ctx, added).await?; + let validator_index = obtain_our_validator_index(&validators, keystore.clone()).await; + state + .add_relay_parent(ctx, added, validators, validator_index) + .await?; + } + + // handle all candidates + for (candidate_hash, _receipt) in state.cached_live_candidates_unioned(added) { + let per_candidate = state.per_candidate.entry(candidate_hash).or_default(); + + // assure the node has the validator role + if per_candidate.validator_index.is_none() { + continue; + }; + + // check if the availability is present in the store exists + if !query_data_availability(ctx, candidate_hash).await? { + continue; + } + + let validator_count = per_candidate.validators.len(); + + // obtain interested peers in the candidate hash + let peers: Vec = state + .peer_views + .clone() + .into_iter() + .filter(|(_peer, view)| { + // collect all direct interests of a peer w/o ancestors + state + .cached_live_candidates_unioned(view.0.iter()) + .contains_key(&candidate_hash) + }) + .map(|(peer, _view)| peer.clone()) + .collect(); + + // distribute all erasure messages to interested peers + for chunk_index in 0u32..(validator_count as u32) { + // only the peers which did not receive this particular erasure chunk + let per_candidate = state.per_candidate.entry(candidate_hash).or_default(); + + // obtain the chunks from the cache, if not fallback + // and query the availability store + let message_id = (candidate_hash, chunk_index); + let erasure_chunk = if let Some(message) = per_candidate.message_vault.get(&chunk_index) + { + message.erasure_chunk.clone() + } else if let Some(erasure_chunk) = + query_chunk(ctx, candidate_hash, chunk_index as ValidatorIndex).await? + { + erasure_chunk + } else { + continue; + }; + + debug_assert_eq!(erasure_chunk.index, chunk_index); + + let peers = peers + .iter() + .filter(|peer| { + // only pick those which were not sent before + !per_candidate + .sent_messages + .get(*peer) + .filter(|set| set.contains(&message_id)) + .is_some() + }) + .map(|peer| peer.clone()) + .collect::>(); + let message = AvailabilityGossipMessage { + candidate_hash, + erasure_chunk, + }; + + send_tracked_gossip_message_to_peers(ctx, per_candidate, metrics, peers, message) + .await?; + } + } + + // cleanup the removed relay parents and their states + let removed = old_view.difference(&view).collect::>(); + for removed in removed { + state.remove_relay_parent(&removed)?; + } + Ok(()) } #[inline(always)] async fn send_tracked_gossip_message_to_peers( - ctx: &mut Context, - per_candidate: &mut PerCandidate, - metrics: &Metrics, - peers: Vec, - message: AvailabilityGossipMessage, + ctx: &mut Context, + per_candidate: &mut PerCandidate, + metrics: &Metrics, + peers: Vec, + message: AvailabilityGossipMessage, ) -> Result<()> where - Context: SubsystemContext, + Context: SubsystemContext, { - send_tracked_gossip_messages_to_peers(ctx, per_candidate, metrics, peers, iter::once(message)).await + send_tracked_gossip_messages_to_peers(ctx, per_candidate, metrics, peers, iter::once(message)) + .await } #[inline(always)] async fn send_tracked_gossip_messages_to_peer( - ctx: &mut Context, - per_candidate: &mut PerCandidate, - metrics: &Metrics, - peer: PeerId, - message_iter: impl IntoIterator, + ctx: &mut Context, + per_candidate: &mut PerCandidate, + metrics: &Metrics, + peer: PeerId, + message_iter: impl IntoIterator, ) -> Result<()> where - Context: SubsystemContext, + Context: SubsystemContext, { - send_tracked_gossip_messages_to_peers(ctx, per_candidate, metrics, vec![peer], message_iter).await + send_tracked_gossip_messages_to_peers(ctx, per_candidate, metrics, vec![peer], message_iter) + .await } async fn send_tracked_gossip_messages_to_peers( - ctx: &mut Context, - per_candidate: &mut PerCandidate, - metrics: &Metrics, - peers: Vec, - message_iter: impl IntoIterator, + ctx: &mut Context, + per_candidate: &mut PerCandidate, + metrics: &Metrics, + peers: Vec, + message_iter: impl IntoIterator, ) -> Result<()> where - Context: SubsystemContext, + Context: SubsystemContext, { - if peers.is_empty() { - return Ok(()) - } - for message in message_iter { - for peer in peers.iter() { - let message_id = (message.candidate_hash, message.erasure_chunk.index); - per_candidate - .sent_messages - .entry(peer.clone()) - .or_default() - .insert(message_id); - } - - per_candidate - .message_vault - .insert(message.erasure_chunk.index, message.clone()); - - let wire_message = protocol_v1::AvailabilityDistributionMessage::Chunk( - message.candidate_hash, - message.erasure_chunk, - ); - - ctx.send_message(AllMessages::NetworkBridge( - NetworkBridgeMessage::SendValidationMessage( - peers.clone(), - protocol_v1::ValidationProtocol::AvailabilityDistribution(wire_message), - ), - )) - .await - .map_err(|e| Error::TrackedGossipMessage(e))?; - - metrics.on_chunk_distributed(); - } - - Ok(()) + if peers.is_empty() { + return Ok(()); + } + for message in message_iter { + for peer in peers.iter() { + let message_id = (message.candidate_hash, message.erasure_chunk.index); + per_candidate + .sent_messages + .entry(peer.clone()) + .or_default() + .insert(message_id); + } + + per_candidate + .message_vault + .insert(message.erasure_chunk.index, message.clone()); + + let wire_message = protocol_v1::AvailabilityDistributionMessage::Chunk( + message.candidate_hash, + message.erasure_chunk, + ); + + ctx.send_message(AllMessages::NetworkBridge( + NetworkBridgeMessage::SendValidationMessage( + peers.clone(), + protocol_v1::ValidationProtocol::AvailabilityDistribution(wire_message), + ), + )) + .await + .map_err(|e| Error::TrackedGossipMessage(e))?; + + metrics.on_chunk_distributed(); + } + + Ok(()) } // Send the difference between two views which were not sent // to that particular peer. async fn handle_peer_view_change( - ctx: &mut Context, - state: &mut ProtocolState, - origin: PeerId, - view: View, - metrics: &Metrics, + ctx: &mut Context, + state: &mut ProtocolState, + origin: PeerId, + view: View, + metrics: &Metrics, ) -> Result<()> where - Context: SubsystemContext, + Context: SubsystemContext, { - let current = state.peer_views.entry(origin.clone()).or_default(); - - let added: Vec = view.difference(&*current).cloned().collect(); - - *current = view; - - // only contains the intersection of what we are interested and - // the union of all relay parent's candidates. - let added_candidates = state.cached_live_candidates_unioned(added.iter()); - - // Send all messages we've seen before and the peer is now interested - // in to that peer. - - for (candidate_hash, _receipt) in added_candidates { - let per_candidate = state.per_candidate.entry(candidate_hash).or_default(); - - // obtain the relevant chunk indices not sent yet - let messages = ((0 as ValidatorIndex) - ..(per_candidate.validators.len() as ValidatorIndex)) - .into_iter() - .filter_map(|erasure_chunk_index: ValidatorIndex| { - let message_id = (candidate_hash, erasure_chunk_index); - - // try to pick up the message from the message vault - // so we send as much as we have - per_candidate - .message_vault - .get(&erasure_chunk_index) - .filter(|_| { - // check if that erasure chunk was already sent before - if let Some(sent_set) = per_candidate.sent_messages.get(&origin) { - if sent_set.contains(&message_id) { - return false; - } - } - true - }) - }) - .cloned() - .collect::>(); - - send_tracked_gossip_messages_to_peer(ctx, per_candidate, metrics, origin.clone(), messages).await?; - } - Ok(()) + let current = state.peer_views.entry(origin.clone()).or_default(); + + let added: Vec = view.difference(&*current).cloned().collect(); + + *current = view; + + // only contains the intersection of what we are interested and + // the union of all relay parent's candidates. + let added_candidates = state.cached_live_candidates_unioned(added.iter()); + + // Send all messages we've seen before and the peer is now interested + // in to that peer. + + for (candidate_hash, _receipt) in added_candidates { + let per_candidate = state.per_candidate.entry(candidate_hash).or_default(); + + // obtain the relevant chunk indices not sent yet + let messages = ((0 as ValidatorIndex)..(per_candidate.validators.len() as ValidatorIndex)) + .into_iter() + .filter_map(|erasure_chunk_index: ValidatorIndex| { + let message_id = (candidate_hash, erasure_chunk_index); + + // try to pick up the message from the message vault + // so we send as much as we have + per_candidate + .message_vault + .get(&erasure_chunk_index) + .filter(|_| { + // check if that erasure chunk was already sent before + if let Some(sent_set) = per_candidate.sent_messages.get(&origin) { + if sent_set.contains(&message_id) { + return false; + } + } + true + }) + }) + .cloned() + .collect::>(); + + send_tracked_gossip_messages_to_peer(ctx, per_candidate, metrics, origin.clone(), messages) + .await?; + } + Ok(()) } /// Obtain the first key which has a signing key. /// Returns the index within the validator set as `ValidatorIndex`, if there exists one, /// otherwise, `None` is returned. async fn obtain_our_validator_index( - validators: &[ValidatorId], - keystore: SyncCryptoStorePtr, + validators: &[ValidatorId], + keystore: SyncCryptoStorePtr, ) -> Option { - for (idx, validator) in validators.iter().enumerate() { - if CryptoStore::has_keys(&*keystore, &[(validator.to_raw_vec(), PARACHAIN_KEY_TYPE_ID)]).await { - return Some(idx as ValidatorIndex) - } - } - None + for (idx, validator) in validators.iter().enumerate() { + if CryptoStore::has_keys( + &*keystore, + &[(validator.to_raw_vec(), PARACHAIN_KEY_TYPE_ID)], + ) + .await + { + return Some(idx as ValidatorIndex); + } + } + None } /// Handle an incoming message from a peer. async fn process_incoming_peer_message( - ctx: &mut Context, - state: &mut ProtocolState, - origin: PeerId, - message: AvailabilityGossipMessage, - metrics: &Metrics, + ctx: &mut Context, + state: &mut ProtocolState, + origin: PeerId, + message: AvailabilityGossipMessage, + metrics: &Metrics, ) -> Result<()> where - Context: SubsystemContext, + Context: SubsystemContext, { - // obtain the set of candidates we are interested in based on our current view - let live_candidates = state.cached_live_candidates_unioned(state.view.0.iter()); - - // check if the candidate is of interest - let live_candidate = if let Some(live_candidate) = live_candidates.get(&message.candidate_hash) - { - live_candidate - } else { - return modify_reputation(ctx, origin, COST_NOT_A_LIVE_CANDIDATE).await; - }; - - // check the merkle proof - let root = &live_candidate.commitments.erasure_root; - let anticipated_hash = if let Ok(hash) = branch_hash( - root, - &message.erasure_chunk.proof, - message.erasure_chunk.index as usize, - ) { - hash - } else { - return modify_reputation(ctx, origin, COST_MERKLE_PROOF_INVALID).await; - }; - - let erasure_chunk_hash = BlakeTwo256::hash(&message.erasure_chunk.chunk); - if anticipated_hash != erasure_chunk_hash { - return modify_reputation(ctx, origin, COST_MERKLE_PROOF_INVALID).await; - } - - // an internal unique identifier of this message - let message_id = (message.candidate_hash, message.erasure_chunk.index); - - { - let per_candidate = state.per_candidate.entry(message_id.0.clone()).or_default(); - - // check if this particular erasure chunk was already sent by that peer before - { - let received_set = per_candidate - .received_messages - .entry(origin.clone()) - .or_default(); - if received_set.contains(&message_id) { - return modify_reputation(ctx, origin, COST_PEER_DUPLICATE_MESSAGE).await; - } else { - received_set.insert(message_id.clone()); - } - } - - // insert into known messages and change reputation - if per_candidate - .message_vault - .insert(message_id.1, message.clone()) - .is_some() - { - modify_reputation(ctx, origin, BENEFIT_VALID_MESSAGE).await?; - } else { - modify_reputation(ctx, origin, BENEFIT_VALID_MESSAGE_FIRST).await?; - - // save the chunk for our index - if let Some(validator_index) = per_candidate.validator_index { - if message.erasure_chunk.index == validator_index { - if let Err(_e) = store_chunk( - ctx, - message.candidate_hash.clone(), - message.erasure_chunk.index, - message.erasure_chunk.clone(), - ).await? { - warn!(target: TARGET, "Failed to store erasure chunk to availability store"); - } - } - } - }; - } - // condense the peers to the peers with interest on the candidate - let peers = state - .peer_views - .clone() - .into_iter() - .filter(|(_peer, view)| { - // peers view must contain the candidate hash too - state - .cached_live_candidates_unioned(view.0.iter()) - .contains_key(&message_id.0) - }) - .map(|(peer, _)| -> PeerId { peer.clone() }) - .collect::>(); - - let per_candidate = state.per_candidate.entry(message_id.0.clone()).or_default(); - - let peers = peers - .into_iter() - .filter(|peer| { - let peer: PeerId = peer.clone(); - // avoid sending duplicate messages - per_candidate - .sent_messages - .entry(peer) - .or_default() - .contains(&message_id) - }) - .collect::>(); - - // gossip that message to interested peers - send_tracked_gossip_message_to_peers(ctx, per_candidate, metrics, peers, message).await + // obtain the set of candidates we are interested in based on our current view + let live_candidates = state.cached_live_candidates_unioned(state.view.0.iter()); + + // check if the candidate is of interest + let live_candidate = if let Some(live_candidate) = live_candidates.get(&message.candidate_hash) + { + live_candidate + } else { + return modify_reputation(ctx, origin, COST_NOT_A_LIVE_CANDIDATE).await; + }; + + // check the merkle proof + let root = &live_candidate.commitments.erasure_root; + let anticipated_hash = if let Ok(hash) = branch_hash( + root, + &message.erasure_chunk.proof, + message.erasure_chunk.index as usize, + ) { + hash + } else { + return modify_reputation(ctx, origin, COST_MERKLE_PROOF_INVALID).await; + }; + + let erasure_chunk_hash = BlakeTwo256::hash(&message.erasure_chunk.chunk); + if anticipated_hash != erasure_chunk_hash { + return modify_reputation(ctx, origin, COST_MERKLE_PROOF_INVALID).await; + } + + // an internal unique identifier of this message + let message_id = (message.candidate_hash, message.erasure_chunk.index); + + { + let per_candidate = state.per_candidate.entry(message_id.0.clone()).or_default(); + + // check if this particular erasure chunk was already sent by that peer before + { + let received_set = per_candidate + .received_messages + .entry(origin.clone()) + .or_default(); + if received_set.contains(&message_id) { + return modify_reputation(ctx, origin, COST_PEER_DUPLICATE_MESSAGE).await; + } else { + received_set.insert(message_id.clone()); + } + } + + // insert into known messages and change reputation + if per_candidate + .message_vault + .insert(message_id.1, message.clone()) + .is_some() + { + modify_reputation(ctx, origin, BENEFIT_VALID_MESSAGE).await?; + } else { + modify_reputation(ctx, origin, BENEFIT_VALID_MESSAGE_FIRST).await?; + + // save the chunk for our index + if let Some(validator_index) = per_candidate.validator_index { + if message.erasure_chunk.index == validator_index { + if let Err(_e) = store_chunk( + ctx, + message.candidate_hash.clone(), + message.erasure_chunk.index, + message.erasure_chunk.clone(), + ) + .await? + { + warn!( + target: TARGET, + "Failed to store erasure chunk to availability store" + ); + } + } + } + }; + } + // condense the peers to the peers with interest on the candidate + let peers = state + .peer_views + .clone() + .into_iter() + .filter(|(_peer, view)| { + // peers view must contain the candidate hash too + state + .cached_live_candidates_unioned(view.0.iter()) + .contains_key(&message_id.0) + }) + .map(|(peer, _)| -> PeerId { peer.clone() }) + .collect::>(); + + let per_candidate = state.per_candidate.entry(message_id.0.clone()).or_default(); + + let peers = peers + .into_iter() + .filter(|peer| { + let peer: PeerId = peer.clone(); + // avoid sending duplicate messages + per_candidate + .sent_messages + .entry(peer) + .or_default() + .contains(&message_id) + }) + .collect::>(); + + // gossip that message to interested peers + send_tracked_gossip_message_to_peers(ctx, per_candidate, metrics, peers, message).await } /// The bitfield distribution subsystem. pub struct AvailabilityDistributionSubsystem { - /// Pointer to a keystore, which is required for determining this nodes validator index. - keystore: SyncCryptoStorePtr, - /// Prometheus metrics. - metrics: Metrics, + /// Pointer to a keystore, which is required for determining this nodes validator index. + keystore: SyncCryptoStorePtr, + /// Prometheus metrics. + metrics: Metrics, } impl AvailabilityDistributionSubsystem { - /// Number of ancestors to keep around for the relay-chain heads. - const K: usize = 3; - - /// Create a new instance of the availability distribution. - pub fn new(keystore: SyncCryptoStorePtr, metrics: Metrics) -> Self { - Self { keystore, metrics } - } - - /// Start processing work as passed on from the Overseer. - async fn run(self, mut ctx: Context) -> Result<()> - where - Context: SubsystemContext, - { - // work: process incoming messages from the overseer. - let mut state = ProtocolState::default(); - loop { - let message = ctx - .recv() - .await - .map_err(|e| Error::IncomingMessageChannel(e))?; - match message { - FromOverseer::Communication { - msg: AvailabilityDistributionMessage::NetworkBridgeUpdateV1(event), - } => { - if let Err(e) = handle_network_msg( - &mut ctx, - &self.keystore.clone(), - &mut state, - &self.metrics, - event, - ).await { - warn!( - target: TARGET, - "Failed to handle incomming network messages: {:?}", e - ); - } - } - FromOverseer::Signal(OverseerSignal::ActiveLeaves(ActiveLeavesUpdate { - activated: _, - deactivated: _, - })) => { - // handled at view change - } - FromOverseer::Signal(OverseerSignal::BlockFinalized(_)) => {} - FromOverseer::Signal(OverseerSignal::Conclude) => { - return Ok(()); - } - } - } - } + /// Number of ancestors to keep around for the relay-chain heads. + const K: usize = 3; + + /// Create a new instance of the availability distribution. + pub fn new(keystore: SyncCryptoStorePtr, metrics: Metrics) -> Self { + Self { keystore, metrics } + } + + /// Start processing work as passed on from the Overseer. + async fn run(self, mut ctx: Context) -> Result<()> + where + Context: SubsystemContext, + { + // work: process incoming messages from the overseer. + let mut state = ProtocolState::default(); + loop { + let message = ctx + .recv() + .await + .map_err(|e| Error::IncomingMessageChannel(e))?; + match message { + FromOverseer::Communication { + msg: AvailabilityDistributionMessage::NetworkBridgeUpdateV1(event), + } => { + if let Err(e) = handle_network_msg( + &mut ctx, + &self.keystore.clone(), + &mut state, + &self.metrics, + event, + ) + .await + { + warn!( + target: TARGET, + "Failed to handle incomming network messages: {:?}", e + ); + } + } + FromOverseer::Signal(OverseerSignal::ActiveLeaves(ActiveLeavesUpdate { + activated: _, + deactivated: _, + })) => { + // handled at view change + } + FromOverseer::Signal(OverseerSignal::BlockFinalized(_)) => {} + FromOverseer::Signal(OverseerSignal::Conclude) => { + return Ok(()); + } + } + } + } } impl Subsystem for AvailabilityDistributionSubsystem where - Context: SubsystemContext + Sync + Send, + Context: SubsystemContext + Sync + Send, { - fn start(self, ctx: Context) -> SpawnedSubsystem { - - let future = self.run(ctx) - .map_err(|e| - SubsystemError::with_origin("availability-distribution", e) - ) - .map(|_| ()).boxed(); - - SpawnedSubsystem { - name: "availability-distribution-subsystem", - future, - } - } + fn start(self, ctx: Context) -> SpawnedSubsystem { + let future = self + .run(ctx) + .map_err(|e| SubsystemError::with_origin("availability-distribution", e)) + .map(|_| ()) + .boxed(); + + SpawnedSubsystem { + name: "availability-distribution-subsystem", + future, + } + } } /// Obtain all live candidates based on an iterator of relay heads. async fn query_live_candidates_without_ancestors( - ctx: &mut Context, - relay_parents: impl IntoIterator, + ctx: &mut Context, + relay_parents: impl IntoIterator, ) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - let iter = relay_parents.into_iter(); - let hint = iter.size_hint(); - - let mut live_candidates = HashSet::with_capacity(hint.1.unwrap_or(hint.0)); - for relay_parent in iter { - let paras = query_para_ids(ctx, relay_parent).await?; - for para in paras { - if let Some(ccr) = query_pending_availability(ctx, relay_parent, para).await? { - live_candidates.insert(ccr); - } - } - } - Ok(live_candidates) + let iter = relay_parents.into_iter(); + let hint = iter.size_hint(); + + let mut live_candidates = HashSet::with_capacity(hint.1.unwrap_or(hint.0)); + for relay_parent in iter { + let paras = query_para_ids(ctx, relay_parent).await?; + for para in paras { + if let Some(ccr) = query_pending_availability(ctx, relay_parent, para).await? { + live_candidates.insert(ccr); + } + } + } + Ok(live_candidates) } /// Obtain all live candidates based on an iterator or relay heads including `k` ancestors. /// /// Relay parent. async fn query_live_candidates( - ctx: &mut Context, - state: &mut ProtocolState, - relay_parents: impl IntoIterator, + ctx: &mut Context, + state: &mut ProtocolState, + relay_parents: impl IntoIterator, ) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - let iter = relay_parents.into_iter(); - let hint = iter.size_hint(); - - let capacity = hint.1.unwrap_or(hint.0) * (1 + AvailabilityDistributionSubsystem::K); - let mut live_candidates = - HashMap::::with_capacity(capacity); - - for relay_parent in iter { - - // register one of relay parents (not the ancestors) - let mut ancestors = query_up_to_k_ancestors_in_same_session( - ctx, - relay_parent, - AvailabilityDistributionSubsystem::K, - ) - .await?; - - ancestors.push(relay_parent); - - - // ancestors might overlap, so check the cache too - let unknown = ancestors - .into_iter() - .filter(|relay_parent_or_ancestor| { - // use the ones which we pulled before - // but keep the unknown relay parents - state - .receipts - .get(relay_parent_or_ancestor) - .and_then(|receipts| { - // directly extend the live_candidates with the cached value - live_candidates.extend(receipts.into_iter().map( - |(receipt_hash, receipt)| { - ( - relay_parent, - (receipt_hash.clone(), receipt.clone()), - ) - }, - )); - Some(()) - }) - .is_none() - }) - .collect::>(); - - // query the ones that were not present in the receipts cache - let receipts = query_live_candidates_without_ancestors(ctx, unknown.clone()).await?; - live_candidates.extend( - unknown.into_iter().zip( - receipts - .into_iter() - .map(|receipt| (receipt.hash(), receipt)), - ), - ); - } - Ok(live_candidates) + let iter = relay_parents.into_iter(); + let hint = iter.size_hint(); + + let capacity = hint.1.unwrap_or(hint.0) * (1 + AvailabilityDistributionSubsystem::K); + let mut live_candidates = + HashMap::::with_capacity(capacity); + + for relay_parent in iter { + // register one of relay parents (not the ancestors) + let mut ancestors = query_up_to_k_ancestors_in_same_session( + ctx, + relay_parent, + AvailabilityDistributionSubsystem::K, + ) + .await?; + + ancestors.push(relay_parent); + + // ancestors might overlap, so check the cache too + let unknown = ancestors + .into_iter() + .filter(|relay_parent_or_ancestor| { + // use the ones which we pulled before + // but keep the unknown relay parents + state + .receipts + .get(relay_parent_or_ancestor) + .and_then(|receipts| { + // directly extend the live_candidates with the cached value + live_candidates.extend(receipts.into_iter().map( + |(receipt_hash, receipt)| { + (relay_parent, (receipt_hash.clone(), receipt.clone())) + }, + )); + Some(()) + }) + .is_none() + }) + .collect::>(); + + // query the ones that were not present in the receipts cache + let receipts = query_live_candidates_without_ancestors(ctx, unknown.clone()).await?; + live_candidates.extend( + unknown.into_iter().zip( + receipts + .into_iter() + .map(|receipt| (receipt.hash(), receipt)), + ), + ); + } + Ok(live_candidates) } /// Query all para IDs. async fn query_para_ids(ctx: &mut Context, relay_parent: Hash) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - let (tx, rx) = oneshot::channel(); - ctx.send_message(AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::AvailabilityCores(tx), - ))) - .await - .map_err(|e| Error::AvailabilityCoresSendQuery(e))?; - - let all_para_ids: Vec<_> = rx - .await - .map_err(|e| Error::AvailabilityCoresResponseChannel(e))? - .map_err(|e| Error::AvailabilityCores(e))?; - - let occupied_para_ids = all_para_ids - .into_iter() - .filter_map(|core_state| { - if let CoreState::Occupied(occupied) = core_state { - Some(occupied.para_id) - } else { - None - } - }) - .collect(); - Ok(occupied_para_ids) + let (tx, rx) = oneshot::channel(); + ctx.send_message(AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::AvailabilityCores(tx), + ))) + .await + .map_err(|e| Error::AvailabilityCoresSendQuery(e))?; + + let all_para_ids: Vec<_> = rx + .await + .map_err(|e| Error::AvailabilityCoresResponseChannel(e))? + .map_err(|e| Error::AvailabilityCores(e))?; + + let occupied_para_ids = all_para_ids + .into_iter() + .filter_map(|core_state| { + if let CoreState::Occupied(occupied) = core_state { + Some(occupied.para_id) + } else { + None + } + }) + .collect(); + Ok(occupied_para_ids) } /// Modify the reputation of a peer based on its behavior. async fn modify_reputation(ctx: &mut Context, peer: PeerId, rep: Rep) -> Result<()> where - Context: SubsystemContext, + Context: SubsystemContext, { - trace!( - target: TARGET, - "Reputation change of {:?} for peer {:?}", - rep, - peer - ); - ctx.send_message(AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep), - )) - .await - .map_err(|e| Error::ReportPeerMessageSend(e)) + trace!( + target: TARGET, + "Reputation change of {:?} for peer {:?}", + rep, + peer + ); + ctx.send_message(AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep), + )) + .await + .map_err(|e| Error::ReportPeerMessageSend(e)) } /// Query the proof of validity for a particular candidate hash. -async fn query_data_availability( - ctx: &mut Context, - candidate_hash: Hash, -) -> Result +async fn query_data_availability(ctx: &mut Context, candidate_hash: Hash) -> Result where - Context: SubsystemContext, + Context: SubsystemContext, { - let (tx, rx) = oneshot::channel(); - ctx.send_message(AllMessages::AvailabilityStore( - AvailabilityStoreMessage::QueryDataAvailability(candidate_hash, tx), - )) - .await - .map_err(|e| Error::QueryAvailabilitySendQuery(e)) - ?; - rx - .await - .map_err(|e| Error::QueryAvailabilityResponseChannel(e)) + let (tx, rx) = oneshot::channel(); + ctx.send_message(AllMessages::AvailabilityStore( + AvailabilityStoreMessage::QueryDataAvailability(candidate_hash, tx), + )) + .await + .map_err(|e| Error::QueryAvailabilitySendQuery(e))?; + rx.await + .map_err(|e| Error::QueryAvailabilityResponseChannel(e)) } - async fn query_chunk( - ctx: &mut Context, - candidate_hash: Hash, - validator_index: ValidatorIndex, + ctx: &mut Context, + candidate_hash: Hash, + validator_index: ValidatorIndex, ) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - let (tx, rx) = oneshot::channel(); - ctx.send_message(AllMessages::AvailabilityStore( - AvailabilityStoreMessage::QueryChunk(candidate_hash, validator_index, tx), - )) - .await - .map_err(|e| Error::QueryChunkSendQuery(e))?; - rx.await - .map_err(|e| Error::QueryChunkResponseChannel(e)) + let (tx, rx) = oneshot::channel(); + ctx.send_message(AllMessages::AvailabilityStore( + AvailabilityStoreMessage::QueryChunk(candidate_hash, validator_index, tx), + )) + .await + .map_err(|e| Error::QueryChunkSendQuery(e))?; + rx.await.map_err(|e| Error::QueryChunkResponseChannel(e)) } - async fn store_chunk( - ctx: &mut Context, - candidate_hash: Hash, - validator_index: ValidatorIndex, - erasure_chunk: ErasureChunk, + ctx: &mut Context, + candidate_hash: Hash, + validator_index: ValidatorIndex, + erasure_chunk: ErasureChunk, ) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - let (tx, rx) = oneshot::channel(); - ctx.send_message(AllMessages::AvailabilityStore( - AvailabilityStoreMessage::StoreChunk(candidate_hash, validator_index, erasure_chunk, tx), - )) - .await - .map_err(|e| Error::StoreChunkSendQuery(e))?; - rx - .await - .map_err(|e| Error::StoreChunkResponseChannel(e)) + let (tx, rx) = oneshot::channel(); + ctx.send_message(AllMessages::AvailabilityStore( + AvailabilityStoreMessage::StoreChunk(candidate_hash, validator_index, erasure_chunk, tx), + )) + .await + .map_err(|e| Error::StoreChunkSendQuery(e))?; + rx.await.map_err(|e| Error::StoreChunkResponseChannel(e)) } /// Request the head data for a particular para. async fn query_pending_availability( - ctx: &mut Context, - relay_parent: Hash, - para: ParaId, + ctx: &mut Context, + relay_parent: Hash, + para: ParaId, ) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - let (tx, rx) = oneshot::channel(); - ctx.send_message(AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::CandidatePendingAvailability(para, tx), - ))) - .await - .map_err(|e| Error::QueryPendingAvailabilitySendQuery(e))?; - - rx.await - .map_err(|e| Error::QueryPendingAvailabilityResponseChannel(e))? - .map_err(|e| Error::QueryPendingAvailability(e)) + let (tx, rx) = oneshot::channel(); + ctx.send_message(AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::CandidatePendingAvailability(para, tx), + ))) + .await + .map_err(|e| Error::QueryPendingAvailabilitySendQuery(e))?; + + rx.await + .map_err(|e| Error::QueryPendingAvailabilityResponseChannel(e))? + .map_err(|e| Error::QueryPendingAvailability(e)) } /// Query the validator set. async fn query_validators( - ctx: &mut Context, - relay_parent: Hash, + ctx: &mut Context, + relay_parent: Hash, ) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - let (tx, rx) = oneshot::channel(); - let query_validators = AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::Validators(tx), - )); - - ctx.send_message(query_validators) - .await - .map_err(|e| Error::QueryValidatorsSendQuery(e))?; - rx.await - .map_err(|e| Error::QueryValidatorsResponseChannel(e))? - .map_err(|e| Error::QueryValidators(e)) + let (tx, rx) = oneshot::channel(); + let query_validators = AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::Validators(tx), + )); + + ctx.send_message(query_validators) + .await + .map_err(|e| Error::QueryValidatorsSendQuery(e))?; + rx.await + .map_err(|e| Error::QueryValidatorsResponseChannel(e))? + .map_err(|e| Error::QueryValidators(e)) } /// Query the hash of the `K` ancestors async fn query_k_ancestors( - ctx: &mut Context, - relay_parent: Hash, - k: usize, + ctx: &mut Context, + relay_parent: Hash, + k: usize, ) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - let (tx, rx) = oneshot::channel(); - let query_ancestors = AllMessages::ChainApi(ChainApiMessage::Ancestors { - hash: relay_parent, - k, - response_channel: tx, - }); - - ctx.send_message(query_ancestors) - .await - .map_err(|e| Error::QueryAncestorsSendQuery(e))?; - rx.await - .map_err(|e| Error::QueryAncestorsResponseChannel(e))? - .map_err(|e| Error::QueryAncestors(e)) + let (tx, rx) = oneshot::channel(); + let query_ancestors = AllMessages::ChainApi(ChainApiMessage::Ancestors { + hash: relay_parent, + k, + response_channel: tx, + }); + + ctx.send_message(query_ancestors) + .await + .map_err(|e| Error::QueryAncestorsSendQuery(e))?; + rx.await + .map_err(|e| Error::QueryAncestorsResponseChannel(e))? + .map_err(|e| Error::QueryAncestors(e)) } /// Query the session index of a relay parent async fn query_session_index_for_child( - ctx: &mut Context, - relay_parent: Hash, + ctx: &mut Context, + relay_parent: Hash, ) -> Result where - Context: SubsystemContext, + Context: SubsystemContext, { - let (tx, rx) = oneshot::channel(); - let query_session_idx_for_child = AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::SessionIndexForChild(tx), - )); - - ctx.send_message(query_session_idx_for_child) - .await - .map_err(|e| Error::QuerySessionSendQuery(e))?; - rx.await - .map_err(|e| Error::QuerySessionResponseChannel(e))? - .map_err(|e| Error::QuerySession(e)) + let (tx, rx) = oneshot::channel(); + let query_session_idx_for_child = AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::SessionIndexForChild(tx), + )); + + ctx.send_message(query_session_idx_for_child) + .await + .map_err(|e| Error::QuerySessionSendQuery(e))?; + rx.await + .map_err(|e| Error::QuerySessionResponseChannel(e))? + .map_err(|e| Error::QuerySession(e)) } /// Queries up to k ancestors with the constraints of equiv session async fn query_up_to_k_ancestors_in_same_session( - ctx: &mut Context, - relay_parent: Hash, - k: usize, + ctx: &mut Context, + relay_parent: Hash, + k: usize, ) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - // k + 1 since we always query the child's session index - // ordering is [parent, grandparent, greatgrandparent, greatgreatgrandparent, ...] - let ancestors = query_k_ancestors(ctx, relay_parent, k + 1).await?; - let desired_session = query_session_index_for_child(ctx, relay_parent).await?; - // we would only need `ancestors.len() - 1`, but the one extra could avoid a re-alloc - // if the consumer wants to push the `relay_parent` onto it too and does not hurt otherwise - let mut acc = Vec::with_capacity(ancestors.len()); - - // iterate from youngest to oldest - let mut iter = ancestors.into_iter().peekable(); - - while let Some(ancestor) = iter.next() { - if let Some(ancestor_parent) = iter.peek() { - let session = query_session_index_for_child(ctx, *ancestor_parent).await?; - if session != desired_session { - break; - } - acc.push(ancestor); - } else { - // either ended up at genesis or the blocks were - // already pruned - break; - } - } - - debug_assert!(acc.len() <= k); - Ok(acc) + // k + 1 since we always query the child's session index + // ordering is [parent, grandparent, greatgrandparent, greatgreatgrandparent, ...] + let ancestors = query_k_ancestors(ctx, relay_parent, k + 1).await?; + let desired_session = query_session_index_for_child(ctx, relay_parent).await?; + // we would only need `ancestors.len() - 1`, but the one extra could avoid a re-alloc + // if the consumer wants to push the `relay_parent` onto it too and does not hurt otherwise + let mut acc = Vec::with_capacity(ancestors.len()); + + // iterate from youngest to oldest + let mut iter = ancestors.into_iter().peekable(); + + while let Some(ancestor) = iter.next() { + if let Some(ancestor_parent) = iter.peek() { + let session = query_session_index_for_child(ctx, *ancestor_parent).await?; + if session != desired_session { + break; + } + acc.push(ancestor); + } else { + // either ended up at genesis or the blocks were + // already pruned + break; + } + } + + debug_assert!(acc.len() <= k); + Ok(acc) } - #[derive(Clone)] struct MetricsInner { - gossipped_availability_chunks: prometheus::Counter, + gossipped_availability_chunks: prometheus::Counter, } /// Availability Distribution metrics. @@ -1171,26 +1154,28 @@ struct MetricsInner { pub struct Metrics(Option); impl Metrics { - fn on_chunk_distributed(&self) { - if let Some(metrics) = &self.0 { - metrics.gossipped_availability_chunks.inc(); - } - } + fn on_chunk_distributed(&self) { + if let Some(metrics) = &self.0 { + metrics.gossipped_availability_chunks.inc(); + } + } } impl metrics::Metrics for Metrics { - fn try_register(registry: &prometheus::Registry) -> std::result::Result { - let metrics = MetricsInner { - gossipped_availability_chunks: prometheus::register( - prometheus::Counter::new( - "parachain_gossipped_availability_chunks_total", - "Number of availability chunks gossipped to other peers." - )?, - registry, - )?, - }; - Ok(Metrics(Some(metrics))) - } + fn try_register( + registry: &prometheus::Registry, + ) -> std::result::Result { + let metrics = MetricsInner { + gossipped_availability_chunks: prometheus::register( + prometheus::Counter::new( + "parachain_gossipped_availability_chunks_total", + "Number of availability chunks gossipped to other peers.", + )?, + registry, + )?, + }; + Ok(Metrics(Some(metrics))) + } } #[cfg(test)] diff --git a/node/network/availability-distribution/src/tests.rs b/node/network/availability-distribution/src/tests.rs index c04716639905..c42c0b7c6479 100644 --- a/node/network/availability-distribution/src/tests.rs +++ b/node/network/availability-distribution/src/tests.rs @@ -17,22 +17,21 @@ use super::*; use assert_matches::assert_matches; use polkadot_erasure_coding::{branches, obtain_chunks_v1 as obtain_chunks}; +use polkadot_node_network_protocol::ObservedRole; +use polkadot_node_subsystem_util::TimeoutExt; use polkadot_primitives::v1::{ - AvailableData, BlockData, CandidateCommitments, CandidateDescriptor, GroupIndex, - GroupRotationInfo, HeadData, PersistedValidationData, OccupiedCore, - PoV, ScheduledCore, + AvailableData, BlockData, CandidateCommitments, CandidateDescriptor, GroupIndex, + GroupRotationInfo, HeadData, OccupiedCore, PersistedValidationData, PoV, ScheduledCore, }; use polkadot_subsystem_testhelpers::{self as test_helpers}; -use polkadot_node_subsystem_util::TimeoutExt; -use polkadot_node_network_protocol::ObservedRole; use futures::{executor, future, Future}; use futures_timer::Delay; -use smallvec::smallvec; -use std::{sync::Arc, time::Duration}; use sc_keystore::LocalKeystore; -use sp_keystore::{SyncCryptoStorePtr, SyncCryptoStore}; +use smallvec::smallvec; use sp_application_crypto::AppKey; +use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr}; +use std::{sync::Arc, time::Duration}; macro_rules! view { ( $( $hash:expr ),* $(,)? ) => [ @@ -41,930 +40,931 @@ macro_rules! view { } macro_rules! delay { - ($delay:expr) => { - Delay::new(Duration::from_millis($delay)).await; - }; + ($delay:expr) => { + Delay::new(Duration::from_millis($delay)).await; + }; } -fn chunk_protocol_message(message: AvailabilityGossipMessage) - -> protocol_v1::AvailabilityDistributionMessage -{ - protocol_v1::AvailabilityDistributionMessage::Chunk( - message.candidate_hash, - message.erasure_chunk, - ) +fn chunk_protocol_message( + message: AvailabilityGossipMessage, +) -> protocol_v1::AvailabilityDistributionMessage { + protocol_v1::AvailabilityDistributionMessage::Chunk( + message.candidate_hash, + message.erasure_chunk, + ) } struct TestHarness { - virtual_overseer: test_helpers::TestSubsystemContextHandle, + virtual_overseer: test_helpers::TestSubsystemContextHandle, } fn test_harness>( - keystore: SyncCryptoStorePtr, - test: impl FnOnce(TestHarness) -> T, + keystore: SyncCryptoStorePtr, + test: impl FnOnce(TestHarness) -> T, ) { - let _ = env_logger::builder() - .is_test(true) - .filter( - Some("polkadot_availability_distribution"), - log::LevelFilter::Trace, - ) - .try_init(); + let _ = env_logger::builder() + .is_test(true) + .filter( + Some("polkadot_availability_distribution"), + log::LevelFilter::Trace, + ) + .try_init(); - let pool = sp_core::testing::TaskExecutor::new(); + let pool = sp_core::testing::TaskExecutor::new(); - let (context, virtual_overseer) = test_helpers::make_subsystem_context(pool.clone()); + let (context, virtual_overseer) = test_helpers::make_subsystem_context(pool.clone()); - let subsystem = AvailabilityDistributionSubsystem::new(keystore, Default::default()); - let subsystem = subsystem.run(context); + let subsystem = AvailabilityDistributionSubsystem::new(keystore, Default::default()); + let subsystem = subsystem.run(context); - let test_fut = test(TestHarness { virtual_overseer }); + let test_fut = test(TestHarness { virtual_overseer }); - futures::pin_mut!(test_fut); - futures::pin_mut!(subsystem); + futures::pin_mut!(test_fut); + futures::pin_mut!(subsystem); - executor::block_on(future::select(test_fut, subsystem)); + executor::block_on(future::select(test_fut, subsystem)); } const TIMEOUT: Duration = Duration::from_millis(100); async fn overseer_signal( - overseer: &mut test_helpers::TestSubsystemContextHandle, - signal: OverseerSignal, + overseer: &mut test_helpers::TestSubsystemContextHandle, + signal: OverseerSignal, ) { - delay!(50); - overseer - .send(FromOverseer::Signal(signal)) - .timeout(TIMEOUT) - .await - .expect("10ms is more than enough for sending signals."); + delay!(50); + overseer + .send(FromOverseer::Signal(signal)) + .timeout(TIMEOUT) + .await + .expect("10ms is more than enough for sending signals."); } async fn overseer_send( - overseer: &mut test_helpers::TestSubsystemContextHandle, - msg: AvailabilityDistributionMessage, + overseer: &mut test_helpers::TestSubsystemContextHandle, + msg: AvailabilityDistributionMessage, ) { - log::trace!("Sending message:\n{:?}", &msg); - overseer - .send(FromOverseer::Communication { msg }) - .timeout(TIMEOUT) - .await - .expect("10ms is more than enough for sending messages."); + log::trace!("Sending message:\n{:?}", &msg); + overseer + .send(FromOverseer::Communication { msg }) + .timeout(TIMEOUT) + .await + .expect("10ms is more than enough for sending messages."); } async fn overseer_recv( - overseer: &mut test_helpers::TestSubsystemContextHandle, + overseer: &mut test_helpers::TestSubsystemContextHandle, ) -> AllMessages { - log::trace!("Waiting for message ..."); - let msg = overseer - .recv() - .timeout(TIMEOUT) - .await - .expect("TIMEOUT is enough to recv."); - log::trace!("Received message:\n{:?}", &msg); - msg + log::trace!("Waiting for message ..."); + let msg = overseer + .recv() + .timeout(TIMEOUT) + .await + .expect("TIMEOUT is enough to recv."); + log::trace!("Received message:\n{:?}", &msg); + msg } fn dummy_occupied_core(para: ParaId) -> CoreState { - CoreState::Occupied(OccupiedCore { - para_id: para, - next_up_on_available: None, - occupied_since: 0, - time_out_at: 5, - next_up_on_time_out: None, - availability: Default::default(), - group_responsible: GroupIndex::from(0), - }) + CoreState::Occupied(OccupiedCore { + para_id: para, + next_up_on_available: None, + occupied_since: 0, + time_out_at: 5, + next_up_on_time_out: None, + availability: Default::default(), + group_responsible: GroupIndex::from(0), + }) } use sp_keyring::Sr25519Keyring; #[derive(Clone)] struct TestState { - chain_ids: Vec, - validators: Vec, - validator_public: Vec, - validator_index: Option, - validator_groups: (Vec>, GroupRotationInfo), - head_data: HashMap, - keystore: SyncCryptoStorePtr, - relay_parent: Hash, - ancestors: Vec, - availability_cores: Vec, - persisted_validation_data: PersistedValidationData, + chain_ids: Vec, + validators: Vec, + validator_public: Vec, + validator_index: Option, + validator_groups: (Vec>, GroupRotationInfo), + head_data: HashMap, + keystore: SyncCryptoStorePtr, + relay_parent: Hash, + ancestors: Vec, + availability_cores: Vec, + persisted_validation_data: PersistedValidationData, } fn validator_pubkeys(val_ids: &[Sr25519Keyring]) -> Vec { - val_ids.iter().map(|v| v.public().into()).collect() + val_ids.iter().map(|v| v.public().into()).collect() } impl Default for TestState { - fn default() -> Self { - let chain_a = ParaId::from(1); - let chain_b = ParaId::from(2); - - let chain_ids = vec![chain_a, chain_b]; - - let validators = vec![ - Sr25519Keyring::Ferdie, // <- this node, role: validator - Sr25519Keyring::Alice, - Sr25519Keyring::Bob, - Sr25519Keyring::Charlie, - Sr25519Keyring::Dave, - ]; - - let keystore: SyncCryptoStorePtr = Arc::new(LocalKeystore::in_memory()); - - SyncCryptoStore::sr25519_generate_new(&*keystore, ValidatorId::ID, Some(&validators[0].to_seed())) - .expect("Insert key into keystore"); - - let validator_public = validator_pubkeys(&validators); - - let validator_groups = vec![vec![2, 0, 4], vec![1], vec![3]]; - let group_rotation_info = GroupRotationInfo { - session_start_block: 0, - group_rotation_frequency: 100, - now: 1, - }; - let validator_groups = (validator_groups, group_rotation_info); - - let availability_cores = vec![ - CoreState::Scheduled(ScheduledCore { - para_id: chain_ids[0], - collator: None, - }), - CoreState::Scheduled(ScheduledCore { - para_id: chain_ids[1], - collator: None, - }), - ]; - - let mut head_data = HashMap::new(); - head_data.insert(chain_a, HeadData(vec![4, 5, 6])); - head_data.insert(chain_b, HeadData(vec![7, 8, 9])); - - let ancestors = vec![ - Hash::repeat_byte(0x44), - Hash::repeat_byte(0x33), - Hash::repeat_byte(0x22), - ]; - let relay_parent = Hash::repeat_byte(0x05); - - let persisted_validation_data = PersistedValidationData { - parent_head: HeadData(vec![7, 8, 9]), - block_number: Default::default(), - hrmp_mqc_heads: Vec::new(), - }; - - let validator_index = Some((validators.len() - 1) as ValidatorIndex); - - Self { - chain_ids, - keystore, - validators, - validator_public, - validator_groups, - availability_cores, - head_data, - persisted_validation_data, - relay_parent, - ancestors, - validator_index, - } - } + fn default() -> Self { + let chain_a = ParaId::from(1); + let chain_b = ParaId::from(2); + + let chain_ids = vec![chain_a, chain_b]; + + let validators = vec![ + Sr25519Keyring::Ferdie, // <- this node, role: validator + Sr25519Keyring::Alice, + Sr25519Keyring::Bob, + Sr25519Keyring::Charlie, + Sr25519Keyring::Dave, + ]; + + let keystore: SyncCryptoStorePtr = Arc::new(LocalKeystore::in_memory()); + + SyncCryptoStore::sr25519_generate_new( + &*keystore, + ValidatorId::ID, + Some(&validators[0].to_seed()), + ) + .expect("Insert key into keystore"); + + let validator_public = validator_pubkeys(&validators); + + let validator_groups = vec![vec![2, 0, 4], vec![1], vec![3]]; + let group_rotation_info = GroupRotationInfo { + session_start_block: 0, + group_rotation_frequency: 100, + now: 1, + }; + let validator_groups = (validator_groups, group_rotation_info); + + let availability_cores = vec![ + CoreState::Scheduled(ScheduledCore { + para_id: chain_ids[0], + collator: None, + }), + CoreState::Scheduled(ScheduledCore { + para_id: chain_ids[1], + collator: None, + }), + ]; + + let mut head_data = HashMap::new(); + head_data.insert(chain_a, HeadData(vec![4, 5, 6])); + head_data.insert(chain_b, HeadData(vec![7, 8, 9])); + + let ancestors = vec![ + Hash::repeat_byte(0x44), + Hash::repeat_byte(0x33), + Hash::repeat_byte(0x22), + ]; + let relay_parent = Hash::repeat_byte(0x05); + + let persisted_validation_data = PersistedValidationData { + parent_head: HeadData(vec![7, 8, 9]), + block_number: Default::default(), + hrmp_mqc_heads: Vec::new(), + }; + + let validator_index = Some((validators.len() - 1) as ValidatorIndex); + + Self { + chain_ids, + keystore, + validators, + validator_public, + validator_groups, + availability_cores, + head_data, + persisted_validation_data, + relay_parent, + ancestors, + validator_index, + } + } } fn make_available_data(test: &TestState, pov: PoV) -> AvailableData { - AvailableData { - validation_data: test.persisted_validation_data.clone(), - pov, - } + AvailableData { + validation_data: test.persisted_validation_data.clone(), + pov, + } } fn make_erasure_root(test: &TestState, pov: PoV) -> Hash { - let available_data = make_available_data(test, pov); + let available_data = make_available_data(test, pov); - let chunks = obtain_chunks(test.validators.len(), &available_data).unwrap(); - branches(&chunks).root() + let chunks = obtain_chunks(test.validators.len(), &available_data).unwrap(); + branches(&chunks).root() } fn make_valid_availability_gossip( - test: &TestState, - candidate_hash: Hash, - erasure_chunk_index: u32, - pov: PoV, + test: &TestState, + candidate_hash: Hash, + erasure_chunk_index: u32, + pov: PoV, ) -> AvailabilityGossipMessage { - let available_data = make_available_data(test, pov); + let available_data = make_available_data(test, pov); - let erasure_chunks = derive_erasure_chunks_with_proofs(test.validators.len(), &available_data); + let erasure_chunks = derive_erasure_chunks_with_proofs(test.validators.len(), &available_data); - let erasure_chunk: ErasureChunk = erasure_chunks - .get(erasure_chunk_index as usize) - .expect("Must be valid or input is oob") - .clone(); + let erasure_chunk: ErasureChunk = erasure_chunks + .get(erasure_chunk_index as usize) + .expect("Must be valid or input is oob") + .clone(); - AvailabilityGossipMessage { - candidate_hash, - erasure_chunk, - } + AvailabilityGossipMessage { + candidate_hash, + erasure_chunk, + } } #[derive(Default)] struct TestCandidateBuilder { - para_id: ParaId, - head_data: HeadData, - pov_hash: Hash, - relay_parent: Hash, - erasure_root: Hash, + para_id: ParaId, + head_data: HeadData, + pov_hash: Hash, + relay_parent: Hash, + erasure_root: Hash, } impl TestCandidateBuilder { - fn build(self) -> CommittedCandidateReceipt { - CommittedCandidateReceipt { - descriptor: CandidateDescriptor { - para_id: self.para_id, - pov_hash: self.pov_hash, - relay_parent: self.relay_parent, - ..Default::default() - }, - commitments: CandidateCommitments { - head_data: self.head_data, - erasure_root: self.erasure_root, - ..Default::default() - }, - } - } + fn build(self) -> CommittedCandidateReceipt { + CommittedCandidateReceipt { + descriptor: CandidateDescriptor { + para_id: self.para_id, + pov_hash: self.pov_hash, + relay_parent: self.relay_parent, + ..Default::default() + }, + commitments: CandidateCommitments { + head_data: self.head_data, + erasure_root: self.erasure_root, + ..Default::default() + }, + } + } } #[test] fn helper_integrity() { - let test_state = TestState::default(); - - let pov_block = PoV { - block_data: BlockData(vec![42, 43, 44]), - }; - - let pov_hash = pov_block.hash(); - - let candidate = TestCandidateBuilder { - para_id: test_state.chain_ids[0], - relay_parent: test_state.relay_parent, - pov_hash: pov_hash, - erasure_root: make_erasure_root(&test_state, pov_block.clone()), - ..Default::default() - } - .build(); - - let message = - make_valid_availability_gossip(&test_state, dbg!(candidate.hash()), 2, pov_block.clone()); - - let root = dbg!(&candidate.commitments.erasure_root); - - let anticipated_hash = branch_hash( - root, - &message.erasure_chunk.proof, - dbg!(message.erasure_chunk.index as usize), - ) - .expect("Must be able to derive branch hash"); - assert_eq!( - anticipated_hash, - BlakeTwo256::hash(&message.erasure_chunk.chunk) - ); + let test_state = TestState::default(); + + let pov_block = PoV { + block_data: BlockData(vec![42, 43, 44]), + }; + + let pov_hash = pov_block.hash(); + + let candidate = TestCandidateBuilder { + para_id: test_state.chain_ids[0], + relay_parent: test_state.relay_parent, + pov_hash: pov_hash, + erasure_root: make_erasure_root(&test_state, pov_block.clone()), + ..Default::default() + } + .build(); + + let message = + make_valid_availability_gossip(&test_state, dbg!(candidate.hash()), 2, pov_block.clone()); + + let root = dbg!(&candidate.commitments.erasure_root); + + let anticipated_hash = branch_hash( + root, + &message.erasure_chunk.proof, + dbg!(message.erasure_chunk.index as usize), + ) + .expect("Must be able to derive branch hash"); + assert_eq!( + anticipated_hash, + BlakeTwo256::hash(&message.erasure_chunk.chunk) + ); } fn derive_erasure_chunks_with_proofs( - n_validators: usize, - available_data: &AvailableData, + n_validators: usize, + available_data: &AvailableData, ) -> Vec { - let chunks: Vec> = obtain_chunks(n_validators, available_data).unwrap(); + let chunks: Vec> = obtain_chunks(n_validators, available_data).unwrap(); - // create proofs for each erasure chunk - let branches = branches(chunks.as_ref()); + // create proofs for each erasure chunk + let branches = branches(chunks.as_ref()); - let erasure_chunks = branches - .enumerate() - .map(|(index, (proof, chunk))| ErasureChunk { - chunk: chunk.to_vec(), - index: index as _, - proof, - }) - .collect::>(); + let erasure_chunks = branches + .enumerate() + .map(|(index, (proof, chunk))| ErasureChunk { + chunk: chunk.to_vec(), + index: index as _, + proof, + }) + .collect::>(); - erasure_chunks + erasure_chunks } #[test] fn reputation_verification() { - let test_state = TestState::default(); - - test_harness(test_state.keystore.clone(), |test_harness| async move { - let TestHarness { - mut virtual_overseer, - } = test_harness; - - let expected_head_data = test_state.head_data.get(&test_state.chain_ids[0]).unwrap(); - - let pov_block_a = PoV { - block_data: BlockData(vec![42, 43, 44]), - }; - - let pov_block_b = PoV { - block_data: BlockData(vec![45, 46, 47]), - }; - - let pov_block_c = PoV { - block_data: BlockData(vec![48, 49, 50]), - }; - - let pov_hash_a = pov_block_a.hash(); - let pov_hash_b = pov_block_b.hash(); - let pov_hash_c = pov_block_c.hash(); - - let candidates = vec![ - TestCandidateBuilder { - para_id: test_state.chain_ids[0], - relay_parent: test_state.relay_parent, - pov_hash: pov_hash_a, - erasure_root: make_erasure_root(&test_state, pov_block_a.clone()), - ..Default::default() - } - .build(), - TestCandidateBuilder { - para_id: test_state.chain_ids[0], - relay_parent: test_state.relay_parent, - pov_hash: pov_hash_b, - erasure_root: make_erasure_root(&test_state, pov_block_b.clone()), - head_data: expected_head_data.clone(), - ..Default::default() - } - .build(), - TestCandidateBuilder { - para_id: test_state.chain_ids[1], - relay_parent: Hash::repeat_byte(0xFA), - pov_hash: pov_hash_c, - erasure_root: make_erasure_root(&test_state, pov_block_c.clone()), - head_data: test_state - .head_data - .get(&test_state.chain_ids[1]) - .unwrap() - .clone(), - ..Default::default() - } - .build(), - ]; - - let TestState { - chain_ids, - keystore: _, - validators: _, - validator_public, - validator_groups, - availability_cores, - head_data: _, - persisted_validation_data: _, - relay_parent: current, - ancestors, - validator_index: _, - } = test_state.clone(); - - let _ = validator_groups; - let _ = availability_cores; - - let peer_a = PeerId::random(); - let peer_b = PeerId::random(); - assert_ne!(&peer_a, &peer_b); - - log::trace!("peer A: {:?}", peer_a); - log::trace!("peer B: {:?}", peer_b); - - log::trace!("candidate A: {:?}", candidates[0].hash()); - log::trace!("candidate B: {:?}", candidates[1].hash()); - - overseer_signal( - &mut virtual_overseer, - OverseerSignal::ActiveLeaves(ActiveLeavesUpdate { - activated: smallvec![current.clone()], - deactivated: smallvec![], - }), - ) - .await; - - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::OurViewChange(view![current,]), - ), - ) - .await; - - // obtain the validators per relay parent - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::Validators(tx), - )) => { - assert_eq!(relay_parent, current); - tx.send(Ok(validator_public.clone())).unwrap(); - } - ); - - let genesis = Hash::repeat_byte(0xAA); - // query of k ancestors, we only provide one - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::ChainApi(ChainApiMessage::Ancestors { - hash: relay_parent, - k, - response_channel: tx, - }) => { - assert_eq!(relay_parent, current); - assert_eq!(k, AvailabilityDistributionSubsystem::K + 1); - // 0xAA..AA will not be included, since there is no mean to determine - // its session index - tx.send(Ok(vec![ancestors[0].clone(), genesis])).unwrap(); - } - ); - - // state query for each of them - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::SessionIndexForChild(tx) - )) => { - assert_eq!(relay_parent, current); - tx.send(Ok(1 as SessionIndex)).unwrap(); - } - ); - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::SessionIndexForChild(tx) - )) => { - assert_eq!(relay_parent, genesis); - tx.send(Ok(1 as SessionIndex)).unwrap(); - } - ); - - // subsystem peer id collection - // which will query the availability cores - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::AvailabilityCores(tx) - )) => { - assert_eq!(relay_parent, ancestors[0]); - // respond with a set of availability core states - tx.send(Ok(vec![ - dummy_occupied_core(chain_ids[0]), - dummy_occupied_core(chain_ids[1]) - ])).unwrap(); - } - ); - - // now each of the relay parents in the view (1) will - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::CandidatePendingAvailability(para, tx) - )) => { - assert_eq!(relay_parent, ancestors[0]); - assert_eq!(para, chain_ids[0]); - tx.send(Ok(Some( - candidates[0].clone() - ))).unwrap(); - } - ); - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::CandidatePendingAvailability(para, tx) - )) => { - assert_eq!(relay_parent, ancestors[0]); - assert_eq!(para, chain_ids[1]); - tx.send(Ok(Some( - candidates[1].clone() - ))).unwrap(); - } - ); - - for _ in 0usize..1 { - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - _relay_parent, - RuntimeApiRequest::AvailabilityCores(tx), - )) => { - tx.send(Ok(vec![ - CoreState::Occupied(OccupiedCore { - para_id: chain_ids[0].clone(), - next_up_on_available: None, - occupied_since: 0, - time_out_at: 10, - next_up_on_time_out: None, - availability: Default::default(), - group_responsible: GroupIndex::from(0), - }), - CoreState::Free, - CoreState::Free, - CoreState::Occupied(OccupiedCore { - para_id: chain_ids[1].clone(), - next_up_on_available: None, - occupied_since: 1, - time_out_at: 7, - next_up_on_time_out: None, - availability: Default::default(), - group_responsible: GroupIndex::from(0), - }), - CoreState::Free, - CoreState::Free, - ])).unwrap(); - } - ); - - // query the availability cores for each of the paras (2) - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi( - RuntimeApiMessage::Request( - _relay_parent, - RuntimeApiRequest::CandidatePendingAvailability(para, tx), - ) - ) => { - assert_eq!(para, chain_ids[0]); - tx.send(Ok(Some( - candidates[0].clone() - ))).unwrap(); - } - ); - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - _relay_parent, - RuntimeApiRequest::CandidatePendingAvailability(para, tx), - )) => { - assert_eq!(para, chain_ids[1]); - tx.send(Ok(Some( - candidates[1].clone() - ))).unwrap(); - } - ); - } - - let mut candidates2 = candidates.clone(); - // check if the availability store can provide the desired erasure chunks - for i in 0usize..2 { - log::trace!("0000"); - let avail_data = make_available_data(&test_state, pov_block_a.clone()); - let chunks = - derive_erasure_chunks_with_proofs(test_state.validators.len(), &avail_data); - - let expected; - // store the chunk to the av store - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::AvailabilityStore( - AvailabilityStoreMessage::QueryDataAvailability( - candidate_hash, - tx, - ) - ) => { - let index = candidates2.iter().enumerate().find(|x| { x.1.hash() == candidate_hash }).map(|x| x.0).unwrap(); - expected = dbg!(candidates2.swap_remove(index).hash()); - tx.send( - i == 0 - ).unwrap(); - } - ); - - assert_eq!(chunks.len(), test_state.validators.len()); - - log::trace!("xxxx"); - // retrieve a stored chunk - for (j, chunk) in chunks.into_iter().enumerate() { - log::trace!("yyyy i={}, j={}", i, j); - if i != 0 { - // not a validator, so this never happens - break; - } - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::AvailabilityStore( - AvailabilityStoreMessage::QueryChunk( - candidate_hash, - idx, - tx, - ) - ) => { - assert_eq!(candidate_hash, expected); - assert_eq!(j as u32, chunk.index); - assert_eq!(idx, j as u32); - tx.send( - Some(chunk.clone()) - ).unwrap(); - } - ); - } - } - // setup peer a with interest in current - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerConnected(peer_a.clone(), ObservedRole::Full), - ), - ) - .await; - - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerViewChange(peer_a.clone(), view![current]), - ), - ) - .await; - - // setup peer b with interest in ancestor - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerConnected(peer_b.clone(), ObservedRole::Full), - ), - ) - .await; - - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerViewChange(peer_b.clone(), view![ancestors[0]]), - ), - ) - .await; - - delay!(100); - - let valid: AvailabilityGossipMessage = make_valid_availability_gossip( - &test_state, - candidates[0].hash(), - 2, - pov_block_a.clone(), - ); - - { - // valid (first, from b) - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerMessage( - peer_b.clone(), - chunk_protocol_message(valid.clone()), - ), - ), - ) - .await; - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer( - peer, - rep - ) - ) => { - assert_eq!(peer, peer_b); - assert_eq!(rep, BENEFIT_VALID_MESSAGE_FIRST); - } - ); - } - - { - // valid (duplicate, from b) - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerMessage( - peer_b.clone(), - chunk_protocol_message(valid.clone()), - ), - ), - ) - .await; - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer( - peer, - rep - ) - ) => { - assert_eq!(peer, peer_b); - assert_eq!(rep, COST_PEER_DUPLICATE_MESSAGE); - } - ); - } - - { - // valid (second, from a) - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - chunk_protocol_message(valid.clone()), - ), - ), - ) - .await; - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer( - peer, - rep - ) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, BENEFIT_VALID_MESSAGE); - } - ); - } - - // peer a is not interested in anything anymore - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerViewChange(peer_a.clone(), view![]), - ), - ) - .await; - - { - // send the a message again, so we should detect the duplicate - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - chunk_protocol_message(valid.clone()), - ), - ), - ) - .await; - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer( - peer, - rep - ) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, COST_PEER_DUPLICATE_MESSAGE); - } - ); - } - - // peer b sends a message before we have the view - // setup peer a with interest in parent x - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerDisconnected(peer_b.clone()), - ), - ) - .await; - - delay!(10); - - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerConnected(peer_b.clone(), ObservedRole::Full), - ), - ) - .await; - - { - // send another message - let valid2: AvailabilityGossipMessage = make_valid_availability_gossip( - &test_state, - candidates[2].hash(), - 1, - pov_block_c.clone(), - ); - - // send the a message before we send a view update - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - chunk_protocol_message(valid2), - ), - ), - ) - .await; - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer( - peer, - rep - ) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, COST_NOT_A_LIVE_CANDIDATE); - } - ); - } - }); + let test_state = TestState::default(); + + test_harness(test_state.keystore.clone(), |test_harness| async move { + let TestHarness { + mut virtual_overseer, + } = test_harness; + + let expected_head_data = test_state.head_data.get(&test_state.chain_ids[0]).unwrap(); + + let pov_block_a = PoV { + block_data: BlockData(vec![42, 43, 44]), + }; + + let pov_block_b = PoV { + block_data: BlockData(vec![45, 46, 47]), + }; + + let pov_block_c = PoV { + block_data: BlockData(vec![48, 49, 50]), + }; + + let pov_hash_a = pov_block_a.hash(); + let pov_hash_b = pov_block_b.hash(); + let pov_hash_c = pov_block_c.hash(); + + let candidates = vec![ + TestCandidateBuilder { + para_id: test_state.chain_ids[0], + relay_parent: test_state.relay_parent, + pov_hash: pov_hash_a, + erasure_root: make_erasure_root(&test_state, pov_block_a.clone()), + ..Default::default() + } + .build(), + TestCandidateBuilder { + para_id: test_state.chain_ids[0], + relay_parent: test_state.relay_parent, + pov_hash: pov_hash_b, + erasure_root: make_erasure_root(&test_state, pov_block_b.clone()), + head_data: expected_head_data.clone(), + ..Default::default() + } + .build(), + TestCandidateBuilder { + para_id: test_state.chain_ids[1], + relay_parent: Hash::repeat_byte(0xFA), + pov_hash: pov_hash_c, + erasure_root: make_erasure_root(&test_state, pov_block_c.clone()), + head_data: test_state + .head_data + .get(&test_state.chain_ids[1]) + .unwrap() + .clone(), + ..Default::default() + } + .build(), + ]; + + let TestState { + chain_ids, + keystore: _, + validators: _, + validator_public, + validator_groups, + availability_cores, + head_data: _, + persisted_validation_data: _, + relay_parent: current, + ancestors, + validator_index: _, + } = test_state.clone(); + + let _ = validator_groups; + let _ = availability_cores; + + let peer_a = PeerId::random(); + let peer_b = PeerId::random(); + assert_ne!(&peer_a, &peer_b); + + log::trace!("peer A: {:?}", peer_a); + log::trace!("peer B: {:?}", peer_b); + + log::trace!("candidate A: {:?}", candidates[0].hash()); + log::trace!("candidate B: {:?}", candidates[1].hash()); + + overseer_signal( + &mut virtual_overseer, + OverseerSignal::ActiveLeaves(ActiveLeavesUpdate { + activated: smallvec![current.clone()], + deactivated: smallvec![], + }), + ) + .await; + + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::OurViewChange(view![current,]), + ), + ) + .await; + + // obtain the validators per relay parent + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::Validators(tx), + )) => { + assert_eq!(relay_parent, current); + tx.send(Ok(validator_public.clone())).unwrap(); + } + ); + + let genesis = Hash::repeat_byte(0xAA); + // query of k ancestors, we only provide one + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::ChainApi(ChainApiMessage::Ancestors { + hash: relay_parent, + k, + response_channel: tx, + }) => { + assert_eq!(relay_parent, current); + assert_eq!(k, AvailabilityDistributionSubsystem::K + 1); + // 0xAA..AA will not be included, since there is no mean to determine + // its session index + tx.send(Ok(vec![ancestors[0].clone(), genesis])).unwrap(); + } + ); + + // state query for each of them + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::SessionIndexForChild(tx) + )) => { + assert_eq!(relay_parent, current); + tx.send(Ok(1 as SessionIndex)).unwrap(); + } + ); + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::SessionIndexForChild(tx) + )) => { + assert_eq!(relay_parent, genesis); + tx.send(Ok(1 as SessionIndex)).unwrap(); + } + ); + + // subsystem peer id collection + // which will query the availability cores + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::AvailabilityCores(tx) + )) => { + assert_eq!(relay_parent, ancestors[0]); + // respond with a set of availability core states + tx.send(Ok(vec![ + dummy_occupied_core(chain_ids[0]), + dummy_occupied_core(chain_ids[1]) + ])).unwrap(); + } + ); + + // now each of the relay parents in the view (1) will + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::CandidatePendingAvailability(para, tx) + )) => { + assert_eq!(relay_parent, ancestors[0]); + assert_eq!(para, chain_ids[0]); + tx.send(Ok(Some( + candidates[0].clone() + ))).unwrap(); + } + ); + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::CandidatePendingAvailability(para, tx) + )) => { + assert_eq!(relay_parent, ancestors[0]); + assert_eq!(para, chain_ids[1]); + tx.send(Ok(Some( + candidates[1].clone() + ))).unwrap(); + } + ); + + for _ in 0usize..1 { + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + _relay_parent, + RuntimeApiRequest::AvailabilityCores(tx), + )) => { + tx.send(Ok(vec![ + CoreState::Occupied(OccupiedCore { + para_id: chain_ids[0].clone(), + next_up_on_available: None, + occupied_since: 0, + time_out_at: 10, + next_up_on_time_out: None, + availability: Default::default(), + group_responsible: GroupIndex::from(0), + }), + CoreState::Free, + CoreState::Free, + CoreState::Occupied(OccupiedCore { + para_id: chain_ids[1].clone(), + next_up_on_available: None, + occupied_since: 1, + time_out_at: 7, + next_up_on_time_out: None, + availability: Default::default(), + group_responsible: GroupIndex::from(0), + }), + CoreState::Free, + CoreState::Free, + ])).unwrap(); + } + ); + + // query the availability cores for each of the paras (2) + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request( + _relay_parent, + RuntimeApiRequest::CandidatePendingAvailability(para, tx), + ) + ) => { + assert_eq!(para, chain_ids[0]); + tx.send(Ok(Some( + candidates[0].clone() + ))).unwrap(); + } + ); + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + _relay_parent, + RuntimeApiRequest::CandidatePendingAvailability(para, tx), + )) => { + assert_eq!(para, chain_ids[1]); + tx.send(Ok(Some( + candidates[1].clone() + ))).unwrap(); + } + ); + } + + let mut candidates2 = candidates.clone(); + // check if the availability store can provide the desired erasure chunks + for i in 0usize..2 { + log::trace!("0000"); + let avail_data = make_available_data(&test_state, pov_block_a.clone()); + let chunks = + derive_erasure_chunks_with_proofs(test_state.validators.len(), &avail_data); + + let expected; + // store the chunk to the av store + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::AvailabilityStore( + AvailabilityStoreMessage::QueryDataAvailability( + candidate_hash, + tx, + ) + ) => { + let index = candidates2.iter().enumerate().find(|x| { x.1.hash() == candidate_hash }).map(|x| x.0).unwrap(); + expected = dbg!(candidates2.swap_remove(index).hash()); + tx.send( + i == 0 + ).unwrap(); + } + ); + + assert_eq!(chunks.len(), test_state.validators.len()); + + log::trace!("xxxx"); + // retrieve a stored chunk + for (j, chunk) in chunks.into_iter().enumerate() { + log::trace!("yyyy i={}, j={}", i, j); + if i != 0 { + // not a validator, so this never happens + break; + } + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::AvailabilityStore( + AvailabilityStoreMessage::QueryChunk( + candidate_hash, + idx, + tx, + ) + ) => { + assert_eq!(candidate_hash, expected); + assert_eq!(j as u32, chunk.index); + assert_eq!(idx, j as u32); + tx.send( + Some(chunk.clone()) + ).unwrap(); + } + ); + } + } + // setup peer a with interest in current + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerConnected(peer_a.clone(), ObservedRole::Full), + ), + ) + .await; + + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerViewChange(peer_a.clone(), view![current]), + ), + ) + .await; + + // setup peer b with interest in ancestor + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerConnected(peer_b.clone(), ObservedRole::Full), + ), + ) + .await; + + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerViewChange(peer_b.clone(), view![ancestors[0]]), + ), + ) + .await; + + delay!(100); + + let valid: AvailabilityGossipMessage = make_valid_availability_gossip( + &test_state, + candidates[0].hash(), + 2, + pov_block_a.clone(), + ); + + { + // valid (first, from b) + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerMessage( + peer_b.clone(), + chunk_protocol_message(valid.clone()), + ), + ), + ) + .await; + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer( + peer, + rep + ) + ) => { + assert_eq!(peer, peer_b); + assert_eq!(rep, BENEFIT_VALID_MESSAGE_FIRST); + } + ); + } + + { + // valid (duplicate, from b) + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerMessage( + peer_b.clone(), + chunk_protocol_message(valid.clone()), + ), + ), + ) + .await; + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer( + peer, + rep + ) + ) => { + assert_eq!(peer, peer_b); + assert_eq!(rep, COST_PEER_DUPLICATE_MESSAGE); + } + ); + } + + { + // valid (second, from a) + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + chunk_protocol_message(valid.clone()), + ), + ), + ) + .await; + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer( + peer, + rep + ) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, BENEFIT_VALID_MESSAGE); + } + ); + } + + // peer a is not interested in anything anymore + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerViewChange(peer_a.clone(), view![]), + ), + ) + .await; + + { + // send the a message again, so we should detect the duplicate + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + chunk_protocol_message(valid.clone()), + ), + ), + ) + .await; + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer( + peer, + rep + ) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, COST_PEER_DUPLICATE_MESSAGE); + } + ); + } + + // peer b sends a message before we have the view + // setup peer a with interest in parent x + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerDisconnected(peer_b.clone()), + ), + ) + .await; + + delay!(10); + + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerConnected(peer_b.clone(), ObservedRole::Full), + ), + ) + .await; + + { + // send another message + let valid2: AvailabilityGossipMessage = make_valid_availability_gossip( + &test_state, + candidates[2].hash(), + 1, + pov_block_c.clone(), + ); + + // send the a message before we send a view update + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerMessage(peer_a.clone(), chunk_protocol_message(valid2)), + ), + ) + .await; + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer( + peer, + rep + ) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, COST_NOT_A_LIVE_CANDIDATE); + } + ); + } + }); } #[test] fn k_ancestors_in_session() { - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut virtual_overseer) = - test_helpers::make_subsystem_context::(pool); - - const DATA: &[(Hash, SessionIndex)] = &[ - (Hash::repeat_byte(0x32), 3), // relay parent - (Hash::repeat_byte(0x31), 3), // grand parent - (Hash::repeat_byte(0x30), 3), // great ... - (Hash::repeat_byte(0x20), 2), - (Hash::repeat_byte(0x12), 1), - (Hash::repeat_byte(0x11), 1), - (Hash::repeat_byte(0x10), 1), - ]; - const K: usize = 5; - - const EXPECTED: &[Hash] = &[DATA[1].0, DATA[2].0]; - - let test_fut = async move { - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::ChainApi(ChainApiMessage::Ancestors { - hash: relay_parent, - k, - response_channel: tx, - }) => { - assert_eq!(k, K+1); - assert_eq!(relay_parent, DATA[0].0); - tx.send(Ok(DATA[1..=k].into_iter().map(|x| x.0).collect::>())).unwrap(); - } - ); - - // query the desired session index of the relay parent - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::SessionIndexForChild(tx), - )) => { - assert_eq!(relay_parent, DATA[0].0); - let session: SessionIndex = DATA[0].1; - tx.send(Ok(session)).unwrap(); - } - ); - - // query ancestors - for i in 2usize..=(EXPECTED.len() + 1 + 1) { - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::SessionIndexForChild(tx), - )) => { - // query is for ancestor_parent - let x = &DATA[i]; - assert_eq!(relay_parent, x.0); - // but needs to yield ancestor_parent's child's session index - let x = &DATA[i-1]; - tx.send(Ok(x.1)).unwrap(); - } - ); - } - }; - - let sut = async move { - let ancestors = query_up_to_k_ancestors_in_same_session(&mut ctx, DATA[0].0, K) - .await - .unwrap(); - assert_eq!(ancestors, EXPECTED.to_vec()); - }; - - futures::pin_mut!(test_fut); - futures::pin_mut!(sut); - - executor::block_on(future::join(test_fut, sut).timeout(Duration::from_millis(1000))); + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut virtual_overseer) = + test_helpers::make_subsystem_context::(pool); + + const DATA: &[(Hash, SessionIndex)] = &[ + (Hash::repeat_byte(0x32), 3), // relay parent + (Hash::repeat_byte(0x31), 3), // grand parent + (Hash::repeat_byte(0x30), 3), // great ... + (Hash::repeat_byte(0x20), 2), + (Hash::repeat_byte(0x12), 1), + (Hash::repeat_byte(0x11), 1), + (Hash::repeat_byte(0x10), 1), + ]; + const K: usize = 5; + + const EXPECTED: &[Hash] = &[DATA[1].0, DATA[2].0]; + + let test_fut = async move { + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::ChainApi(ChainApiMessage::Ancestors { + hash: relay_parent, + k, + response_channel: tx, + }) => { + assert_eq!(k, K+1); + assert_eq!(relay_parent, DATA[0].0); + tx.send(Ok(DATA[1..=k].into_iter().map(|x| x.0).collect::>())).unwrap(); + } + ); + + // query the desired session index of the relay parent + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::SessionIndexForChild(tx), + )) => { + assert_eq!(relay_parent, DATA[0].0); + let session: SessionIndex = DATA[0].1; + tx.send(Ok(session)).unwrap(); + } + ); + + // query ancestors + for i in 2usize..=(EXPECTED.len() + 1 + 1) { + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::SessionIndexForChild(tx), + )) => { + // query is for ancestor_parent + let x = &DATA[i]; + assert_eq!(relay_parent, x.0); + // but needs to yield ancestor_parent's child's session index + let x = &DATA[i-1]; + tx.send(Ok(x.1)).unwrap(); + } + ); + } + }; + + let sut = async move { + let ancestors = query_up_to_k_ancestors_in_same_session(&mut ctx, DATA[0].0, K) + .await + .unwrap(); + assert_eq!(ancestors, EXPECTED.to_vec()); + }; + + futures::pin_mut!(test_fut); + futures::pin_mut!(sut); + + executor::block_on(future::join(test_fut, sut).timeout(Duration::from_millis(1000))); } From 727fcf1a94f99a73911c57db5fc4f0e40e4991b5 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Fri, 23 Oct 2020 15:07:32 +0200 Subject: [PATCH 19/62] chore add #![deny(..)] to most files. --- Cargo.lock | 60 ------------------- node/core/backing/src/lib.rs | 2 + node/core/bitfield-signing/src/lib.rs | 3 + node/core/candidate-selection/src/lib.rs | 2 +- node/core/candidate-validation/src/lib.rs | 6 +- node/core/chain-api/src/lib.rs | 3 + node/core/proposer/src/lib.rs | 20 +++++++ node/core/provisioner/src/lib.rs | 2 +- node/core/runtime-api/src/lib.rs | 3 + .../availability-distribution/src/lib.rs | 4 +- node/network/bitfield-distribution/src/lib.rs | 2 + node/network/bridge/src/lib.rs | 3 + node/network/collator-protocol/src/lib.rs | 2 +- node/network/pov-distribution/src/lib.rs | 3 + node/network/protocol/src/lib.rs | 3 + .../network/statement-distribution/src/lib.rs | 3 + node/overseer/Cargo.toml | 1 - node/overseer/src/lib.rs | 12 ++-- node/primitives/src/lib.rs | 2 + node/service/src/lib.rs | 6 +- node/subsystem-test-helpers/src/lib.rs | 3 + node/subsystem-util/src/lib.rs | 8 ++- 22 files changed, 77 insertions(+), 76 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aaa82766d524..5618c1799e34 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -817,32 +817,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "color-eyre" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2a5123db5af8349c41c43ed0e5dca1cd56c911ea0c4ce6e6ff30f159fa5d27e" -dependencies = [ - "backtrace", - "color-spantrace", - "eyre", - "indenter", - "once_cell 1.4.1", - "owo-colors", - "tracing-error", -] - -[[package]] -name = "color-spantrace" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a99aa4aa18448eef4c7d3f86d2720d2d8cad5c860fe9ff9b279293efdc8f5be" -dependencies = [ - "ansi_term 0.11.0", - "tracing-core", - "tracing-error", -] - [[package]] name = "concurrent-queue" version = "1.2.2" @@ -1407,16 +1381,6 @@ dependencies = [ "futures 0.3.5", ] -[[package]] -name = "eyre" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c5cb4dc433c59f09df4b4450f649cbfed61e8a3505abe32e4154066439157e" -dependencies = [ - "indenter", - "once_cell 1.4.1", -] - [[package]] name = "failure" version = "0.1.8" @@ -2427,12 +2391,6 @@ dependencies = [ "syn 1.0.33", ] -[[package]] -name = "indenter" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0bd112d44d9d870a6819eb505d04dd92b5e4d94bb8c304924a0872ae7016fb5" - [[package]] name = "indexmap" version = "1.4.0" @@ -3895,12 +3853,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "owo-colors" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a1250cdd103eef6bd542b5ae82989f931fc00a41a27f60377338241594410f3" - [[package]] name = "pallet-authority-discovery" version = "2.0.0" @@ -5254,8 +5206,6 @@ name = "polkadot-overseer" version = "0.1.0" dependencies = [ "async-trait", - "color-eyre", - "eyre", "femme", "futures 0.3.5", "futures-timer 3.0.2", @@ -9447,16 +9397,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "tracing-error" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4d7c0b83d4a500748fa5879461652b361edf5c9d51ede2a2ac03875ca185e24" -dependencies = [ - "tracing", - "tracing-subscriber", -] - [[package]] name = "tracing-futures" version = "0.2.4" diff --git a/node/core/backing/src/lib.rs b/node/core/backing/src/lib.rs index 8a7d2847b6fe..d19dd97b1d83 100644 --- a/node/core/backing/src/lib.rs +++ b/node/core/backing/src/lib.rs @@ -16,6 +16,8 @@ //! Implements a `CandidateBackingSubsystem`. +#![deny(unused_extern_crates, unused_results)] + use std::collections::{HashMap, HashSet}; use std::convert::TryFrom; use std::pin::Pin; diff --git a/node/core/bitfield-signing/src/lib.rs b/node/core/bitfield-signing/src/lib.rs index 059cd07c7c4d..b973efdd7871 100644 --- a/node/core/bitfield-signing/src/lib.rs +++ b/node/core/bitfield-signing/src/lib.rs @@ -16,6 +16,9 @@ //! The bitfield signing subsystem produces `SignedAvailabilityBitfield`s once per block. +#![deny(unused_extern_crates, unused_results)] +#![warn(missing_docs)] + use bitvec::bitvec; use futures::{ channel::{mpsc, oneshot}, diff --git a/node/core/candidate-selection/src/lib.rs b/node/core/candidate-selection/src/lib.rs index 84c1c9f1120d..d622fe5feb35 100644 --- a/node/core/candidate-selection/src/lib.rs +++ b/node/core/candidate-selection/src/lib.rs @@ -17,7 +17,7 @@ //! The provisioner is responsible for assembling a relay chain block //! from a set of available parachain candidates of its choice. -#![deny(missing_docs)] +#![deny(missing_docs, unused_extern_crates, unused_results)] use futures::{ channel::{mpsc, oneshot}, diff --git a/node/core/candidate-validation/src/lib.rs b/node/core/candidate-validation/src/lib.rs index 396b9dff4a6c..089731000df3 100644 --- a/node/core/candidate-validation/src/lib.rs +++ b/node/core/candidate-validation/src/lib.rs @@ -20,6 +20,9 @@ //! according to a validation function. This delegates validation to an underlying //! pool of processes used for execution of the Wasm. +#![deny(unused_extern_crates, unused_results)] +#![warn(missing_docs)] + use polkadot_subsystem::{ Subsystem, SubsystemContext, SpawnedSubsystem, SubsystemResult, FromOverseer, OverseerSignal, @@ -118,7 +121,8 @@ impl Subsystem for CandidateValidationSubsystem where fn start(self, ctx: C) -> SpawnedSubsystem { let future = run(ctx, self.spawn, self.metrics) .map_err(|e| SubsystemError::with_origin("candidate-validation", e)) - .map(|_| ()).boxed(); + .map(|_| ()) + .boxed(); SpawnedSubsystem { name: "candidate-validation-subsystem", future, diff --git a/node/core/chain-api/src/lib.rs b/node/core/chain-api/src/lib.rs index 06b07703936d..82fee0082303 100644 --- a/node/core/chain-api/src/lib.rs +++ b/node/core/chain-api/src/lib.rs @@ -27,6 +27,9 @@ //! * Last finalized block number //! * Ancestors +#![deny(unused_extern_crates, unused_results)] +#![warn(missing_docs)] + use polkadot_subsystem::{ FromOverseer, OverseerSignal, SpawnedSubsystem, Subsystem, SubsystemResult, SubsystemContext, diff --git a/node/core/proposer/src/lib.rs b/node/core/proposer/src/lib.rs index 07a3aff989e8..3e88eba721d4 100644 --- a/node/core/proposer/src/lib.rs +++ b/node/core/proposer/src/lib.rs @@ -1,3 +1,23 @@ +// Copyright 2020 Parity Technologies (UK) Ltd. +// This file is part of Polkadot. + +// Polkadot is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Polkadot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Polkadot. If not, see . + +//! The proposer proposes new blocks to include + +#![deny(unused_extern_crates, unused_results)] + use futures::prelude::*; use futures::select; use polkadot_node_subsystem::{messages::{AllMessages, ProvisionerInherentData, ProvisionerMessage}, SubsystemError}; diff --git a/node/core/provisioner/src/lib.rs b/node/core/provisioner/src/lib.rs index 9c4f634b9fd4..e83ed31925d1 100644 --- a/node/core/provisioner/src/lib.rs +++ b/node/core/provisioner/src/lib.rs @@ -17,7 +17,7 @@ //! The provisioner is responsible for assembling a relay chain block //! from a set of available parachain candidates of its choice. -#![deny(missing_docs)] +#![deny(missing_docs, unused_extern_crates, unused_results)] use bitvec::vec::BitVec; use futures::{ diff --git a/node/core/runtime-api/src/lib.rs b/node/core/runtime-api/src/lib.rs index d73f4910b28a..ae64a0433661 100644 --- a/node/core/runtime-api/src/lib.rs +++ b/node/core/runtime-api/src/lib.rs @@ -19,6 +19,9 @@ //! This provides a clean, ownerless wrapper around the parachain-related runtime APIs. This crate //! can also be used to cache responses from heavy runtime APIs. +#![deny(unused_extern_crates, unused_results)] +#![warn(missing_docs)] + use polkadot_subsystem::{ Subsystem, SpawnedSubsystem, SubsystemResult, SubsystemContext, FromOverseer, OverseerSignal, diff --git a/node/network/availability-distribution/src/lib.rs b/node/network/availability-distribution/src/lib.rs index 195a1fb4cfac..12463a765f8e 100644 --- a/node/network/availability-distribution/src/lib.rs +++ b/node/network/availability-distribution/src/lib.rs @@ -22,7 +22,8 @@ //! peers. Verified in this context means, the erasure chunks contained merkle proof //! is checked. -#[deny(unused_extern_crates, unused_results, unused_qualifications)] +#![deny(unused_extern_crates, unused_results, unused_qualifications)] + use codec::{Decode, Encode}; use futures::{channel::oneshot, FutureExt, TryFutureExt}; @@ -51,6 +52,7 @@ use polkadot_subsystem::{ use std::collections::{HashMap, HashSet}; use std::iter; use thiserror::Error; + const TARGET: &'static str = "avad"; #[derive(Debug, Error)] diff --git a/node/network/bitfield-distribution/src/lib.rs b/node/network/bitfield-distribution/src/lib.rs index d402a0132aa0..02f4c3cc7cf7 100644 --- a/node/network/bitfield-distribution/src/lib.rs +++ b/node/network/bitfield-distribution/src/lib.rs @@ -20,6 +20,8 @@ //! for a particular relay parent. //! Independently of that, gossips on received messages from peers to other interested peers. +#![deny(unused_extern_crates, unused_results)] + use codec::{Decode, Encode}; use futures::{channel::oneshot, FutureExt}; diff --git a/node/network/bridge/src/lib.rs b/node/network/bridge/src/lib.rs index c7212b55f9b3..96fc2b589570 100644 --- a/node/network/bridge/src/lib.rs +++ b/node/network/bridge/src/lib.rs @@ -16,6 +16,9 @@ //! The Network Bridge Subsystem - protocol multiplexer for Polkadot. +#![deny(unused_extern_crates, unused_results)] +#![warn(missing_docs)] + use parity_scale_codec::{Encode, Decode}; use futures::prelude::*; use futures::future::BoxFuture; diff --git a/node/network/collator-protocol/src/lib.rs b/node/network/collator-protocol/src/lib.rs index f4bed40cd690..8d39e1cea686 100644 --- a/node/network/collator-protocol/src/lib.rs +++ b/node/network/collator-protocol/src/lib.rs @@ -17,7 +17,7 @@ //! The Collator Protocol allows collators and validators talk to each other. //! This subsystem implements both sides of the collator protocol. -#![deny(missing_docs)] +#![deny(missing_docs, unused_extern_crates, unused_results)] use std::time::Duration; use futures::{channel::oneshot, FutureExt}; diff --git a/node/network/pov-distribution/src/lib.rs b/node/network/pov-distribution/src/lib.rs index 74aa110e4bb3..e07441a060f7 100644 --- a/node/network/pov-distribution/src/lib.rs +++ b/node/network/pov-distribution/src/lib.rs @@ -19,6 +19,9 @@ //! This is a gossip implementation of code that is responsible for distributing PoVs //! among validators. +#![deny(unused_extern_crates, unused_results)] +#![warn(missing_docs)] + use polkadot_primitives::v1::{Hash, PoV, CandidateDescriptor}; use polkadot_subsystem::{ ActiveLeavesUpdate, OverseerSignal, SubsystemContext, Subsystem, SubsystemResult, FromOverseer, SpawnedSubsystem, diff --git a/node/network/protocol/src/lib.rs b/node/network/protocol/src/lib.rs index dbeea99f4a43..860f34701f20 100644 --- a/node/network/protocol/src/lib.rs +++ b/node/network/protocol/src/lib.rs @@ -16,6 +16,9 @@ //! Network protocol types for parachains. +#![deny(unused_extern_crates, unused_results)] +#![warn(missing_docs)] + use polkadot_primitives::v1::Hash; use parity_scale_codec::{Encode, Decode}; use std::convert::TryFrom; diff --git a/node/network/statement-distribution/src/lib.rs b/node/network/statement-distribution/src/lib.rs index f0db3800c458..8fbfa435dc0f 100644 --- a/node/network/statement-distribution/src/lib.rs +++ b/node/network/statement-distribution/src/lib.rs @@ -19,6 +19,9 @@ //! This is responsible for distributing signed statements about candidate //! validity amongst validators. +#![deny(unused_extern_crates, unused_results)] +#![warn(missing_docs)] + use polkadot_subsystem::{ Subsystem, SubsystemResult, SubsystemContext, SpawnedSubsystem, ActiveLeavesUpdate, FromOverseer, OverseerSignal, diff --git a/node/overseer/Cargo.toml b/node/overseer/Cargo.toml index a05af75765a6..bf0fd7785832 100644 --- a/node/overseer/Cargo.toml +++ b/node/overseer/Cargo.toml @@ -15,7 +15,6 @@ polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../subsystem polkadot-node-subsystem-util = { path = "../subsystem-util" } polkadot-node-primitives = { package = "polkadot-node-primitives", path = "../primitives" } async-trait = "0.1" -color-eyre = "0.5.6" [dev-dependencies] sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/overseer/src/lib.rs b/node/overseer/src/lib.rs index 44c890773f1f..5b6389947289 100644 --- a/node/overseer/src/lib.rs +++ b/node/overseer/src/lib.rs @@ -54,6 +54,9 @@ //! .................................................................. //! ``` +#![deny(unused_extern_crates, unused_results)] +#![warn(missing_docs)] + use std::fmt::Debug; use std::pin::Pin; use std::sync::Arc; @@ -96,9 +99,6 @@ const STOP_DELAY: u64 = 1; // Target for logs. const LOG_TARGET: &'static str = "overseer"; -/// A universal helper type for the overseer. -pub use color_eyre::eyre::Error as OverseerError; - /// A type of messages that are sent from [`Subsystem`] to [`Overseer`]. /// /// It wraps a system-wide [`AllMessages`] type that represents all possible @@ -1287,7 +1287,7 @@ where for (hash, number) in leaves.into_iter() { update.activated.push(hash); - self.active_leaves.insert(hash, number); + let _ = self.active_leaves.insert(hash, number); self.on_head_activated(&hash); } @@ -1355,7 +1355,7 @@ where match self.active_leaves.entry(block.hash) { hash_map::Entry::Vacant(entry) => { update.activated.push(block.hash); - entry.insert(block.number); + let _ = entry.insert(block.number); self.on_head_activated(&block.hash); }, hash_map::Entry::Occupied(entry) => { @@ -1606,7 +1606,7 @@ fn spawn( spawner.spawn(name, fut); - streams.push(from_rx); + let _ = streams.push(from_rx); futures.push(Box::pin(rx.map(|e| { log::warn!("Dropping error {:?}", e); Ok(()) }))); let instance = Some(SubsystemInstance { diff --git a/node/primitives/src/lib.rs b/node/primitives/src/lib.rs index e961112be1c7..0f1e5516bb3f 100644 --- a/node/primitives/src/lib.rs +++ b/node/primitives/src/lib.rs @@ -20,6 +20,8 @@ //! not shared between the node and the runtime. This crate builds on top of the primitives defined //! there. +#![deny(missing_docs)] + use futures::Future; use parity_scale_codec::{Decode, Encode}; use polkadot_primitives::v1::{ diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index 07cb10b92c15..3f1b17d8b8a3 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -16,6 +16,8 @@ //! Polkadot service. Specialized wrapper over substrate service. +#![deny(unused_extern_crates, unused_results)] + pub mod chain_spec; mod grandpa_support; mod client; @@ -375,7 +377,7 @@ pub fn new_full( })?; if config.offchain_worker.enabled { - service::build_offchain_workers( + let _ = service::build_offchain_workers( &config, backend.clone(), task_manager.spawn_handle(), client.clone(), network.clone(), ); } @@ -655,7 +657,7 @@ fn new_light(mut config: Configuration) -> Result<(TaskManage })?; if config.offchain_worker.enabled { - service::build_offchain_workers( + let _ = service::build_offchain_workers( &config, backend.clone(), task_manager.spawn_handle(), diff --git a/node/subsystem-test-helpers/src/lib.rs b/node/subsystem-test-helpers/src/lib.rs index ae1dd91ad1c5..48a303cac03e 100644 --- a/node/subsystem-test-helpers/src/lib.rs +++ b/node/subsystem-test-helpers/src/lib.rs @@ -16,6 +16,9 @@ //! Utilities for testing subsystems. +#![deny(unused_extern_crates, unused_results)] +#![warn(missing_docs)] + use polkadot_node_subsystem::messages::AllMessages; use polkadot_node_subsystem::{ FromOverseer, SubsystemContext, SubsystemError, SubsystemResult, Subsystem, diff --git a/node/subsystem-util/src/lib.rs b/node/subsystem-util/src/lib.rs index 2ec12ebcbe07..226a50d02639 100644 --- a/node/subsystem-util/src/lib.rs +++ b/node/subsystem-util/src/lib.rs @@ -22,6 +22,8 @@ //! //! This crate also reexports Prometheus metric types which are expected to be implemented by subsystems. +#![deny(unused_extern_crates, unused_results)] +#![warn(missing_docs)] use polkadot_node_subsystem::{ errors::{ChainApiError, RuntimeApiError}, @@ -650,7 +652,7 @@ impl Jobs { outgoing_msgs_handle, }; - self.running.insert(parent_hash, handle); + let _ = self.running.insert(parent_hash, handle); Ok(()) } @@ -659,7 +661,7 @@ impl Jobs { pub async fn stop_job(&mut self, parent_hash: Hash) -> Result<(), Error> { match self.running.remove(&parent_hash) { Some(handle) => { - Pin::new(&mut self.outgoing_msgs).remove(handle.outgoing_msgs_handle); + let _ = Pin::new(&mut self.outgoing_msgs).remove(handle.outgoing_msgs_handle); handle.stop().await; Ok(()) } @@ -1044,6 +1046,8 @@ pub struct Timeout { /// Extends `Future` to allow time-limited futures. pub trait TimeoutExt: Future { + /// Adds a timeout of `duration` to the given `Future`. + /// Returns a new `Future`. fn timeout(self, duration: Duration) -> Timeout where Self: Sized, From 8a42dfd2322fed62542566805e447c6ece3da977 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Fri, 23 Oct 2020 15:14:31 +0200 Subject: [PATCH 20/62] make the erasure wrapper use thiserror --- Cargo.lock | 18 ++---------------- erasure-coding/Cargo.toml | 2 +- erasure-coding/src/lib.rs | 7 +++---- node/collation-generation/Cargo.toml | 2 +- node/collation-generation/src/error.rs | 23 ++++++++++++----------- 5 files changed, 19 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5618c1799e34..29f26a142c0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1119,20 +1119,6 @@ dependencies = [ "syn 0.15.44", ] -[[package]] -name = "derive_more" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a141330240c921ec6d074a3e188a7c7ef95668bb95e7d44fa0e5778ec2a7afe" -dependencies = [ - "lazy_static", - "proc-macro2 0.4.30", - "quote 0.6.13", - "regex", - "rustc_version", - "syn 0.15.44", -] - [[package]] name = "derive_more" version = "0.99.11" @@ -4880,12 +4866,12 @@ dependencies = [ name = "polkadot-erasure-coding" version = "0.8.25" dependencies = [ - "derive_more 0.15.0", "parity-scale-codec", "polkadot-primitives", "reed-solomon-erasure", "sp-core", "sp-trie", + "thiserror", ] [[package]] @@ -4915,7 +4901,6 @@ dependencies = [ name = "polkadot-node-collation-generation" version = "0.1.0" dependencies = [ - "derive_more 0.99.11", "futures 0.3.5", "log 0.4.11", "polkadot-erasure-coding", @@ -4925,6 +4910,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "sp-core", + "thiserror", ] [[package]] diff --git a/erasure-coding/Cargo.toml b/erasure-coding/Cargo.toml index dc7bdf05dfb6..6a8988eb0aeb 100644 --- a/erasure-coding/Cargo.toml +++ b/erasure-coding/Cargo.toml @@ -10,4 +10,4 @@ reed_solomon = { package = "reed-solomon-erasure", version = "4.0.2"} codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false, features = ["derive"] } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } trie = { package = "sp-trie", git = "https://github.com/paritytech/substrate", branch = "master" } -derive_more = "0.15.0" +thiserror = "1.0.21" diff --git a/erasure-coding/src/lib.rs b/erasure-coding/src/lib.rs index 708a167d6276..4d7da4ac87ea 100644 --- a/erasure-coding/src/lib.rs +++ b/erasure-coding/src/lib.rs @@ -30,6 +30,7 @@ use primitives::v0::{self, Hash as H256, BlakeTwo256, HashT}; use primitives::v1; use sp_core::Blake2Hasher; use trie::{EMPTY_PREFIX, MemoryDB, Trie, TrieMut, trie_types::{TrieDBMut, TrieDB}}; +use thiserror::Error; use self::wrapped_shard::WrappedShard; @@ -39,7 +40,7 @@ mod wrapped_shard; const MAX_VALIDATORS: usize = ::ORDER; /// Errors in erasure coding. -#[derive(Debug, Clone, PartialEq, derive_more::Display)] +#[derive(Debug, Clone, PartialEq, Error)] pub enum Error { /// Returned when there are too many validators. TooManyValidators, @@ -56,7 +57,7 @@ pub enum Error { /// An uneven byte-length of a shard is not valid for GF(2^16) encoding. UnevenLength, /// Chunk index out of bounds. - #[display(fmt = "Chunk is out of bounds: {} {}", _0, _1)] + #[error("Chunk is out of bounds: {0}..={1}")] ChunkIndexOutOfBounds(usize, usize), /// Bad payload in reconstructed bytes. BadPayload, @@ -66,8 +67,6 @@ pub enum Error { BranchOutOfBounds, } -impl std::error::Error for Error { } - #[derive(Debug, PartialEq)] struct CodeParams { data_shards: usize, diff --git a/node/collation-generation/Cargo.toml b/node/collation-generation/Cargo.toml index f7d5e7f162ef..0e302ae6884f 100644 --- a/node/collation-generation/Cargo.toml +++ b/node/collation-generation/Cargo.toml @@ -5,7 +5,6 @@ authors = ["Parity Technologies "] edition = "2018" [dependencies] -derive_more = "0.99.9" futures = "0.3.5" log = "0.4.8" polkadot-erasure-coding = { path = "../../erasure-coding" } @@ -14,6 +13,7 @@ polkadot-node-subsystem = { path = "../subsystem" } polkadot-node-subsystem-util = { path = "../subsystem-util" } polkadot-primitives = { path = "../../primitives" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } +thiserror = "1.0.21" [dev-dependencies] polkadot-node-subsystem-test-helpers = { path = "../subsystem-test-helpers" } diff --git a/node/collation-generation/src/error.rs b/node/collation-generation/src/error.rs index b256df751e4b..44b08c473f83 100644 --- a/node/collation-generation/src/error.rs +++ b/node/collation-generation/src/error.rs @@ -14,19 +14,20 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . +use thiserror::Error; -#[derive(Debug, derive_more::From)] +#[derive(Debug, Error)] pub enum Error { - #[from] - Subsystem(polkadot_node_subsystem::SubsystemError), - #[from] - OneshotRecv(futures::channel::oneshot::Canceled), - #[from] - Runtime(polkadot_node_subsystem::errors::RuntimeApiError), - #[from] - Util(polkadot_node_subsystem_util::Error), - #[from] - Erasure(polkadot_erasure_coding::Error), + #[error(transparent)] + Subsystem(#[from] polkadot_node_subsystem::SubsystemError), + #[error(transparent)] + OneshotRecv(#[from] futures::channel::oneshot::Canceled), + #[error(transparent)] + Runtime(#[from] polkadot_node_subsystem::errors::RuntimeApiError), + #[error(transparent)] + Util(#[from] polkadot_node_subsystem_util::Error), + #[error(transparent)] + Erasure(#[from] polkadot_erasure_coding::Error), } pub type Result = std::result::Result; From 597b7c2cfc5b29be61b7886cdfae1e890c61792d Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Fri, 23 Oct 2020 15:29:34 +0200 Subject: [PATCH 21/62] remove derive_from where possible, unify version to 0.99.11 --- Cargo.lock | 73 +++++++------------ node/core/av-store/Cargo.toml | 1 - node/core/backing/Cargo.toml | 1 - node/core/bitfield-signing/Cargo.toml | 1 - node/core/candidate-selection/Cargo.toml | 1 - node/core/provisioner/Cargo.toml | 1 - .../availability-distribution/Cargo.toml | 1 - node/network/collator-protocol/Cargo.toml | 1 - node/network/collator-protocol/src/lib.rs | 23 +++--- node/subsystem-test-helpers/Cargo.toml | 1 - node/subsystem-util/Cargo.toml | 1 - node/subsystem-util/src/lib.rs | 6 +- .../subsystem-util/src/validator_discovery.rs | 15 ++-- parachain/Cargo.toml | 2 +- validation/Cargo.toml | 2 +- validation/src/error.rs | 14 ++-- 16 files changed, 60 insertions(+), 84 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 29f26a142c0b..bc2f1661b5ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1107,18 +1107,6 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72aa14c04dfae8dd7d8a2b1cb7ca2152618cd01336dbfe704b8dcbf8d41dbd69" -[[package]] -name = "derive_more" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d944ac6003ed268757ef1ee686753b57efc5fcf0ebe7b64c9fc81e7e32ff839" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "rustc_version", - "syn 0.15.44", -] - [[package]] name = "derive_more" version = "0.99.11" @@ -4779,7 +4767,6 @@ version = "0.1.0" dependencies = [ "assert_matches", "bitvec", - "derive_more 0.99.11", "env_logger", "futures 0.3.5", "futures-timer 3.0.2", @@ -4834,7 +4821,6 @@ name = "polkadot-collator-protocol" version = "0.1.0" dependencies = [ "assert_matches", - "derive_more 0.99.11", "env_logger", "futures 0.3.5", "futures-timer 3.0.2", @@ -4918,7 +4904,6 @@ name = "polkadot-node-core-av-store" version = "0.1.0" dependencies = [ "assert_matches", - "derive_more 0.99.11", "futures 0.3.5", "kvdb", "kvdb-memorydb", @@ -4941,7 +4926,6 @@ version = "0.1.0" dependencies = [ "assert_matches", "bitvec", - "derive_more 0.99.11", "futures 0.3.5", "log 0.4.11", "polkadot-erasure-coding", @@ -4967,7 +4951,6 @@ name = "polkadot-node-core-bitfield-signing" version = "0.1.0" dependencies = [ "bitvec", - "derive_more 0.99.11", "futures 0.3.5", "log 0.4.11", "polkadot-node-subsystem", @@ -4982,7 +4965,6 @@ dependencies = [ name = "polkadot-node-core-candidate-selection" version = "0.1.0" dependencies = [ - "derive_more 0.99.11", "futures 0.3.5", "log 0.4.11", "polkadot-node-primitives", @@ -4997,7 +4979,7 @@ name = "polkadot-node-core-candidate-validation" version = "0.1.0" dependencies = [ "assert_matches", - "derive_more 0.99.11", + "derive_more", "futures 0.3.5", "log 0.4.11", "parity-scale-codec", @@ -5057,7 +5039,6 @@ name = "polkadot-node-core-provisioner" version = "0.1.0" dependencies = [ "bitvec", - "derive_more 0.99.11", "futures 0.3.5", "futures-timer 3.0.2", "lazy_static", @@ -5117,7 +5098,7 @@ version = "0.1.0" dependencies = [ "assert_matches", "async-trait", - "derive_more 0.99.11", + "derive_more", "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", @@ -5140,7 +5121,6 @@ name = "polkadot-node-subsystem-test-helpers" version = "0.1.0" dependencies = [ "async-trait", - "derive_more 0.99.11", "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", @@ -5164,7 +5144,6 @@ version = "0.1.0" dependencies = [ "assert_matches", "async-trait", - "derive_more 0.99.11", "env_logger", "futures 0.3.5", "futures-timer 3.0.2", @@ -5211,7 +5190,7 @@ dependencies = [ name = "polkadot-parachain" version = "0.8.25" dependencies = [ - "derive_more 0.99.11", + "derive_more", "futures 0.3.5", "log 0.4.11", "parity-scale-codec", @@ -5706,7 +5685,6 @@ dependencies = [ name = "polkadot-validation" version = "0.8.25" dependencies = [ - "derive_more 0.14.1", "futures 0.3.5", "log 0.4.11", "parity-scale-codec", @@ -5728,6 +5706,7 @@ dependencies = [ "sp-transaction-pool", "sp-trie", "substrate-prometheus-endpoint", + "thiserror", ] [[package]] @@ -6559,7 +6538,7 @@ version = "0.8.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "bytes 0.5.6", - "derive_more 0.99.11", + "derive_more", "either", "futures 0.3.5", "futures-timer 3.0.2", @@ -6664,7 +6643,7 @@ dependencies = [ "atty", "bip39", "chrono", - "derive_more 0.99.11", + "derive_more", "fdlimit", "futures 0.3.5", "hex", @@ -6725,7 +6704,7 @@ name = "sc-client-api" version = "2.0.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "derive_more 0.99.11", + "derive_more", "fnv", "futures 0.3.5", "hash-db", @@ -6803,7 +6782,7 @@ name = "sc-consensus-babe" version = "0.8.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "derive_more 0.99.11", + "derive_more", "fork-tree", "futures 0.3.5", "futures-timer 3.0.2", @@ -6848,7 +6827,7 @@ name = "sc-consensus-babe-rpc" version = "0.8.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "derive_more 0.99.11", + "derive_more", "futures 0.3.5", "jsonrpc-core", "jsonrpc-core-client", @@ -6922,7 +6901,7 @@ name = "sc-executor" version = "0.8.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "derive_more 0.99.11", + "derive_more", "lazy_static", "libsecp256k1", "log 0.4.11", @@ -6951,7 +6930,7 @@ name = "sc-executor-common" version = "0.8.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "derive_more 0.99.11", + "derive_more", "log 0.4.11", "parity-scale-codec", "parity-wasm", @@ -7001,7 +6980,7 @@ name = "sc-finality-grandpa" version = "0.8.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "derive_more 0.99.11", + "derive_more", "finality-grandpa", "fork-tree", "futures 0.3.5", @@ -7038,7 +7017,7 @@ name = "sc-finality-grandpa-rpc" version = "0.8.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "derive_more 0.99.11", + "derive_more", "finality-grandpa", "futures 0.3.5", "jsonrpc-core", @@ -7081,7 +7060,7 @@ version = "2.0.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "async-trait", - "derive_more 0.99.11", + "derive_more", "futures 0.3.5", "futures-util", "hex", @@ -7124,7 +7103,7 @@ dependencies = [ "bitflags", "bs58", "bytes 0.5.6", - "derive_more 0.99.11", + "derive_more", "either", "erased-serde", "fnv", @@ -7270,7 +7249,7 @@ name = "sc-rpc-api" version = "0.8.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "derive_more 0.99.11", + "derive_more", "futures 0.3.5", "jsonrpc-core", "jsonrpc-core-client", @@ -7312,7 +7291,7 @@ name = "sc-service" version = "0.8.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "derive_more 0.99.11", + "derive_more", "directories", "exit-future", "futures 0.1.29", @@ -7449,7 +7428,7 @@ name = "sc-transaction-graph" version = "2.0.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "derive_more 0.99.11", + "derive_more", "futures 0.3.5", "linked-hash-map", "log 0.4.11", @@ -7470,7 +7449,7 @@ name = "sc-transaction-pool" version = "2.0.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "derive_more 0.99.11", + "derive_more", "futures 0.3.5", "futures-diagnose", "intervalier", @@ -7937,7 +7916,7 @@ name = "sp-allocator" version = "2.0.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "derive_more 0.99.11", + "derive_more", "log 0.4.11", "sp-core", "sp-std", @@ -8036,7 +8015,7 @@ name = "sp-blockchain" version = "2.0.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "derive_more 0.99.11", + "derive_more", "log 0.4.11", "lru 0.4.3", "parity-scale-codec", @@ -8062,7 +8041,7 @@ name = "sp-consensus" version = "0.8.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "derive_more 0.99.11", + "derive_more", "futures 0.3.5", "futures-timer 3.0.2", "libp2p", @@ -8219,7 +8198,7 @@ name = "sp-inherents" version = "2.0.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "derive_more 0.99.11", + "derive_more", "parity-scale-codec", "parking_lot 0.10.2", "sp-core", @@ -8267,7 +8246,7 @@ version = "0.8.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "async-trait", - "derive_more 0.99.11", + "derive_more", "futures 0.3.5", "merlin", "parity-scale-codec", @@ -8494,7 +8473,7 @@ name = "sp-transaction-pool" version = "2.0.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ - "derive_more 0.99.11", + "derive_more", "futures 0.3.5", "log 0.4.11", "parity-scale-codec", @@ -8746,7 +8725,7 @@ version = "0.8.0" source = "git+https://github.com/paritytech/substrate#a4673586a469a1a2c6e17ab9dea048a1307cb9cf" dependencies = [ "async-std", - "derive_more 0.99.11", + "derive_more", "futures-util", "hyper 0.13.6", "log 0.4.11", diff --git a/node/core/av-store/Cargo.toml b/node/core/av-store/Cargo.toml index 63bd810ab8b3..2bddaefb95ed 100644 --- a/node/core/av-store/Cargo.toml +++ b/node/core/av-store/Cargo.toml @@ -5,7 +5,6 @@ authors = ["Parity Technologies "] edition = "2018" [dependencies] -derive_more = "0.99.9" futures = "0.3.5" log = "0.4.11" thiserror = "1.0.21" diff --git a/node/core/backing/Cargo.toml b/node/core/backing/Cargo.toml index e8b51de67285..fada2c92dae0 100644 --- a/node/core/backing/Cargo.toml +++ b/node/core/backing/Cargo.toml @@ -16,7 +16,6 @@ polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsys polkadot-node-subsystem-util = { path = "../../subsystem-util" } erasure-coding = { package = "polkadot-erasure-coding", path = "../../../erasure-coding" } statement-table = { package = "polkadot-statement-table", path = "../../../statement-table" } -derive_more = "0.99.9" bitvec = { version = "0.17.4", default-features = false, features = ["alloc"] } log = "0.4.11" thiserror = "1.0.21" diff --git a/node/core/bitfield-signing/Cargo.toml b/node/core/bitfield-signing/Cargo.toml index 1957ab69387c..1ad319617ad7 100644 --- a/node/core/bitfield-signing/Cargo.toml +++ b/node/core/bitfield-signing/Cargo.toml @@ -6,7 +6,6 @@ edition = "2018" [dependencies] bitvec = "0.17.4" -derive_more = "0.99.9" futures = "0.3.5" log = "0.4.11" polkadot-primitives = { path = "../../../primitives" } diff --git a/node/core/candidate-selection/Cargo.toml b/node/core/candidate-selection/Cargo.toml index 171e84723eb1..e58c53cffc67 100644 --- a/node/core/candidate-selection/Cargo.toml +++ b/node/core/candidate-selection/Cargo.toml @@ -5,7 +5,6 @@ authors = ["Parity Technologies "] edition = "2018" [dependencies] -derive_more = "0.99.9" futures = "0.3.5" log = "0.4.8" polkadot-primitives = { path = "../../../primitives" } diff --git a/node/core/provisioner/Cargo.toml b/node/core/provisioner/Cargo.toml index 3b7e1f5add4c..0dfa39c1044a 100644 --- a/node/core/provisioner/Cargo.toml +++ b/node/core/provisioner/Cargo.toml @@ -6,7 +6,6 @@ edition = "2018" [dependencies] bitvec = { version = "0.17.4", default-features = false, features = ["alloc"] } -derive_more = "0.99.9" futures = "0.3.5" log = "0.4.8" polkadot-primitives = { path = "../../../primitives" } diff --git a/node/network/availability-distribution/Cargo.toml b/node/network/availability-distribution/Cargo.toml index a145b5026730..de80af70afaf 100644 --- a/node/network/availability-distribution/Cargo.toml +++ b/node/network/availability-distribution/Cargo.toml @@ -9,7 +9,6 @@ futures = "0.3.5" log = "0.4.11" streamunordered = "0.5.1" codec = { package="parity-scale-codec", version = "1.3.4", features = ["std"] } -derive_more = "0.99.9" polkadot-primitives = { path = "../../../primitives" } polkadot-erasure-coding = { path = "../../../erasure-coding" } polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } diff --git a/node/network/collator-protocol/Cargo.toml b/node/network/collator-protocol/Cargo.toml index 8469bc5b9450..b2073d6b94e4 100644 --- a/node/network/collator-protocol/Cargo.toml +++ b/node/network/collator-protocol/Cargo.toml @@ -7,7 +7,6 @@ edition = "2018" [dependencies] futures = "0.3.5" log = "0.4.11" -derive_more = "0.99.9" codec = { package="parity-scale-codec", version = "1.3.4", features = ["std"] } diff --git a/node/network/collator-protocol/src/lib.rs b/node/network/collator-protocol/src/lib.rs index 8d39e1cea686..0ba79d7017bb 100644 --- a/node/network/collator-protocol/src/lib.rs +++ b/node/network/collator-protocol/src/lib.rs @@ -22,6 +22,7 @@ use std::time::Duration; use futures::{channel::oneshot, FutureExt}; use log::trace; +use thiserror::Error; use polkadot_subsystem::{ Subsystem, SubsystemContext, SubsystemError, SpawnedSubsystem, @@ -45,18 +46,18 @@ mod validator_side; const TARGET: &'static str = "colp"; const REQUEST_TIMEOUT: Duration = Duration::from_secs(1); -#[derive(Debug, derive_more::From)] +#[derive(Debug, Error)] enum Error { - #[from] - Subsystem(SubsystemError), - #[from] - Oneshot(oneshot::Canceled), - #[from] - RuntimeApi(RuntimeApiError), - #[from] - UtilError(util::Error), - #[from] - Prometheus(prometheus::PrometheusError), + #[error(transparent)] + Subsystem(#[from] SubsystemError), + #[error(transparent)] + Oneshot(#[from] oneshot::Canceled), + #[error(transparent)] + RuntimeApi(#[from] RuntimeApiError), + #[error(transparent)] + UtilError(#[from] util::Error), + #[error(transparent)] + Prometheus(#[from] prometheus::PrometheusError), } impl From for Error { diff --git a/node/subsystem-test-helpers/Cargo.toml b/node/subsystem-test-helpers/Cargo.toml index 5f1388136a35..24f49ec3a1c7 100644 --- a/node/subsystem-test-helpers/Cargo.toml +++ b/node/subsystem-test-helpers/Cargo.toml @@ -7,7 +7,6 @@ description = "Subsystem traits and message definitions" [dependencies] async-trait = "0.1" -derive_more = "0.99.9" futures = "0.3.5" futures-timer = "3.0.2" log = "0.4.8" diff --git a/node/subsystem-util/Cargo.toml b/node/subsystem-util/Cargo.toml index aff26c1970ec..54329621693c 100644 --- a/node/subsystem-util/Cargo.toml +++ b/node/subsystem-util/Cargo.toml @@ -7,7 +7,6 @@ description = "Subsystem traits and message definitions" [dependencies] async-trait = "0.1" -derive_more = "0.99.9" futures = "0.3.5" futures-timer = "3.0.2" log = "0.4.8" diff --git a/node/subsystem-util/src/lib.rs b/node/subsystem-util/src/lib.rs index 226a50d02639..cf47a2d6bd79 100644 --- a/node/subsystem-util/src/lib.rs +++ b/node/subsystem-util/src/lib.rs @@ -1172,10 +1172,10 @@ mod tests { // Error will mostly be a wrapper to make the try operator more convenient; // deriving From implementations for most variants is recommended. // It must implement Debug for logging. - #[derive(Debug, derive_more::From)] + #[derive(Debug, Error)] enum Error { - #[from] - Sending(mpsc::SendError), + #[error(transparent)] + Sending(#[from]mpsc::SendError), } impl JobTrait for FakeCandidateSelectionJob { diff --git a/node/subsystem-util/src/validator_discovery.rs b/node/subsystem-util/src/validator_discovery.rs index 4fb964945b01..ac5bf1d47066 100644 --- a/node/subsystem-util/src/validator_discovery.rs +++ b/node/subsystem-util/src/validator_discovery.rs @@ -24,6 +24,7 @@ use futures::{ task::{Poll, self}, stream, }; +use thiserror::Error; use polkadot_node_subsystem::{ errors::RuntimeApiError, SubsystemError, @@ -34,17 +35,17 @@ use polkadot_primitives::v1::{Hash, ValidatorId, AuthorityDiscoveryId}; use sc_network::PeerId; /// Error when making a request to connect to validators. -#[derive(Debug, derive_more::From)] +#[derive(Debug, Error)] pub enum Error { /// Attempted to send or receive on a oneshot channel which had been canceled - #[from] - Oneshot(oneshot::Canceled), + #[error(transparent)] + Oneshot(#[from] oneshot::Canceled), /// A subsystem error. - #[from] - Subsystem(SubsystemError), + #[error(transparent)] + Subsystem(#[from] SubsystemError), /// An error in the Runtime API. - #[from] - RuntimeApi(RuntimeApiError), + #[error(transparent)] + RuntimeApi(#[from] RuntimeApiError), } /// Utility function to make it easier to connect to validators. diff --git a/parachain/Cargo.toml b/parachain/Cargo.toml index 855cdcc6a21d..3acf2965fa63 100644 --- a/parachain/Cargo.toml +++ b/parachain/Cargo.toml @@ -17,7 +17,7 @@ sp-wasm-interface = { git = "https://github.com/paritytech/substrate", branch = polkadot-core-primitives = { path = "../core-primitives", default-features = false } # all optional crates. -derive_more = { version = "0.99.2", optional = true } +derive_more = { version = "0.99.11", optional = true } serde = { version = "1.0.102", default-features = false, features = [ "derive" ], optional = true } sp-externalities = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true } sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true } diff --git a/validation/Cargo.toml b/validation/Cargo.toml index 60fe47a873ce..81ea0f746ee1 100644 --- a/validation/Cargo.toml +++ b/validation/Cargo.toml @@ -15,7 +15,6 @@ consensus = { package = "sp-consensus", git = "https://github.com/paritytech/sub runtime_primitives = { package = "sp-runtime", git = "https://github.com/paritytech/substrate", branch = "master" } futures = "0.3.4" log = "0.4.8" -derive_more = "0.14.1" codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false, features = ["derive"] } grandpa = { package = "sc-finality-grandpa", git = "https://github.com/paritytech/substrate", branch = "master" } inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master" } @@ -26,6 +25,7 @@ block-builder = { package = "sc-block-builder", git = "https://github.com/parity trie = { package = "sp-trie", git = "https://github.com/paritytech/substrate", branch = "master" } babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" } prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https://github.com/paritytech/substrate", branch = "master" } +thiserror = "1.0.21" [dev-dependencies] sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/validation/src/error.rs b/validation/src/error.rs index 913b110e7f67..60ca1709db5f 100644 --- a/validation/src/error.rs +++ b/validation/src/error.rs @@ -16,16 +16,20 @@ //! Errors that can occur during the validation process. +use thiserror::Error; + /// Error type for validation -#[derive(Debug, derive_more::Display, derive_more::From)] +#[derive(Debug, Error)] pub enum Error { /// Client error - Client(sp_blockchain::Error), + #[error(transparent)] + Client(#[from] sp_blockchain::Error), /// Consensus error - Consensus(consensus::error::Error), + #[error(transparent)] + Consensus(#[from] consensus::error::Error), /// Unexpected error checking inherents - #[display(fmt = "Unexpected error while checking inherents: {}", _0)] - InherentError(inherents::Error), + #[error("Unexpected error while checking inherents: {0}")] + InherentError(#[from] inherents::Error), } impl std::error::Error for Error { From 2170598c0e354fffb83779607486d8dcf07db671 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Fri, 23 Oct 2020 18:05:14 +0200 Subject: [PATCH 22/62] Update node/core/chain-api/src/lib.rs Co-authored-by: Andronik Ordian --- node/core/chain-api/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/core/chain-api/src/lib.rs b/node/core/chain-api/src/lib.rs index 82fee0082303..0f7367f5efd8 100644 --- a/node/core/chain-api/src/lib.rs +++ b/node/core/chain-api/src/lib.rs @@ -66,7 +66,7 @@ impl Subsystem for ChainApiSubsystem where fn start(self, ctx: Context) -> SpawnedSubsystem { let future = run(ctx, self).map_err(|e| SubsystemError::with_origin("chain-api", e)).map(|_| ()).boxed(); SpawnedSubsystem { - future: , + future, name: "chain-api-subsystem", } } From 6b6f38c2f3e970fc97dae0109bc90adb85435247 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 09:28:07 +0100 Subject: [PATCH 23/62] rewrap --- node/overseer/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/node/overseer/src/lib.rs b/node/overseer/src/lib.rs index 5b6389947289..4a508aaf2bf8 100644 --- a/node/overseer/src/lib.rs +++ b/node/overseer/src/lib.rs @@ -305,7 +305,11 @@ impl SubsystemContext for OverseerSubsystemContext { } async fn recv(&mut self) -> SubsystemResult> { - self.rx.next().await.ok_or(SubsystemError::Context("No more messages in rx queue to process".to_owned())) + self.rx.next().await + .ok_or(SubsystemError::Context( + "No more messages in rx queue to process" + .to_owned() + )) } async fn spawn(&mut self, name: &'static str, s: Pin + Send>>) From d16efd76a4c2cf736e1288b0cb3337d6f2104bfd Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 09:42:09 +0100 Subject: [PATCH 24/62] undo whitespace madness --- .../availability-distribution/src/lib.rs | 1860 ++++++++--------- .../availability-distribution/src/tests.rs | 1686 +++++++-------- 2 files changed, 1773 insertions(+), 1773 deletions(-) diff --git a/node/network/availability-distribution/src/lib.rs b/node/network/availability-distribution/src/lib.rs index 12463a765f8e..f5340744ff72 100644 --- a/node/network/availability-distribution/src/lib.rs +++ b/node/network/availability-distribution/src/lib.rs @@ -33,21 +33,21 @@ use sp_keystore::{CryptoStore, SyncCryptoStorePtr}; use log::{trace, warn}; use polkadot_erasure_coding::branch_hash; use polkadot_node_network_protocol::{ - v1 as protocol_v1, NetworkBridgeEvent, PeerId, ReputationChange as Rep, View, + v1 as protocol_v1, NetworkBridgeEvent, PeerId, ReputationChange as Rep, View, }; use polkadot_node_subsystem_util::metrics::{self, prometheus}; use polkadot_primitives::v1::{ - BlakeTwo256, CommittedCandidateReceipt, CoreState, ErasureChunk, Hash, HashT, Id as ParaId, - SessionIndex, ValidatorId, ValidatorIndex, PARACHAIN_KEY_TYPE_ID, + BlakeTwo256, CommittedCandidateReceipt, CoreState, ErasureChunk, Hash, HashT, Id as ParaId, + SessionIndex, ValidatorId, ValidatorIndex, PARACHAIN_KEY_TYPE_ID, }; use polkadot_subsystem::messages::{ - AllMessages, AvailabilityDistributionMessage, AvailabilityStoreMessage, ChainApiMessage, - NetworkBridgeMessage, RuntimeApiMessage, RuntimeApiRequest, + AllMessages, AvailabilityDistributionMessage, AvailabilityStoreMessage, ChainApiMessage, + NetworkBridgeMessage, RuntimeApiMessage, RuntimeApiRequest, }; use polkadot_subsystem::{ - errors::{ChainApiError, RuntimeApiError}, - ActiveLeavesUpdate, FromOverseer, OverseerSignal, SpawnedSubsystem, Subsystem, - SubsystemContext, SubsystemError, + errors::{ChainApiError, RuntimeApiError}, + ActiveLeavesUpdate, FromOverseer, OverseerSignal, SpawnedSubsystem, Subsystem, + SubsystemContext, SubsystemError, }; use std::collections::{HashMap, HashSet}; use std::iter; @@ -57,64 +57,64 @@ const TARGET: &'static str = "avad"; #[derive(Debug, Error)] enum Error { - #[error("Sending PendingAvailability query failed")] - QueryPendingAvailabilitySendQuery(#[source] SubsystemError), - #[error("Response channel to obtain PendingAvailability failed")] - QueryPendingAvailabilityResponseChannel(#[source] oneshot::Canceled), - #[error("RuntimeAPI to obtain PendingAvailability failed")] - QueryPendingAvailability(#[source] RuntimeApiError), - - #[error("Sending StoreChunk query failed")] - StoreChunkSendQuery(#[source] SubsystemError), - #[error("Response channel to obtain StoreChunk failed")] - StoreChunkResponseChannel(#[source] oneshot::Canceled), - - #[error("Sending QueryChunk query failed")] - QueryChunkSendQuery(#[source] SubsystemError), - #[error("Response channel to obtain QueryChunk failed")] - QueryChunkResponseChannel(#[source] oneshot::Canceled), - - #[error("Sending QueryAncestors query failed")] - QueryAncestorsSendQuery(#[source] SubsystemError), - #[error("Response channel to obtain QueryAncestors failed")] - QueryAncestorsResponseChannel(#[source] oneshot::Canceled), - #[error("RuntimeAPI to obtain QueryAncestors failed")] - QueryAncestors(#[source] ChainApiError), - - #[error("Sending QuerySession query failed")] - QuerySessionSendQuery(#[source] SubsystemError), - #[error("Response channel to obtain QuerySession failed")] - QuerySessionResponseChannel(#[source] oneshot::Canceled), - #[error("RuntimeAPI to obtain QuerySession failed")] - QuerySession(#[source] RuntimeApiError), - - #[error("Sending QueryValidators query failed")] - QueryValidatorsSendQuery(#[source] SubsystemError), - #[error("Response channel to obtain QueryValidators failed")] - QueryValidatorsResponseChannel(#[source] oneshot::Canceled), - #[error("RuntimeAPI to obtain QueryValidators failed")] - QueryValidators(#[source] RuntimeApiError), - - #[error("Sending AvailabilityCores query failed")] - AvailabilityCoresSendQuery(#[source] SubsystemError), - #[error("Response channel to obtain AvailabilityCores failed")] - AvailabilityCoresResponseChannel(#[source] oneshot::Canceled), - #[error("RuntimeAPI to obtain AvailabilityCores failed")] - AvailabilityCores(#[source] RuntimeApiError), - - #[error("Sending AvailabilityCores query failed")] - QueryAvailabilitySendQuery(#[source] SubsystemError), - #[error("Response channel to obtain AvailabilityCores failed")] - QueryAvailabilityResponseChannel(#[source] oneshot::Canceled), - - #[error("Sending out a peer report message")] - ReportPeerMessageSend(#[source] SubsystemError), - - #[error("Sending a gossip message")] - TrackedGossipMessage(#[source] SubsystemError), - - #[error("Receive channel closed")] - IncomingMessageChannel(#[source] SubsystemError), + #[error("Sending PendingAvailability query failed")] + QueryPendingAvailabilitySendQuery(#[source] SubsystemError), + #[error("Response channel to obtain PendingAvailability failed")] + QueryPendingAvailabilityResponseChannel(#[source] oneshot::Canceled), + #[error("RuntimeAPI to obtain PendingAvailability failed")] + QueryPendingAvailability(#[source] RuntimeApiError), + + #[error("Sending StoreChunk query failed")] + StoreChunkSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain StoreChunk failed")] + StoreChunkResponseChannel(#[source] oneshot::Canceled), + + #[error("Sending QueryChunk query failed")] + QueryChunkSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain QueryChunk failed")] + QueryChunkResponseChannel(#[source] oneshot::Canceled), + + #[error("Sending QueryAncestors query failed")] + QueryAncestorsSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain QueryAncestors failed")] + QueryAncestorsResponseChannel(#[source] oneshot::Canceled), + #[error("RuntimeAPI to obtain QueryAncestors failed")] + QueryAncestors(#[source] ChainApiError), + + #[error("Sending QuerySession query failed")] + QuerySessionSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain QuerySession failed")] + QuerySessionResponseChannel(#[source] oneshot::Canceled), + #[error("RuntimeAPI to obtain QuerySession failed")] + QuerySession(#[source] RuntimeApiError), + + #[error("Sending QueryValidators query failed")] + QueryValidatorsSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain QueryValidators failed")] + QueryValidatorsResponseChannel(#[source] oneshot::Canceled), + #[error("RuntimeAPI to obtain QueryValidators failed")] + QueryValidators(#[source] RuntimeApiError), + + #[error("Sending AvailabilityCores query failed")] + AvailabilityCoresSendQuery(#[source] SubsystemError), + #[error("Response channel to obtain AvailabilityCores failed")] + AvailabilityCoresResponseChannel(#[source] oneshot::Canceled), + #[error("RuntimeAPI to obtain AvailabilityCores failed")] + AvailabilityCores(#[source] RuntimeApiError), + + #[error("Sending AvailabilityCores query failed")] + QueryAvailabilitySendQuery(#[source] SubsystemError), + #[error("Response channel to obtain AvailabilityCores failed")] + QueryAvailabilityResponseChannel(#[source] oneshot::Canceled), + + #[error("Sending out a peer report message")] + ReportPeerMessageSend(#[source] SubsystemError), + + #[error("Sending a gossip message")] + TrackedGossipMessage(#[source] SubsystemError), + + #[error("Receive channel closed")] + IncomingMessageChannel(#[source] SubsystemError), } type Result = std::result::Result; @@ -129,1026 +129,1026 @@ const BENEFIT_VALID_MESSAGE: Rep = Rep::new(10, "Valid message"); /// to other peers. #[derive(Encode, Decode, Debug, Clone, PartialEq, Eq, Hash)] pub struct AvailabilityGossipMessage { - /// Anchor hash of the candidate the `ErasureChunk` is associated to. - pub candidate_hash: Hash, - /// The erasure chunk, a encoded information part of `AvailabilityData`. - pub erasure_chunk: ErasureChunk, + /// Anchor hash of the candidate the `ErasureChunk` is associated to. + pub candidate_hash: Hash, + /// The erasure chunk, a encoded information part of `AvailabilityData`. + pub erasure_chunk: ErasureChunk, } /// Data used to track information of peers and relay parents the /// overseer ordered us to work on. #[derive(Default, Clone, Debug)] struct ProtocolState { - /// Track all active peers and their views - /// to determine what is relevant to them. - peer_views: HashMap, - - /// Our own view. - view: View, - - /// Caches a mapping of relay parents or ancestor to live candidate receipts. - /// Allows fast intersection of live candidates with views and consecutive unioning. - /// Maps relay parent / ancestor -> live candidate receipts + its hash. - receipts: HashMap>, - - /// Allow reverse caching of view checks. - /// Maps candidate hash -> relay parent for extracting meta information from `PerRelayParent`. - /// Note that the presence of this is not sufficient to determine if deletion is OK, i.e. - /// two histories could cover this. - reverse: HashMap, - - /// Keeps track of which candidate receipts are required due to ancestors of which relay parents - /// of our view. - /// Maps ancestor -> relay parents in view - ancestry: HashMap>, - - /// Track things needed to start and stop work on a particular relay parent. - per_relay_parent: HashMap, - - /// Track data that is specific to a candidate. - per_candidate: HashMap, + /// Track all active peers and their views + /// to determine what is relevant to them. + peer_views: HashMap, + + /// Our own view. + view: View, + + /// Caches a mapping of relay parents or ancestor to live candidate receipts. + /// Allows fast intersection of live candidates with views and consecutive unioning. + /// Maps relay parent / ancestor -> live candidate receipts + its hash. + receipts: HashMap>, + + /// Allow reverse caching of view checks. + /// Maps candidate hash -> relay parent for extracting meta information from `PerRelayParent`. + /// Note that the presence of this is not sufficient to determine if deletion is OK, i.e. + /// two histories could cover this. + reverse: HashMap, + + /// Keeps track of which candidate receipts are required due to ancestors of which relay parents + /// of our view. + /// Maps ancestor -> relay parents in view + ancestry: HashMap>, + + /// Track things needed to start and stop work on a particular relay parent. + per_relay_parent: HashMap, + + /// Track data that is specific to a candidate. + per_candidate: HashMap, } #[derive(Debug, Clone, Default)] struct PerCandidate { - /// A Candidate and a set of known erasure chunks in form of messages to be gossiped / distributed if the peer view wants that. - /// This is _across_ peers and not specific to a particular one. - /// candidate hash + erasure chunk index -> gossip message - message_vault: HashMap, + /// A Candidate and a set of known erasure chunks in form of messages to be gossiped / distributed if the peer view wants that. + /// This is _across_ peers and not specific to a particular one. + /// candidate hash + erasure chunk index -> gossip message + message_vault: HashMap, - /// Track received candidate hashes and chunk indices from peers. - received_messages: HashMap>, + /// Track received candidate hashes and chunk indices from peers. + received_messages: HashMap>, - /// Track already sent candidate hashes and the erasure chunk index to the peers. - sent_messages: HashMap>, + /// Track already sent candidate hashes and the erasure chunk index to the peers. + sent_messages: HashMap>, - /// The set of validators. - validators: Vec, + /// The set of validators. + validators: Vec, - /// If this node is a validator, note the index in the validator set. - validator_index: Option, + /// If this node is a validator, note the index in the validator set. + validator_index: Option, } #[derive(Debug, Clone, Default)] struct PerRelayParent { - /// Set of `K` ancestors for this relay parent. - ancestors: Vec, + /// Set of `K` ancestors for this relay parent. + ancestors: Vec, } impl ProtocolState { - /// Collects the relay_parents ancestors including the relay parents themselfes. - fn extend_with_ancestors<'a>( - &'a self, - relay_parents: impl IntoIterator + 'a, - ) -> HashSet { - relay_parents - .into_iter() - .map(|relay_parent| { - self.per_relay_parent - .get(relay_parent) - .into_iter() - .map(|per_relay_parent| per_relay_parent.ancestors.iter().cloned()) - .flatten() - .chain(iter::once(*relay_parent)) - }) - .flatten() - .collect::>() - } - - /// Unionize all cached entries for the given relay parents and its ancestors. - /// Ignores all non existent relay parents, so this can be used directly with a peers view. - /// Returns a map from candidate hash -> receipt - fn cached_live_candidates_unioned<'a>( - &'a self, - relay_parents: impl IntoIterator + 'a, - ) -> HashMap { - let relay_parents_and_ancestors = self.extend_with_ancestors(relay_parents); - relay_parents_and_ancestors - .into_iter() - .filter_map(|relay_parent_or_ancestor| self.receipts.get(&relay_parent_or_ancestor)) - .map(|receipt_set| receipt_set.into_iter()) - .flatten() - .map(|(receipt_hash, receipt)| (receipt_hash.clone(), receipt.clone())) - .collect::>() - } - - async fn add_relay_parent( - &mut self, - ctx: &mut Context, - relay_parent: Hash, - validators: Vec, - validator_index: Option, - ) -> Result<()> - where - Context: SubsystemContext, - { - let candidates = query_live_candidates(ctx, self, std::iter::once(relay_parent)).await?; - - // register the relation of relay_parent to candidate.. - // ..and the reverse association. - for (relay_parent_or_ancestor, (receipt_hash, receipt)) in candidates.clone() { - self.reverse - .insert(receipt_hash.clone(), relay_parent_or_ancestor.clone()); - let per_candidate = self.per_candidate.entry(receipt_hash.clone()).or_default(); - per_candidate.validator_index = validator_index.clone(); - per_candidate.validators = validators.clone(); - - self.receipts - .entry(relay_parent_or_ancestor) - .or_default() - .insert((receipt_hash, receipt)); - } - - // collect the ancestors again from the hash map - let ancestors = candidates - .iter() - .filter_map(|(ancestor_or_relay_parent, _receipt)| { - if ancestor_or_relay_parent == &relay_parent { - None - } else { - Some(*ancestor_or_relay_parent) - } - }) - .collect::>(); - - // mark all the ancestors as "needed" by this newly added relay parent - for ancestor in ancestors.iter() { - self.ancestry - .entry(ancestor.clone()) - .or_default() - .insert(relay_parent); - } - - self.per_relay_parent - .entry(relay_parent) - .or_default() - .ancestors = ancestors; - - Ok(()) - } - - fn remove_relay_parent(&mut self, relay_parent: &Hash) -> Result<()> { - // we might be ancestor of some other relay_parent - if let Some(ref mut descendants) = self.ancestry.get_mut(relay_parent) { - // if we were the last user, and it is - // not explicitly set to be worked on by the overseer - if descendants.is_empty() { - // remove from the ancestry index - self.ancestry.remove(relay_parent); - // and also remove the actual receipt - self.receipts.remove(relay_parent); - self.per_candidate.remove(relay_parent); - } - } - if let Some(per_relay_parent) = self.per_relay_parent.remove(relay_parent) { - // remove all "references" from the hash maps and sets for all ancestors - for ancestor in per_relay_parent.ancestors { - // one of our decendants might be ancestor of some other relay_parent - if let Some(ref mut descendants) = self.ancestry.get_mut(&ancestor) { - // we do not need this descendant anymore - descendants.remove(&relay_parent); - // if we were the last user, and it is - // not explicitly set to be worked on by the overseer - if descendants.is_empty() && !self.per_relay_parent.contains_key(&ancestor) { - // remove from the ancestry index - self.ancestry.remove(&ancestor); - // and also remove the actual receipt - self.receipts.remove(&ancestor); - self.per_candidate.remove(&ancestor); - } - } - } - } - Ok(()) - } + /// Collects the relay_parents ancestors including the relay parents themselfes. + fn extend_with_ancestors<'a>( + &'a self, + relay_parents: impl IntoIterator + 'a, + ) -> HashSet { + relay_parents + .into_iter() + .map(|relay_parent| { + self.per_relay_parent + .get(relay_parent) + .into_iter() + .map(|per_relay_parent| per_relay_parent.ancestors.iter().cloned()) + .flatten() + .chain(iter::once(*relay_parent)) + }) + .flatten() + .collect::>() + } + + /// Unionize all cached entries for the given relay parents and its ancestors. + /// Ignores all non existent relay parents, so this can be used directly with a peers view. + /// Returns a map from candidate hash -> receipt + fn cached_live_candidates_unioned<'a>( + &'a self, + relay_parents: impl IntoIterator + 'a, + ) -> HashMap { + let relay_parents_and_ancestors = self.extend_with_ancestors(relay_parents); + relay_parents_and_ancestors + .into_iter() + .filter_map(|relay_parent_or_ancestor| self.receipts.get(&relay_parent_or_ancestor)) + .map(|receipt_set| receipt_set.into_iter()) + .flatten() + .map(|(receipt_hash, receipt)| (receipt_hash.clone(), receipt.clone())) + .collect::>() + } + + async fn add_relay_parent( + &mut self, + ctx: &mut Context, + relay_parent: Hash, + validators: Vec, + validator_index: Option, + ) -> Result<()> + where + Context: SubsystemContext, + { + let candidates = query_live_candidates(ctx, self, std::iter::once(relay_parent)).await?; + + // register the relation of relay_parent to candidate.. + // ..and the reverse association. + for (relay_parent_or_ancestor, (receipt_hash, receipt)) in candidates.clone() { + self.reverse + .insert(receipt_hash.clone(), relay_parent_or_ancestor.clone()); + let per_candidate = self.per_candidate.entry(receipt_hash.clone()).or_default(); + per_candidate.validator_index = validator_index.clone(); + per_candidate.validators = validators.clone(); + + self.receipts + .entry(relay_parent_or_ancestor) + .or_default() + .insert((receipt_hash, receipt)); + } + + // collect the ancestors again from the hash map + let ancestors = candidates + .iter() + .filter_map(|(ancestor_or_relay_parent, _receipt)| { + if ancestor_or_relay_parent == &relay_parent { + None + } else { + Some(*ancestor_or_relay_parent) + } + }) + .collect::>(); + + // mark all the ancestors as "needed" by this newly added relay parent + for ancestor in ancestors.iter() { + self.ancestry + .entry(ancestor.clone()) + .or_default() + .insert(relay_parent); + } + + self.per_relay_parent + .entry(relay_parent) + .or_default() + .ancestors = ancestors; + + Ok(()) + } + + fn remove_relay_parent(&mut self, relay_parent: &Hash) -> Result<()> { + // we might be ancestor of some other relay_parent + if let Some(ref mut descendants) = self.ancestry.get_mut(relay_parent) { + // if we were the last user, and it is + // not explicitly set to be worked on by the overseer + if descendants.is_empty() { + // remove from the ancestry index + self.ancestry.remove(relay_parent); + // and also remove the actual receipt + self.receipts.remove(relay_parent); + self.per_candidate.remove(relay_parent); + } + } + if let Some(per_relay_parent) = self.per_relay_parent.remove(relay_parent) { + // remove all "references" from the hash maps and sets for all ancestors + for ancestor in per_relay_parent.ancestors { + // one of our decendants might be ancestor of some other relay_parent + if let Some(ref mut descendants) = self.ancestry.get_mut(&ancestor) { + // we do not need this descendant anymore + descendants.remove(&relay_parent); + // if we were the last user, and it is + // not explicitly set to be worked on by the overseer + if descendants.is_empty() && !self.per_relay_parent.contains_key(&ancestor) { + // remove from the ancestry index + self.ancestry.remove(&ancestor); + // and also remove the actual receipt + self.receipts.remove(&ancestor); + self.per_candidate.remove(&ancestor); + } + } + } + } + Ok(()) + } } /// Deal with network bridge updates and track what needs to be tracked /// which depends on the message type received. async fn handle_network_msg( - ctx: &mut Context, - keystore: &SyncCryptoStorePtr, - state: &mut ProtocolState, - metrics: &Metrics, - bridge_message: NetworkBridgeEvent, + ctx: &mut Context, + keystore: &SyncCryptoStorePtr, + state: &mut ProtocolState, + metrics: &Metrics, + bridge_message: NetworkBridgeEvent, ) -> Result<()> where - Context: SubsystemContext, + Context: SubsystemContext, { - match bridge_message { - NetworkBridgeEvent::PeerConnected(peerid, _role) => { - // insert if none already present - state.peer_views.entry(peerid).or_default(); - } - NetworkBridgeEvent::PeerDisconnected(peerid) => { - // get rid of superfluous data - state.peer_views.remove(&peerid); - } - NetworkBridgeEvent::PeerViewChange(peerid, view) => { - handle_peer_view_change(ctx, state, peerid, view, metrics).await?; - } - NetworkBridgeEvent::OurViewChange(view) => { - handle_our_view_change(ctx, keystore, state, view, metrics).await?; - } - NetworkBridgeEvent::PeerMessage(remote, msg) => { - let gossiped_availability = match msg { - protocol_v1::AvailabilityDistributionMessage::Chunk(candidate_hash, chunk) => { - AvailabilityGossipMessage { - candidate_hash, - erasure_chunk: chunk, - } - } - }; - - process_incoming_peer_message(ctx, state, remote, gossiped_availability, metrics) - .await?; - } - } - Ok(()) + match bridge_message { + NetworkBridgeEvent::PeerConnected(peerid, _role) => { + // insert if none already present + state.peer_views.entry(peerid).or_default(); + } + NetworkBridgeEvent::PeerDisconnected(peerid) => { + // get rid of superfluous data + state.peer_views.remove(&peerid); + } + NetworkBridgeEvent::PeerViewChange(peerid, view) => { + handle_peer_view_change(ctx, state, peerid, view, metrics).await?; + } + NetworkBridgeEvent::OurViewChange(view) => { + handle_our_view_change(ctx, keystore, state, view, metrics).await?; + } + NetworkBridgeEvent::PeerMessage(remote, msg) => { + let gossiped_availability = match msg { + protocol_v1::AvailabilityDistributionMessage::Chunk(candidate_hash, chunk) => { + AvailabilityGossipMessage { + candidate_hash, + erasure_chunk: chunk, + } + } + }; + + process_incoming_peer_message(ctx, state, remote, gossiped_availability, metrics) + .await?; + } + } + Ok(()) } /// Handle the changes necessary when our view changes. async fn handle_our_view_change( - ctx: &mut Context, - keystore: &SyncCryptoStorePtr, - state: &mut ProtocolState, - view: View, - metrics: &Metrics, + ctx: &mut Context, + keystore: &SyncCryptoStorePtr, + state: &mut ProtocolState, + view: View, + metrics: &Metrics, ) -> Result<()> where - Context: SubsystemContext, + Context: SubsystemContext, { - let old_view = std::mem::replace(&mut (state.view), view); - - // needed due to borrow rules - let view = state.view.clone(); - let added = view.difference(&old_view).collect::>(); - - // add all the relay parents and fill the cache - for added in added.iter() { - let added = **added; - let validators = query_validators(ctx, added).await?; - let validator_index = obtain_our_validator_index(&validators, keystore.clone()).await; - state - .add_relay_parent(ctx, added, validators, validator_index) - .await?; - } - - // handle all candidates - for (candidate_hash, _receipt) in state.cached_live_candidates_unioned(added) { - let per_candidate = state.per_candidate.entry(candidate_hash).or_default(); - - // assure the node has the validator role - if per_candidate.validator_index.is_none() { - continue; - }; - - // check if the availability is present in the store exists - if !query_data_availability(ctx, candidate_hash).await? { - continue; - } - - let validator_count = per_candidate.validators.len(); - - // obtain interested peers in the candidate hash - let peers: Vec = state - .peer_views - .clone() - .into_iter() - .filter(|(_peer, view)| { - // collect all direct interests of a peer w/o ancestors - state - .cached_live_candidates_unioned(view.0.iter()) - .contains_key(&candidate_hash) - }) - .map(|(peer, _view)| peer.clone()) - .collect(); - - // distribute all erasure messages to interested peers - for chunk_index in 0u32..(validator_count as u32) { - // only the peers which did not receive this particular erasure chunk - let per_candidate = state.per_candidate.entry(candidate_hash).or_default(); - - // obtain the chunks from the cache, if not fallback - // and query the availability store - let message_id = (candidate_hash, chunk_index); - let erasure_chunk = if let Some(message) = per_candidate.message_vault.get(&chunk_index) - { - message.erasure_chunk.clone() - } else if let Some(erasure_chunk) = - query_chunk(ctx, candidate_hash, chunk_index as ValidatorIndex).await? - { - erasure_chunk - } else { - continue; - }; - - debug_assert_eq!(erasure_chunk.index, chunk_index); - - let peers = peers - .iter() - .filter(|peer| { - // only pick those which were not sent before - !per_candidate - .sent_messages - .get(*peer) - .filter(|set| set.contains(&message_id)) - .is_some() - }) - .map(|peer| peer.clone()) - .collect::>(); - let message = AvailabilityGossipMessage { - candidate_hash, - erasure_chunk, - }; - - send_tracked_gossip_message_to_peers(ctx, per_candidate, metrics, peers, message) - .await?; - } - } - - // cleanup the removed relay parents and their states - let removed = old_view.difference(&view).collect::>(); - for removed in removed { - state.remove_relay_parent(&removed)?; - } - Ok(()) + let old_view = std::mem::replace(&mut (state.view), view); + + // needed due to borrow rules + let view = state.view.clone(); + let added = view.difference(&old_view).collect::>(); + + // add all the relay parents and fill the cache + for added in added.iter() { + let added = **added; + let validators = query_validators(ctx, added).await?; + let validator_index = obtain_our_validator_index(&validators, keystore.clone()).await; + state + .add_relay_parent(ctx, added, validators, validator_index) + .await?; + } + + // handle all candidates + for (candidate_hash, _receipt) in state.cached_live_candidates_unioned(added) { + let per_candidate = state.per_candidate.entry(candidate_hash).or_default(); + + // assure the node has the validator role + if per_candidate.validator_index.is_none() { + continue; + }; + + // check if the availability is present in the store exists + if !query_data_availability(ctx, candidate_hash).await? { + continue; + } + + let validator_count = per_candidate.validators.len(); + + // obtain interested peers in the candidate hash + let peers: Vec = state + .peer_views + .clone() + .into_iter() + .filter(|(_peer, view)| { + // collect all direct interests of a peer w/o ancestors + state + .cached_live_candidates_unioned(view.0.iter()) + .contains_key(&candidate_hash) + }) + .map(|(peer, _view)| peer.clone()) + .collect(); + + // distribute all erasure messages to interested peers + for chunk_index in 0u32..(validator_count as u32) { + // only the peers which did not receive this particular erasure chunk + let per_candidate = state.per_candidate.entry(candidate_hash).or_default(); + + // obtain the chunks from the cache, if not fallback + // and query the availability store + let message_id = (candidate_hash, chunk_index); + let erasure_chunk = if let Some(message) = per_candidate.message_vault.get(&chunk_index) + { + message.erasure_chunk.clone() + } else if let Some(erasure_chunk) = + query_chunk(ctx, candidate_hash, chunk_index as ValidatorIndex).await? + { + erasure_chunk + } else { + continue; + }; + + debug_assert_eq!(erasure_chunk.index, chunk_index); + + let peers = peers + .iter() + .filter(|peer| { + // only pick those which were not sent before + !per_candidate + .sent_messages + .get(*peer) + .filter(|set| set.contains(&message_id)) + .is_some() + }) + .map(|peer| peer.clone()) + .collect::>(); + let message = AvailabilityGossipMessage { + candidate_hash, + erasure_chunk, + }; + + send_tracked_gossip_message_to_peers(ctx, per_candidate, metrics, peers, message) + .await?; + } + } + + // cleanup the removed relay parents and their states + let removed = old_view.difference(&view).collect::>(); + for removed in removed { + state.remove_relay_parent(&removed)?; + } + Ok(()) } #[inline(always)] async fn send_tracked_gossip_message_to_peers( - ctx: &mut Context, - per_candidate: &mut PerCandidate, - metrics: &Metrics, - peers: Vec, - message: AvailabilityGossipMessage, + ctx: &mut Context, + per_candidate: &mut PerCandidate, + metrics: &Metrics, + peers: Vec, + message: AvailabilityGossipMessage, ) -> Result<()> where - Context: SubsystemContext, + Context: SubsystemContext, { - send_tracked_gossip_messages_to_peers(ctx, per_candidate, metrics, peers, iter::once(message)) - .await + send_tracked_gossip_messages_to_peers(ctx, per_candidate, metrics, peers, iter::once(message)) + .await } #[inline(always)] async fn send_tracked_gossip_messages_to_peer( - ctx: &mut Context, - per_candidate: &mut PerCandidate, - metrics: &Metrics, - peer: PeerId, - message_iter: impl IntoIterator, + ctx: &mut Context, + per_candidate: &mut PerCandidate, + metrics: &Metrics, + peer: PeerId, + message_iter: impl IntoIterator, ) -> Result<()> where - Context: SubsystemContext, + Context: SubsystemContext, { - send_tracked_gossip_messages_to_peers(ctx, per_candidate, metrics, vec![peer], message_iter) - .await + send_tracked_gossip_messages_to_peers(ctx, per_candidate, metrics, vec![peer], message_iter) + .await } async fn send_tracked_gossip_messages_to_peers( - ctx: &mut Context, - per_candidate: &mut PerCandidate, - metrics: &Metrics, - peers: Vec, - message_iter: impl IntoIterator, + ctx: &mut Context, + per_candidate: &mut PerCandidate, + metrics: &Metrics, + peers: Vec, + message_iter: impl IntoIterator, ) -> Result<()> where - Context: SubsystemContext, + Context: SubsystemContext, { - if peers.is_empty() { - return Ok(()); - } - for message in message_iter { - for peer in peers.iter() { - let message_id = (message.candidate_hash, message.erasure_chunk.index); - per_candidate - .sent_messages - .entry(peer.clone()) - .or_default() - .insert(message_id); - } - - per_candidate - .message_vault - .insert(message.erasure_chunk.index, message.clone()); - - let wire_message = protocol_v1::AvailabilityDistributionMessage::Chunk( - message.candidate_hash, - message.erasure_chunk, - ); - - ctx.send_message(AllMessages::NetworkBridge( - NetworkBridgeMessage::SendValidationMessage( - peers.clone(), - protocol_v1::ValidationProtocol::AvailabilityDistribution(wire_message), - ), - )) - .await - .map_err(|e| Error::TrackedGossipMessage(e))?; - - metrics.on_chunk_distributed(); - } - - Ok(()) + if peers.is_empty() { + return Ok(()); + } + for message in message_iter { + for peer in peers.iter() { + let message_id = (message.candidate_hash, message.erasure_chunk.index); + per_candidate + .sent_messages + .entry(peer.clone()) + .or_default() + .insert(message_id); + } + + per_candidate + .message_vault + .insert(message.erasure_chunk.index, message.clone()); + + let wire_message = protocol_v1::AvailabilityDistributionMessage::Chunk( + message.candidate_hash, + message.erasure_chunk, + ); + + ctx.send_message(AllMessages::NetworkBridge( + NetworkBridgeMessage::SendValidationMessage( + peers.clone(), + protocol_v1::ValidationProtocol::AvailabilityDistribution(wire_message), + ), + )) + .await + .map_err(|e| Error::TrackedGossipMessage(e))?; + + metrics.on_chunk_distributed(); + } + + Ok(()) } // Send the difference between two views which were not sent // to that particular peer. async fn handle_peer_view_change( - ctx: &mut Context, - state: &mut ProtocolState, - origin: PeerId, - view: View, - metrics: &Metrics, + ctx: &mut Context, + state: &mut ProtocolState, + origin: PeerId, + view: View, + metrics: &Metrics, ) -> Result<()> where - Context: SubsystemContext, + Context: SubsystemContext, { - let current = state.peer_views.entry(origin.clone()).or_default(); - - let added: Vec = view.difference(&*current).cloned().collect(); - - *current = view; - - // only contains the intersection of what we are interested and - // the union of all relay parent's candidates. - let added_candidates = state.cached_live_candidates_unioned(added.iter()); - - // Send all messages we've seen before and the peer is now interested - // in to that peer. - - for (candidate_hash, _receipt) in added_candidates { - let per_candidate = state.per_candidate.entry(candidate_hash).or_default(); - - // obtain the relevant chunk indices not sent yet - let messages = ((0 as ValidatorIndex)..(per_candidate.validators.len() as ValidatorIndex)) - .into_iter() - .filter_map(|erasure_chunk_index: ValidatorIndex| { - let message_id = (candidate_hash, erasure_chunk_index); - - // try to pick up the message from the message vault - // so we send as much as we have - per_candidate - .message_vault - .get(&erasure_chunk_index) - .filter(|_| { - // check if that erasure chunk was already sent before - if let Some(sent_set) = per_candidate.sent_messages.get(&origin) { - if sent_set.contains(&message_id) { - return false; - } - } - true - }) - }) - .cloned() - .collect::>(); - - send_tracked_gossip_messages_to_peer(ctx, per_candidate, metrics, origin.clone(), messages) - .await?; - } - Ok(()) + let current = state.peer_views.entry(origin.clone()).or_default(); + + let added: Vec = view.difference(&*current).cloned().collect(); + + *current = view; + + // only contains the intersection of what we are interested and + // the union of all relay parent's candidates. + let added_candidates = state.cached_live_candidates_unioned(added.iter()); + + // Send all messages we've seen before and the peer is now interested + // in to that peer. + + for (candidate_hash, _receipt) in added_candidates { + let per_candidate = state.per_candidate.entry(candidate_hash).or_default(); + + // obtain the relevant chunk indices not sent yet + let messages = ((0 as ValidatorIndex)..(per_candidate.validators.len() as ValidatorIndex)) + .into_iter() + .filter_map(|erasure_chunk_index: ValidatorIndex| { + let message_id = (candidate_hash, erasure_chunk_index); + + // try to pick up the message from the message vault + // so we send as much as we have + per_candidate + .message_vault + .get(&erasure_chunk_index) + .filter(|_| { + // check if that erasure chunk was already sent before + if let Some(sent_set) = per_candidate.sent_messages.get(&origin) { + if sent_set.contains(&message_id) { + return false; + } + } + true + }) + }) + .cloned() + .collect::>(); + + send_tracked_gossip_messages_to_peer(ctx, per_candidate, metrics, origin.clone(), messages) + .await?; + } + Ok(()) } /// Obtain the first key which has a signing key. /// Returns the index within the validator set as `ValidatorIndex`, if there exists one, /// otherwise, `None` is returned. async fn obtain_our_validator_index( - validators: &[ValidatorId], - keystore: SyncCryptoStorePtr, + validators: &[ValidatorId], + keystore: SyncCryptoStorePtr, ) -> Option { - for (idx, validator) in validators.iter().enumerate() { - if CryptoStore::has_keys( - &*keystore, - &[(validator.to_raw_vec(), PARACHAIN_KEY_TYPE_ID)], - ) - .await - { - return Some(idx as ValidatorIndex); - } - } - None + for (idx, validator) in validators.iter().enumerate() { + if CryptoStore::has_keys( + &*keystore, + &[(validator.to_raw_vec(), PARACHAIN_KEY_TYPE_ID)], + ) + .await + { + return Some(idx as ValidatorIndex); + } + } + None } /// Handle an incoming message from a peer. async fn process_incoming_peer_message( - ctx: &mut Context, - state: &mut ProtocolState, - origin: PeerId, - message: AvailabilityGossipMessage, - metrics: &Metrics, + ctx: &mut Context, + state: &mut ProtocolState, + origin: PeerId, + message: AvailabilityGossipMessage, + metrics: &Metrics, ) -> Result<()> where - Context: SubsystemContext, + Context: SubsystemContext, { - // obtain the set of candidates we are interested in based on our current view - let live_candidates = state.cached_live_candidates_unioned(state.view.0.iter()); - - // check if the candidate is of interest - let live_candidate = if let Some(live_candidate) = live_candidates.get(&message.candidate_hash) - { - live_candidate - } else { - return modify_reputation(ctx, origin, COST_NOT_A_LIVE_CANDIDATE).await; - }; - - // check the merkle proof - let root = &live_candidate.commitments.erasure_root; - let anticipated_hash = if let Ok(hash) = branch_hash( - root, - &message.erasure_chunk.proof, - message.erasure_chunk.index as usize, - ) { - hash - } else { - return modify_reputation(ctx, origin, COST_MERKLE_PROOF_INVALID).await; - }; - - let erasure_chunk_hash = BlakeTwo256::hash(&message.erasure_chunk.chunk); - if anticipated_hash != erasure_chunk_hash { - return modify_reputation(ctx, origin, COST_MERKLE_PROOF_INVALID).await; - } - - // an internal unique identifier of this message - let message_id = (message.candidate_hash, message.erasure_chunk.index); - - { - let per_candidate = state.per_candidate.entry(message_id.0.clone()).or_default(); - - // check if this particular erasure chunk was already sent by that peer before - { - let received_set = per_candidate - .received_messages - .entry(origin.clone()) - .or_default(); - if received_set.contains(&message_id) { - return modify_reputation(ctx, origin, COST_PEER_DUPLICATE_MESSAGE).await; - } else { - received_set.insert(message_id.clone()); - } - } - - // insert into known messages and change reputation - if per_candidate - .message_vault - .insert(message_id.1, message.clone()) - .is_some() - { - modify_reputation(ctx, origin, BENEFIT_VALID_MESSAGE).await?; - } else { - modify_reputation(ctx, origin, BENEFIT_VALID_MESSAGE_FIRST).await?; - - // save the chunk for our index - if let Some(validator_index) = per_candidate.validator_index { - if message.erasure_chunk.index == validator_index { - if let Err(_e) = store_chunk( - ctx, - message.candidate_hash.clone(), - message.erasure_chunk.index, - message.erasure_chunk.clone(), - ) - .await? - { - warn!( - target: TARGET, - "Failed to store erasure chunk to availability store" - ); - } - } - } - }; - } - // condense the peers to the peers with interest on the candidate - let peers = state - .peer_views - .clone() - .into_iter() - .filter(|(_peer, view)| { - // peers view must contain the candidate hash too - state - .cached_live_candidates_unioned(view.0.iter()) - .contains_key(&message_id.0) - }) - .map(|(peer, _)| -> PeerId { peer.clone() }) - .collect::>(); - - let per_candidate = state.per_candidate.entry(message_id.0.clone()).or_default(); - - let peers = peers - .into_iter() - .filter(|peer| { - let peer: PeerId = peer.clone(); - // avoid sending duplicate messages - per_candidate - .sent_messages - .entry(peer) - .or_default() - .contains(&message_id) - }) - .collect::>(); - - // gossip that message to interested peers - send_tracked_gossip_message_to_peers(ctx, per_candidate, metrics, peers, message).await + // obtain the set of candidates we are interested in based on our current view + let live_candidates = state.cached_live_candidates_unioned(state.view.0.iter()); + + // check if the candidate is of interest + let live_candidate = if let Some(live_candidate) = live_candidates.get(&message.candidate_hash) + { + live_candidate + } else { + return modify_reputation(ctx, origin, COST_NOT_A_LIVE_CANDIDATE).await; + }; + + // check the merkle proof + let root = &live_candidate.commitments.erasure_root; + let anticipated_hash = if let Ok(hash) = branch_hash( + root, + &message.erasure_chunk.proof, + message.erasure_chunk.index as usize, + ) { + hash + } else { + return modify_reputation(ctx, origin, COST_MERKLE_PROOF_INVALID).await; + }; + + let erasure_chunk_hash = BlakeTwo256::hash(&message.erasure_chunk.chunk); + if anticipated_hash != erasure_chunk_hash { + return modify_reputation(ctx, origin, COST_MERKLE_PROOF_INVALID).await; + } + + // an internal unique identifier of this message + let message_id = (message.candidate_hash, message.erasure_chunk.index); + + { + let per_candidate = state.per_candidate.entry(message_id.0.clone()).or_default(); + + // check if this particular erasure chunk was already sent by that peer before + { + let received_set = per_candidate + .received_messages + .entry(origin.clone()) + .or_default(); + if received_set.contains(&message_id) { + return modify_reputation(ctx, origin, COST_PEER_DUPLICATE_MESSAGE).await; + } else { + received_set.insert(message_id.clone()); + } + } + + // insert into known messages and change reputation + if per_candidate + .message_vault + .insert(message_id.1, message.clone()) + .is_some() + { + modify_reputation(ctx, origin, BENEFIT_VALID_MESSAGE).await?; + } else { + modify_reputation(ctx, origin, BENEFIT_VALID_MESSAGE_FIRST).await?; + + // save the chunk for our index + if let Some(validator_index) = per_candidate.validator_index { + if message.erasure_chunk.index == validator_index { + if let Err(_e) = store_chunk( + ctx, + message.candidate_hash.clone(), + message.erasure_chunk.index, + message.erasure_chunk.clone(), + ) + .await? + { + warn!( + target: TARGET, + "Failed to store erasure chunk to availability store" + ); + } + } + } + }; + } + // condense the peers to the peers with interest on the candidate + let peers = state + .peer_views + .clone() + .into_iter() + .filter(|(_peer, view)| { + // peers view must contain the candidate hash too + state + .cached_live_candidates_unioned(view.0.iter()) + .contains_key(&message_id.0) + }) + .map(|(peer, _)| -> PeerId { peer.clone() }) + .collect::>(); + + let per_candidate = state.per_candidate.entry(message_id.0.clone()).or_default(); + + let peers = peers + .into_iter() + .filter(|peer| { + let peer: PeerId = peer.clone(); + // avoid sending duplicate messages + per_candidate + .sent_messages + .entry(peer) + .or_default() + .contains(&message_id) + }) + .collect::>(); + + // gossip that message to interested peers + send_tracked_gossip_message_to_peers(ctx, per_candidate, metrics, peers, message).await } /// The bitfield distribution subsystem. pub struct AvailabilityDistributionSubsystem { - /// Pointer to a keystore, which is required for determining this nodes validator index. - keystore: SyncCryptoStorePtr, - /// Prometheus metrics. - metrics: Metrics, + /// Pointer to a keystore, which is required for determining this nodes validator index. + keystore: SyncCryptoStorePtr, + /// Prometheus metrics. + metrics: Metrics, } impl AvailabilityDistributionSubsystem { - /// Number of ancestors to keep around for the relay-chain heads. - const K: usize = 3; - - /// Create a new instance of the availability distribution. - pub fn new(keystore: SyncCryptoStorePtr, metrics: Metrics) -> Self { - Self { keystore, metrics } - } - - /// Start processing work as passed on from the Overseer. - async fn run(self, mut ctx: Context) -> Result<()> - where - Context: SubsystemContext, - { - // work: process incoming messages from the overseer. - let mut state = ProtocolState::default(); - loop { - let message = ctx - .recv() - .await - .map_err(|e| Error::IncomingMessageChannel(e))?; - match message { - FromOverseer::Communication { - msg: AvailabilityDistributionMessage::NetworkBridgeUpdateV1(event), - } => { - if let Err(e) = handle_network_msg( - &mut ctx, - &self.keystore.clone(), - &mut state, - &self.metrics, - event, - ) - .await - { - warn!( - target: TARGET, - "Failed to handle incomming network messages: {:?}", e - ); - } - } - FromOverseer::Signal(OverseerSignal::ActiveLeaves(ActiveLeavesUpdate { - activated: _, - deactivated: _, - })) => { - // handled at view change - } - FromOverseer::Signal(OverseerSignal::BlockFinalized(_)) => {} - FromOverseer::Signal(OverseerSignal::Conclude) => { - return Ok(()); - } - } - } - } + /// Number of ancestors to keep around for the relay-chain heads. + const K: usize = 3; + + /// Create a new instance of the availability distribution. + pub fn new(keystore: SyncCryptoStorePtr, metrics: Metrics) -> Self { + Self { keystore, metrics } + } + + /// Start processing work as passed on from the Overseer. + async fn run(self, mut ctx: Context) -> Result<()> + where + Context: SubsystemContext, + { + // work: process incoming messages from the overseer. + let mut state = ProtocolState::default(); + loop { + let message = ctx + .recv() + .await + .map_err(|e| Error::IncomingMessageChannel(e))?; + match message { + FromOverseer::Communication { + msg: AvailabilityDistributionMessage::NetworkBridgeUpdateV1(event), + } => { + if let Err(e) = handle_network_msg( + &mut ctx, + &self.keystore.clone(), + &mut state, + &self.metrics, + event, + ) + .await + { + warn!( + target: TARGET, + "Failed to handle incomming network messages: {:?}", e + ); + } + } + FromOverseer::Signal(OverseerSignal::ActiveLeaves(ActiveLeavesUpdate { + activated: _, + deactivated: _, + })) => { + // handled at view change + } + FromOverseer::Signal(OverseerSignal::BlockFinalized(_)) => {} + FromOverseer::Signal(OverseerSignal::Conclude) => { + return Ok(()); + } + } + } + } } impl Subsystem for AvailabilityDistributionSubsystem where - Context: SubsystemContext + Sync + Send, + Context: SubsystemContext + Sync + Send, { - fn start(self, ctx: Context) -> SpawnedSubsystem { - let future = self - .run(ctx) - .map_err(|e| SubsystemError::with_origin("availability-distribution", e)) - .map(|_| ()) - .boxed(); - - SpawnedSubsystem { - name: "availability-distribution-subsystem", - future, - } - } + fn start(self, ctx: Context) -> SpawnedSubsystem { + let future = self + .run(ctx) + .map_err(|e| SubsystemError::with_origin("availability-distribution", e)) + .map(|_| ()) + .boxed(); + + SpawnedSubsystem { + name: "availability-distribution-subsystem", + future, + } + } } /// Obtain all live candidates based on an iterator of relay heads. async fn query_live_candidates_without_ancestors( - ctx: &mut Context, - relay_parents: impl IntoIterator, + ctx: &mut Context, + relay_parents: impl IntoIterator, ) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - let iter = relay_parents.into_iter(); - let hint = iter.size_hint(); - - let mut live_candidates = HashSet::with_capacity(hint.1.unwrap_or(hint.0)); - for relay_parent in iter { - let paras = query_para_ids(ctx, relay_parent).await?; - for para in paras { - if let Some(ccr) = query_pending_availability(ctx, relay_parent, para).await? { - live_candidates.insert(ccr); - } - } - } - Ok(live_candidates) + let iter = relay_parents.into_iter(); + let hint = iter.size_hint(); + + let mut live_candidates = HashSet::with_capacity(hint.1.unwrap_or(hint.0)); + for relay_parent in iter { + let paras = query_para_ids(ctx, relay_parent).await?; + for para in paras { + if let Some(ccr) = query_pending_availability(ctx, relay_parent, para).await? { + live_candidates.insert(ccr); + } + } + } + Ok(live_candidates) } /// Obtain all live candidates based on an iterator or relay heads including `k` ancestors. /// /// Relay parent. async fn query_live_candidates( - ctx: &mut Context, - state: &mut ProtocolState, - relay_parents: impl IntoIterator, + ctx: &mut Context, + state: &mut ProtocolState, + relay_parents: impl IntoIterator, ) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - let iter = relay_parents.into_iter(); - let hint = iter.size_hint(); - - let capacity = hint.1.unwrap_or(hint.0) * (1 + AvailabilityDistributionSubsystem::K); - let mut live_candidates = - HashMap::::with_capacity(capacity); - - for relay_parent in iter { - // register one of relay parents (not the ancestors) - let mut ancestors = query_up_to_k_ancestors_in_same_session( - ctx, - relay_parent, - AvailabilityDistributionSubsystem::K, - ) - .await?; - - ancestors.push(relay_parent); - - // ancestors might overlap, so check the cache too - let unknown = ancestors - .into_iter() - .filter(|relay_parent_or_ancestor| { - // use the ones which we pulled before - // but keep the unknown relay parents - state - .receipts - .get(relay_parent_or_ancestor) - .and_then(|receipts| { - // directly extend the live_candidates with the cached value - live_candidates.extend(receipts.into_iter().map( - |(receipt_hash, receipt)| { - (relay_parent, (receipt_hash.clone(), receipt.clone())) - }, - )); - Some(()) - }) - .is_none() - }) - .collect::>(); - - // query the ones that were not present in the receipts cache - let receipts = query_live_candidates_without_ancestors(ctx, unknown.clone()).await?; - live_candidates.extend( - unknown.into_iter().zip( - receipts - .into_iter() - .map(|receipt| (receipt.hash(), receipt)), - ), - ); - } - Ok(live_candidates) + let iter = relay_parents.into_iter(); + let hint = iter.size_hint(); + + let capacity = hint.1.unwrap_or(hint.0) * (1 + AvailabilityDistributionSubsystem::K); + let mut live_candidates = + HashMap::::with_capacity(capacity); + + for relay_parent in iter { + // register one of relay parents (not the ancestors) + let mut ancestors = query_up_to_k_ancestors_in_same_session( + ctx, + relay_parent, + AvailabilityDistributionSubsystem::K, + ) + .await?; + + ancestors.push(relay_parent); + + // ancestors might overlap, so check the cache too + let unknown = ancestors + .into_iter() + .filter(|relay_parent_or_ancestor| { + // use the ones which we pulled before + // but keep the unknown relay parents + state + .receipts + .get(relay_parent_or_ancestor) + .and_then(|receipts| { + // directly extend the live_candidates with the cached value + live_candidates.extend(receipts.into_iter().map( + |(receipt_hash, receipt)| { + (relay_parent, (receipt_hash.clone(), receipt.clone())) + }, + )); + Some(()) + }) + .is_none() + }) + .collect::>(); + + // query the ones that were not present in the receipts cache + let receipts = query_live_candidates_without_ancestors(ctx, unknown.clone()).await?; + live_candidates.extend( + unknown.into_iter().zip( + receipts + .into_iter() + .map(|receipt| (receipt.hash(), receipt)), + ), + ); + } + Ok(live_candidates) } /// Query all para IDs. async fn query_para_ids(ctx: &mut Context, relay_parent: Hash) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - let (tx, rx) = oneshot::channel(); - ctx.send_message(AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::AvailabilityCores(tx), - ))) - .await - .map_err(|e| Error::AvailabilityCoresSendQuery(e))?; - - let all_para_ids: Vec<_> = rx - .await - .map_err(|e| Error::AvailabilityCoresResponseChannel(e))? - .map_err(|e| Error::AvailabilityCores(e))?; - - let occupied_para_ids = all_para_ids - .into_iter() - .filter_map(|core_state| { - if let CoreState::Occupied(occupied) = core_state { - Some(occupied.para_id) - } else { - None - } - }) - .collect(); - Ok(occupied_para_ids) + let (tx, rx) = oneshot::channel(); + ctx.send_message(AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::AvailabilityCores(tx), + ))) + .await + .map_err(|e| Error::AvailabilityCoresSendQuery(e))?; + + let all_para_ids: Vec<_> = rx + .await + .map_err(|e| Error::AvailabilityCoresResponseChannel(e))? + .map_err(|e| Error::AvailabilityCores(e))?; + + let occupied_para_ids = all_para_ids + .into_iter() + .filter_map(|core_state| { + if let CoreState::Occupied(occupied) = core_state { + Some(occupied.para_id) + } else { + None + } + }) + .collect(); + Ok(occupied_para_ids) } /// Modify the reputation of a peer based on its behavior. async fn modify_reputation(ctx: &mut Context, peer: PeerId, rep: Rep) -> Result<()> where - Context: SubsystemContext, + Context: SubsystemContext, { - trace!( - target: TARGET, - "Reputation change of {:?} for peer {:?}", - rep, - peer - ); - ctx.send_message(AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep), - )) - .await - .map_err(|e| Error::ReportPeerMessageSend(e)) + trace!( + target: TARGET, + "Reputation change of {:?} for peer {:?}", + rep, + peer + ); + ctx.send_message(AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep), + )) + .await + .map_err(|e| Error::ReportPeerMessageSend(e)) } /// Query the proof of validity for a particular candidate hash. async fn query_data_availability(ctx: &mut Context, candidate_hash: Hash) -> Result where - Context: SubsystemContext, + Context: SubsystemContext, { - let (tx, rx) = oneshot::channel(); - ctx.send_message(AllMessages::AvailabilityStore( - AvailabilityStoreMessage::QueryDataAvailability(candidate_hash, tx), - )) - .await - .map_err(|e| Error::QueryAvailabilitySendQuery(e))?; - rx.await - .map_err(|e| Error::QueryAvailabilityResponseChannel(e)) + let (tx, rx) = oneshot::channel(); + ctx.send_message(AllMessages::AvailabilityStore( + AvailabilityStoreMessage::QueryDataAvailability(candidate_hash, tx), + )) + .await + .map_err(|e| Error::QueryAvailabilitySendQuery(e))?; + rx.await + .map_err(|e| Error::QueryAvailabilityResponseChannel(e)) } async fn query_chunk( - ctx: &mut Context, - candidate_hash: Hash, - validator_index: ValidatorIndex, + ctx: &mut Context, + candidate_hash: Hash, + validator_index: ValidatorIndex, ) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - let (tx, rx) = oneshot::channel(); - ctx.send_message(AllMessages::AvailabilityStore( - AvailabilityStoreMessage::QueryChunk(candidate_hash, validator_index, tx), - )) - .await - .map_err(|e| Error::QueryChunkSendQuery(e))?; - rx.await.map_err(|e| Error::QueryChunkResponseChannel(e)) + let (tx, rx) = oneshot::channel(); + ctx.send_message(AllMessages::AvailabilityStore( + AvailabilityStoreMessage::QueryChunk(candidate_hash, validator_index, tx), + )) + .await + .map_err(|e| Error::QueryChunkSendQuery(e))?; + rx.await.map_err(|e| Error::QueryChunkResponseChannel(e)) } async fn store_chunk( - ctx: &mut Context, - candidate_hash: Hash, - validator_index: ValidatorIndex, - erasure_chunk: ErasureChunk, + ctx: &mut Context, + candidate_hash: Hash, + validator_index: ValidatorIndex, + erasure_chunk: ErasureChunk, ) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - let (tx, rx) = oneshot::channel(); - ctx.send_message(AllMessages::AvailabilityStore( - AvailabilityStoreMessage::StoreChunk(candidate_hash, validator_index, erasure_chunk, tx), - )) - .await - .map_err(|e| Error::StoreChunkSendQuery(e))?; - rx.await.map_err(|e| Error::StoreChunkResponseChannel(e)) + let (tx, rx) = oneshot::channel(); + ctx.send_message(AllMessages::AvailabilityStore( + AvailabilityStoreMessage::StoreChunk(candidate_hash, validator_index, erasure_chunk, tx), + )) + .await + .map_err(|e| Error::StoreChunkSendQuery(e))?; + rx.await.map_err(|e| Error::StoreChunkResponseChannel(e)) } /// Request the head data for a particular para. async fn query_pending_availability( - ctx: &mut Context, - relay_parent: Hash, - para: ParaId, + ctx: &mut Context, + relay_parent: Hash, + para: ParaId, ) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - let (tx, rx) = oneshot::channel(); - ctx.send_message(AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::CandidatePendingAvailability(para, tx), - ))) - .await - .map_err(|e| Error::QueryPendingAvailabilitySendQuery(e))?; - - rx.await - .map_err(|e| Error::QueryPendingAvailabilityResponseChannel(e))? - .map_err(|e| Error::QueryPendingAvailability(e)) + let (tx, rx) = oneshot::channel(); + ctx.send_message(AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::CandidatePendingAvailability(para, tx), + ))) + .await + .map_err(|e| Error::QueryPendingAvailabilitySendQuery(e))?; + + rx.await + .map_err(|e| Error::QueryPendingAvailabilityResponseChannel(e))? + .map_err(|e| Error::QueryPendingAvailability(e)) } /// Query the validator set. async fn query_validators( - ctx: &mut Context, - relay_parent: Hash, + ctx: &mut Context, + relay_parent: Hash, ) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - let (tx, rx) = oneshot::channel(); - let query_validators = AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::Validators(tx), - )); - - ctx.send_message(query_validators) - .await - .map_err(|e| Error::QueryValidatorsSendQuery(e))?; - rx.await - .map_err(|e| Error::QueryValidatorsResponseChannel(e))? - .map_err(|e| Error::QueryValidators(e)) + let (tx, rx) = oneshot::channel(); + let query_validators = AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::Validators(tx), + )); + + ctx.send_message(query_validators) + .await + .map_err(|e| Error::QueryValidatorsSendQuery(e))?; + rx.await + .map_err(|e| Error::QueryValidatorsResponseChannel(e))? + .map_err(|e| Error::QueryValidators(e)) } /// Query the hash of the `K` ancestors async fn query_k_ancestors( - ctx: &mut Context, - relay_parent: Hash, - k: usize, + ctx: &mut Context, + relay_parent: Hash, + k: usize, ) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - let (tx, rx) = oneshot::channel(); - let query_ancestors = AllMessages::ChainApi(ChainApiMessage::Ancestors { - hash: relay_parent, - k, - response_channel: tx, - }); - - ctx.send_message(query_ancestors) - .await - .map_err(|e| Error::QueryAncestorsSendQuery(e))?; - rx.await - .map_err(|e| Error::QueryAncestorsResponseChannel(e))? - .map_err(|e| Error::QueryAncestors(e)) + let (tx, rx) = oneshot::channel(); + let query_ancestors = AllMessages::ChainApi(ChainApiMessage::Ancestors { + hash: relay_parent, + k, + response_channel: tx, + }); + + ctx.send_message(query_ancestors) + .await + .map_err(|e| Error::QueryAncestorsSendQuery(e))?; + rx.await + .map_err(|e| Error::QueryAncestorsResponseChannel(e))? + .map_err(|e| Error::QueryAncestors(e)) } /// Query the session index of a relay parent async fn query_session_index_for_child( - ctx: &mut Context, - relay_parent: Hash, + ctx: &mut Context, + relay_parent: Hash, ) -> Result where - Context: SubsystemContext, + Context: SubsystemContext, { - let (tx, rx) = oneshot::channel(); - let query_session_idx_for_child = AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::SessionIndexForChild(tx), - )); - - ctx.send_message(query_session_idx_for_child) - .await - .map_err(|e| Error::QuerySessionSendQuery(e))?; - rx.await - .map_err(|e| Error::QuerySessionResponseChannel(e))? - .map_err(|e| Error::QuerySession(e)) + let (tx, rx) = oneshot::channel(); + let query_session_idx_for_child = AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::SessionIndexForChild(tx), + )); + + ctx.send_message(query_session_idx_for_child) + .await + .map_err(|e| Error::QuerySessionSendQuery(e))?; + rx.await + .map_err(|e| Error::QuerySessionResponseChannel(e))? + .map_err(|e| Error::QuerySession(e)) } /// Queries up to k ancestors with the constraints of equiv session async fn query_up_to_k_ancestors_in_same_session( - ctx: &mut Context, - relay_parent: Hash, - k: usize, + ctx: &mut Context, + relay_parent: Hash, + k: usize, ) -> Result> where - Context: SubsystemContext, + Context: SubsystemContext, { - // k + 1 since we always query the child's session index - // ordering is [parent, grandparent, greatgrandparent, greatgreatgrandparent, ...] - let ancestors = query_k_ancestors(ctx, relay_parent, k + 1).await?; - let desired_session = query_session_index_for_child(ctx, relay_parent).await?; - // we would only need `ancestors.len() - 1`, but the one extra could avoid a re-alloc - // if the consumer wants to push the `relay_parent` onto it too and does not hurt otherwise - let mut acc = Vec::with_capacity(ancestors.len()); - - // iterate from youngest to oldest - let mut iter = ancestors.into_iter().peekable(); - - while let Some(ancestor) = iter.next() { - if let Some(ancestor_parent) = iter.peek() { - let session = query_session_index_for_child(ctx, *ancestor_parent).await?; - if session != desired_session { - break; - } - acc.push(ancestor); - } else { - // either ended up at genesis or the blocks were - // already pruned - break; - } - } - - debug_assert!(acc.len() <= k); - Ok(acc) + // k + 1 since we always query the child's session index + // ordering is [parent, grandparent, greatgrandparent, greatgreatgrandparent, ...] + let ancestors = query_k_ancestors(ctx, relay_parent, k + 1).await?; + let desired_session = query_session_index_for_child(ctx, relay_parent).await?; + // we would only need `ancestors.len() - 1`, but the one extra could avoid a re-alloc + // if the consumer wants to push the `relay_parent` onto it too and does not hurt otherwise + let mut acc = Vec::with_capacity(ancestors.len()); + + // iterate from youngest to oldest + let mut iter = ancestors.into_iter().peekable(); + + while let Some(ancestor) = iter.next() { + if let Some(ancestor_parent) = iter.peek() { + let session = query_session_index_for_child(ctx, *ancestor_parent).await?; + if session != desired_session { + break; + } + acc.push(ancestor); + } else { + // either ended up at genesis or the blocks were + // already pruned + break; + } + } + + debug_assert!(acc.len() <= k); + Ok(acc) } #[derive(Clone)] struct MetricsInner { - gossipped_availability_chunks: prometheus::Counter, + gossipped_availability_chunks: prometheus::Counter, } /// Availability Distribution metrics. @@ -1156,28 +1156,28 @@ struct MetricsInner { pub struct Metrics(Option); impl Metrics { - fn on_chunk_distributed(&self) { - if let Some(metrics) = &self.0 { - metrics.gossipped_availability_chunks.inc(); - } - } + fn on_chunk_distributed(&self) { + if let Some(metrics) = &self.0 { + metrics.gossipped_availability_chunks.inc(); + } + } } impl metrics::Metrics for Metrics { - fn try_register( - registry: &prometheus::Registry, - ) -> std::result::Result { - let metrics = MetricsInner { - gossipped_availability_chunks: prometheus::register( - prometheus::Counter::new( - "parachain_gossipped_availability_chunks_total", - "Number of availability chunks gossipped to other peers.", - )?, - registry, - )?, - }; - Ok(Metrics(Some(metrics))) - } + fn try_register( + registry: &prometheus::Registry, + ) -> std::result::Result { + let metrics = MetricsInner { + gossipped_availability_chunks: prometheus::register( + prometheus::Counter::new( + "parachain_gossipped_availability_chunks_total", + "Number of availability chunks gossipped to other peers.", + )?, + registry, + )?, + }; + Ok(Metrics(Some(metrics))) + } } #[cfg(test)] diff --git a/node/network/availability-distribution/src/tests.rs b/node/network/availability-distribution/src/tests.rs index c42c0b7c6479..2387c943cfa8 100644 --- a/node/network/availability-distribution/src/tests.rs +++ b/node/network/availability-distribution/src/tests.rs @@ -20,8 +20,8 @@ use polkadot_erasure_coding::{branches, obtain_chunks_v1 as obtain_chunks}; use polkadot_node_network_protocol::ObservedRole; use polkadot_node_subsystem_util::TimeoutExt; use polkadot_primitives::v1::{ - AvailableData, BlockData, CandidateCommitments, CandidateDescriptor, GroupIndex, - GroupRotationInfo, HeadData, OccupiedCore, PersistedValidationData, PoV, ScheduledCore, + AvailableData, BlockData, CandidateCommitments, CandidateDescriptor, GroupIndex, + GroupRotationInfo, HeadData, OccupiedCore, PersistedValidationData, PoV, ScheduledCore, }; use polkadot_subsystem_testhelpers::{self as test_helpers}; @@ -40,931 +40,931 @@ macro_rules! view { } macro_rules! delay { - ($delay:expr) => { - Delay::new(Duration::from_millis($delay)).await; - }; + ($delay:expr) => { + Delay::new(Duration::from_millis($delay)).await; + }; } fn chunk_protocol_message( - message: AvailabilityGossipMessage, + message: AvailabilityGossipMessage, ) -> protocol_v1::AvailabilityDistributionMessage { - protocol_v1::AvailabilityDistributionMessage::Chunk( - message.candidate_hash, - message.erasure_chunk, - ) + protocol_v1::AvailabilityDistributionMessage::Chunk( + message.candidate_hash, + message.erasure_chunk, + ) } struct TestHarness { - virtual_overseer: test_helpers::TestSubsystemContextHandle, + virtual_overseer: test_helpers::TestSubsystemContextHandle, } fn test_harness>( - keystore: SyncCryptoStorePtr, - test: impl FnOnce(TestHarness) -> T, + keystore: SyncCryptoStorePtr, + test: impl FnOnce(TestHarness) -> T, ) { - let _ = env_logger::builder() - .is_test(true) - .filter( - Some("polkadot_availability_distribution"), - log::LevelFilter::Trace, - ) - .try_init(); + let _ = env_logger::builder() + .is_test(true) + .filter( + Some("polkadot_availability_distribution"), + log::LevelFilter::Trace, + ) + .try_init(); - let pool = sp_core::testing::TaskExecutor::new(); + let pool = sp_core::testing::TaskExecutor::new(); - let (context, virtual_overseer) = test_helpers::make_subsystem_context(pool.clone()); + let (context, virtual_overseer) = test_helpers::make_subsystem_context(pool.clone()); - let subsystem = AvailabilityDistributionSubsystem::new(keystore, Default::default()); - let subsystem = subsystem.run(context); + let subsystem = AvailabilityDistributionSubsystem::new(keystore, Default::default()); + let subsystem = subsystem.run(context); - let test_fut = test(TestHarness { virtual_overseer }); + let test_fut = test(TestHarness { virtual_overseer }); - futures::pin_mut!(test_fut); - futures::pin_mut!(subsystem); + futures::pin_mut!(test_fut); + futures::pin_mut!(subsystem); - executor::block_on(future::select(test_fut, subsystem)); + executor::block_on(future::select(test_fut, subsystem)); } const TIMEOUT: Duration = Duration::from_millis(100); async fn overseer_signal( - overseer: &mut test_helpers::TestSubsystemContextHandle, - signal: OverseerSignal, + overseer: &mut test_helpers::TestSubsystemContextHandle, + signal: OverseerSignal, ) { - delay!(50); - overseer - .send(FromOverseer::Signal(signal)) - .timeout(TIMEOUT) - .await - .expect("10ms is more than enough for sending signals."); + delay!(50); + overseer + .send(FromOverseer::Signal(signal)) + .timeout(TIMEOUT) + .await + .expect("10ms is more than enough for sending signals."); } async fn overseer_send( - overseer: &mut test_helpers::TestSubsystemContextHandle, - msg: AvailabilityDistributionMessage, + overseer: &mut test_helpers::TestSubsystemContextHandle, + msg: AvailabilityDistributionMessage, ) { - log::trace!("Sending message:\n{:?}", &msg); - overseer - .send(FromOverseer::Communication { msg }) - .timeout(TIMEOUT) - .await - .expect("10ms is more than enough for sending messages."); + log::trace!("Sending message:\n{:?}", &msg); + overseer + .send(FromOverseer::Communication { msg }) + .timeout(TIMEOUT) + .await + .expect("10ms is more than enough for sending messages."); } async fn overseer_recv( - overseer: &mut test_helpers::TestSubsystemContextHandle, + overseer: &mut test_helpers::TestSubsystemContextHandle, ) -> AllMessages { - log::trace!("Waiting for message ..."); - let msg = overseer - .recv() - .timeout(TIMEOUT) - .await - .expect("TIMEOUT is enough to recv."); - log::trace!("Received message:\n{:?}", &msg); - msg + log::trace!("Waiting for message ..."); + let msg = overseer + .recv() + .timeout(TIMEOUT) + .await + .expect("TIMEOUT is enough to recv."); + log::trace!("Received message:\n{:?}", &msg); + msg } fn dummy_occupied_core(para: ParaId) -> CoreState { - CoreState::Occupied(OccupiedCore { - para_id: para, - next_up_on_available: None, - occupied_since: 0, - time_out_at: 5, - next_up_on_time_out: None, - availability: Default::default(), - group_responsible: GroupIndex::from(0), - }) + CoreState::Occupied(OccupiedCore { + para_id: para, + next_up_on_available: None, + occupied_since: 0, + time_out_at: 5, + next_up_on_time_out: None, + availability: Default::default(), + group_responsible: GroupIndex::from(0), + }) } use sp_keyring::Sr25519Keyring; #[derive(Clone)] struct TestState { - chain_ids: Vec, - validators: Vec, - validator_public: Vec, - validator_index: Option, - validator_groups: (Vec>, GroupRotationInfo), - head_data: HashMap, - keystore: SyncCryptoStorePtr, - relay_parent: Hash, - ancestors: Vec, - availability_cores: Vec, - persisted_validation_data: PersistedValidationData, + chain_ids: Vec, + validators: Vec, + validator_public: Vec, + validator_index: Option, + validator_groups: (Vec>, GroupRotationInfo), + head_data: HashMap, + keystore: SyncCryptoStorePtr, + relay_parent: Hash, + ancestors: Vec, + availability_cores: Vec, + persisted_validation_data: PersistedValidationData, } fn validator_pubkeys(val_ids: &[Sr25519Keyring]) -> Vec { - val_ids.iter().map(|v| v.public().into()).collect() + val_ids.iter().map(|v| v.public().into()).collect() } impl Default for TestState { - fn default() -> Self { - let chain_a = ParaId::from(1); - let chain_b = ParaId::from(2); - - let chain_ids = vec![chain_a, chain_b]; - - let validators = vec![ - Sr25519Keyring::Ferdie, // <- this node, role: validator - Sr25519Keyring::Alice, - Sr25519Keyring::Bob, - Sr25519Keyring::Charlie, - Sr25519Keyring::Dave, - ]; - - let keystore: SyncCryptoStorePtr = Arc::new(LocalKeystore::in_memory()); - - SyncCryptoStore::sr25519_generate_new( - &*keystore, - ValidatorId::ID, - Some(&validators[0].to_seed()), - ) - .expect("Insert key into keystore"); - - let validator_public = validator_pubkeys(&validators); - - let validator_groups = vec![vec![2, 0, 4], vec![1], vec![3]]; - let group_rotation_info = GroupRotationInfo { - session_start_block: 0, - group_rotation_frequency: 100, - now: 1, - }; - let validator_groups = (validator_groups, group_rotation_info); - - let availability_cores = vec![ - CoreState::Scheduled(ScheduledCore { - para_id: chain_ids[0], - collator: None, - }), - CoreState::Scheduled(ScheduledCore { - para_id: chain_ids[1], - collator: None, - }), - ]; - - let mut head_data = HashMap::new(); - head_data.insert(chain_a, HeadData(vec![4, 5, 6])); - head_data.insert(chain_b, HeadData(vec![7, 8, 9])); - - let ancestors = vec![ - Hash::repeat_byte(0x44), - Hash::repeat_byte(0x33), - Hash::repeat_byte(0x22), - ]; - let relay_parent = Hash::repeat_byte(0x05); - - let persisted_validation_data = PersistedValidationData { - parent_head: HeadData(vec![7, 8, 9]), - block_number: Default::default(), - hrmp_mqc_heads: Vec::new(), - }; - - let validator_index = Some((validators.len() - 1) as ValidatorIndex); - - Self { - chain_ids, - keystore, - validators, - validator_public, - validator_groups, - availability_cores, - head_data, - persisted_validation_data, - relay_parent, - ancestors, - validator_index, - } - } + fn default() -> Self { + let chain_a = ParaId::from(1); + let chain_b = ParaId::from(2); + + let chain_ids = vec![chain_a, chain_b]; + + let validators = vec![ + Sr25519Keyring::Ferdie, // <- this node, role: validator + Sr25519Keyring::Alice, + Sr25519Keyring::Bob, + Sr25519Keyring::Charlie, + Sr25519Keyring::Dave, + ]; + + let keystore: SyncCryptoStorePtr = Arc::new(LocalKeystore::in_memory()); + + SyncCryptoStore::sr25519_generate_new( + &*keystore, + ValidatorId::ID, + Some(&validators[0].to_seed()), + ) + .expect("Insert key into keystore"); + + let validator_public = validator_pubkeys(&validators); + + let validator_groups = vec![vec![2, 0, 4], vec![1], vec![3]]; + let group_rotation_info = GroupRotationInfo { + session_start_block: 0, + group_rotation_frequency: 100, + now: 1, + }; + let validator_groups = (validator_groups, group_rotation_info); + + let availability_cores = vec![ + CoreState::Scheduled(ScheduledCore { + para_id: chain_ids[0], + collator: None, + }), + CoreState::Scheduled(ScheduledCore { + para_id: chain_ids[1], + collator: None, + }), + ]; + + let mut head_data = HashMap::new(); + head_data.insert(chain_a, HeadData(vec![4, 5, 6])); + head_data.insert(chain_b, HeadData(vec![7, 8, 9])); + + let ancestors = vec![ + Hash::repeat_byte(0x44), + Hash::repeat_byte(0x33), + Hash::repeat_byte(0x22), + ]; + let relay_parent = Hash::repeat_byte(0x05); + + let persisted_validation_data = PersistedValidationData { + parent_head: HeadData(vec![7, 8, 9]), + block_number: Default::default(), + hrmp_mqc_heads: Vec::new(), + }; + + let validator_index = Some((validators.len() - 1) as ValidatorIndex); + + Self { + chain_ids, + keystore, + validators, + validator_public, + validator_groups, + availability_cores, + head_data, + persisted_validation_data, + relay_parent, + ancestors, + validator_index, + } + } } fn make_available_data(test: &TestState, pov: PoV) -> AvailableData { - AvailableData { - validation_data: test.persisted_validation_data.clone(), - pov, - } + AvailableData { + validation_data: test.persisted_validation_data.clone(), + pov, + } } fn make_erasure_root(test: &TestState, pov: PoV) -> Hash { - let available_data = make_available_data(test, pov); + let available_data = make_available_data(test, pov); - let chunks = obtain_chunks(test.validators.len(), &available_data).unwrap(); - branches(&chunks).root() + let chunks = obtain_chunks(test.validators.len(), &available_data).unwrap(); + branches(&chunks).root() } fn make_valid_availability_gossip( - test: &TestState, - candidate_hash: Hash, - erasure_chunk_index: u32, - pov: PoV, + test: &TestState, + candidate_hash: Hash, + erasure_chunk_index: u32, + pov: PoV, ) -> AvailabilityGossipMessage { - let available_data = make_available_data(test, pov); + let available_data = make_available_data(test, pov); - let erasure_chunks = derive_erasure_chunks_with_proofs(test.validators.len(), &available_data); + let erasure_chunks = derive_erasure_chunks_with_proofs(test.validators.len(), &available_data); - let erasure_chunk: ErasureChunk = erasure_chunks - .get(erasure_chunk_index as usize) - .expect("Must be valid or input is oob") - .clone(); + let erasure_chunk: ErasureChunk = erasure_chunks + .get(erasure_chunk_index as usize) + .expect("Must be valid or input is oob") + .clone(); - AvailabilityGossipMessage { - candidate_hash, - erasure_chunk, - } + AvailabilityGossipMessage { + candidate_hash, + erasure_chunk, + } } #[derive(Default)] struct TestCandidateBuilder { - para_id: ParaId, - head_data: HeadData, - pov_hash: Hash, - relay_parent: Hash, - erasure_root: Hash, + para_id: ParaId, + head_data: HeadData, + pov_hash: Hash, + relay_parent: Hash, + erasure_root: Hash, } impl TestCandidateBuilder { - fn build(self) -> CommittedCandidateReceipt { - CommittedCandidateReceipt { - descriptor: CandidateDescriptor { - para_id: self.para_id, - pov_hash: self.pov_hash, - relay_parent: self.relay_parent, - ..Default::default() - }, - commitments: CandidateCommitments { - head_data: self.head_data, - erasure_root: self.erasure_root, - ..Default::default() - }, - } - } + fn build(self) -> CommittedCandidateReceipt { + CommittedCandidateReceipt { + descriptor: CandidateDescriptor { + para_id: self.para_id, + pov_hash: self.pov_hash, + relay_parent: self.relay_parent, + ..Default::default() + }, + commitments: CandidateCommitments { + head_data: self.head_data, + erasure_root: self.erasure_root, + ..Default::default() + }, + } + } } #[test] fn helper_integrity() { - let test_state = TestState::default(); - - let pov_block = PoV { - block_data: BlockData(vec![42, 43, 44]), - }; - - let pov_hash = pov_block.hash(); - - let candidate = TestCandidateBuilder { - para_id: test_state.chain_ids[0], - relay_parent: test_state.relay_parent, - pov_hash: pov_hash, - erasure_root: make_erasure_root(&test_state, pov_block.clone()), - ..Default::default() - } - .build(); - - let message = - make_valid_availability_gossip(&test_state, dbg!(candidate.hash()), 2, pov_block.clone()); - - let root = dbg!(&candidate.commitments.erasure_root); - - let anticipated_hash = branch_hash( - root, - &message.erasure_chunk.proof, - dbg!(message.erasure_chunk.index as usize), - ) - .expect("Must be able to derive branch hash"); - assert_eq!( - anticipated_hash, - BlakeTwo256::hash(&message.erasure_chunk.chunk) - ); + let test_state = TestState::default(); + + let pov_block = PoV { + block_data: BlockData(vec![42, 43, 44]), + }; + + let pov_hash = pov_block.hash(); + + let candidate = TestCandidateBuilder { + para_id: test_state.chain_ids[0], + relay_parent: test_state.relay_parent, + pov_hash: pov_hash, + erasure_root: make_erasure_root(&test_state, pov_block.clone()), + ..Default::default() + } + .build(); + + let message = + make_valid_availability_gossip(&test_state, dbg!(candidate.hash()), 2, pov_block.clone()); + + let root = dbg!(&candidate.commitments.erasure_root); + + let anticipated_hash = branch_hash( + root, + &message.erasure_chunk.proof, + dbg!(message.erasure_chunk.index as usize), + ) + .expect("Must be able to derive branch hash"); + assert_eq!( + anticipated_hash, + BlakeTwo256::hash(&message.erasure_chunk.chunk) + ); } fn derive_erasure_chunks_with_proofs( - n_validators: usize, - available_data: &AvailableData, + n_validators: usize, + available_data: &AvailableData, ) -> Vec { - let chunks: Vec> = obtain_chunks(n_validators, available_data).unwrap(); + let chunks: Vec> = obtain_chunks(n_validators, available_data).unwrap(); - // create proofs for each erasure chunk - let branches = branches(chunks.as_ref()); + // create proofs for each erasure chunk + let branches = branches(chunks.as_ref()); - let erasure_chunks = branches - .enumerate() - .map(|(index, (proof, chunk))| ErasureChunk { - chunk: chunk.to_vec(), - index: index as _, - proof, - }) - .collect::>(); + let erasure_chunks = branches + .enumerate() + .map(|(index, (proof, chunk))| ErasureChunk { + chunk: chunk.to_vec(), + index: index as _, + proof, + }) + .collect::>(); - erasure_chunks + erasure_chunks } #[test] fn reputation_verification() { - let test_state = TestState::default(); - - test_harness(test_state.keystore.clone(), |test_harness| async move { - let TestHarness { - mut virtual_overseer, - } = test_harness; - - let expected_head_data = test_state.head_data.get(&test_state.chain_ids[0]).unwrap(); - - let pov_block_a = PoV { - block_data: BlockData(vec![42, 43, 44]), - }; - - let pov_block_b = PoV { - block_data: BlockData(vec![45, 46, 47]), - }; - - let pov_block_c = PoV { - block_data: BlockData(vec![48, 49, 50]), - }; - - let pov_hash_a = pov_block_a.hash(); - let pov_hash_b = pov_block_b.hash(); - let pov_hash_c = pov_block_c.hash(); - - let candidates = vec![ - TestCandidateBuilder { - para_id: test_state.chain_ids[0], - relay_parent: test_state.relay_parent, - pov_hash: pov_hash_a, - erasure_root: make_erasure_root(&test_state, pov_block_a.clone()), - ..Default::default() - } - .build(), - TestCandidateBuilder { - para_id: test_state.chain_ids[0], - relay_parent: test_state.relay_parent, - pov_hash: pov_hash_b, - erasure_root: make_erasure_root(&test_state, pov_block_b.clone()), - head_data: expected_head_data.clone(), - ..Default::default() - } - .build(), - TestCandidateBuilder { - para_id: test_state.chain_ids[1], - relay_parent: Hash::repeat_byte(0xFA), - pov_hash: pov_hash_c, - erasure_root: make_erasure_root(&test_state, pov_block_c.clone()), - head_data: test_state - .head_data - .get(&test_state.chain_ids[1]) - .unwrap() - .clone(), - ..Default::default() - } - .build(), - ]; - - let TestState { - chain_ids, - keystore: _, - validators: _, - validator_public, - validator_groups, - availability_cores, - head_data: _, - persisted_validation_data: _, - relay_parent: current, - ancestors, - validator_index: _, - } = test_state.clone(); - - let _ = validator_groups; - let _ = availability_cores; - - let peer_a = PeerId::random(); - let peer_b = PeerId::random(); - assert_ne!(&peer_a, &peer_b); - - log::trace!("peer A: {:?}", peer_a); - log::trace!("peer B: {:?}", peer_b); - - log::trace!("candidate A: {:?}", candidates[0].hash()); - log::trace!("candidate B: {:?}", candidates[1].hash()); - - overseer_signal( - &mut virtual_overseer, - OverseerSignal::ActiveLeaves(ActiveLeavesUpdate { - activated: smallvec![current.clone()], - deactivated: smallvec![], - }), - ) - .await; - - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::OurViewChange(view![current,]), - ), - ) - .await; - - // obtain the validators per relay parent - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::Validators(tx), - )) => { - assert_eq!(relay_parent, current); - tx.send(Ok(validator_public.clone())).unwrap(); - } - ); - - let genesis = Hash::repeat_byte(0xAA); - // query of k ancestors, we only provide one - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::ChainApi(ChainApiMessage::Ancestors { - hash: relay_parent, - k, - response_channel: tx, - }) => { - assert_eq!(relay_parent, current); - assert_eq!(k, AvailabilityDistributionSubsystem::K + 1); - // 0xAA..AA will not be included, since there is no mean to determine - // its session index - tx.send(Ok(vec![ancestors[0].clone(), genesis])).unwrap(); - } - ); - - // state query for each of them - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::SessionIndexForChild(tx) - )) => { - assert_eq!(relay_parent, current); - tx.send(Ok(1 as SessionIndex)).unwrap(); - } - ); - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::SessionIndexForChild(tx) - )) => { - assert_eq!(relay_parent, genesis); - tx.send(Ok(1 as SessionIndex)).unwrap(); - } - ); - - // subsystem peer id collection - // which will query the availability cores - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::AvailabilityCores(tx) - )) => { - assert_eq!(relay_parent, ancestors[0]); - // respond with a set of availability core states - tx.send(Ok(vec![ - dummy_occupied_core(chain_ids[0]), - dummy_occupied_core(chain_ids[1]) - ])).unwrap(); - } - ); - - // now each of the relay parents in the view (1) will - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::CandidatePendingAvailability(para, tx) - )) => { - assert_eq!(relay_parent, ancestors[0]); - assert_eq!(para, chain_ids[0]); - tx.send(Ok(Some( - candidates[0].clone() - ))).unwrap(); - } - ); - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::CandidatePendingAvailability(para, tx) - )) => { - assert_eq!(relay_parent, ancestors[0]); - assert_eq!(para, chain_ids[1]); - tx.send(Ok(Some( - candidates[1].clone() - ))).unwrap(); - } - ); - - for _ in 0usize..1 { - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - _relay_parent, - RuntimeApiRequest::AvailabilityCores(tx), - )) => { - tx.send(Ok(vec![ - CoreState::Occupied(OccupiedCore { - para_id: chain_ids[0].clone(), - next_up_on_available: None, - occupied_since: 0, - time_out_at: 10, - next_up_on_time_out: None, - availability: Default::default(), - group_responsible: GroupIndex::from(0), - }), - CoreState::Free, - CoreState::Free, - CoreState::Occupied(OccupiedCore { - para_id: chain_ids[1].clone(), - next_up_on_available: None, - occupied_since: 1, - time_out_at: 7, - next_up_on_time_out: None, - availability: Default::default(), - group_responsible: GroupIndex::from(0), - }), - CoreState::Free, - CoreState::Free, - ])).unwrap(); - } - ); - - // query the availability cores for each of the paras (2) - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi( - RuntimeApiMessage::Request( - _relay_parent, - RuntimeApiRequest::CandidatePendingAvailability(para, tx), - ) - ) => { - assert_eq!(para, chain_ids[0]); - tx.send(Ok(Some( - candidates[0].clone() - ))).unwrap(); - } - ); - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - _relay_parent, - RuntimeApiRequest::CandidatePendingAvailability(para, tx), - )) => { - assert_eq!(para, chain_ids[1]); - tx.send(Ok(Some( - candidates[1].clone() - ))).unwrap(); - } - ); - } - - let mut candidates2 = candidates.clone(); - // check if the availability store can provide the desired erasure chunks - for i in 0usize..2 { - log::trace!("0000"); - let avail_data = make_available_data(&test_state, pov_block_a.clone()); - let chunks = - derive_erasure_chunks_with_proofs(test_state.validators.len(), &avail_data); - - let expected; - // store the chunk to the av store - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::AvailabilityStore( - AvailabilityStoreMessage::QueryDataAvailability( - candidate_hash, - tx, - ) - ) => { - let index = candidates2.iter().enumerate().find(|x| { x.1.hash() == candidate_hash }).map(|x| x.0).unwrap(); - expected = dbg!(candidates2.swap_remove(index).hash()); - tx.send( - i == 0 - ).unwrap(); - } - ); - - assert_eq!(chunks.len(), test_state.validators.len()); - - log::trace!("xxxx"); - // retrieve a stored chunk - for (j, chunk) in chunks.into_iter().enumerate() { - log::trace!("yyyy i={}, j={}", i, j); - if i != 0 { - // not a validator, so this never happens - break; - } - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::AvailabilityStore( - AvailabilityStoreMessage::QueryChunk( - candidate_hash, - idx, - tx, - ) - ) => { - assert_eq!(candidate_hash, expected); - assert_eq!(j as u32, chunk.index); - assert_eq!(idx, j as u32); - tx.send( - Some(chunk.clone()) - ).unwrap(); - } - ); - } - } - // setup peer a with interest in current - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerConnected(peer_a.clone(), ObservedRole::Full), - ), - ) - .await; - - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerViewChange(peer_a.clone(), view![current]), - ), - ) - .await; - - // setup peer b with interest in ancestor - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerConnected(peer_b.clone(), ObservedRole::Full), - ), - ) - .await; - - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerViewChange(peer_b.clone(), view![ancestors[0]]), - ), - ) - .await; - - delay!(100); - - let valid: AvailabilityGossipMessage = make_valid_availability_gossip( - &test_state, - candidates[0].hash(), - 2, - pov_block_a.clone(), - ); - - { - // valid (first, from b) - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerMessage( - peer_b.clone(), - chunk_protocol_message(valid.clone()), - ), - ), - ) - .await; - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer( - peer, - rep - ) - ) => { - assert_eq!(peer, peer_b); - assert_eq!(rep, BENEFIT_VALID_MESSAGE_FIRST); - } - ); - } - - { - // valid (duplicate, from b) - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerMessage( - peer_b.clone(), - chunk_protocol_message(valid.clone()), - ), - ), - ) - .await; - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer( - peer, - rep - ) - ) => { - assert_eq!(peer, peer_b); - assert_eq!(rep, COST_PEER_DUPLICATE_MESSAGE); - } - ); - } - - { - // valid (second, from a) - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - chunk_protocol_message(valid.clone()), - ), - ), - ) - .await; - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer( - peer, - rep - ) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, BENEFIT_VALID_MESSAGE); - } - ); - } - - // peer a is not interested in anything anymore - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerViewChange(peer_a.clone(), view![]), - ), - ) - .await; - - { - // send the a message again, so we should detect the duplicate - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - chunk_protocol_message(valid.clone()), - ), - ), - ) - .await; - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer( - peer, - rep - ) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, COST_PEER_DUPLICATE_MESSAGE); - } - ); - } - - // peer b sends a message before we have the view - // setup peer a with interest in parent x - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerDisconnected(peer_b.clone()), - ), - ) - .await; - - delay!(10); - - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerConnected(peer_b.clone(), ObservedRole::Full), - ), - ) - .await; - - { - // send another message - let valid2: AvailabilityGossipMessage = make_valid_availability_gossip( - &test_state, - candidates[2].hash(), - 1, - pov_block_c.clone(), - ); - - // send the a message before we send a view update - overseer_send( - &mut virtual_overseer, - AvailabilityDistributionMessage::NetworkBridgeUpdateV1( - NetworkBridgeEvent::PeerMessage(peer_a.clone(), chunk_protocol_message(valid2)), - ), - ) - .await; - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer( - peer, - rep - ) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, COST_NOT_A_LIVE_CANDIDATE); - } - ); - } - }); + let test_state = TestState::default(); + + test_harness(test_state.keystore.clone(), |test_harness| async move { + let TestHarness { + mut virtual_overseer, + } = test_harness; + + let expected_head_data = test_state.head_data.get(&test_state.chain_ids[0]).unwrap(); + + let pov_block_a = PoV { + block_data: BlockData(vec![42, 43, 44]), + }; + + let pov_block_b = PoV { + block_data: BlockData(vec![45, 46, 47]), + }; + + let pov_block_c = PoV { + block_data: BlockData(vec![48, 49, 50]), + }; + + let pov_hash_a = pov_block_a.hash(); + let pov_hash_b = pov_block_b.hash(); + let pov_hash_c = pov_block_c.hash(); + + let candidates = vec![ + TestCandidateBuilder { + para_id: test_state.chain_ids[0], + relay_parent: test_state.relay_parent, + pov_hash: pov_hash_a, + erasure_root: make_erasure_root(&test_state, pov_block_a.clone()), + ..Default::default() + } + .build(), + TestCandidateBuilder { + para_id: test_state.chain_ids[0], + relay_parent: test_state.relay_parent, + pov_hash: pov_hash_b, + erasure_root: make_erasure_root(&test_state, pov_block_b.clone()), + head_data: expected_head_data.clone(), + ..Default::default() + } + .build(), + TestCandidateBuilder { + para_id: test_state.chain_ids[1], + relay_parent: Hash::repeat_byte(0xFA), + pov_hash: pov_hash_c, + erasure_root: make_erasure_root(&test_state, pov_block_c.clone()), + head_data: test_state + .head_data + .get(&test_state.chain_ids[1]) + .unwrap() + .clone(), + ..Default::default() + } + .build(), + ]; + + let TestState { + chain_ids, + keystore: _, + validators: _, + validator_public, + validator_groups, + availability_cores, + head_data: _, + persisted_validation_data: _, + relay_parent: current, + ancestors, + validator_index: _, + } = test_state.clone(); + + let _ = validator_groups; + let _ = availability_cores; + + let peer_a = PeerId::random(); + let peer_b = PeerId::random(); + assert_ne!(&peer_a, &peer_b); + + log::trace!("peer A: {:?}", peer_a); + log::trace!("peer B: {:?}", peer_b); + + log::trace!("candidate A: {:?}", candidates[0].hash()); + log::trace!("candidate B: {:?}", candidates[1].hash()); + + overseer_signal( + &mut virtual_overseer, + OverseerSignal::ActiveLeaves(ActiveLeavesUpdate { + activated: smallvec![current.clone()], + deactivated: smallvec![], + }), + ) + .await; + + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::OurViewChange(view![current,]), + ), + ) + .await; + + // obtain the validators per relay parent + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::Validators(tx), + )) => { + assert_eq!(relay_parent, current); + tx.send(Ok(validator_public.clone())).unwrap(); + } + ); + + let genesis = Hash::repeat_byte(0xAA); + // query of k ancestors, we only provide one + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::ChainApi(ChainApiMessage::Ancestors { + hash: relay_parent, + k, + response_channel: tx, + }) => { + assert_eq!(relay_parent, current); + assert_eq!(k, AvailabilityDistributionSubsystem::K + 1); + // 0xAA..AA will not be included, since there is no mean to determine + // its session index + tx.send(Ok(vec![ancestors[0].clone(), genesis])).unwrap(); + } + ); + + // state query for each of them + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::SessionIndexForChild(tx) + )) => { + assert_eq!(relay_parent, current); + tx.send(Ok(1 as SessionIndex)).unwrap(); + } + ); + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::SessionIndexForChild(tx) + )) => { + assert_eq!(relay_parent, genesis); + tx.send(Ok(1 as SessionIndex)).unwrap(); + } + ); + + // subsystem peer id collection + // which will query the availability cores + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::AvailabilityCores(tx) + )) => { + assert_eq!(relay_parent, ancestors[0]); + // respond with a set of availability core states + tx.send(Ok(vec![ + dummy_occupied_core(chain_ids[0]), + dummy_occupied_core(chain_ids[1]) + ])).unwrap(); + } + ); + + // now each of the relay parents in the view (1) will + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::CandidatePendingAvailability(para, tx) + )) => { + assert_eq!(relay_parent, ancestors[0]); + assert_eq!(para, chain_ids[0]); + tx.send(Ok(Some( + candidates[0].clone() + ))).unwrap(); + } + ); + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::CandidatePendingAvailability(para, tx) + )) => { + assert_eq!(relay_parent, ancestors[0]); + assert_eq!(para, chain_ids[1]); + tx.send(Ok(Some( + candidates[1].clone() + ))).unwrap(); + } + ); + + for _ in 0usize..1 { + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + _relay_parent, + RuntimeApiRequest::AvailabilityCores(tx), + )) => { + tx.send(Ok(vec![ + CoreState::Occupied(OccupiedCore { + para_id: chain_ids[0].clone(), + next_up_on_available: None, + occupied_since: 0, + time_out_at: 10, + next_up_on_time_out: None, + availability: Default::default(), + group_responsible: GroupIndex::from(0), + }), + CoreState::Free, + CoreState::Free, + CoreState::Occupied(OccupiedCore { + para_id: chain_ids[1].clone(), + next_up_on_available: None, + occupied_since: 1, + time_out_at: 7, + next_up_on_time_out: None, + availability: Default::default(), + group_responsible: GroupIndex::from(0), + }), + CoreState::Free, + CoreState::Free, + ])).unwrap(); + } + ); + + // query the availability cores for each of the paras (2) + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request( + _relay_parent, + RuntimeApiRequest::CandidatePendingAvailability(para, tx), + ) + ) => { + assert_eq!(para, chain_ids[0]); + tx.send(Ok(Some( + candidates[0].clone() + ))).unwrap(); + } + ); + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + _relay_parent, + RuntimeApiRequest::CandidatePendingAvailability(para, tx), + )) => { + assert_eq!(para, chain_ids[1]); + tx.send(Ok(Some( + candidates[1].clone() + ))).unwrap(); + } + ); + } + + let mut candidates2 = candidates.clone(); + // check if the availability store can provide the desired erasure chunks + for i in 0usize..2 { + log::trace!("0000"); + let avail_data = make_available_data(&test_state, pov_block_a.clone()); + let chunks = + derive_erasure_chunks_with_proofs(test_state.validators.len(), &avail_data); + + let expected; + // store the chunk to the av store + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::AvailabilityStore( + AvailabilityStoreMessage::QueryDataAvailability( + candidate_hash, + tx, + ) + ) => { + let index = candidates2.iter().enumerate().find(|x| { x.1.hash() == candidate_hash }).map(|x| x.0).unwrap(); + expected = dbg!(candidates2.swap_remove(index).hash()); + tx.send( + i == 0 + ).unwrap(); + } + ); + + assert_eq!(chunks.len(), test_state.validators.len()); + + log::trace!("xxxx"); + // retrieve a stored chunk + for (j, chunk) in chunks.into_iter().enumerate() { + log::trace!("yyyy i={}, j={}", i, j); + if i != 0 { + // not a validator, so this never happens + break; + } + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::AvailabilityStore( + AvailabilityStoreMessage::QueryChunk( + candidate_hash, + idx, + tx, + ) + ) => { + assert_eq!(candidate_hash, expected); + assert_eq!(j as u32, chunk.index); + assert_eq!(idx, j as u32); + tx.send( + Some(chunk.clone()) + ).unwrap(); + } + ); + } + } + // setup peer a with interest in current + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerConnected(peer_a.clone(), ObservedRole::Full), + ), + ) + .await; + + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerViewChange(peer_a.clone(), view![current]), + ), + ) + .await; + + // setup peer b with interest in ancestor + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerConnected(peer_b.clone(), ObservedRole::Full), + ), + ) + .await; + + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerViewChange(peer_b.clone(), view![ancestors[0]]), + ), + ) + .await; + + delay!(100); + + let valid: AvailabilityGossipMessage = make_valid_availability_gossip( + &test_state, + candidates[0].hash(), + 2, + pov_block_a.clone(), + ); + + { + // valid (first, from b) + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerMessage( + peer_b.clone(), + chunk_protocol_message(valid.clone()), + ), + ), + ) + .await; + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer( + peer, + rep + ) + ) => { + assert_eq!(peer, peer_b); + assert_eq!(rep, BENEFIT_VALID_MESSAGE_FIRST); + } + ); + } + + { + // valid (duplicate, from b) + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerMessage( + peer_b.clone(), + chunk_protocol_message(valid.clone()), + ), + ), + ) + .await; + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer( + peer, + rep + ) + ) => { + assert_eq!(peer, peer_b); + assert_eq!(rep, COST_PEER_DUPLICATE_MESSAGE); + } + ); + } + + { + // valid (second, from a) + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + chunk_protocol_message(valid.clone()), + ), + ), + ) + .await; + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer( + peer, + rep + ) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, BENEFIT_VALID_MESSAGE); + } + ); + } + + // peer a is not interested in anything anymore + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerViewChange(peer_a.clone(), view![]), + ), + ) + .await; + + { + // send the a message again, so we should detect the duplicate + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + chunk_protocol_message(valid.clone()), + ), + ), + ) + .await; + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer( + peer, + rep + ) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, COST_PEER_DUPLICATE_MESSAGE); + } + ); + } + + // peer b sends a message before we have the view + // setup peer a with interest in parent x + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerDisconnected(peer_b.clone()), + ), + ) + .await; + + delay!(10); + + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerConnected(peer_b.clone(), ObservedRole::Full), + ), + ) + .await; + + { + // send another message + let valid2: AvailabilityGossipMessage = make_valid_availability_gossip( + &test_state, + candidates[2].hash(), + 1, + pov_block_c.clone(), + ); + + // send the a message before we send a view update + overseer_send( + &mut virtual_overseer, + AvailabilityDistributionMessage::NetworkBridgeUpdateV1( + NetworkBridgeEvent::PeerMessage(peer_a.clone(), chunk_protocol_message(valid2)), + ), + ) + .await; + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer( + peer, + rep + ) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, COST_NOT_A_LIVE_CANDIDATE); + } + ); + } + }); } #[test] fn k_ancestors_in_session() { - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut virtual_overseer) = - test_helpers::make_subsystem_context::(pool); - - const DATA: &[(Hash, SessionIndex)] = &[ - (Hash::repeat_byte(0x32), 3), // relay parent - (Hash::repeat_byte(0x31), 3), // grand parent - (Hash::repeat_byte(0x30), 3), // great ... - (Hash::repeat_byte(0x20), 2), - (Hash::repeat_byte(0x12), 1), - (Hash::repeat_byte(0x11), 1), - (Hash::repeat_byte(0x10), 1), - ]; - const K: usize = 5; - - const EXPECTED: &[Hash] = &[DATA[1].0, DATA[2].0]; - - let test_fut = async move { - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::ChainApi(ChainApiMessage::Ancestors { - hash: relay_parent, - k, - response_channel: tx, - }) => { - assert_eq!(k, K+1); - assert_eq!(relay_parent, DATA[0].0); - tx.send(Ok(DATA[1..=k].into_iter().map(|x| x.0).collect::>())).unwrap(); - } - ); - - // query the desired session index of the relay parent - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::SessionIndexForChild(tx), - )) => { - assert_eq!(relay_parent, DATA[0].0); - let session: SessionIndex = DATA[0].1; - tx.send(Ok(session)).unwrap(); - } - ); - - // query ancestors - for i in 2usize..=(EXPECTED.len() + 1 + 1) { - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - relay_parent, - RuntimeApiRequest::SessionIndexForChild(tx), - )) => { - // query is for ancestor_parent - let x = &DATA[i]; - assert_eq!(relay_parent, x.0); - // but needs to yield ancestor_parent's child's session index - let x = &DATA[i-1]; - tx.send(Ok(x.1)).unwrap(); - } - ); - } - }; - - let sut = async move { - let ancestors = query_up_to_k_ancestors_in_same_session(&mut ctx, DATA[0].0, K) - .await - .unwrap(); - assert_eq!(ancestors, EXPECTED.to_vec()); - }; - - futures::pin_mut!(test_fut); - futures::pin_mut!(sut); - - executor::block_on(future::join(test_fut, sut).timeout(Duration::from_millis(1000))); + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut virtual_overseer) = + test_helpers::make_subsystem_context::(pool); + + const DATA: &[(Hash, SessionIndex)] = &[ + (Hash::repeat_byte(0x32), 3), // relay parent + (Hash::repeat_byte(0x31), 3), // grand parent + (Hash::repeat_byte(0x30), 3), // great ... + (Hash::repeat_byte(0x20), 2), + (Hash::repeat_byte(0x12), 1), + (Hash::repeat_byte(0x11), 1), + (Hash::repeat_byte(0x10), 1), + ]; + const K: usize = 5; + + const EXPECTED: &[Hash] = &[DATA[1].0, DATA[2].0]; + + let test_fut = async move { + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::ChainApi(ChainApiMessage::Ancestors { + hash: relay_parent, + k, + response_channel: tx, + }) => { + assert_eq!(k, K+1); + assert_eq!(relay_parent, DATA[0].0); + tx.send(Ok(DATA[1..=k].into_iter().map(|x| x.0).collect::>())).unwrap(); + } + ); + + // query the desired session index of the relay parent + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::SessionIndexForChild(tx), + )) => { + assert_eq!(relay_parent, DATA[0].0); + let session: SessionIndex = DATA[0].1; + tx.send(Ok(session)).unwrap(); + } + ); + + // query ancestors + for i in 2usize..=(EXPECTED.len() + 1 + 1) { + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + relay_parent, + RuntimeApiRequest::SessionIndexForChild(tx), + )) => { + // query is for ancestor_parent + let x = &DATA[i]; + assert_eq!(relay_parent, x.0); + // but needs to yield ancestor_parent's child's session index + let x = &DATA[i-1]; + tx.send(Ok(x.1)).unwrap(); + } + ); + } + }; + + let sut = async move { + let ancestors = query_up_to_k_ancestors_in_same_session(&mut ctx, DATA[0].0, K) + .await + .unwrap(); + assert_eq!(ancestors, EXPECTED.to_vec()); + }; + + futures::pin_mut!(test_fut); + futures::pin_mut!(sut); + + executor::block_on(future::join(test_fut, sut).timeout(Duration::from_millis(1000))); } From e65b342e6d13bbba2a5ba9b7d18c6be2fbabf388 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 10:08:15 +0100 Subject: [PATCH 25/62] erasure coding error message fix --- erasure-coding/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erasure-coding/src/lib.rs b/erasure-coding/src/lib.rs index 4d7da4ac87ea..559a84257d0f 100644 --- a/erasure-coding/src/lib.rs +++ b/erasure-coding/src/lib.rs @@ -57,8 +57,8 @@ pub enum Error { /// An uneven byte-length of a shard is not valid for GF(2^16) encoding. UnevenLength, /// Chunk index out of bounds. - #[error("Chunk is out of bounds: {0}..={1}")] - ChunkIndexOutOfBounds(usize, usize), + #[error("Chunk is out of bounds: {chunk_index} not included in 0..{n_validators}")] + ChunkIndexOutOfBounds{ chunk_index: usize, n_validators: usize}, /// Bad payload in reconstructed bytes. BadPayload, /// Invalid branch proof. @@ -205,7 +205,7 @@ fn reconstruct<'a, I: 'a, T: Decode>(n_validators: usize, chunks: I) -> Result= n_validators { - return Err(Error::ChunkIndexOutOfBounds(chunk_idx, n_validators)); + return Err(Error::ChunkIndexOutOfBounds{chunk_index: chunk_idx, n_validators}); } let shard_len = shard_len.get_or_insert_with(|| chunk_data.len()); From 931558e394ac99963c0657126d738f8d82864e62 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 10:11:53 +0100 Subject: [PATCH 26/62] merge fallout --- node/core/av-store/src/lib.rs | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/node/core/av-store/src/lib.rs b/node/core/av-store/src/lib.rs index 421822deeda1..a54977860d87 100644 --- a/node/core/av-store/src/lib.rs +++ b/node/core/av-store/src/lib.rs @@ -44,11 +44,8 @@ use polkadot_node_subsystem_util::metrics::{self, prometheus}; use polkadot_subsystem::messages::{ AllMessages, AvailabilityStoreMessage, ChainApiMessage, RuntimeApiMessage, RuntimeApiRequest, }; -<<<<<<< HEAD use polkadot_subsystem::messages::AvailabilityStoreMessage; use thiserror::Error; -======= ->>>>>>> origin/master const LOG_TARGET: &str = "availability"; @@ -60,7 +57,6 @@ mod columns { #[derive(Debug, Error)] enum Error { -<<<<<<< HEAD #[error(transparent)] Erasure(#[from]erasure::Error), #[error(transparent)] @@ -69,21 +65,8 @@ enum Error { Oneshot(#[from]oneshot::Canceled), #[error(transparent)] Subsystem(#[from]SubsystemError), -======= - #[from] - Chain(ChainApiError), - #[from] - Erasure(erasure::Error), - #[from] - Io(io::Error), - #[from] - Oneshot(oneshot::Canceled), - #[from] - Runtime(RuntimeApiError), - #[from] - Subsystem(SubsystemError), - #[from] - Time(SystemTimeError), + #[error(transparent)] + Time(#[from]SystemTimeError), } /// A wrapper type for delays. @@ -302,7 +285,6 @@ impl PartialOrd for ChunkPruningRecord { fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } ->>>>>>> origin/master } /// An implementation of the Availability Store subsystem. From 6516ccaf370fa05d8bcd7072de4488fd3b499523 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 10:29:36 +0100 Subject: [PATCH 27/62] add missing #[error] annotations --- erasure-coding/src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/erasure-coding/src/lib.rs b/erasure-coding/src/lib.rs index 559a84257d0f..d03d72b66f1f 100644 --- a/erasure-coding/src/lib.rs +++ b/erasure-coding/src/lib.rs @@ -43,27 +43,37 @@ const MAX_VALIDATORS: usize = ::ORDER; #[derive(Debug, Clone, PartialEq, Error)] pub enum Error { /// Returned when there are too many validators. + #[error("There are too many validators")] TooManyValidators, /// Cannot encode something for no validators + #[error("Validator set is empty")] EmptyValidators, /// Cannot reconstruct: wrong number of validators. + #[error("Validator count mismatches between encoding and decoding")] WrongValidatorCount, /// Not enough chunks present. + #[error("Not enough chunks to reconstruct message")] NotEnoughChunks, /// Too many chunks present. + #[error("Too many chunks present")] TooManyChunks, /// Chunks not of uniform length or the chunks are empty. + #[error("Chunks are not unform, mismatch in length or are zero sized")] NonUniformChunks, /// An uneven byte-length of a shard is not valid for GF(2^16) encoding. + #[error("Uneven length is not valid for field GF(2^16)")] UnevenLength, /// Chunk index out of bounds. #[error("Chunk is out of bounds: {chunk_index} not included in 0..{n_validators}")] ChunkIndexOutOfBounds{ chunk_index: usize, n_validators: usize}, /// Bad payload in reconstructed bytes. + #[error("Reconstructed payload invalid")] BadPayload, /// Invalid branch proof. + #[error("Invalid branch proof")] InvalidBranchProof, /// Branch out of bounds. + #[error("Branch is out of bounds")] BranchOutOfBounds, } From 73f6ee3a259813363458fbb56e93461af8e063af Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 10:31:24 +0100 Subject: [PATCH 28/62] chore extra spaces between #[from] and wrapped error --- node/core/av-store/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/node/core/av-store/src/lib.rs b/node/core/av-store/src/lib.rs index a54977860d87..8210fd50dd32 100644 --- a/node/core/av-store/src/lib.rs +++ b/node/core/av-store/src/lib.rs @@ -58,15 +58,15 @@ mod columns { #[derive(Debug, Error)] enum Error { #[error(transparent)] - Erasure(#[from]erasure::Error), + Erasure(#[from] erasure::Error), #[error(transparent)] - Io(#[from]io::Error), + Io(#[from] io::Error), #[error(transparent)] - Oneshot(#[from]oneshot::Canceled), + Oneshot(#[from] oneshot::Canceled), #[error(transparent)] - Subsystem(#[from]SubsystemError), + Subsystem(#[from] SubsystemError), #[error(transparent)] - Time(#[from]SystemTimeError), + Time(#[from] SystemTimeError), } /// A wrapper type for delays. From 574d93f9cf5b5c7318bdcafcce9f525815f629dd Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 10:57:29 +0100 Subject: [PATCH 29/62] chore: cleanup unused dependencies --- Cargo.lock | 23 ------------------- cli/Cargo.toml | 8 ------- cli/src/lib.rs | 4 +++- node/core/backing/src/lib.rs | 2 +- node/core/bitfield-signing/src/lib.rs | 2 +- node/core/candidate-selection/src/lib.rs | 2 +- node/core/candidate-validation/src/lib.rs | 2 +- node/core/chain-api/src/lib.rs | 2 +- node/core/proposer/Cargo.toml | 4 ---- node/core/proposer/src/lib.rs | 2 +- node/core/provisioner/src/lib.rs | 2 +- node/core/runtime-api/src/lib.rs | 2 +- .../availability-distribution/src/lib.rs | 2 +- node/network/bitfield-distribution/src/lib.rs | 2 +- node/network/bridge/src/lib.rs | 2 +- node/network/collator-protocol/src/lib.rs | 2 +- node/network/pov-distribution/src/lib.rs | 2 +- node/network/protocol/Cargo.toml | 2 -- node/network/protocol/src/lib.rs | 2 +- .../network/statement-distribution/src/lib.rs | 2 +- node/overseer/src/lib.rs | 2 +- node/service/Cargo.toml | 8 ------- node/service/src/lib.rs | 2 +- node/subsystem-test-helpers/src/lib.rs | 2 +- node/subsystem-util/Cargo.toml | 3 +-- node/subsystem-util/src/lib.rs | 4 +++- 26 files changed, 25 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1afe7ea4e3e5..aaf6353d9974 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4814,23 +4814,16 @@ name = "polkadot-cli" version = "0.8.25" dependencies = [ "frame-benchmarking-cli", - "futures 0.3.5", "log 0.4.11", "polkadot-service", "sc-cli", - "sc-client-api", - "sc-client-db", - "sc-executor", "sc-service", "sc-tracing", - "sp-api", "sp-core", - "sp-runtime", "sp-trie", "structopt", "substrate-browser-utils", "substrate-build-script-utils", - "tokio 0.2.21", "wasm-bindgen", "wasm-bindgen-futures", ] @@ -5035,16 +5028,13 @@ name = "polkadot-node-core-proposer" version = "0.1.0" dependencies = [ "futures 0.3.5", - "futures-timer 3.0.2", "log 0.4.11", - "parity-scale-codec", "polkadot-node-subsystem", "polkadot-overseer", "polkadot-primitives", "sc-basic-authorship", "sc-block-builder", "sc-client-api", - "sc-telemetry", "sp-api", "sp-blockchain", "sp-consensus", @@ -5052,7 +5042,6 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-transaction-pool", - "tokio-executor 0.2.0-alpha.6", "wasm-timer", ] @@ -5098,8 +5087,6 @@ dependencies = [ "polkadot-node-primitives", "polkadot-primitives", "sc-network", - "sp-core", - "sp-runtime", ] [[package]] @@ -5177,9 +5164,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", "polkadot-primitives", - "polkadot-statement-table", "sc-network", - "smallvec 1.4.2", "sp-application-crypto", "sp-core", "sp-keystore", @@ -5481,14 +5466,11 @@ dependencies = [ "futures 0.3.5", "hex-literal 0.2.1", "kusama-runtime", - "lazy_static", "log 0.4.11", - "pallet-babe", "pallet-im-online", "pallet-staking", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", - "parking_lot 0.9.0", "polkadot-node-core-proposer", "polkadot-node-subsystem", "polkadot-overseer", @@ -5499,21 +5481,17 @@ dependencies = [ "polkadot-test-client", "rococo-v1-runtime", "sc-authority-discovery", - "sc-block-builder", "sc-chain-spec", "sc-client-api", - "sc-client-db", "sc-consensus", "sc-consensus-babe", "sc-executor", "sc-finality-grandpa", - "sc-keystore", "sc-network", "sc-service", "sc-telemetry", "sc-transaction-pool", "serde", - "slog", "sp-api", "sp-authority-discovery", "sp-block-builder", @@ -5523,7 +5501,6 @@ dependencies = [ "sp-core", "sp-finality-grandpa", "sp-inherents", - "sp-io", "sp-offchain", "sp-runtime", "sp-session", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 1060a48ce07a..d000bb94dcc4 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -15,18 +15,11 @@ crate-type = ["cdylib", "rlib"] [dependencies] log = "0.4.8" -futures = { version = "0.3.4", features = ["compat"] } structopt = "0.3.8" -sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" } service = { package = "polkadot-service", path = "../node/service", default-features = false, optional = true } -tokio = { version = "0.2.13", features = ["rt-threaded"], optional = true } frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true } sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true } sc-service = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true } @@ -46,7 +39,6 @@ default = [ "wasmtime", "db", "cli", "full-node", "trie-memory-tracker" ] wasmtime = [ "sc-cli/wasmtime" ] db = [ "service/db" ] cli = [ - "tokio", "sc-cli", "sc-service", "frame-benchmarking-cli", diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 76c67488a116..7bf23cc4d7af 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -17,7 +17,9 @@ //! Polkadot CLI library. #![warn(missing_docs)] -#![warn(unused_extern_crates)] +#![deny(unused_crate_dependencies)] + +use sp_trie as _; #[cfg(feature = "browser")] mod browser; diff --git a/node/core/backing/src/lib.rs b/node/core/backing/src/lib.rs index 7acdf1877f44..d130e07b15f2 100644 --- a/node/core/backing/src/lib.rs +++ b/node/core/backing/src/lib.rs @@ -16,7 +16,7 @@ //! Implements a `CandidateBackingSubsystem`. -#![deny(unused_extern_crates, unused_results)] +#![deny(unused_crate_dependencies, unused_results)] use std::collections::{HashMap, HashSet}; use std::convert::TryFrom; diff --git a/node/core/bitfield-signing/src/lib.rs b/node/core/bitfield-signing/src/lib.rs index b973efdd7871..c27b95a17d3b 100644 --- a/node/core/bitfield-signing/src/lib.rs +++ b/node/core/bitfield-signing/src/lib.rs @@ -16,7 +16,7 @@ //! The bitfield signing subsystem produces `SignedAvailabilityBitfield`s once per block. -#![deny(unused_extern_crates, unused_results)] +#![deny(unused_crate_dependencies, unused_results)] #![warn(missing_docs)] use bitvec::bitvec; diff --git a/node/core/candidate-selection/src/lib.rs b/node/core/candidate-selection/src/lib.rs index a0e6b1bb5414..eb5c63565e92 100644 --- a/node/core/candidate-selection/src/lib.rs +++ b/node/core/candidate-selection/src/lib.rs @@ -17,7 +17,7 @@ //! The provisioner is responsible for assembling a relay chain block //! from a set of available parachain candidates of its choice. -#![deny(missing_docs, unused_extern_crates, unused_results)] +#![deny(missing_docs, unused_crate_dependencies, unused_results)] use futures::{ channel::{mpsc, oneshot}, diff --git a/node/core/candidate-validation/src/lib.rs b/node/core/candidate-validation/src/lib.rs index 1650c01d60e5..083c2ab3f14f 100644 --- a/node/core/candidate-validation/src/lib.rs +++ b/node/core/candidate-validation/src/lib.rs @@ -20,7 +20,7 @@ //! according to a validation function. This delegates validation to an underlying //! pool of processes used for execution of the Wasm. -#![deny(unused_extern_crates, unused_results)] +#![deny(unused_crate_dependencies, unused_results)] #![warn(missing_docs)] use polkadot_subsystem::{ diff --git a/node/core/chain-api/src/lib.rs b/node/core/chain-api/src/lib.rs index 0f7367f5efd8..ba5dec5fdfe2 100644 --- a/node/core/chain-api/src/lib.rs +++ b/node/core/chain-api/src/lib.rs @@ -27,7 +27,7 @@ //! * Last finalized block number //! * Ancestors -#![deny(unused_extern_crates, unused_results)] +#![deny(unused_crate_dependencies, unused_results)] #![warn(missing_docs)] use polkadot_subsystem::{ diff --git a/node/core/proposer/Cargo.toml b/node/core/proposer/Cargo.toml index 7cf7fc28af22..3205b50b5bb0 100644 --- a/node/core/proposer/Cargo.toml +++ b/node/core/proposer/Cargo.toml @@ -6,16 +6,13 @@ edition = "2018" [dependencies] futures = "0.3.4" -futures-timer = "3.0.1" log = "0.4.8" -parity-scale-codec = "1.3.4" polkadot-node-subsystem = { path = "../../subsystem" } polkadot-overseer = { path = "../../overseer" } polkadot-primitives = { path = "../../../primitives" } sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } @@ -23,5 +20,4 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" } -tokio-executor = { version = "0.2.0-alpha.6", features = ["blocking"] } wasm-timer = "0.2.4" diff --git a/node/core/proposer/src/lib.rs b/node/core/proposer/src/lib.rs index 3e88eba721d4..89a4060621f5 100644 --- a/node/core/proposer/src/lib.rs +++ b/node/core/proposer/src/lib.rs @@ -16,7 +16,7 @@ //! The proposer proposes new blocks to include -#![deny(unused_extern_crates, unused_results)] +#![deny(unused_crate_dependencies, unused_results)] use futures::prelude::*; use futures::select; diff --git a/node/core/provisioner/src/lib.rs b/node/core/provisioner/src/lib.rs index e83ed31925d1..8cd01883b379 100644 --- a/node/core/provisioner/src/lib.rs +++ b/node/core/provisioner/src/lib.rs @@ -17,7 +17,7 @@ //! The provisioner is responsible for assembling a relay chain block //! from a set of available parachain candidates of its choice. -#![deny(missing_docs, unused_extern_crates, unused_results)] +#![deny(missing_docs, unused_crate_dependencies, unused_results)] use bitvec::vec::BitVec; use futures::{ diff --git a/node/core/runtime-api/src/lib.rs b/node/core/runtime-api/src/lib.rs index 6fbaa6849fa0..2efcb29ff3ac 100644 --- a/node/core/runtime-api/src/lib.rs +++ b/node/core/runtime-api/src/lib.rs @@ -19,7 +19,7 @@ //! This provides a clean, ownerless wrapper around the parachain-related runtime APIs. This crate //! can also be used to cache responses from heavy runtime APIs. -#![deny(unused_extern_crates, unused_results)] +#![deny(unused_crate_dependencies, unused_results)] #![warn(missing_docs)] use polkadot_subsystem::{ diff --git a/node/network/availability-distribution/src/lib.rs b/node/network/availability-distribution/src/lib.rs index 5578ca99e8ec..8dfcff4a7dfb 100644 --- a/node/network/availability-distribution/src/lib.rs +++ b/node/network/availability-distribution/src/lib.rs @@ -22,7 +22,7 @@ //! peers. Verified in this context means, the erasure chunks contained merkle proof //! is checked. -#![deny(unused_extern_crates, unused_results, unused_qualifications)] +#![deny(unused_crate_dependencies, unused_results, unused_qualifications)] use codec::{Decode, Encode}; use futures::{channel::oneshot, FutureExt, TryFutureExt}; diff --git a/node/network/bitfield-distribution/src/lib.rs b/node/network/bitfield-distribution/src/lib.rs index 02f4c3cc7cf7..c8ca9a3a0ec8 100644 --- a/node/network/bitfield-distribution/src/lib.rs +++ b/node/network/bitfield-distribution/src/lib.rs @@ -20,7 +20,7 @@ //! for a particular relay parent. //! Independently of that, gossips on received messages from peers to other interested peers. -#![deny(unused_extern_crates, unused_results)] +#![deny(unused_crate_dependencies, unused_results)] use codec::{Decode, Encode}; use futures::{channel::oneshot, FutureExt}; diff --git a/node/network/bridge/src/lib.rs b/node/network/bridge/src/lib.rs index 96fc2b589570..7291d453ea98 100644 --- a/node/network/bridge/src/lib.rs +++ b/node/network/bridge/src/lib.rs @@ -16,7 +16,7 @@ //! The Network Bridge Subsystem - protocol multiplexer for Polkadot. -#![deny(unused_extern_crates, unused_results)] +#![deny(unused_crate_dependencies, unused_results)] #![warn(missing_docs)] use parity_scale_codec::{Encode, Decode}; diff --git a/node/network/collator-protocol/src/lib.rs b/node/network/collator-protocol/src/lib.rs index 0ba79d7017bb..2269cfad38d3 100644 --- a/node/network/collator-protocol/src/lib.rs +++ b/node/network/collator-protocol/src/lib.rs @@ -17,7 +17,7 @@ //! The Collator Protocol allows collators and validators talk to each other. //! This subsystem implements both sides of the collator protocol. -#![deny(missing_docs, unused_extern_crates, unused_results)] +#![deny(missing_docs, unused_crate_dependencies, unused_results)] use std::time::Duration; use futures::{channel::oneshot, FutureExt}; diff --git a/node/network/pov-distribution/src/lib.rs b/node/network/pov-distribution/src/lib.rs index e07441a060f7..74bd27eb3949 100644 --- a/node/network/pov-distribution/src/lib.rs +++ b/node/network/pov-distribution/src/lib.rs @@ -19,7 +19,7 @@ //! This is a gossip implementation of code that is responsible for distributing PoVs //! among validators. -#![deny(unused_extern_crates, unused_results)] +#![deny(unused_crate_dependencies, unused_results)] #![warn(missing_docs)] use polkadot_primitives::v1::{Hash, PoV, CandidateDescriptor}; diff --git a/node/network/protocol/Cargo.toml b/node/network/protocol/Cargo.toml index abcb6ae2adda..11e1cc4180e3 100644 --- a/node/network/protocol/Cargo.toml +++ b/node/network/protocol/Cargo.toml @@ -9,6 +9,4 @@ description = "Primitives types for the Node-side" polkadot-primitives = { path = "../../../primitives" } polkadot-node-primitives = { path = "../../primitives" } parity-scale-codec = { version = "1.3.4", default-features = false, features = ["derive"] } -runtime_primitives = { package = "sp-runtime", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } -sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/network/protocol/src/lib.rs b/node/network/protocol/src/lib.rs index 860f34701f20..31ec729d8b86 100644 --- a/node/network/protocol/src/lib.rs +++ b/node/network/protocol/src/lib.rs @@ -16,7 +16,7 @@ //! Network protocol types for parachains. -#![deny(unused_extern_crates, unused_results)] +#![deny(unused_crate_dependencies, unused_results)] #![warn(missing_docs)] use polkadot_primitives::v1::Hash; diff --git a/node/network/statement-distribution/src/lib.rs b/node/network/statement-distribution/src/lib.rs index 8fbfa435dc0f..2d86866ae2ef 100644 --- a/node/network/statement-distribution/src/lib.rs +++ b/node/network/statement-distribution/src/lib.rs @@ -19,7 +19,7 @@ //! This is responsible for distributing signed statements about candidate //! validity amongst validators. -#![deny(unused_extern_crates, unused_results)] +#![deny(unused_crate_dependencies, unused_results)] #![warn(missing_docs)] use polkadot_subsystem::{ diff --git a/node/overseer/src/lib.rs b/node/overseer/src/lib.rs index 4a508aaf2bf8..1bde8d9e54a6 100644 --- a/node/overseer/src/lib.rs +++ b/node/overseer/src/lib.rs @@ -54,7 +54,7 @@ //! .................................................................. //! ``` -#![deny(unused_extern_crates, unused_results)] +#![deny(unused_crate_dependencies, unused_results)] #![warn(missing_docs)] use std::fmt::Debug; diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 6029b849c622..083ecd53ccfd 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -9,13 +9,10 @@ edition = "2018" authority-discovery = { package = "sc-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master" } babe = { package = "sc-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" } grandpa = { package = "sc-finality-grandpa", git = "https://github.com/paritytech/substrate", branch = "master" } -sc-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" } service = { package = "sc-service", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } @@ -31,7 +28,6 @@ sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-offchain = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master" } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master" } @@ -40,7 +36,6 @@ sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" } # Substrate Pallets -pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master" } @@ -54,11 +49,8 @@ prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https: codec = { package = "parity-scale-codec", version = "1.3.4" } futures = "0.3.4" hex-literal = "0.2.1" -lazy_static = "1.4.0" log = "0.4.8" -parking_lot = "0.9.0" serde = { version = "1.0.102", features = ["derive"] } -slog = "2.5.2" # Polkadot kusama-runtime = { path = "../../runtime/kusama" } diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index 3f1b17d8b8a3..bf2c9eb7378c 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -16,7 +16,7 @@ //! Polkadot service. Specialized wrapper over substrate service. -#![deny(unused_extern_crates, unused_results)] +#![deny(unused_crate_dependencies, unused_results)] pub mod chain_spec; mod grandpa_support; diff --git a/node/subsystem-test-helpers/src/lib.rs b/node/subsystem-test-helpers/src/lib.rs index 48a303cac03e..c466a609ebae 100644 --- a/node/subsystem-test-helpers/src/lib.rs +++ b/node/subsystem-test-helpers/src/lib.rs @@ -16,7 +16,7 @@ //! Utilities for testing subsystems. -#![deny(unused_extern_crates, unused_results)] +#![deny(unused_crate_dependencies, unused_results)] #![warn(missing_docs)] use polkadot_node_subsystem::messages::AllMessages; diff --git a/node/subsystem-util/Cargo.toml b/node/subsystem-util/Cargo.toml index 54329621693c..1c7b38ad9585 100644 --- a/node/subsystem-util/Cargo.toml +++ b/node/subsystem-util/Cargo.toml @@ -14,13 +14,12 @@ thiserror = "1.0.21" parity-scale-codec = "1.3.4" parking_lot = { version = "0.10.0", optional = true } pin-project = "0.4.22" -smallvec = "1.4.1" streamunordered = "0.5.1" polkadot-node-primitives = { path = "../primitives" } polkadot-node-subsystem = { path = "../subsystem" } polkadot-primitives = { path = "../../primitives" } -polkadot-statement-table = { path = "../../statement-table" } +#polkadot-statement-table = { path = "../../statement-table" } sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/subsystem-util/src/lib.rs b/node/subsystem-util/src/lib.rs index cf47a2d6bd79..3ee915766a94 100644 --- a/node/subsystem-util/src/lib.rs +++ b/node/subsystem-util/src/lib.rs @@ -22,7 +22,9 @@ //! //! This crate also reexports Prometheus metric types which are expected to be implemented by subsystems. -#![deny(unused_extern_crates, unused_results)] +#![deny(unused_results)] +// #![deny(unused_crate_dependencies] causes false positives +// https://github.com/rust-lang/rust/issues/57274 #![warn(missing_docs)] use polkadot_node_subsystem::{ From ce334f92fe32f15ecffa3137563b52d145efdb7a Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 11:10:02 +0100 Subject: [PATCH 30/62] moar --- Cargo.lock | 4 ---- node/service/Cargo.toml | 4 ---- node/service/src/lib.rs | 2 ++ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aaf6353d9974..bba1d56aa0f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5463,14 +5463,12 @@ dependencies = [ "env_logger 0.8.1", "frame-benchmarking", "frame-system-rpc-runtime-api", - "futures 0.3.5", "hex-literal 0.2.1", "kusama-runtime", "log 0.4.11", "pallet-im-online", "pallet-staking", "pallet-transaction-payment-rpc-runtime-api", - "parity-scale-codec", "polkadot-node-core-proposer", "polkadot-node-subsystem", "polkadot-overseer", @@ -5480,14 +5478,12 @@ dependencies = [ "polkadot-runtime", "polkadot-test-client", "rococo-v1-runtime", - "sc-authority-discovery", "sc-chain-spec", "sc-client-api", "sc-consensus", "sc-consensus-babe", "sc-executor", "sc-finality-grandpa", - "sc-network", "sc-service", "sc-telemetry", "sc-transaction-pool", diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 083ecd53ccfd..e3b42ee63574 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -6,14 +6,12 @@ edition = "2018" [dependencies] # Substrate Client -authority-discovery = { package = "sc-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master" } babe = { package = "sc-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" } grandpa = { package = "sc-finality-grandpa", git = "https://github.com/paritytech/substrate", branch = "master" } sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" } service = { package = "sc-service", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } telemetry = { package = "sc-telemetry", git = "https://github.com/paritytech/substrate", branch = "master" } @@ -46,8 +44,6 @@ frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate" prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https://github.com/paritytech/substrate", branch = "master" } # External Crates -codec = { package = "parity-scale-codec", version = "1.3.4" } -futures = "0.3.4" hex-literal = "0.2.1" log = "0.4.8" serde = { version = "1.0.102", features = ["derive"] } diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index bf2c9eb7378c..c37e27610fc3 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -24,6 +24,8 @@ mod client; use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider}; +#[cfg(feature = "full-node")] + use log::info; use polkadot_node_core_proposer::ProposerFactory; use polkadot_overseer::{AllSubsystems, BlockInfo, Overseer, OverseerHandler}; From 2b4a0fc58bc2ef05f30aa702a58fda805b8c4da1 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 11:18:21 +0100 Subject: [PATCH 31/62] chore --- node/service/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index c37e27610fc3..54d1785ef1f2 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -25,7 +25,6 @@ mod client; use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider}; #[cfg(feature = "full-node")] - use log::info; use polkadot_node_core_proposer::ProposerFactory; use polkadot_overseer::{AllSubsystems, BlockInfo, Overseer, OverseerHandler}; From 86c5a43ee589b3b088ad14573f003bac191cf02f Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 11:49:53 +0100 Subject: [PATCH 32/62] service is too much pain for the gain --- Cargo.lock | 12 ++++++++++++ node/service/Cargo.toml | 12 ++++++++++++ node/service/src/lib.rs | 3 +-- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bba1d56aa0f2..2af482150847 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5463,12 +5463,17 @@ dependencies = [ "env_logger 0.8.1", "frame-benchmarking", "frame-system-rpc-runtime-api", + "futures 0.3.5", "hex-literal 0.2.1", "kusama-runtime", + "lazy_static", "log 0.4.11", + "pallet-babe", "pallet-im-online", "pallet-staking", "pallet-transaction-payment-rpc-runtime-api", + "parity-scale-codec", + "parking_lot 0.9.0", "polkadot-node-core-proposer", "polkadot-node-subsystem", "polkadot-overseer", @@ -5478,16 +5483,22 @@ dependencies = [ "polkadot-runtime", "polkadot-test-client", "rococo-v1-runtime", + "sc-authority-discovery", + "sc-block-builder", "sc-chain-spec", "sc-client-api", + "sc-client-db", "sc-consensus", "sc-consensus-babe", "sc-executor", "sc-finality-grandpa", + "sc-keystore", + "sc-network", "sc-service", "sc-telemetry", "sc-transaction-pool", "serde", + "slog", "sp-api", "sp-authority-discovery", "sp-block-builder", @@ -5497,6 +5508,7 @@ dependencies = [ "sp-core", "sp-finality-grandpa", "sp-inherents", + "sp-io", "sp-offchain", "sp-runtime", "sp-session", diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index e3b42ee63574..6029b849c622 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -6,12 +6,17 @@ edition = "2018" [dependencies] # Substrate Client +authority-discovery = { package = "sc-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master" } babe = { package = "sc-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" } grandpa = { package = "sc-finality-grandpa", git = "https://github.com/paritytech/substrate", branch = "master" } +sc-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" } service = { package = "sc-service", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } telemetry = { package = "sc-telemetry", git = "https://github.com/paritytech/substrate", branch = "master" } @@ -26,6 +31,7 @@ sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-offchain = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master" } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-session = { git = "https://github.com/paritytech/substrate", branch = "master" } @@ -34,6 +40,7 @@ sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" } # Substrate Pallets +pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master" } pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master" } @@ -44,9 +51,14 @@ frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate" prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https://github.com/paritytech/substrate", branch = "master" } # External Crates +codec = { package = "parity-scale-codec", version = "1.3.4" } +futures = "0.3.4" hex-literal = "0.2.1" +lazy_static = "1.4.0" log = "0.4.8" +parking_lot = "0.9.0" serde = { version = "1.0.102", features = ["derive"] } +slog = "2.5.2" # Polkadot kusama-runtime = { path = "../../runtime/kusama" } diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index 54d1785ef1f2..cc61c79408c4 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -16,13 +16,12 @@ //! Polkadot service. Specialized wrapper over substrate service. -#![deny(unused_crate_dependencies, unused_results)] +#![deny(unused_results)] pub mod chain_spec; mod grandpa_support; mod client; - use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider}; #[cfg(feature = "full-node")] use log::info; From 64a95ba000cda9306c6c35de60d7406fce4cdf56 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 11:54:12 +0100 Subject: [PATCH 33/62] fallout --- validation/src/error.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/validation/src/error.rs b/validation/src/error.rs index 60ca1709db5f..10a9d4580781 100644 --- a/validation/src/error.rs +++ b/validation/src/error.rs @@ -29,15 +29,12 @@ pub enum Error { Consensus(#[from] consensus::error::Error), /// Unexpected error checking inherents #[error("Unexpected error while checking inherents: {0}")] - InherentError(#[from] inherents::Error), + InherentError(inherents::Error), } -impl std::error::Error for Error { - fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { - match self { - Error::Client(ref err) => Some(err), - Error::Consensus(ref err) => Some(err), - _ => None, - } + +impl std::convert::From for Error { + fn from(inner: inherents::Error) -> Self { + Self::InherentError(inner) } -} +} \ No newline at end of file From 722aa4dd6f4d8c1371c29812ae70fabf9a168d96 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 13:06:43 +0100 Subject: [PATCH 34/62] chore --- Cargo.lock | 1 - node/network/bridge/Cargo.toml | 1 - node/network/bridge/src/lib.rs | 4 +++- node/network/bridge/src/validator_discovery.rs | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2af482150847..1aeee4397c81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4879,7 +4879,6 @@ dependencies = [ "assert_matches", "async-trait", "futures 0.3.5", - "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", "parking_lot 0.10.2", diff --git a/node/network/bridge/Cargo.toml b/node/network/bridge/Cargo.toml index fbf93fd37e55..bf6eaf81f7a7 100644 --- a/node/network/bridge/Cargo.toml +++ b/node/network/bridge/Cargo.toml @@ -8,7 +8,6 @@ edition = "2018" async-trait = "0.1" futures = "0.3.5" log = "0.4.8" -futures-timer = "3.0.2" streamunordered = "0.5.1" polkadot-primitives = { path = "../../../primitives" } parity-scale-codec = "1.3.4" diff --git a/node/network/bridge/src/lib.rs b/node/network/bridge/src/lib.rs index 7291d453ea98..d3839c2a7694 100644 --- a/node/network/bridge/src/lib.rs +++ b/node/network/bridge/src/lib.rs @@ -19,6 +19,8 @@ #![deny(unused_crate_dependencies, unused_results)] #![warn(missing_docs)] +use streamunordered as _; + use parity_scale_codec::{Encode, Decode}; use futures::prelude::*; use futures::future::BoxFuture; @@ -663,7 +665,7 @@ where match peer_map.entry(peer.clone()) { hash_map::Entry::Occupied(_) => continue, hash_map::Entry::Vacant(vacant) => { - vacant.insert(PeerData { + let _ = vacant.insert(PeerData { view: View(Vec::new()), }); diff --git a/node/network/bridge/src/validator_discovery.rs b/node/network/bridge/src/validator_discovery.rs index 542045f8c300..531e41cd629d 100644 --- a/node/network/bridge/src/validator_discovery.rs +++ b/node/network/bridge/src/validator_discovery.rs @@ -192,7 +192,7 @@ impl Service { Err(e) if e.is_disconnected() => { // the request is already revoked for peer_id in validator_ids { - on_revoke(&mut self.requested_validators, peer_id); + let _ = on_revoke(&mut self.requested_validators, peer_id); } return (network_service, authority_discovery_service); } @@ -217,7 +217,7 @@ impl Service { // They are going to be removed soon though: // https://github.com/paritytech/substrate/issues/6845 for addr in addresses.into_iter().take(MAX_ADDR_PER_PEER) { - multiaddr_to_add.insert(addr); + let _ = multiaddr_to_add.insert(addr); } } } @@ -247,7 +247,7 @@ impl Service { let result = authority_discovery_service.get_addresses_by_authority_id(id).await; if let Some(addresses) = result { for addr in addresses.into_iter().take(MAX_ADDR_PER_PEER) { - multiaddr_to_remove.insert(addr); + let _ = multiaddr_to_remove.insert(addr); } } } @@ -283,16 +283,16 @@ impl Service { let maybe_authority = authority_discovery_service.get_authority_id_by_peer_id(peer_id.clone()).await; if let Some(authority) = maybe_authority { for request in self.non_revoked_discovery_requests.iter_mut() { - request.on_authority_connected(&authority, peer_id); + let _ = request.on_authority_connected(&authority, peer_id); } - self.connected_validators.insert(authority, peer_id.clone()); + let _ = self.connected_validators.insert(authority, peer_id.clone()); } } pub async fn on_peer_disconnected(&mut self, peer_id: &PeerId, authority_discovery_service: &mut AD) { let maybe_authority = authority_discovery_service.get_authority_id_by_peer_id(peer_id.clone()).await; if let Some(authority) = maybe_authority { - self.connected_validators.remove(&authority); + let _ = self.connected_validators.remove(&authority); } } } From 4e730cdcc713a82328c18f969ad0df431741945f Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 13:25:17 +0100 Subject: [PATCH 35/62] fixes from cargo b --workspace --- Cargo.lock | 3 +-- node/core/backing/src/lib.rs | 12 ++++++------ node/network/collator-protocol/Cargo.toml | 3 +-- node/network/collator-protocol/src/lib.rs | 4 ++-- node/subsystem/src/messages.rs | 5 +++-- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1aeee4397c81..e8887d73d031 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4837,8 +4837,6 @@ dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", - "parity-scale-codec", - "polkadot-network-bridge", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", @@ -4848,6 +4846,7 @@ dependencies = [ "smol-timeout", "sp-core", "sp-keyring", + "thiserror", ] [[package]] diff --git a/node/core/backing/src/lib.rs b/node/core/backing/src/lib.rs index d130e07b15f2..1e8de2bb24de 100644 --- a/node/core/backing/src/lib.rs +++ b/node/core/backing/src/lib.rs @@ -75,17 +75,17 @@ enum Error { #[error("Signature is invalid")] InvalidSignature, #[error("Storing data failed")] - StoreFailed(oneshot::Canceled), + StoreFailed(#[source] oneshot::Canceled), #[error("Responding to backing request failed")] - BackingResponseChannel(oneshot::Canceled), + BackingResponseChannel(#[source] oneshot::Canceled), #[error("Obtaining erasure chunks failed")] - ObtainErasureChunks(#[from] #[source]erasure_coding::Error), + ObtainErasureChunks(#[from] #[source] erasure_coding::Error), #[error(transparent)] - ValidationFailed(ValidationFailed), + ValidationFailed(#[from] ValidationFailed), #[error(transparent)] - Mpsc(mpsc::SendError), + Mpsc(#[from] mpsc::SendError), #[error(transparent)] - UtilError(util::Error), + UtilError(#[from] util::Error), } /// Holds all data needed for candidate backing job operation. diff --git a/node/network/collator-protocol/Cargo.toml b/node/network/collator-protocol/Cargo.toml index b2073d6b94e4..a2b37b8a3d89 100644 --- a/node/network/collator-protocol/Cargo.toml +++ b/node/network/collator-protocol/Cargo.toml @@ -7,11 +7,10 @@ edition = "2018" [dependencies] futures = "0.3.5" log = "0.4.11" +thiserror = "1.0.21" -codec = { package="parity-scale-codec", version = "1.3.4", features = ["std"] } polkadot-primitives = { path = "../../../primitives" } -polkadot-network-bridge = { path = "../../network/bridge" } polkadot-node-network-protocol = { path = "../../network/protocol" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } diff --git a/node/network/collator-protocol/src/lib.rs b/node/network/collator-protocol/src/lib.rs index 2269cfad38d3..01212ea4ea2d 100644 --- a/node/network/collator-protocol/src/lib.rs +++ b/node/network/collator-protocol/src/lib.rs @@ -17,7 +17,7 @@ //! The Collator Protocol allows collators and validators talk to each other. //! This subsystem implements both sides of the collator protocol. -#![deny(missing_docs, unused_crate_dependencies, unused_results)] +#![deny(missing_docs, unused_crate_dependencies)] use std::time::Duration; use futures::{channel::oneshot, FutureExt}; @@ -115,7 +115,7 @@ impl CollatorProtocolSubsystem { metrics, ).await, }.map_err(|e| { - SubsystemError::with_origin("collator-protocol", e) + SubsystemError::with_origin("collator-protocol", e).into() }) } } diff --git a/node/subsystem/src/messages.rs b/node/subsystem/src/messages.rs index e6df5791d4c8..c408dac3853e 100644 --- a/node/subsystem/src/messages.rs +++ b/node/subsystem/src/messages.rs @@ -23,7 +23,7 @@ //! Subsystems' APIs are defined separately from their implementation, leading to easier mocking. use futures::channel::{mpsc, oneshot}; - +use thiserror::Error; use polkadot_node_network_protocol::{ v1 as protocol_v1, NetworkBridgeEvent, ReputationChange, PeerId, }; @@ -97,7 +97,8 @@ impl CandidateBackingMessage { } /// Blanket error for validation failing for internal reasons. -#[derive(Debug)] +#[derive(Debug, Error)] +#[error("Validation failed with {0:?}")] pub struct ValidationFailed(pub String); /// Messages received by the Validation subsystem. From 17537246c9a7903482398879b092db0404379a36 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 13:35:35 +0100 Subject: [PATCH 36/62] fixup core-backing --- Cargo.lock | 3 --- node/core/backing/Cargo.toml | 3 --- node/core/backing/src/lib.rs | 14 +++++++------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e8887d73d031..aef8cb112c1b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4948,11 +4948,8 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "polkadot-statement-table", - "sc-client-api", "sc-keystore", - "sp-api", "sp-application-crypto", - "sp-blockchain", "sp-core", "sp-keyring", "sp-keystore", diff --git a/node/core/backing/Cargo.toml b/node/core/backing/Cargo.toml index fada2c92dae0..8892e201503c 100644 --- a/node/core/backing/Cargo.toml +++ b/node/core/backing/Cargo.toml @@ -6,10 +6,7 @@ edition = "2018" [dependencies] futures = "0.3.5" -sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-primitives = { path = "../../../primitives" } polkadot-node-primitives = { path = "../../primitives" } polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } diff --git a/node/core/backing/src/lib.rs b/node/core/backing/src/lib.rs index 1e8de2bb24de..6c0979618160 100644 --- a/node/core/backing/src/lib.rs +++ b/node/core/backing/src/lib.rs @@ -16,7 +16,7 @@ //! Implements a `CandidateBackingSubsystem`. -#![deny(unused_crate_dependencies, unused_results)] +#![deny(unused_crate_dependencies)] use std::collections::{HashMap, HashSet}; use std::convert::TryFrom; @@ -74,10 +74,10 @@ enum Error { CandidateNotFound, #[error("Signature is invalid")] InvalidSignature, - #[error("Storing data failed")] - StoreFailed(#[source] oneshot::Canceled), - #[error("Responding to backing request failed")] - BackingResponseChannel(#[source] oneshot::Canceled), + #[error("Failed to send candidates {0:?}")] + Send(Vec), + #[error("Oneshot never resolved")] + Oneshot(#[from] #[source] oneshot::Canceled), #[error("Obtaining erasure chunks failed")] ObtainErasureChunks(#[from] #[source] erasure_coding::Error), #[error(transparent)] @@ -474,7 +474,7 @@ impl CandidateBackingJob { CandidateBackingMessage::GetBackedCandidates(_, tx) => { let backed = self.get_backed(); - tx.send(backed).map_err(|e| Error::BackingResponseChannel(e))?; + tx.send(backed).map_err(|data| Error::Send(data))?; } } @@ -646,7 +646,7 @@ impl CandidateBackingJob { ) ).await?; - rx.await?.map_err(|e| Error::StoreFailed(e))?; + let _ = rx.await?; Ok(()) } From 199a68245074148d31aeb505a7835a982d9183b3 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 13:41:11 +0100 Subject: [PATCH 37/62] fixup bitfield-signing --- node/core/bitfield-signing/src/lib.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/node/core/bitfield-signing/src/lib.rs b/node/core/bitfield-signing/src/lib.rs index c27b95a17d3b..48bc8df70a5a 100644 --- a/node/core/bitfield-signing/src/lib.rs +++ b/node/core/bitfield-signing/src/lib.rs @@ -49,6 +49,7 @@ const JOB_DELAY: Duration = Duration::from_millis(1500); pub struct BitfieldSigningJob; /// Messages which a `BitfieldSigningJob` is prepared to receive. +#[allow(missing_docs)] pub enum ToJob { BitfieldSigning(BitfieldSigningMessage), Stop, @@ -83,6 +84,7 @@ impl From for ToJob { } /// Messages which may be sent from a `BitfieldSigningJob`. +#[allow(missing_docs)] pub enum FromJob { AvailabilityStore(AvailabilityStoreMessage), BitfieldDistribution(BitfieldDistributionMessage), @@ -120,24 +122,24 @@ impl TryFrom for FromJob { pub enum Error { /// error propagated from the utility subsystem #[error(transparent)] - Util(util::Error), + Util(#[from] util::Error), /// io error #[error(transparent)] - Io(std::io::Error), + Io(#[from] std::io::Error), /// a one shot channel was canceled #[error(transparent)] - Oneshot(oneshot::Canceled), + Oneshot(#[from] oneshot::Canceled), /// a mspc channel failed to send #[error(transparent)] - MpscSend(mpsc::SendError), + MpscSend(#[from] mpsc::SendError), /// several errors collected into one - #[error(transparent)] + #[error("Multiple errours occured: {0:?}")] Multiple(Vec), /// the runtime API failed to return what we wanted #[error(transparent)] - Runtime(RuntimeApiError), + Runtime(#[from] RuntimeApiError), /// the keystore failed to process signing request - #[error(transparent)] + #[error("Keystore failed: {0:?}")] Keystore(KeystoreError), } @@ -256,7 +258,7 @@ async fn construct_availability_bitfield( if errs.is_empty() { Ok(out.into_inner().into()) } else { - Err(errs.into()) + Err(Error::Multiple(errs.into())) } } From b7268a362066caa29d55e6c069b50c7d620abe70 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 13:46:21 +0100 Subject: [PATCH 38/62] fixup provisioner --- Cargo.lock | 1 + node/core/provisioner/Cargo.toml | 3 ++- node/core/provisioner/src/lib.rs | 14 +++++++------- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aef8cb112c1b..0e3110121823 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5057,6 +5057,7 @@ dependencies = [ "sp-core", "sp-keystore", "tempfile", + "thiserror", ] [[package]] diff --git a/node/core/provisioner/Cargo.toml b/node/core/provisioner/Cargo.toml index 0dfa39c1044a..34fa717638a3 100644 --- a/node/core/provisioner/Cargo.toml +++ b/node/core/provisioner/Cargo.toml @@ -7,7 +7,8 @@ edition = "2018" [dependencies] bitvec = { version = "0.17.4", default-features = false, features = ["alloc"] } futures = "0.3.5" -log = "0.4.8" +log = "0.4.11" +thiserror = "1.0.21" polkadot-primitives = { path = "../../../primitives" } polkadot-node-subsystem = { path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } diff --git a/node/core/provisioner/src/lib.rs b/node/core/provisioner/src/lib.rs index 8cd01883b379..d0b271b66949 100644 --- a/node/core/provisioner/src/lib.rs +++ b/node/core/provisioner/src/lib.rs @@ -119,22 +119,22 @@ impl TryFrom for FromJob { #[derive(Debug, Error)] enum Error { #[error(transparent)] - Util(util::Error), + Util(#[from] util::Error), #[error(transparent)] - OneshotRecv(oneshot::Canceled), + OneshotRecv(#[from] oneshot::Canceled), #[error(transparent)] - ChainApi(ChainApiError), + ChainApi(#[from] ChainApiError), #[error(transparent)] - Runtime(RuntimeApiError), + Runtime(#[from] RuntimeApiError), #[error("Failed to send message to ChainAPI")] ChainApiMessageSend(#[source] mpsc::SendError), #[error("Failed to send return message with Inherents")] - InherentDataReturnChannel(#[source] mpsc::SendError), + InherentDataReturnChannel, } impl JobTrait for ProvisioningJob { @@ -237,7 +237,7 @@ impl ProvisioningJob { let tail = bad_indices[bad_indices.len() - 1]; let retain = *idx != tail; if *idx >= tail { - bad_indices.pop(); + let _ = bad_indices.pop(); } retain }) @@ -306,7 +306,7 @@ async fn send_inherent_data( return_sender .send((bitfields, candidates)) - .map_err(|e| Error::InherentDataReturnChannel(e))?; + .map_err(|_data| Error::InherentDataReturnChannel)?; Ok(()) } From 0e6a1f79cfe2c74a9d8148fa45806bccd11644d0 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 13:53:08 +0100 Subject: [PATCH 39/62] fix subsys-test-helpers, fixup bitfield-distribution --- Cargo.lock | 4 ---- node/network/bitfield-distribution/Cargo.toml | 12 ++++++------ node/network/bitfield-distribution/src/lib.rs | 5 +++-- node/subsystem-test-helpers/src/lib.rs | 4 ++-- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e3110121823..c788377275a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4763,20 +4763,16 @@ dependencies = [ "maplit", "parity-scale-codec", "parking_lot 0.11.0", - "polkadot-network-bridge", "polkadot-node-network-protocol", - "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", "polkadot-node-subsystem-util", "polkadot-primitives", "sc-keystore", - "sc-network", "smol 0.3.3", "sp-application-crypto", "sp-core", "sp-keystore", - "streamunordered", "tempfile", ] diff --git a/node/network/bitfield-distribution/Cargo.toml b/node/network/bitfield-distribution/Cargo.toml index 7ffeacabb4d5..444895167208 100644 --- a/node/network/bitfield-distribution/Cargo.toml +++ b/node/network/bitfield-distribution/Cargo.toml @@ -6,19 +6,19 @@ edition = "2018" [dependencies] futures = "0.3.5" -futures-timer = "3.0.2" -log = "0.4.8" -streamunordered = "0.5.1" +log = "0.4.11" +#streamunordered = "0.5.1" codec = { package="parity-scale-codec", version = "1.3.4" } -node-primitives = { package = "polkadot-node-primitives", path = "../../primitives" } +#node-primitives = { package = "polkadot-node-primitives", path = "../../primitives" } polkadot-primitives = { path = "../../../primitives" } polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } -polkadot-network-bridge = { path = "../../network/bridge" } +#polkadot-network-bridge = { path = "../../network/bridge" } polkadot-node-network-protocol = { path = "../../network/protocol" } -sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } +#sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } [dev-dependencies] +futures-timer = "3.0.2" polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } bitvec = { version = "0.17.4", default-features = false, features = ["alloc"] } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/network/bitfield-distribution/src/lib.rs b/node/network/bitfield-distribution/src/lib.rs index c8ca9a3a0ec8..3f3db43c0ba9 100644 --- a/node/network/bitfield-distribution/src/lib.rs +++ b/node/network/bitfield-distribution/src/lib.rs @@ -20,10 +20,10 @@ //! for a particular relay parent. //! Independently of that, gossips on received messages from peers to other interested peers. -#![deny(unused_crate_dependencies, unused_results)] +#![deny(unused_crate_dependencies)] use codec::{Decode, Encode}; -use futures::{channel::oneshot, FutureExt}; +use futures::{channel::oneshot, FutureExt, TryFutureExt}; use log::{trace, warn}; use polkadot_subsystem::messages::*; @@ -35,6 +35,7 @@ use polkadot_node_subsystem_util::{ }; use polkadot_primitives::v1::{Hash, SignedAvailabilityBitfield, SigningContext, ValidatorId}; use polkadot_node_network_protocol::{v1 as protocol_v1, PeerId, NetworkBridgeEvent, View, ReputationChange}; +use polkadot_subsystem::SubsystemError; use std::collections::{HashMap, HashSet}; const COST_SIGNATURE_INVALID: ReputationChange = diff --git a/node/subsystem-test-helpers/src/lib.rs b/node/subsystem-test-helpers/src/lib.rs index c466a609ebae..0c9c8b05608b 100644 --- a/node/subsystem-test-helpers/src/lib.rs +++ b/node/subsystem-test-helpers/src/lib.rs @@ -16,7 +16,6 @@ //! Utilities for testing subsystems. -#![deny(unused_crate_dependencies, unused_results)] #![warn(missing_docs)] use polkadot_node_subsystem::messages::AllMessages; @@ -172,7 +171,8 @@ impl SubsystemContext } async fn recv(&mut self) -> SubsystemResult> { - self.rx.next().await.ok_or(SubsystemError) + self.rx.next().await + .ok_or_else(|| SubsystemError::Context("Receiving end closed".to_owned())) } async fn spawn( From ce9ef22dd0f1a9d3a4640d968840118d8ac59c18 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 14:06:41 +0100 Subject: [PATCH 40/62] fixup av-store --- node/core/av-store/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/node/core/av-store/src/lib.rs b/node/core/av-store/src/lib.rs index 8210fd50dd32..ce73e02df1f5 100644 --- a/node/core/av-store/src/lib.rs +++ b/node/core/av-store/src/lib.rs @@ -44,7 +44,6 @@ use polkadot_node_subsystem_util::metrics::{self, prometheus}; use polkadot_subsystem::messages::{ AllMessages, AvailabilityStoreMessage, ChainApiMessage, RuntimeApiMessage, RuntimeApiRequest, }; -use polkadot_subsystem::messages::AvailabilityStoreMessage; use thiserror::Error; const LOG_TARGET: &str = "availability"; @@ -57,6 +56,10 @@ mod columns { #[derive(Debug, Error)] enum Error { + #[error(transparent)] + RuntimeAPI(#[from] RuntimeApiError), + #[error(transparent)] + ChainAPI(#[from] ChainApiError), #[error(transparent)] Erasure(#[from] erasure::Error), #[error(transparent)] From 6de29081d705f0d3c2d564a76d6155b81fdce1fa Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 14:13:18 +0100 Subject: [PATCH 41/62] fixup chain-api --- node/core/chain-api/src/lib.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/node/core/chain-api/src/lib.rs b/node/core/chain-api/src/lib.rs index ba5dec5fdfe2..7c7f2d98b2d2 100644 --- a/node/core/chain-api/src/lib.rs +++ b/node/core/chain-api/src/lib.rs @@ -32,7 +32,7 @@ use polkadot_subsystem::{ FromOverseer, OverseerSignal, - SpawnedSubsystem, Subsystem, SubsystemResult, SubsystemContext, + SpawnedSubsystem, Subsystem, SubsystemResult, SubsystemError, SubsystemContext, messages::ChainApiMessage, }; use polkadot_node_subsystem_util::{ @@ -64,7 +64,10 @@ impl Subsystem for ChainApiSubsystem where Context: SubsystemContext { fn start(self, ctx: Context) -> SpawnedSubsystem { - let future = run(ctx, self).map_err(|e| SubsystemError::with_origin("chain-api", e)).map(|_| ()).boxed(); + let future = run(ctx, self) + .map_err(|e| SubsystemError::with_origin("chain-api", e)) + .map(|_| ()) + .boxed(); SpawnedSubsystem { future, name: "chain-api-subsystem", @@ -116,7 +119,10 @@ where let maybe_header = subsystem.client.header(BlockId::Hash(hash)); match maybe_header { // propagate the error - Err(e) => Some(Err(e.into())), + Err(e) => { + let e = e.to_string().into(); + Some(Err(e)) + }, // fewer than `k` ancestors are available Ok(None) => None, Ok(Some(header)) => { From c07b2efef0dbae0d4f26fc32b9a31d681ce6a1d0 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 14:16:12 +0100 Subject: [PATCH 42/62] Update node/subsystem-util/Cargo.toml Co-authored-by: Andronik Ordian --- node/subsystem-util/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/node/subsystem-util/Cargo.toml b/node/subsystem-util/Cargo.toml index 1c7b38ad9585..863a4bc91cac 100644 --- a/node/subsystem-util/Cargo.toml +++ b/node/subsystem-util/Cargo.toml @@ -19,7 +19,6 @@ streamunordered = "0.5.1" polkadot-node-primitives = { path = "../primitives" } polkadot-node-subsystem = { path = "../subsystem" } polkadot-primitives = { path = "../../primitives" } -#polkadot-statement-table = { path = "../../statement-table" } sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } From 317ab57050aad29077a38cf2ff5c3fcb7c8d40e2 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 14:16:21 +0100 Subject: [PATCH 43/62] Update validation/src/error.rs Co-authored-by: Andronik Ordian --- validation/src/error.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validation/src/error.rs b/validation/src/error.rs index 10a9d4580781..0665a70f3312 100644 --- a/validation/src/error.rs +++ b/validation/src/error.rs @@ -37,4 +37,4 @@ impl std::convert::From for Error { fn from(inner: inherents::Error) -> Self { Self::InherentError(inner) } -} \ No newline at end of file +} From 37ade0329deee5d1da6b3af493c5852c6dba1e94 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 14:16:30 +0100 Subject: [PATCH 44/62] Update erasure-coding/src/lib.rs Co-authored-by: Andronik Ordian --- erasure-coding/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erasure-coding/src/lib.rs b/erasure-coding/src/lib.rs index d03d72b66f1f..f51d09ce25b2 100644 --- a/erasure-coding/src/lib.rs +++ b/erasure-coding/src/lib.rs @@ -215,7 +215,7 @@ fn reconstruct<'a, I: 'a, T: Decode>(n_validators: usize, chunks: I) -> Result= n_validators { - return Err(Error::ChunkIndexOutOfBounds{chunk_index: chunk_idx, n_validators}); + return Err(Error::ChunkIndexOutOfBounds{ chunk_index: chunk_idx, n_validators }); } let shard_len = shard_len.get_or_insert_with(|| chunk_data.len()); From 6cacc5918bcd3432865a56865e985e6f1ac27f4a Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 14:16:40 +0100 Subject: [PATCH 45/62] Update erasure-coding/src/lib.rs Co-authored-by: Andronik Ordian --- erasure-coding/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erasure-coding/src/lib.rs b/erasure-coding/src/lib.rs index f51d09ce25b2..e20e36c25905 100644 --- a/erasure-coding/src/lib.rs +++ b/erasure-coding/src/lib.rs @@ -65,7 +65,7 @@ pub enum Error { UnevenLength, /// Chunk index out of bounds. #[error("Chunk is out of bounds: {chunk_index} not included in 0..{n_validators}")] - ChunkIndexOutOfBounds{ chunk_index: usize, n_validators: usize}, + ChunkIndexOutOfBounds{ chunk_index: usize, n_validators: usize }, /// Bad payload in reconstructed bytes. #[error("Reconstructed payload invalid")] BadPayload, From 5ef5f8c4cd365f8053f2e1bf0dd92e79fef52ae4 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 14:18:38 +0100 Subject: [PATCH 46/62] fixup pov-distribution --- Cargo.lock | 6 - node/network/pov-distribution/Cargo.toml | 8 +- node/network/pov-distribution/src/lib.rs | 921 +-------------------- node/network/pov-distribution/src/tests.rs | 913 ++++++++++++++++++++ 4 files changed, 918 insertions(+), 930 deletions(-) create mode 100644 node/network/pov-distribution/src/tests.rs diff --git a/Cargo.lock b/Cargo.lock index c788377275a1..3c1342315a3a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5212,19 +5212,13 @@ version = "0.1.0" dependencies = [ "assert_matches", "futures 0.3.5", - "futures-timer 3.0.2", "log 0.4.11", - "parity-scale-codec", - "parking_lot 0.10.2", "polkadot-node-network-protocol", - "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", "polkadot-node-subsystem-util", "polkadot-primitives", "sp-core", - "sp-runtime", - "streamunordered", ] [[package]] diff --git a/node/network/pov-distribution/Cargo.toml b/node/network/pov-distribution/Cargo.toml index 24f2107ca18f..2449a63016f7 100644 --- a/node/network/pov-distribution/Cargo.toml +++ b/node/network/pov-distribution/Cargo.toml @@ -6,19 +6,13 @@ edition = "2018" [dependencies] futures = "0.3.5" -log = "0.4.8" -futures-timer = "3.0.2" -streamunordered = "0.5.1" +log = "0.4.11" polkadot-primitives = { path = "../../../primitives" } -node-primitives = { package = "polkadot-node-primitives", path = "../../primitives" } -parity-scale-codec = "1.3.4" -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } polkadot-node-network-protocol = { path = "../../network/protocol" } [dev-dependencies] -parking_lot = "0.10.0" assert_matches = "1.3.0" sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } diff --git a/node/network/pov-distribution/src/lib.rs b/node/network/pov-distribution/src/lib.rs index 74bd27eb3949..2a6f81361a60 100644 --- a/node/network/pov-distribution/src/lib.rs +++ b/node/network/pov-distribution/src/lib.rs @@ -19,12 +19,13 @@ //! This is a gossip implementation of code that is responsible for distributing PoVs //! among validators. -#![deny(unused_crate_dependencies, unused_results)] +#![deny(unused_crate_dependencies)] #![warn(missing_docs)] use polkadot_primitives::v1::{Hash, PoV, CandidateDescriptor}; use polkadot_subsystem::{ - ActiveLeavesUpdate, OverseerSignal, SubsystemContext, Subsystem, SubsystemResult, FromOverseer, SpawnedSubsystem, + ActiveLeavesUpdate, OverseerSignal, SubsystemContext, Subsystem, SubsystemResult, SubsystemError, + FromOverseer, SpawnedSubsystem, messages::{ PoVDistributionMessage, RuntimeApiMessage, RuntimeApiRequest, AllMessages, NetworkBridgeMessage, }, @@ -615,918 +616,4 @@ impl metrics::Metrics for Metrics { } #[cfg(test)] -mod tests { - use super::*; - use futures::executor; - use polkadot_primitives::v1::BlockData; - use assert_matches::assert_matches; - - fn make_pov(data: Vec) -> PoV { - PoV { block_data: BlockData(data) } - } - - fn make_peer_state(awaited: Vec<(Hash, Vec)>) - -> PeerState - { - PeerState { - awaited: awaited.into_iter().map(|(rp, h)| (rp, h.into_iter().collect())).collect() - } - } - - #[test] - fn distributes_to_those_awaiting_and_completes_local() { - let hash_a: Hash = [0; 32].into(); - let hash_b: Hash = [1; 32].into(); - - let peer_a = PeerId::random(); - let peer_b = PeerId::random(); - let peer_c = PeerId::random(); - - let (pov_send, pov_recv) = oneshot::channel(); - let pov = make_pov(vec![1, 2, 3]); - let pov_hash = pov.hash(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let mut b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - b.fetching.insert(pov_hash, vec![pov_send]); - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - // peer A has hash_a in its view and is awaiting the PoV. - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![pov_hash])]), - ); - - // peer B has hash_a in its view but is not awaiting. - s.insert( - peer_b.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - // peer C doesn't have hash_a in its view but is awaiting the PoV under hash_b. - s.insert( - peer_c.clone(), - make_peer_state(vec![(hash_b, vec![pov_hash])]), - ); - - s - }, - our_view: View(vec![hash_a, hash_b]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - let mut descriptor = CandidateDescriptor::default(); - descriptor.pov_hash = pov_hash; - - executor::block_on(async move { - handle_distribute( - &mut state, - &mut ctx, - hash_a, - descriptor, - Arc::new(pov.clone()), - ).await.unwrap(); - - assert!(!state.peer_state[&peer_a].awaited[&hash_a].contains(&pov_hash)); - assert!(state.peer_state[&peer_c].awaited[&hash_b].contains(&pov_hash)); - - // our local sender also completed - assert_eq!(&*pov_recv.await.unwrap(), &pov); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::SendValidationMessage(peers, message) - ) => { - assert_eq!(peers, vec![peer_a.clone()]); - assert_eq!( - message, - send_pov_message(hash_a, pov_hash, pov.clone()), - ); - } - ) - }); - } - - #[test] - fn we_inform_peers_with_same_view_we_are_awaiting() { - let hash_a: Hash = [0; 32].into(); - let hash_b: Hash = [1; 32].into(); - - let peer_a = PeerId::random(); - let peer_b = PeerId::random(); - - let (pov_send, _) = oneshot::channel(); - let pov = make_pov(vec![1, 2, 3]); - let pov_hash = pov.hash(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - // peer A has hash_a in its view. - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - // peer B doesn't have hash_a in its view. - s.insert( - peer_b.clone(), - make_peer_state(vec![(hash_b, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - let mut descriptor = CandidateDescriptor::default(); - descriptor.pov_hash = pov_hash; - - executor::block_on(async move { - handle_fetch( - &mut state, - &mut ctx, - hash_a, - descriptor, - pov_send, - ).await.unwrap(); - - assert_eq!(state.relay_parent_state[&hash_a].fetching[&pov_hash].len(), 1); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::SendValidationMessage(peers, message) - ) => { - assert_eq!(peers, vec![peer_a.clone()]); - assert_eq!( - message, - awaiting_message(hash_a, vec![pov_hash]), - ); - } - ) - }); - } - - #[test] - fn peer_view_change_leads_to_us_informing() { - let hash_a: Hash = [0; 32].into(); - let hash_b: Hash = [1; 32].into(); - - let peer_a = PeerId::random(); - - let (pov_a_send, _) = oneshot::channel(); - - let pov_a = make_pov(vec![1, 2, 3]); - let pov_a_hash = pov_a.hash(); - - let pov_b = make_pov(vec![4, 5, 6]); - let pov_b_hash = pov_b.hash(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let mut b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - // pov_a is still being fetched, whereas the fetch of pov_b has already - // completed, as implied by the empty vector. - b.fetching.insert(pov_a_hash, vec![pov_a_send]); - b.fetching.insert(pov_b_hash, vec![]); - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - // peer A doesn't yet have hash_a in its view. - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_b, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerViewChange(peer_a.clone(), View(vec![hash_a, hash_b])), - ).await.unwrap(); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::SendValidationMessage(peers, message) - ) => { - assert_eq!(peers, vec![peer_a.clone()]); - assert_eq!( - message, - awaiting_message(hash_a, vec![pov_a_hash]), - ); - } - ) - }); - } - - #[test] - fn peer_complete_fetch_and_is_rewarded() { - let hash_a: Hash = [0; 32].into(); - - let peer_a = PeerId::random(); - let peer_b = PeerId::random(); - - let (pov_send, pov_recv) = oneshot::channel(); - - let pov = make_pov(vec![1, 2, 3]); - let pov_hash = pov.hash(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let mut b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - // pov is being fetched. - b.fetching.insert(pov_hash, vec![pov_send]); - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - // peers A and B are functionally the same. - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - s.insert( - peer_b.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - // Peer A answers our request before peer B. - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - send_pov_message(hash_a, pov_hash, pov.clone()), - ).focus().unwrap(), - ).await.unwrap(); - - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_b.clone(), - send_pov_message(hash_a, pov_hash, pov.clone()), - ).focus().unwrap(), - ).await.unwrap(); - - assert_eq!(&*pov_recv.await.unwrap(), &pov); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, BENEFIT_FRESH_POV); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_b); - assert_eq!(rep, BENEFIT_LATE_POV); - } - ); - }); - } - - #[test] - fn peer_punished_for_sending_bad_pov() { - let hash_a: Hash = [0; 32].into(); - - let peer_a = PeerId::random(); - - let (pov_send, _) = oneshot::channel(); - - let pov = make_pov(vec![1, 2, 3]); - let pov_hash = pov.hash(); - - let bad_pov = make_pov(vec![6, 6, 6]); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let mut b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - // pov is being fetched. - b.fetching.insert(pov_hash, vec![pov_send]); - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - // Peer A answers our request: right relay parent, awaited hash, wrong PoV. - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - send_pov_message(hash_a, pov_hash, bad_pov.clone()), - ).focus().unwrap(), - ).await.unwrap(); - - // didn't complete our sender. - assert_eq!(state.relay_parent_state[&hash_a].fetching[&pov_hash].len(), 1); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, COST_UNEXPECTED_POV); - } - ); - }); - } - - #[test] - fn peer_punished_for_sending_unexpected_pov() { - let hash_a: Hash = [0; 32].into(); - - let peer_a = PeerId::random(); - - let pov = make_pov(vec![1, 2, 3]); - let pov_hash = pov.hash(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - // Peer A answers our request: right relay parent, awaited hash, wrong PoV. - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - send_pov_message(hash_a, pov_hash, pov.clone()), - ).focus().unwrap(), - ).await.unwrap(); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, COST_UNEXPECTED_POV); - } - ); - }); - } - - #[test] - fn peer_punished_for_sending_pov_out_of_our_view() { - let hash_a: Hash = [0; 32].into(); - let hash_b: Hash = [1; 32].into(); - - let peer_a = PeerId::random(); - - let pov = make_pov(vec![1, 2, 3]); - let pov_hash = pov.hash(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - // Peer A answers our request: right relay parent, awaited hash, wrong PoV. - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - send_pov_message(hash_b, pov_hash, pov.clone()), - ).focus().unwrap(), - ).await.unwrap(); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, COST_UNEXPECTED_POV); - } - ); - }); - } - - #[test] - fn peer_reported_for_awaiting_too_much() { - let hash_a: Hash = [0; 32].into(); - - let peer_a = PeerId::random(); - let n_validators = 10; - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators, - }; - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - let max_plausibly_awaited = n_validators * 2; - - // The peer awaits a plausible (albeit unlikely) amount of PoVs. - for i in 0..max_plausibly_awaited { - let pov_hash = make_pov(vec![i as u8; 32]).hash(); - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - awaiting_message(hash_a, vec![pov_hash]), - ).focus().unwrap(), - ).await.unwrap(); - } - - assert_eq!(state.peer_state[&peer_a].awaited[&hash_a].len(), max_plausibly_awaited); - - // The last straw: - let last_pov_hash = make_pov(vec![max_plausibly_awaited as u8; 32]).hash(); - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - awaiting_message(hash_a, vec![last_pov_hash]), - ).focus().unwrap(), - ).await.unwrap(); - - // No more bookkeeping for you! - assert_eq!(state.peer_state[&peer_a].awaited[&hash_a].len(), max_plausibly_awaited); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, COST_APPARENT_FLOOD); - } - ); - }); - } - - #[test] - fn peer_reported_for_awaiting_outside_their_view() { - let hash_a: Hash = [0; 32].into(); - let hash_b: Hash = [1; 32].into(); - - let peer_a = PeerId::random(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - s.insert(hash_a, BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }); - - s.insert(hash_b, BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }); - - s - }, - peer_state: { - let mut s = HashMap::new(); - - // Peer has only hash A in its view. - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a, hash_b]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - let pov_hash = make_pov(vec![1, 2, 3]).hash(); - - // Hash B is in our view but not the peer's - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - awaiting_message(hash_b, vec![pov_hash]), - ).focus().unwrap(), - ).await.unwrap(); - - assert!(state.peer_state[&peer_a].awaited.get(&hash_b).is_none()); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, COST_AWAITED_NOT_IN_VIEW); - } - ); - }); - } - - #[test] - fn peer_reported_for_awaiting_outside_our_view() { - let hash_a: Hash = [0; 32].into(); - let hash_b: Hash = [1; 32].into(); - - let peer_a = PeerId::random(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - s.insert(hash_a, BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }); - - s - }, - peer_state: { - let mut s = HashMap::new(); - - // Peer has hashes A and B in their view. - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![]), (hash_b, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - let pov_hash = make_pov(vec![1, 2, 3]).hash(); - - // Hash B is in peer's view but not ours. - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - awaiting_message(hash_b, vec![pov_hash]), - ).focus().unwrap(), - ).await.unwrap(); - - // Illegal `awaited` is ignored. - assert!(state.peer_state[&peer_a].awaited[&hash_b].is_empty()); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, COST_AWAITED_NOT_IN_VIEW); - } - ); - }); - } - - #[test] - fn peer_complete_fetch_leads_to_us_completing_others() { - let hash_a: Hash = [0; 32].into(); - - let peer_a = PeerId::random(); - let peer_b = PeerId::random(); - - let (pov_send, pov_recv) = oneshot::channel(); - - let pov = make_pov(vec![1, 2, 3]); - let pov_hash = pov.hash(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let mut b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - // pov is being fetched. - b.fetching.insert(pov_hash, vec![pov_send]); - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - // peer B is awaiting peer A's request. - s.insert( - peer_b.clone(), - make_peer_state(vec![(hash_a, vec![pov_hash])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - send_pov_message(hash_a, pov_hash, pov.clone()), - ).focus().unwrap(), - ).await.unwrap(); - - assert_eq!(&*pov_recv.await.unwrap(), &pov); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, BENEFIT_FRESH_POV); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::SendValidationMessage(peers, message) - ) => { - assert_eq!(peers, vec![peer_b.clone()]); - assert_eq!( - message, - send_pov_message(hash_a, pov_hash, pov.clone()), - ); - } - ); - - assert!(!state.peer_state[&peer_b].awaited[&hash_a].contains(&pov_hash)); - }); - } - - #[test] - fn peer_completing_request_no_longer_awaiting() { - let hash_a: Hash = [0; 32].into(); - - let peer_a = PeerId::random(); - - let (pov_send, pov_recv) = oneshot::channel(); - - let pov = make_pov(vec![1, 2, 3]); - let pov_hash = pov.hash(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let mut b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - // pov is being fetched. - b.fetching.insert(pov_hash, vec![pov_send]); - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - // peer A is registered as awaiting. - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![pov_hash])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - send_pov_message(hash_a, pov_hash, pov.clone()), - ).focus().unwrap(), - ).await.unwrap(); - - assert_eq!(&*pov_recv.await.unwrap(), &pov); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, BENEFIT_FRESH_POV); - } - ); - - // We received the PoV from peer A, so we do not consider it awaited by peer A anymore. - assert!(!state.peer_state[&peer_a].awaited[&hash_a].contains(&pov_hash)); - }); - } -} +mod tests; \ No newline at end of file diff --git a/node/network/pov-distribution/src/tests.rs b/node/network/pov-distribution/src/tests.rs new file mode 100644 index 000000000000..bf3a357dd0ab --- /dev/null +++ b/node/network/pov-distribution/src/tests.rs @@ -0,0 +1,913 @@ +use super::*; +use futures::executor; +use polkadot_primitives::v1::BlockData; +use assert_matches::assert_matches; + +fn make_pov(data: Vec) -> PoV { + PoV { block_data: BlockData(data) } +} + +fn make_peer_state(awaited: Vec<(Hash, Vec)>) + -> PeerState +{ + PeerState { + awaited: awaited.into_iter().map(|(rp, h)| (rp, h.into_iter().collect())).collect() + } +} + +#[test] +fn distributes_to_those_awaiting_and_completes_local() { + let hash_a: Hash = [0; 32].into(); + let hash_b: Hash = [1; 32].into(); + + let peer_a = PeerId::random(); + let peer_b = PeerId::random(); + let peer_c = PeerId::random(); + + let (pov_send, pov_recv) = oneshot::channel(); + let pov = make_pov(vec![1, 2, 3]); + let pov_hash = pov.hash(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let mut b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + b.fetching.insert(pov_hash, vec![pov_send]); + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + // peer A has hash_a in its view and is awaiting the PoV. + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![pov_hash])]), + ); + + // peer B has hash_a in its view but is not awaiting. + s.insert( + peer_b.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + // peer C doesn't have hash_a in its view but is awaiting the PoV under hash_b. + s.insert( + peer_c.clone(), + make_peer_state(vec![(hash_b, vec![pov_hash])]), + ); + + s + }, + our_view: View(vec![hash_a, hash_b]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + let mut descriptor = CandidateDescriptor::default(); + descriptor.pov_hash = pov_hash; + + executor::block_on(async move { + handle_distribute( + &mut state, + &mut ctx, + hash_a, + descriptor, + Arc::new(pov.clone()), + ).await.unwrap(); + + assert!(!state.peer_state[&peer_a].awaited[&hash_a].contains(&pov_hash)); + assert!(state.peer_state[&peer_c].awaited[&hash_b].contains(&pov_hash)); + + // our local sender also completed + assert_eq!(&*pov_recv.await.unwrap(), &pov); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::SendValidationMessage(peers, message) + ) => { + assert_eq!(peers, vec![peer_a.clone()]); + assert_eq!( + message, + send_pov_message(hash_a, pov_hash, pov.clone()), + ); + } + ) + }); +} + +#[test] +fn we_inform_peers_with_same_view_we_are_awaiting() { + let hash_a: Hash = [0; 32].into(); + let hash_b: Hash = [1; 32].into(); + + let peer_a = PeerId::random(); + let peer_b = PeerId::random(); + + let (pov_send, _) = oneshot::channel(); + let pov = make_pov(vec![1, 2, 3]); + let pov_hash = pov.hash(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + // peer A has hash_a in its view. + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + // peer B doesn't have hash_a in its view. + s.insert( + peer_b.clone(), + make_peer_state(vec![(hash_b, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + let mut descriptor = CandidateDescriptor::default(); + descriptor.pov_hash = pov_hash; + + executor::block_on(async move { + handle_fetch( + &mut state, + &mut ctx, + hash_a, + descriptor, + pov_send, + ).await.unwrap(); + + assert_eq!(state.relay_parent_state[&hash_a].fetching[&pov_hash].len(), 1); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::SendValidationMessage(peers, message) + ) => { + assert_eq!(peers, vec![peer_a.clone()]); + assert_eq!( + message, + awaiting_message(hash_a, vec![pov_hash]), + ); + } + ) + }); +} + +#[test] +fn peer_view_change_leads_to_us_informing() { + let hash_a: Hash = [0; 32].into(); + let hash_b: Hash = [1; 32].into(); + + let peer_a = PeerId::random(); + + let (pov_a_send, _) = oneshot::channel(); + + let pov_a = make_pov(vec![1, 2, 3]); + let pov_a_hash = pov_a.hash(); + + let pov_b = make_pov(vec![4, 5, 6]); + let pov_b_hash = pov_b.hash(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let mut b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + // pov_a is still being fetched, whereas the fetch of pov_b has already + // completed, as implied by the empty vector. + b.fetching.insert(pov_a_hash, vec![pov_a_send]); + b.fetching.insert(pov_b_hash, vec![]); + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + // peer A doesn't yet have hash_a in its view. + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_b, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerViewChange(peer_a.clone(), View(vec![hash_a, hash_b])), + ).await.unwrap(); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::SendValidationMessage(peers, message) + ) => { + assert_eq!(peers, vec![peer_a.clone()]); + assert_eq!( + message, + awaiting_message(hash_a, vec![pov_a_hash]), + ); + } + ) + }); +} + +#[test] +fn peer_complete_fetch_and_is_rewarded() { + let hash_a: Hash = [0; 32].into(); + + let peer_a = PeerId::random(); + let peer_b = PeerId::random(); + + let (pov_send, pov_recv) = oneshot::channel(); + + let pov = make_pov(vec![1, 2, 3]); + let pov_hash = pov.hash(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let mut b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + // pov is being fetched. + b.fetching.insert(pov_hash, vec![pov_send]); + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + // peers A and B are functionally the same. + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + s.insert( + peer_b.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + // Peer A answers our request before peer B. + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + send_pov_message(hash_a, pov_hash, pov.clone()), + ).focus().unwrap(), + ).await.unwrap(); + + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_b.clone(), + send_pov_message(hash_a, pov_hash, pov.clone()), + ).focus().unwrap(), + ).await.unwrap(); + + assert_eq!(&*pov_recv.await.unwrap(), &pov); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, BENEFIT_FRESH_POV); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_b); + assert_eq!(rep, BENEFIT_LATE_POV); + } + ); + }); +} + +#[test] +fn peer_punished_for_sending_bad_pov() { + let hash_a: Hash = [0; 32].into(); + + let peer_a = PeerId::random(); + + let (pov_send, _) = oneshot::channel(); + + let pov = make_pov(vec![1, 2, 3]); + let pov_hash = pov.hash(); + + let bad_pov = make_pov(vec![6, 6, 6]); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let mut b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + // pov is being fetched. + b.fetching.insert(pov_hash, vec![pov_send]); + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + // Peer A answers our request: right relay parent, awaited hash, wrong PoV. + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + send_pov_message(hash_a, pov_hash, bad_pov.clone()), + ).focus().unwrap(), + ).await.unwrap(); + + // didn't complete our sender. + assert_eq!(state.relay_parent_state[&hash_a].fetching[&pov_hash].len(), 1); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, COST_UNEXPECTED_POV); + } + ); + }); +} + +#[test] +fn peer_punished_for_sending_unexpected_pov() { + let hash_a: Hash = [0; 32].into(); + + let peer_a = PeerId::random(); + + let pov = make_pov(vec![1, 2, 3]); + let pov_hash = pov.hash(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + // Peer A answers our request: right relay parent, awaited hash, wrong PoV. + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + send_pov_message(hash_a, pov_hash, pov.clone()), + ).focus().unwrap(), + ).await.unwrap(); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, COST_UNEXPECTED_POV); + } + ); + }); +} + +#[test] +fn peer_punished_for_sending_pov_out_of_our_view() { + let hash_a: Hash = [0; 32].into(); + let hash_b: Hash = [1; 32].into(); + + let peer_a = PeerId::random(); + + let pov = make_pov(vec![1, 2, 3]); + let pov_hash = pov.hash(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + // Peer A answers our request: right relay parent, awaited hash, wrong PoV. + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + send_pov_message(hash_b, pov_hash, pov.clone()), + ).focus().unwrap(), + ).await.unwrap(); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, COST_UNEXPECTED_POV); + } + ); + }); +} + +#[test] +fn peer_reported_for_awaiting_too_much() { + let hash_a: Hash = [0; 32].into(); + + let peer_a = PeerId::random(); + let n_validators = 10; + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators, + }; + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + let max_plausibly_awaited = n_validators * 2; + + // The peer awaits a plausible (albeit unlikely) amount of PoVs. + for i in 0..max_plausibly_awaited { + let pov_hash = make_pov(vec![i as u8; 32]).hash(); + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + awaiting_message(hash_a, vec![pov_hash]), + ).focus().unwrap(), + ).await.unwrap(); + } + + assert_eq!(state.peer_state[&peer_a].awaited[&hash_a].len(), max_plausibly_awaited); + + // The last straw: + let last_pov_hash = make_pov(vec![max_plausibly_awaited as u8; 32]).hash(); + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + awaiting_message(hash_a, vec![last_pov_hash]), + ).focus().unwrap(), + ).await.unwrap(); + + // No more bookkeeping for you! + assert_eq!(state.peer_state[&peer_a].awaited[&hash_a].len(), max_plausibly_awaited); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, COST_APPARENT_FLOOD); + } + ); + }); +} + +#[test] +fn peer_reported_for_awaiting_outside_their_view() { + let hash_a: Hash = [0; 32].into(); + let hash_b: Hash = [1; 32].into(); + + let peer_a = PeerId::random(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + s.insert(hash_a, BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }); + + s.insert(hash_b, BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }); + + s + }, + peer_state: { + let mut s = HashMap::new(); + + // Peer has only hash A in its view. + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a, hash_b]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + let pov_hash = make_pov(vec![1, 2, 3]).hash(); + + // Hash B is in our view but not the peer's + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + awaiting_message(hash_b, vec![pov_hash]), + ).focus().unwrap(), + ).await.unwrap(); + + assert!(state.peer_state[&peer_a].awaited.get(&hash_b).is_none()); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, COST_AWAITED_NOT_IN_VIEW); + } + ); + }); +} + +#[test] +fn peer_reported_for_awaiting_outside_our_view() { + let hash_a: Hash = [0; 32].into(); + let hash_b: Hash = [1; 32].into(); + + let peer_a = PeerId::random(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + s.insert(hash_a, BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }); + + s + }, + peer_state: { + let mut s = HashMap::new(); + + // Peer has hashes A and B in their view. + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![]), (hash_b, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + let pov_hash = make_pov(vec![1, 2, 3]).hash(); + + // Hash B is in peer's view but not ours. + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + awaiting_message(hash_b, vec![pov_hash]), + ).focus().unwrap(), + ).await.unwrap(); + + // Illegal `awaited` is ignored. + assert!(state.peer_state[&peer_a].awaited[&hash_b].is_empty()); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, COST_AWAITED_NOT_IN_VIEW); + } + ); + }); +} + +#[test] +fn peer_complete_fetch_leads_to_us_completing_others() { + let hash_a: Hash = [0; 32].into(); + + let peer_a = PeerId::random(); + let peer_b = PeerId::random(); + + let (pov_send, pov_recv) = oneshot::channel(); + + let pov = make_pov(vec![1, 2, 3]); + let pov_hash = pov.hash(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let mut b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + // pov is being fetched. + b.fetching.insert(pov_hash, vec![pov_send]); + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + // peer B is awaiting peer A's request. + s.insert( + peer_b.clone(), + make_peer_state(vec![(hash_a, vec![pov_hash])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + send_pov_message(hash_a, pov_hash, pov.clone()), + ).focus().unwrap(), + ).await.unwrap(); + + assert_eq!(&*pov_recv.await.unwrap(), &pov); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, BENEFIT_FRESH_POV); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::SendValidationMessage(peers, message) + ) => { + assert_eq!(peers, vec![peer_b.clone()]); + assert_eq!( + message, + send_pov_message(hash_a, pov_hash, pov.clone()), + ); + } + ); + + assert!(!state.peer_state[&peer_b].awaited[&hash_a].contains(&pov_hash)); + }); +} + +#[test] +fn peer_completing_request_no_longer_awaiting() { + let hash_a: Hash = [0; 32].into(); + + let peer_a = PeerId::random(); + + let (pov_send, pov_recv) = oneshot::channel(); + + let pov = make_pov(vec![1, 2, 3]); + let pov_hash = pov.hash(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let mut b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + // pov is being fetched. + b.fetching.insert(pov_hash, vec![pov_send]); + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + // peer A is registered as awaiting. + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![pov_hash])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + send_pov_message(hash_a, pov_hash, pov.clone()), + ).focus().unwrap(), + ).await.unwrap(); + + assert_eq!(&*pov_recv.await.unwrap(), &pov); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, BENEFIT_FRESH_POV); + } + ); + + // We received the PoV from peer A, so we do not consider it awaited by peer A anymore. + assert!(!state.peer_state[&peer_a].awaited[&hash_a].contains(&pov_hash)); + }); +} From 12293b359c267b21fe8284b1a87435998429dd5f Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 14:24:21 +0100 Subject: [PATCH 47/62] fixup candidate-validation --- Cargo.lock | 2 -- node/core/candidate-validation/Cargo.toml | 4 +--- node/core/candidate-validation/src/lib.rs | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3c1342315a3a..a2526a5b5ec9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4985,7 +4985,6 @@ name = "polkadot-node-core-candidate-validation" version = "0.1.0" dependencies = [ "assert_matches", - "derive_more", "futures 0.3.5", "log 0.4.11", "parity-scale-codec", @@ -4995,7 +4994,6 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-parachain", "polkadot-primitives", - "sp-blockchain", "sp-core", "sp-keyring", ] diff --git a/node/core/candidate-validation/Cargo.toml b/node/core/candidate-validation/Cargo.toml index 77f9712cb8c9..87cb639a3601 100644 --- a/node/core/candidate-validation/Cargo.toml +++ b/node/core/candidate-validation/Cargo.toml @@ -5,11 +5,9 @@ authors = ["Parity Technologies "] edition = "2018" [dependencies] -derive_more = "0.99.9" futures = "0.3.5" -log = "0.4.8" +log = "0.4.11" -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { package = "sp-core", git = "https://github.com/paritytech/substrate", branch = "master" } parity-scale-codec = { version = "1.3.0", default-features = false, features = ["bit-vec", "derive"] } diff --git a/node/core/candidate-validation/src/lib.rs b/node/core/candidate-validation/src/lib.rs index 083c2ab3f14f..632e9b55774d 100644 --- a/node/core/candidate-validation/src/lib.rs +++ b/node/core/candidate-validation/src/lib.rs @@ -24,7 +24,7 @@ #![warn(missing_docs)] use polkadot_subsystem::{ - Subsystem, SubsystemContext, SpawnedSubsystem, SubsystemResult, + Subsystem, SubsystemContext, SpawnedSubsystem, SubsystemResult, SubsystemError, FromOverseer, OverseerSignal, messages::{ AllMessages, CandidateValidationMessage, RuntimeApiMessage, From 5297f8cdd277512ebcc38f8397934b2c4e339f21 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 14:36:15 +0100 Subject: [PATCH 48/62] chore: tabs vs spaces --- node/network/pov-distribution/src/tests.rs | 1708 ++++++++++---------- 1 file changed, 854 insertions(+), 854 deletions(-) diff --git a/node/network/pov-distribution/src/tests.rs b/node/network/pov-distribution/src/tests.rs index bf3a357dd0ab..65f32ffe8810 100644 --- a/node/network/pov-distribution/src/tests.rs +++ b/node/network/pov-distribution/src/tests.rs @@ -4,910 +4,910 @@ use polkadot_primitives::v1::BlockData; use assert_matches::assert_matches; fn make_pov(data: Vec) -> PoV { - PoV { block_data: BlockData(data) } + PoV { block_data: BlockData(data) } } fn make_peer_state(awaited: Vec<(Hash, Vec)>) - -> PeerState + -> PeerState { - PeerState { - awaited: awaited.into_iter().map(|(rp, h)| (rp, h.into_iter().collect())).collect() - } + PeerState { + awaited: awaited.into_iter().map(|(rp, h)| (rp, h.into_iter().collect())).collect() + } } #[test] fn distributes_to_those_awaiting_and_completes_local() { - let hash_a: Hash = [0; 32].into(); - let hash_b: Hash = [1; 32].into(); - - let peer_a = PeerId::random(); - let peer_b = PeerId::random(); - let peer_c = PeerId::random(); - - let (pov_send, pov_recv) = oneshot::channel(); - let pov = make_pov(vec![1, 2, 3]); - let pov_hash = pov.hash(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let mut b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - b.fetching.insert(pov_hash, vec![pov_send]); - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - // peer A has hash_a in its view and is awaiting the PoV. - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![pov_hash])]), - ); - - // peer B has hash_a in its view but is not awaiting. - s.insert( - peer_b.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - // peer C doesn't have hash_a in its view but is awaiting the PoV under hash_b. - s.insert( - peer_c.clone(), - make_peer_state(vec![(hash_b, vec![pov_hash])]), - ); - - s - }, - our_view: View(vec![hash_a, hash_b]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - let mut descriptor = CandidateDescriptor::default(); - descriptor.pov_hash = pov_hash; - - executor::block_on(async move { - handle_distribute( - &mut state, - &mut ctx, - hash_a, - descriptor, - Arc::new(pov.clone()), - ).await.unwrap(); - - assert!(!state.peer_state[&peer_a].awaited[&hash_a].contains(&pov_hash)); - assert!(state.peer_state[&peer_c].awaited[&hash_b].contains(&pov_hash)); - - // our local sender also completed - assert_eq!(&*pov_recv.await.unwrap(), &pov); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::SendValidationMessage(peers, message) - ) => { - assert_eq!(peers, vec![peer_a.clone()]); - assert_eq!( - message, - send_pov_message(hash_a, pov_hash, pov.clone()), - ); - } - ) - }); + let hash_a: Hash = [0; 32].into(); + let hash_b: Hash = [1; 32].into(); + + let peer_a = PeerId::random(); + let peer_b = PeerId::random(); + let peer_c = PeerId::random(); + + let (pov_send, pov_recv) = oneshot::channel(); + let pov = make_pov(vec![1, 2, 3]); + let pov_hash = pov.hash(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let mut b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + b.fetching.insert(pov_hash, vec![pov_send]); + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + // peer A has hash_a in its view and is awaiting the PoV. + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![pov_hash])]), + ); + + // peer B has hash_a in its view but is not awaiting. + s.insert( + peer_b.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + // peer C doesn't have hash_a in its view but is awaiting the PoV under hash_b. + s.insert( + peer_c.clone(), + make_peer_state(vec![(hash_b, vec![pov_hash])]), + ); + + s + }, + our_view: View(vec![hash_a, hash_b]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + let mut descriptor = CandidateDescriptor::default(); + descriptor.pov_hash = pov_hash; + + executor::block_on(async move { + handle_distribute( + &mut state, + &mut ctx, + hash_a, + descriptor, + Arc::new(pov.clone()), + ).await.unwrap(); + + assert!(!state.peer_state[&peer_a].awaited[&hash_a].contains(&pov_hash)); + assert!(state.peer_state[&peer_c].awaited[&hash_b].contains(&pov_hash)); + + // our local sender also completed + assert_eq!(&*pov_recv.await.unwrap(), &pov); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::SendValidationMessage(peers, message) + ) => { + assert_eq!(peers, vec![peer_a.clone()]); + assert_eq!( + message, + send_pov_message(hash_a, pov_hash, pov.clone()), + ); + } + ) + }); } #[test] fn we_inform_peers_with_same_view_we_are_awaiting() { - let hash_a: Hash = [0; 32].into(); - let hash_b: Hash = [1; 32].into(); - - let peer_a = PeerId::random(); - let peer_b = PeerId::random(); - - let (pov_send, _) = oneshot::channel(); - let pov = make_pov(vec![1, 2, 3]); - let pov_hash = pov.hash(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - // peer A has hash_a in its view. - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - // peer B doesn't have hash_a in its view. - s.insert( - peer_b.clone(), - make_peer_state(vec![(hash_b, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - let mut descriptor = CandidateDescriptor::default(); - descriptor.pov_hash = pov_hash; - - executor::block_on(async move { - handle_fetch( - &mut state, - &mut ctx, - hash_a, - descriptor, - pov_send, - ).await.unwrap(); - - assert_eq!(state.relay_parent_state[&hash_a].fetching[&pov_hash].len(), 1); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::SendValidationMessage(peers, message) - ) => { - assert_eq!(peers, vec![peer_a.clone()]); - assert_eq!( - message, - awaiting_message(hash_a, vec![pov_hash]), - ); - } - ) - }); + let hash_a: Hash = [0; 32].into(); + let hash_b: Hash = [1; 32].into(); + + let peer_a = PeerId::random(); + let peer_b = PeerId::random(); + + let (pov_send, _) = oneshot::channel(); + let pov = make_pov(vec![1, 2, 3]); + let pov_hash = pov.hash(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + // peer A has hash_a in its view. + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + // peer B doesn't have hash_a in its view. + s.insert( + peer_b.clone(), + make_peer_state(vec![(hash_b, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + let mut descriptor = CandidateDescriptor::default(); + descriptor.pov_hash = pov_hash; + + executor::block_on(async move { + handle_fetch( + &mut state, + &mut ctx, + hash_a, + descriptor, + pov_send, + ).await.unwrap(); + + assert_eq!(state.relay_parent_state[&hash_a].fetching[&pov_hash].len(), 1); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::SendValidationMessage(peers, message) + ) => { + assert_eq!(peers, vec![peer_a.clone()]); + assert_eq!( + message, + awaiting_message(hash_a, vec![pov_hash]), + ); + } + ) + }); } #[test] fn peer_view_change_leads_to_us_informing() { - let hash_a: Hash = [0; 32].into(); - let hash_b: Hash = [1; 32].into(); - - let peer_a = PeerId::random(); - - let (pov_a_send, _) = oneshot::channel(); - - let pov_a = make_pov(vec![1, 2, 3]); - let pov_a_hash = pov_a.hash(); - - let pov_b = make_pov(vec![4, 5, 6]); - let pov_b_hash = pov_b.hash(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let mut b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - // pov_a is still being fetched, whereas the fetch of pov_b has already - // completed, as implied by the empty vector. - b.fetching.insert(pov_a_hash, vec![pov_a_send]); - b.fetching.insert(pov_b_hash, vec![]); - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - // peer A doesn't yet have hash_a in its view. - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_b, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerViewChange(peer_a.clone(), View(vec![hash_a, hash_b])), - ).await.unwrap(); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::SendValidationMessage(peers, message) - ) => { - assert_eq!(peers, vec![peer_a.clone()]); - assert_eq!( - message, - awaiting_message(hash_a, vec![pov_a_hash]), - ); - } - ) - }); + let hash_a: Hash = [0; 32].into(); + let hash_b: Hash = [1; 32].into(); + + let peer_a = PeerId::random(); + + let (pov_a_send, _) = oneshot::channel(); + + let pov_a = make_pov(vec![1, 2, 3]); + let pov_a_hash = pov_a.hash(); + + let pov_b = make_pov(vec![4, 5, 6]); + let pov_b_hash = pov_b.hash(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let mut b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + // pov_a is still being fetched, whereas the fetch of pov_b has already + // completed, as implied by the empty vector. + b.fetching.insert(pov_a_hash, vec![pov_a_send]); + b.fetching.insert(pov_b_hash, vec![]); + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + // peer A doesn't yet have hash_a in its view. + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_b, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerViewChange(peer_a.clone(), View(vec![hash_a, hash_b])), + ).await.unwrap(); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::SendValidationMessage(peers, message) + ) => { + assert_eq!(peers, vec![peer_a.clone()]); + assert_eq!( + message, + awaiting_message(hash_a, vec![pov_a_hash]), + ); + } + ) + }); } #[test] fn peer_complete_fetch_and_is_rewarded() { - let hash_a: Hash = [0; 32].into(); - - let peer_a = PeerId::random(); - let peer_b = PeerId::random(); - - let (pov_send, pov_recv) = oneshot::channel(); - - let pov = make_pov(vec![1, 2, 3]); - let pov_hash = pov.hash(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let mut b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - // pov is being fetched. - b.fetching.insert(pov_hash, vec![pov_send]); - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - // peers A and B are functionally the same. - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - s.insert( - peer_b.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - // Peer A answers our request before peer B. - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - send_pov_message(hash_a, pov_hash, pov.clone()), - ).focus().unwrap(), - ).await.unwrap(); - - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_b.clone(), - send_pov_message(hash_a, pov_hash, pov.clone()), - ).focus().unwrap(), - ).await.unwrap(); - - assert_eq!(&*pov_recv.await.unwrap(), &pov); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, BENEFIT_FRESH_POV); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_b); - assert_eq!(rep, BENEFIT_LATE_POV); - } - ); - }); + let hash_a: Hash = [0; 32].into(); + + let peer_a = PeerId::random(); + let peer_b = PeerId::random(); + + let (pov_send, pov_recv) = oneshot::channel(); + + let pov = make_pov(vec![1, 2, 3]); + let pov_hash = pov.hash(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let mut b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + // pov is being fetched. + b.fetching.insert(pov_hash, vec![pov_send]); + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + // peers A and B are functionally the same. + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + s.insert( + peer_b.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + // Peer A answers our request before peer B. + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + send_pov_message(hash_a, pov_hash, pov.clone()), + ).focus().unwrap(), + ).await.unwrap(); + + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_b.clone(), + send_pov_message(hash_a, pov_hash, pov.clone()), + ).focus().unwrap(), + ).await.unwrap(); + + assert_eq!(&*pov_recv.await.unwrap(), &pov); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, BENEFIT_FRESH_POV); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_b); + assert_eq!(rep, BENEFIT_LATE_POV); + } + ); + }); } #[test] fn peer_punished_for_sending_bad_pov() { - let hash_a: Hash = [0; 32].into(); - - let peer_a = PeerId::random(); - - let (pov_send, _) = oneshot::channel(); - - let pov = make_pov(vec![1, 2, 3]); - let pov_hash = pov.hash(); - - let bad_pov = make_pov(vec![6, 6, 6]); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let mut b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - // pov is being fetched. - b.fetching.insert(pov_hash, vec![pov_send]); - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - // Peer A answers our request: right relay parent, awaited hash, wrong PoV. - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - send_pov_message(hash_a, pov_hash, bad_pov.clone()), - ).focus().unwrap(), - ).await.unwrap(); - - // didn't complete our sender. - assert_eq!(state.relay_parent_state[&hash_a].fetching[&pov_hash].len(), 1); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, COST_UNEXPECTED_POV); - } - ); - }); + let hash_a: Hash = [0; 32].into(); + + let peer_a = PeerId::random(); + + let (pov_send, _) = oneshot::channel(); + + let pov = make_pov(vec![1, 2, 3]); + let pov_hash = pov.hash(); + + let bad_pov = make_pov(vec![6, 6, 6]); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let mut b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + // pov is being fetched. + b.fetching.insert(pov_hash, vec![pov_send]); + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + // Peer A answers our request: right relay parent, awaited hash, wrong PoV. + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + send_pov_message(hash_a, pov_hash, bad_pov.clone()), + ).focus().unwrap(), + ).await.unwrap(); + + // didn't complete our sender. + assert_eq!(state.relay_parent_state[&hash_a].fetching[&pov_hash].len(), 1); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, COST_UNEXPECTED_POV); + } + ); + }); } #[test] fn peer_punished_for_sending_unexpected_pov() { - let hash_a: Hash = [0; 32].into(); - - let peer_a = PeerId::random(); - - let pov = make_pov(vec![1, 2, 3]); - let pov_hash = pov.hash(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - // Peer A answers our request: right relay parent, awaited hash, wrong PoV. - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - send_pov_message(hash_a, pov_hash, pov.clone()), - ).focus().unwrap(), - ).await.unwrap(); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, COST_UNEXPECTED_POV); - } - ); - }); + let hash_a: Hash = [0; 32].into(); + + let peer_a = PeerId::random(); + + let pov = make_pov(vec![1, 2, 3]); + let pov_hash = pov.hash(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + // Peer A answers our request: right relay parent, awaited hash, wrong PoV. + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + send_pov_message(hash_a, pov_hash, pov.clone()), + ).focus().unwrap(), + ).await.unwrap(); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, COST_UNEXPECTED_POV); + } + ); + }); } #[test] fn peer_punished_for_sending_pov_out_of_our_view() { - let hash_a: Hash = [0; 32].into(); - let hash_b: Hash = [1; 32].into(); - - let peer_a = PeerId::random(); - - let pov = make_pov(vec![1, 2, 3]); - let pov_hash = pov.hash(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - // Peer A answers our request: right relay parent, awaited hash, wrong PoV. - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - send_pov_message(hash_b, pov_hash, pov.clone()), - ).focus().unwrap(), - ).await.unwrap(); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, COST_UNEXPECTED_POV); - } - ); - }); + let hash_a: Hash = [0; 32].into(); + let hash_b: Hash = [1; 32].into(); + + let peer_a = PeerId::random(); + + let pov = make_pov(vec![1, 2, 3]); + let pov_hash = pov.hash(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + // Peer A answers our request: right relay parent, awaited hash, wrong PoV. + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + send_pov_message(hash_b, pov_hash, pov.clone()), + ).focus().unwrap(), + ).await.unwrap(); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, COST_UNEXPECTED_POV); + } + ); + }); } #[test] fn peer_reported_for_awaiting_too_much() { - let hash_a: Hash = [0; 32].into(); - - let peer_a = PeerId::random(); - let n_validators = 10; - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators, - }; - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - let max_plausibly_awaited = n_validators * 2; - - // The peer awaits a plausible (albeit unlikely) amount of PoVs. - for i in 0..max_plausibly_awaited { - let pov_hash = make_pov(vec![i as u8; 32]).hash(); - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - awaiting_message(hash_a, vec![pov_hash]), - ).focus().unwrap(), - ).await.unwrap(); - } - - assert_eq!(state.peer_state[&peer_a].awaited[&hash_a].len(), max_plausibly_awaited); - - // The last straw: - let last_pov_hash = make_pov(vec![max_plausibly_awaited as u8; 32]).hash(); - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - awaiting_message(hash_a, vec![last_pov_hash]), - ).focus().unwrap(), - ).await.unwrap(); - - // No more bookkeeping for you! - assert_eq!(state.peer_state[&peer_a].awaited[&hash_a].len(), max_plausibly_awaited); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, COST_APPARENT_FLOOD); - } - ); - }); + let hash_a: Hash = [0; 32].into(); + + let peer_a = PeerId::random(); + let n_validators = 10; + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators, + }; + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + let max_plausibly_awaited = n_validators * 2; + + // The peer awaits a plausible (albeit unlikely) amount of PoVs. + for i in 0..max_plausibly_awaited { + let pov_hash = make_pov(vec![i as u8; 32]).hash(); + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + awaiting_message(hash_a, vec![pov_hash]), + ).focus().unwrap(), + ).await.unwrap(); + } + + assert_eq!(state.peer_state[&peer_a].awaited[&hash_a].len(), max_plausibly_awaited); + + // The last straw: + let last_pov_hash = make_pov(vec![max_plausibly_awaited as u8; 32]).hash(); + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + awaiting_message(hash_a, vec![last_pov_hash]), + ).focus().unwrap(), + ).await.unwrap(); + + // No more bookkeeping for you! + assert_eq!(state.peer_state[&peer_a].awaited[&hash_a].len(), max_plausibly_awaited); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, COST_APPARENT_FLOOD); + } + ); + }); } #[test] fn peer_reported_for_awaiting_outside_their_view() { - let hash_a: Hash = [0; 32].into(); - let hash_b: Hash = [1; 32].into(); - - let peer_a = PeerId::random(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - s.insert(hash_a, BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }); - - s.insert(hash_b, BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }); - - s - }, - peer_state: { - let mut s = HashMap::new(); - - // Peer has only hash A in its view. - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a, hash_b]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - let pov_hash = make_pov(vec![1, 2, 3]).hash(); - - // Hash B is in our view but not the peer's - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - awaiting_message(hash_b, vec![pov_hash]), - ).focus().unwrap(), - ).await.unwrap(); - - assert!(state.peer_state[&peer_a].awaited.get(&hash_b).is_none()); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, COST_AWAITED_NOT_IN_VIEW); - } - ); - }); + let hash_a: Hash = [0; 32].into(); + let hash_b: Hash = [1; 32].into(); + + let peer_a = PeerId::random(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + s.insert(hash_a, BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }); + + s.insert(hash_b, BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }); + + s + }, + peer_state: { + let mut s = HashMap::new(); + + // Peer has only hash A in its view. + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a, hash_b]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + let pov_hash = make_pov(vec![1, 2, 3]).hash(); + + // Hash B is in our view but not the peer's + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + awaiting_message(hash_b, vec![pov_hash]), + ).focus().unwrap(), + ).await.unwrap(); + + assert!(state.peer_state[&peer_a].awaited.get(&hash_b).is_none()); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, COST_AWAITED_NOT_IN_VIEW); + } + ); + }); } #[test] fn peer_reported_for_awaiting_outside_our_view() { - let hash_a: Hash = [0; 32].into(); - let hash_b: Hash = [1; 32].into(); - - let peer_a = PeerId::random(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - s.insert(hash_a, BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }); - - s - }, - peer_state: { - let mut s = HashMap::new(); - - // Peer has hashes A and B in their view. - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![]), (hash_b, vec![])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - let pov_hash = make_pov(vec![1, 2, 3]).hash(); - - // Hash B is in peer's view but not ours. - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - awaiting_message(hash_b, vec![pov_hash]), - ).focus().unwrap(), - ).await.unwrap(); - - // Illegal `awaited` is ignored. - assert!(state.peer_state[&peer_a].awaited[&hash_b].is_empty()); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, COST_AWAITED_NOT_IN_VIEW); - } - ); - }); + let hash_a: Hash = [0; 32].into(); + let hash_b: Hash = [1; 32].into(); + + let peer_a = PeerId::random(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + s.insert(hash_a, BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }); + + s + }, + peer_state: { + let mut s = HashMap::new(); + + // Peer has hashes A and B in their view. + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![]), (hash_b, vec![])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + let pov_hash = make_pov(vec![1, 2, 3]).hash(); + + // Hash B is in peer's view but not ours. + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + awaiting_message(hash_b, vec![pov_hash]), + ).focus().unwrap(), + ).await.unwrap(); + + // Illegal `awaited` is ignored. + assert!(state.peer_state[&peer_a].awaited[&hash_b].is_empty()); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, COST_AWAITED_NOT_IN_VIEW); + } + ); + }); } #[test] fn peer_complete_fetch_leads_to_us_completing_others() { - let hash_a: Hash = [0; 32].into(); - - let peer_a = PeerId::random(); - let peer_b = PeerId::random(); - - let (pov_send, pov_recv) = oneshot::channel(); - - let pov = make_pov(vec![1, 2, 3]); - let pov_hash = pov.hash(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let mut b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - // pov is being fetched. - b.fetching.insert(pov_hash, vec![pov_send]); - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![])]), - ); - - // peer B is awaiting peer A's request. - s.insert( - peer_b.clone(), - make_peer_state(vec![(hash_a, vec![pov_hash])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - send_pov_message(hash_a, pov_hash, pov.clone()), - ).focus().unwrap(), - ).await.unwrap(); - - assert_eq!(&*pov_recv.await.unwrap(), &pov); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, BENEFIT_FRESH_POV); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::SendValidationMessage(peers, message) - ) => { - assert_eq!(peers, vec![peer_b.clone()]); - assert_eq!( - message, - send_pov_message(hash_a, pov_hash, pov.clone()), - ); - } - ); - - assert!(!state.peer_state[&peer_b].awaited[&hash_a].contains(&pov_hash)); - }); + let hash_a: Hash = [0; 32].into(); + + let peer_a = PeerId::random(); + let peer_b = PeerId::random(); + + let (pov_send, pov_recv) = oneshot::channel(); + + let pov = make_pov(vec![1, 2, 3]); + let pov_hash = pov.hash(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let mut b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + // pov is being fetched. + b.fetching.insert(pov_hash, vec![pov_send]); + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![])]), + ); + + // peer B is awaiting peer A's request. + s.insert( + peer_b.clone(), + make_peer_state(vec![(hash_a, vec![pov_hash])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + send_pov_message(hash_a, pov_hash, pov.clone()), + ).focus().unwrap(), + ).await.unwrap(); + + assert_eq!(&*pov_recv.await.unwrap(), &pov); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, BENEFIT_FRESH_POV); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::SendValidationMessage(peers, message) + ) => { + assert_eq!(peers, vec![peer_b.clone()]); + assert_eq!( + message, + send_pov_message(hash_a, pov_hash, pov.clone()), + ); + } + ); + + assert!(!state.peer_state[&peer_b].awaited[&hash_a].contains(&pov_hash)); + }); } #[test] fn peer_completing_request_no_longer_awaiting() { - let hash_a: Hash = [0; 32].into(); - - let peer_a = PeerId::random(); - - let (pov_send, pov_recv) = oneshot::channel(); - - let pov = make_pov(vec![1, 2, 3]); - let pov_hash = pov.hash(); - - let mut state = State { - relay_parent_state: { - let mut s = HashMap::new(); - let mut b = BlockBasedState { - known: HashMap::new(), - fetching: HashMap::new(), - n_validators: 10, - }; - - // pov is being fetched. - b.fetching.insert(pov_hash, vec![pov_send]); - - s.insert(hash_a, b); - s - }, - peer_state: { - let mut s = HashMap::new(); - - // peer A is registered as awaiting. - s.insert( - peer_a.clone(), - make_peer_state(vec![(hash_a, vec![pov_hash])]), - ); - - s - }, - our_view: View(vec![hash_a]), - metrics: Default::default(), - }; - - let pool = sp_core::testing::TaskExecutor::new(); - let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); - - executor::block_on(async move { - handle_network_update( - &mut state, - &mut ctx, - NetworkBridgeEvent::PeerMessage( - peer_a.clone(), - send_pov_message(hash_a, pov_hash, pov.clone()), - ).focus().unwrap(), - ).await.unwrap(); - - assert_eq!(&*pov_recv.await.unwrap(), &pov); - - assert_matches!( - handle.recv().await, - AllMessages::NetworkBridge( - NetworkBridgeMessage::ReportPeer(peer, rep) - ) => { - assert_eq!(peer, peer_a); - assert_eq!(rep, BENEFIT_FRESH_POV); - } - ); - - // We received the PoV from peer A, so we do not consider it awaited by peer A anymore. - assert!(!state.peer_state[&peer_a].awaited[&hash_a].contains(&pov_hash)); - }); + let hash_a: Hash = [0; 32].into(); + + let peer_a = PeerId::random(); + + let (pov_send, pov_recv) = oneshot::channel(); + + let pov = make_pov(vec![1, 2, 3]); + let pov_hash = pov.hash(); + + let mut state = State { + relay_parent_state: { + let mut s = HashMap::new(); + let mut b = BlockBasedState { + known: HashMap::new(), + fetching: HashMap::new(), + n_validators: 10, + }; + + // pov is being fetched. + b.fetching.insert(pov_hash, vec![pov_send]); + + s.insert(hash_a, b); + s + }, + peer_state: { + let mut s = HashMap::new(); + + // peer A is registered as awaiting. + s.insert( + peer_a.clone(), + make_peer_state(vec![(hash_a, vec![pov_hash])]), + ); + + s + }, + our_view: View(vec![hash_a]), + metrics: Default::default(), + }; + + let pool = sp_core::testing::TaskExecutor::new(); + let (mut ctx, mut handle) = polkadot_node_subsystem_test_helpers::make_subsystem_context(pool); + + executor::block_on(async move { + handle_network_update( + &mut state, + &mut ctx, + NetworkBridgeEvent::PeerMessage( + peer_a.clone(), + send_pov_message(hash_a, pov_hash, pov.clone()), + ).focus().unwrap(), + ).await.unwrap(); + + assert_eq!(&*pov_recv.await.unwrap(), &pov); + + assert_matches!( + handle.recv().await, + AllMessages::NetworkBridge( + NetworkBridgeMessage::ReportPeer(peer, rep) + ) => { + assert_eq!(peer, peer_a); + assert_eq!(rep, BENEFIT_FRESH_POV); + } + ); + + // We received the PoV from peer A, so we do not consider it awaited by peer A anymore. + assert!(!state.peer_state[&peer_a].awaited[&hash_a].contains(&pov_hash)); + }); } From e358347da67d5835427bff45aef267c908f3032a Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 14:45:45 +0100 Subject: [PATCH 49/62] fixup candidate selection --- Cargo.lock | 1 + node/core/candidate-selection/Cargo.toml | 3 ++- node/core/candidate-selection/src/lib.rs | 17 ++++++++--------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a2526a5b5ec9..5103b05c9c5b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4978,6 +4978,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "sp-core", + "thiserror", ] [[package]] diff --git a/node/core/candidate-selection/Cargo.toml b/node/core/candidate-selection/Cargo.toml index e58c53cffc67..071f83d53c4c 100644 --- a/node/core/candidate-selection/Cargo.toml +++ b/node/core/candidate-selection/Cargo.toml @@ -6,7 +6,8 @@ edition = "2018" [dependencies] futures = "0.3.5" -log = "0.4.8" +log = "0.4.11" +thiserror = "1.0.21" polkadot-primitives = { path = "../../../primitives" } polkadot-node-primitives = { path = "../../primitives" } polkadot-node-subsystem = { path = "../../subsystem" } diff --git a/node/core/candidate-selection/src/lib.rs b/node/core/candidate-selection/src/lib.rs index eb5c63565e92..1e8cf4900221 100644 --- a/node/core/candidate-selection/src/lib.rs +++ b/node/core/candidate-selection/src/lib.rs @@ -120,15 +120,15 @@ impl TryFrom for FromJob { #[derive(Debug, Error)] enum Error { #[error(transparent)] - Sending(mpsc::SendError), + Sending(#[from] mpsc::SendError), #[error(transparent)] - Util(util::Error), + Util(#[from] util::Error), #[error(transparent)] - OneshotRecv(oneshot::Canceled), + OneshotRecv(#[from] oneshot::Canceled), #[error(transparent)] - ChainApi(ChainApiError), + ChainApi(#[from] ChainApiError), #[error(transparent)] - Runtime(RuntimeApiError), + Runtime(#[from] RuntimeApiError), } impl JobTrait for CandidateSelectionJob { @@ -150,14 +150,13 @@ impl JobTrait for CandidateSelectionJob { receiver: mpsc::Receiver, sender: mpsc::Sender, ) -> Pin> + Send>> { - async move { + Box::pin(async move { let job = CandidateSelectionJob::new(metrics, sender, receiver); // it isn't necessary to break run_loop into its own function, // but it's convenient to separate the concerns in this way - job.run_loop().await.map_err(|e| SubsystemError::with_origin(NAME, e)) - } - .boxed() + job.run_loop().await + }) } } From b6b436e1eee575f285548a707b69cf4504fa2343 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 14:50:23 +0100 Subject: [PATCH 50/62] fixup availability distribution --- Cargo.lock | 2 -- node/network/availability-distribution/Cargo.toml | 2 -- node/network/availability-distribution/src/lib.rs | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5103b05c9c5b..c5f4b80401b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4789,7 +4789,6 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.11.0", "polkadot-erasure-coding", - "polkadot-network-bridge", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", @@ -4801,7 +4800,6 @@ dependencies = [ "sp-core", "sp-keyring", "sp-keystore", - "streamunordered", "thiserror", ] diff --git a/node/network/availability-distribution/Cargo.toml b/node/network/availability-distribution/Cargo.toml index de80af70afaf..234362ed0f80 100644 --- a/node/network/availability-distribution/Cargo.toml +++ b/node/network/availability-distribution/Cargo.toml @@ -7,12 +7,10 @@ edition = "2018" [dependencies] futures = "0.3.5" log = "0.4.11" -streamunordered = "0.5.1" codec = { package="parity-scale-codec", version = "1.3.4", features = ["std"] } polkadot-primitives = { path = "../../../primitives" } polkadot-erasure-coding = { path = "../../../erasure-coding" } polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } -polkadot-network-bridge = { path = "../../network/bridge" } polkadot-node-network-protocol = { path = "../../network/protocol" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", features = ["std"] } diff --git a/node/network/availability-distribution/src/lib.rs b/node/network/availability-distribution/src/lib.rs index 8dfcff4a7dfb..7a53452ef118 100644 --- a/node/network/availability-distribution/src/lib.rs +++ b/node/network/availability-distribution/src/lib.rs @@ -22,7 +22,7 @@ //! peers. Verified in this context means, the erasure chunks contained merkle proof //! is checked. -#![deny(unused_crate_dependencies, unused_results, unused_qualifications)] +#![deny(unused_crate_dependencies, unused_qualifications)] use codec::{Decode, Encode}; use futures::{channel::oneshot, FutureExt, TryFutureExt}; From 36cbf66ba561da9db87668e098abd3e9cf257ae5 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 14:52:24 +0100 Subject: [PATCH 51/62] fixup runtime-api --- Cargo.lock | 2 -- node/core/runtime-api/Cargo.toml | 2 -- node/core/runtime-api/src/lib.rs | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c5f4b80401b7..0b8a2659cb79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5058,13 +5058,11 @@ name = "polkadot-node-core-runtime-api" version = "0.1.0" dependencies = [ "futures 0.3.5", - "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", "polkadot-node-subsystem-util", "polkadot-primitives", "sp-api", - "sp-blockchain", "sp-core", ] diff --git a/node/core/runtime-api/Cargo.toml b/node/core/runtime-api/Cargo.toml index 0a3a5015a4be..81cf95410976 100644 --- a/node/core/runtime-api/Cargo.toml +++ b/node/core/runtime-api/Cargo.toml @@ -7,10 +7,8 @@ edition = "2018" [dependencies] futures = "0.3.5" sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-primitives = { path = "../../../primitives" } -polkadot-node-primitives = { path = "../../primitives" } polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } diff --git a/node/core/runtime-api/src/lib.rs b/node/core/runtime-api/src/lib.rs index 2efcb29ff3ac..2f568673cd15 100644 --- a/node/core/runtime-api/src/lib.rs +++ b/node/core/runtime-api/src/lib.rs @@ -19,7 +19,7 @@ //! This provides a clean, ownerless wrapper around the parachain-related runtime APIs. This crate //! can also be used to cache responses from heavy runtime APIs. -#![deny(unused_crate_dependencies, unused_results)] +#![deny(unused_crate_dependencies)] #![warn(missing_docs)] use polkadot_subsystem::{ From acdcc3bbada9cfcf9bef1b70aaa833ffb26fae6a Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 14:54:24 +0100 Subject: [PATCH 52/62] fixup statement-distribution --- Cargo.lock | 5 ----- node/network/statement-distribution/Cargo.toml | 7 +------ node/network/statement-distribution/src/lib.rs | 2 +- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0b8a2659cb79..eaa571fe0a3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5507,11 +5507,8 @@ dependencies = [ "arrayvec 0.5.1", "assert_matches", "futures 0.3.5", - "futures-timer 3.0.2", "indexmap", "log 0.4.11", - "parity-scale-codec", - "parking_lot 0.10.2", "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -5523,9 +5520,7 @@ dependencies = [ "sp-core", "sp-keyring", "sp-keystore", - "sp-runtime", "sp-staking", - "streamunordered", ] [[package]] diff --git a/node/network/statement-distribution/Cargo.toml b/node/network/statement-distribution/Cargo.toml index 74baa9ad6e37..fa0b3786d014 100644 --- a/node/network/statement-distribution/Cargo.toml +++ b/node/network/statement-distribution/Cargo.toml @@ -7,13 +7,9 @@ edition = "2018" [dependencies] futures = "0.3.5" -log = "0.4.8" -futures-timer = "3.0.2" -streamunordered = "0.5.1" +log = "0.4.11" polkadot-primitives = { path = "../../../primitives" } node-primitives = { package = "polkadot-node-primitives", path = "../../primitives" } -parity-scale-codec = "1.3.4" -sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-staking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } @@ -22,7 +18,6 @@ arrayvec = "0.5.1" indexmap = "1.4.0" [dev-dependencies] -parking_lot = "0.10.0" polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } assert_matches = "1.3.0" sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/network/statement-distribution/src/lib.rs b/node/network/statement-distribution/src/lib.rs index 2d86866ae2ef..c294776dd2c3 100644 --- a/node/network/statement-distribution/src/lib.rs +++ b/node/network/statement-distribution/src/lib.rs @@ -19,7 +19,7 @@ //! This is responsible for distributing signed statements about candidate //! validity amongst validators. -#![deny(unused_crate_dependencies, unused_results)] +#![deny(unused_crate_dependencies)] #![warn(missing_docs)] use polkadot_subsystem::{ From 808683592fa90445f7e7859511de104a07ebec80 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 15:32:48 +0100 Subject: [PATCH 53/62] fixup provisioner --- Cargo.lock | 2 - node/core/provisioner/Cargo.toml | 2 - node/core/provisioner/src/lib.rs | 380 +---------------------------- node/core/provisioner/src/tests.rs | 377 ++++++++++++++++++++++++++++ 4 files changed, 378 insertions(+), 383 deletions(-) create mode 100644 node/core/provisioner/src/tests.rs diff --git a/Cargo.lock b/Cargo.lock index eaa571fe0a3b..aeb19a11966b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5040,14 +5040,12 @@ dependencies = [ "bitvec", "futures 0.3.5", "futures-timer 3.0.2", - "lazy_static", "log 0.4.11", "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", "sc-keystore", "sp-application-crypto", - "sp-core", "sp-keystore", "tempfile", "thiserror", diff --git a/node/core/provisioner/Cargo.toml b/node/core/provisioner/Cargo.toml index 34fa717638a3..a44fae43f52a 100644 --- a/node/core/provisioner/Cargo.toml +++ b/node/core/provisioner/Cargo.toml @@ -14,8 +14,6 @@ polkadot-node-subsystem = { path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } [dev-dependencies] -lazy_static = "1.4" -sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/core/provisioner/src/lib.rs b/node/core/provisioner/src/lib.rs index d0b271b66949..37c082bc47d5 100644 --- a/node/core/provisioner/src/lib.rs +++ b/node/core/provisioner/src/lib.rs @@ -511,382 +511,4 @@ impl metrics::Metrics for Metrics { delegated_subsystem!(ProvisioningJob((), Metrics) <- ToJob as ProvisioningSubsystem); #[cfg(test)] -mod tests { - use super::*; - use bitvec::bitvec; - use polkadot_primitives::v1::{OccupiedCore, ScheduledCore}; - - pub fn occupied_core(para_id: u32) -> CoreState { - CoreState::Occupied(OccupiedCore { - para_id: para_id.into(), - group_responsible: para_id.into(), - next_up_on_available: None, - occupied_since: 100_u32, - time_out_at: 200_u32, - next_up_on_time_out: None, - availability: default_bitvec(), - }) - } - - pub fn build_occupied_core(para_id: u32, builder: Builder) -> CoreState - where - Builder: FnOnce(&mut OccupiedCore), - { - let mut core = match occupied_core(para_id) { - CoreState::Occupied(core) => core, - _ => unreachable!(), - }; - - builder(&mut core); - - CoreState::Occupied(core) - } - - pub fn default_bitvec() -> CoreAvailability { - bitvec![bitvec::order::Lsb0, u8; 0; 32] - } - - pub fn scheduled_core(id: u32) -> ScheduledCore { - ScheduledCore { - para_id: id.into(), - ..Default::default() - } - } - - mod select_availability_bitfields { - use super::super::*; - use super::{default_bitvec, occupied_core}; - use futures::executor::block_on; - use std::sync::Arc; - use polkadot_primitives::v1::{SigningContext, ValidatorIndex, ValidatorId}; - use sp_application_crypto::AppKey; - use sp_keystore::{CryptoStore, SyncCryptoStorePtr}; - use sc_keystore::LocalKeystore; - - async fn signed_bitfield( - keystore: &SyncCryptoStorePtr, - field: CoreAvailability, - validator_idx: ValidatorIndex, - ) -> SignedAvailabilityBitfield { - let public = CryptoStore::sr25519_generate_new(&**keystore, ValidatorId::ID, None) - .await - .expect("generated sr25519 key"); - SignedAvailabilityBitfield::sign( - &keystore, - field.into(), - &>::default(), - validator_idx, - &public.into(), - ).await.expect("Should be signed") - } - - #[test] - fn not_more_than_one_per_validator() { - // Configure filesystem-based keystore as generating keys without seed - // would trigger the key to be generated on the filesystem. - let keystore_path = tempfile::tempdir().expect("Creates keystore path"); - let keystore : SyncCryptoStorePtr = Arc::new(LocalKeystore::open(keystore_path.path(), None) - .expect("Creates keystore")); - let bitvec = default_bitvec(); - - let cores = vec![occupied_core(0), occupied_core(1)]; - - // we pass in three bitfields with two validators - // this helps us check the postcondition that we get two bitfields back, for which the validators differ - let bitfields = vec![ - block_on(signed_bitfield(&keystore, bitvec.clone(), 0)), - block_on(signed_bitfield(&keystore, bitvec.clone(), 1)), - block_on(signed_bitfield(&keystore, bitvec, 1)), - ]; - - let mut selected_bitfields = select_availability_bitfields(&cores, &bitfields); - selected_bitfields.sort_by_key(|bitfield| bitfield.validator_index()); - - assert_eq!(selected_bitfields.len(), 2); - assert_eq!(selected_bitfields[0], bitfields[0]); - // we don't know which of the (otherwise equal) bitfields will be selected - assert!(selected_bitfields[1] == bitfields[1] || selected_bitfields[1] == bitfields[2]); - } - - #[test] - fn each_corresponds_to_an_occupied_core() { - // Configure filesystem-based keystore as generating keys without seed - // would trigger the key to be generated on the filesystem. - let keystore_path = tempfile::tempdir().expect("Creates keystore path"); - let keystore : SyncCryptoStorePtr = Arc::new(LocalKeystore::open(keystore_path.path(), None) - .expect("Creates keystore")); - let bitvec = default_bitvec(); - - let cores = vec![CoreState::Free, CoreState::Scheduled(Default::default())]; - - let bitfields = vec![ - block_on(signed_bitfield(&keystore, bitvec.clone(), 0)), - block_on(signed_bitfield(&keystore, bitvec.clone(), 1)), - block_on(signed_bitfield(&keystore, bitvec, 1)), - ]; - - let mut selected_bitfields = select_availability_bitfields(&cores, &bitfields); - selected_bitfields.sort_by_key(|bitfield| bitfield.validator_index()); - - // bitfields not corresponding to occupied cores are not selected - assert!(selected_bitfields.is_empty()); - } - - #[test] - fn more_set_bits_win_conflicts() { - // Configure filesystem-based keystore as generating keys without seed - // would trigger the key to be generated on the filesystem. - let keystore_path = tempfile::tempdir().expect("Creates keystore path"); - let keystore : SyncCryptoStorePtr = Arc::new(LocalKeystore::open(keystore_path.path(), None) - .expect("Creates keystore")); - let bitvec_zero = default_bitvec(); - let bitvec_one = { - let mut bitvec = bitvec_zero.clone(); - bitvec.set(0, true); - bitvec - }; - - let cores = vec![occupied_core(0)]; - - let bitfields = vec![ - block_on(signed_bitfield(&keystore, bitvec_zero, 0)), - block_on(signed_bitfield(&keystore, bitvec_one.clone(), 0)), - ]; - - // this test is probablistic: chances are excellent that it does what it claims to. - // it cannot fail unless things are broken. - // however, there is a (very small) chance that it passes when things are broken. - for _ in 0..64 { - let selected_bitfields = select_availability_bitfields(&cores, &bitfields); - assert_eq!(selected_bitfields.len(), 1); - assert_eq!(selected_bitfields[0].payload().0, bitvec_one); - } - } - } - - mod select_candidates { - use futures_timer::Delay; - use super::super::*; - use super::{build_occupied_core, default_bitvec, occupied_core, scheduled_core}; - use polkadot_node_subsystem::messages::RuntimeApiRequest::{ - AvailabilityCores, PersistedValidationData as PersistedValidationDataReq, - }; - use polkadot_primitives::v1::{ - BlockNumber, CandidateDescriptor, CommittedCandidateReceipt, PersistedValidationData, - }; - use FromJob::{ChainApi, Runtime}; - - const BLOCK_UNDER_PRODUCTION: BlockNumber = 128; - - fn test_harness( - overseer_factory: OverseerFactory, - test_factory: TestFactory, - ) where - OverseerFactory: FnOnce(mpsc::Receiver) -> Overseer, - Overseer: Future, - TestFactory: FnOnce(mpsc::Sender) -> Test, - Test: Future, - { - let (tx, rx) = mpsc::channel(64); - let overseer = overseer_factory(rx); - let test = test_factory(tx); - - futures::pin_mut!(overseer, test); - - futures::executor::block_on(future::select(overseer, test)); - } - - // For test purposes, we always return this set of availability cores: - // - // [ - // 0: Free, - // 1: Scheduled(default), - // 2: Occupied(no next_up set), - // 3: Occupied(next_up_on_available set but not available), - // 4: Occupied(next_up_on_available set and available), - // 5: Occupied(next_up_on_time_out set but not timeout), - // 6: Occupied(next_up_on_time_out set and timeout but available), - // 7: Occupied(next_up_on_time_out set and timeout and not available), - // 8: Occupied(both next_up set, available), - // 9: Occupied(both next_up set, not available, no timeout), - // 10: Occupied(both next_up set, not available, timeout), - // 11: Occupied(next_up_on_available and available, but different successor para_id) - // ] - fn mock_availability_cores() -> Vec { - use std::ops::Not; - use CoreState::{Free, Scheduled}; - - vec![ - // 0: Free, - Free, - // 1: Scheduled(default), - Scheduled(scheduled_core(1)), - // 2: Occupied(no next_up set), - occupied_core(2), - // 3: Occupied(next_up_on_available set but not available), - build_occupied_core(3, |core| { - core.next_up_on_available = Some(scheduled_core(3)); - }), - // 4: Occupied(next_up_on_available set and available), - build_occupied_core(4, |core| { - core.next_up_on_available = Some(scheduled_core(4)); - core.availability = core.availability.clone().not(); - }), - // 5: Occupied(next_up_on_time_out set but not timeout), - build_occupied_core(5, |core| { - core.next_up_on_time_out = Some(scheduled_core(5)); - }), - // 6: Occupied(next_up_on_time_out set and timeout but available), - build_occupied_core(6, |core| { - core.next_up_on_time_out = Some(scheduled_core(6)); - core.time_out_at = BLOCK_UNDER_PRODUCTION; - core.availability = core.availability.clone().not(); - }), - // 7: Occupied(next_up_on_time_out set and timeout and not available), - build_occupied_core(7, |core| { - core.next_up_on_time_out = Some(scheduled_core(7)); - core.time_out_at = BLOCK_UNDER_PRODUCTION; - }), - // 8: Occupied(both next_up set, available), - build_occupied_core(8, |core| { - core.next_up_on_available = Some(scheduled_core(8)); - core.next_up_on_time_out = Some(scheduled_core(8)); - core.availability = core.availability.clone().not(); - }), - // 9: Occupied(both next_up set, not available, no timeout), - build_occupied_core(9, |core| { - core.next_up_on_available = Some(scheduled_core(9)); - core.next_up_on_time_out = Some(scheduled_core(9)); - }), - // 10: Occupied(both next_up set, not available, timeout), - build_occupied_core(10, |core| { - core.next_up_on_available = Some(scheduled_core(10)); - core.next_up_on_time_out = Some(scheduled_core(10)); - core.time_out_at = BLOCK_UNDER_PRODUCTION; - }), - // 11: Occupied(next_up_on_available and available, but different successor para_id) - build_occupied_core(11, |core| { - core.next_up_on_available = Some(scheduled_core(12)); - core.availability = core.availability.clone().not(); - }), - ] - } - - async fn mock_overseer(mut receiver: mpsc::Receiver) { - use ChainApiMessage::BlockNumber; - use RuntimeApiMessage::Request; - - while let Some(from_job) = receiver.next().await { - match from_job { - ChainApi(BlockNumber(_relay_parent, tx)) => { - tx.send(Ok(Some(BLOCK_UNDER_PRODUCTION - 1))).unwrap() - } - Runtime(Request( - _parent_hash, - PersistedValidationDataReq(_para_id, _assumption, tx), - )) => tx.send(Ok(Some(Default::default()))).unwrap(), - Runtime(Request(_parent_hash, AvailabilityCores(tx))) => { - tx.send(Ok(mock_availability_cores())).unwrap() - } - // non-exhaustive matches are fine for testing - _ => unimplemented!(), - } - } - } - - #[test] - fn handles_overseer_failure() { - let overseer = |rx: mpsc::Receiver| async move { - // drop the receiver so it closes and the sender can't send, then just sleep long enough that - // this is almost certainly not the first of the two futures to complete - std::mem::drop(rx); - Delay::new(std::time::Duration::from_secs(1)).await; - }; - - let test = |mut tx: mpsc::Sender| async move { - // wait so that the overseer can drop the rx before we attempt to send - Delay::new(std::time::Duration::from_millis(50)).await; - let result = select_candidates(&[], &[], &[], Default::default(), &mut tx).await; - println!("{:?}", result); - assert!(std::matches!(result, Err(Error::ChainApiMessageSend(_)))); - }; - - test_harness(overseer, test); - } - - #[test] - fn can_succeed() { - test_harness(mock_overseer, |mut tx: mpsc::Sender| async move { - let result = select_candidates(&[], &[], &[], Default::default(), &mut tx).await; - println!("{:?}", result); - assert!(result.is_ok()); - }) - } - - // this tests that only the appropriate candidates get selected. - // To accomplish this, we supply a candidate list containing one candidate per possible core; - // the candidate selection algorithm must filter them to the appropriate set - #[test] - fn selects_correct_candidates() { - let mock_cores = mock_availability_cores(); - - let empty_hash = PersistedValidationData::::default().hash(); - - let candidate_template = BackedCandidate { - candidate: CommittedCandidateReceipt { - descriptor: CandidateDescriptor { - persisted_validation_data_hash: empty_hash, - ..Default::default() - }, - ..Default::default() - }, - validity_votes: Vec::new(), - validator_indices: default_bitvec(), - }; - - let candidates: Vec<_> = std::iter::repeat(candidate_template) - .take(mock_cores.len()) - .enumerate() - .map(|(idx, mut candidate)| { - candidate.candidate.descriptor.para_id = idx.into(); - candidate - }) - .cycle() - .take(mock_cores.len() * 3) - .enumerate() - .map(|(idx, mut candidate)| { - if idx < mock_cores.len() { - // first go-around: use candidates which should work - candidate - } else if idx < mock_cores.len() * 2 { - // for the second repetition of the candidates, give them the wrong hash - candidate.candidate.descriptor.persisted_validation_data_hash - = Default::default(); - candidate - } else { - // third go-around: right hash, wrong para_id - candidate.candidate.descriptor.para_id = idx.into(); - candidate - } - }) - .collect(); - - // why those particular indices? see the comments on mock_availability_cores() - let expected_candidates: Vec<_> = [1, 4, 7, 8, 10] - .iter() - .map(|&idx| candidates[idx].clone()) - .collect(); - - test_harness(mock_overseer, |mut tx: mpsc::Sender| async move { - let result = - select_candidates(&mock_cores, &[], &candidates, Default::default(), &mut tx) - .await; - - if result.is_err() { - println!("{:?}", result); - } - assert_eq!(result.unwrap(), expected_candidates); - }) - } - } -} +mod tests; \ No newline at end of file diff --git a/node/core/provisioner/src/tests.rs b/node/core/provisioner/src/tests.rs new file mode 100644 index 000000000000..d32782a07e87 --- /dev/null +++ b/node/core/provisioner/src/tests.rs @@ -0,0 +1,377 @@ +use super::*; +use bitvec::bitvec; +use polkadot_primitives::v1::{OccupiedCore, ScheduledCore}; + +pub fn occupied_core(para_id: u32) -> CoreState { + CoreState::Occupied(OccupiedCore { + para_id: para_id.into(), + group_responsible: para_id.into(), + next_up_on_available: None, + occupied_since: 100_u32, + time_out_at: 200_u32, + next_up_on_time_out: None, + availability: default_bitvec(), + }) +} + +pub fn build_occupied_core(para_id: u32, builder: Builder) -> CoreState +where + Builder: FnOnce(&mut OccupiedCore), +{ + let mut core = match occupied_core(para_id) { + CoreState::Occupied(core) => core, + _ => unreachable!(), + }; + + builder(&mut core); + + CoreState::Occupied(core) +} + +pub fn default_bitvec() -> CoreAvailability { + bitvec![bitvec::order::Lsb0, u8; 0; 32] +} + +pub fn scheduled_core(id: u32) -> ScheduledCore { + ScheduledCore { + para_id: id.into(), + ..Default::default() + } +} + +mod select_availability_bitfields { + use super::super::*; + use super::{default_bitvec, occupied_core}; + use futures::executor::block_on; + use std::sync::Arc; + use polkadot_primitives::v1::{SigningContext, ValidatorIndex, ValidatorId}; + use sp_application_crypto::AppKey; + use sp_keystore::{CryptoStore, SyncCryptoStorePtr}; + use sc_keystore::LocalKeystore; + + async fn signed_bitfield( + keystore: &SyncCryptoStorePtr, + field: CoreAvailability, + validator_idx: ValidatorIndex, + ) -> SignedAvailabilityBitfield { + let public = CryptoStore::sr25519_generate_new(&**keystore, ValidatorId::ID, None) + .await + .expect("generated sr25519 key"); + SignedAvailabilityBitfield::sign( + &keystore, + field.into(), + &>::default(), + validator_idx, + &public.into(), + ).await.expect("Should be signed") + } + + #[test] + fn not_more_than_one_per_validator() { + // Configure filesystem-based keystore as generating keys without seed + // would trigger the key to be generated on the filesystem. + let keystore_path = tempfile::tempdir().expect("Creates keystore path"); + let keystore : SyncCryptoStorePtr = Arc::new(LocalKeystore::open(keystore_path.path(), None) + .expect("Creates keystore")); + let bitvec = default_bitvec(); + + let cores = vec![occupied_core(0), occupied_core(1)]; + + // we pass in three bitfields with two validators + // this helps us check the postcondition that we get two bitfields back, for which the validators differ + let bitfields = vec![ + block_on(signed_bitfield(&keystore, bitvec.clone(), 0)), + block_on(signed_bitfield(&keystore, bitvec.clone(), 1)), + block_on(signed_bitfield(&keystore, bitvec, 1)), + ]; + + let mut selected_bitfields = select_availability_bitfields(&cores, &bitfields); + selected_bitfields.sort_by_key(|bitfield| bitfield.validator_index()); + + assert_eq!(selected_bitfields.len(), 2); + assert_eq!(selected_bitfields[0], bitfields[0]); + // we don't know which of the (otherwise equal) bitfields will be selected + assert!(selected_bitfields[1] == bitfields[1] || selected_bitfields[1] == bitfields[2]); + } + + #[test] + fn each_corresponds_to_an_occupied_core() { + // Configure filesystem-based keystore as generating keys without seed + // would trigger the key to be generated on the filesystem. + let keystore_path = tempfile::tempdir().expect("Creates keystore path"); + let keystore : SyncCryptoStorePtr = Arc::new(LocalKeystore::open(keystore_path.path(), None) + .expect("Creates keystore")); + let bitvec = default_bitvec(); + + let cores = vec![CoreState::Free, CoreState::Scheduled(Default::default())]; + + let bitfields = vec![ + block_on(signed_bitfield(&keystore, bitvec.clone(), 0)), + block_on(signed_bitfield(&keystore, bitvec.clone(), 1)), + block_on(signed_bitfield(&keystore, bitvec, 1)), + ]; + + let mut selected_bitfields = select_availability_bitfields(&cores, &bitfields); + selected_bitfields.sort_by_key(|bitfield| bitfield.validator_index()); + + // bitfields not corresponding to occupied cores are not selected + assert!(selected_bitfields.is_empty()); + } + + #[test] + fn more_set_bits_win_conflicts() { + // Configure filesystem-based keystore as generating keys without seed + // would trigger the key to be generated on the filesystem. + let keystore_path = tempfile::tempdir().expect("Creates keystore path"); + let keystore : SyncCryptoStorePtr = Arc::new(LocalKeystore::open(keystore_path.path(), None) + .expect("Creates keystore")); + let bitvec_zero = default_bitvec(); + let bitvec_one = { + let mut bitvec = bitvec_zero.clone(); + bitvec.set(0, true); + bitvec + }; + + let cores = vec![occupied_core(0)]; + + let bitfields = vec![ + block_on(signed_bitfield(&keystore, bitvec_zero, 0)), + block_on(signed_bitfield(&keystore, bitvec_one.clone(), 0)), + ]; + + // this test is probablistic: chances are excellent that it does what it claims to. + // it cannot fail unless things are broken. + // however, there is a (very small) chance that it passes when things are broken. + for _ in 0..64 { + let selected_bitfields = select_availability_bitfields(&cores, &bitfields); + assert_eq!(selected_bitfields.len(), 1); + assert_eq!(selected_bitfields[0].payload().0, bitvec_one); + } + } +} + +mod select_candidates { + use futures_timer::Delay; + use super::super::*; + use super::{build_occupied_core, default_bitvec, occupied_core, scheduled_core}; + use polkadot_node_subsystem::messages::RuntimeApiRequest::{ + AvailabilityCores, PersistedValidationData as PersistedValidationDataReq, + }; + use polkadot_primitives::v1::{ + BlockNumber, CandidateDescriptor, CommittedCandidateReceipt, PersistedValidationData, + }; + use FromJob::{ChainApi, Runtime}; + + const BLOCK_UNDER_PRODUCTION: BlockNumber = 128; + + fn test_harness( + overseer_factory: OverseerFactory, + test_factory: TestFactory, + ) where + OverseerFactory: FnOnce(mpsc::Receiver) -> Overseer, + Overseer: Future, + TestFactory: FnOnce(mpsc::Sender) -> Test, + Test: Future, + { + let (tx, rx) = mpsc::channel(64); + let overseer = overseer_factory(rx); + let test = test_factory(tx); + + futures::pin_mut!(overseer, test); + + let _ = futures::executor::block_on(future::select(overseer, test)); + } + + // For test purposes, we always return this set of availability cores: + // + // [ + // 0: Free, + // 1: Scheduled(default), + // 2: Occupied(no next_up set), + // 3: Occupied(next_up_on_available set but not available), + // 4: Occupied(next_up_on_available set and available), + // 5: Occupied(next_up_on_time_out set but not timeout), + // 6: Occupied(next_up_on_time_out set and timeout but available), + // 7: Occupied(next_up_on_time_out set and timeout and not available), + // 8: Occupied(both next_up set, available), + // 9: Occupied(both next_up set, not available, no timeout), + // 10: Occupied(both next_up set, not available, timeout), + // 11: Occupied(next_up_on_available and available, but different successor para_id) + // ] + fn mock_availability_cores() -> Vec { + use std::ops::Not; + use CoreState::{Free, Scheduled}; + + vec![ + // 0: Free, + Free, + // 1: Scheduled(default), + Scheduled(scheduled_core(1)), + // 2: Occupied(no next_up set), + occupied_core(2), + // 3: Occupied(next_up_on_available set but not available), + build_occupied_core(3, |core| { + core.next_up_on_available = Some(scheduled_core(3)); + }), + // 4: Occupied(next_up_on_available set and available), + build_occupied_core(4, |core| { + core.next_up_on_available = Some(scheduled_core(4)); + core.availability = core.availability.clone().not(); + }), + // 5: Occupied(next_up_on_time_out set but not timeout), + build_occupied_core(5, |core| { + core.next_up_on_time_out = Some(scheduled_core(5)); + }), + // 6: Occupied(next_up_on_time_out set and timeout but available), + build_occupied_core(6, |core| { + core.next_up_on_time_out = Some(scheduled_core(6)); + core.time_out_at = BLOCK_UNDER_PRODUCTION; + core.availability = core.availability.clone().not(); + }), + // 7: Occupied(next_up_on_time_out set and timeout and not available), + build_occupied_core(7, |core| { + core.next_up_on_time_out = Some(scheduled_core(7)); + core.time_out_at = BLOCK_UNDER_PRODUCTION; + }), + // 8: Occupied(both next_up set, available), + build_occupied_core(8, |core| { + core.next_up_on_available = Some(scheduled_core(8)); + core.next_up_on_time_out = Some(scheduled_core(8)); + core.availability = core.availability.clone().not(); + }), + // 9: Occupied(both next_up set, not available, no timeout), + build_occupied_core(9, |core| { + core.next_up_on_available = Some(scheduled_core(9)); + core.next_up_on_time_out = Some(scheduled_core(9)); + }), + // 10: Occupied(both next_up set, not available, timeout), + build_occupied_core(10, |core| { + core.next_up_on_available = Some(scheduled_core(10)); + core.next_up_on_time_out = Some(scheduled_core(10)); + core.time_out_at = BLOCK_UNDER_PRODUCTION; + }), + // 11: Occupied(next_up_on_available and available, but different successor para_id) + build_occupied_core(11, |core| { + core.next_up_on_available = Some(scheduled_core(12)); + core.availability = core.availability.clone().not(); + }), + ] + } + + async fn mock_overseer(mut receiver: mpsc::Receiver) { + use ChainApiMessage::BlockNumber; + use RuntimeApiMessage::Request; + + while let Some(from_job) = receiver.next().await { + match from_job { + ChainApi(BlockNumber(_relay_parent, tx)) => { + tx.send(Ok(Some(BLOCK_UNDER_PRODUCTION - 1))).unwrap() + } + Runtime(Request( + _parent_hash, + PersistedValidationDataReq(_para_id, _assumption, tx), + )) => tx.send(Ok(Some(Default::default()))).unwrap(), + Runtime(Request(_parent_hash, AvailabilityCores(tx))) => { + tx.send(Ok(mock_availability_cores())).unwrap() + } + // non-exhaustive matches are fine for testing + _ => unimplemented!(), + } + } + } + + #[test] + fn handles_overseer_failure() { + let overseer = |rx: mpsc::Receiver| async move { + // drop the receiver so it closes and the sender can't send, then just sleep long enough that + // this is almost certainly not the first of the two futures to complete + std::mem::drop(rx); + Delay::new(std::time::Duration::from_secs(1)).await; + }; + + let test = |mut tx: mpsc::Sender| async move { + // wait so that the overseer can drop the rx before we attempt to send + Delay::new(std::time::Duration::from_millis(50)).await; + let result = select_candidates(&[], &[], &[], Default::default(), &mut tx).await; + println!("{:?}", result); + assert!(std::matches!(result, Err(Error::ChainApiMessageSend(_)))); + }; + + test_harness(overseer, test); + } + + #[test] + fn can_succeed() { + test_harness(mock_overseer, |mut tx: mpsc::Sender| async move { + let result = select_candidates(&[], &[], &[], Default::default(), &mut tx).await; + println!("{:?}", result); + assert!(result.is_ok()); + }) + } + + // this tests that only the appropriate candidates get selected. + // To accomplish this, we supply a candidate list containing one candidate per possible core; + // the candidate selection algorithm must filter them to the appropriate set + #[test] + fn selects_correct_candidates() { + let mock_cores = mock_availability_cores(); + + let empty_hash = PersistedValidationData::::default().hash(); + + let candidate_template = BackedCandidate { + candidate: CommittedCandidateReceipt { + descriptor: CandidateDescriptor { + persisted_validation_data_hash: empty_hash, + ..Default::default() + }, + ..Default::default() + }, + validity_votes: Vec::new(), + validator_indices: default_bitvec(), + }; + + let candidates: Vec<_> = std::iter::repeat(candidate_template) + .take(mock_cores.len()) + .enumerate() + .map(|(idx, mut candidate)| { + candidate.candidate.descriptor.para_id = idx.into(); + candidate + }) + .cycle() + .take(mock_cores.len() * 3) + .enumerate() + .map(|(idx, mut candidate)| { + if idx < mock_cores.len() { + // first go-around: use candidates which should work + candidate + } else if idx < mock_cores.len() * 2 { + // for the second repetition of the candidates, give them the wrong hash + candidate.candidate.descriptor.persisted_validation_data_hash + = Default::default(); + candidate + } else { + // third go-around: right hash, wrong para_id + candidate.candidate.descriptor.para_id = idx.into(); + candidate + } + }) + .collect(); + + // why those particular indices? see the comments on mock_availability_cores() + let expected_candidates: Vec<_> = [1, 4, 7, 8, 10] + .iter() + .map(|&idx| candidates[idx].clone()) + .collect(); + + test_harness(mock_overseer, |mut tx: mpsc::Sender| async move { + let result = + select_candidates(&mock_cores, &[], &candidates, Default::default(), &mut tx) + .await; + + if result.is_err() { + println!("{:?}", result); + } + assert_eq!(result.unwrap(), expected_candidates); + }) + } +} From 59bb59dc357ffa9bf5e5a9872db638e84782737d Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 15:35:00 +0100 Subject: [PATCH 54/62] fixup subsystem-util --- node/subsystem-util/Cargo.toml | 2 +- node/subsystem-util/src/lib.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/node/subsystem-util/Cargo.toml b/node/subsystem-util/Cargo.toml index 863a4bc91cac..f03cea134827 100644 --- a/node/subsystem-util/Cargo.toml +++ b/node/subsystem-util/Cargo.toml @@ -9,7 +9,7 @@ description = "Subsystem traits and message definitions" async-trait = "0.1" futures = "0.3.5" futures-timer = "3.0.2" -log = "0.4.8" +log = "0.4.11" thiserror = "1.0.21" parity-scale-codec = "1.3.4" parking_lot = { version = "0.10.0", optional = true } diff --git a/node/subsystem-util/src/lib.rs b/node/subsystem-util/src/lib.rs index 3ee915766a94..fb9e160b721d 100644 --- a/node/subsystem-util/src/lib.rs +++ b/node/subsystem-util/src/lib.rs @@ -1084,6 +1084,7 @@ impl Future for Timeout { #[cfg(test)] mod tests { use super::{Error as UtilError, JobManager, JobTrait, JobsError, TimeoutExt, ToJobTrait}; + use thiserror::Error; use polkadot_node_subsystem::{ messages::{AllMessages, CandidateSelectionMessage}, ActiveLeavesUpdate, FromOverseer, OverseerSignal, SpawnedSubsystem, Subsystem, @@ -1279,7 +1280,7 @@ mod tests { fn starting_and_stopping_job_works() { let relay_parent: Hash = [0; 32].into(); let mut run_args = HashMap::new(); - run_args.insert( + let _ = run_args.insert( relay_parent.clone(), vec![FromJob::Test], ); @@ -1335,7 +1336,7 @@ mod tests { fn sending_to_a_non_running_job_do_not_stop_the_subsystem() { let relay_parent = Hash::repeat_byte(0x01); let mut run_args = HashMap::new(); - run_args.insert( + let _ = run_args.insert( relay_parent.clone(), vec![FromJob::Test], ); From 0b0237a1a7b08070ecf6b0eea3ad820dcbea949d Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 15:37:09 +0100 Subject: [PATCH 55/62] fixup availability distr --- Cargo.lock | 2 -- node/network/availability-distribution/Cargo.toml | 2 -- 2 files changed, 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aeb19a11966b..9fb7b899ac14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4781,13 +4781,11 @@ name = "polkadot-availability-distribution" version = "0.1.0" dependencies = [ "assert_matches", - "bitvec", "env_logger 0.7.1", "futures 0.3.5", "futures-timer 3.0.2", "log 0.4.11", "parity-scale-codec", - "parking_lot 0.11.0", "polkadot-erasure-coding", "polkadot-node-network-protocol", "polkadot-node-subsystem", diff --git a/node/network/availability-distribution/Cargo.toml b/node/network/availability-distribution/Cargo.toml index 234362ed0f80..1f032b7f054b 100644 --- a/node/network/availability-distribution/Cargo.toml +++ b/node/network/availability-distribution/Cargo.toml @@ -19,12 +19,10 @@ thiserror = "1.0.21" [dev-dependencies] polkadot-subsystem-testhelpers = { package = "polkadot-node-subsystem-test-helpers", path = "../../subsystem-test-helpers" } -bitvec = { version = "0.17.4", default-features = false, features = ["alloc"] } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", features = ["std"] } sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } -parking_lot = "0.11.0" futures-timer = "3.0.2" env_logger = "0.7.1" assert_matches = "1.3.0" From 3f3cc02eb2518041ec8e754b9757de65014e85c4 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 15:48:57 +0100 Subject: [PATCH 56/62] finalize fixups --- Cargo.lock | 195 ++---------------- node/network/bitfield-distribution/Cargo.toml | 7 - node/network/bridge/src/lib.rs | 2 +- node/network/collator-protocol/Cargo.toml | 1 - node/overseer/Cargo.toml | 8 +- node/overseer/src/lib.rs | 4 +- 6 files changed, 26 insertions(+), 191 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9fb7b899ac14..422b49eed923 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -224,32 +224,18 @@ dependencies = [ "futures-core", ] -[[package]] -name = "async-executor" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f47c78ea98277cb1f5e6f60ba4fc762f5eafe9f6511bc2f7dfd8b75c225650" -dependencies = [ - "async-io 0.1.5", - "futures-lite 0.1.10", - "multitask", - "parking 1.0.5", - "scoped-tls", - "waker-fn", -] - [[package]] name = "async-executor" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d373d78ded7d0b3fa8039375718cde0aace493f2e34fb60f51cbf567562ca801" dependencies = [ - "async-task 4.0.3", + "async-task", "concurrent-queue", "fastrand", - "futures-lite 1.11.2", + "futures-lite", "once_cell 1.4.1", - "vec-arena 1.0.0", + "vec-arena", ] [[package]] @@ -258,31 +244,13 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "124ac8c265e407641c3362b8f4d39cdb4e243885b71eef087be27199790f5a3a" dependencies = [ - "async-executor 1.3.0", - "async-io 1.1.0", - "futures-lite 1.11.2", + "async-executor", + "async-io", + "futures-lite", "num_cpus", "once_cell 1.4.1", ] -[[package]] -name = "async-io" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8126ef9fb99355c6fd27575d691be4887b884137a5b6f48c2d961f13590c51" -dependencies = [ - "cfg-if", - "concurrent-queue", - "futures-lite 0.1.10", - "libc", - "once_cell 1.4.1", - "parking 1.0.5", - "socket2", - "vec-arena 0.5.0", - "wepoll-sys-stjepang", - "winapi 0.3.9", -] - [[package]] name = "async-io" version = "1.1.0" @@ -292,14 +260,14 @@ dependencies = [ "cfg-if", "concurrent-queue", "fastrand", - "futures-lite 1.11.2", + "futures-lite", "libc", "log 0.4.11", "once_cell 1.4.1", - "parking 2.0.0", + "parking", "polling", "socket2", - "vec-arena 1.0.0", + "vec-arena", "waker-fn", "wepoll-sys-stjepang", "winapi 0.3.9", @@ -321,14 +289,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9fa76751505e8df1c7a77762f60486f60c71bbd9b8557f4da6ad47d083732ed" dependencies = [ "async-global-executor", - "async-io 1.1.0", + "async-io", "async-mutex", - "blocking 1.0.2", + "blocking", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite 1.11.2", + "futures-lite", "gloo-timers", "kv-log-macro", "log 0.4.11", @@ -341,12 +309,6 @@ dependencies = [ "wasm-bindgen-futures", ] -[[package]] -name = "async-task" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17772156ef2829aadc587461c7753af20b7e8db1529bc66855add962a3b35d3" - [[package]] name = "async-task" version = "4.0.3" @@ -598,33 +560,6 @@ dependencies = [ "byte-tools", ] -[[package]] -name = "blocking" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2468ff7bf85066b4a3678fede6fe66db31846d753ff0adfbfab2c6a6e81612b" -dependencies = [ - "async-channel", - "atomic-waker", - "futures-lite 0.1.10", - "once_cell 1.4.1", - "parking 1.0.5", - "waker-fn", -] - -[[package]] -name = "blocking" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e94bf99b692f54c9d05f97454d3faf11134523fe5b180564a3fb6ed63bcc0a" -dependencies = [ - "async-channel", - "atomic-waker", - "futures-lite 0.1.10", - "once_cell 1.4.1", - "waker-fn", -] - [[package]] name = "blocking" version = "1.0.2" @@ -632,10 +567,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5e170dbede1f740736619b776d7251cb1b9095c435c34d8ca9f57fcd2f335e9" dependencies = [ "async-channel", - "async-task 4.0.3", + "async-task", "atomic-waker", "fastrand", - "futures-lite 1.11.2", + "futures-lite", "once_cell 1.4.1", ] @@ -1215,12 +1150,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c53dc3a653e0f64081026e4bf048d48fec9fce90c66e8326ca7292df0ff2d82" -[[package]] -name = "easy-parallel" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd4afd79212583ff429b913ad6605242ed7eec277e950b1438f300748f948f4" - [[package]] name = "ed25519" version = "1.0.1" @@ -1422,15 +1351,16 @@ dependencies = [ [[package]] name = "femme" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b6b21baebbed15551f2170010ca4101b9ed3fdc05822791c8bd4631840eab81" +checksum = "2af1a24f391a5a94d756db5092c6576aad494b88a71a5a36b20c67b63e0df034" dependencies = [ "cfg-if", "js-sys", "log 0.4.11", "serde", "serde_derive", + "serde_json", "wasm-bindgen", "web-sys", ] @@ -1803,21 +1733,6 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" -[[package]] -name = "futures-lite" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe71459749b2e8e66fb95df721b22fa08661ad384a0c5b519e11d3893b4692a" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "memchr", - "parking 1.0.5", - "pin-project-lite", - "waker-fn", -] - [[package]] name = "futures-lite" version = "1.11.2" @@ -1828,7 +1743,7 @@ dependencies = [ "futures-core", "futures-io", "memchr", - "parking 2.0.0", + "parking", "pin-project-lite", "waker-fn", ] @@ -3615,17 +3530,6 @@ dependencies = [ "unsigned-varint 0.4.0", ] -[[package]] -name = "multitask" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c09c35271e7dcdb5f709779111f2c8e8ab8e06c1b587c1c6a9e179d865aaa5b4" -dependencies = [ - "async-task 3.0.0", - "concurrent-queue", - "fastrand", -] - [[package]] name = "nalgebra" version = "0.18.1" @@ -4518,12 +4422,6 @@ dependencies = [ "url 2.1.1", ] -[[package]] -name = "parking" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d4a6da31f8144a32532fe38fe8fb439a6842e0ec633f0037f0144c14e7f907" - [[package]] name = "parking" version = "2.0.0" @@ -4758,18 +4656,15 @@ dependencies = [ "bitvec", "env_logger 0.7.1", "futures 0.3.5", - "futures-timer 3.0.2", "log 0.4.11", "maplit", "parity-scale-codec", - "parking_lot 0.11.0", "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-test-helpers", "polkadot-node-subsystem-util", "polkadot-primitives", "sc-keystore", - "smol 0.3.3", "sp-application-crypto", "sp-core", "sp-keystore", @@ -4835,7 +4730,6 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "smallvec 1.4.2", - "smol-timeout", "sp-core", "sp-keyring", "thiserror", @@ -7797,53 +7691,6 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" -[[package]] -name = "smol" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620cbb3c6e34da57d3a248cda0cd01cd5848164dc062e764e65d06fe3ea7aed5" -dependencies = [ - "async-task 3.0.0", - "blocking 0.4.7", - "concurrent-queue", - "fastrand", - "futures-io", - "futures-util", - "libc", - "once_cell 1.4.1", - "scoped-tls", - "slab", - "socket2", - "wepoll-sys-stjepang", - "winapi 0.3.9", -] - -[[package]] -name = "smol" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67583f4ccc13bbb105a0752058d8ad66c47753d85445952809bcaca891954f83" -dependencies = [ - "async-channel", - "async-executor 0.1.2", - "async-io 0.1.5", - "blocking 0.5.0", - "cfg-if", - "easy-parallel", - "futures-lite 0.1.10", - "num_cpus", -] - -[[package]] -name = "smol-timeout" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "024818c1f00b80e8171ddcfcee33860134293aa3aced60c9cbd7a5a2d41db392" -dependencies = [ - "pin-project", - "smol 0.1.18", -] - [[package]] name = "snow" version = "0.7.1" @@ -9578,12 +9425,6 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" -[[package]] -name = "vec-arena" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17dfb54bf57c9043f4616cb03dab30eff012cc26631b797d8354b916708db919" - [[package]] name = "vec-arena" version = "1.0.0" diff --git a/node/network/bitfield-distribution/Cargo.toml b/node/network/bitfield-distribution/Cargo.toml index 444895167208..41e34cb2f7cf 100644 --- a/node/network/bitfield-distribution/Cargo.toml +++ b/node/network/bitfield-distribution/Cargo.toml @@ -7,27 +7,20 @@ edition = "2018" [dependencies] futures = "0.3.5" log = "0.4.11" -#streamunordered = "0.5.1" codec = { package="parity-scale-codec", version = "1.3.4" } -#node-primitives = { package = "polkadot-node-primitives", path = "../../primitives" } polkadot-primitives = { path = "../../../primitives" } polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } -#polkadot-network-bridge = { path = "../../network/bridge" } polkadot-node-network-protocol = { path = "../../network/protocol" } -#sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } [dev-dependencies] -futures-timer = "3.0.2" polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } bitvec = { version = "0.17.4", default-features = false, features = ["alloc"] } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } -parking_lot = "0.11.0" maplit = "1.0.2" -smol = "0.3.3" env_logger = "0.7.1" assert_matches = "1.3.0" tempfile = "3.1.0" diff --git a/node/network/bridge/src/lib.rs b/node/network/bridge/src/lib.rs index d3839c2a7694..a4d490521b6e 100644 --- a/node/network/bridge/src/lib.rs +++ b/node/network/bridge/src/lib.rs @@ -948,7 +948,7 @@ mod tests { futures::pin_mut!(test_fut); futures::pin_mut!(network_bridge); - executor::block_on(future::select(test_fut, network_bridge)); + let _ = executor::block_on(future::select(test_fut, network_bridge)); } async fn assert_sends_validation_event_to_all( diff --git a/node/network/collator-protocol/Cargo.toml b/node/network/collator-protocol/Cargo.toml index a2b37b8a3d89..3b10015e1545 100644 --- a/node/network/collator-protocol/Cargo.toml +++ b/node/network/collator-protocol/Cargo.toml @@ -18,7 +18,6 @@ polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsys [dev-dependencies] env_logger = "0.7.1" assert_matches = "1.3.0" -smol-timeout = "0.1.0" smallvec = "1.4.2" futures-timer = "3.0.2" diff --git a/node/overseer/Cargo.toml b/node/overseer/Cargo.toml index bf0fd7785832..5341cb42e014 100644 --- a/node/overseer/Cargo.toml +++ b/node/overseer/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dependencies] futures = "0.3.5" -log = "0.4.8" +log = "0.4.11" futures-timer = "3.0.2" streamunordered = "0.5.1" polkadot-primitives = { path = "../../primitives" } @@ -21,6 +21,6 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-node-network-protocol = { path = "../network/protocol" } futures = { version = "0.3.5", features = ["thread-pool"] } futures-timer = "3.0.2" -femme = "2.0.1" -log = "0.4.8" -kv-log-macro = "1.0.6" +femme = "2.1.1" +log = "0.4.11" +kv-log-macro = "1.0.7" diff --git a/node/overseer/src/lib.rs b/node/overseer/src/lib.rs index 1bde8d9e54a6..f54535e9e14b 100644 --- a/node/overseer/src/lib.rs +++ b/node/overseer/src/lib.rs @@ -54,7 +54,9 @@ //! .................................................................. //! ``` -#![deny(unused_crate_dependencies, unused_results)] +// #![deny(unused_results)] +// unused dependencies can not work for test and examples at the same time +// yielding false positives #![warn(missing_docs)] use std::fmt::Debug; From 576ff06b7e49f697900c5439a6acbdc82797e87d Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 16:20:42 +0100 Subject: [PATCH 57/62] chore: spaces vs tabs --- node/core/provisioner/src/tests.rs | 704 ++++++++++++++--------------- 1 file changed, 352 insertions(+), 352 deletions(-) diff --git a/node/core/provisioner/src/tests.rs b/node/core/provisioner/src/tests.rs index d32782a07e87..d0df7f5329f0 100644 --- a/node/core/provisioner/src/tests.rs +++ b/node/core/provisioner/src/tests.rs @@ -3,375 +3,375 @@ use bitvec::bitvec; use polkadot_primitives::v1::{OccupiedCore, ScheduledCore}; pub fn occupied_core(para_id: u32) -> CoreState { - CoreState::Occupied(OccupiedCore { - para_id: para_id.into(), - group_responsible: para_id.into(), - next_up_on_available: None, - occupied_since: 100_u32, - time_out_at: 200_u32, - next_up_on_time_out: None, - availability: default_bitvec(), - }) + CoreState::Occupied(OccupiedCore { + para_id: para_id.into(), + group_responsible: para_id.into(), + next_up_on_available: None, + occupied_since: 100_u32, + time_out_at: 200_u32, + next_up_on_time_out: None, + availability: default_bitvec(), + }) } pub fn build_occupied_core(para_id: u32, builder: Builder) -> CoreState where - Builder: FnOnce(&mut OccupiedCore), + Builder: FnOnce(&mut OccupiedCore), { - let mut core = match occupied_core(para_id) { - CoreState::Occupied(core) => core, - _ => unreachable!(), - }; + let mut core = match occupied_core(para_id) { + CoreState::Occupied(core) => core, + _ => unreachable!(), + }; - builder(&mut core); + builder(&mut core); - CoreState::Occupied(core) + CoreState::Occupied(core) } pub fn default_bitvec() -> CoreAvailability { - bitvec![bitvec::order::Lsb0, u8; 0; 32] + bitvec![bitvec::order::Lsb0, u8; 0; 32] } pub fn scheduled_core(id: u32) -> ScheduledCore { - ScheduledCore { - para_id: id.into(), - ..Default::default() - } + ScheduledCore { + para_id: id.into(), + ..Default::default() + } } mod select_availability_bitfields { - use super::super::*; - use super::{default_bitvec, occupied_core}; - use futures::executor::block_on; - use std::sync::Arc; - use polkadot_primitives::v1::{SigningContext, ValidatorIndex, ValidatorId}; - use sp_application_crypto::AppKey; - use sp_keystore::{CryptoStore, SyncCryptoStorePtr}; - use sc_keystore::LocalKeystore; - - async fn signed_bitfield( - keystore: &SyncCryptoStorePtr, - field: CoreAvailability, - validator_idx: ValidatorIndex, - ) -> SignedAvailabilityBitfield { - let public = CryptoStore::sr25519_generate_new(&**keystore, ValidatorId::ID, None) - .await - .expect("generated sr25519 key"); - SignedAvailabilityBitfield::sign( - &keystore, - field.into(), - &>::default(), - validator_idx, - &public.into(), - ).await.expect("Should be signed") - } - - #[test] - fn not_more_than_one_per_validator() { - // Configure filesystem-based keystore as generating keys without seed - // would trigger the key to be generated on the filesystem. - let keystore_path = tempfile::tempdir().expect("Creates keystore path"); - let keystore : SyncCryptoStorePtr = Arc::new(LocalKeystore::open(keystore_path.path(), None) - .expect("Creates keystore")); - let bitvec = default_bitvec(); - - let cores = vec![occupied_core(0), occupied_core(1)]; - - // we pass in three bitfields with two validators - // this helps us check the postcondition that we get two bitfields back, for which the validators differ - let bitfields = vec![ - block_on(signed_bitfield(&keystore, bitvec.clone(), 0)), - block_on(signed_bitfield(&keystore, bitvec.clone(), 1)), - block_on(signed_bitfield(&keystore, bitvec, 1)), - ]; - - let mut selected_bitfields = select_availability_bitfields(&cores, &bitfields); - selected_bitfields.sort_by_key(|bitfield| bitfield.validator_index()); - - assert_eq!(selected_bitfields.len(), 2); - assert_eq!(selected_bitfields[0], bitfields[0]); - // we don't know which of the (otherwise equal) bitfields will be selected - assert!(selected_bitfields[1] == bitfields[1] || selected_bitfields[1] == bitfields[2]); - } - - #[test] - fn each_corresponds_to_an_occupied_core() { - // Configure filesystem-based keystore as generating keys without seed - // would trigger the key to be generated on the filesystem. - let keystore_path = tempfile::tempdir().expect("Creates keystore path"); - let keystore : SyncCryptoStorePtr = Arc::new(LocalKeystore::open(keystore_path.path(), None) - .expect("Creates keystore")); - let bitvec = default_bitvec(); - - let cores = vec![CoreState::Free, CoreState::Scheduled(Default::default())]; - - let bitfields = vec![ - block_on(signed_bitfield(&keystore, bitvec.clone(), 0)), - block_on(signed_bitfield(&keystore, bitvec.clone(), 1)), - block_on(signed_bitfield(&keystore, bitvec, 1)), - ]; - - let mut selected_bitfields = select_availability_bitfields(&cores, &bitfields); - selected_bitfields.sort_by_key(|bitfield| bitfield.validator_index()); - - // bitfields not corresponding to occupied cores are not selected - assert!(selected_bitfields.is_empty()); - } - - #[test] - fn more_set_bits_win_conflicts() { - // Configure filesystem-based keystore as generating keys without seed - // would trigger the key to be generated on the filesystem. - let keystore_path = tempfile::tempdir().expect("Creates keystore path"); - let keystore : SyncCryptoStorePtr = Arc::new(LocalKeystore::open(keystore_path.path(), None) - .expect("Creates keystore")); - let bitvec_zero = default_bitvec(); - let bitvec_one = { - let mut bitvec = bitvec_zero.clone(); - bitvec.set(0, true); - bitvec - }; - - let cores = vec![occupied_core(0)]; - - let bitfields = vec![ - block_on(signed_bitfield(&keystore, bitvec_zero, 0)), - block_on(signed_bitfield(&keystore, bitvec_one.clone(), 0)), - ]; - - // this test is probablistic: chances are excellent that it does what it claims to. - // it cannot fail unless things are broken. - // however, there is a (very small) chance that it passes when things are broken. - for _ in 0..64 { - let selected_bitfields = select_availability_bitfields(&cores, &bitfields); - assert_eq!(selected_bitfields.len(), 1); - assert_eq!(selected_bitfields[0].payload().0, bitvec_one); - } - } + use super::super::*; + use super::{default_bitvec, occupied_core}; + use futures::executor::block_on; + use std::sync::Arc; + use polkadot_primitives::v1::{SigningContext, ValidatorIndex, ValidatorId}; + use sp_application_crypto::AppKey; + use sp_keystore::{CryptoStore, SyncCryptoStorePtr}; + use sc_keystore::LocalKeystore; + + async fn signed_bitfield( + keystore: &SyncCryptoStorePtr, + field: CoreAvailability, + validator_idx: ValidatorIndex, + ) -> SignedAvailabilityBitfield { + let public = CryptoStore::sr25519_generate_new(&**keystore, ValidatorId::ID, None) + .await + .expect("generated sr25519 key"); + SignedAvailabilityBitfield::sign( + &keystore, + field.into(), + &>::default(), + validator_idx, + &public.into(), + ).await.expect("Should be signed") + } + + #[test] + fn not_more_than_one_per_validator() { + // Configure filesystem-based keystore as generating keys without seed + // would trigger the key to be generated on the filesystem. + let keystore_path = tempfile::tempdir().expect("Creates keystore path"); + let keystore : SyncCryptoStorePtr = Arc::new(LocalKeystore::open(keystore_path.path(), None) + .expect("Creates keystore")); + let bitvec = default_bitvec(); + + let cores = vec![occupied_core(0), occupied_core(1)]; + + // we pass in three bitfields with two validators + // this helps us check the postcondition that we get two bitfields back, for which the validators differ + let bitfields = vec![ + block_on(signed_bitfield(&keystore, bitvec.clone(), 0)), + block_on(signed_bitfield(&keystore, bitvec.clone(), 1)), + block_on(signed_bitfield(&keystore, bitvec, 1)), + ]; + + let mut selected_bitfields = select_availability_bitfields(&cores, &bitfields); + selected_bitfields.sort_by_key(|bitfield| bitfield.validator_index()); + + assert_eq!(selected_bitfields.len(), 2); + assert_eq!(selected_bitfields[0], bitfields[0]); + // we don't know which of the (otherwise equal) bitfields will be selected + assert!(selected_bitfields[1] == bitfields[1] || selected_bitfields[1] == bitfields[2]); + } + + #[test] + fn each_corresponds_to_an_occupied_core() { + // Configure filesystem-based keystore as generating keys without seed + // would trigger the key to be generated on the filesystem. + let keystore_path = tempfile::tempdir().expect("Creates keystore path"); + let keystore : SyncCryptoStorePtr = Arc::new(LocalKeystore::open(keystore_path.path(), None) + .expect("Creates keystore")); + let bitvec = default_bitvec(); + + let cores = vec![CoreState::Free, CoreState::Scheduled(Default::default())]; + + let bitfields = vec![ + block_on(signed_bitfield(&keystore, bitvec.clone(), 0)), + block_on(signed_bitfield(&keystore, bitvec.clone(), 1)), + block_on(signed_bitfield(&keystore, bitvec, 1)), + ]; + + let mut selected_bitfields = select_availability_bitfields(&cores, &bitfields); + selected_bitfields.sort_by_key(|bitfield| bitfield.validator_index()); + + // bitfields not corresponding to occupied cores are not selected + assert!(selected_bitfields.is_empty()); + } + + #[test] + fn more_set_bits_win_conflicts() { + // Configure filesystem-based keystore as generating keys without seed + // would trigger the key to be generated on the filesystem. + let keystore_path = tempfile::tempdir().expect("Creates keystore path"); + let keystore : SyncCryptoStorePtr = Arc::new(LocalKeystore::open(keystore_path.path(), None) + .expect("Creates keystore")); + let bitvec_zero = default_bitvec(); + let bitvec_one = { + let mut bitvec = bitvec_zero.clone(); + bitvec.set(0, true); + bitvec + }; + + let cores = vec![occupied_core(0)]; + + let bitfields = vec![ + block_on(signed_bitfield(&keystore, bitvec_zero, 0)), + block_on(signed_bitfield(&keystore, bitvec_one.clone(), 0)), + ]; + + // this test is probablistic: chances are excellent that it does what it claims to. + // it cannot fail unless things are broken. + // however, there is a (very small) chance that it passes when things are broken. + for _ in 0..64 { + let selected_bitfields = select_availability_bitfields(&cores, &bitfields); + assert_eq!(selected_bitfields.len(), 1); + assert_eq!(selected_bitfields[0].payload().0, bitvec_one); + } + } } mod select_candidates { - use futures_timer::Delay; - use super::super::*; - use super::{build_occupied_core, default_bitvec, occupied_core, scheduled_core}; - use polkadot_node_subsystem::messages::RuntimeApiRequest::{ - AvailabilityCores, PersistedValidationData as PersistedValidationDataReq, - }; - use polkadot_primitives::v1::{ - BlockNumber, CandidateDescriptor, CommittedCandidateReceipt, PersistedValidationData, - }; - use FromJob::{ChainApi, Runtime}; - - const BLOCK_UNDER_PRODUCTION: BlockNumber = 128; - - fn test_harness( - overseer_factory: OverseerFactory, - test_factory: TestFactory, - ) where - OverseerFactory: FnOnce(mpsc::Receiver) -> Overseer, - Overseer: Future, - TestFactory: FnOnce(mpsc::Sender) -> Test, - Test: Future, - { - let (tx, rx) = mpsc::channel(64); - let overseer = overseer_factory(rx); - let test = test_factory(tx); - - futures::pin_mut!(overseer, test); - - let _ = futures::executor::block_on(future::select(overseer, test)); - } - - // For test purposes, we always return this set of availability cores: - // - // [ - // 0: Free, - // 1: Scheduled(default), - // 2: Occupied(no next_up set), - // 3: Occupied(next_up_on_available set but not available), - // 4: Occupied(next_up_on_available set and available), - // 5: Occupied(next_up_on_time_out set but not timeout), - // 6: Occupied(next_up_on_time_out set and timeout but available), - // 7: Occupied(next_up_on_time_out set and timeout and not available), - // 8: Occupied(both next_up set, available), - // 9: Occupied(both next_up set, not available, no timeout), - // 10: Occupied(both next_up set, not available, timeout), - // 11: Occupied(next_up_on_available and available, but different successor para_id) - // ] - fn mock_availability_cores() -> Vec { - use std::ops::Not; - use CoreState::{Free, Scheduled}; - - vec![ - // 0: Free, - Free, - // 1: Scheduled(default), - Scheduled(scheduled_core(1)), - // 2: Occupied(no next_up set), - occupied_core(2), - // 3: Occupied(next_up_on_available set but not available), - build_occupied_core(3, |core| { - core.next_up_on_available = Some(scheduled_core(3)); - }), - // 4: Occupied(next_up_on_available set and available), - build_occupied_core(4, |core| { - core.next_up_on_available = Some(scheduled_core(4)); - core.availability = core.availability.clone().not(); - }), - // 5: Occupied(next_up_on_time_out set but not timeout), - build_occupied_core(5, |core| { - core.next_up_on_time_out = Some(scheduled_core(5)); - }), - // 6: Occupied(next_up_on_time_out set and timeout but available), - build_occupied_core(6, |core| { - core.next_up_on_time_out = Some(scheduled_core(6)); - core.time_out_at = BLOCK_UNDER_PRODUCTION; - core.availability = core.availability.clone().not(); - }), - // 7: Occupied(next_up_on_time_out set and timeout and not available), - build_occupied_core(7, |core| { - core.next_up_on_time_out = Some(scheduled_core(7)); - core.time_out_at = BLOCK_UNDER_PRODUCTION; - }), - // 8: Occupied(both next_up set, available), - build_occupied_core(8, |core| { - core.next_up_on_available = Some(scheduled_core(8)); - core.next_up_on_time_out = Some(scheduled_core(8)); - core.availability = core.availability.clone().not(); - }), - // 9: Occupied(both next_up set, not available, no timeout), - build_occupied_core(9, |core| { - core.next_up_on_available = Some(scheduled_core(9)); - core.next_up_on_time_out = Some(scheduled_core(9)); - }), - // 10: Occupied(both next_up set, not available, timeout), - build_occupied_core(10, |core| { - core.next_up_on_available = Some(scheduled_core(10)); - core.next_up_on_time_out = Some(scheduled_core(10)); - core.time_out_at = BLOCK_UNDER_PRODUCTION; - }), - // 11: Occupied(next_up_on_available and available, but different successor para_id) - build_occupied_core(11, |core| { - core.next_up_on_available = Some(scheduled_core(12)); - core.availability = core.availability.clone().not(); - }), - ] - } - - async fn mock_overseer(mut receiver: mpsc::Receiver) { - use ChainApiMessage::BlockNumber; - use RuntimeApiMessage::Request; - - while let Some(from_job) = receiver.next().await { - match from_job { - ChainApi(BlockNumber(_relay_parent, tx)) => { - tx.send(Ok(Some(BLOCK_UNDER_PRODUCTION - 1))).unwrap() - } - Runtime(Request( - _parent_hash, - PersistedValidationDataReq(_para_id, _assumption, tx), - )) => tx.send(Ok(Some(Default::default()))).unwrap(), - Runtime(Request(_parent_hash, AvailabilityCores(tx))) => { - tx.send(Ok(mock_availability_cores())).unwrap() - } - // non-exhaustive matches are fine for testing - _ => unimplemented!(), - } - } - } - - #[test] - fn handles_overseer_failure() { - let overseer = |rx: mpsc::Receiver| async move { - // drop the receiver so it closes and the sender can't send, then just sleep long enough that - // this is almost certainly not the first of the two futures to complete - std::mem::drop(rx); - Delay::new(std::time::Duration::from_secs(1)).await; - }; - - let test = |mut tx: mpsc::Sender| async move { - // wait so that the overseer can drop the rx before we attempt to send - Delay::new(std::time::Duration::from_millis(50)).await; - let result = select_candidates(&[], &[], &[], Default::default(), &mut tx).await; - println!("{:?}", result); - assert!(std::matches!(result, Err(Error::ChainApiMessageSend(_)))); - }; - - test_harness(overseer, test); - } - - #[test] - fn can_succeed() { - test_harness(mock_overseer, |mut tx: mpsc::Sender| async move { - let result = select_candidates(&[], &[], &[], Default::default(), &mut tx).await; - println!("{:?}", result); - assert!(result.is_ok()); - }) - } - - // this tests that only the appropriate candidates get selected. - // To accomplish this, we supply a candidate list containing one candidate per possible core; - // the candidate selection algorithm must filter them to the appropriate set - #[test] - fn selects_correct_candidates() { - let mock_cores = mock_availability_cores(); - - let empty_hash = PersistedValidationData::::default().hash(); - - let candidate_template = BackedCandidate { - candidate: CommittedCandidateReceipt { - descriptor: CandidateDescriptor { - persisted_validation_data_hash: empty_hash, - ..Default::default() - }, - ..Default::default() - }, - validity_votes: Vec::new(), - validator_indices: default_bitvec(), - }; - - let candidates: Vec<_> = std::iter::repeat(candidate_template) - .take(mock_cores.len()) - .enumerate() - .map(|(idx, mut candidate)| { - candidate.candidate.descriptor.para_id = idx.into(); - candidate - }) - .cycle() - .take(mock_cores.len() * 3) - .enumerate() - .map(|(idx, mut candidate)| { - if idx < mock_cores.len() { - // first go-around: use candidates which should work - candidate - } else if idx < mock_cores.len() * 2 { - // for the second repetition of the candidates, give them the wrong hash - candidate.candidate.descriptor.persisted_validation_data_hash - = Default::default(); - candidate - } else { - // third go-around: right hash, wrong para_id - candidate.candidate.descriptor.para_id = idx.into(); - candidate - } - }) - .collect(); - - // why those particular indices? see the comments on mock_availability_cores() - let expected_candidates: Vec<_> = [1, 4, 7, 8, 10] - .iter() - .map(|&idx| candidates[idx].clone()) - .collect(); - - test_harness(mock_overseer, |mut tx: mpsc::Sender| async move { - let result = - select_candidates(&mock_cores, &[], &candidates, Default::default(), &mut tx) - .await; - - if result.is_err() { - println!("{:?}", result); - } - assert_eq!(result.unwrap(), expected_candidates); - }) - } + use futures_timer::Delay; + use super::super::*; + use super::{build_occupied_core, default_bitvec, occupied_core, scheduled_core}; + use polkadot_node_subsystem::messages::RuntimeApiRequest::{ + AvailabilityCores, PersistedValidationData as PersistedValidationDataReq, + }; + use polkadot_primitives::v1::{ + BlockNumber, CandidateDescriptor, CommittedCandidateReceipt, PersistedValidationData, + }; + use FromJob::{ChainApi, Runtime}; + + const BLOCK_UNDER_PRODUCTION: BlockNumber = 128; + + fn test_harness( + overseer_factory: OverseerFactory, + test_factory: TestFactory, + ) where + OverseerFactory: FnOnce(mpsc::Receiver) -> Overseer, + Overseer: Future, + TestFactory: FnOnce(mpsc::Sender) -> Test, + Test: Future, + { + let (tx, rx) = mpsc::channel(64); + let overseer = overseer_factory(rx); + let test = test_factory(tx); + + futures::pin_mut!(overseer, test); + + let _ = futures::executor::block_on(future::select(overseer, test)); + } + + // For test purposes, we always return this set of availability cores: + // + // [ + // 0: Free, + // 1: Scheduled(default), + // 2: Occupied(no next_up set), + // 3: Occupied(next_up_on_available set but not available), + // 4: Occupied(next_up_on_available set and available), + // 5: Occupied(next_up_on_time_out set but not timeout), + // 6: Occupied(next_up_on_time_out set and timeout but available), + // 7: Occupied(next_up_on_time_out set and timeout and not available), + // 8: Occupied(both next_up set, available), + // 9: Occupied(both next_up set, not available, no timeout), + // 10: Occupied(both next_up set, not available, timeout), + // 11: Occupied(next_up_on_available and available, but different successor para_id) + // ] + fn mock_availability_cores() -> Vec { + use std::ops::Not; + use CoreState::{Free, Scheduled}; + + vec![ + // 0: Free, + Free, + // 1: Scheduled(default), + Scheduled(scheduled_core(1)), + // 2: Occupied(no next_up set), + occupied_core(2), + // 3: Occupied(next_up_on_available set but not available), + build_occupied_core(3, |core| { + core.next_up_on_available = Some(scheduled_core(3)); + }), + // 4: Occupied(next_up_on_available set and available), + build_occupied_core(4, |core| { + core.next_up_on_available = Some(scheduled_core(4)); + core.availability = core.availability.clone().not(); + }), + // 5: Occupied(next_up_on_time_out set but not timeout), + build_occupied_core(5, |core| { + core.next_up_on_time_out = Some(scheduled_core(5)); + }), + // 6: Occupied(next_up_on_time_out set and timeout but available), + build_occupied_core(6, |core| { + core.next_up_on_time_out = Some(scheduled_core(6)); + core.time_out_at = BLOCK_UNDER_PRODUCTION; + core.availability = core.availability.clone().not(); + }), + // 7: Occupied(next_up_on_time_out set and timeout and not available), + build_occupied_core(7, |core| { + core.next_up_on_time_out = Some(scheduled_core(7)); + core.time_out_at = BLOCK_UNDER_PRODUCTION; + }), + // 8: Occupied(both next_up set, available), + build_occupied_core(8, |core| { + core.next_up_on_available = Some(scheduled_core(8)); + core.next_up_on_time_out = Some(scheduled_core(8)); + core.availability = core.availability.clone().not(); + }), + // 9: Occupied(both next_up set, not available, no timeout), + build_occupied_core(9, |core| { + core.next_up_on_available = Some(scheduled_core(9)); + core.next_up_on_time_out = Some(scheduled_core(9)); + }), + // 10: Occupied(both next_up set, not available, timeout), + build_occupied_core(10, |core| { + core.next_up_on_available = Some(scheduled_core(10)); + core.next_up_on_time_out = Some(scheduled_core(10)); + core.time_out_at = BLOCK_UNDER_PRODUCTION; + }), + // 11: Occupied(next_up_on_available and available, but different successor para_id) + build_occupied_core(11, |core| { + core.next_up_on_available = Some(scheduled_core(12)); + core.availability = core.availability.clone().not(); + }), + ] + } + + async fn mock_overseer(mut receiver: mpsc::Receiver) { + use ChainApiMessage::BlockNumber; + use RuntimeApiMessage::Request; + + while let Some(from_job) = receiver.next().await { + match from_job { + ChainApi(BlockNumber(_relay_parent, tx)) => { + tx.send(Ok(Some(BLOCK_UNDER_PRODUCTION - 1))).unwrap() + } + Runtime(Request( + _parent_hash, + PersistedValidationDataReq(_para_id, _assumption, tx), + )) => tx.send(Ok(Some(Default::default()))).unwrap(), + Runtime(Request(_parent_hash, AvailabilityCores(tx))) => { + tx.send(Ok(mock_availability_cores())).unwrap() + } + // non-exhaustive matches are fine for testing + _ => unimplemented!(), + } + } + } + + #[test] + fn handles_overseer_failure() { + let overseer = |rx: mpsc::Receiver| async move { + // drop the receiver so it closes and the sender can't send, then just sleep long enough that + // this is almost certainly not the first of the two futures to complete + std::mem::drop(rx); + Delay::new(std::time::Duration::from_secs(1)).await; + }; + + let test = |mut tx: mpsc::Sender| async move { + // wait so that the overseer can drop the rx before we attempt to send + Delay::new(std::time::Duration::from_millis(50)).await; + let result = select_candidates(&[], &[], &[], Default::default(), &mut tx).await; + println!("{:?}", result); + assert!(std::matches!(result, Err(Error::ChainApiMessageSend(_)))); + }; + + test_harness(overseer, test); + } + + #[test] + fn can_succeed() { + test_harness(mock_overseer, |mut tx: mpsc::Sender| async move { + let result = select_candidates(&[], &[], &[], Default::default(), &mut tx).await; + println!("{:?}", result); + assert!(result.is_ok()); + }) + } + + // this tests that only the appropriate candidates get selected. + // To accomplish this, we supply a candidate list containing one candidate per possible core; + // the candidate selection algorithm must filter them to the appropriate set + #[test] + fn selects_correct_candidates() { + let mock_cores = mock_availability_cores(); + + let empty_hash = PersistedValidationData::::default().hash(); + + let candidate_template = BackedCandidate { + candidate: CommittedCandidateReceipt { + descriptor: CandidateDescriptor { + persisted_validation_data_hash: empty_hash, + ..Default::default() + }, + ..Default::default() + }, + validity_votes: Vec::new(), + validator_indices: default_bitvec(), + }; + + let candidates: Vec<_> = std::iter::repeat(candidate_template) + .take(mock_cores.len()) + .enumerate() + .map(|(idx, mut candidate)| { + candidate.candidate.descriptor.para_id = idx.into(); + candidate + }) + .cycle() + .take(mock_cores.len() * 3) + .enumerate() + .map(|(idx, mut candidate)| { + if idx < mock_cores.len() { + // first go-around: use candidates which should work + candidate + } else if idx < mock_cores.len() * 2 { + // for the second repetition of the candidates, give them the wrong hash + candidate.candidate.descriptor.persisted_validation_data_hash + = Default::default(); + candidate + } else { + // third go-around: right hash, wrong para_id + candidate.candidate.descriptor.para_id = idx.into(); + candidate + } + }) + .collect(); + + // why those particular indices? see the comments on mock_availability_cores() + let expected_candidates: Vec<_> = [1, 4, 7, 8, 10] + .iter() + .map(|&idx| candidates[idx].clone()) + .collect(); + + test_harness(mock_overseer, |mut tx: mpsc::Sender| async move { + let result = + select_candidates(&mock_cores, &[], &candidates, Default::default(), &mut tx) + .await; + + if result.is_err() { + println!("{:?}", result); + } + assert_eq!(result.unwrap(), expected_candidates); + }) + } } From 3dc8e30964a68c4318e57c037c823a773b124a62 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 16:24:06 +0100 Subject: [PATCH 58/62] review comments. --- Cargo.lock | 1 - node/network/bridge/Cargo.toml | 3 +-- node/network/bridge/src/lib.rs | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d2f15ea4a3d2..1308bc36f88b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4776,7 +4776,6 @@ dependencies = [ "sp-core", "sp-keyring", "sp-runtime", - "streamunordered", ] [[package]] diff --git a/node/network/bridge/Cargo.toml b/node/network/bridge/Cargo.toml index bf6eaf81f7a7..32b41133574c 100644 --- a/node/network/bridge/Cargo.toml +++ b/node/network/bridge/Cargo.toml @@ -7,8 +7,7 @@ edition = "2018" [dependencies] async-trait = "0.1" futures = "0.3.5" -log = "0.4.8" -streamunordered = "0.5.1" +log = "0.4.11" polkadot-primitives = { path = "../../../primitives" } parity-scale-codec = "1.3.4" sc-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/network/bridge/src/lib.rs b/node/network/bridge/src/lib.rs index a4d490521b6e..86098b4477e6 100644 --- a/node/network/bridge/src/lib.rs +++ b/node/network/bridge/src/lib.rs @@ -19,7 +19,6 @@ #![deny(unused_crate_dependencies, unused_results)] #![warn(missing_docs)] -use streamunordered as _; use parity_scale_codec::{Encode, Decode}; use futures::prelude::*; From 97237522d41bb908ae13bd39309725da06806d1e Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 16:55:33 +0100 Subject: [PATCH 59/62] 3 -> 3u32 --- runtime/common/src/crowdfund.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/common/src/crowdfund.rs b/runtime/common/src/crowdfund.rs index 139b09ac3d7f..c3f96f17285d 100644 --- a/runtime/common/src/crowdfund.rs +++ b/runtime/common/src/crowdfund.rs @@ -269,7 +269,7 @@ decl_module! { let owner = ensure_signed(origin)?; ensure!(first_slot < last_slot, Error::::LastSlotBeforeFirstSlot); - ensure!(last_slot <= first_slot + 3.into(), Error::::LastSlotTooFarInFuture); + ensure!(last_slot <= first_slot + 3u32.into(), Error::::LastSlotTooFarInFuture); ensure!(end > >::block_number(), Error::::CannotEndInPast); let deposit = T::SubmissionDeposit::get(); From 4d93bfbb08e9f06b2230282bde19e86d25af8edc Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 16:56:53 +0100 Subject: [PATCH 60/62] update substrate to d766e229466d63afadd19097e277d85146fee3c9" --- Cargo.lock | 272 ++++++++++++++++++++++++++--------------------------- 1 file changed, 136 insertions(+), 136 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1308bc36f88b..d5d517df1882 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1430,7 +1430,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "parity-scale-codec", ] @@ -1438,7 +1438,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-support", "frame-system", @@ -1456,7 +1456,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "chrono", "frame-benchmarking", @@ -1476,7 +1476,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-support", "frame-system", @@ -1492,7 +1492,7 @@ dependencies = [ [[package]] name = "frame-metadata" version = "12.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "parity-scale-codec", "serde", @@ -1503,7 +1503,7 @@ dependencies = [ [[package]] name = "frame-support" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "bitmask", "frame-metadata", @@ -1528,7 +1528,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-support-procedural-tools", "proc-macro2 1.0.18", @@ -1539,7 +1539,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -1551,7 +1551,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", @@ -1561,7 +1561,7 @@ dependencies = [ [[package]] name = "frame-system" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -1577,7 +1577,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -1591,7 +1591,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "parity-scale-codec", "sp-api", @@ -3753,7 +3753,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-support", "frame-system", @@ -3769,7 +3769,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-support", "frame-system", @@ -3784,7 +3784,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -3809,7 +3809,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -3823,7 +3823,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -3839,7 +3839,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -3854,7 +3854,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -3869,7 +3869,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -3890,7 +3890,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "enumflags2", "frame-benchmarking", @@ -3906,7 +3906,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -3926,7 +3926,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -3943,7 +3943,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-support", "frame-system", @@ -3957,7 +3957,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -3973,7 +3973,7 @@ dependencies = [ [[package]] name = "pallet-nicks" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-support", "frame-system", @@ -3987,7 +3987,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-support", "frame-system", @@ -4002,7 +4002,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -4023,7 +4023,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -4039,7 +4039,7 @@ dependencies = [ [[package]] name = "pallet-randomness-collective-flip" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-support", "frame-system", @@ -4052,7 +4052,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "enumflags2", "frame-support", @@ -4067,7 +4067,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -4082,7 +4082,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-support", "frame-system", @@ -4102,7 +4102,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -4118,7 +4118,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-support", "frame-system", @@ -4132,7 +4132,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -4154,7 +4154,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.18", @@ -4165,7 +4165,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-support", "frame-system", @@ -4179,7 +4179,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -4197,7 +4197,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-support", "frame-system", @@ -4214,7 +4214,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -4232,7 +4232,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-support", "parity-scale-codec", @@ -4245,7 +4245,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -4260,7 +4260,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-benchmarking", "frame-support", @@ -4276,7 +4276,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "enumflags2", "frame-benchmarking", @@ -6407,7 +6407,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "async-trait", "bytes 0.5.6", @@ -6437,7 +6437,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -6461,7 +6461,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -6478,7 +6478,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -6499,7 +6499,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.18", @@ -6510,7 +6510,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "ansi_term 0.12.1", "atty", @@ -6564,7 +6564,7 @@ dependencies = [ [[package]] name = "sc-cli-proc-macro" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.18", @@ -6575,7 +6575,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "derive_more", "fnv", @@ -6612,7 +6612,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "blake2-rfc", "hash-db", @@ -6642,7 +6642,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "sc-client-api", "sp-blockchain", @@ -6653,7 +6653,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "derive_more", "fork-tree", @@ -6698,7 +6698,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "derive_more", "futures 0.3.5", @@ -6722,7 +6722,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "fork-tree", "parity-scale-codec", @@ -6735,7 +6735,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -6758,7 +6758,7 @@ dependencies = [ [[package]] name = "sc-consensus-uncles" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "log 0.4.11", "sc-client-api", @@ -6772,7 +6772,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "derive_more", "lazy_static", @@ -6801,7 +6801,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "derive_more", "log 0.4.11", @@ -6818,7 +6818,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "log 0.4.11", "parity-scale-codec", @@ -6833,7 +6833,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "log 0.4.11", "parity-scale-codec", @@ -6851,7 +6851,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "derive_more", "finality-grandpa", @@ -6888,7 +6888,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "derive_more", "finality-grandpa", @@ -6912,7 +6912,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "ansi_term 0.12.1", "futures 0.3.5", @@ -6930,7 +6930,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "async-trait", "derive_more", @@ -6950,7 +6950,7 @@ dependencies = [ [[package]] name = "sc-light" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "hash-db", "lazy_static", @@ -6969,7 +6969,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "async-std", "async-trait", @@ -7023,7 +7023,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -7038,7 +7038,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "bytes 0.5.6", "fnv", @@ -7065,7 +7065,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "futures 0.3.5", "libp2p", @@ -7078,7 +7078,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "log 0.4.11", "substrate-prometheus-endpoint", @@ -7087,7 +7087,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "futures 0.3.5", "hash-db", @@ -7120,7 +7120,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "derive_more", "futures 0.3.5", @@ -7144,7 +7144,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "futures 0.1.29", "jsonrpc-core", @@ -7162,7 +7162,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "derive_more", "directories", @@ -7226,7 +7226,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "log 0.4.11", "parity-scale-codec", @@ -7240,7 +7240,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "jsonrpc-core", "jsonrpc-core-client", @@ -7259,7 +7259,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "futures 0.3.5", "futures-timer 3.0.2", @@ -7280,7 +7280,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "erased-serde", "log 0.4.11", @@ -7299,7 +7299,7 @@ dependencies = [ [[package]] name = "sc-transaction-graph" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "derive_more", "futures 0.3.5", @@ -7320,7 +7320,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "derive_more", "futures 0.3.5", @@ -7740,7 +7740,7 @@ dependencies = [ [[package]] name = "sp-allocator" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "derive_more", "log 0.4.11", @@ -7752,7 +7752,7 @@ dependencies = [ [[package]] name = "sp-api" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "hash-db", "parity-scale-codec", @@ -7767,7 +7767,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "blake2-rfc", "proc-macro-crate", @@ -7779,7 +7779,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "parity-scale-codec", "serde", @@ -7791,7 +7791,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "integer-sqrt", "num-traits 0.2.12", @@ -7804,7 +7804,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "parity-scale-codec", "sp-api", @@ -7816,7 +7816,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "parity-scale-codec", "sp-inherents", @@ -7827,7 +7827,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "parity-scale-codec", "sp-api", @@ -7839,7 +7839,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "derive_more", "log 0.4.11", @@ -7856,7 +7856,7 @@ dependencies = [ [[package]] name = "sp-chain-spec" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "serde", "serde_json", @@ -7865,7 +7865,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "derive_more", "futures 0.3.5", @@ -7891,7 +7891,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "merlin", "parity-scale-codec", @@ -7911,7 +7911,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -7920,7 +7920,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "parity-scale-codec", "schnorrkel", @@ -7932,7 +7932,7 @@ dependencies = [ [[package]] name = "sp-core" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "base58", "blake2-rfc", @@ -7975,7 +7975,7 @@ dependencies = [ [[package]] name = "sp-database" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "kvdb", "parking_lot 0.10.2", @@ -7984,7 +7984,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "proc-macro2 1.0.18", "quote 1.0.7", @@ -7994,7 +7994,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "environmental", "parity-scale-codec", @@ -8005,7 +8005,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "finality-grandpa", "log 0.4.11", @@ -8022,7 +8022,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "derive_more", "parity-scale-codec", @@ -8034,7 +8034,7 @@ dependencies = [ [[package]] name = "sp-io" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "futures 0.3.5", "hash-db", @@ -8058,7 +8058,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "lazy_static", "sp-core", @@ -8069,7 +8069,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "async-trait", "derive_more", @@ -8085,7 +8085,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "parity-scale-codec", "serde", @@ -8097,7 +8097,7 @@ dependencies = [ [[package]] name = "sp-npos-elections-compact" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.18", @@ -8108,7 +8108,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "sp-api", "sp-core", @@ -8118,7 +8118,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "backtrace", "log 0.4.11", @@ -8127,7 +8127,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "serde", "sp-core", @@ -8136,7 +8136,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "either", "hash256-std-hasher", @@ -8158,7 +8158,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "parity-scale-codec", "primitive-types", @@ -8174,7 +8174,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "Inflector", "proc-macro-crate", @@ -8186,7 +8186,7 @@ dependencies = [ [[package]] name = "sp-serializer" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "serde", "serde_json", @@ -8195,7 +8195,7 @@ dependencies = [ [[package]] name = "sp-session" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "parity-scale-codec", "sp-api", @@ -8208,7 +8208,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "parity-scale-codec", "sp-runtime", @@ -8218,7 +8218,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "hash-db", "log 0.4.11", @@ -8239,12 +8239,12 @@ dependencies = [ [[package]] name = "sp-std" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" [[package]] name = "sp-storage" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8257,7 +8257,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "log 0.4.11", "sp-core", @@ -8270,7 +8270,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -8284,7 +8284,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "log 0.4.11", "parity-scale-codec", @@ -8297,7 +8297,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "derive_more", "futures 0.3.5", @@ -8312,7 +8312,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "hash-db", "memory-db", @@ -8326,7 +8326,7 @@ dependencies = [ [[package]] name = "sp-utils" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "futures 0.3.5", "futures-core", @@ -8338,7 +8338,7 @@ dependencies = [ [[package]] name = "sp-version" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "impl-serde", "parity-scale-codec", @@ -8350,7 +8350,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -8491,7 +8491,7 @@ dependencies = [ [[package]] name = "substrate-browser-utils" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "chrono", "console_error_panic_hook", @@ -8517,7 +8517,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "platforms", ] @@ -8525,7 +8525,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.5", @@ -8548,7 +8548,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "async-std", "derive_more", @@ -8562,7 +8562,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "futures 0.1.29", "futures 0.3.5", @@ -8589,7 +8589,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "2.0.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "futures 0.3.5", "substrate-test-utils-derive", @@ -8599,7 +8599,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.8.0" -source = "git+https://github.com/paritytech/substrate#668390ae5a3cda309f37d5584e81dee522b883c8" +source = "git+https://github.com/paritytech/substrate#d766e229466d63afadd19097e277d85146fee3c9" dependencies = [ "proc-macro-crate", "quote 1.0.7", From 755f9193a905e94eed9fc065919a1d96e527caf1 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Mon, 26 Oct 2020 17:52:25 +0100 Subject: [PATCH 61/62] add u32 type annotations --- runtime/common/src/claims.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/runtime/common/src/claims.rs b/runtime/common/src/claims.rs index 0af1ec143afc..b01babaa6401 100644 --- a/runtime/common/src/claims.rs +++ b/runtime/common/src/claims.rs @@ -1184,7 +1184,7 @@ mod benchmarking { fn create_claim(input: u32) -> DispatchResult { let secret_key = secp256k1::SecretKey::parse(&keccak_256(&input.encode())).unwrap(); let eth_address = eth(&secret_key); - let vesting = Some((100_000.into(), 1_000.into(), 100.into())); + let vesting = Some((100_000u32.into(), 1_000u32.into(), 100u32.into())); super::Module::::mint_claim(RawOrigin::Root.into(), eth_address, VALUE.into(), vesting, None)?; Ok(()) } @@ -1192,7 +1192,7 @@ mod benchmarking { fn create_claim_attest(input: u32) -> DispatchResult { let secret_key = secp256k1::SecretKey::parse(&keccak_256(&input.encode())).unwrap(); let eth_address = eth(&secret_key); - let vesting = Some((100_000.into(), 1_000.into(), 100.into())); + let vesting = Some((100_000u32.into(), 1_000u32.into(), 100u32.into())); super::Module::::mint_claim( RawOrigin::Root.into(), eth_address, @@ -1218,7 +1218,7 @@ mod benchmarking { let secret_key = secp256k1::SecretKey::parse(&keccak_256(&u.encode())).unwrap(); let eth_address = eth(&secret_key); let account: T::AccountId = account("user", u, SEED); - let vesting = Some((100_000.into(), 1_000.into(), 100.into())); + let vesting = Some((100_000u32.into(), 1_000u32.into(), 100u32.into())); let signature = sig::(&secret_key, &account.encode(), &[][..]); super::Module::::mint_claim(RawOrigin::Root.into(), eth_address, VALUE.into(), vesting, None)?; assert_eq!(Claims::::get(eth_address), Some(VALUE.into())); @@ -1231,7 +1231,7 @@ mod benchmarking { mint_claim { let c in ...; let eth_address = account("eth_address", c, SEED); - let vesting = Some((100_000.into(), 1_000.into(), 100.into())); + let vesting = Some((100_000u32.into(), 1_000u32.into(), 100u32.into())); let statement = StatementKind::Regular; }: _(RawOrigin::Root, eth_address, VALUE.into(), vesting, Some(statement)) verify { @@ -1245,7 +1245,7 @@ mod benchmarking { let secret_key = secp256k1::SecretKey::parse(&keccak_256(&attest_u.encode())).unwrap(); let eth_address = eth(&secret_key); let account: T::AccountId = account("user", u, SEED); - let vesting = Some((100_000.into(), 1_000.into(), 100.into())); + let vesting = Some((100_000u32.into(), 1_000u32.into(), 100u32.into())); let statement = StatementKind::Regular; let signature = sig::(&secret_key, &account.encode(), statement.to_text()); super::Module::::mint_claim(RawOrigin::Root.into(), eth_address, VALUE.into(), vesting, Some(statement))?; @@ -1262,7 +1262,7 @@ mod benchmarking { let secret_key = secp256k1::SecretKey::parse(&keccak_256(&attest_u.encode())).unwrap(); let eth_address = eth(&secret_key); let account: T::AccountId = account("user", u, SEED); - let vesting = Some((100_000.into(), 1_000.into(), 100.into())); + let vesting = Some((100_000u32.into(), 1_000u32.into(), 100u32.into())); let statement = StatementKind::Regular; let signature = sig::(&secret_key, &account.encode(), statement.to_text()); super::Module::::mint_claim(RawOrigin::Root.into(), eth_address, VALUE.into(), vesting, Some(statement))?; From 8eea3b879d34375dc434761e5ace6c1891d4c123 Mon Sep 17 00:00:00 2001 From: Bernhard Schuster Date: Tue, 27 Oct 2020 07:51:00 +0100 Subject: [PATCH 62/62] avoid the pain with cli for now --- cli/Cargo.toml | 5 +++-- cli/src/lib.rs | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cli/Cargo.toml b/cli/Cargo.toml index d000bb94dcc4..a51ea2ae86d4 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -14,8 +14,8 @@ wasm-opt = false crate-type = ["cdylib", "rlib"] [dependencies] -log = "0.4.8" -structopt = "0.3.8" +log = "0.4.11" +structopt = { version = "0.3.8", optional = true } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" } service = { package = "polkadot-service", path = "../node/service", default-features = false, optional = true } @@ -39,6 +39,7 @@ default = [ "wasmtime", "db", "cli", "full-node", "trie-memory-tracker" ] wasmtime = [ "sc-cli/wasmtime" ] db = [ "service/db" ] cli = [ + "structopt", "sc-cli", "sc-service", "frame-benchmarking-cli", diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 7bf23cc4d7af..43b8da81f969 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -17,9 +17,6 @@ //! Polkadot CLI library. #![warn(missing_docs)] -#![deny(unused_crate_dependencies)] - -use sp_trie as _; #[cfg(feature = "browser")] mod browser;