From ed18805e05c152c2be5ff5c594831ebf45f5a48d Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Tue, 4 Oct 2022 10:14:57 +0100 Subject: [PATCH 01/49] Malus: add disputed block percentage * Bump clap to support value_parser with range * Add rand crate and use Bernoulli and Distribution * Add conditional logic based on sampled value from Bernoulli distribution * Add SuggestGarbageCandidateOptions struct --- Cargo.lock | 19 +- node/malus/Cargo.toml | 3 +- node/malus/src/malus.rs | 83 ++++- node/malus/src/variants/mod.rs | 2 +- .../src/variants/suggest_garbage_candidate.rs | 287 +++++++++++------- 5 files changed, 268 insertions(+), 126 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 498c9120c0f1..1f4ec51a3fd9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -919,16 +919,16 @@ dependencies = [ [[package]] name = "clap" -version = "3.1.18" +version = "3.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b" +checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" dependencies = [ "atty", "bitflags", "clap_derive", "clap_lex", "indexmap", - "lazy_static", + "once_cell", "strsim", "termcolor", "textwrap", @@ -936,9 +936,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.1.18" +version = "3.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25320346e922cffe59c0bbc5410c8d8784509efb321488971081313cb1e1a33c" +checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" dependencies = [ "heck", "proc-macro-error", @@ -949,9 +949,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.0" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a37c35f1112dad5e6e0b1adaff798507497a18fceeb30cceb3bae7d1427b9213" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" dependencies = [ "os_str_bytes", ] @@ -7484,6 +7484,7 @@ dependencies = [ "polkadot-node-subsystem-types", "polkadot-node-subsystem-util", "polkadot-primitives", + "rand 0.8.5", "sp-core", "sp-keystore", "tracing-gum", @@ -11384,9 +11385,9 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" [[package]] name = "thiserror" diff --git a/node/malus/Cargo.toml b/node/malus/Cargo.toml index cfc56307b146..b68adef1a1df 100644 --- a/node/malus/Cargo.toml +++ b/node/malus/Cargo.toml @@ -29,11 +29,12 @@ assert_matches = "1.5" async-trait = "0.1.57" sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } -clap = { version = "3.1", features = ["derive"] } +clap = { version = "3.2.21", features = ["derive"] } futures = "0.3.21" futures-timer = "3.0.2" gum = { package = "tracing-gum", path = "../gum/" } erasure = { package = "polkadot-erasure-coding", path = "../../erasure-coding" } +rand = "0.8.5" [features] default = [] diff --git a/node/malus/src/malus.rs b/node/malus/src/malus.rs index dd9f1377f14a..cb0e6465850e 100644 --- a/node/malus/src/malus.rs +++ b/node/malus/src/malus.rs @@ -33,7 +33,7 @@ use variants::*; #[clap(rename_all = "kebab-case")] enum NemesisVariant { /// Suggest a candidate with an invalid proof of validity. - SuggestGarbageCandidate(RunCmd), + SuggestGarbageCandidate(SuggestGarbageCandidateOptions), /// Back a candidate with a specifically crafted proof of validity. BackGarbageCandidate(RunCmd), /// Delayed disputing of ancestors that are perfectly fine. @@ -68,8 +68,11 @@ impl MalusCli { match self.variant { NemesisVariant::BackGarbageCandidate(cmd) => polkadot_cli::run_node(run_cmd(cmd), BackGarbageCandidate, finality_delay)?, - NemesisVariant::SuggestGarbageCandidate(cmd) => - polkadot_cli::run_node(run_cmd(cmd), BackGarbageCandidateWrapper, finality_delay)?, + NemesisVariant::SuggestGarbageCandidate(opts) => polkadot_cli::run_node( + run_cmd(opts.clone().cmd), + BackGarbageCandidateWrapper::new(opts), + finality_delay, + )?, NemesisVariant::DisputeAncestor(opts) => polkadot_cli::run_node( run_cmd(opts.clone().cmd), DisputeValidCandidates::new(opts), @@ -129,4 +132,78 @@ mod tests { assert!(run.cmd.base.bob); }); } + + #[test] + fn percentage_works_suggest_garbage() { + let cli = MalusCli::try_parse_from(IntoIterator::into_iter([ + "malus", + "suggest-garbage-candidate", + "--percentage", + "100", + "--bob", + ])) + .unwrap(); + assert_matches::assert_matches!(cli, MalusCli { + variant: NemesisVariant::SuggestGarbageCandidate(run), + .. + } => { + assert!(run.cmd.base.bob); + }); + } + + #[test] + fn percentage_works_dispute_ancestor() { + let cli = MalusCli::try_parse_from(IntoIterator::into_iter([ + "malus", + "dispute-ancestor", + "--percentage", + "100", + "--bob", + ])) + .unwrap(); + assert_matches::assert_matches!(cli, MalusCli { + variant: NemesisVariant::DisputeAncestor(run), + .. + } => { + assert!(run.cmd.base.bob); + }); + } + + #[test] + #[should_panic] + fn validate_range_for_percentage_suggest() { + let cli = MalusCli::try_parse_from(IntoIterator::into_iter([ + "malus", + "suggest-garbage-candidate", + "--percentage", + "101", + "--bob", + ])) + .unwrap(); + assert_matches::assert_matches!(cli, MalusCli { + variant: NemesisVariant::DisputeAncestor(run), + .. + } => { + assert!(run.cmd.base.bob); + }); + } + + #[test] + #[should_panic] + fn validate_range_for_percentage_dispute() { + let cli = MalusCli::try_parse_from(IntoIterator::into_iter([ + "malus", + "dispute-ancestor", + "--percentage", + "101", + "--bob", + ])) + .unwrap(); + assert_matches::assert_matches!(cli, MalusCli { + variant: NemesisVariant::DisputeAncestor(run), + .. + } => { + assert!(run.cmd.base.bob); + }); + } } diff --git a/node/malus/src/variants/mod.rs b/node/malus/src/variants/mod.rs index d57580fdf8d3..2bda9d32a45a 100644 --- a/node/malus/src/variants/mod.rs +++ b/node/malus/src/variants/mod.rs @@ -24,6 +24,6 @@ mod suggest_garbage_candidate; pub(crate) use self::{ back_garbage_candidate::BackGarbageCandidate, dispute_valid_candidates::{DisputeAncestorOptions, DisputeValidCandidates}, - suggest_garbage_candidate::BackGarbageCandidateWrapper, + suggest_garbage_candidate::{BackGarbageCandidateWrapper, SuggestGarbageCandidateOptions}, }; pub(crate) use common::*; diff --git a/node/malus/src/variants/suggest_garbage_candidate.rs b/node/malus/src/variants/suggest_garbage_candidate.rs index b8aaaa18c10d..f92074ca007c 100644 --- a/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/node/malus/src/variants/suggest_garbage_candidate.rs @@ -29,6 +29,7 @@ use polkadot_cli::{ OverseerConnector, OverseerGen, OverseerGenArgs, OverseerHandle, ParachainHost, ProvideRuntimeApi, }, + RunCmd, }; use polkadot_node_core_candidate_validation::find_validation_data; use polkadot_node_primitives::{AvailableData, BlockData, PoV}; @@ -37,6 +38,8 @@ use polkadot_primitives::v2::{CandidateDescriptor, CandidateHash}; use polkadot_node_subsystem_util::request_validators; use sp_core::traits::SpawnNamed; +use rand::distributions::{Bernoulli, Distribution}; + // Filter wrapping related types. use crate::{ interceptor::*, @@ -71,6 +74,7 @@ struct Inner { struct NoteCandidate { inner: Arc>, spawner: Spawner, + percentage: f64, } impl MessageInterceptor for NoteCandidate @@ -88,131 +92,166 @@ where ) -> Option> { match msg { FromOrchestra::Communication { - msg: CandidateBackingMessage::Second(relay_parent, candidate, _pov), + msg: CandidateBackingMessage::Second(relay_parent, ref candidate, ref _pov), } => { - gum::debug!( + gum::info!( target: MALUS, - candidate_hash = ?candidate.hash(), - ?relay_parent, - "Received request to second candidate" + "😈 Started Malus node with '--percentage' set to: {:?}", + &self.percentage, ); - let pov = PoV { block_data: BlockData(MALICIOUS_POV.into()) }; - - let (sender, receiver) = std::sync::mpsc::channel(); - let mut new_sender = subsystem_sender.clone(); - let _candidate = candidate.clone(); - self.spawner.spawn_blocking( - "malus-get-validation-data", - Some("malus"), - Box::pin(async move { - gum::trace!(target: MALUS, "Requesting validators"); - let n_validators = request_validators(relay_parent, &mut new_sender) - .await - .await - .unwrap() - .unwrap() - .len(); - gum::trace!(target: MALUS, "Validators {}", n_validators); - match find_validation_data(&mut new_sender, &_candidate.descriptor()).await - { - Ok(Some((validation_data, validation_code))) => { - sender - .send((validation_data, validation_code, n_validators)) - .expect("channel is still open"); - }, - _ => { - panic!("Unable to fetch validation data"); - }, - } - }), - ); - - let (validation_data, validation_code, n_validators) = receiver.recv().unwrap(); - - let validation_data_hash = validation_data.hash(); - let validation_code_hash = validation_code.hash(); - let validation_data_relay_parent_number = validation_data.relay_parent_number; - - gum::trace!( + gum::debug!( target: MALUS, candidate_hash = ?candidate.hash(), ?relay_parent, - ?n_validators, - ?validation_data_hash, - ?validation_code_hash, - ?validation_data_relay_parent_number, - "Fetched validation data." + "Received request to second candidate", ); - let malicious_available_data = - AvailableData { pov: Arc::new(pov.clone()), validation_data }; - - let pov_hash = pov.hash(); - let erasure_root = { - let chunks = - erasure::obtain_chunks_v1(n_validators as usize, &malicious_available_data) - .unwrap(); - - let branches = erasure::branches(chunks.as_ref()); - branches.root() - }; - - let (collator_id, collator_signature) = { - use polkadot_primitives::v2::CollatorPair; - use sp_core::crypto::Pair; - - let collator_pair = CollatorPair::generate().0; - let signature_payload = polkadot_primitives::v2::collator_signature_payload( - &relay_parent, - &candidate.descriptor().para_id, - &validation_data_hash, - &pov_hash, - &validation_code_hash, - ); + // Need to draw value from Bernoulli distribution with given probability of success defined by the Clap parameter. + // Note that clap parameter must be f64 since this is expected by the Bernoulli::new() function, hence it must be converted. + let distribution = Bernoulli::new(self.percentage / 100.0).unwrap(); - (collator_pair.public(), collator_pair.sign(&signature_payload)) - }; - - let malicious_commitments = - create_fake_candidate_commitments(&malicious_available_data.validation_data); - - let malicious_candidate = CandidateReceipt { - descriptor: CandidateDescriptor { - para_id: candidate.descriptor().para_id, - relay_parent, - collator: collator_id, - persisted_validation_data_hash: validation_data_hash, - pov_hash, - erasure_root, - signature: collator_signature, - para_head: malicious_commitments.head_data.hash(), - validation_code_hash, - }, - commitments_hash: malicious_commitments.hash(), - }; - let malicious_candidate_hash = malicious_candidate.hash(); + // Draw a random value from the distribution, where T: bool, and probability of drawing a 'true' value is = to percentage parameter, + // using thread_rng as the source of randomness. + let true_or_false = distribution.sample(&mut rand::thread_rng()); gum::debug!( target: MALUS, - candidate_hash = ?candidate.hash(), - ?malicious_candidate_hash, - "Created malicious candidate" + "😈 Sampled value from Bernoulli distribution is: {:?}", + &true_or_false, ); - // Map malicious candidate to the original one. We need this mapping to send back the correct seconded statement - // to the collators. - self.inner - .lock() - .expect("bad lock") - .map - .insert(malicious_candidate_hash, candidate.hash()); + // Manipulate the message if sampled value is true + if true_or_false == true { + gum::info!(target: MALUS, "😈 Manipulating CandidateBackingMessage",); + + let pov = PoV { block_data: BlockData(MALICIOUS_POV.into()) }; + + let (sender, receiver) = std::sync::mpsc::channel(); + let mut new_sender = subsystem_sender.clone(); + let _candidate = candidate.clone(); + self.spawner.spawn_blocking( + "malus-get-validation-data", + Some("malus"), + Box::pin(async move { + gum::trace!(target: MALUS, "Requesting validators"); + let n_validators = request_validators(relay_parent, &mut new_sender) + .await + .await + .unwrap() + .unwrap() + .len(); + gum::trace!(target: MALUS, "Validators {}", n_validators); + match find_validation_data(&mut new_sender, &_candidate.descriptor()) + .await + { + Ok(Some((validation_data, validation_code))) => { + sender + .send((validation_data, validation_code, n_validators)) + .expect("channel is still open"); + }, + _ => { + panic!("Unable to fetch validation data"); + }, + } + }), + ); - let message = FromOrchestra::Communication { - msg: CandidateBackingMessage::Second(relay_parent, malicious_candidate, pov), - }; + let (validation_data, validation_code, n_validators) = receiver.recv().unwrap(); + + let validation_data_hash = validation_data.hash(); + let validation_code_hash = validation_code.hash(); + let validation_data_relay_parent_number = validation_data.relay_parent_number; + + gum::trace!( + target: MALUS, + candidate_hash = ?candidate.hash(), + ?relay_parent, + ?n_validators, + ?validation_data_hash, + ?validation_code_hash, + ?validation_data_relay_parent_number, + "Fetched validation data." + ); - Some(message) + let malicious_available_data = + AvailableData { pov: Arc::new(pov.clone()), validation_data }; + + let pov_hash = pov.hash(); + let erasure_root = { + let chunks = erasure::obtain_chunks_v1( + n_validators as usize, + &malicious_available_data, + ) + .unwrap(); + + let branches = erasure::branches(chunks.as_ref()); + branches.root() + }; + + let (collator_id, collator_signature) = { + use polkadot_primitives::v2::CollatorPair; + use sp_core::crypto::Pair; + + let collator_pair = CollatorPair::generate().0; + let signature_payload = polkadot_primitives::v2::collator_signature_payload( + &relay_parent, + &candidate.descriptor().para_id, + &validation_data_hash, + &pov_hash, + &validation_code_hash, + ); + + (collator_pair.public(), collator_pair.sign(&signature_payload)) + }; + + let malicious_commitments = create_fake_candidate_commitments( + &malicious_available_data.validation_data, + ); + + let malicious_candidate = CandidateReceipt { + descriptor: CandidateDescriptor { + para_id: candidate.descriptor().para_id, + relay_parent, + collator: collator_id, + persisted_validation_data_hash: validation_data_hash, + pov_hash, + erasure_root, + signature: collator_signature, + para_head: malicious_commitments.head_data.hash(), + validation_code_hash, + }, + commitments_hash: malicious_commitments.hash(), + }; + let malicious_candidate_hash = malicious_candidate.hash(); + + gum::debug!( + target: MALUS, + candidate_hash = ?candidate.hash(), + ?malicious_candidate_hash, + "Created malicious candidate" + ); + + // Map malicious candidate to the original one. We need this mapping to send back the correct seconded statement + // to the collators. + self.inner + .lock() + .expect("bad lock") + .map + .insert(malicious_candidate_hash, candidate.hash()); + + let message = FromOrchestra::Communication { + msg: CandidateBackingMessage::Second( + relay_parent, + malicious_candidate, + pov, + ), + }; + + Some(message) + } else { + Some(msg) + } }, FromOrchestra::Communication { msg } => Some(FromOrchestra::Communication { msg }), FromOrchestra::Signal(signal) => Some(FromOrchestra::Signal(signal)), @@ -241,8 +280,30 @@ where } } +#[derive(Clone, Debug, clap::Parser)] +#[clap(rename_all = "kebab-case")] +#[allow(missing_docs)] +pub struct SuggestGarbageCandidateOptions { + /// Determines the percentage of candidates that should be disputed. Allows for fine-tuning + /// the intensity of the behavior of the malicious node. Value must be in the range 0..=100. + #[clap(short, long, ignore_case = true, default_value_t = 100, value_parser = clap::value_parser!(u8).range(0..=100))] + pub percentage: u8, + + #[clap(flatten)] + pub cmd: RunCmd, +} + /// Garbage candidate implementation wrapper which implements `OverseerGen` glue. -pub(crate) struct BackGarbageCandidateWrapper; +pub(crate) struct BackGarbageCandidateWrapper { + /// Options from CLI. + opts: SuggestGarbageCandidateOptions, +} + +impl BackGarbageCandidateWrapper { + pub fn new(opts: SuggestGarbageCandidateOptions) -> Self { + Self { opts } + } +} impl OverseerGen for BackGarbageCandidateWrapper { fn generate<'a, Spawner, RuntimeClient>( @@ -257,9 +318,11 @@ impl OverseerGen for BackGarbageCandidateWrapper { { let inner = Inner { map: std::collections::HashMap::new() }; let inner_mut = Arc::new(Mutex::new(inner)); - let note_candidate = - NoteCandidate { inner: inner_mut.clone(), spawner: SpawnGlue(args.spawner.clone()) }; - + let note_candidate = NoteCandidate { + inner: inner_mut.clone(), + spawner: SpawnGlue(args.spawner.clone()), + percentage: f64::from(self.opts.percentage), + }; let validation_filter = ReplaceValidationResult::new( FakeCandidateValidation::BackingAndApprovalValid, FakeCandidateValidationError::InvalidOutputs, From 1eb3844d2367ac35a133d7797dfa008cb603e947 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Tue, 4 Oct 2022 10:46:04 +0100 Subject: [PATCH 02/49] Cleanup tests --- node/malus/src/malus.rs | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/node/malus/src/malus.rs b/node/malus/src/malus.rs index cb0e6465850e..08924e4b2503 100644 --- a/node/malus/src/malus.rs +++ b/node/malus/src/malus.rs @@ -152,7 +152,8 @@ mod tests { } #[test] - fn percentage_works_dispute_ancestor() { + #[should_panic] + fn percentage_not_working_dispute_ancestor() { let cli = MalusCli::try_parse_from(IntoIterator::into_iter([ "malus", "dispute-ancestor", @@ -171,7 +172,7 @@ mod tests { #[test] #[should_panic] - fn validate_range_for_percentage_suggest() { + fn validate_range_for_percentage() { let cli = MalusCli::try_parse_from(IntoIterator::into_iter([ "malus", "suggest-garbage-candidate", @@ -187,23 +188,4 @@ mod tests { assert!(run.cmd.base.bob); }); } - - #[test] - #[should_panic] - fn validate_range_for_percentage_dispute() { - let cli = MalusCli::try_parse_from(IntoIterator::into_iter([ - "malus", - "dispute-ancestor", - "--percentage", - "101", - "--bob", - ])) - .unwrap(); - assert_matches::assert_matches!(cli, MalusCli { - variant: NemesisVariant::DisputeAncestor(run), - .. - } => { - assert!(run.cmd.base.bob); - }); - } } From f46e97c09ff115f2a414f5b9f532610bd15f23aa Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Tue, 4 Oct 2022 15:08:28 +0100 Subject: [PATCH 03/49] * Replace unwrap with expect and meaningful error message --- node/malus/src/variants/suggest_garbage_candidate.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/malus/src/variants/suggest_garbage_candidate.rs b/node/malus/src/variants/suggest_garbage_candidate.rs index f92074ca007c..08ff5985e6d1 100644 --- a/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/node/malus/src/variants/suggest_garbage_candidate.rs @@ -109,7 +109,7 @@ where // Need to draw value from Bernoulli distribution with given probability of success defined by the Clap parameter. // Note that clap parameter must be f64 since this is expected by the Bernoulli::new() function, hence it must be converted. - let distribution = Bernoulli::new(self.percentage / 100.0).unwrap(); + let distribution = Bernoulli::new(self.percentage / 100.0).expect("Invalid probability! Percentage cannot be < 0 or > 100."); // Draw a random value from the distribution, where T: bool, and probability of drawing a 'true' value is = to percentage parameter, // using thread_rng as the source of randomness. @@ -123,7 +123,7 @@ where // Manipulate the message if sampled value is true if true_or_false == true { - gum::info!(target: MALUS, "😈 Manipulating CandidateBackingMessage",); + gum::info!(target: MALUS, "😈 Intercepted CandidateBackingMessage::Second; crafting a malicious candidate",); let pov = PoV { block_data: BlockData(MALICIOUS_POV.into()) }; From 99bc912941e2afa39dc77b4276119b0b53d82572 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Tue, 4 Oct 2022 18:21:32 +0100 Subject: [PATCH 04/49] * Remove Inner * Remove intercept_outgoing --- .../src/variants/suggest_garbage_candidate.rs | 45 +++---------------- 1 file changed, 5 insertions(+), 40 deletions(-) diff --git a/node/malus/src/variants/suggest_garbage_candidate.rs b/node/malus/src/variants/suggest_garbage_candidate.rs index 08ff5985e6d1..451fd66e0745 100644 --- a/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/node/malus/src/variants/suggest_garbage_candidate.rs @@ -63,16 +63,9 @@ use std::{ sync::{Arc, Mutex}, }; -struct Inner { - /// Maps malicious candidate hash to original candidate hash. - /// It is used to replace outgoing collator protocol seconded messages. - map: HashMap, -} - /// Replace outgoing approval messages with disputes. #[derive(Clone)] struct NoteCandidate { - inner: Arc>, spawner: Spawner, percentage: f64, } @@ -232,14 +225,6 @@ where "Created malicious candidate" ); - // Map malicious candidate to the original one. We need this mapping to send back the correct seconded statement - // to the collators. - self.inner - .lock() - .expect("bad lock") - .map - .insert(malicious_candidate_hash, candidate.hash()); - let message = FromOrchestra::Communication { msg: CandidateBackingMessage::Second( relay_parent, @@ -247,7 +232,6 @@ where pov, ), }; - Some(message) } else { Some(msg) @@ -257,27 +241,11 @@ where FromOrchestra::Signal(signal) => Some(FromOrchestra::Signal(signal)), } } - - fn intercept_outgoing( - &self, - msg: overseer::CandidateBackingOutgoingMessages, - ) -> Option { - let msg = match msg { - overseer::CandidateBackingOutgoingMessages::CollatorProtocolMessage( - CollatorProtocolMessage::Seconded(relay_parent, statement), - ) => { - // `parachain::collator-protocol: received an unexpected `CollationSeconded`: unknown statement statement=...` - // TODO: Fix this error. We get this on colaltors because `malicious backing` creates a candidate that gets backed/included. - // It is harmless for test parachain collators, but it will prevent cumulus based collators to make progress - // as they wait for the relay chain to confirm the seconding of the collation. - overseer::CandidateBackingOutgoingMessages::CollatorProtocolMessage( - CollatorProtocolMessage::Seconded(relay_parent, statement), - ) - }, - msg => msg, - }; - Some(msg) - } + // Comments related to unexpected CollationSeconded: + // `parachain::collator-protocol: received an unexpected `CollationSeconded`: unknown statement statement=...` + // TODO: Fix this error. We get this on colaltors because `malicious backing` creates a candidate that gets backed/included. + // It is harmless for test parachain collators, but it will prevent cumulus based collators to make progress + // as they wait for the relay chain to confirm the seconding of the collation. } #[derive(Clone, Debug, clap::Parser)] @@ -316,10 +284,7 @@ impl OverseerGen for BackGarbageCandidateWrapper { RuntimeClient::Api: ParachainHost + BabeApi + AuthorityDiscoveryApi, Spawner: 'static + SpawnNamed + Clone + Unpin, { - let inner = Inner { map: std::collections::HashMap::new() }; - let inner_mut = Arc::new(Mutex::new(inner)); let note_candidate = NoteCandidate { - inner: inner_mut.clone(), spawner: SpawnGlue(args.spawner.clone()), percentage: f64::from(self.opts.percentage), }; From a259272b08d2cf64b6147e94af8814df2cf2a8b5 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Thu, 6 Oct 2022 16:59:16 +0100 Subject: [PATCH 05/49] * Rename sampled variable * Move info! logs to include candidate hash of malicious candidate --- .../src/variants/suggest_garbage_candidate.rs | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/node/malus/src/variants/suggest_garbage_candidate.rs b/node/malus/src/variants/suggest_garbage_candidate.rs index 451fd66e0745..079631684eba 100644 --- a/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/node/malus/src/variants/suggest_garbage_candidate.rs @@ -106,18 +106,16 @@ where // Draw a random value from the distribution, where T: bool, and probability of drawing a 'true' value is = to percentage parameter, // using thread_rng as the source of randomness. - let true_or_false = distribution.sample(&mut rand::thread_rng()); + let generate_malicious_candidate = distribution.sample(&mut rand::thread_rng()); gum::debug!( target: MALUS, "😈 Sampled value from Bernoulli distribution is: {:?}", - &true_or_false, + &generate_malicious_candidate, ); - // Manipulate the message if sampled value is true - if true_or_false == true { - gum::info!(target: MALUS, "😈 Intercepted CandidateBackingMessage::Second; crafting a malicious candidate",); - + if generate_malicious_candidate == true { + let pov = PoV { block_data: BlockData(MALICIOUS_POV.into()) }; let (sender, receiver) = std::sync::mpsc::channel(); @@ -218,13 +216,6 @@ where }; let malicious_candidate_hash = malicious_candidate.hash(); - gum::debug!( - target: MALUS, - candidate_hash = ?candidate.hash(), - ?malicious_candidate_hash, - "Created malicious candidate" - ); - let message = FromOrchestra::Communication { msg: CandidateBackingMessage::Second( relay_parent, @@ -232,6 +223,14 @@ where pov, ), }; + + gum::info!( + target: MALUS, + candidate_hash = ?candidate.hash(), + ?malicious_candidate_hash, + "😈 Intercepted CandidateBackingMessage::Second and created malicious candidate with hash: {:?}", + &candidate_hash + ); Some(message) } else { Some(msg) From f371e5ee2ab0f3fa81ce03483ea218204821f7dc Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Thu, 6 Oct 2022 17:00:12 +0100 Subject: [PATCH 06/49] * Add percentage option to dispute_ancestor --- node/malus/src/malus.rs | 3 +-- node/malus/src/variants/dispute_valid_candidates.rs | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/node/malus/src/malus.rs b/node/malus/src/malus.rs index 08924e4b2503..61a072045f7e 100644 --- a/node/malus/src/malus.rs +++ b/node/malus/src/malus.rs @@ -152,8 +152,7 @@ mod tests { } #[test] - #[should_panic] - fn percentage_not_working_dispute_ancestor() { + fn percentage_working_dispute_ancestor() { let cli = MalusCli::try_parse_from(IntoIterator::into_iter([ "malus", "dispute-ancestor", diff --git a/node/malus/src/variants/dispute_valid_candidates.rs b/node/malus/src/variants/dispute_valid_candidates.rs index 17ac070e619b..774a162f1904 100644 --- a/node/malus/src/variants/dispute_valid_candidates.rs +++ b/node/malus/src/variants/dispute_valid_candidates.rs @@ -55,6 +55,11 @@ pub struct DisputeAncestorOptions { #[clap(long, arg_enum, ignore_case = true, default_value_t = FakeCandidateValidationError::InvalidOutputs)] pub fake_validation_error: FakeCandidateValidationError, + /// Determines the percentage of candidates that should be disputed. Allows for fine-tuning + /// the intensity of the behavior of the malicious node. Value must be in the range [0..=100]. + #[clap(short, long, ignore_case = true, default_value_t = 100, value_parser = clap::value_parser!(u8).range(0..=100))] + pub percentage: u8, + #[clap(flatten)] pub cmd: RunCmd, } From f3dca6751a615b1d0d0263d9ce6f122203b6855a Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Fri, 7 Oct 2022 14:55:46 +0100 Subject: [PATCH 07/49] * Support static probability for `ReplaceValidationResult` proxy * Update some comments and docs --- node/malus/src/variants/suggest_garbage_candidate.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/node/malus/src/variants/suggest_garbage_candidate.rs b/node/malus/src/variants/suggest_garbage_candidate.rs index 079631684eba..8bdff71885a1 100644 --- a/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/node/malus/src/variants/suggest_garbage_candidate.rs @@ -77,7 +77,7 @@ where { type Message = CandidateBackingMessage; - /// Intercept incoming `Second` requests from the `collator-protocol` subsystem. We take + /// Intercept incoming `Second` requests from the `collator-protocol` subsystem. fn intercept_incoming( &self, subsystem_sender: &mut Sender, @@ -251,7 +251,7 @@ where #[clap(rename_all = "kebab-case")] #[allow(missing_docs)] pub struct SuggestGarbageCandidateOptions { - /// Determines the percentage of candidates that should be disputed. Allows for fine-tuning + /// Determines the percentage of malicious candidates that are suggested. Allows for fine-tuning /// the intensity of the behavior of the malicious node. Value must be in the range 0..=100. #[clap(short, long, ignore_case = true, default_value_t = 100, value_parser = clap::value_parser!(u8).range(0..=100))] pub percentage: u8, @@ -261,18 +261,18 @@ pub struct SuggestGarbageCandidateOptions { } /// Garbage candidate implementation wrapper which implements `OverseerGen` glue. -pub(crate) struct BackGarbageCandidateWrapper { +pub(crate) struct SuggestGarbageCandidateWrapper { /// Options from CLI. opts: SuggestGarbageCandidateOptions, } -impl BackGarbageCandidateWrapper { +impl SuggestGarbageCandidateWrapper { pub fn new(opts: SuggestGarbageCandidateOptions) -> Self { Self { opts } } } -impl OverseerGen for BackGarbageCandidateWrapper { +impl OverseerGen for SuggestGarbageCandidateWrapper { fn generate<'a, Spawner, RuntimeClient>( &self, connector: OverseerConnector, @@ -287,9 +287,11 @@ impl OverseerGen for BackGarbageCandidateWrapper { spawner: SpawnGlue(args.spawner.clone()), percentage: f64::from(self.opts.percentage), }; + let validation_probability = 100.0; let validation_filter = ReplaceValidationResult::new( FakeCandidateValidation::BackingAndApprovalValid, FakeCandidateValidationError::InvalidOutputs, + validation_probability, SpawnGlue(args.spawner.clone()), ); From d08d4053828cccc6fba3e222225e751afe6fe932 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Fri, 7 Oct 2022 14:56:36 +0100 Subject: [PATCH 08/49] * Add `--percentage` to `back-garbage-candidate` variant * Rename structs for consistency --- node/malus/src/malus.rs | 33 +++++++++++++++---- .../src/variants/back_garbage_candidate.rs | 28 ++++++++++++++-- node/malus/src/variants/mod.rs | 6 ++-- 3 files changed, 56 insertions(+), 11 deletions(-) diff --git a/node/malus/src/malus.rs b/node/malus/src/malus.rs index 61a072045f7e..9a7cd4c95420 100644 --- a/node/malus/src/malus.rs +++ b/node/malus/src/malus.rs @@ -35,7 +35,7 @@ enum NemesisVariant { /// Suggest a candidate with an invalid proof of validity. SuggestGarbageCandidate(SuggestGarbageCandidateOptions), /// Back a candidate with a specifically crafted proof of validity. - BackGarbageCandidate(RunCmd), + BackGarbageCandidate(BackGarbageCandidateOptions), /// Delayed disputing of ancestors that are perfectly fine. DisputeAncestor(DisputeAncestorOptions), @@ -66,16 +66,19 @@ impl MalusCli { fn launch(self) -> eyre::Result<()> { let finality_delay = self.finality_delay; match self.variant { - NemesisVariant::BackGarbageCandidate(cmd) => - polkadot_cli::run_node(run_cmd(cmd), BackGarbageCandidate, finality_delay)?, - NemesisVariant::SuggestGarbageCandidate(opts) => polkadot_cli::run_node( + NemesisVariant::BackGarbageCandidate(opts) => polkadot_cli::run_node( run_cmd(opts.clone().cmd), BackGarbageCandidateWrapper::new(opts), finality_delay, )?, + NemesisVariant::SuggestGarbageCandidate(opts) => polkadot_cli::run_node( + run_cmd(opts.clone().cmd), + SuggestGarbageCandidateWrapper::new(opts), + finality_delay, + )?, NemesisVariant::DisputeAncestor(opts) => polkadot_cli::run_node( run_cmd(opts.clone().cmd), - DisputeValidCandidates::new(opts), + DisputeValidCandidateWrapper::new(opts), finality_delay, )?, NemesisVariant::PvfPrepareWorker(cmd) => { @@ -152,7 +155,7 @@ mod tests { } #[test] - fn percentage_working_dispute_ancestor() { + fn percentage_works_dispute_ancestor() { let cli = MalusCli::try_parse_from(IntoIterator::into_iter([ "malus", "dispute-ancestor", @@ -169,6 +172,24 @@ mod tests { }); } + #[test] + fn percentage_works_back_garbage() { + let cli = MalusCli::try_parse_from(IntoIterator::into_iter([ + "malus", + "back-garbage-candidate", + "--percentage", + "100", + "--bob", + ])) + .unwrap(); + assert_matches::assert_matches!(cli, MalusCli { + variant: NemesisVariant::BackGarbageCandidate(run), + .. + } => { + assert!(run.cmd.base.bob); + }); + } + #[test] #[should_panic] fn validate_range_for_percentage() { diff --git a/node/malus/src/variants/back_garbage_candidate.rs b/node/malus/src/variants/back_garbage_candidate.rs index cf72776b5f28..e5332e03cd4e 100644 --- a/node/malus/src/variants/back_garbage_candidate.rs +++ b/node/malus/src/variants/back_garbage_candidate.rs @@ -25,6 +25,7 @@ use polkadot_cli::{ OverseerConnector, OverseerGen, OverseerGenArgs, OverseerHandle, ParachainHost, ProvideRuntimeApi, }, + RunCmd, }; use polkadot_node_subsystem::SpawnGlue; use sp_core::traits::SpawnNamed; @@ -36,11 +37,33 @@ use crate::{ use std::sync::Arc; +#[derive(Clone, Debug, clap::Parser)] +#[clap(rename_all = "kebab-case")] +#[allow(missing_docs)] +pub struct BackGarbageCandidateOptions { + /// Determines the percentage of garbage candidates that should be backed. + /// Defaults to 100% of garbage candidates being backed. + #[clap(short, long, ignore_case = true, default_value_t = 100, value_parser = clap::value_parser!(u8).range(0..=100))] + pub percentage: u8, + + #[clap(flatten)] + pub cmd: RunCmd, +} + /// Generates an overseer that replaces the candidate validation subsystem with our malicious /// variant. -pub(crate) struct BackGarbageCandidate; +pub(crate) struct BackGarbageCandidateWrapper { + /// Options from CLI + opts: BackGarbageCandidateOptions +} + +impl BackGarbageCandidateWrapper { + pub fn new(opts: BackGarbageCandidateOptions) -> Self { + Self { opts } + } +} -impl OverseerGen for BackGarbageCandidate { +impl OverseerGen for BackGarbageCandidateWrapper { fn generate<'a, Spawner, RuntimeClient>( &self, connector: OverseerConnector, @@ -55,6 +78,7 @@ impl OverseerGen for BackGarbageCandidate { let validation_filter = ReplaceValidationResult::new( FakeCandidateValidation::BackingAndApprovalValid, FakeCandidateValidationError::InvalidOutputs, + f64::from(self.opts.percentage), SpawnGlue(spawner), ); diff --git a/node/malus/src/variants/mod.rs b/node/malus/src/variants/mod.rs index 2bda9d32a45a..86f79722460f 100644 --- a/node/malus/src/variants/mod.rs +++ b/node/malus/src/variants/mod.rs @@ -22,8 +22,8 @@ mod dispute_valid_candidates; mod suggest_garbage_candidate; pub(crate) use self::{ - back_garbage_candidate::BackGarbageCandidate, - dispute_valid_candidates::{DisputeAncestorOptions, DisputeValidCandidates}, - suggest_garbage_candidate::{BackGarbageCandidateWrapper, SuggestGarbageCandidateOptions}, + back_garbage_candidate::{BackGarbageCandidateWrapper, BackGarbageCandidateOptions}, + dispute_valid_candidates::{DisputeValidCandidateWrapper, DisputeAncestorOptions}, + suggest_garbage_candidate::{SuggestGarbageCandidateWrapper, SuggestGarbageCandidateOptions}, }; pub(crate) use common::*; From e9a1b3ec6054a45f9e93778f21f80db33fca37c6 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Fri, 7 Oct 2022 14:58:10 +0100 Subject: [PATCH 09/49] * Add probabilistic behavior to `dispute-ancestor` variant * Add probabilistic behavior to `back-garbage-candidate` variant * Rename structs in dispute variant --- node/malus/src/variants/common.rs | 156 ++++++++++++++---- .../src/variants/dispute_valid_candidates.rs | 7 +- 2 files changed, 124 insertions(+), 39 deletions(-) diff --git a/node/malus/src/variants/common.rs b/node/malus/src/variants/common.rs index e112aa49f83e..a2dd423fe0b8 100644 --- a/node/malus/src/variants/common.rs +++ b/node/malus/src/variants/common.rs @@ -34,6 +34,8 @@ use polkadot_primitives::v2::{ use futures::channel::oneshot; +use rand::distributions::{Bernoulli, Distribution}; + #[derive(clap::ArgEnum, Clone, Copy, Debug, PartialEq)] #[clap(rename_all = "kebab-case")] #[non_exhaustive] @@ -109,6 +111,7 @@ impl Into for FakeCandidateValidationError { pub struct ReplaceValidationResult { fake_validation: FakeCandidateValidation, fake_validation_error: FakeCandidateValidationError, + percentage: f64, spawner: Spawner, } @@ -119,9 +122,10 @@ where pub fn new( fake_validation: FakeCandidateValidation, fake_validation_error: FakeCandidateValidationError, + percentage: f64, spawner: Spawner, ) -> Self { - Self { fake_validation, fake_validation_error, spawner } + Self { fake_validation, fake_validation_error, percentage, spawner } } /// Creates and sends the validation response for a given candidate. Queries the runtime to obtain the validation data for the @@ -202,13 +206,14 @@ where { type Message = CandidateValidationMessage; - // Capture all candidate validation requests and depending on configuration fail them. + // Capture all (approval and backing) candidate validation requests and depending on configuration fail them. fn intercept_incoming( &self, subsystem_sender: &mut Sender, msg: FromOrchestra, ) -> Option> { match msg { + // Behaviour related to the approval subsystem FromOrchestra::Communication { msg: CandidateValidationMessage::ValidateFromExhaustive( @@ -236,28 +241,70 @@ where ), }) } - create_validation_response( - validation_data, - candidate_receipt.descriptor, - sender, - ); - None + // Create the fake response with probability `p` if the `PoV` is malicious. + let distribution = Bernoulli::new(self.percentage / 100.0).expect("Invalid probability! Percentage cannot be < 0 or > 100."); + let random_bool = distribution.sample(&mut rand::thread_rng()); + match random_bool { + true => { + create_validation_response( + validation_data, + candidate_receipt.descriptor, + sender, + ); + None + }, + // + false => { + // Behave normally with probability `(1-p)` for a malicious `PoV`. + Some(FromOrchestra::Communication { + msg: CandidateValidationMessage::ValidateFromExhaustive( + validation_data, + validation_code, + candidate_receipt, + pov, + timeout, + sender, + ), + }) + } + } }, FakeCandidateValidation::ApprovalInvalid | FakeCandidateValidation::BackingAndApprovalInvalid => { - let validation_result = - ValidationResult::Invalid(InvalidCandidate::InvalidOutputs); + // Set the validation result to invalid with probability `p` + let distribution = Bernoulli::new(self.percentage / 100.0).expect("Invalid probability! Percentage cannot be < 0 or > 100."); + let random_bool = distribution.sample(&mut rand::thread_rng()); + match random_bool { + true => { + let validation_result = + ValidationResult::Invalid(InvalidCandidate::InvalidOutputs); - gum::debug!( - target: MALUS, - para_id = ?candidate_receipt.descriptor.para_id, - "ValidateFromExhaustive result: {:?}", - &validation_result - ); - // We're not even checking the candidate, this makes us appear faster than honest validators. - sender.send(Ok(validation_result)).unwrap(); - None + gum::debug!( + target: MALUS, + para_id = ?candidate_receipt.descriptor.para_id, + "ValidateFromExhaustive result: {:?}", + &validation_result + ); + // We're not even checking the candidate, this makes us appear faster than honest validators. + sender.send(Ok(validation_result)).unwrap(); + None + }, + false => { + // Behave normally with probability `(1-p)` + Some(FromOrchestra::Communication { + msg: CandidateValidationMessage::ValidateFromExhaustive( + validation_data, + validation_code, + candidate_receipt, + pov, + timeout, + sender, + ), + }) + }, + } }, + // `dispute-ancestor --fake-validation` disabled case _ => Some(FromOrchestra::Communication { msg: CandidateValidationMessage::ValidateFromExhaustive( validation_data, @@ -270,6 +317,7 @@ where }), } }, + // Behaviour related to the backing subsystem FromOrchestra::Communication { msg: CandidateValidationMessage::ValidateFromChainState( @@ -293,27 +341,63 @@ where ), }) } - self.send_validation_response( - candidate_receipt.descriptor, - subsystem_sender.clone(), - response_sender, - ); - None + // If the `PoV` is malicious, back the candidate with some probability `p` (default 100) + let distribution = Bernoulli::new(self.percentage / 100.0).expect("Invalid probability! Percentage cannot be < 0 or > 100."); + let random_bool = distribution.sample(&mut rand::thread_rng()); + match random_bool { + true => { + self.send_validation_response( + candidate_receipt.descriptor, + subsystem_sender.clone(), + response_sender, + ); + None + }, + // If the `PoV` is malicious, we behave normally with some probability `(1-p)` (default 0) + false => { + Some(FromOrchestra::Communication { + msg: CandidateValidationMessage::ValidateFromChainState( + candidate_receipt, + pov, + timeout, + response_sender, + ), + }) + } + } }, FakeCandidateValidation::BackingInvalid | FakeCandidateValidation::BackingAndApprovalInvalid => { - let validation_result = - ValidationResult::Invalid(self.fake_validation_error.clone().into()); - gum::debug!( - target: MALUS, - para_id = ?candidate_receipt.descriptor.para_id, - "ValidateFromChainState result: {:?}", - &validation_result - ); + // We back a garbage candidate with some probability `p` (default 100) + let distribution = Bernoulli::new(self.percentage / 100.0).expect("Invalid probability! Percentage cannot be < 0 or > 100."); + let random_bool = distribution.sample(&mut rand::thread_rng()); + match random_bool { + true => { + let validation_result = + ValidationResult::Invalid(self.fake_validation_error.clone().into()); + gum::debug!( + target: MALUS, + para_id = ?candidate_receipt.descriptor.para_id, + "ValidateFromChainState result: {:?}", + &validation_result + ); - // We're not even checking the candidate, this makes us appear faster than honest validators. - response_sender.send(Ok(validation_result)).unwrap(); - None + // We're not even checking the candidate, this makes us appear faster than honest validators. + response_sender.send(Ok(validation_result)).unwrap(); + None + }, + // With some probability `(1-p)` (default 0) we behave normally + false => { + Some(FromOrchestra::Communication { + msg: CandidateValidationMessage::ValidateFromChainState( + candidate_receipt, + pov, + timeout, + response_sender, + ), + }) + }, + } }, _ => Some(FromOrchestra::Communication { msg: CandidateValidationMessage::ValidateFromChainState( diff --git a/node/malus/src/variants/dispute_valid_candidates.rs b/node/malus/src/variants/dispute_valid_candidates.rs index 774a162f1904..e6dc899c4480 100644 --- a/node/malus/src/variants/dispute_valid_candidates.rs +++ b/node/malus/src/variants/dispute_valid_candidates.rs @@ -64,18 +64,18 @@ pub struct DisputeAncestorOptions { pub cmd: RunCmd, } -pub(crate) struct DisputeValidCandidates { +pub(crate) struct DisputeValidCandidateWrapper { /// Fake validation config (applies to disputes as well). opts: DisputeAncestorOptions, } -impl DisputeValidCandidates { +impl DisputeValidCandidateWrapper { pub fn new(opts: DisputeAncestorOptions) -> Self { Self { opts } } } -impl OverseerGen for DisputeValidCandidates { +impl OverseerGen for DisputeValidCandidateWrapper { fn generate<'a, Spawner, RuntimeClient>( &self, connector: OverseerConnector, @@ -90,6 +90,7 @@ impl OverseerGen for DisputeValidCandidates { let validation_filter = ReplaceValidationResult::new( self.opts.fake_validation, self.opts.fake_validation_error, + f64::from(self.opts.percentage), SpawnGlue(spawner.clone()), ); From 4fff00b2624f4f64c5235295d01db74b87882966 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Fri, 7 Oct 2022 15:10:33 +0100 Subject: [PATCH 10/49] * More descriptive comments --- node/malus/src/variants/common.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/node/malus/src/variants/common.rs b/node/malus/src/variants/common.rs index a2dd423fe0b8..d34513255b61 100644 --- a/node/malus/src/variants/common.rs +++ b/node/malus/src/variants/common.rs @@ -341,7 +341,8 @@ where ), }) } - // If the `PoV` is malicious, back the candidate with some probability `p` (default 100) + // If the `PoV` is malicious, back the candidate with some probability `p`, + // which defaults to 100% for suggest-garbage-candidate variant. let distribution = Bernoulli::new(self.percentage / 100.0).expect("Invalid probability! Percentage cannot be < 0 or > 100."); let random_bool = distribution.sample(&mut rand::thread_rng()); match random_bool { @@ -353,7 +354,7 @@ where ); None }, - // If the `PoV` is malicious, we behave normally with some probability `(1-p)` (default 0) + // If the `PoV` is malicious, we behave normally with some probability `(1-p)` false => { Some(FromOrchestra::Communication { msg: CandidateValidationMessage::ValidateFromChainState( @@ -368,7 +369,8 @@ where }, FakeCandidateValidation::BackingInvalid | FakeCandidateValidation::BackingAndApprovalInvalid => { - // We back a garbage candidate with some probability `p` (default 100) + // We back a garbage candidate with some probability `p`, + // which defaults to 100% for suggest-garbage-candidate variant. let distribution = Bernoulli::new(self.percentage / 100.0).expect("Invalid probability! Percentage cannot be < 0 or > 100."); let random_bool = distribution.sample(&mut rand::thread_rng()); match random_bool { @@ -386,7 +388,7 @@ where response_sender.send(Ok(validation_result)).unwrap(); None }, - // With some probability `(1-p)` (default 0) we behave normally + // With some probability `(1-p)` we behave normally false => { Some(FromOrchestra::Communication { msg: CandidateValidationMessage::ValidateFromChainState( From bfe0aa7ebb06f2ab6a6db692e222378c7285b573 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Fri, 7 Oct 2022 15:17:30 +0100 Subject: [PATCH 11/49] * cargo +nightly fmt --all --- .../src/variants/back_garbage_candidate.rs | 4 +- node/malus/src/variants/common.rs | 61 ++++++++++--------- node/malus/src/variants/mod.rs | 6 +- .../src/variants/suggest_garbage_candidate.rs | 4 +- 4 files changed, 38 insertions(+), 37 deletions(-) diff --git a/node/malus/src/variants/back_garbage_candidate.rs b/node/malus/src/variants/back_garbage_candidate.rs index e5332e03cd4e..04d20d008288 100644 --- a/node/malus/src/variants/back_garbage_candidate.rs +++ b/node/malus/src/variants/back_garbage_candidate.rs @@ -41,7 +41,7 @@ use std::sync::Arc; #[clap(rename_all = "kebab-case")] #[allow(missing_docs)] pub struct BackGarbageCandidateOptions { - /// Determines the percentage of garbage candidates that should be backed. + /// Determines the percentage of garbage candidates that should be backed. /// Defaults to 100% of garbage candidates being backed. #[clap(short, long, ignore_case = true, default_value_t = 100, value_parser = clap::value_parser!(u8).range(0..=100))] pub percentage: u8, @@ -54,7 +54,7 @@ pub struct BackGarbageCandidateOptions { /// variant. pub(crate) struct BackGarbageCandidateWrapper { /// Options from CLI - opts: BackGarbageCandidateOptions + opts: BackGarbageCandidateOptions, } impl BackGarbageCandidateWrapper { diff --git a/node/malus/src/variants/common.rs b/node/malus/src/variants/common.rs index d34513255b61..fa9bb1eb160a 100644 --- a/node/malus/src/variants/common.rs +++ b/node/malus/src/variants/common.rs @@ -242,7 +242,8 @@ where }) } // Create the fake response with probability `p` if the `PoV` is malicious. - let distribution = Bernoulli::new(self.percentage / 100.0).expect("Invalid probability! Percentage cannot be < 0 or > 100."); + let distribution = Bernoulli::new(self.percentage / 100.0) + .expect("Invalid probability! Percentage cannot be < 0 or > 100."); let random_bool = distribution.sample(&mut rand::thread_rng()); match random_bool { true => { @@ -253,7 +254,7 @@ where ); None }, - // + // false => { // Behave normally with probability `(1-p)` for a malicious `PoV`. Some(FromOrchestra::Communication { @@ -266,13 +267,14 @@ where sender, ), }) - } + }, } }, FakeCandidateValidation::ApprovalInvalid | FakeCandidateValidation::BackingAndApprovalInvalid => { // Set the validation result to invalid with probability `p` - let distribution = Bernoulli::new(self.percentage / 100.0).expect("Invalid probability! Percentage cannot be < 0 or > 100."); + let distribution = Bernoulli::new(self.percentage / 100.0) + .expect("Invalid probability! Percentage cannot be < 0 or > 100."); let random_bool = distribution.sample(&mut rand::thread_rng()); match random_bool { true => { @@ -288,7 +290,7 @@ where // We're not even checking the candidate, this makes us appear faster than honest validators. sender.send(Ok(validation_result)).unwrap(); None - }, + }, false => { // Behave normally with probability `(1-p)` Some(FromOrchestra::Communication { @@ -343,7 +345,8 @@ where } // If the `PoV` is malicious, back the candidate with some probability `p`, // which defaults to 100% for suggest-garbage-candidate variant. - let distribution = Bernoulli::new(self.percentage / 100.0).expect("Invalid probability! Percentage cannot be < 0 or > 100."); + let distribution = Bernoulli::new(self.percentage / 100.0) + .expect("Invalid probability! Percentage cannot be < 0 or > 100."); let random_bool = distribution.sample(&mut rand::thread_rng()); match random_bool { true => { @@ -354,29 +357,29 @@ where ); None }, - // If the `PoV` is malicious, we behave normally with some probability `(1-p)` - false => { - Some(FromOrchestra::Communication { - msg: CandidateValidationMessage::ValidateFromChainState( - candidate_receipt, - pov, - timeout, - response_sender, - ), - }) - } + // If the `PoV` is malicious, we behave normally with some probability `(1-p)` + false => Some(FromOrchestra::Communication { + msg: CandidateValidationMessage::ValidateFromChainState( + candidate_receipt, + pov, + timeout, + response_sender, + ), + }), } }, FakeCandidateValidation::BackingInvalid | FakeCandidateValidation::BackingAndApprovalInvalid => { // We back a garbage candidate with some probability `p`, // which defaults to 100% for suggest-garbage-candidate variant. - let distribution = Bernoulli::new(self.percentage / 100.0).expect("Invalid probability! Percentage cannot be < 0 or > 100."); + let distribution = Bernoulli::new(self.percentage / 100.0) + .expect("Invalid probability! Percentage cannot be < 0 or > 100."); let random_bool = distribution.sample(&mut rand::thread_rng()); match random_bool { true => { - let validation_result = - ValidationResult::Invalid(self.fake_validation_error.clone().into()); + let validation_result = ValidationResult::Invalid( + self.fake_validation_error.clone().into(), + ); gum::debug!( target: MALUS, para_id = ?candidate_receipt.descriptor.para_id, @@ -389,16 +392,14 @@ where None }, // With some probability `(1-p)` we behave normally - false => { - Some(FromOrchestra::Communication { - msg: CandidateValidationMessage::ValidateFromChainState( - candidate_receipt, - pov, - timeout, - response_sender, - ), - }) - }, + false => Some(FromOrchestra::Communication { + msg: CandidateValidationMessage::ValidateFromChainState( + candidate_receipt, + pov, + timeout, + response_sender, + ), + }), } }, _ => Some(FromOrchestra::Communication { diff --git a/node/malus/src/variants/mod.rs b/node/malus/src/variants/mod.rs index 86f79722460f..036ffc534a20 100644 --- a/node/malus/src/variants/mod.rs +++ b/node/malus/src/variants/mod.rs @@ -22,8 +22,8 @@ mod dispute_valid_candidates; mod suggest_garbage_candidate; pub(crate) use self::{ - back_garbage_candidate::{BackGarbageCandidateWrapper, BackGarbageCandidateOptions}, - dispute_valid_candidates::{DisputeValidCandidateWrapper, DisputeAncestorOptions}, - suggest_garbage_candidate::{SuggestGarbageCandidateWrapper, SuggestGarbageCandidateOptions}, + back_garbage_candidate::{BackGarbageCandidateOptions, BackGarbageCandidateWrapper}, + dispute_valid_candidates::{DisputeAncestorOptions, DisputeValidCandidateWrapper}, + suggest_garbage_candidate::{SuggestGarbageCandidateOptions, SuggestGarbageCandidateWrapper}, }; pub(crate) use common::*; diff --git a/node/malus/src/variants/suggest_garbage_candidate.rs b/node/malus/src/variants/suggest_garbage_candidate.rs index 8bdff71885a1..9d0c63fdea5e 100644 --- a/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/node/malus/src/variants/suggest_garbage_candidate.rs @@ -102,7 +102,8 @@ where // Need to draw value from Bernoulli distribution with given probability of success defined by the Clap parameter. // Note that clap parameter must be f64 since this is expected by the Bernoulli::new() function, hence it must be converted. - let distribution = Bernoulli::new(self.percentage / 100.0).expect("Invalid probability! Percentage cannot be < 0 or > 100."); + let distribution = Bernoulli::new(self.percentage / 100.0) + .expect("Invalid probability! Percentage cannot be < 0 or > 100."); // Draw a random value from the distribution, where T: bool, and probability of drawing a 'true' value is = to percentage parameter, // using thread_rng as the source of randomness. @@ -115,7 +116,6 @@ where ); if generate_malicious_candidate == true { - let pov = PoV { block_data: BlockData(MALICIOUS_POV.into()) }; let (sender, receiver) = std::sync::mpsc::channel(); From 4704e98e03c96caad9cac496e1913d8a7bf738ed Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Fri, 7 Oct 2022 16:22:20 +0100 Subject: [PATCH 12/49] * Move Bernoulli distributrion to ReplaceValidationResult constructor * Rename random_bool to behave_maliciously --- node/malus/src/variants/common.rs | 33 +++++++++++++------------------ 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/node/malus/src/variants/common.rs b/node/malus/src/variants/common.rs index fa9bb1eb160a..1484be5566ae 100644 --- a/node/malus/src/variants/common.rs +++ b/node/malus/src/variants/common.rs @@ -112,6 +112,7 @@ pub struct ReplaceValidationResult { fake_validation: FakeCandidateValidation, fake_validation_error: FakeCandidateValidationError, percentage: f64, + distribution: Bernoulli, spawner: Spawner, } @@ -125,7 +126,9 @@ where percentage: f64, spawner: Spawner, ) -> Self { - Self { fake_validation, fake_validation_error, percentage, spawner } + let distribution = Bernoulli::new(percentage / 100.0) + .expect("Invalid probability! Percentage must be in range [0..=100]."); + Self { fake_validation, fake_validation_error, percentage, distribution, spawner } } /// Creates and sends the validation response for a given candidate. Queries the runtime to obtain the validation data for the @@ -242,10 +245,8 @@ where }) } // Create the fake response with probability `p` if the `PoV` is malicious. - let distribution = Bernoulli::new(self.percentage / 100.0) - .expect("Invalid probability! Percentage cannot be < 0 or > 100."); - let random_bool = distribution.sample(&mut rand::thread_rng()); - match random_bool { + let behave_maliciously = self.distribution.sample(&mut rand::thread_rng()); + match behave_maliciously { true => { create_validation_response( validation_data, @@ -272,11 +273,9 @@ where }, FakeCandidateValidation::ApprovalInvalid | FakeCandidateValidation::BackingAndApprovalInvalid => { - // Set the validation result to invalid with probability `p` - let distribution = Bernoulli::new(self.percentage / 100.0) - .expect("Invalid probability! Percentage cannot be < 0 or > 100."); - let random_bool = distribution.sample(&mut rand::thread_rng()); - match random_bool { + // Set the validation result to invalid with probability `p` and trigger a dispute + let behave_maliciously = self.distribution.sample(&mut rand::thread_rng()); + match behave_maliciously { true => { let validation_result = ValidationResult::Invalid(InvalidCandidate::InvalidOutputs); @@ -306,7 +305,7 @@ where }, } }, - // `dispute-ancestor --fake-validation` disabled case + // Handle FakeCandidateValidation::Disabled _ => Some(FromOrchestra::Communication { msg: CandidateValidationMessage::ValidateFromExhaustive( validation_data, @@ -345,10 +344,8 @@ where } // If the `PoV` is malicious, back the candidate with some probability `p`, // which defaults to 100% for suggest-garbage-candidate variant. - let distribution = Bernoulli::new(self.percentage / 100.0) - .expect("Invalid probability! Percentage cannot be < 0 or > 100."); - let random_bool = distribution.sample(&mut rand::thread_rng()); - match random_bool { + let behave_maliciously = self.distribution.sample(&mut rand::thread_rng()); + match behave_maliciously { true => { self.send_validation_response( candidate_receipt.descriptor, @@ -372,10 +369,8 @@ where FakeCandidateValidation::BackingAndApprovalInvalid => { // We back a garbage candidate with some probability `p`, // which defaults to 100% for suggest-garbage-candidate variant. - let distribution = Bernoulli::new(self.percentage / 100.0) - .expect("Invalid probability! Percentage cannot be < 0 or > 100."); - let random_bool = distribution.sample(&mut rand::thread_rng()); - match random_bool { + let behave_maliciously = self.distribution.sample(&mut rand::thread_rng()); + match behave_maliciously { true => { let validation_result = ValidationResult::Invalid( self.fake_validation_error.clone().into(), From 0ec9bc1d23be98762b99d8f4a68b4e82bdbde10d Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Fri, 7 Oct 2022 16:22:33 +0100 Subject: [PATCH 13/49] * Remove dangling comment --- node/malus/src/variants/suggest_garbage_candidate.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/node/malus/src/variants/suggest_garbage_candidate.rs b/node/malus/src/variants/suggest_garbage_candidate.rs index 9d0c63fdea5e..d11c2e84a56a 100644 --- a/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/node/malus/src/variants/suggest_garbage_candidate.rs @@ -240,11 +240,6 @@ where FromOrchestra::Signal(signal) => Some(FromOrchestra::Signal(signal)), } } - // Comments related to unexpected CollationSeconded: - // `parachain::collator-protocol: received an unexpected `CollationSeconded`: unknown statement statement=...` - // TODO: Fix this error. We get this on colaltors because `malicious backing` creates a candidate that gets backed/included. - // It is harmless for test parachain collators, but it will prevent cumulus based collators to make progress - // as they wait for the relay chain to confirm the seconding of the collation. } #[derive(Clone, Debug, clap::Parser)] From 563fa17616bac545cbf1e3aec0e9bc619870f411 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Fri, 7 Oct 2022 16:57:35 +0100 Subject: [PATCH 14/49] * Consistent log --- node/malus/src/variants/suggest_garbage_candidate.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/node/malus/src/variants/suggest_garbage_candidate.rs b/node/malus/src/variants/suggest_garbage_candidate.rs index d11c2e84a56a..767b7494f6fe 100644 --- a/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/node/malus/src/variants/suggest_garbage_candidate.rs @@ -103,7 +103,7 @@ where // Need to draw value from Bernoulli distribution with given probability of success defined by the Clap parameter. // Note that clap parameter must be f64 since this is expected by the Bernoulli::new() function, hence it must be converted. let distribution = Bernoulli::new(self.percentage / 100.0) - .expect("Invalid probability! Percentage cannot be < 0 or > 100."); + .expect("Invalid probability! Percentage must be in range [0..=100]."); // Draw a random value from the distribution, where T: bool, and probability of drawing a 'true' value is = to percentage parameter, // using thread_rng as the source of randomness. @@ -246,8 +246,9 @@ where #[clap(rename_all = "kebab-case")] #[allow(missing_docs)] pub struct SuggestGarbageCandidateOptions { - /// Determines the percentage of malicious candidates that are suggested. Allows for fine-tuning - /// the intensity of the behavior of the malicious node. Value must be in the range 0..=100. + /// Determines the percentage of malicious candidates that are suggested by malus, + /// based on the total number of intercepted CandidateBacking + /// Must be in the range [0..=100]. #[clap(short, long, ignore_case = true, default_value_t = 100, value_parser = clap::value_parser!(u8).range(0..=100))] pub percentage: u8, From f7899588b05308d86a37135ffb4023ad028f78fe Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Fri, 7 Oct 2022 16:57:58 +0100 Subject: [PATCH 15/49] * Add logs based on sampled value --- node/malus/src/variants/common.rs | 61 ++++++++++++++++++++++++++----- 1 file changed, 52 insertions(+), 9 deletions(-) diff --git a/node/malus/src/variants/common.rs b/node/malus/src/variants/common.rs index 1484be5566ae..816886c2c3fd 100644 --- a/node/malus/src/variants/common.rs +++ b/node/malus/src/variants/common.rs @@ -248,6 +248,12 @@ where let behave_maliciously = self.distribution.sample(&mut rand::thread_rng()); match behave_maliciously { true => { + gum::info!( + target: MALUS, + "😈 Malicious behaviour is sampled as: {:?}. Now outputting malicious ValidationResult::Valid message.", + &behave_maliciously, + ); + create_validation_response( validation_data, candidate_receipt.descriptor, @@ -255,9 +261,14 @@ where ); None }, - // false => { // Behave normally with probability `(1-p)` for a malicious `PoV`. + gum::info!( + target: MALUS, + "😈 Malicious behaviour is sampled as: {:?}. Faking normal behaviour and outputting CandidateValidationMessage::ValidateFromExhaustive.", + &behave_maliciously, + ); + Some(FromOrchestra::Communication { msg: CandidateValidationMessage::ValidateFromExhaustive( validation_data, @@ -277,6 +288,12 @@ where let behave_maliciously = self.distribution.sample(&mut rand::thread_rng()); match behave_maliciously { true => { + gum::info!( + target: MALUS, + "😈 Malicious behaviour is sampled as: {:?}. Now setting ValidationResult::Invalid.", + &behave_maliciously, + ); + let validation_result = ValidationResult::Invalid(InvalidCandidate::InvalidOutputs); @@ -292,6 +309,12 @@ where }, false => { // Behave normally with probability `(1-p)` + gum::info!( + target: MALUS, + "😈 Malicious behaviour is sampled as: {:?}. Faking normal behaviour and outputting CandidateValidationMessage::ValidateFromExhaustive message.", + &behave_maliciously, + ); + Some(FromOrchestra::Communication { msg: CandidateValidationMessage::ValidateFromExhaustive( validation_data, @@ -347,6 +370,12 @@ where let behave_maliciously = self.distribution.sample(&mut rand::thread_rng()); match behave_maliciously { true => { + gum::info!( + target: MALUS, + "😈 Malicious behaviour is sampled as: {:?}. Backing candidate with malicious PoV.", + &behave_maliciously, + ); + self.send_validation_response( candidate_receipt.descriptor, subsystem_sender.clone(), @@ -372,6 +401,12 @@ where let behave_maliciously = self.distribution.sample(&mut rand::thread_rng()); match behave_maliciously { true => { + gum::info!( + target: MALUS, + "😈 Malicious behaviour is sampled as: {:?}. Setting ValidationResult::Invalid for valid candidate.", + &behave_maliciously, + ); + let validation_result = ValidationResult::Invalid( self.fake_validation_error.clone().into(), ); @@ -387,14 +422,22 @@ where None }, // With some probability `(1-p)` we behave normally - false => Some(FromOrchestra::Communication { - msg: CandidateValidationMessage::ValidateFromChainState( - candidate_receipt, - pov, - timeout, - response_sender, - ), - }), + false => { + gum::info!( + target: MALUS, + "😈 Malicious behaviour is sampled as: {:?}. Faking normal behaviour and outputting CandidateValidationMessage::ValidateFromChainState message.", + &behave_maliciously, + ); + + Some(FromOrchestra::Communication { + msg: CandidateValidationMessage::ValidateFromChainState( + candidate_receipt, + pov, + timeout, + response_sender, + ), + }), + } } }, _ => Some(FromOrchestra::Communication { From decb9e2ac615298d1757ccf14c9ab1546b60b118 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Fri, 7 Oct 2022 17:00:22 +0100 Subject: [PATCH 16/49] * Cargo +nightly fmt --all --- node/malus/src/variants/common.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/node/malus/src/variants/common.rs b/node/malus/src/variants/common.rs index 816886c2c3fd..1eea23f931e8 100644 --- a/node/malus/src/variants/common.rs +++ b/node/malus/src/variants/common.rs @@ -314,7 +314,7 @@ where "😈 Malicious behaviour is sampled as: {:?}. Faking normal behaviour and outputting CandidateValidationMessage::ValidateFromExhaustive message.", &behave_maliciously, ); - + Some(FromOrchestra::Communication { msg: CandidateValidationMessage::ValidateFromExhaustive( validation_data, @@ -436,8 +436,8 @@ where timeout, response_sender, ), - }), - } + }) + }, } }, _ => Some(FromOrchestra::Communication { From 3ad5cec787e45885e5445d78fd6bfb0994613f63 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Mon, 10 Oct 2022 10:00:49 +0100 Subject: [PATCH 17/49] * Remove unused percentage attributed after moving Bernoulli to constructor --- node/malus/src/variants/common.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/node/malus/src/variants/common.rs b/node/malus/src/variants/common.rs index 1eea23f931e8..ad3a50118c52 100644 --- a/node/malus/src/variants/common.rs +++ b/node/malus/src/variants/common.rs @@ -111,7 +111,6 @@ impl Into for FakeCandidateValidationError { pub struct ReplaceValidationResult { fake_validation: FakeCandidateValidation, fake_validation_error: FakeCandidateValidationError, - percentage: f64, distribution: Bernoulli, spawner: Spawner, } @@ -128,7 +127,7 @@ where ) -> Self { let distribution = Bernoulli::new(percentage / 100.0) .expect("Invalid probability! Percentage must be in range [0..=100]."); - Self { fake_validation, fake_validation_error, percentage, distribution, spawner } + Self { fake_validation, fake_validation_error, distribution, spawner } } /// Creates and sends the validation response for a given candidate. Queries the runtime to obtain the validation data for the From 5001fa5d1dcd366029d156f81c40b99ca29d8f77 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Mon, 10 Oct 2022 10:40:36 +0100 Subject: [PATCH 18/49] Squashed commit of the following: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit e36cc59bfc8338d6fb01f261a243c1f4048773df Author: Chris Sosnin <48099298+slumber@users.noreply.github.com> Date: Mon Oct 10 10:06:44 2022 +0400 Fix flaky test (#6131) * Split test + decrease test timeout * fmt * spellcheck commit f85f96c9d6f4d16bc04f2b3950b091c979adf6d0 Author: girazoki Date: Mon Oct 10 06:39:30 2022 +0200 Add event to asset claim (#6029) commit fb0dd8ebd109c1961d6b52548246908ae6689929 Author: Leszek Wiesner Date: Mon Oct 10 00:23:54 2022 +0200 Companion for 12109 (#5929) * Update following `pallet-vesting` configurable `WithdrawReasons` * Update lib.rs * Update lib.rs * Update lib.rs * update lockfile for {"substrate"} * fix warning Co-authored-by: Shawn Tabrizi Co-authored-by: parity-processbot <> commit 1c786b372617f26f5982fadc77269e9d4a7c5da2 Author: Bastian Köcher Date: Fri Oct 7 13:40:40 2022 +0200 Companion for upgrading pin-project (#6118) * Companion for upgrading pin-project This will remove some warnings with the latest rustc nightly/stable. https://github.com/paritytech/substrate/pull/12426 * update lockfile for {"substrate"} Co-authored-by: parity-processbot <> commit 3d6b56342e5e1313685aae6f4e222cbf91ba790f Author: Sergej Sakac <73715684+Szegoo@users.noreply.github.com> Date: Thu Oct 6 19:20:58 2022 +0200 Maximum value for `MultiplierUpdate` (#6021) * update multiplier * fix * update lockfile for {"substrate"} * fmt * fix typo Co-authored-by: parity-processbot <> commit 09f340c928ea324105b39b957dc155cbd29b173d Author: Adrian Catangiu Date: Thu Oct 6 12:58:39 2022 +0300 service: use MmrRootProvider as custom BEEFY payload provider (companion for 12428) (#6112) * service: use MmrRootProvider as custom BEEFY payload provider * update lockfile for {"substrate"} Co-authored-by: parity-processbot <> commit d12042f1a0a0e34ca274de9035ea35b6c016783f Author: Branislav Kontur Date: Thu Oct 6 10:03:34 2022 +0200 Skip `unexpected metric type` * Dump more info for `unexpected metric type` * Skip `unexpected metric type` commit 3646202110b3810027f9d7fd0b45cb1bcb9678f4 Author: Andronik Date: Thu Oct 6 00:36:51 2022 +0200 update kvdb & co (#6111) * toml changes * REVERTME: patch * adapt parachains db interface * fix Cargo.toml patch after master rebase * fix av-store * fix chain-selection * fix parachains-db? * Revert "fix Cargo.toml patch after master rebase" This reverts commit 3afcbf033c86027b3f2b909d83ec703591bdd287. * Revert "REVERTME: patch" This reverts commit 464b717cf4142d3d09c3d77b83700b632d8c5f54. * Use `Ok` imported from prelude Co-authored-by: Bastian Köcher * update lockfile for {"substrate"} * Revert "update lockfile for {"substrate"}" This reverts commit fdc623de226f7645741b86c4b1a7d030fed2172d. * cargo update -p sp-io Co-authored-by: Bastian Köcher Co-authored-by: parity-processbot <> commit 7870dafbd88c8a4bdb1d3c3fb94745f0824a8fb6 Author: Gavin Wood Date: Wed Oct 5 22:17:59 2022 +0100 Companion for #11649: Bound uses of `Call` (#5729) * Fixes * Clear out old weights Signed-off-by: Oliver Tale-Yazdi * Resolve merges Signed-off-by: Oliver Tale-Yazdi * Fix weight traits Signed-off-by: Oliver Tale-Yazdi * polkadot runtime: Clippy Signed-off-by: Oliver Tale-Yazdi * rococo runtime: update pallet configs Signed-off-by: Oliver Tale-Yazdi * Add preimage migration Signed-off-by: Oliver Tale-Yazdi * Add all migrations Signed-off-by: Oliver Tale-Yazdi * Democracy is not on Westend Signed-off-by: Oliver Tale-Yazdi * [Migration] Refund stored multisig calls (#6075) * Add Preimages to referenda config Needed since Gov V2 just merged. Signed-off-by: Oliver Tale-Yazdi * Update weights Signed-off-by: Oliver Tale-Yazdi * Add multisig migration to Westend+Rococo Signed-off-by: Oliver Tale-Yazdi * Fix Executive syntax Signed-off-by: Oliver Tale-Yazdi * Bump Substrate Signed-off-by: Oliver Tale-Yazdi Co-authored-by: Oliver Tale-Yazdi Co-authored-by: parity-processbot <> Co-authored-by: Roman Useinov commit df4a1c3cd919c727c1c1c3676229193de1134380 Author: Alexander Theißen Date: Wed Oct 5 15:15:07 2022 +0200 Pass through `runtime-benchmark` feature (#6110) commit 3eb61f8871220f2a17a98342382270782cdb4b0c Author: Keith Yeung Date: Wed Oct 5 17:47:15 2022 +0800 Properly migrate weights to v2 (#6091) * Create migration for config pallet * Use XcmWeight in XCM pallet extrinsics * Link to PR in doc comment * cargo fmt * Fix tests * Fix tests * Remove unused import * Update runtime/parachains/src/configuration/migration.rs Co-authored-by: Oliver Tale-Yazdi * Add missing on_runtime_upgrade implementation * Use new migration API * cargo fmt * Fix log message Co-authored-by: Oliver Tale-Yazdi commit edd6499e3220c2a646f2a693108c1084fc6a92ff Author: Chris Sosnin <48099298+slumber@users.noreply.github.com> Date: Wed Oct 5 11:48:50 2022 +0400 Buffered connection management for collator-protocol (#6022) * Extract metrics into a separate module * Introduce validators buffer * Integrate buffer into the subsystem * Only reconnect on new advertisements * Test * comma * doc comment * Make capacity buffer compile time non-zero * Add doc comments * nits * remove derives * review * better naming * check timeout * Extract interval stream into lib * Ensure collator disconnects after timeout * spellcheck * rename buf * Remove double interval * Add a log on timeout * Cleanup buffer on timeout commit c913107a84bb60a70d8d514091631730cbba3cd2 Author: Robert Klotzner Date: Tue Oct 4 18:47:52 2022 +0200 Add unknown words (#6105) commit ce430c22560ddf76188742f870345a9a1eca65dc Author: Robert Klotzner Date: Tue Oct 4 18:02:05 2022 +0200 Batch vote import in dispute-distribution (#5894) * Start work on batching in dispute-distribution. * Guide work. * More guide changes. Still very much WIP. * Finish guide changes. * Clarification * Adjust argument about slashing. * WIP: Add constants to receiver. * Maintain order of disputes. * dispute-distribuion sender Rate limit. * Cleanup * WIP: dispute-distribution receiver. - [ ] Rate limiting - [ ] Batching * WIP: Batching. * fmt * Update `PeerQueues` to maintain more invariants. * WIP: Batching. * Small cleanup * Batching logic. * Some integration work. * Finish. Missing: Tests * Typo. * Docs. * Report missing metric. * Doc pass. * Tests for waiting_queue. * Speed up some crypto by 10x. * Fix redundant import. * Add some tracing. * Better sender rate limit * Some tests. * Tests * Add logging to rate limiter * Update roadmap/implementers-guide/src/node/disputes/dispute-distribution.md Co-authored-by: Tsvetomir Dimitrov * Update roadmap/implementers-guide/src/node/disputes/dispute-distribution.md Co-authored-by: Tsvetomir Dimitrov * Update node/network/dispute-distribution/src/receiver/mod.rs Co-authored-by: Tsvetomir Dimitrov * Review feedback. * Also log peer in log messages. * Fix indentation. * waker -> timer * Guide improvement. * Remove obsolete comment. * waker -> timer * Fix spell complaints. * Fix Cargo.lock Co-authored-by: Tsvetomir Dimitrov commit efb82ef7b0a0f0a67b43b616471db5921f45a614 Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue Oct 4 11:28:21 2022 +0000 Bump lru from 0.7.8 to 0.8.0 (#6060) * Bump lru from 0.7.8 to 0.8.0 Bumps [lru](https://github.com/jeromefroe/lru-rs) from 0.7.8 to 0.8.0. - [Release notes](https://github.com/jeromefroe/lru-rs/releases) - [Changelog](https://github.com/jeromefroe/lru-rs/blob/master/CHANGELOG.md) - [Commits](https://github.com/jeromefroe/lru-rs/compare/0.7.8...0.8.0) --- updated-dependencies: - dependency-name: lru dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Change `LruCache` paramerter to `NonZeroUsize` * Change type of `session_cache_lru_size` to `NonZeroUsize` * Add expects instead of unwrap Co-authored-by: Bastian Köcher * Use match to get rid of expects Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sebastian Kunert Co-authored-by: Bastian Köcher commit 60554e1f2dba9aa1c553e4bdbd15c5c99936c56a Author: Andrei Sandu <54316454+sandreim@users.noreply.github.com> Date: Tue Oct 4 13:36:42 2022 +0300 Keep sessions in window for the full unfinalized chain (#6054) * Impl dynamic window size. Keep sessions for unfinalized chain Signed-off-by: Andrei Sandu * feedback Signed-off-by: Andrei Sandu * Stretch also in contructor plus tests Signed-off-by: Andrei Sandu * review feedback Signed-off-by: Andrei Sandu * fix approval-voting tests Signed-off-by: Andrei Sandu * grunting: dispute coordinator tests Signed-off-by: Andrei Sandu Signed-off-by: Andrei Sandu commit 4ddf0ffe5b6d75149016bed74e2d587acf011cb9 Author: Serban Iorga Date: Tue Oct 4 12:25:48 2022 +0300 Companion for BEEFY: Simplify hashing for pallet-beefy-mmr (#6098) * beefy-mmr: Simplify hashing * update lockfile for {"substrate"} Co-authored-by: parity-processbot <> --- Cargo.lock | 496 +++++++++-------- Cargo.toml | 9 +- cli/Cargo.toml | 6 +- core-primitives/Cargo.toml | 2 +- node/core/approval-voting/Cargo.toml | 6 +- node/core/approval-voting/src/import.rs | 32 ++ node/core/approval-voting/src/lib.rs | 7 +- node/core/approval-voting/src/tests.rs | 31 ++ node/core/av-store/Cargo.toml | 4 +- node/core/av-store/src/lib.rs | 28 +- node/core/chain-selection/Cargo.toml | 4 +- .../core/chain-selection/src/db_backend/v1.rs | 26 +- node/core/dispute-coordinator/Cargo.toml | 6 +- .../dispute-coordinator/src/scraping/mod.rs | 10 +- node/core/dispute-coordinator/src/tests.rs | 41 +- node/core/runtime-api/Cargo.toml | 2 +- node/malus/Cargo.toml | 2 +- node/metrics/src/tests.rs | 15 +- .../availability-distribution/Cargo.toml | 2 +- .../src/requester/session_cache.rs | 4 +- node/network/availability-recovery/Cargo.toml | 2 +- node/network/availability-recovery/src/lib.rs | 6 +- node/network/collator-protocol/Cargo.toml | 1 + .../src/collator_side/metrics.rs | 123 +++++ .../src/collator_side/mod.rs | 254 +++++---- .../src/collator_side/tests.rs | 116 +++- .../src/collator_side/validators_buffer.rs | 317 +++++++++++ node/network/collator-protocol/src/lib.rs | 27 +- .../src/validator_side/mod.rs | 33 +- .../src/validator_side/tests.rs | 50 +- node/network/dispute-distribution/Cargo.toml | 4 +- node/network/dispute-distribution/src/lib.rs | 41 +- .../dispute-distribution/src/metrics.rs | 7 +- .../src/receiver/batches/batch.rs | 209 +++++++ .../src/receiver/batches/mod.rs | 170 ++++++ .../src/receiver/batches/waiting_queue.rs | 204 +++++++ .../src/receiver/error.rs | 25 +- .../dispute-distribution/src/receiver/mod.rs | 511 +++++++++++------- .../src/receiver/peer_queues.rs | 141 +++++ .../dispute-distribution/src/sender/mod.rs | 110 +++- .../src/sender/send_task.rs | 30 +- .../dispute-distribution/src/tests/mock.rs | 28 +- .../dispute-distribution/src/tests/mod.rs | 453 ++++++++++++---- .../protocol/src/request_response/mod.rs | 8 +- node/overseer/Cargo.toml | 4 +- node/overseer/src/lib.rs | 6 +- node/service/Cargo.toml | 6 +- node/service/src/lib.rs | 4 +- node/service/src/parachains_db/upgrade.rs | 2 +- node/subsystem-test-helpers/src/lib.rs | 29 + node/subsystem-util/Cargo.toml | 8 +- node/subsystem-util/src/database.rs | 79 ++- .../src/rolling_session_window.rs | 339 +++++++++++- node/subsystem-util/src/runtime/mod.rs | 11 +- node/test/performance-test/Cargo.toml | 3 + parachain/Cargo.toml | 2 +- primitives/Cargo.toml | 2 +- .../src/node/disputes/dispute-distribution.md | 309 +++++++---- runtime/common/src/claims.rs | 5 +- runtime/common/src/lib.rs | 12 +- runtime/common/src/purchase.rs | 9 +- runtime/kusama/src/governance/fellowship.rs | 1 + runtime/kusama/src/governance/mod.rs | 1 + runtime/kusama/src/governance/old.rs | 6 +- runtime/kusama/src/lib.rs | 19 +- .../kusama/src/weights/pallet_democracy.rs | 185 +++---- runtime/kusama/src/weights/pallet_preimage.rs | 67 ++- .../kusama/src/weights/pallet_scheduler.rs | 161 ++---- runtime/parachains/src/configuration.rs | 3 +- .../parachains/src/configuration/migration.rs | 322 ++++++++++- runtime/polkadot/src/lib.rs | 25 +- .../polkadot/src/weights/pallet_democracy.rs | 185 +++---- .../polkadot/src/weights/pallet_preimage.rs | 63 ++- .../polkadot/src/weights/pallet_scheduler.rs | 160 ++---- runtime/rococo/src/lib.rs | 31 +- .../rococo/src/weights/pallet_democracy.rs | 183 +++---- runtime/rococo/src/weights/pallet_preimage.rs | 63 ++- .../rococo/src/weights/pallet_scheduler.rs | 158 ++---- runtime/test-runtime/src/lib.rs | 5 +- runtime/westend/src/lib.rs | 15 +- .../westend/src/weights/pallet_preimage.rs | 63 ++- .../westend/src/weights/pallet_scheduler.rs | 160 ++---- scripts/ci/gitlab/lingua.dic | 2 + xcm/pallet-xcm/src/lib.rs | 17 +- xcm/pallet-xcm/src/tests.rs | 8 +- xcm/xcm-executor/integration-tests/src/lib.rs | 7 +- 86 files changed, 4285 insertions(+), 2058 deletions(-) create mode 100644 node/network/collator-protocol/src/collator_side/metrics.rs create mode 100644 node/network/collator-protocol/src/collator_side/validators_buffer.rs create mode 100644 node/network/dispute-distribution/src/receiver/batches/batch.rs create mode 100644 node/network/dispute-distribution/src/receiver/batches/mod.rs create mode 100644 node/network/dispute-distribution/src/receiver/batches/waiting_queue.rs create mode 100644 node/network/dispute-distribution/src/receiver/peer_queues.rs diff --git a/Cargo.lock b/Cargo.lock index 1f4ec51a3fd9..33b4d44fefb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -435,7 +435,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "async-trait", @@ -472,7 +472,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -492,22 +492,25 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "beefy-primitives", "sp-api", + "sp-runtime", ] [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", "sp-application-crypto", "sp-core", + "sp-io", + "sp-mmr-primitives", "sp-runtime", "sp-std", ] @@ -529,9 +532,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.59.2" +version = "0.60.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" dependencies = [ "bitflags", "cexpr", @@ -554,9 +557,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitvec" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1489fcb93a5bb47da0462ca93ad252ad6af2145cce58d10d46a83931ba9f016b" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", "radium", @@ -914,7 +917,7 @@ checksum = "fa66045b9cb23c2e9c1520732030608b02ee07e5cfaa5a521ec15ded7fa24c90" dependencies = [ "glob", "libc", - "libloading 0.7.2", + "libloading", ] [[package]] @@ -1945,9 +1948,9 @@ dependencies = [ [[package]] name = "fixed-hash" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", "rand 0.8.5", @@ -1998,7 +2001,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", ] @@ -2016,7 +2019,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -2039,7 +2042,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "Inflector", "array-bytes", @@ -2090,7 +2093,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2101,7 +2104,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2117,7 +2120,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -2146,7 +2149,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "bitflags", "frame-metadata", @@ -2178,7 +2181,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "Inflector", "cfg-expr", @@ -2192,7 +2195,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2204,7 +2207,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "proc-macro2", "quote", @@ -2214,7 +2217,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2237,7 +2240,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -2248,7 +2251,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "log", @@ -2266,7 +2269,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -2281,7 +2284,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "sp-api", @@ -2290,7 +2293,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "parity-scale-codec", @@ -2305,18 +2308,6 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ebd3504ad6116843b8375ad70df74e7bfe83cac77a1f3fe73200c844d43bfe0" -[[package]] -name = "fs-swap" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5" -dependencies = [ - "lazy_static", - "libc", - "libloading 0.5.2", - "winapi", -] - [[package]] name = "fs2" version = "0.4.3" @@ -2473,7 +2464,7 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "chrono", "frame-election-provider-support", @@ -2909,9 +2900,9 @@ dependencies = [ [[package]] name = "impl-serde" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" dependencies = [ "serde", ] @@ -3326,9 +3317,9 @@ dependencies = [ [[package]] name = "kvdb" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a301d8ecb7989d4a6e2c57a49baca77d353bdbf879909debe3f375fe25d61f86" +checksum = "585089ceadba0197ffe9af6740ab350b325e3c1f5fccfbc3522e0250c750409b" dependencies = [ "parity-util-mem", "smallvec", @@ -3336,9 +3327,9 @@ dependencies = [ [[package]] name = "kvdb-memorydb" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece7e668abd21387aeb6628130a6f4c802787f014fa46bc83221448322250357" +checksum = "40d109c87bfb7759edd2a49b2649c1afe25af785d930ad6a38479b4dc70dd873" dependencies = [ "kvdb", "parity-util-mem", @@ -3347,15 +3338,13 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.15.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca7fbdfd71cd663dceb0faf3367a99f8cf724514933e9867cec4995b6027cbc1" +checksum = "c076cc2cdbac89b9910c853a36c957d3862a779f31c2661174222cefb49ee597" dependencies = [ - "fs-swap", "kvdb", "log", "num_cpus", - "owning_ref", "parity-util-mem", "parking_lot 0.12.1", "regex", @@ -3365,9 +3354,9 @@ dependencies = [ [[package]] name = "kvdb-shared-tests" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9001edd3459aa1503ea84215cf4618a6e2e020f51682494cc6f5ab1150e68e" +checksum = "de82a1adb7ade192c0090dd56d059a626191c0638c795eb68aff4b0bd2c1f9be" dependencies = [ "kvdb", ] @@ -3402,16 +3391,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "libloading" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -dependencies = [ - "cc", - "winapi", -] - [[package]] name = "libloading" version = "0.7.2" @@ -3945,9 +3924,9 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "0.6.1+6.28.2" +version = "0.8.0+7.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc587013734dadb7cf23468e531aa120788b87243648be42e2d3a072186291" +checksum = "611804e4666a25136fcc5f8cf425ab4d26c7f74ea245ffe92ea23b85b6420b5d" dependencies = [ "bindgen", "bzip2-sys", @@ -4224,9 +4203,9 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" +checksum = "34ac11bb793c28fa095b7554466f53b3a60a2cd002afdac01bcf135cbd73a269" dependencies = [ "hash-db", "hashbrown", @@ -4834,7 +4813,7 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -4848,7 +4827,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -4864,7 +4843,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -4879,7 +4858,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -4903,7 +4882,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4923,7 +4902,7 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4942,7 +4921,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -4957,7 +4936,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "beefy-primitives", "frame-support", @@ -4973,7 +4952,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "beefy-merkle-tree", @@ -4996,7 +4975,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5014,7 +4993,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5033,7 +5012,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5050,7 +5029,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#dbb72f3fd98253b72c0090375b738b9d00995090" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5067,14 +5046,16 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "serde", + "sp-core", "sp-io", "sp-runtime", "sp-std", @@ -5083,7 +5064,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5107,7 +5088,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5120,7 +5101,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5138,7 +5119,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5159,7 +5140,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5174,7 +5155,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5197,7 +5178,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5213,7 +5194,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5233,7 +5214,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5250,7 +5231,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5267,7 +5248,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5285,7 +5266,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -5300,11 +5281,12 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-io", @@ -5315,7 +5297,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -5332,7 +5314,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5352,7 +5334,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "sp-api", @@ -5362,7 +5344,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -5379,7 +5361,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5402,11 +5384,12 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-core", @@ -5418,7 +5401,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5433,7 +5416,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#dbb72f3fd98253b72c0090375b738b9d00995090" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5451,7 +5434,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5466,7 +5449,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#dbb72f3fd98253b72c0090375b738b9d00995090" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5484,7 +5467,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5500,7 +5483,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -5521,7 +5504,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5537,7 +5520,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -5551,7 +5534,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5574,7 +5557,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5585,7 +5568,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "log", "sp-arithmetic", @@ -5594,7 +5577,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -5608,7 +5591,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5626,7 +5609,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5645,7 +5628,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -5661,7 +5644,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5676,7 +5659,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5687,7 +5670,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5704,7 +5687,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5720,7 +5703,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5735,7 +5718,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#dbb72f3fd98253b72c0090375b738b9d00995090" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5848,9 +5831,9 @@ checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" [[package]] name = "parity-util-mem" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" +checksum = "0d32c34f4f5ca7f9196001c0aba5a1f9a5a12382c8944b8b0f90233282d1e8f8" dependencies = [ "cfg-if 1.0.0", "hashbrown", @@ -6035,18 +6018,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", @@ -6166,7 +6149,7 @@ dependencies = [ "fatality", "futures", "futures-timer", - "lru 0.7.8", + "lru 0.8.0", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6196,7 +6179,7 @@ dependencies = [ "futures", "futures-timer", "log", - "lru 0.7.8", + "lru 0.8.0", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6289,6 +6272,7 @@ version = "0.9.29" dependencies = [ "always-assert", "assert_matches", + "bitvec", "env_logger 0.9.0", "fatality", "futures", @@ -6333,8 +6317,9 @@ dependencies = [ "fatality", "futures", "futures-timer", + "indexmap", "lazy_static", - "lru 0.7.8", + "lru 0.8.0", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6454,7 +6439,7 @@ dependencies = [ "futures-timer", "kvdb", "kvdb-memorydb", - "lru 0.7.8", + "lru 0.8.0", "merlin", "parity-scale-codec", "parking_lot 0.12.1", @@ -6623,7 +6608,7 @@ dependencies = [ "futures-timer", "kvdb", "kvdb-memorydb", - "lru 0.7.8", + "lru 0.8.0", "parity-scale-codec", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -6910,7 +6895,7 @@ dependencies = [ "kvdb-shared-tests", "lazy_static", "log", - "lru 0.7.8", + "lru 0.8.0", "parity-db", "parity-scale-codec", "parity-util-mem", @@ -6944,7 +6929,7 @@ dependencies = [ "femme", "futures", "futures-timer", - "lru 0.7.8", + "lru 0.8.0", "orchestra", "parity-util-mem", "parking_lot 0.12.1", @@ -7301,7 +7286,7 @@ dependencies = [ "kvdb", "kvdb-rocksdb", "log", - "lru 0.7.8", + "lru 0.8.0", "pallet-babe", "pallet-im-online", "pallet-staking", @@ -7725,9 +7710,9 @@ dependencies = [ [[package]] name = "primitive-types" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" +checksum = "5cfd65aea0c5fa0bfcc7c9e7ca828c921ef778f43d325325ec84bda371bfa75a" dependencies = [ "fixed-hash", "impl-codec", @@ -8267,7 +8252,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "env_logger 0.9.0", "jsonrpsee", @@ -8365,9 +8350,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620f4129485ff1a7128d184bc687470c21c7951b64779ebc9cfdad3dcd920290" +checksum = "7e9562ea1d70c0cc63a34a22d977753b50cca91cc6b6527750463bd5dd8697bc" dependencies = [ "libc", "librocksdb-sys", @@ -8615,7 +8600,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "log", "sp-core", @@ -8626,7 +8611,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "futures", @@ -8635,8 +8620,8 @@ dependencies = [ "libp2p", "log", "parity-scale-codec", - "prost 0.10.3", - "prost-build 0.10.4", + "prost 0.11.0", + "prost-build 0.11.1", "rand 0.7.3", "sc-client-api", "sc-network-common", @@ -8653,7 +8638,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "futures-timer", @@ -8676,7 +8661,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8692,7 +8677,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8709,7 +8694,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8720,7 +8705,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "chrono", @@ -8760,7 +8745,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "fnv", "futures", @@ -8788,7 +8773,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "hash-db", "kvdb", @@ -8813,7 +8798,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "futures", @@ -8837,7 +8822,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "fork-tree", @@ -8879,7 +8864,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "jsonrpsee", @@ -8901,7 +8886,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8914,7 +8899,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "futures", @@ -8938,7 +8923,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "lazy_static", "lru 0.7.8", @@ -8965,7 +8950,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "environmental", "parity-scale-codec", @@ -8981,7 +8966,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "log", "parity-scale-codec", @@ -8996,7 +8981,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "cfg-if 1.0.0", "libc", @@ -9016,7 +9001,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "ahash", "array-bytes", @@ -9057,7 +9042,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "finality-grandpa", "futures", @@ -9078,7 +9063,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "ansi_term", "futures", @@ -9095,7 +9080,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "async-trait", @@ -9110,7 +9095,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "async-trait", @@ -9132,7 +9117,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "pin-project", - "prost 0.10.3", + "prost 0.11.0", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -9157,7 +9142,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "cid", "futures", @@ -9177,7 +9162,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "bitflags", @@ -9187,7 +9172,7 @@ dependencies = [ "libp2p", "linked_hash_set", "parity-scale-codec", - "prost-build 0.10.4", + "prost-build 0.11.1", "sc-consensus", "sc-peerset", "serde", @@ -9203,7 +9188,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "ahash", "futures", @@ -9221,15 +9206,15 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "futures", "libp2p", "log", "parity-scale-codec", - "prost 0.10.3", - "prost-build 0.10.4", + "prost 0.11.0", + "prost-build 0.11.1", "sc-client-api", "sc-network-common", "sc-peerset", @@ -9242,7 +9227,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "fork-tree", @@ -9251,8 +9236,8 @@ dependencies = [ "log", "lru 0.7.8", "parity-scale-codec", - "prost 0.10.3", - "prost-build 0.10.4", + "prost 0.11.0", + "prost-build 0.11.1", "sc-client-api", "sc-consensus", "sc-network-common", @@ -9270,7 +9255,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "futures", @@ -9289,7 +9274,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "bytes", @@ -9319,7 +9304,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "libp2p", @@ -9332,7 +9317,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9341,7 +9326,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "hash-db", @@ -9371,7 +9356,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "jsonrpsee", @@ -9394,7 +9379,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "jsonrpsee", @@ -9407,7 +9392,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "directories", @@ -9477,7 +9462,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "log", "parity-scale-codec", @@ -9491,7 +9476,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -9510,7 +9495,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "libc", @@ -9529,7 +9514,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "chrono", "futures", @@ -9547,7 +9532,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "ansi_term", "atty", @@ -9578,7 +9563,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9589,7 +9574,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "futures-timer", @@ -9615,7 +9600,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "log", @@ -9628,7 +9613,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "futures-timer", @@ -10114,7 +10099,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "hash-db", "log", @@ -10132,7 +10117,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "blake2", "proc-macro-crate", @@ -10144,7 +10129,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10157,7 +10142,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "integer-sqrt", "num-traits", @@ -10172,7 +10157,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10185,7 +10170,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "parity-scale-codec", @@ -10197,7 +10182,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "sp-api", @@ -10209,7 +10194,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "log", @@ -10227,7 +10212,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "futures", @@ -10246,7 +10231,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "merlin", @@ -10269,7 +10254,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10283,7 +10268,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10296,7 +10281,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "base58", @@ -10342,7 +10327,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "blake2", "byteorder", @@ -10356,7 +10341,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "proc-macro2", "quote", @@ -10367,7 +10352,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -10376,7 +10361,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "proc-macro2", "quote", @@ -10386,7 +10371,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "environmental", "parity-scale-codec", @@ -10397,7 +10382,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "finality-grandpa", "log", @@ -10415,7 +10400,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10429,7 +10414,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "bytes", "futures", @@ -10455,7 +10440,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "lazy_static", "sp-core", @@ -10466,7 +10451,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "futures", @@ -10483,7 +10468,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "thiserror", "zstd", @@ -10492,10 +10477,11 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "log", "parity-scale-codec", + "scale-info", "serde", "sp-api", "sp-core", @@ -10507,7 +10493,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10521,7 +10507,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "sp-api", "sp-core", @@ -10531,7 +10517,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "backtrace", "lazy_static", @@ -10541,7 +10527,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "rustc-hash", "serde", @@ -10551,7 +10537,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "either", "hash256-std-hasher", @@ -10574,7 +10560,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -10592,7 +10578,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "Inflector", "proc-macro-crate", @@ -10604,7 +10590,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "log", "parity-scale-codec", @@ -10618,7 +10604,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10632,7 +10618,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10643,7 +10629,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "hash-db", "log", @@ -10665,12 +10651,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10683,7 +10669,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "log", "sp-core", @@ -10696,7 +10682,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "futures-timer", @@ -10712,7 +10698,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "sp-std", @@ -10724,7 +10710,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "sp-api", "sp-runtime", @@ -10733,7 +10719,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "log", @@ -10749,7 +10735,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "ahash", "hash-db", @@ -10772,7 +10758,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10789,7 +10775,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10800,7 +10786,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "impl-trait-for-tuples", "log", @@ -10813,7 +10799,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -11028,7 +11014,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "platforms", ] @@ -11036,7 +11022,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -11057,7 +11043,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures-util", "hyper", @@ -11070,7 +11056,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "jsonrpsee", "log", @@ -11091,7 +11077,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "async-trait", @@ -11117,7 +11103,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "substrate-test-utils-derive", @@ -11127,7 +11113,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11138,7 +11124,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "ansi_term", "build-helper", @@ -11448,9 +11434,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-ctl" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb833c46ecbf8b6daeccb347cefcabf9c1beb5c9b0f853e1cec45632d9963e69" +checksum = "e37706572f4b151dff7a0146e040804e9c26fe3a3118591112f05cf12a4216c1" dependencies = [ "libc", "paste", @@ -11459,9 +11445,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-sys" -version = "0.4.2+5.2.1-patched.2" +version = "0.5.2+5.3.0-patched" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5844e429d797c62945a566f8da4e24c7fe3fbd5d6617fd8bf7a0b7dc1ee0f22e" +checksum = "ec45c14da997d0925c7835883e4d5c181f196fa142f8c19d7643d1e9af2592c3" dependencies = [ "cc", "fs_extra", @@ -11470,9 +11456,9 @@ dependencies = [ [[package]] name = "tikv-jemallocator" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c14a5a604eb8715bc5785018a37d00739b180bcf609916ddf4393d33d49ccdf" +checksum = "20612db8a13a6c06d57ec83953694185a367e16945f66565e8028d2c0bd76979" dependencies = [ "libc", "tikv-jemalloc-sys", @@ -11851,7 +11837,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "clap", "frame-try-runtime", diff --git a/Cargo.toml b/Cargo.toml index ee886dafdc8a..0ed0892593d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ readme = "README.md" [dependencies] polkadot-cli = { path = "cli", features = [ "kusama-native", "westend-native", "rococo-native" ] } color-eyre = { version = "0.6.1", default-features = false } -parity-util-mem = { version = "0.11.0", default-features = false, features = ["jemalloc-global"] } +parity-util-mem = { version = "0.12.0", default-features = false, features = ["jemalloc-global"] } [dev-dependencies] assert_cmd = "2.0.4" @@ -125,9 +125,9 @@ maintenance = { status = "actively-developed" } # # This list is ordered alphabetically. [profile.dev.package] -blake2b_simd = { opt-level = 3 } blake2 = { opt-level = 3 } blake2-rfc = { opt-level = 3 } +blake2b_simd = { opt-level = 3 } chacha20poly1305 = { opt-level = 3 } cranelift-codegen = { opt-level = 3 } cranelift-wasm = { opt-level = 3 } @@ -138,8 +138,8 @@ curve25519-dalek = { opt-level = 3 } ed25519-dalek = { opt-level = 3 } flate2 = { opt-level = 3 } futures-channel = { opt-level = 3 } -hashbrown = { opt-level = 3 } hash-db = { opt-level = 3 } +hashbrown = { opt-level = 3 } hmac = { opt-level = 3 } httparse = { opt-level = 3 } integer-sqrt = { opt-level = 3 } @@ -151,8 +151,8 @@ libz-sys = { opt-level = 3 } mio = { opt-level = 3 } nalgebra = { opt-level = 3 } num-bigint = { opt-level = 3 } -parking_lot_core = { opt-level = 3 } parking_lot = { opt-level = 3 } +parking_lot_core = { opt-level = 3 } percent-encoding = { opt-level = 3 } primitive-types = { opt-level = 3 } reed-solomon-novelpoly = { opt-level = 3 } @@ -162,6 +162,7 @@ sha2 = { opt-level = 3 } sha3 = { opt-level = 3 } smallvec = { opt-level = 3 } snow = { opt-level = 3 } +substrate-bip39 = {opt-level = 3} twox-hash = { opt-level = 3 } uint = { opt-level = 3 } wasmi = { opt-level = 3 } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 1e770cd8715b..1be1b63c0cfb 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -56,7 +56,11 @@ cli = [ "polkadot-client", "polkadot-node-core-pvf", ] -runtime-benchmarks = ["service/runtime-benchmarks", "polkadot-node-metrics/runtime-benchmarks"] +runtime-benchmarks = [ + "service/runtime-benchmarks", + "polkadot-node-metrics/runtime-benchmarks", + "polkadot-performance-test?/runtime-benchmarks" +] trie-memory-tracker = ["sp-trie/memory-tracker"] full-node = ["service/full-node"] try-runtime = ["service/try-runtime"] diff --git a/core-primitives/Cargo.toml b/core-primitives/Cargo.toml index 9bbe8f516afb..a10b80b0c30f 100644 --- a/core-primitives/Cargo.toml +++ b/core-primitives/Cargo.toml @@ -10,7 +10,7 @@ sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", d sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } parity-scale-codec = { version = "3.1.5", default-features = false, features = [ "derive" ] } -parity-util-mem = { version = "0.11.0", default-features = false, optional = true } +parity-util-mem = { version = "0.12.0", default-features = false, optional = true } [features] default = [ "std" ] diff --git a/node/core/approval-voting/Cargo.toml b/node/core/approval-voting/Cargo.toml index f2572cac8232..25fb51eb712b 100644 --- a/node/core/approval-voting/Cargo.toml +++ b/node/core/approval-voting/Cargo.toml @@ -10,10 +10,10 @@ futures-timer = "3.0.2" parity-scale-codec = { version = "3.1.5", default-features = false, features = ["bit-vec", "derive"] } gum = { package = "tracing-gum", path = "../../gum" } bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } -lru = "0.7" +lru = "0.8" merlin = "2.0" schnorrkel = "0.9.1" -kvdb = "0.11.0" +kvdb = "0.12.0" derive_more = "0.99.17" thiserror = "1.0.31" @@ -40,5 +40,5 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } assert_matches = "1.4.0" -kvdb-memorydb = "0.11.0" +kvdb-memorydb = "0.12.0" test-helpers = { package = "polkadot-primitives-test-helpers", path = "../../../primitives/test-helpers" } diff --git a/node/core/approval-voting/src/import.rs b/node/core/approval-voting/src/import.rs index d43bf40546ae..5413c271e0d6 100644 --- a/node/core/approval-voting/src/import.rs +++ b/node/core/approval-voting/src/import.rs @@ -1296,6 +1296,38 @@ pub(crate) mod tests { } ); + // Caching of sesssions needs sessoion of first unfinalied block. + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( + s_tx, + )) => { + let _ = s_tx.send(Ok(header.number)); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( + block_number, + s_tx, + )) => { + assert_eq!(block_number, header.number); + let _ = s_tx.send(Ok(Some(header.hash()))); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionIndexForChild(s_tx), + )) => { + assert_eq!(h, header.hash()); + let _ = s_tx.send(Ok(session)); + } + ); + // determine_new_blocks exits early as the parent_hash is in the DB assert_matches!( diff --git a/node/core/approval-voting/src/lib.rs b/node/core/approval-voting/src/lib.rs index ac025f366ab7..467d8be612e9 100644 --- a/node/core/approval-voting/src/lib.rs +++ b/node/core/approval-voting/src/lib.rs @@ -70,6 +70,7 @@ use std::{ collections::{ btree_map::Entry as BTMEntry, hash_map::Entry as HMEntry, BTreeMap, HashMap, HashSet, }, + num::NonZeroUsize, sync::Arc, time::Duration, }; @@ -104,7 +105,11 @@ const APPROVAL_CHECKING_TIMEOUT: Duration = Duration::from_secs(120); /// Value rather arbitrarily: Should not be hit in practice, it exists to more easily diagnose dead /// lock issues for example. const WAIT_FOR_SIGS_TIMEOUT: Duration = Duration::from_millis(500); -const APPROVAL_CACHE_SIZE: usize = 1024; +const APPROVAL_CACHE_SIZE: NonZeroUsize = match NonZeroUsize::new(1024) { + Some(cap) => cap, + None => panic!("Approval cache size must be non-zero."), +}; + const TICK_TOO_FAR_IN_FUTURE: Tick = 20; // 10 seconds. const APPROVAL_DELAY: Tick = 2; const LOG_TARGET: &str = "parachain::approval-voting"; diff --git a/node/core/approval-voting/src/tests.rs b/node/core/approval-voting/src/tests.rs index 66d1402ed6dc..bdb7a8c929b3 100644 --- a/node/core/approval-voting/src/tests.rs +++ b/node/core/approval-voting/src/tests.rs @@ -807,6 +807,37 @@ async fn import_block( } ); + assert_matches!( + overseer_recv(overseer).await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( + s_tx, + )) => { + let _ = s_tx.send(Ok(number)); + } + ); + + assert_matches!( + overseer_recv(overseer).await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( + block_number, + s_tx, + )) => { + assert_eq!(block_number, number); + let _ = s_tx.send(Ok(Some(hashes[number as usize].0))); + } + ); + + assert_matches!( + overseer_recv(overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionIndexForChild(s_tx), + )) => { + assert_eq!(h, hashes[number as usize].0); + let _ = s_tx.send(Ok(number.into())); + } + ); + if !fork { assert_matches!( overseer_recv(overseer).await, diff --git a/node/core/av-store/Cargo.toml b/node/core/av-store/Cargo.toml index 9cea9f1bdc24..4cec2cb637b9 100644 --- a/node/core/av-store/Cargo.toml +++ b/node/core/av-store/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] futures = "0.3.21" futures-timer = "3.0.2" -kvdb = "0.11.0" +kvdb = "0.12.0" thiserror = "1.0.31" gum = { package = "tracing-gum", path = "../../gum" } bitvec = "1.0.0" @@ -24,7 +24,7 @@ polkadot-node-primitives = { path = "../../primitives" } log = "0.4.17" env_logger = "0.9.0" assert_matches = "1.4.0" -kvdb-memorydb = "0.11.0" +kvdb-memorydb = "0.12.0" sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } diff --git a/node/core/av-store/src/lib.rs b/node/core/av-store/src/lib.rs index cd1685e32ea8..4fbbf3740ab0 100644 --- a/node/core/av-store/src/lib.rs +++ b/node/core/av-store/src/lib.rs @@ -792,8 +792,9 @@ fn note_block_included( macro_rules! peek_num { ($iter:ident) => { match $iter.peek() { - Some((k, _)) => decode_unfinalized_key(&k[..]).ok().map(|(b, _, _)| b), - None => None, + Some(Ok((k, _))) => Ok(decode_unfinalized_key(&k[..]).ok().map(|(b, _, _)| b)), + Some(Err(_)) => Err($iter.next().expect("peek returned Some(Err); qed").unwrap_err()), + None => Ok(None), } }; } @@ -819,10 +820,10 @@ async fn process_block_finalized( let mut iter = subsystem .db .iter_with_prefix(subsystem.config.col_meta, &start_prefix) - .take_while(|(k, _)| &k[..] < &end_prefix[..]) + .take_while(|r| r.as_ref().map_or(true, |(k, _v)| &k[..] < &end_prefix[..])) .peekable(); - match peek_num!(iter) { + match peek_num!(iter)? { None => break, // end of iterator. Some(n) => n, } @@ -867,10 +868,10 @@ async fn process_block_finalized( let iter = subsystem .db .iter_with_prefix(subsystem.config.col_meta, &start_prefix) - .take_while(|(k, _)| &k[..] < &end_prefix[..]) + .take_while(|r| r.as_ref().map_or(true, |(k, _v)| &k[..] < &end_prefix[..])) .peekable(); - let batch = load_all_at_finalized_height(iter, batch_num, batch_finalized_hash); + let batch = load_all_at_finalized_height(iter, batch_num, batch_finalized_hash)?; // Now that we've iterated over the entire batch at this finalized height, // update the meta. @@ -890,22 +891,22 @@ async fn process_block_finalized( // loads all candidates at the finalized height and maps them to `true` if finalized // and `false` if unfinalized. fn load_all_at_finalized_height( - mut iter: std::iter::Peekable, Box<[u8]>)>>, + mut iter: std::iter::Peekable>>, block_number: BlockNumber, finalized_hash: Hash, -) -> impl IntoIterator { +) -> io::Result> { // maps candidate hashes to true if finalized, false otherwise. let mut candidates = HashMap::new(); // Load all candidates that were included at this height. loop { - match peek_num!(iter) { + match peek_num!(iter)? { None => break, // end of iterator. Some(n) if n != block_number => break, // end of batch. _ => {}, } - let (k, _v) = iter.next().expect("`peek` used to check non-empty; qed"); + let (k, _v) = iter.next().expect("`peek` used to check non-empty; qed")?; let (_, block_hash, candidate_hash) = decode_unfinalized_key(&k[..]).expect("`peek_num` checks validity of key; qed"); @@ -916,7 +917,7 @@ fn load_all_at_finalized_height( } } - candidates + Ok(candidates) } fn update_blocks_at_finalized_height( @@ -1214,9 +1215,10 @@ fn prune_all(db: &Arc, config: &Config, clock: &dyn Clock) -> Resu let mut tx = DBTransaction::new(); let iter = db .iter_with_prefix(config.col_meta, &range_start[..]) - .take_while(|(k, _)| &k[..] < &range_end[..]); + .take_while(|r| r.as_ref().map_or(true, |(k, _v)| &k[..] < &range_end[..])); - for (k, _v) in iter { + for r in iter { + let (k, _v) = r?; tx.delete(config.col_meta, &k[..]); let (_, candidate_hash) = match decode_pruning_key(&k[..]) { diff --git a/node/core/chain-selection/Cargo.toml b/node/core/chain-selection/Cargo.toml index 8d9875b6f389..df6a5c24f10e 100644 --- a/node/core/chain-selection/Cargo.toml +++ b/node/core/chain-selection/Cargo.toml @@ -13,7 +13,7 @@ polkadot-primitives = { path = "../../../primitives" } polkadot-node-primitives = { path = "../../primitives" } polkadot-node-subsystem = { path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } -kvdb = "0.11.0" +kvdb = "0.12.0" thiserror = "1.0.31" parity-scale-codec = "3.1.5" @@ -22,4 +22,4 @@ polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } parking_lot = "0.12.0" assert_matches = "1" -kvdb-memorydb = "0.11.0" +kvdb-memorydb = "0.12.0" diff --git a/node/core/chain-selection/src/db_backend/v1.rs b/node/core/chain-selection/src/db_backend/v1.rs index db117ff945df..a037d27baaea 100644 --- a/node/core/chain-selection/src/db_backend/v1.rs +++ b/node/core/chain-selection/src/db_backend/v1.rs @@ -235,16 +235,21 @@ impl Backend for DbBackend { self.inner.iter_with_prefix(self.config.col_data, &STAGNANT_AT_PREFIX[..]); let val = stagnant_at_iter - .filter_map(|(k, v)| { - match (decode_stagnant_at_key(&mut &k[..]), >::decode(&mut &v[..]).ok()) { - (Some(at), Some(stagnant_at)) => Some((at, stagnant_at)), - _ => None, - } + .filter_map(|r| match r { + Ok((k, v)) => + match (decode_stagnant_at_key(&mut &k[..]), >::decode(&mut &v[..]).ok()) + { + (Some(at), Some(stagnant_at)) => Some(Ok((at, stagnant_at))), + _ => None, + }, + Err(e) => Some(Err(e)), }) .enumerate() - .take_while(|(idx, (at, _))| *at <= up_to.into() && *idx < max_elements) + .take_while(|(idx, r)| { + r.as_ref().map_or(true, |(at, _)| *at <= up_to.into() && *idx < max_elements) + }) .map(|(_, v)| v) - .collect::>(); + .collect::, _>>()?; Ok(val) } @@ -254,10 +259,13 @@ impl Backend for DbBackend { self.inner.iter_with_prefix(self.config.col_data, &BLOCK_HEIGHT_PREFIX[..]); let val = blocks_at_height_iter - .filter_map(|(k, _)| decode_block_height_key(&k[..])) + .filter_map(|r| match r { + Ok((k, _)) => decode_block_height_key(&k[..]).map(Ok), + Err(e) => Some(Err(e)), + }) .next(); - Ok(val) + val.transpose().map_err(Error::from) } fn load_blocks_by_number(&self, number: BlockNumber) -> Result, Error> { diff --git a/node/core/dispute-coordinator/Cargo.toml b/node/core/dispute-coordinator/Cargo.toml index bc22b40c8529..fd89b599f63c 100644 --- a/node/core/dispute-coordinator/Cargo.toml +++ b/node/core/dispute-coordinator/Cargo.toml @@ -8,9 +8,9 @@ edition = "2021" futures = "0.3.21" gum = { package = "tracing-gum", path = "../../gum" } parity-scale-codec = "3.1.5" -kvdb = "0.11.0" +kvdb = "0.12.0" thiserror = "1.0.31" -lru = "0.7.7" +lru = "0.8.0" fatality = "0.0.6" polkadot-primitives = { path = "../../../primitives" } @@ -22,7 +22,7 @@ sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "maste [dev-dependencies] -kvdb-memorydb = "0.11.0" +kvdb-memorydb = "0.12.0" polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/core/dispute-coordinator/src/scraping/mod.rs b/node/core/dispute-coordinator/src/scraping/mod.rs index b45dbfa95197..7d5d33e1ff4b 100644 --- a/node/core/dispute-coordinator/src/scraping/mod.rs +++ b/node/core/dispute-coordinator/src/scraping/mod.rs @@ -14,7 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::collections::{BTreeMap, HashSet}; +use std::{ + collections::{BTreeMap, HashSet}, + num::NonZeroUsize, +}; use futures::channel::oneshot; use lru::LruCache; @@ -44,7 +47,10 @@ mod tests; /// `last_observed_blocks` LRU. This means, this value should the very least be as large as the /// number of expected forks for keeping chain scraping efficient. Making the LRU much larger than /// that has very limited use. -const LRU_OBSERVED_BLOCKS_CAPACITY: usize = 20; +const LRU_OBSERVED_BLOCKS_CAPACITY: NonZeroUsize = match NonZeroUsize::new(20) { + Some(cap) => cap, + None => panic!("Observed blocks cache size must be non-zero"), +}; /// Chain scraper /// diff --git a/node/core/dispute-coordinator/src/tests.rs b/node/core/dispute-coordinator/src/tests.rs index ff85319599ce..aaef00999259 100644 --- a/node/core/dispute-coordinator/src/tests.rs +++ b/node/core/dispute-coordinator/src/tests.rs @@ -239,13 +239,15 @@ impl TestState { ))) .await; - self.handle_sync_queries(virtual_overseer, block_hash, session).await; + self.handle_sync_queries(virtual_overseer, block_hash, block_number, session) + .await; } async fn handle_sync_queries( &mut self, virtual_overseer: &mut VirtualOverseer, block_hash: Hash, + block_number: BlockNumber, session: SessionIndex, ) { // Order of messages is not fixed (different on initializing): @@ -278,11 +280,45 @@ impl TestState { finished_steps.got_session_information = true; assert_eq!(h, block_hash); let _ = tx.send(Ok(session)); + + // Queries for fetching earliest unfinalized block session. See `RollingSessionWindow`. + assert_matches!( + overseer_recv(virtual_overseer).await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( + s_tx, + )) => { + let _ = s_tx.send(Ok(block_number)); + } + ); + + assert_matches!( + overseer_recv(virtual_overseer).await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( + number, + s_tx, + )) => { + assert_eq!(block_number, number); + let _ = s_tx.send(Ok(Some(block_hash))); + } + ); + + assert_matches!( + overseer_recv(virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionIndexForChild(s_tx), + )) => { + assert_eq!(h, block_hash); + let _ = s_tx.send(Ok(session)); + } + ); + // No queries, if subsystem knows about this session already. if self.known_session == Some(session) { continue } self.known_session = Some(session); + loop { // answer session info queries until the current session is reached. assert_matches!( @@ -361,7 +397,8 @@ impl TestState { ))) .await; - self.handle_sync_queries(virtual_overseer, *leaf, session).await; + self.handle_sync_queries(virtual_overseer, *leaf, n as BlockNumber, session) + .await; } } diff --git a/node/core/runtime-api/Cargo.toml b/node/core/runtime-api/Cargo.toml index 9ef6af06c5c2..b7a9895e0c67 100644 --- a/node/core/runtime-api/Cargo.toml +++ b/node/core/runtime-api/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" futures = "0.3.21" gum = { package = "tracing-gum", path = "../../gum" } memory-lru = "0.1.1" -parity-util-mem = { version = "0.11.0", default-features = false } +parity-util-mem = { version = "0.12.0", default-features = false } sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/malus/Cargo.toml b/node/malus/Cargo.toml index b68adef1a1df..9548857a03ed 100644 --- a/node/malus/Cargo.toml +++ b/node/malus/Cargo.toml @@ -23,7 +23,7 @@ polkadot-node-core-backing = { path = "../core/backing" } polkadot-node-primitives = { path = "../primitives" } polkadot-primitives = { path = "../../primitives" } polkadot-node-core-pvf = { path = "../core/pvf" } -parity-util-mem = { version = "0.11.0", default-features = false, features = ["jemalloc-global"] } +parity-util-mem = { version = "0.12.0", default-features = false, features = ["jemalloc-global"] } color-eyre = { version = "0.6.1", default-features = false } assert_matches = "1.5" async-trait = "0.1.57" diff --git a/node/metrics/src/tests.rs b/node/metrics/src/tests.rs index 56e07d96280d..932cc7b68be7 100644 --- a/node/metrics/src/tests.rs +++ b/node/metrics/src/tests.rs @@ -92,16 +92,11 @@ async fn scrape_prometheus_metrics(metrics_uri: &str) -> HashMap { .expect("Scraper failed to parse Prometheus metrics") .samples .into_iter() - .map(|sample| { - ( - sample.metric.to_owned(), - match sample.value { - prometheus_parse::Value::Counter(value) => value as u64, - prometheus_parse::Value::Gauge(value) => value as u64, - prometheus_parse::Value::Untyped(value) => value as u64, - _ => unreachable!("unexpected metric type"), - }, - ) + .filter_map(|prometheus_parse::Sample { metric, value, .. }| match value { + prometheus_parse::Value::Counter(value) => Some((metric, value as u64)), + prometheus_parse::Value::Gauge(value) => Some((metric, value as u64)), + prometheus_parse::Value::Untyped(value) => Some((metric, value as u64)), + _ => None, }) .collect() } diff --git a/node/network/availability-distribution/Cargo.toml b/node/network/availability-distribution/Cargo.toml index 43d56a1ace24..3e8626c18898 100644 --- a/node/network/availability-distribution/Cargo.toml +++ b/node/network/availability-distribution/Cargo.toml @@ -19,7 +19,7 @@ sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "maste thiserror = "1.0.31" rand = "0.8.5" derive_more = "0.99.17" -lru = "0.7.7" +lru = "0.8.0" fatality = "0.0.6" [dev-dependencies] diff --git a/node/network/availability-distribution/src/requester/session_cache.rs b/node/network/availability-distribution/src/requester/session_cache.rs index 6d41d9301233..cf01e448b70b 100644 --- a/node/network/availability-distribution/src/requester/session_cache.rs +++ b/node/network/availability-distribution/src/requester/session_cache.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::collections::HashSet; +use std::{collections::HashSet, num::NonZeroUsize}; use lru::LruCache; use rand::{seq::SliceRandom, thread_rng}; @@ -85,7 +85,7 @@ impl SessionCache { pub fn new() -> Self { SessionCache { // We need to cache the current and the last session the most: - session_info_cache: LruCache::new(2), + session_info_cache: LruCache::new(NonZeroUsize::new(2).unwrap()), } } diff --git a/node/network/availability-recovery/Cargo.toml b/node/network/availability-recovery/Cargo.toml index fce9755a05a3..86f6237740fa 100644 --- a/node/network/availability-recovery/Cargo.toml +++ b/node/network/availability-recovery/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] futures = "0.3.21" -lru = "0.7.7" +lru = "0.8.0" rand = "0.8.5" fatality = "0.0.6" thiserror = "1.0.31" diff --git a/node/network/availability-recovery/src/lib.rs b/node/network/availability-recovery/src/lib.rs index 62401e3ad615..f2f92cc54490 100644 --- a/node/network/availability-recovery/src/lib.rs +++ b/node/network/availability-recovery/src/lib.rs @@ -20,6 +20,7 @@ use std::{ collections::{HashMap, VecDeque}, + num::NonZeroUsize, pin::Pin, time::Duration, }; @@ -77,7 +78,10 @@ const LOG_TARGET: &str = "parachain::availability-recovery"; const N_PARALLEL: usize = 50; // Size of the LRU cache where we keep recovered data. -const LRU_SIZE: usize = 16; +const LRU_SIZE: NonZeroUsize = match NonZeroUsize::new(16) { + Some(cap) => cap, + None => panic!("Availability-recovery cache size must be non-zero."), +}; const COST_INVALID_REQUEST: Rep = Rep::CostMajor("Peer sent unparsable request"); diff --git a/node/network/collator-protocol/Cargo.toml b/node/network/collator-protocol/Cargo.toml index df9e75c9e951..e089719106b5 100644 --- a/node/network/collator-protocol/Cargo.toml +++ b/node/network/collator-protocol/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [dependencies] always-assert = "0.1.2" +bitvec = { version = "1.0.1", default-features = false, features = ["alloc"] } futures = "0.3.21" futures-timer = "3" gum = { package = "tracing-gum", path = "../../gum" } diff --git a/node/network/collator-protocol/src/collator_side/metrics.rs b/node/network/collator-protocol/src/collator_side/metrics.rs new file mode 100644 index 000000000000..85e00406b9ba --- /dev/null +++ b/node/network/collator-protocol/src/collator_side/metrics.rs @@ -0,0 +1,123 @@ +// Copyright 2017-2022 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 . + +use polkadot_node_subsystem_util::metrics::{self, prometheus}; + +#[derive(Clone, Default)] +pub struct Metrics(Option); + +impl Metrics { + pub fn on_advertisment_made(&self) { + if let Some(metrics) = &self.0 { + metrics.advertisements_made.inc(); + } + } + + pub fn on_collation_sent_requested(&self) { + if let Some(metrics) = &self.0 { + metrics.collations_send_requested.inc(); + } + } + + pub fn on_collation_sent(&self) { + if let Some(metrics) = &self.0 { + metrics.collations_sent.inc(); + } + } + + /// Provide a timer for `process_msg` which observes on drop. + pub fn time_process_msg(&self) -> Option { + self.0.as_ref().map(|metrics| metrics.process_msg.start_timer()) + } + + /// Provide a timer for `distribute_collation` which observes on drop. + pub fn time_collation_distribution( + &self, + label: &'static str, + ) -> Option { + self.0.as_ref().map(|metrics| { + metrics.collation_distribution_time.with_label_values(&[label]).start_timer() + }) + } +} + +#[derive(Clone)] +struct MetricsInner { + advertisements_made: prometheus::Counter, + collations_sent: prometheus::Counter, + collations_send_requested: prometheus::Counter, + process_msg: prometheus::Histogram, + collation_distribution_time: prometheus::HistogramVec, +} + +impl metrics::Metrics for Metrics { + fn try_register( + registry: &prometheus::Registry, + ) -> std::result::Result { + let metrics = MetricsInner { + advertisements_made: prometheus::register( + prometheus::Counter::new( + "polkadot_parachain_collation_advertisements_made_total", + "A number of collation advertisements sent to validators.", + )?, + registry, + )?, + collations_send_requested: prometheus::register( + prometheus::Counter::new( + "polkadot_parachain_collations_sent_requested_total", + "A number of collations requested to be sent to validators.", + )?, + registry, + )?, + collations_sent: prometheus::register( + prometheus::Counter::new( + "polkadot_parachain_collations_sent_total", + "A number of collations sent to validators.", + )?, + registry, + )?, + process_msg: prometheus::register( + prometheus::Histogram::with_opts( + prometheus::HistogramOpts::new( + "polkadot_parachain_collator_protocol_collator_process_msg", + "Time spent within `collator_protocol_collator::process_msg`", + ) + .buckets(vec![ + 0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.35, 0.5, 0.75, + 1.0, + ]), + )?, + registry, + )?, + collation_distribution_time: prometheus::register( + prometheus::HistogramVec::new( + prometheus::HistogramOpts::new( + "polkadot_parachain_collator_protocol_collator_distribution_time", + "Time spent within `collator_protocol_collator::distribute_collation`", + ) + .buckets(vec![ + 0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.35, 0.5, 0.75, + 1.0, + ]), + &["state"], + )?, + registry, + )?, + }; + + Ok(Metrics(Some(metrics))) + } +} diff --git a/node/network/collator-protocol/src/collator_side/mod.rs b/node/network/collator-protocol/src/collator_side/mod.rs index c1a20a2a670b..4f2eea2ca747 100644 --- a/node/network/collator-protocol/src/collator_side/mod.rs +++ b/node/network/collator-protocol/src/collator_side/mod.rs @@ -17,7 +17,7 @@ use std::{ collections::{HashMap, HashSet, VecDeque}, pin::Pin, - time::Duration, + time::{Duration, Instant}, }; use futures::{ @@ -44,19 +44,25 @@ use polkadot_node_subsystem::{ overseer, FromOrchestra, OverseerSignal, PerLeafSpan, }; use polkadot_node_subsystem_util::{ - metrics::{self, prometheus}, runtime::{get_availability_cores, get_group_rotation_info, RuntimeInfo}, TimeoutExt, }; use polkadot_primitives::v2::{ AuthorityDiscoveryId, CandidateHash, CandidateReceipt, CollatorPair, CoreIndex, CoreState, - Hash, Id as ParaId, + GroupIndex, Hash, Id as ParaId, SessionIndex, }; use super::LOG_TARGET; use crate::error::{log_error, Error, FatalError, Result}; use fatality::Split; +mod metrics; +mod validators_buffer; + +use validators_buffer::{ValidatorGroupsBuffer, VALIDATORS_BUFFER_CAPACITY}; + +pub use metrics::Metrics; + #[cfg(test)] mod tests; @@ -73,111 +79,16 @@ const COST_APPARENT_FLOOD: Rep = /// For considerations on this value, see: https://github.com/paritytech/polkadot/issues/4386 const MAX_UNSHARED_UPLOAD_TIME: Duration = Duration::from_millis(150); -#[derive(Clone, Default)] -pub struct Metrics(Option); - -impl Metrics { - fn on_advertisment_made(&self) { - if let Some(metrics) = &self.0 { - metrics.advertisements_made.inc(); - } - } - - fn on_collation_sent_requested(&self) { - if let Some(metrics) = &self.0 { - metrics.collations_send_requested.inc(); - } - } - - fn on_collation_sent(&self) { - if let Some(metrics) = &self.0 { - metrics.collations_sent.inc(); - } - } - - /// Provide a timer for `process_msg` which observes on drop. - fn time_process_msg(&self) -> Option { - self.0.as_ref().map(|metrics| metrics.process_msg.start_timer()) - } - - /// Provide a timer for `distribute_collation` which observes on drop. - fn time_collation_distribution( - &self, - label: &'static str, - ) -> Option { - self.0.as_ref().map(|metrics| { - metrics.collation_distribution_time.with_label_values(&[label]).start_timer() - }) - } -} - -#[derive(Clone)] -struct MetricsInner { - advertisements_made: prometheus::Counter, - collations_sent: prometheus::Counter, - collations_send_requested: prometheus::Counter, - process_msg: prometheus::Histogram, - collation_distribution_time: prometheus::HistogramVec, -} +/// Ensure that collator issues a connection request at least once every this many seconds. +/// Usually it's done when advertising new collation. However, if the core stays occupied or +/// it's not our turn to produce a candidate, it's important to disconnect from previous +/// peers. +/// +/// Validators are obtained from [`ValidatorGroupsBuffer::validators_to_connect`]. +const RECONNECT_TIMEOUT: Duration = Duration::from_secs(12); -impl metrics::Metrics for Metrics { - fn try_register( - registry: &prometheus::Registry, - ) -> std::result::Result { - let metrics = MetricsInner { - advertisements_made: prometheus::register( - prometheus::Counter::new( - "polkadot_parachain_collation_advertisements_made_total", - "A number of collation advertisements sent to validators.", - )?, - registry, - )?, - collations_send_requested: prometheus::register( - prometheus::Counter::new( - "polkadot_parachain_collations_sent_requested_total", - "A number of collations requested to be sent to validators.", - )?, - registry, - )?, - collations_sent: prometheus::register( - prometheus::Counter::new( - "polkadot_parachain_collations_sent_total", - "A number of collations sent to validators.", - )?, - registry, - )?, - process_msg: prometheus::register( - prometheus::Histogram::with_opts( - prometheus::HistogramOpts::new( - "polkadot_parachain_collator_protocol_collator_process_msg", - "Time spent within `collator_protocol_collator::process_msg`", - ) - .buckets(vec![ - 0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.35, 0.5, 0.75, - 1.0, - ]), - )?, - registry, - )?, - collation_distribution_time: prometheus::register( - prometheus::HistogramVec::new( - prometheus::HistogramOpts::new( - "polkadot_parachain_collator_protocol_collator_distribution_time", - "Time spent within `collator_protocol_collator::distribute_collation`", - ) - .buckets(vec![ - 0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.35, 0.5, 0.75, - 1.0, - ]), - &["state"], - )?, - registry, - )?, - }; - - Ok(Metrics(Some(metrics))) - } -} +/// How often to check for reconnect timeout. +const RECONNECT_POLL: Duration = Duration::from_secs(1); /// Info about validators we are currently connected to. /// @@ -269,8 +180,14 @@ struct WaitingCollationFetches { waiting_peers: HashSet, } +struct CollationSendResult { + relay_parent: Hash, + peer_id: PeerId, + timed_out: bool, +} + type ActiveCollationFetches = - FuturesUnordered + Send + 'static>>>; + FuturesUnordered + Send + 'static>>>; struct State { /// Our network peer id. @@ -308,6 +225,13 @@ struct State { /// by `PeerConnected` events. peer_ids: HashMap>, + /// Tracks which validators we want to stay connected to. + validator_groups_buf: ValidatorGroupsBuffer, + + /// Timestamp of the last connection request to a non-empty list of validators, + /// `None` otherwise. + last_connected_at: Option, + /// Metrics. metrics: Metrics, @@ -339,6 +263,8 @@ impl State { collation_result_senders: Default::default(), our_validators_groups: Default::default(), peer_ids: Default::default(), + validator_groups_buf: ValidatorGroupsBuffer::with_capacity(VALIDATORS_BUFFER_CAPACITY), + last_connected_at: None, waiting_collation_fetches: Default::default(), active_collation_fetches: Default::default(), } @@ -373,6 +299,7 @@ async fn distribute_collation( result_sender: Option>, ) -> Result<()> { let relay_parent = receipt.descriptor.relay_parent; + let candidate_hash = receipt.hash(); // This collation is not in the active-leaves set. if !state.view.contains(&relay_parent) { @@ -412,10 +339,10 @@ async fn distribute_collation( }; // Determine the group on that core. - let current_validators = + let GroupValidators { validators, session_index, group_index } = determine_our_validators(ctx, runtime, our_core, num_cores, relay_parent).await?; - if current_validators.validators.is_empty() { + if validators.is_empty() { gum::warn!( target: LOG_TARGET, core = ?our_core, @@ -425,24 +352,36 @@ async fn distribute_collation( return Ok(()) } + // It's important to insert new collation bits **before** + // issuing a connection request. + // + // If a validator managed to fetch all the relevant collations + // but still assigned to our core, we keep the connection alive. + state.validator_groups_buf.note_collation_advertised( + relay_parent, + session_index, + group_index, + &validators, + ); + gum::debug!( target: LOG_TARGET, para_id = %id, relay_parent = %relay_parent, - candidate_hash = ?receipt.hash(), + ?candidate_hash, pov_hash = ?pov.hash(), core = ?our_core, - ?current_validators, + current_validators = ?validators, "Accepted collation, connecting to validators." ); - // Issue a discovery request for the validators of the current group: - connect_to_validators(ctx, current_validators.validators.into_iter().collect()).await; + // Update a set of connected validators if necessary. + state.last_connected_at = connect_to_validators(ctx, &state.validator_groups_buf).await; state.our_validators_groups.insert(relay_parent, ValidatorGroup::new()); if let Some(result_sender) = result_sender { - state.collation_result_senders.insert(receipt.hash(), result_sender); + state.collation_result_senders.insert(candidate_hash, result_sender); } state @@ -483,6 +422,9 @@ async fn determine_core( struct GroupValidators { /// The validators of above group (their discovery keys). validators: Vec, + + session_index: SessionIndex, + group_index: GroupIndex, } /// Figure out current group of validators assigned to the para being collated on. @@ -516,7 +458,11 @@ async fn determine_our_validators( let current_validators = current_validators.iter().map(|i| validators[i.0 as usize].clone()).collect(); - let current_validators = GroupValidators { validators: current_validators }; + let current_validators = GroupValidators { + validators: current_validators, + session_index, + group_index: current_group_index, + }; Ok(current_validators) } @@ -541,13 +487,19 @@ async fn declare(ctx: &mut Context, state: &mut State, peer: PeerId) { } } -/// Issue a connection request to a set of validators and -/// revoke the previous connection request. +/// Updates a set of connected validators based on their advertisement-bits +/// in a validators buffer. +/// +/// Returns current timestamp if the connection request was non-empty, `None` +/// otherwise. #[overseer::contextbounds(CollatorProtocol, prefix = self::overseer)] async fn connect_to_validators( ctx: &mut Context, - validator_ids: Vec, -) { + validator_groups_buf: &ValidatorGroupsBuffer, +) -> Option { + let validator_ids = validator_groups_buf.validators_to_connect(); + let is_disconnect = validator_ids.is_empty(); + // ignore address resolution failure // will reissue a new request on new collation let (failed, _) = oneshot::channel(); @@ -557,6 +509,8 @@ async fn connect_to_validators( failed, }) .await; + + (!is_disconnect).then_some(Instant::now()) } /// Advertise collation to the given `peer`. @@ -715,15 +669,9 @@ async fn send_collation( state.active_collation_fetches.push( async move { let r = rx.timeout(MAX_UNSHARED_UPLOAD_TIME).await; - if r.is_none() { - gum::debug!( - target: LOG_TARGET, - ?relay_parent, - ?peer_id, - "Sending collation to validator timed out, carrying on with next validator." - ); - } - (relay_parent, peer_id) + let timed_out = r.is_none(); + + CollationSendResult { relay_parent, peer_id, timed_out } } .boxed(), ); @@ -986,6 +934,7 @@ async fn handle_our_view_change(state: &mut State, view: OurView) -> Result<()> state.our_validators_groups.remove(removed); state.span_per_relay_parent.remove(removed); state.waiting_collation_fetches.remove(removed); + state.validator_groups_buf.remove_relay_parent(removed); } state.view = view; @@ -1007,6 +956,9 @@ pub(crate) async fn run( let mut state = State::new(local_peer_id, collator_pair, metrics); let mut runtime = RuntimeInfo::new(None); + let reconnect_stream = super::tick_stream(RECONNECT_POLL); + pin_mut!(reconnect_stream); + loop { let recv_req = req_receiver.recv(|| vec![COST_INVALID_REQUEST]).fuse(); pin_mut!(recv_req); @@ -1022,7 +974,25 @@ pub(crate) async fn run( FromOrchestra::Signal(BlockFinalized(..)) => {} FromOrchestra::Signal(Conclude) => return Ok(()), }, - (relay_parent, peer_id) = state.active_collation_fetches.select_next_some() => { + CollationSendResult { + relay_parent, + peer_id, + timed_out, + } = state.active_collation_fetches.select_next_some() => { + if timed_out { + gum::debug!( + target: LOG_TARGET, + ?relay_parent, + ?peer_id, + "Sending collation to validator timed out, carrying on with next validator", + ); + } else { + for authority_id in state.peer_ids.get(&peer_id).into_iter().flatten() { + // Timeout not hit, this peer is no longer interested in this relay parent. + state.validator_groups_buf.reset_validator_interest(relay_parent, authority_id); + } + } + let next = if let Some(waiting) = state.waiting_collation_fetches.get_mut(&relay_parent) { waiting.waiting_peers.remove(&peer_id); if let Some(next) = waiting.waiting.pop_front() { @@ -1042,7 +1012,29 @@ pub(crate) async fn run( send_collation(&mut state, next, receipt, pov).await; } - } + }, + _ = reconnect_stream.next() => { + let now = Instant::now(); + if state + .last_connected_at + .map_or(false, |timestamp| now - timestamp > RECONNECT_TIMEOUT) + { + // Remove all advertisements from the buffer if the timeout was hit. + // Usually, it shouldn't be necessary as leaves get deactivated, rather + // serves as a safeguard against finality lags. + state.validator_groups_buf.clear_advertisements(); + // Returns `None` if connection request is empty. + state.last_connected_at = + connect_to_validators(&mut ctx, &state.validator_groups_buf).await; + + gum::debug!( + target: LOG_TARGET, + timeout = ?RECONNECT_TIMEOUT, + "Timeout hit, sent a connection request. Disconnected from all validators = {}", + state.last_connected_at.is_none(), + ); + } + }, in_req = recv_req => { match in_req { Ok(req) => { diff --git a/node/network/collator-protocol/src/collator_side/tests.rs b/node/network/collator-protocol/src/collator_side/tests.rs index 2d2f2cf043de..c20a2d6c97a5 100644 --- a/node/network/collator-protocol/src/collator_side/tests.rs +++ b/node/network/collator-protocol/src/collator_side/tests.rs @@ -56,7 +56,7 @@ struct TestState { group_rotation_info: GroupRotationInfo, validator_peer_id: Vec, relay_parent: Hash, - availability_core: CoreState, + availability_cores: Vec, local_peer_id: PeerId, collator_pair: CollatorPair, session_index: SessionIndex, @@ -88,14 +88,15 @@ impl Default for TestState { let validator_peer_id = std::iter::repeat_with(|| PeerId::random()).take(discovery_keys.len()).collect(); - let validator_groups = vec![vec![2, 0, 4], vec![3, 2, 4]] + let validator_groups = vec![vec![2, 0, 4], vec![1, 3]] .into_iter() .map(|g| g.into_iter().map(ValidatorIndex).collect()) .collect(); let group_rotation_info = GroupRotationInfo { session_start_block: 0, group_rotation_frequency: 100, now: 1 }; - let availability_core = CoreState::Scheduled(ScheduledCore { para_id, collator: None }); + let availability_cores = + vec![CoreState::Scheduled(ScheduledCore { para_id, collator: None }), CoreState::Free]; let relay_parent = Hash::random(); @@ -122,7 +123,7 @@ impl Default for TestState { group_rotation_info, validator_peer_id, relay_parent, - availability_core, + availability_cores, local_peer_id, collator_pair, session_index: 1, @@ -132,7 +133,9 @@ impl Default for TestState { impl TestState { fn current_group_validator_indices(&self) -> &[ValidatorIndex] { - &self.session_info.validator_groups[0] + let core_num = self.availability_cores.len(); + let GroupIndex(group_idx) = self.group_rotation_info.group_for_core(CoreIndex(0), core_num); + &self.session_info.validator_groups[group_idx as usize] } fn current_session_index(&self) -> SessionIndex { @@ -333,7 +336,7 @@ async fn distribute_collation( RuntimeApiRequest::AvailabilityCores(tx) )) => { assert_eq!(relay_parent, test_state.relay_parent); - tx.send(Ok(vec![test_state.availability_core.clone()])).unwrap(); + tx.send(Ok(test_state.availability_cores.clone())).unwrap(); } ); @@ -987,3 +990,104 @@ where test_harness }); } + +#[test] +fn connect_to_buffered_groups() { + let mut test_state = TestState::default(); + let local_peer_id = test_state.local_peer_id.clone(); + let collator_pair = test_state.collator_pair.clone(); + + test_harness(local_peer_id, collator_pair, |test_harness| async move { + let mut virtual_overseer = test_harness.virtual_overseer; + let mut req_cfg = test_harness.req_cfg; + + setup_system(&mut virtual_overseer, &test_state).await; + + let group_a = test_state.current_group_validator_authority_ids(); + let peers_a = test_state.current_group_validator_peer_ids(); + assert!(group_a.len() > 1); + + distribute_collation(&mut virtual_overseer, &test_state, false).await; + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::NetworkBridgeTx( + NetworkBridgeTxMessage::ConnectToValidators { validator_ids, .. } + ) => { + assert_eq!(group_a, validator_ids); + } + ); + + let head_a = test_state.relay_parent; + + for (val, peer) in group_a.iter().zip(&peers_a) { + connect_peer(&mut virtual_overseer, peer.clone(), Some(val.clone())).await; + } + + for peer_id in &peers_a { + expect_declare_msg(&mut virtual_overseer, &test_state, peer_id).await; + } + + // Update views. + for peed_id in &peers_a { + send_peer_view_change(&mut virtual_overseer, peed_id, vec![head_a]).await; + expect_advertise_collation_msg(&mut virtual_overseer, peed_id, head_a).await; + } + + let peer = peers_a[0]; + // Peer from the group fetches the collation. + let (pending_response, rx) = oneshot::channel(); + req_cfg + .inbound_queue + .as_mut() + .unwrap() + .send(RawIncomingRequest { + peer, + payload: CollationFetchingRequest { + relay_parent: head_a, + para_id: test_state.para_id, + } + .encode(), + pending_response, + }) + .await + .unwrap(); + assert_matches!( + rx.await, + Ok(full_response) => { + let CollationFetchingResponse::Collation(..): CollationFetchingResponse = + CollationFetchingResponse::decode( + &mut full_response.result.expect("We should have a proper answer").as_ref(), + ) + .expect("Decoding should work"); + } + ); + + test_state.advance_to_new_round(&mut virtual_overseer, true).await; + test_state.group_rotation_info = test_state.group_rotation_info.bump_rotation(); + + let head_b = test_state.relay_parent; + let group_b = test_state.current_group_validator_authority_ids(); + assert_ne!(head_a, head_b); + assert_ne!(group_a, group_b); + + distribute_collation(&mut virtual_overseer, &test_state, false).await; + + // Should be connected to both groups except for the validator that fetched advertised + // collation. + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::NetworkBridgeTx( + NetworkBridgeTxMessage::ConnectToValidators { validator_ids, .. } + ) => { + assert!(!validator_ids.contains(&group_a[0])); + + for validator in group_a[1..].iter().chain(&group_b) { + assert!(validator_ids.contains(validator)); + } + } + ); + + TestHarness { virtual_overseer, req_cfg } + }); +} diff --git a/node/network/collator-protocol/src/collator_side/validators_buffer.rs b/node/network/collator-protocol/src/collator_side/validators_buffer.rs new file mode 100644 index 000000000000..5bb31c72d6c5 --- /dev/null +++ b/node/network/collator-protocol/src/collator_side/validators_buffer.rs @@ -0,0 +1,317 @@ +// Copyright 2017-2022 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 . + +//! Validator groups buffer for connection managements. +//! +//! Solves 2 problems: +//! 1. A collator may want to stay connected to multiple groups on rotation boundaries. +//! 2. It's important to disconnect from validator when there're no collations to be fetched. +//! +//! We keep a simple FIFO buffer of N validator groups and a bitvec for each advertisement, +//! 1 indicating we want to be connected to i-th validator in a buffer, 0 otherwise. +//! +//! The bit is set to 1 for the whole **group** whenever it's inserted into the buffer. Given a relay +//! parent, one can reset a bit back to 0 for particular **validator**. For example, if a collation +//! was fetched or some timeout has been hit. +//! +//! The bitwise OR over known advertisements gives us validators indices for connection request. + +use std::{ + collections::{HashMap, VecDeque}, + num::NonZeroUsize, + ops::Range, +}; + +use bitvec::{bitvec, vec::BitVec}; + +use polkadot_primitives::v2::{AuthorityDiscoveryId, GroupIndex, Hash, SessionIndex}; + +/// The ring buffer stores at most this many unique validator groups. +/// +/// This value should be chosen in way that all groups assigned to our para +/// in the view can fit into the buffer. +pub const VALIDATORS_BUFFER_CAPACITY: NonZeroUsize = match NonZeroUsize::new(3) { + Some(cap) => cap, + None => panic!("buffer capacity must be non-zero"), +}; + +/// Unique identifier of a validators group. +#[derive(Debug)] +struct ValidatorsGroupInfo { + /// Number of validators in the group. + len: usize, + session_index: SessionIndex, + group_index: GroupIndex, +} + +/// Ring buffer of validator groups. +/// +/// Tracks which peers we want to be connected to with respect to advertised collations. +#[derive(Debug)] +pub struct ValidatorGroupsBuffer { + /// Validator groups identifiers we **had** advertisements for. + group_infos: VecDeque, + /// Continuous buffer of validators discovery keys. + validators: VecDeque, + /// Mapping from relay-parent to bit-vectors with bits for all `validators`. + /// Invariants kept: All bit-vectors are guaranteed to have the same size. + should_be_connected: HashMap, + /// Buffer capacity, limits the number of **groups** tracked. + cap: NonZeroUsize, +} + +impl ValidatorGroupsBuffer { + /// Creates a new buffer with a non-zero capacity. + pub fn with_capacity(cap: NonZeroUsize) -> Self { + Self { + group_infos: VecDeque::new(), + validators: VecDeque::new(), + should_be_connected: HashMap::new(), + cap, + } + } + + /// Returns discovery ids of validators we have at least one advertised-but-not-fetched + /// collation for. + pub fn validators_to_connect(&self) -> Vec { + let validators_num = self.validators.len(); + let bits = self + .should_be_connected + .values() + .fold(bitvec![0; validators_num], |acc, next| acc | next); + + self.validators + .iter() + .enumerate() + .filter_map(|(idx, authority_id)| bits[idx].then_some(authority_id.clone())) + .collect() + } + + /// Note a new advertisement, marking that we want to be connected to validators + /// from this group. + /// + /// If max capacity is reached and the group is new, drops validators from the back + /// of the buffer. + pub fn note_collation_advertised( + &mut self, + relay_parent: Hash, + session_index: SessionIndex, + group_index: GroupIndex, + validators: &[AuthorityDiscoveryId], + ) { + if validators.is_empty() { + return + } + + match self.group_infos.iter().enumerate().find(|(_, group)| { + group.session_index == session_index && group.group_index == group_index + }) { + Some((idx, group)) => { + let group_start_idx = self.group_lengths_iter().take(idx).sum(); + self.set_bits(relay_parent, group_start_idx..(group_start_idx + group.len)); + }, + None => self.push(relay_parent, session_index, group_index, validators), + } + } + + /// Note that a validator is no longer interested in a given relay parent. + pub fn reset_validator_interest( + &mut self, + relay_parent: Hash, + authority_id: &AuthorityDiscoveryId, + ) { + let bits = match self.should_be_connected.get_mut(&relay_parent) { + Some(bits) => bits, + None => return, + }; + + for (idx, auth_id) in self.validators.iter().enumerate() { + if auth_id == authority_id { + bits.set(idx, false); + } + } + } + + /// Remove relay parent from the buffer. + /// + /// The buffer will no longer track which validators are interested in a corresponding + /// advertisement. + pub fn remove_relay_parent(&mut self, relay_parent: &Hash) { + self.should_be_connected.remove(relay_parent); + } + + /// Removes all advertisements from the buffer. + pub fn clear_advertisements(&mut self) { + self.should_be_connected.clear(); + } + + /// Pushes a new group to the buffer along with advertisement, setting all validators + /// bits to 1. + /// + /// If the buffer is full, drops group from the tail. + fn push( + &mut self, + relay_parent: Hash, + session_index: SessionIndex, + group_index: GroupIndex, + validators: &[AuthorityDiscoveryId], + ) { + let new_group_info = + ValidatorsGroupInfo { len: validators.len(), session_index, group_index }; + + let buf = &mut self.group_infos; + let cap = self.cap.get(); + + if buf.len() >= cap { + let pruned_group = buf.pop_front().expect("buf is not empty; qed"); + self.validators.drain(..pruned_group.len); + + self.should_be_connected.values_mut().for_each(|bits| { + bits.as_mut_bitslice().shift_left(pruned_group.len); + }); + } + + self.validators.extend(validators.iter().cloned()); + buf.push_back(new_group_info); + let buf_len = buf.len(); + let group_start_idx = self.group_lengths_iter().take(buf_len - 1).sum(); + + let new_len = self.validators.len(); + self.should_be_connected + .values_mut() + .for_each(|bits| bits.resize(new_len, false)); + self.set_bits(relay_parent, group_start_idx..(group_start_idx + validators.len())); + } + + /// Sets advertisement bits to 1 in a given range (usually corresponding to some group). + /// If the relay parent is unknown, inserts 0-initialized bitvec first. + /// + /// The range must be ensured to be within bounds. + fn set_bits(&mut self, relay_parent: Hash, range: Range) { + let bits = self + .should_be_connected + .entry(relay_parent) + .or_insert_with(|| bitvec![0; self.validators.len()]); + + bits[range].fill(true); + } + + /// Returns iterator over numbers of validators in groups. + /// + /// Useful for getting an index of the first validator in i-th group. + fn group_lengths_iter(&self) -> impl Iterator + '_ { + self.group_infos.iter().map(|group| group.len) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use sp_keyring::Sr25519Keyring; + + #[test] + fn one_capacity_buffer() { + let cap = NonZeroUsize::new(1).unwrap(); + let mut buf = ValidatorGroupsBuffer::with_capacity(cap); + + let hash_a = Hash::repeat_byte(0x1); + let hash_b = Hash::repeat_byte(0x2); + + let validators: Vec<_> = [ + Sr25519Keyring::Alice, + Sr25519Keyring::Bob, + Sr25519Keyring::Charlie, + Sr25519Keyring::Dave, + Sr25519Keyring::Ferdie, + ] + .into_iter() + .map(|key| AuthorityDiscoveryId::from(key.public())) + .collect(); + + assert!(buf.validators_to_connect().is_empty()); + + buf.note_collation_advertised(hash_a, 0, GroupIndex(0), &validators[..2]); + assert_eq!(buf.validators_to_connect(), validators[..2].to_vec()); + + buf.reset_validator_interest(hash_a, &validators[1]); + assert_eq!(buf.validators_to_connect(), vec![validators[0].clone()]); + + buf.note_collation_advertised(hash_b, 0, GroupIndex(1), &validators[2..]); + assert_eq!(buf.validators_to_connect(), validators[2..].to_vec()); + + for validator in &validators[2..] { + buf.reset_validator_interest(hash_b, validator); + } + assert!(buf.validators_to_connect().is_empty()); + } + + #[test] + fn buffer_works() { + let cap = NonZeroUsize::new(3).unwrap(); + let mut buf = ValidatorGroupsBuffer::with_capacity(cap); + + let hashes: Vec<_> = (0..5).map(Hash::repeat_byte).collect(); + + let validators: Vec<_> = [ + Sr25519Keyring::Alice, + Sr25519Keyring::Bob, + Sr25519Keyring::Charlie, + Sr25519Keyring::Dave, + Sr25519Keyring::Ferdie, + ] + .into_iter() + .map(|key| AuthorityDiscoveryId::from(key.public())) + .collect(); + + buf.note_collation_advertised(hashes[0], 0, GroupIndex(0), &validators[..2]); + buf.note_collation_advertised(hashes[1], 0, GroupIndex(0), &validators[..2]); + buf.note_collation_advertised(hashes[2], 0, GroupIndex(1), &validators[2..4]); + buf.note_collation_advertised(hashes[2], 0, GroupIndex(1), &validators[2..4]); + + assert_eq!(buf.validators_to_connect(), validators[..4].to_vec()); + + for validator in &validators[2..4] { + buf.reset_validator_interest(hashes[2], validator); + } + + buf.reset_validator_interest(hashes[1], &validators[0]); + assert_eq!(buf.validators_to_connect(), validators[..2].to_vec()); + + buf.reset_validator_interest(hashes[0], &validators[0]); + assert_eq!(buf.validators_to_connect(), vec![validators[1].clone()]); + + buf.note_collation_advertised(hashes[3], 0, GroupIndex(1), &validators[2..4]); + buf.note_collation_advertised( + hashes[4], + 0, + GroupIndex(2), + std::slice::from_ref(&validators[4]), + ); + + buf.reset_validator_interest(hashes[3], &validators[2]); + buf.note_collation_advertised( + hashes[4], + 0, + GroupIndex(3), + std::slice::from_ref(&validators[0]), + ); + + assert_eq!( + buf.validators_to_connect(), + vec![validators[3].clone(), validators[4].clone(), validators[0].clone()] + ); + } +} diff --git a/node/network/collator-protocol/src/lib.rs b/node/network/collator-protocol/src/lib.rs index 66659e4b5bee..b71acc127c88 100644 --- a/node/network/collator-protocol/src/lib.rs +++ b/node/network/collator-protocol/src/lib.rs @@ -21,9 +21,12 @@ #![deny(unused_crate_dependencies)] #![recursion_limit = "256"] -use std::time::Duration; +use std::time::{Duration, Instant}; -use futures::{FutureExt, TryFutureExt}; +use futures::{ + stream::{FusedStream, StreamExt}, + FutureExt, TryFutureExt, +}; use sp_keystore::SyncCryptoStorePtr; @@ -134,3 +137,23 @@ async fn modify_reputation( sender.send_message(NetworkBridgeTxMessage::ReportPeer(peer, rep)).await; } + +/// Wait until tick and return the timestamp for the following one. +async fn wait_until_next_tick(last_poll: Instant, period: Duration) -> Instant { + let now = Instant::now(); + let next_poll = last_poll + period; + + if next_poll > now { + futures_timer::Delay::new(next_poll - now).await + } + + Instant::now() +} + +/// Returns an infinite stream that yields with an interval of `period`. +fn tick_stream(period: Duration) -> impl FusedStream { + futures::stream::unfold(Instant::now(), move |next_check| async move { + Some(((), wait_until_next_tick(next_check, period).await)) + }) + .fuse() +} diff --git a/node/network/collator-protocol/src/validator_side/mod.rs b/node/network/collator-protocol/src/validator_side/mod.rs index 47795aac0ce2..b2b3dc4824b5 100644 --- a/node/network/collator-protocol/src/validator_side/mod.rs +++ b/node/network/collator-protocol/src/validator_side/mod.rs @@ -19,7 +19,7 @@ use futures::{ channel::oneshot, future::{BoxFuture, Fuse, FusedFuture}, select, - stream::{FusedStream, FuturesUnordered}, + stream::FuturesUnordered, FutureExt, StreamExt, }; use futures_timer::Delay; @@ -57,7 +57,7 @@ use polkadot_primitives::v2::{CandidateReceipt, CollatorId, Hash, Id as ParaId}; use crate::error::Result; -use super::{modify_reputation, LOG_TARGET}; +use super::{modify_reputation, tick_stream, LOG_TARGET}; #[cfg(test)] mod tests; @@ -85,19 +85,23 @@ const BENEFIT_NOTIFY_GOOD: Rep = /// to finish on time. /// /// There is debug logging output, so we can adjust this value based on production results. +#[cfg(not(test))] const MAX_UNSHARED_DOWNLOAD_TIME: Duration = Duration::from_millis(400); // How often to check all peers with activity. #[cfg(not(test))] const ACTIVITY_POLL: Duration = Duration::from_secs(1); +#[cfg(test)] +const MAX_UNSHARED_DOWNLOAD_TIME: Duration = Duration::from_millis(100); + #[cfg(test)] const ACTIVITY_POLL: Duration = Duration::from_millis(10); // How often to poll collation responses. // This is a hack that should be removed in a refactoring. // See https://github.com/paritytech/polkadot/issues/4182 -const CHECK_COLLATIONS_POLL: Duration = Duration::from_millis(5); +const CHECK_COLLATIONS_POLL: Duration = Duration::from_millis(50); #[derive(Clone, Default)] pub struct Metrics(Option); @@ -1167,25 +1171,6 @@ async fn process_msg( } } -// wait until next inactivity check. returns the instant for the following check. -async fn wait_until_next_check(last_poll: Instant) -> Instant { - let now = Instant::now(); - let next_poll = last_poll + ACTIVITY_POLL; - - if next_poll > now { - Delay::new(next_poll - now).await - } - - Instant::now() -} - -fn infinite_stream(every: Duration) -> impl FusedStream { - futures::stream::unfold(Instant::now() + every, |next_check| async move { - Some(((), wait_until_next_check(next_check).await)) - }) - .fuse() -} - /// The main run loop. #[overseer::contextbounds(CollatorProtocol, prefix = self::overseer)] pub(crate) async fn run( @@ -1196,10 +1181,10 @@ pub(crate) async fn run( ) -> std::result::Result<(), crate::error::FatalError> { let mut state = State { metrics, ..Default::default() }; - let next_inactivity_stream = infinite_stream(ACTIVITY_POLL); + let next_inactivity_stream = tick_stream(ACTIVITY_POLL); futures::pin_mut!(next_inactivity_stream); - let check_collations_stream = infinite_stream(CHECK_COLLATIONS_POLL); + let check_collations_stream = tick_stream(CHECK_COLLATIONS_POLL); futures::pin_mut!(check_collations_stream); loop { diff --git a/node/network/collator-protocol/src/validator_side/tests.rs b/node/network/collator-protocol/src/validator_side/tests.rs index 15740e5d5efa..ae8644cea521 100644 --- a/node/network/collator-protocol/src/validator_side/tests.rs +++ b/node/network/collator-protocol/src/validator_side/tests.rs @@ -20,7 +20,7 @@ use futures::{executor, future, Future}; use sp_core::{crypto::Pair, Encode}; use sp_keyring::Sr25519Keyring; use sp_keystore::{testing::KeyStore as TestKeyStore, SyncCryptoStore}; -use std::{iter, sync::Arc, time::Duration}; +use std::{iter, sync::Arc, task::Poll, time::Duration}; use polkadot_node_network_protocol::{ our_view, @@ -493,17 +493,11 @@ fn collator_authentication_verification_works() { }); } -// A test scenario that takes the following steps -// - Two collators connect, declare themselves and advertise a collation relevant to -// our view. -// - Collation protocol should request one PoV. -// - Collation protocol should disconnect both collators after having received the collation. -// - The same collators plus an additional collator connect again and send `PoV`s for a different relay parent. -// - Collation protocol will request one PoV, but we will cancel it. -// - Collation protocol should request the second PoV which does not succeed in time. -// - Collation protocol should request third PoV. +/// Tests that a validator fetches only one collation at any moment of time +/// per relay parent and ignores other advertisements once a candidate gets +/// seconded. #[test] -fn fetch_collations_works() { +fn fetch_one_collation_at_a_time() { let test_state = TestState::default(); test_harness(|test_harness| async move { @@ -575,22 +569,38 @@ fn fetch_collations_works() { ) .await; - overseer_send( - &mut virtual_overseer, - CollatorProtocolMessage::NetworkBridgeUpdate(NetworkBridgeEvent::PeerDisconnected( - peer_b.clone(), - )), - ) - .await; + // Ensure the subsystem is polled. + test_helpers::Yield::new().await; + + // Second collation is not requested since there's already seconded one. + assert_matches!(futures::poll!(virtual_overseer.recv().boxed()), Poll::Pending); + + virtual_overseer + }) +} + +/// Tests that a validator starts fetching next queued collations on [`MAX_UNSHARED_DOWNLOAD_TIME`] +/// timeout and in case of an error. +#[test] +fn fetches_next_collation() { + let test_state = TestState::default(); + + test_harness(|test_harness| async move { + let TestHarness { mut virtual_overseer } = test_harness; + + let second = Hash::random(); overseer_send( &mut virtual_overseer, - CollatorProtocolMessage::NetworkBridgeUpdate(NetworkBridgeEvent::PeerDisconnected( - peer_c.clone(), + CollatorProtocolMessage::NetworkBridgeUpdate(NetworkBridgeEvent::OurViewChange( + our_view![test_state.relay_parent, second], )), ) .await; + respond_to_core_info_queries(&mut virtual_overseer, &test_state).await; + respond_to_core_info_queries(&mut virtual_overseer, &test_state).await; + let peer_b = PeerId::random(); let peer_c = PeerId::random(); let peer_d = PeerId::random(); diff --git a/node/network/dispute-distribution/Cargo.toml b/node/network/dispute-distribution/Cargo.toml index f50f24bf42c8..a731175f0521 100644 --- a/node/network/dispute-distribution/Cargo.toml +++ b/node/network/dispute-distribution/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [dependencies] futures = "0.3.21" +futures-timer = "3.0.2" gum = { package = "tracing-gum", path = "../../gum" } derive_more = "0.99.17" parity-scale-codec = { version = "3.1.5", features = ["std"] } @@ -20,7 +21,8 @@ sp-application-crypto = { git = "https://github.com/paritytech/substrate", branc sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } thiserror = "1.0.31" fatality = "0.0.6" -lru = "0.7.7" +lru = "0.8.0" +indexmap = "1.9.1" [dev-dependencies] async-trait = "0.1.57" diff --git a/node/network/dispute-distribution/src/lib.rs b/node/network/dispute-distribution/src/lib.rs index aefd66e0ae79..f109d5e6a40e 100644 --- a/node/network/dispute-distribution/src/lib.rs +++ b/node/network/dispute-distribution/src/lib.rs @@ -24,6 +24,8 @@ //! The sender is responsible for getting our vote out, see [`sender`]. The receiver handles //! incoming [`DisputeRequest`]s and offers spam protection, see [`receiver`]. +use std::{num::NonZeroUsize, time::Duration}; + use futures::{channel::mpsc, FutureExt, StreamExt, TryFutureExt}; use polkadot_node_network_protocol::authority_discovery::AuthorityDiscovery; @@ -64,16 +66,19 @@ use self::sender::{DisputeSender, TaskFinish}; /// via a dedicated channel and forwarding them to the dispute coordinator via /// `DisputeCoordinatorMessage::ImportStatements`. Being the interface to the network and untrusted /// nodes, the reality is not that simple of course. Before importing statements the receiver will -/// make sure as good as it can to filter out malicious/unwanted/spammy requests. For this it does -/// the following: +/// batch up imports as well as possible for efficient imports while maintaining timely dispute +/// resolution and handling of spamming validators: /// /// - Drop all messages from non validator nodes, for this it requires the [`AuthorityDiscovery`] /// service. -/// - Drop messages from a node, if we are already importing a message from that node (flood). -/// - Drop messages from nodes, that provided us messages where the statement import failed. +/// - Drop messages from a node, if it sends at a too high rate. +/// - Filter out duplicate messages (over some period of time). /// - Drop any obviously invalid votes (invalid signatures for example). /// - Ban peers whose votes were deemed invalid. /// +/// In general dispute-distribution works on limiting the work the dispute-coordinator will have to +/// do, while at the same time making it aware of new disputes as fast as possible. +/// /// For successfully imported votes, we will confirm the receipt of the message back to the sender. /// This way a received confirmation guarantees, that the vote has been stored to disk by the /// receiver. @@ -93,6 +98,20 @@ pub use metrics::Metrics; const LOG_TARGET: &'static str = "parachain::dispute-distribution"; +/// Rate limit on the `receiver` side. +/// +/// If messages from one peer come in at a higher rate than every `RECEIVE_RATE_LIMIT` on average, we +/// start dropping messages from that peer to enforce that limit. +pub const RECEIVE_RATE_LIMIT: Duration = Duration::from_millis(100); + +/// Rate limit on the `sender` side. +/// +/// In order to not hit the `RECEIVE_RATE_LIMIT` on the receiving side, we limit out sending rate as +/// well. +/// +/// We add 50ms extra, just to have some save margin to the `RECEIVE_RATE_LIMIT`. +pub const SEND_RATE_LIMIT: Duration = RECEIVE_RATE_LIMIT.saturating_add(Duration::from_millis(50)); + /// The dispute distribution subsystem. pub struct DisputeDistributionSubsystem { /// Easy and efficient runtime access for this subsystem. @@ -145,7 +164,8 @@ where ) -> Self { let runtime = RuntimeInfo::new_with_config(runtime::Config { keystore: Some(keystore), - session_cache_lru_size: DISPUTE_WINDOW.get() as usize, + session_cache_lru_size: NonZeroUsize::new(DISPUTE_WINDOW.get() as usize) + .expect("Dispute window can not be 0; qed"), }); let (tx, sender_rx) = mpsc::channel(1); let disputes_sender = DisputeSender::new(tx, metrics.clone()); @@ -172,6 +192,12 @@ where ctx.spawn("disputes-receiver", receiver.run().boxed()) .map_err(FatalError::SpawnTask)?; + // Process messages for sending side. + // + // Note: We want the sender to be rate limited and we are currently taking advantage of the + // fact that the root task of this subsystem is only concerned with sending: Functions of + // `DisputeSender` might back pressure if the rate limit is hit, which will slow down this + // loop. If this fact ever changes, we will likely need another task. loop { let message = MuxedMessage::receive(&mut ctx, &mut self.sender_rx).await; match message { @@ -247,9 +273,10 @@ impl MuxedMessage { // ends. let from_overseer = ctx.recv().fuse(); futures::pin_mut!(from_overseer, from_sender); - futures::select!( - msg = from_overseer => MuxedMessage::Subsystem(msg.map_err(FatalError::SubsystemReceive)), + // We select biased to make sure we finish up loose ends, before starting new work. + futures::select_biased!( msg = from_sender.next() => MuxedMessage::Sender(msg), + msg = from_overseer => MuxedMessage::Subsystem(msg.map_err(FatalError::SubsystemReceive)), ) } } diff --git a/node/network/dispute-distribution/src/metrics.rs b/node/network/dispute-distribution/src/metrics.rs index 3f717bd105c3..aa2feeaad3a0 100644 --- a/node/network/dispute-distribution/src/metrics.rs +++ b/node/network/dispute-distribution/src/metrics.rs @@ -72,9 +72,12 @@ impl Metrics { } /// Statements have been imported. - pub fn on_imported(&self, label: &'static str) { + pub fn on_imported(&self, label: &'static str, num_requests: usize) { if let Some(metrics) = &self.0 { - metrics.imported_requests.with_label_values(&[label]).inc() + metrics + .imported_requests + .with_label_values(&[label]) + .inc_by(num_requests as u64) } } diff --git a/node/network/dispute-distribution/src/receiver/batches/batch.rs b/node/network/dispute-distribution/src/receiver/batches/batch.rs new file mode 100644 index 000000000000..eebed25ed790 --- /dev/null +++ b/node/network/dispute-distribution/src/receiver/batches/batch.rs @@ -0,0 +1,209 @@ +// Copyright 2022 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 . + +use std::{collections::HashMap, time::Instant}; + +use gum::CandidateHash; +use polkadot_node_network_protocol::{ + request_response::{incoming::OutgoingResponseSender, v1::DisputeRequest}, + PeerId, +}; +use polkadot_node_primitives::SignedDisputeStatement; +use polkadot_primitives::v2::{CandidateReceipt, ValidatorIndex}; + +use crate::receiver::{BATCH_COLLECTING_INTERVAL, MIN_KEEP_BATCH_ALIVE_VOTES}; + +use super::MAX_BATCH_LIFETIME; + +/// A batch of votes to be imported into the `dispute-coordinator`. +/// +/// Vote imports are way more efficient when performed in batches, hence we batch together incoming +/// votes until the rate of incoming votes falls below a threshold, then we import into the dispute +/// coordinator. +/// +/// A `Batch` keeps track of the votes to be imported and the current incoming rate, on rate update +/// it will "flush" in case the incoming rate dropped too low, preparing the import. +pub struct Batch { + /// The actual candidate this batch is concerned with. + candidate_receipt: CandidateReceipt, + + /// Cache of `CandidateHash` (candidate_receipt.hash()). + candidate_hash: CandidateHash, + + /// All valid votes received in this batch so far. + /// + /// We differentiate between valid and invalid votes, so we can detect (and drop) duplicates, + /// while still allowing validators to equivocate. + /// + /// Detecting and rejecting duplicates is crucial in order to effectively enforce + /// `MIN_KEEP_BATCH_ALIVE_VOTES` per `BATCH_COLLECTING_INTERVAL`. If we would count duplicates + /// here, the mechanism would be broken. + valid_votes: HashMap, + + /// All invalid votes received in this batch so far. + invalid_votes: HashMap, + + /// How many votes have been batched since the last tick/creation. + votes_batched_since_last_tick: u32, + + /// Expiry time for the batch. + /// + /// By this time the latest this batch will get flushed. + best_before: Instant, + + /// Requesters waiting for a response. + requesters: Vec<(PeerId, OutgoingResponseSender)>, +} + +/// Result of checking a batch every `BATCH_COLLECTING_INTERVAL`. +pub(super) enum TickResult { + /// Batch is still alive, please call `tick` again at the given `Instant`. + Alive(Batch, Instant), + /// Batch is done, ready for import! + Done(PreparedImport), +} + +/// Ready for import. +pub struct PreparedImport { + pub candidate_receipt: CandidateReceipt, + pub statements: Vec<(SignedDisputeStatement, ValidatorIndex)>, + /// Information about original requesters. + pub requesters: Vec<(PeerId, OutgoingResponseSender)>, +} + +impl From for PreparedImport { + fn from(batch: Batch) -> Self { + let Batch { + candidate_receipt, + valid_votes, + invalid_votes, + requesters: pending_responses, + .. + } = batch; + + let statements = valid_votes + .into_iter() + .chain(invalid_votes.into_iter()) + .map(|(index, statement)| (statement, index)) + .collect(); + + Self { candidate_receipt, statements, requesters: pending_responses } + } +} + +impl Batch { + /// Create a new empty batch based on the given `CandidateReceipt`. + /// + /// To create a `Batch` use Batches::find_batch`. + /// + /// Arguments: + /// + /// * `candidate_receipt` - The candidate this batch is meant to track votes for. + /// * `now` - current time stamp for calculating the first tick. + /// + /// Returns: A batch and the first `Instant` you are supposed to call `tick`. + pub(super) fn new(candidate_receipt: CandidateReceipt, now: Instant) -> (Self, Instant) { + let s = Self { + candidate_hash: candidate_receipt.hash(), + candidate_receipt, + valid_votes: HashMap::new(), + invalid_votes: HashMap::new(), + votes_batched_since_last_tick: 0, + best_before: Instant::now() + MAX_BATCH_LIFETIME, + requesters: Vec::new(), + }; + let next_tick = s.calculate_next_tick(now); + (s, next_tick) + } + + /// Receipt of the candidate this batch is batching votes for. + pub fn candidate_receipt(&self) -> &CandidateReceipt { + &self.candidate_receipt + } + + /// Add votes from a validator into the batch. + /// + /// The statements are supposed to be the valid and invalid statements received in a + /// `DisputeRequest`. + /// + /// The given `pending_response` is the corresponding response sender for responding to `peer`. + /// If at least one of the votes is new as far as this batch is concerned we record the + /// pending_response, for later use. In case both votes are known already, we return the + /// response sender as an `Err` value. + pub fn add_votes( + &mut self, + valid_vote: (SignedDisputeStatement, ValidatorIndex), + invalid_vote: (SignedDisputeStatement, ValidatorIndex), + peer: PeerId, + pending_response: OutgoingResponseSender, + ) -> Result<(), OutgoingResponseSender> { + debug_assert!(valid_vote.0.candidate_hash() == invalid_vote.0.candidate_hash()); + debug_assert!(valid_vote.0.candidate_hash() == &self.candidate_hash); + + let mut duplicate = true; + + if self.valid_votes.insert(valid_vote.1, valid_vote.0).is_none() { + self.votes_batched_since_last_tick += 1; + duplicate = false; + } + if self.invalid_votes.insert(invalid_vote.1, invalid_vote.0).is_none() { + self.votes_batched_since_last_tick += 1; + duplicate = false; + } + + if duplicate { + Err(pending_response) + } else { + self.requesters.push((peer, pending_response)); + Ok(()) + } + } + + /// Check batch for liveness. + /// + /// This function is supposed to be called at instants given at construction and as returned as + /// part of `TickResult`. + pub(super) fn tick(mut self, now: Instant) -> TickResult { + if self.votes_batched_since_last_tick >= MIN_KEEP_BATCH_ALIVE_VOTES && + now < self.best_before + { + // Still good: + let next_tick = self.calculate_next_tick(now); + // Reset counter: + self.votes_batched_since_last_tick = 0; + TickResult::Alive(self, next_tick) + } else { + TickResult::Done(PreparedImport::from(self)) + } + } + + /// Calculate when the next tick should happen. + /// + /// This will usually return `now + BATCH_COLLECTING_INTERVAL`, except if the lifetime of this batch + /// would exceed `MAX_BATCH_LIFETIME`. + /// + /// # Arguments + /// + /// * `now` - The current time. + fn calculate_next_tick(&self, now: Instant) -> Instant { + let next_tick = now + BATCH_COLLECTING_INTERVAL; + if next_tick < self.best_before { + next_tick + } else { + self.best_before + } + } +} diff --git a/node/network/dispute-distribution/src/receiver/batches/mod.rs b/node/network/dispute-distribution/src/receiver/batches/mod.rs new file mode 100644 index 000000000000..b343b55e0b04 --- /dev/null +++ b/node/network/dispute-distribution/src/receiver/batches/mod.rs @@ -0,0 +1,170 @@ +// Copyright 2022 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 . + +use std::{ + collections::{hash_map, HashMap}, + time::{Duration, Instant}, +}; + +use futures::future::pending; + +use polkadot_node_network_protocol::request_response::DISPUTE_REQUEST_TIMEOUT; +use polkadot_primitives::v2::{CandidateHash, CandidateReceipt}; + +use crate::{ + receiver::batches::{batch::TickResult, waiting_queue::PendingWake}, + LOG_TARGET, +}; + +pub use self::batch::{Batch, PreparedImport}; +use self::waiting_queue::WaitingQueue; + +use super::{ + error::{JfyiError, JfyiResult}, + BATCH_COLLECTING_INTERVAL, +}; + +/// A single batch (per candidate) as managed by `Batches`. +mod batch; + +/// Queue events in time and wait for them to become ready. +mod waiting_queue; + +/// Safe-guard in case votes trickle in real slow. +/// +/// If the batch life time exceeded the time the sender is willing to wait for a confirmation, we +/// would trigger pointless re-sends. +const MAX_BATCH_LIFETIME: Duration = DISPUTE_REQUEST_TIMEOUT.saturating_sub(Duration::from_secs(2)); + +/// Limit the number of batches that can be alive at any given time. +/// +/// Reasoning for this number, see guide. +pub const MAX_BATCHES: usize = 1000; + +/// Manage batches. +/// +/// - Batches can be found via `find_batch()` in order to add votes to them/check they exist. +/// - Batches can be checked for being ready for flushing in order to import contained votes. +pub struct Batches { + /// The batches we manage. + /// + /// Kept invariants: + /// For each entry in `batches`, there exists an entry in `waiting_queue` as well - we wait on + /// all batches! + batches: HashMap, + /// Waiting queue for waiting for batches to become ready for `tick`. + /// + /// Kept invariants by `Batches`: + /// For each entry in the `waiting_queue` there exists a corresponding entry in `batches`. + waiting_queue: WaitingQueue, +} + +/// A found batch is either really found or got created so it can be found. +pub enum FoundBatch<'a> { + /// Batch just got created. + Created(&'a mut Batch), + /// Batch already existed. + Found(&'a mut Batch), +} + +impl Batches { + /// Create new empty `Batches`. + pub fn new() -> Self { + debug_assert!( + MAX_BATCH_LIFETIME > BATCH_COLLECTING_INTERVAL, + "Unexpectedly low `MAX_BATCH_LIFETIME`, please check parameters." + ); + Self { batches: HashMap::new(), waiting_queue: WaitingQueue::new() } + } + + /// Find a particular batch. + /// + /// That is either find it, or we create it as reflected by the result `FoundBatch`. + pub fn find_batch( + &mut self, + candidate_hash: CandidateHash, + candidate_receipt: CandidateReceipt, + ) -> JfyiResult { + if self.batches.len() >= MAX_BATCHES { + return Err(JfyiError::MaxBatchLimitReached) + } + debug_assert!(candidate_hash == candidate_receipt.hash()); + let result = match self.batches.entry(candidate_hash) { + hash_map::Entry::Vacant(vacant) => { + let now = Instant::now(); + let (created, ready_at) = Batch::new(candidate_receipt, now); + let pending_wake = PendingWake { payload: candidate_hash, ready_at }; + self.waiting_queue.push(pending_wake); + FoundBatch::Created(vacant.insert(created)) + }, + hash_map::Entry::Occupied(occupied) => FoundBatch::Found(occupied.into_mut()), + }; + Ok(result) + } + + /// Wait for the next `tick` to check for ready batches. + /// + /// This function blocks (returns `Poll::Pending`) until at least one batch can be + /// checked for readiness meaning that `BATCH_COLLECTING_INTERVAL` has passed since the last + /// check for that batch or it reached end of life. + /// + /// If this `Batches` instance is empty (does not actually contain any batches), then this + /// function will always return `Poll::Pending`. + /// + /// Returns: A `Vec` of all `PreparedImport`s from batches that became ready. + pub async fn check_batches(&mut self) -> Vec { + let now = Instant::now(); + + let mut imports = Vec::new(); + + // Wait for at least one batch to become ready: + self.waiting_queue.wait_ready(now).await; + + // Process all ready entries: + while let Some(wake) = self.waiting_queue.pop_ready(now) { + let batch = self.batches.remove(&wake.payload); + debug_assert!( + batch.is_some(), + "Entries referenced in `waiting_queue` are supposed to exist!" + ); + let batch = match batch { + None => return pending().await, + Some(batch) => batch, + }; + match batch.tick(now) { + TickResult::Done(import) => { + gum::trace!( + target: LOG_TARGET, + candidate_hash = ?wake.payload, + "Batch became ready." + ); + imports.push(import); + }, + TickResult::Alive(old_batch, next_tick) => { + gum::trace!( + target: LOG_TARGET, + candidate_hash = ?wake.payload, + "Batch found to be still alive on check." + ); + let pending_wake = PendingWake { payload: wake.payload, ready_at: next_tick }; + self.waiting_queue.push(pending_wake); + self.batches.insert(wake.payload, old_batch); + }, + } + } + imports + } +} diff --git a/node/network/dispute-distribution/src/receiver/batches/waiting_queue.rs b/node/network/dispute-distribution/src/receiver/batches/waiting_queue.rs new file mode 100644 index 000000000000..995dc74d358f --- /dev/null +++ b/node/network/dispute-distribution/src/receiver/batches/waiting_queue.rs @@ -0,0 +1,204 @@ +// Copyright 2022 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 . + +use std::{cmp::Ordering, collections::BinaryHeap, time::Instant}; + +use futures::future::pending; +use futures_timer::Delay; + +/// Wait asynchronously for given `Instant`s one after the other. +/// +/// `PendingWake`s can be inserted and `WaitingQueue` makes `wait_ready()` to always wait for the +/// next `Instant` in the queue. +pub struct WaitingQueue { + /// All pending wakes we are supposed to wait on in order. + pending_wakes: BinaryHeap>, + /// Wait for next `PendingWake`. + timer: Option, +} + +/// Represents some event waiting to be processed at `ready_at`. +/// +/// This is an event in `WaitingQueue`. It provides an `Ord` instance, that sorts descending with +/// regard to `Instant` (so we get a `min-heap` with the earliest `Instant` at the top). +#[derive(Eq, PartialEq)] +pub struct PendingWake { + pub payload: Payload, + pub ready_at: Instant, +} + +impl WaitingQueue { + /// Get a new empty `WaitingQueue`. + /// + /// If you call `pop` on this queue immediately, it will always return `Poll::Pending`. + pub fn new() -> Self { + Self { pending_wakes: BinaryHeap::new(), timer: None } + } + + /// Push a `PendingWake`. + /// + /// The next call to `wait_ready` will make sure to wake soon enough to process that new event in a + /// timely manner. + pub fn push(&mut self, wake: PendingWake) { + self.pending_wakes.push(wake); + // Reset timer as it is potentially obsolete now: + self.timer = None; + } + + /// Pop the next ready item. + /// + /// This function does not wait, if nothing is ready right now as determined by the passed + /// `now` time stamp, this function simply returns `None`. + pub fn pop_ready(&mut self, now: Instant) -> Option> { + let is_ready = self.pending_wakes.peek().map_or(false, |p| p.ready_at <= now); + if is_ready { + Some(self.pending_wakes.pop().expect("We just peeked. qed.")) + } else { + None + } + } + + /// Don't pop, just wait until something is ready. + /// + /// Once this function returns `Poll::Ready(())` `pop_ready()` will return `Some`, if passed + /// the same `Instant`. + /// + /// Whether ready or not is determined based on the passed time stamp `now` which should be the + /// current time as returned by `Instant::now()` + /// + /// This function waits asynchronously for an item to become ready. If there is no more item, + /// this call will wait forever (return Poll::Pending without scheduling a wake). + pub async fn wait_ready(&mut self, now: Instant) { + if let Some(timer) = &mut self.timer { + // Previous timer was not done yet. + timer.await + } + + let next_waiting = self.pending_wakes.peek(); + let is_ready = next_waiting.map_or(false, |p| p.ready_at <= now); + if is_ready { + return + } + + self.timer = next_waiting.map(|p| Delay::new(p.ready_at.duration_since(now))); + match &mut self.timer { + None => return pending().await, + Some(timer) => timer.await, + } + } +} + +impl PartialOrd> for PendingWake { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } +} + +impl Ord for PendingWake { + fn cmp(&self, other: &Self) -> Ordering { + // Reverse order for min-heap: + match other.ready_at.cmp(&self.ready_at) { + Ordering::Equal => other.payload.cmp(&self.payload), + o => o, + } + } +} +#[cfg(test)] +mod tests { + use std::{ + task::Poll, + time::{Duration, Instant}, + }; + + use assert_matches::assert_matches; + use futures::{future::poll_fn, pin_mut, Future}; + + use crate::LOG_TARGET; + + use super::{PendingWake, WaitingQueue}; + + #[test] + fn wait_ready_waits_for_earliest_event_always() { + sp_tracing::try_init_simple(); + let mut queue = WaitingQueue::new(); + let now = Instant::now(); + let start = now; + queue.push(PendingWake { payload: 1u32, ready_at: now + Duration::from_millis(3) }); + // Push another one in order: + queue.push(PendingWake { payload: 2u32, ready_at: now + Duration::from_millis(5) }); + // Push one out of order: + queue.push(PendingWake { payload: 0u32, ready_at: now + Duration::from_millis(1) }); + // Push another one at same timestamp (should become ready at the same time) + queue.push(PendingWake { payload: 10u32, ready_at: now + Duration::from_millis(1) }); + + futures::executor::block_on(async move { + // No time passed yet - nothing should be ready. + assert!(queue.pop_ready(now).is_none(), "No time has passed, nothing should be ready"); + + // Receive them in order at expected times: + queue.wait_ready(now).await; + gum::trace!(target: LOG_TARGET, "After first wait."); + + let now = start + Duration::from_millis(1); + assert!(Instant::now() - start >= Duration::from_millis(1)); + assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(0u32)); + // One more should be ready: + assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(10u32)); + assert!(queue.pop_ready(now).is_none(), "No more entry expected to be ready."); + + queue.wait_ready(now).await; + gum::trace!(target: LOG_TARGET, "After second wait."); + let now = start + Duration::from_millis(3); + assert!(Instant::now() - start >= Duration::from_millis(3)); + assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(1u32)); + assert!(queue.pop_ready(now).is_none(), "No more entry expected to be ready."); + + // Push in between wait: + poll_fn(|cx| { + let fut = queue.wait_ready(now); + pin_mut!(fut); + assert_matches!(fut.poll(cx), Poll::Pending); + Poll::Ready(()) + }) + .await; + queue.push(PendingWake { payload: 3u32, ready_at: start + Duration::from_millis(4) }); + + queue.wait_ready(now).await; + // Newly pushed element should have become ready: + gum::trace!(target: LOG_TARGET, "After third wait."); + let now = start + Duration::from_millis(4); + assert!(Instant::now() - start >= Duration::from_millis(4)); + assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(3u32)); + assert!(queue.pop_ready(now).is_none(), "No more entry expected to be ready."); + + queue.wait_ready(now).await; + gum::trace!(target: LOG_TARGET, "After fourth wait."); + let now = start + Duration::from_millis(5); + assert!(Instant::now() - start >= Duration::from_millis(5)); + assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(2u32)); + assert!(queue.pop_ready(now).is_none(), "No more entry expected to be ready."); + + // queue empty - should wait forever now: + poll_fn(|cx| { + let fut = queue.wait_ready(now); + pin_mut!(fut); + assert_matches!(fut.poll(cx), Poll::Pending); + Poll::Ready(()) + }) + .await; + }); + } +} diff --git a/node/network/dispute-distribution/src/receiver/error.rs b/node/network/dispute-distribution/src/receiver/error.rs index ce578cc8e0f9..4477335440d0 100644 --- a/node/network/dispute-distribution/src/receiver/error.rs +++ b/node/network/dispute-distribution/src/receiver/error.rs @@ -19,8 +19,10 @@ use fatality::Nested; +use gum::CandidateHash; use polkadot_node_network_protocol::{request_response::incoming, PeerId}; use polkadot_node_subsystem_util::runtime; +use polkadot_primitives::v2::AuthorityDiscoveryId; use crate::LOG_TARGET; @@ -35,8 +37,8 @@ pub enum Error { #[error("Retrieving next incoming request failed.")] IncomingRequest(#[from] incoming::Error), - #[error("Sending back response to peer {0} failed.")] - SendResponse(PeerId), + #[error("Sending back response to peers {0:#?} failed.")] + SendResponses(Vec), #[error("Changing peer's ({0}) reputation failed.")] SetPeerReputation(PeerId), @@ -44,16 +46,29 @@ pub enum Error { #[error("Dispute request with invalid signatures, from peer {0}.")] InvalidSignature(PeerId), - #[error("Import of dispute got canceled for peer {0} - import failed for some reason.")] - ImportCanceled(PeerId), + #[error("Received votes from peer {0} have been completely redundant.")] + RedundantMessage(PeerId), + + #[error("Import of dispute got canceled for candidate {0} - import failed for some reason.")] + ImportCanceled(CandidateHash), #[error("Peer {0} attempted to participate in dispute and is not a validator.")] NotAValidator(PeerId), + + #[error("Force flush for batch that could not be found attempted, candidate hash: {0}")] + ForceFlushBatchDoesNotExist(CandidateHash), + + // Should never happen in practice: + #[error("We needed to drop messages, because we reached limit on concurrent batches.")] + MaxBatchLimitReached, + + #[error("Authority {0} sent messages at a too high rate.")] + AuthorityFlooding(AuthorityDiscoveryId), } pub type Result = std::result::Result; -pub type JfyiErrorResult = std::result::Result; +pub type JfyiResult = std::result::Result; /// Utility for eating top level errors and log them. /// diff --git a/node/network/dispute-distribution/src/receiver/mod.rs b/node/network/dispute-distribution/src/receiver/mod.rs index 9193947e78d1..158c66e20655 100644 --- a/node/network/dispute-distribution/src/receiver/mod.rs +++ b/node/network/dispute-distribution/src/receiver/mod.rs @@ -15,20 +15,21 @@ // along with Polkadot. If not, see . use std::{ - collections::HashSet, + num::NonZeroUsize, pin::Pin, task::{Context, Poll}, + time::Duration, }; use futures::{ channel::oneshot, - future::{poll_fn, BoxFuture}, + future::poll_fn, pin_mut, - stream::{FusedStream, FuturesUnordered, StreamExt}, - Future, FutureExt, Stream, + stream::{FuturesUnordered, StreamExt}, + Future, }; -use lru::LruCache; +use gum::CandidateHash; use polkadot_node_network_protocol::{ authority_discovery::AuthorityDiscovery, request_response::{ @@ -51,20 +52,47 @@ use crate::{ }; mod error; -use self::error::{log_error, JfyiError, JfyiErrorResult, Result}; + +/// Rate limiting queues for incoming requests by peers. +mod peer_queues; + +/// Batch imports together. +mod batches; + +use self::{ + batches::{Batches, FoundBatch, PreparedImport}, + error::{log_error, JfyiError, JfyiResult, Result}, + peer_queues::PeerQueues, +}; const COST_INVALID_REQUEST: Rep = Rep::CostMajor("Received message could not be decoded."); const COST_INVALID_SIGNATURE: Rep = Rep::Malicious("Signatures were invalid."); -const COST_INVALID_CANDIDATE: Rep = Rep::Malicious("Reported candidate was not available."); +const COST_INVALID_IMPORT: Rep = + Rep::Malicious("Import was deemed invalid by dispute-coordinator."); const COST_NOT_A_VALIDATOR: Rep = Rep::CostMajor("Reporting peer was not a validator."); +/// Mildly punish peers exceeding their rate limit. +/// +/// For honest peers this should rarely happen, but if it happens we would not want to disconnect +/// too quickly. Minor cost should suffice for disconnecting any real flooder. +const COST_APPARENT_FLOOD: Rep = Rep::CostMinor("Peer exceeded the rate limit."); -/// How many statement imports we want to issue in parallel: -pub const MAX_PARALLEL_IMPORTS: usize = 10; +/// How many votes must have arrived in the last `BATCH_COLLECTING_INTERVAL` +/// +/// in order for a batch to stay alive and not get flushed/imported to the dispute-coordinator. +/// +/// This ensures a timely import of batches. +#[cfg(not(test))] +pub const MIN_KEEP_BATCH_ALIVE_VOTES: u32 = 10; +#[cfg(test)] +pub const MIN_KEEP_BATCH_ALIVE_VOTES: u32 = 2; -/// State for handling incoming `DisputeRequest` messages. +/// Time we allow to pass for new votes to trickle in. /// -/// This is supposed to run as its own task in order to easily impose back pressure on the incoming -/// request channel and at the same time to drop flood messages as fast as possible. +/// See `MIN_KEEP_BATCH_ALIVE_VOTES` above. +/// Should be greater or equal to `RECEIVE_RATE_LIMIT` (there is no point in checking any faster). +pub const BATCH_COLLECTING_INTERVAL: Duration = Duration::from_millis(500); + +/// State for handling incoming `DisputeRequest` messages. pub struct DisputesReceiver { /// Access to session information. runtime: RuntimeInfo, @@ -75,18 +103,17 @@ pub struct DisputesReceiver { /// Channel to retrieve incoming requests from. receiver: IncomingRequestReceiver, + /// Rate limiting queue for each peer (only authorities). + peer_queues: PeerQueues, + + /// Currently active batches of imports per candidate. + batches: Batches, + /// Authority discovery service: authority_discovery: AD, - /// Imports currently being processed. - pending_imports: PendingImports, - - /// We keep record of the last banned peers. - /// - /// This is needed because once we ban a peer, we will very likely still have pending requests - /// in the incoming channel - we should not waste time recovering availability for those, as we - /// already know the peer is malicious. - banned_peers: LruCache, + /// Imports currently being processed by the `dispute-coordinator`. + pending_imports: FuturesUnordered, /// Log received requests. metrics: Metrics, @@ -100,36 +127,24 @@ enum MuxedMessage { /// /// - We need to make sure responses are actually sent (therefore we need to await futures /// promptly). - /// - We need to update `banned_peers` accordingly to the result. - ConfirmedImport(JfyiErrorResult<(PeerId, ImportStatementsResult)>), + /// - We need to punish peers whose import got rejected. + ConfirmedImport(ImportResult), /// A new request has arrived and should be handled. NewRequest(IncomingRequest), -} -impl MuxedMessage { - async fn receive( - pending_imports: &mut PendingImports, - pending_requests: &mut IncomingRequestReceiver, - ) -> Result { - poll_fn(|ctx| { - let next_req = pending_requests.recv(|| vec![COST_INVALID_REQUEST]); - pin_mut!(next_req); - if let Poll::Ready(r) = next_req.poll(ctx) { - return match r { - Err(e) => Poll::Ready(Err(incoming::Error::from(e).into())), - Ok(v) => Poll::Ready(Ok(Self::NewRequest(v))), - } - } - // In case of Ready(None) return `Pending` below - we want to wait for the next request - // in that case. - if let Poll::Ready(Some(v)) = pending_imports.poll_next_unpin(ctx) { - return Poll::Ready(Ok(Self::ConfirmedImport(v))) - } - Poll::Pending - }) - .await - } + /// Rate limit timer hit - is is time to process one row of messages. + /// + /// This is the result of calling `self.peer_queues.pop_reqs()`. + WakePeerQueuesPopReqs(Vec>), + + /// It is time to check batches. + /// + /// Every `BATCH_COLLECTING_INTERVAL` we check whether less than `MIN_KEEP_BATCH_ALIVE_VOTES` + /// new votes arrived, if so the batch is ready for import. + /// + /// This is the result of calling `self.batches.check_batches()`. + WakeCheckBatches(Vec), } impl DisputesReceiver @@ -146,17 +161,17 @@ where ) -> Self { let runtime = RuntimeInfo::new_with_config(runtime::Config { keystore: None, - session_cache_lru_size: DISPUTE_WINDOW.get() as usize, + session_cache_lru_size: NonZeroUsize::new(DISPUTE_WINDOW.get() as usize) + .expect("Dispute window can not be 0; qed"), }); Self { runtime, sender, receiver, + peer_queues: PeerQueues::new(), + batches: Batches::new(), authority_discovery, - pending_imports: PendingImports::new(), - // Size of MAX_PARALLEL_IMPORTS ensures we are going to immediately get rid of any - // malicious requests still pending in the incoming queue. - banned_peers: LruCache::new(MAX_PARALLEL_IMPORTS), + pending_imports: FuturesUnordered::new(), metrics, } } @@ -180,60 +195,132 @@ where } } - /// Actual work happening here. + /// Actual work happening here in three phases: + /// + /// 1. Receive and queue incoming messages until the rate limit timer hits. + /// 2. Do import/batching for the head of all queues. + /// 3. Check and flush any ready batches. async fn run_inner(&mut self) -> Result<()> { - let msg = MuxedMessage::receive(&mut self.pending_imports, &mut self.receiver).await?; + let msg = self.receive_message().await?; - let incoming = match msg { - // We need to clean up futures, to make sure responses are sent: - MuxedMessage::ConfirmedImport(m_bad) => { - self.ban_bad_peer(m_bad)?; - return Ok(()) + match msg { + MuxedMessage::NewRequest(req) => { + // Phase 1: + self.metrics.on_received_request(); + self.dispatch_to_queues(req).await?; }, - MuxedMessage::NewRequest(req) => req, - }; + MuxedMessage::WakePeerQueuesPopReqs(reqs) => { + // Phase 2: + for req in reqs { + // No early return - we cannot cancel imports of one peer, because the import of + // another failed: + match log_error(self.start_import_or_batch(req).await) { + Ok(()) => {}, + Err(fatal) => return Err(fatal.into()), + } + } + }, + MuxedMessage::WakeCheckBatches(ready_imports) => { + // Phase 3: + self.import_ready_batches(ready_imports).await; + }, + MuxedMessage::ConfirmedImport(import_result) => { + self.update_imported_requests_metrics(&import_result); + // Confirm imports to requesters/punish them on invalid imports: + send_responses_to_requesters(import_result).await?; + }, + } + + Ok(()) + } + + /// Receive one `MuxedMessage`. + /// + /// + /// Dispatching events to messages as they happen. + async fn receive_message(&mut self) -> Result { + poll_fn(|ctx| { + // In case of Ready(None), we want to wait for pending requests: + if let Poll::Ready(Some(v)) = self.pending_imports.poll_next_unpin(ctx) { + return Poll::Ready(Ok(MuxedMessage::ConfirmedImport(v?))) + } + + let rate_limited = self.peer_queues.pop_reqs(); + pin_mut!(rate_limited); + // We poll rate_limit before batches, so we don't unnecessarily delay importing to + // batches. + if let Poll::Ready(reqs) = rate_limited.poll(ctx) { + return Poll::Ready(Ok(MuxedMessage::WakePeerQueuesPopReqs(reqs))) + } - self.metrics.on_received_request(); + let ready_batches = self.batches.check_batches(); + pin_mut!(ready_batches); + if let Poll::Ready(ready_batches) = ready_batches.poll(ctx) { + return Poll::Ready(Ok(MuxedMessage::WakeCheckBatches(ready_batches))) + } - let peer = incoming.peer; + let next_req = self.receiver.recv(|| vec![COST_INVALID_REQUEST]); + pin_mut!(next_req); + if let Poll::Ready(r) = next_req.poll(ctx) { + return match r { + Err(e) => Poll::Ready(Err(incoming::Error::from(e).into())), + Ok(v) => Poll::Ready(Ok(MuxedMessage::NewRequest(v))), + } + } + Poll::Pending + }) + .await + } - // Only accept messages from validators: - if self.authority_discovery.get_authority_ids_by_peer_id(peer).await.is_none() { - incoming - .send_outgoing_response(OutgoingResponse { + /// Process incoming requests. + /// + /// - Check sender is authority + /// - Dispatch message to corresponding queue in `peer_queues`. + /// - If queue is full, drop message and change reputation of sender. + async fn dispatch_to_queues(&mut self, req: IncomingRequest) -> JfyiResult<()> { + let peer = req.peer; + // Only accept messages from validators, in case there are multiple `AuthorityId`s, we + // just take the first one. On session boundaries this might allow validators to double + // their rate limit for a short period of time, which seems acceptable. + let authority_id = match self + .authority_discovery + .get_authority_ids_by_peer_id(peer) + .await + .and_then(|s| s.into_iter().next()) + { + None => { + req.send_outgoing_response(OutgoingResponse { result: Err(()), reputation_changes: vec![COST_NOT_A_VALIDATOR], sent_feedback: None, }) - .map_err(|_| JfyiError::SendResponse(peer))?; - - return Err(JfyiError::NotAValidator(peer).into()) - } - - // Immediately drop requests from peers that already have requests in flight or have - // been banned recently (flood protection): - if self.pending_imports.peer_is_pending(&peer) || self.banned_peers.contains(&peer) { - gum::trace!( - target: LOG_TARGET, - ?peer, - "Dropping message from peer (banned/pending import)" - ); - return Ok(()) - } + .map_err(|_| JfyiError::SendResponses(vec![peer]))?; + return Err(JfyiError::NotAValidator(peer).into()) + }, + Some(auth_id) => auth_id, + }; - // Wait for a free slot: - if self.pending_imports.len() >= MAX_PARALLEL_IMPORTS as usize { - // Wait for one to finish: - let r = self.pending_imports.next().await; - self.ban_bad_peer(r.expect("pending_imports.len() is greater 0. qed."))?; + // Queue request: + if let Err((authority_id, req)) = self.peer_queues.push_req(authority_id, req) { + req.send_outgoing_response(OutgoingResponse { + result: Err(()), + reputation_changes: vec![COST_APPARENT_FLOOD], + sent_feedback: None, + }) + .map_err(|_| JfyiError::SendResponses(vec![peer]))?; + return Err(JfyiError::AuthorityFlooding(authority_id)) } - - // All good - initiate import. - self.start_import(incoming).await + Ok(()) } - /// Start importing votes for the given request. - async fn start_import(&mut self, incoming: IncomingRequest) -> Result<()> { + /// Start importing votes for the given request or batch. + /// + /// Signature check and in case we already have an existing batch we import to that batch, + /// otherwise import to `dispute-coordinator` directly and open a batch. + async fn start_import_or_batch( + &mut self, + incoming: IncomingRequest, + ) -> Result<()> { let IncomingRequest { peer, payload, pending_response } = incoming; let info = self @@ -263,128 +350,172 @@ where Ok(votes) => votes, }; - let (pending_confirmation, confirmation_rx) = oneshot::channel(); - self.sender - .send_message(DisputeCoordinatorMessage::ImportStatements { - candidate_receipt, - session: valid_vote.0.session_index(), - statements: vec![valid_vote, invalid_vote], - pending_confirmation: Some(pending_confirmation), - }) - .await; + let candidate_hash = *valid_vote.0.candidate_hash(); + + match self.batches.find_batch(candidate_hash, candidate_receipt)? { + FoundBatch::Created(batch) => { + // There was no entry yet - start import immediately: + gum::trace!( + target: LOG_TARGET, + ?candidate_hash, + ?peer, + "No batch yet - triggering immediate import" + ); + let import = PreparedImport { + candidate_receipt: batch.candidate_receipt().clone(), + statements: vec![valid_vote, invalid_vote], + requesters: vec![(peer, pending_response)], + }; + self.start_import(import).await; + }, + FoundBatch::Found(batch) => { + gum::trace!(target: LOG_TARGET, ?candidate_hash, "Batch exists - batching request"); + let batch_result = + batch.add_votes(valid_vote, invalid_vote, peer, pending_response); + + if let Err(pending_response) = batch_result { + // We don't expect honest peers to send redundant votes within a single batch, + // as the timeout for retry is much higher. Still we don't want to punish the + // node as it might not be the node's fault. Some other (malicious) node could have been + // faster sending the same votes in order to harm the reputation of that honest + // node. Given that we already have a rate limit, if a validator chooses to + // waste available rate with redundant votes - so be it. The actual dispute + // resolution is unaffected. + gum::debug!( + target: LOG_TARGET, + ?peer, + "Peer sent completely redundant votes within a single batch - that looks fishy!", + ); + pending_response + .send_outgoing_response(OutgoingResponse { + // While we have seen duplicate votes, we cannot confirm as we don't + // know yet whether the batch is going to be confirmed, so we assume + // the worst. We don't want to push the pending response to the batch + // either as that would be unbounded, only limited by the rate limit. + result: Err(()), + reputation_changes: Vec::new(), + sent_feedback: None, + }) + .map_err(|_| JfyiError::SendResponses(vec![peer]))?; + return Err(From::from(JfyiError::RedundantMessage(peer))) + } + }, + } - self.pending_imports.push(peer, confirmation_rx, pending_response); Ok(()) } - /// Await an import and ban any misbehaving peers. - /// - /// In addition we report import metrics. - fn ban_bad_peer( - &mut self, - result: JfyiErrorResult<(PeerId, ImportStatementsResult)>, - ) -> JfyiErrorResult<()> { - match result? { - (_, ImportStatementsResult::ValidImport) => { - self.metrics.on_imported(SUCCEEDED); - }, - (bad_peer, ImportStatementsResult::InvalidImport) => { - self.metrics.on_imported(FAILED); - self.banned_peers.put(bad_peer, ()); - }, + /// Trigger import into the dispute-coordinator of ready batches (`PreparedImport`s). + async fn import_ready_batches(&mut self, ready_imports: Vec) { + for import in ready_imports { + self.start_import(import).await; } - Ok(()) } -} -/// Manage pending imports in a way that preserves invariants. -struct PendingImports { - /// Futures in flight. - futures: - FuturesUnordered)>>, - /// Peers whose requests are currently in flight. - peers: HashSet, -} + /// Start import and add response receiver to `pending_imports`. + async fn start_import(&mut self, import: PreparedImport) { + let PreparedImport { candidate_receipt, statements, requesters } = import; + let (session_index, candidate_hash) = match statements.iter().next() { + None => { + gum::debug!( + target: LOG_TARGET, + candidate_hash = ?candidate_receipt.hash(), + "Not importing empty batch" + ); + return + }, + Some(vote) => (vote.0.session_index(), vote.0.candidate_hash().clone()), + }; -impl PendingImports { - pub fn new() -> Self { - Self { futures: FuturesUnordered::new(), peers: HashSet::new() } - } + let (pending_confirmation, confirmation_rx) = oneshot::channel(); + self.sender + .send_message(DisputeCoordinatorMessage::ImportStatements { + candidate_receipt, + session: session_index, + statements, + pending_confirmation: Some(pending_confirmation), + }) + .await; - pub fn push( - &mut self, - peer: PeerId, - handled: oneshot::Receiver, - pending_response: OutgoingResponseSender, - ) { - self.peers.insert(peer); - self.futures.push( - async move { - let r = respond_to_request(peer, handled, pending_response).await; - (peer, r) - } - .boxed(), - ) - } + let pending = + PendingImport { candidate_hash, requesters, pending_response: confirmation_rx }; - /// Returns the number of contained futures. - pub fn len(&self) -> usize { - self.futures.len() + self.pending_imports.push(pending); } - /// Check whether a peer has a pending import. - pub fn peer_is_pending(&self, peer: &PeerId) -> bool { - self.peers.contains(peer) + fn update_imported_requests_metrics(&self, result: &ImportResult) { + let label = match result.result { + ImportStatementsResult::ValidImport => SUCCEEDED, + ImportStatementsResult::InvalidImport => FAILED, + }; + self.metrics.on_imported(label, result.requesters.len()); } } -impl Stream for PendingImports { - type Item = JfyiErrorResult<(PeerId, ImportStatementsResult)>; - fn poll_next(mut self: Pin<&mut Self>, ctx: &mut Context<'_>) -> Poll> { - match Pin::new(&mut self.futures).poll_next(ctx) { - Poll::Pending => Poll::Pending, - Poll::Ready(None) => Poll::Ready(None), - Poll::Ready(Some((peer, result))) => { - self.peers.remove(&peer); - Poll::Ready(Some(result.map(|r| (peer, r)))) - }, - } - } -} -impl FusedStream for PendingImports { - fn is_terminated(&self) -> bool { - self.futures.is_terminated() - } -} +async fn send_responses_to_requesters(import_result: ImportResult) -> JfyiResult<()> { + let ImportResult { requesters, result } = import_result; -// Future for `PendingImports` -// -// - Wait for import -// - Punish peer -// - Deliver result -async fn respond_to_request( - peer: PeerId, - handled: oneshot::Receiver, - pending_response: OutgoingResponseSender, -) -> JfyiErrorResult { - let result = handled.await.map_err(|_| JfyiError::ImportCanceled(peer))?; - - let response = match result { - ImportStatementsResult::ValidImport => OutgoingResponse { + let mk_response = match result { + ImportStatementsResult::ValidImport => || OutgoingResponse { result: Ok(DisputeResponse::Confirmed), reputation_changes: Vec::new(), sent_feedback: None, }, - ImportStatementsResult::InvalidImport => OutgoingResponse { + ImportStatementsResult::InvalidImport => || OutgoingResponse { result: Err(()), - reputation_changes: vec![COST_INVALID_CANDIDATE], + reputation_changes: vec![COST_INVALID_IMPORT], sent_feedback: None, }, }; - pending_response - .send_outgoing_response(response) - .map_err(|_| JfyiError::SendResponse(peer))?; + let mut sending_failed_for = Vec::new(); + for (peer, pending_response) in requesters { + if let Err(()) = pending_response.send_outgoing_response(mk_response()) { + sending_failed_for.push(peer); + } + } + + if !sending_failed_for.is_empty() { + Err(JfyiError::SendResponses(sending_failed_for)) + } else { + Ok(()) + } +} - Ok(result) +/// A future that resolves into an `ImportResult` when ready. +/// +/// This future is used on `dispute-coordinator` import messages for the oneshot response receiver +/// to: +/// - Keep track of concerned `CandidateHash` for reporting errors. +/// - Keep track of requesting peers so we can confirm the import/punish them on invalid imports. +struct PendingImport { + candidate_hash: CandidateHash, + requesters: Vec<(PeerId, OutgoingResponseSender)>, + pending_response: oneshot::Receiver, +} + +/// A `PendingImport` becomes an `ImportResult` once done. +struct ImportResult { + /// Requesters of that import. + requesters: Vec<(PeerId, OutgoingResponseSender)>, + /// Actual result of the import. + result: ImportStatementsResult, +} + +impl PendingImport { + async fn wait_for_result(&mut self) -> JfyiResult { + let result = (&mut self.pending_response) + .await + .map_err(|_| JfyiError::ImportCanceled(self.candidate_hash))?; + Ok(ImportResult { requesters: std::mem::take(&mut self.requesters), result }) + } +} + +impl Future for PendingImport { + type Output = JfyiResult; + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + let fut = self.wait_for_result(); + pin_mut!(fut); + fut.poll(cx) + } } diff --git a/node/network/dispute-distribution/src/receiver/peer_queues.rs b/node/network/dispute-distribution/src/receiver/peer_queues.rs new file mode 100644 index 000000000000..138b59c3f867 --- /dev/null +++ b/node/network/dispute-distribution/src/receiver/peer_queues.rs @@ -0,0 +1,141 @@ +// Copyright 2022 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 . + +use std::collections::{hash_map::Entry, HashMap, VecDeque}; + +use futures::future::pending; +use futures_timer::Delay; +use polkadot_node_network_protocol::request_response::{v1::DisputeRequest, IncomingRequest}; +use polkadot_primitives::v2::AuthorityDiscoveryId; + +use crate::RECEIVE_RATE_LIMIT; + +/// How many messages we are willing to queue per peer (validator). +/// +/// The larger this value is, the larger bursts are allowed to be without us dropping messages. On +/// the flip side this gets allocated per validator, so for a size of 10 this will result +/// in `10_000 * size_of(IncomingRequest)` in the worst case. +/// +/// `PEER_QUEUE_CAPACITY` must not be 0 for obvious reasons. +#[cfg(not(test))] +pub const PEER_QUEUE_CAPACITY: usize = 10; +#[cfg(test)] +pub const PEER_QUEUE_CAPACITY: usize = 2; + +/// Queues for messages from authority peers for rate limiting. +/// +/// Invariants ensured: +/// +/// 1. No queue will ever have more than `PEER_QUEUE_CAPACITY` elements. +/// 2. There are no empty queues. Whenever a queue gets empty, it is removed. This way checking +/// whether there are any messages queued is cheap. +/// 3. As long as not empty, `pop_reqs` will, if called in sequence, not return `Ready` more often +/// than once for every `RECEIVE_RATE_LIMIT`, but it will always return Ready eventually. +/// 4. If empty `pop_reqs` will never return `Ready`, but will always be `Pending`. +pub struct PeerQueues { + /// Actual queues. + queues: HashMap>>, + + /// Delay timer for establishing the rate limit. + rate_limit_timer: Option, +} + +impl PeerQueues { + /// New empty `PeerQueues`. + pub fn new() -> Self { + Self { queues: HashMap::new(), rate_limit_timer: None } + } + + /// Push an incoming request for a given authority. + /// + /// Returns: `Ok(())` if succeeded, `Err((args))` if capacity is reached. + pub fn push_req( + &mut self, + peer: AuthorityDiscoveryId, + req: IncomingRequest, + ) -> Result<(), (AuthorityDiscoveryId, IncomingRequest)> { + let queue = match self.queues.entry(peer) { + Entry::Vacant(vacant) => vacant.insert(VecDeque::new()), + Entry::Occupied(occupied) => { + if occupied.get().len() >= PEER_QUEUE_CAPACITY { + return Err((occupied.key().clone(), req)) + } + occupied.into_mut() + }, + }; + queue.push_back(req); + + // We have at least one element to process - rate limit `timer` needs to exist now: + self.ensure_timer(); + Ok(()) + } + + /// Pop all heads and return them for processing. + /// + /// This gets one message from each peer that has sent at least one. + /// + /// This function is rate limited, if called in sequence it will not return more often than + /// every `RECEIVE_RATE_LIMIT`. + /// + /// NOTE: If empty this function will not return `Ready` at all, but will always be `Pending`. + pub async fn pop_reqs(&mut self) -> Vec> { + self.wait_for_timer().await; + + let mut heads = Vec::with_capacity(self.queues.len()); + let old_queues = std::mem::replace(&mut self.queues, HashMap::new()); + for (k, mut queue) in old_queues.into_iter() { + let front = queue.pop_front(); + debug_assert!(front.is_some(), "Invariant that queues are never empty is broken."); + + if let Some(front) = front { + heads.push(front); + } + if !queue.is_empty() { + self.queues.insert(k, queue); + } + } + + if !self.is_empty() { + // Still not empty - we should get woken at some point. + self.ensure_timer(); + } + + heads + } + + /// Whether or not all queues are empty. + pub fn is_empty(&self) -> bool { + self.queues.is_empty() + } + + /// Ensure there is an active `timer`. + /// + /// Checks whether one exists and if not creates one. + fn ensure_timer(&mut self) -> &mut Delay { + self.rate_limit_timer.get_or_insert(Delay::new(RECEIVE_RATE_LIMIT)) + } + + /// Wait for `timer` if it exists, or be `Pending` forever. + /// + /// Afterwards it gets set back to `None`. + async fn wait_for_timer(&mut self) { + match self.rate_limit_timer.as_mut() { + None => pending().await, + Some(timer) => timer.await, + } + self.rate_limit_timer = None; + } +} diff --git a/node/network/dispute-distribution/src/sender/mod.rs b/node/network/dispute-distribution/src/sender/mod.rs index 5312528b413e..09b902173ede 100644 --- a/node/network/dispute-distribution/src/sender/mod.rs +++ b/node/network/dispute-distribution/src/sender/mod.rs @@ -14,10 +14,21 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::collections::{hash_map::Entry, HashMap, HashSet}; - -use futures::channel::{mpsc, oneshot}; - +use std::{ + collections::{HashMap, HashSet}, + pin::Pin, + task::Poll, + time::Duration, +}; + +use futures::{ + channel::{mpsc, oneshot}, + future::poll_fn, + Future, +}; + +use futures_timer::Delay; +use indexmap::{map::Entry, IndexMap}; use polkadot_node_network_protocol::request_response::v1::DisputeRequest; use polkadot_node_primitives::{CandidateVotes, DisputeMessage, SignedDisputeStatement}; use polkadot_node_subsystem::{messages::DisputeCoordinatorMessage, overseer, ActiveLeavesUpdate}; @@ -28,22 +39,27 @@ use polkadot_primitives::v2::{CandidateHash, DisputeStatement, Hash, SessionInde /// /// It is going to spawn real tasks as it sees fit for getting the votes of the particular dispute /// out. +/// +/// As we assume disputes have a priority, we start sending for disputes in the order +/// `start_sender` got called. mod send_task; use send_task::SendTask; pub use send_task::TaskFinish; -/// Error and [`Result`] type for sender +/// Error and [`Result`] type for sender. mod error; pub use error::{Error, FatalError, JfyiError, Result}; use self::error::JfyiErrorResult; -use crate::{Metrics, LOG_TARGET}; +use crate::{Metrics, LOG_TARGET, SEND_RATE_LIMIT}; /// The `DisputeSender` keeps track of all ongoing disputes we need to send statements out. /// /// For each dispute a `SendTask` is responsible for sending to the concerned validators for that /// particular dispute. The `DisputeSender` keeps track of those tasks, informs them about new /// sessions/validator sets and cleans them up when they become obsolete. +/// +/// The unit of work for the `DisputeSender` is a dispute, represented by `SendTask`s. pub struct DisputeSender { /// All heads we currently consider active. active_heads: Vec, @@ -54,11 +70,16 @@ pub struct DisputeSender { active_sessions: HashMap, /// All ongoing dispute sendings this subsystem is aware of. - disputes: HashMap, + /// + /// Using an `IndexMap` so items can be iterated in the order of insertion. + disputes: IndexMap, /// Sender to be cloned for `SendTask`s. tx: mpsc::Sender, + /// Future for delaying too frequent creation of dispute sending tasks. + rate_limit: RateLimit, + /// Metrics for reporting stats about sent requests. metrics: Metrics, } @@ -70,19 +91,25 @@ impl DisputeSender { Self { active_heads: Vec::new(), active_sessions: HashMap::new(), - disputes: HashMap::new(), + disputes: IndexMap::new(), tx, + rate_limit: RateLimit::new(), metrics, } } /// Create a `SendTask` for a particular new dispute. + /// + /// This function is rate-limited by `SEND_RATE_LIMIT`. It will block if called too frequently + /// in order to maintain the limit. pub async fn start_sender( &mut self, ctx: &mut Context, runtime: &mut RuntimeInfo, msg: DisputeMessage, ) -> Result<()> { + self.rate_limit.limit().await; + let req: DisputeRequest = msg.into(); let candidate_hash = req.0.candidate_receipt.hash(); match self.disputes.entry(candidate_hash) { @@ -112,6 +139,8 @@ impl DisputeSender { /// - Get new authorities to send messages to. /// - Get rid of obsolete tasks and disputes. /// - Get dispute sending started in case we missed one for some reason (e.g. on node startup) + /// + /// This function ensures the `SEND_RATE_LIMIT`, therefore it might block. pub async fn update_leaves( &mut self, ctx: &mut Context, @@ -134,21 +163,38 @@ impl DisputeSender { let active_disputes: HashSet<_> = active_disputes.into_iter().map(|(_, c)| c).collect(); - // Cleanup obsolete senders: + // Cleanup obsolete senders (retain keeps order of remaining elements): self.disputes .retain(|candidate_hash, _| active_disputes.contains(candidate_hash)); + // Iterates in order of insertion: + let mut should_rate_limit = true; for dispute in self.disputes.values_mut() { if have_new_sessions || dispute.has_failed_sends() { - dispute + if should_rate_limit { + self.rate_limit.limit().await; + } + let sends_happened = dispute .refresh_sends(ctx, runtime, &self.active_sessions, &self.metrics) .await?; + // Only rate limit if we actually sent something out _and_ it was not just because + // of errors on previous sends. + // + // Reasoning: It would not be acceptable to slow down the whole subsystem, just + // because of a few bad peers having problems. It is actually better to risk + // running into their rate limit in that case and accept a minor reputation change. + should_rate_limit = sends_happened && have_new_sessions; } } - // This should only be non-empty on startup, but if not - we got you covered: + // This should only be non-empty on startup, but if not - we got you covered. + // + // Initial order will not be maintained in that case, but that should be fine as disputes + // recovered at startup will be relatively "old" anyway and we assume that no more than a + // third of the validators will go offline at any point in time anyway. for dispute in unknown_disputes { - self.start_send_for_dispute(ctx, runtime, dispute).await? + self.rate_limit.limit().await; + self.start_send_for_dispute(ctx, runtime, dispute).await?; } Ok(()) } @@ -317,6 +363,46 @@ impl DisputeSender { } } +/// Rate limiting logic. +/// +/// Suitable for the sending side. +struct RateLimit { + limit: Delay, +} + +impl RateLimit { + /// Create new `RateLimit` that is immediately ready. + fn new() -> Self { + // Start with an empty duration, as there has not been any previous call. + Self { limit: Delay::new(Duration::new(0, 0)) } + } + + /// Initialized with actual `SEND_RATE_LIMIT` duration. + fn new_limit() -> Self { + Self { limit: Delay::new(SEND_RATE_LIMIT) } + } + + /// Wait until ready and prepare for next call. + async fn limit(&mut self) { + // Wait for rate limit and add some logging: + poll_fn(|cx| { + let old_limit = Pin::new(&mut self.limit); + match old_limit.poll(cx) { + Poll::Pending => { + gum::debug!( + target: LOG_TARGET, + "Sending rate limit hit, slowing down requests" + ); + Poll::Pending + }, + Poll::Ready(()) => Poll::Ready(()), + } + }) + .await; + *self = Self::new_limit(); + } +} + /// Retrieve the currently active sessions. /// /// List is all indices of all active sessions together with the head that was used for the query. diff --git a/node/network/dispute-distribution/src/sender/send_task.rs b/node/network/dispute-distribution/src/sender/send_task.rs index a2b8cdcf7441..89b5c099bde9 100644 --- a/node/network/dispute-distribution/src/sender/send_task.rs +++ b/node/network/dispute-distribution/src/sender/send_task.rs @@ -42,13 +42,15 @@ use crate::{ /// Delivery status for a particular dispute. /// /// Keeps track of all the validators that have to be reached for a dispute. +/// +/// The unit of work for a `SendTask` is an authority/validator. pub struct SendTask { - /// The request we are supposed to get out to all parachain validators of the dispute's session + /// The request we are supposed to get out to all `parachain` validators of the dispute's session /// and to all current authorities. request: DisputeRequest, /// The set of authorities we need to send our messages to. This set will change at session - /// boundaries. It will always be at least the parachain validators of the session where the + /// boundaries. It will always be at least the `parachain` validators of the session where the /// dispute happened and the authorities of the current sessions as determined by active heads. deliveries: HashMap, @@ -100,6 +102,10 @@ impl TaskResult { #[overseer::contextbounds(DisputeDistribution, prefix = self::overseer)] impl SendTask { /// Initiates sending a dispute message to peers. + /// + /// Creation of new `SendTask`s is subject to rate limiting. As each `SendTask` will trigger + /// sending a message to each validator, hence for employing a per-peer rate limit, we need to + /// limit the construction of new `SendTask`s. pub async fn new( ctx: &mut Context, runtime: &mut RuntimeInfo, @@ -118,15 +124,22 @@ impl SendTask { /// /// This function is called at construction and should also be called whenever a session change /// happens and on a regular basis to ensure we are retrying failed attempts. + /// + /// This might resend to validators and is thus subject to any rate limiting we might want. + /// Calls to this function for different instances should be rate limited according to + /// `SEND_RATE_LIMIT`. + /// + /// Returns: `True` if this call resulted in new requests. pub async fn refresh_sends( &mut self, ctx: &mut Context, runtime: &mut RuntimeInfo, active_sessions: &HashMap, metrics: &Metrics, - ) -> Result<()> { + ) -> Result { let new_authorities = self.get_relevant_validators(ctx, runtime, active_sessions).await?; + // Note this will also contain all authorities for which sending failed previously: let add_authorities = new_authorities .iter() .filter(|a| !self.deliveries.contains_key(a)) @@ -141,12 +154,14 @@ impl SendTask { send_requests(ctx, self.tx.clone(), add_authorities, self.request.clone(), metrics) .await?; + let was_empty = new_statuses.is_empty(); + self.has_failed_sends = false; self.deliveries.extend(new_statuses.into_iter()); - Ok(()) + Ok(!was_empty) } - /// Whether any sends have failed since the last refreshed. + /// Whether any sends have failed since the last refresh. pub fn has_failed_sends(&self) -> bool { self.has_failed_sends } @@ -193,9 +208,8 @@ impl SendTask { /// Determine all validators that should receive the given dispute requests. /// - /// This is all parachain validators of the session the candidate occurred and all authorities + /// This is all `parachain` validators of the session the candidate occurred and all authorities /// of all currently active sessions, determined by currently active heads. - async fn get_relevant_validators( &self, ctx: &mut Context, @@ -293,7 +307,7 @@ async fn wait_response_task( gum::debug!( target: LOG_TARGET, %err, - "Failed to notify susystem about dispute sending result." + "Failed to notify subsystem about dispute sending result." ); } } diff --git a/node/network/dispute-distribution/src/tests/mock.rs b/node/network/dispute-distribution/src/tests/mock.rs index 08428d5852cc..aa2a4485d480 100644 --- a/node/network/dispute-distribution/src/tests/mock.rs +++ b/node/network/dispute-distribution/src/tests/mock.rs @@ -20,6 +20,7 @@ use std::{ collections::{HashMap, HashSet}, sync::Arc, + time::Instant, }; use async_trait::async_trait; @@ -38,6 +39,8 @@ use polkadot_primitives::v2::{ }; use polkadot_primitives_test_helpers::dummy_candidate_descriptor; +use crate::LOG_TARGET; + pub const MOCK_SESSION_INDEX: SessionIndex = 1; pub const MOCK_NEXT_SESSION_INDEX: SessionIndex = 2; pub const MOCK_VALIDATORS: [Sr25519Keyring; 6] = [ @@ -54,6 +57,8 @@ pub const MOCK_AUTHORITIES_NEXT_SESSION: [Sr25519Keyring; 2] = pub const FERDIE_INDEX: ValidatorIndex = ValidatorIndex(0); pub const ALICE_INDEX: ValidatorIndex = ValidatorIndex(1); +pub const BOB_INDEX: ValidatorIndex = ValidatorIndex(2); +pub const CHARLIE_INDEX: ValidatorIndex = ValidatorIndex(3); lazy_static! { @@ -148,12 +153,22 @@ pub async fn make_dispute_message( invalid_validator: ValidatorIndex, ) -> DisputeMessage { let candidate_hash = candidate.hash(); + let before_request = Instant::now(); let valid_vote = make_explicit_signed(MOCK_VALIDATORS[valid_validator.0 as usize], candidate_hash, true) .await; + gum::trace!( + "Passed time for valid vote: {:#?}", + Instant::now().saturating_duration_since(before_request) + ); + let before_request = Instant::now(); let invalid_vote = make_explicit_signed(MOCK_VALIDATORS[invalid_validator.0 as usize], candidate_hash, false) .await; + gum::trace!( + "Passed time for invald vote: {:#?}", + Instant::now().saturating_duration_since(before_request) + ); DisputeMessage::from_signed_statements( valid_vote, valid_validator, @@ -206,10 +221,15 @@ impl AuthorityDiscovery for MockAuthorityDiscovery { ) -> Option> { for (a, p) in self.peer_ids.iter() { if p == &peer_id { - return Some(HashSet::from([MOCK_VALIDATORS_DISCOVERY_KEYS - .get(&a) - .unwrap() - .clone()])) + let result = + HashSet::from([MOCK_VALIDATORS_DISCOVERY_KEYS.get(&a).unwrap().clone()]); + gum::trace!( + target: LOG_TARGET, + %peer_id, + ?result, + "Returning authority ids for peer id" + ); + return Some(result) } } diff --git a/node/network/dispute-distribution/src/tests/mod.rs b/node/network/dispute-distribution/src/tests/mod.rs index 8ef8286ea197..56cdd467fd62 100644 --- a/node/network/dispute-distribution/src/tests/mod.rs +++ b/node/network/dispute-distribution/src/tests/mod.rs @@ -17,12 +17,17 @@ //! Subsystem unit tests -use std::{collections::HashSet, sync::Arc, task::Poll, time::Duration}; +use std::{ + collections::HashSet, + sync::Arc, + task::Poll, + time::{Duration, Instant}, +}; use assert_matches::assert_matches; use futures::{ channel::{mpsc, oneshot}, - future::poll_fn, + future::{poll_fn, ready}, pin_mut, Future, SinkExt, }; use futures_timer::Delay; @@ -52,7 +57,7 @@ use polkadot_node_subsystem_test_helpers::{ mock::make_ferdie_keystore, subsystem_test_harness, TestSubsystemContextHandle, }; use polkadot_primitives::v2::{ - AuthorityDiscoveryId, CandidateHash, Hash, SessionIndex, SessionInfo, + AuthorityDiscoveryId, CandidateHash, CandidateReceipt, Hash, SessionIndex, SessionInfo, }; use self::mock::{ @@ -60,7 +65,11 @@ use self::mock::{ MOCK_AUTHORITY_DISCOVERY, MOCK_NEXT_SESSION_INDEX, MOCK_NEXT_SESSION_INFO, MOCK_SESSION_INDEX, MOCK_SESSION_INFO, }; -use crate::{DisputeDistributionSubsystem, Metrics, LOG_TARGET}; +use crate::{ + receiver::BATCH_COLLECTING_INTERVAL, + tests::mock::{BOB_INDEX, CHARLIE_INDEX}, + DisputeDistributionSubsystem, Metrics, LOG_TARGET, SEND_RATE_LIMIT, +}; /// Useful mock providers. pub mod mock; @@ -72,49 +81,108 @@ fn send_dispute_sends_dispute() { let relay_parent = Hash::random(); let candidate = make_candidate_receipt(relay_parent); - let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; - handle - .send(FromOrchestra::Communication { - msg: DisputeDistributionMessage::SendDispute(message.clone()), - }) - .await; + send_dispute(&mut handle, candidate, true).await; + conclude(&mut handle).await; + }; + test_harness(test); +} + +#[test] +fn send_honors_rate_limit() { + sp_tracing::try_init_simple(); + let test = |mut handle: TestSubsystemContextHandle, _req_cfg| async move { + let _ = handle_subsystem_startup(&mut handle, None).await; + + let relay_parent = Hash::random(); + let candidate = make_candidate_receipt(relay_parent); + let before_request = Instant::now(); + send_dispute(&mut handle, candidate, true).await; + // First send should not be rate limited: + gum::trace!("Passed time: {:#?}", Instant::now().saturating_duration_since(before_request)); + // This test would likely be flaky on CI: + //assert!(Instant::now().saturating_duration_since(before_request) < SEND_RATE_LIMIT); + + let relay_parent = Hash::random(); + let candidate = make_candidate_receipt(relay_parent); + send_dispute(&mut handle, candidate, false).await; + // Second send should be rate limited: + gum::trace!( + "Passed time for send_dispute: {:#?}", + Instant::now().saturating_duration_since(before_request) + ); + assert!(Instant::now() - before_request >= SEND_RATE_LIMIT); + conclude(&mut handle).await; + }; + test_harness(test); +} + +/// Helper for sending a new dispute to dispute-distribution sender and handling resulting messages. +async fn send_dispute( + handle: &mut TestSubsystemContextHandle, + candidate: CandidateReceipt, + needs_session_info: bool, +) { + let before_request = Instant::now(); + let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; + gum::trace!( + "Passed time for making message: {:#?}", + Instant::now().saturating_duration_since(before_request) + ); + let before_request = Instant::now(); + handle + .send(FromOrchestra::Communication { + msg: DisputeDistributionMessage::SendDispute(message.clone()), + }) + .await; + gum::trace!( + "Passed time for sending message: {:#?}", + Instant::now().saturating_duration_since(before_request) + ); + if needs_session_info { // Requests needed session info: assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi( - RuntimeApiMessage::Request( - hash, - RuntimeApiRequest::SessionInfo(session_index, tx) + handle.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request( + hash, + RuntimeApiRequest::SessionInfo(session_index, tx) ) ) => { - assert_eq!(session_index, MOCK_SESSION_INDEX); - assert_eq!( - hash, - message.candidate_receipt().descriptor.relay_parent + assert_eq!(session_index, MOCK_SESSION_INDEX); + assert_eq!( + hash, + message.candidate_receipt().descriptor.relay_parent ); - tx.send(Ok(Some(MOCK_SESSION_INFO.clone()))).expect("Receiver should stay alive."); - } + tx.send(Ok(Some(MOCK_SESSION_INFO.clone()))).expect("Receiver should stay alive."); + } ); + } - let expected_receivers = { - let info = &MOCK_SESSION_INFO; - info.discovery_keys - .clone() - .into_iter() - .filter(|a| a != &Sr25519Keyring::Ferdie.public().into()) - .collect() - // All validators are also authorities in the first session, so we are - // done here. - }; - check_sent_requests(&mut handle, expected_receivers, true).await; - - conclude(&mut handle).await; + let expected_receivers = { + let info = &MOCK_SESSION_INFO; + info.discovery_keys + .clone() + .into_iter() + .filter(|a| a != &Sr25519Keyring::Ferdie.public().into()) + .collect() + // All validators are also authorities in the first session, so we are + // done here. }; - test_harness(test); + check_sent_requests(handle, expected_receivers, true).await; } +// Things to test: +// x Request triggers import +// x Subsequent imports get batched +// x Batch gets flushed. +// x Batch gets renewed. +// x Non authority requests get dropped. +// x Sending rate limit is honored. +// x Receiving rate limit is honored. +// x Duplicate requests on batch are dropped + #[test] -fn received_request_triggers_import() { +fn received_non_authorities_are_dropped() { let test = |mut handle: TestSubsystemContextHandle, mut req_cfg: RequestResponseConfig| async move { let req_tx = req_cfg.inbound_queue.as_mut().unwrap(); @@ -140,110 +208,271 @@ fn received_request_triggers_import() { assert_eq!(reputation_changes.len(), 1); } ); + conclude(&mut handle).await; + }; + test_harness(test); +} + +#[test] +fn received_request_triggers_import() { + let test = |mut handle: TestSubsystemContextHandle, + mut req_cfg: RequestResponseConfig| async move { + let req_tx = req_cfg.inbound_queue.as_mut().unwrap(); + let _ = handle_subsystem_startup(&mut handle, None).await; + + let relay_parent = Hash::random(); + let candidate = make_candidate_receipt(relay_parent); + let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; - // Nested valid and invalid import. - // - // Nested requests from same peer should get dropped. For the invalid request even - // subsequent requests should get dropped. nested_network_dispute_request( &mut handle, req_tx, MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Alice), message.clone().into(), - ImportStatementsResult::InvalidImport, + ImportStatementsResult::ValidImport, true, - move |handle, req_tx, message| { - nested_network_dispute_request( - handle, - req_tx, - MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob), - message.clone().into(), - ImportStatementsResult::ValidImport, - false, - move |_, req_tx, message| async move { - // Another request from Alice should get dropped (request already in - // flight): - { - let rx_response = send_network_dispute_request( - req_tx, - MOCK_AUTHORITY_DISCOVERY - .get_peer_id_by_authority(Sr25519Keyring::Alice), - message.clone(), - ) - .await; - - assert_matches!( - rx_response.await, - Err(err) => { - gum::trace!( - target: LOG_TARGET, - ?err, - "Request got dropped - other request already in flight" - ); - } - ); - } - // Another request from Bob should get dropped (request already in - // flight): - { - let rx_response = send_network_dispute_request( - req_tx, - MOCK_AUTHORITY_DISCOVERY - .get_peer_id_by_authority(Sr25519Keyring::Bob), - message.clone(), - ) - .await; - - assert_matches!( - rx_response.await, - Err(err) => { - gum::trace!( - target: LOG_TARGET, - ?err, - "Request got dropped - other request already in flight" - ); - } - ); - } - }, - ) - }, + move |_handle, _req_tx, _message| ready(()), ) .await; - // Subsequent sends from Alice should fail (peer is banned): - { - let rx_response = send_network_dispute_request( - req_tx, - MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Alice), - message.clone().into(), - ) - .await; + gum::trace!(target: LOG_TARGET, "Concluding."); + conclude(&mut handle).await; + }; + test_harness(test); +} + +#[test] +fn batching_works() { + let test = |mut handle: TestSubsystemContextHandle, + mut req_cfg: RequestResponseConfig| async move { + let req_tx = req_cfg.inbound_queue.as_mut().unwrap(); + let _ = handle_subsystem_startup(&mut handle, None).await; + + let relay_parent = Hash::random(); + let candidate = make_candidate_receipt(relay_parent); + let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; + + // Initial request should get forwarded immediately: + nested_network_dispute_request( + &mut handle, + req_tx, + MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Alice), + message.clone().into(), + ImportStatementsResult::ValidImport, + true, + move |_handle, _req_tx, _message| ready(()), + ) + .await; + let mut rx_responses = Vec::new(); + + let message = make_dispute_message(candidate.clone(), BOB_INDEX, FERDIE_INDEX).await; + let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob); + rx_responses.push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); + + let message = make_dispute_message(candidate.clone(), CHARLIE_INDEX, FERDIE_INDEX).await; + let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Charlie); + rx_responses.push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); + gum::trace!("Imported 3 votes into batch"); + + Delay::new(BATCH_COLLECTING_INTERVAL).await; + gum::trace!("Batch should still be alive"); + // Batch should still be alive (2 new votes): + // Let's import two more votes, but fully duplicates - should not extend batch live. + gum::trace!("Importing duplicate votes"); + let mut rx_responses_duplicate = Vec::new(); + let message = make_dispute_message(candidate.clone(), BOB_INDEX, FERDIE_INDEX).await; + let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob); + rx_responses_duplicate + .push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); + + let message = make_dispute_message(candidate.clone(), CHARLIE_INDEX, FERDIE_INDEX).await; + let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Charlie); + rx_responses_duplicate + .push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); + + for rx_response in rx_responses_duplicate { assert_matches!( rx_response.await, - Err(err) => { + Ok(resp) => { + let sc_network::config::OutgoingResponse { + result, + reputation_changes, + sent_feedback: _, + } = resp; gum::trace!( target: LOG_TARGET, - ?err, - "Request got dropped - peer is banned." + ?reputation_changes, + "Received reputation changes." + ); + // We don't punish on that. + assert_eq!(reputation_changes.len(), 0); + + assert_matches!(result, Err(())); + } + ); + } + + Delay::new(BATCH_COLLECTING_INTERVAL).await; + gum::trace!("Batch should be ready now (only duplicates have been added)"); + + let pending_confirmation = assert_matches!( + handle.recv().await, + AllMessages::DisputeCoordinator( + DisputeCoordinatorMessage::ImportStatements { + candidate_receipt: _, + session, + statements, + pending_confirmation: Some(pending_confirmation), + } + ) => { + assert_eq!(session, MOCK_SESSION_INDEX); + assert_eq!(statements.len(), 3); + pending_confirmation + } + ); + pending_confirmation.send(ImportStatementsResult::ValidImport).unwrap(); + + for rx_response in rx_responses { + assert_matches!( + rx_response.await, + Ok(resp) => { + let sc_network::config::OutgoingResponse { + result, + reputation_changes: _, + sent_feedback, + } = resp; + + let result = result.unwrap(); + let decoded = + ::decode(&mut result.as_slice()).unwrap(); + + assert!(decoded == DisputeResponse::Confirmed); + if let Some(sent_feedback) = sent_feedback { + sent_feedback.send(()).unwrap(); + } + gum::trace!( + target: LOG_TARGET, + "Valid import happened." ); + } ); } - // But should work fine for Bob: + gum::trace!(target: LOG_TARGET, "Concluding."); + conclude(&mut handle).await; + }; + test_harness(test); +} + +#[test] +fn receive_rate_limit_is_enforced() { + let test = |mut handle: TestSubsystemContextHandle, + mut req_cfg: RequestResponseConfig| async move { + let req_tx = req_cfg.inbound_queue.as_mut().unwrap(); + let _ = handle_subsystem_startup(&mut handle, None).await; + + let relay_parent = Hash::random(); + let candidate = make_candidate_receipt(relay_parent); + let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; + + // Initial request should get forwarded immediately: nested_network_dispute_request( &mut handle, req_tx, - MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob), + MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Alice), message.clone().into(), ImportStatementsResult::ValidImport, - false, - |_, _, _| async {}, + true, + move |_handle, _req_tx, _message| ready(()), ) .await; + let mut rx_responses = Vec::new(); + + let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob); + + let message = make_dispute_message(candidate.clone(), BOB_INDEX, FERDIE_INDEX).await; + rx_responses.push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); + + let message = make_dispute_message(candidate.clone(), CHARLIE_INDEX, FERDIE_INDEX).await; + rx_responses.push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); + + gum::trace!("Import one too much:"); + + let message = make_dispute_message(candidate.clone(), CHARLIE_INDEX, ALICE_INDEX).await; + let rx_response_flood = + send_network_dispute_request(req_tx, peer, message.clone().into()).await; + + assert_matches!( + rx_response_flood.await, + Ok(resp) => { + let sc_network::config::OutgoingResponse { + result: _, + reputation_changes, + sent_feedback: _, + } = resp; + gum::trace!( + target: LOG_TARGET, + ?reputation_changes, + "Received reputation changes." + ); + // Received punishment for flood: + assert_eq!(reputation_changes.len(), 1); + } + ); + gum::trace!("Need to wait 2 patch intervals:"); + Delay::new(BATCH_COLLECTING_INTERVAL).await; + Delay::new(BATCH_COLLECTING_INTERVAL).await; + + gum::trace!("Batch should be ready now"); + + let pending_confirmation = assert_matches!( + handle.recv().await, + AllMessages::DisputeCoordinator( + DisputeCoordinatorMessage::ImportStatements { + candidate_receipt: _, + session, + statements, + pending_confirmation: Some(pending_confirmation), + } + ) => { + assert_eq!(session, MOCK_SESSION_INDEX); + // Only 3 as fourth was flood: + assert_eq!(statements.len(), 3); + pending_confirmation + } + ); + pending_confirmation.send(ImportStatementsResult::ValidImport).unwrap(); + + for rx_response in rx_responses { + assert_matches!( + rx_response.await, + Ok(resp) => { + let sc_network::config::OutgoingResponse { + result, + reputation_changes: _, + sent_feedback, + } = resp; + + let result = result.unwrap(); + let decoded = + ::decode(&mut result.as_slice()).unwrap(); + + assert!(decoded == DisputeResponse::Confirmed); + if let Some(sent_feedback) = sent_feedback { + sent_feedback.send(()).unwrap(); + } + gum::trace!( + target: LOG_TARGET, + "Valid import happened." + ); + + } + ); + } + gum::trace!(target: LOG_TARGET, "Concluding."); conclude(&mut handle).await; }; diff --git a/node/network/protocol/src/request_response/mod.rs b/node/network/protocol/src/request_response/mod.rs index 5f4740279ef6..d24537e219c7 100644 --- a/node/network/protocol/src/request_response/mod.rs +++ b/node/network/protocol/src/request_response/mod.rs @@ -121,6 +121,10 @@ const POV_RESPONSE_SIZE: u64 = MAX_POV_SIZE as u64 + 10_000; /// This is `MAX_CODE_SIZE` plus some additional space for protocol overhead. const STATEMENT_RESPONSE_SIZE: u64 = MAX_CODE_SIZE as u64 + 10_000; +/// We can have relative large timeouts here, there is no value of hitting a +/// timeout as we want to get statements through to each node in any case. +pub const DISPUTE_REQUEST_TIMEOUT: Duration = Duration::from_secs(12); + impl Protocol { /// Get a configuration for a given Request response protocol. /// @@ -194,9 +198,7 @@ impl Protocol { /// Responses are just confirmation, in essence not even a bit. So 100 seems /// plenty. max_response_size: 100, - /// We can have relative large timeouts here, there is no value of hitting a - /// timeout as we want to get statements through to each node in any case. - request_timeout: Duration::from_secs(12), + request_timeout: DISPUTE_REQUEST_TIMEOUT, inbound_queue: Some(tx), }, }; diff --git a/node/overseer/Cargo.toml b/node/overseer/Cargo.toml index 0db382e4e783..8ee3fc6fb3cd 100644 --- a/node/overseer/Cargo.toml +++ b/node/overseer/Cargo.toml @@ -17,8 +17,8 @@ polkadot-node-metrics = { path = "../metrics" } polkadot-primitives = { path = "../../primitives" } orchestra = "0.0.2" gum = { package = "tracing-gum", path = "../gum" } -lru = "0.7" -parity-util-mem = { version = "0.11.0", default-features = false } +lru = "0.8" +parity-util-mem = { version = "0.12.0", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } async-trait = "0.1.57" diff --git a/node/overseer/src/lib.rs b/node/overseer/src/lib.rs index 1ce6a6fdb658..70dbe92b2432 100644 --- a/node/overseer/src/lib.rs +++ b/node/overseer/src/lib.rs @@ -62,6 +62,7 @@ use std::{ collections::{hash_map, HashMap}, fmt::{self, Debug}, + num::NonZeroUsize, pin::Pin, sync::Arc, time::Duration, @@ -112,7 +113,10 @@ pub use orchestra::{ /// Store 2 days worth of blocks, not accounting for forks, /// in the LRU cache. Assumes a 6-second block time. -pub const KNOWN_LEAVES_CACHE_SIZE: usize = 2 * 24 * 3600 / 6; +pub const KNOWN_LEAVES_CACHE_SIZE: NonZeroUsize = match NonZeroUsize::new(2 * 24 * 3600 / 6) { + Some(cap) => cap, + None => panic!("Known leaves cache size must be non-zero"), +}; #[cfg(test)] mod tests; diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index a9c9484b6eba..63a5f189a32a 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -69,11 +69,11 @@ gum = { package = "tracing-gum", path = "../gum/" } serde = { version = "1.0.137", features = ["derive"] } serde_json = "1.0.81" thiserror = "1.0.31" -kvdb = "0.11.0" -kvdb-rocksdb = { version = "0.15.2", optional = true } +kvdb = "0.12.0" +kvdb-rocksdb = { version = "0.16.0", optional = true } parity-db = { version = "0.3.16", optional = true } async-trait = "0.1.57" -lru = "0.7" +lru = "0.8" # Polkadot polkadot-node-core-parachains-inherent = { path = "../core/parachains-inherent" } diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index 6425ee7a7536..3619d05c7592 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -1192,9 +1192,11 @@ where justifications_protocol_name, _phantom: core::marker::PhantomData::, }; + let payload_provider = beefy_primitives::mmr::MmrRootProvider::new(client.clone()); let beefy_params = beefy_gadget::BeefyParams { client: client.clone(), backend: backend.clone(), + payload_provider, runtime: client.clone(), key_store: keystore_opt.clone(), network_params, @@ -1204,7 +1206,7 @@ where on_demand_justifications_handler: beefy_on_demand_justifications_handler, }; - let gadget = beefy_gadget::start_beefy_gadget::<_, _, _, _, _>(beefy_params); + let gadget = beefy_gadget::start_beefy_gadget::<_, _, _, _, _, _>(beefy_params); // Wococo's purpose is to be a testbed for BEEFY, so if it fails we'll // bring the node down with it to make sure it is noticed. diff --git a/node/service/src/parachains_db/upgrade.rs b/node/service/src/parachains_db/upgrade.rs index ad995f41ed82..73321ae04c09 100644 --- a/node/service/src/parachains_db/upgrade.rs +++ b/node/service/src/parachains_db/upgrade.rs @@ -121,7 +121,7 @@ fn rocksdb_migrate_from_version_0_to_1(path: &Path) -> Result<(), Error> { .to_str() .ok_or_else(|| super::other_io_error("Invalid database path".into()))?; let db_cfg = DatabaseConfig::with_columns(super::columns::v0::NUM_COLUMNS); - let db = Database::open(&db_cfg, db_path)?; + let mut db = Database::open(&db_cfg, db_path)?; db.add_column()?; db.add_column()?; diff --git a/node/subsystem-test-helpers/src/lib.rs b/node/subsystem-test-helpers/src/lib.rs index e2e61c2006d8..79f833b7558c 100644 --- a/node/subsystem-test-helpers/src/lib.rs +++ b/node/subsystem-test-helpers/src/lib.rs @@ -30,6 +30,7 @@ use sp_core::testing::TaskExecutor; use std::{ convert::Infallible, + future::Future, pin::Pin, sync::Arc, task::{Context, Poll, Waker}, @@ -391,6 +392,34 @@ macro_rules! arbitrary_order { }; } +/// Future that yields the execution once and resolves +/// immediately after. +/// +/// Useful when one wants to poll the background task to completion +/// before sending messages to it in order to avoid races. +pub struct Yield(bool); + +impl Yield { + /// Returns new `Yield` future. + pub fn new() -> Self { + Self(false) + } +} + +impl Future for Yield { + type Output = (); + + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + if !self.0 { + self.0 = true; + cx.waker().wake_by_ref(); + Poll::Pending + } else { + Poll::Ready(()) + } + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/node/subsystem-util/Cargo.toml b/node/subsystem-util/Cargo.toml index a3985a898849..26eca7aa8f1f 100644 --- a/node/subsystem-util/Cargo.toml +++ b/node/subsystem-util/Cargo.toml @@ -17,7 +17,7 @@ thiserror = "1.0.31" fatality = "0.0.6" gum = { package = "tracing-gum", path = "../gum" } derive_more = "0.99.17" -lru = "0.7.7" +lru = "0.8.0" polkadot-node-subsystem = {path = "../subsystem" } polkadot-node-jaeger = { path = "../jaeger" } @@ -32,8 +32,8 @@ 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" } -kvdb = "0.11.0" -parity-util-mem = { version = "0.11", default-features = false } +kvdb = "0.12.0" +parity-util-mem = { version = "0.12.0", default-features = false } parity-db = { version = "0.3.13" } [dev-dependencies] @@ -44,5 +44,5 @@ log = "0.4.17" polkadot-node-subsystem-test-helpers = { path = "../subsystem-test-helpers" } lazy_static = "1.4.0" polkadot-primitives-test-helpers = { path = "../../primitives/test-helpers" } -kvdb-shared-tests = "0.9.0" +kvdb-shared-tests = "0.10.0" tempfile = "3.1.0" diff --git a/node/subsystem-util/src/database.rs b/node/subsystem-util/src/database.rs index a6b31043302f..6f338b5d6440 100644 --- a/node/subsystem-util/src/database.rs +++ b/node/subsystem-util/src/database.rs @@ -16,7 +16,7 @@ //! Database trait for polkadot db. -pub use kvdb::{DBTransaction, DBValue, KeyValueDB}; +pub use kvdb::{DBKeyValue, DBTransaction, DBValue, KeyValueDB}; /// Database trait with ordered key capacity. pub trait Database: KeyValueDB { @@ -27,7 +27,7 @@ pub trait Database: KeyValueDB { /// Implementation for database supporting `KeyValueDB` already. pub mod kvdb_impl { - use super::{DBTransaction, DBValue, Database, KeyValueDB}; + use super::{DBKeyValue, DBTransaction, DBValue, Database, KeyValueDB}; use kvdb::{DBOp, IoStats, IoStatsKind}; use parity_util_mem::{MallocSizeOf, MallocSizeOfOps}; use std::{collections::BTreeSet, io::Result}; @@ -86,7 +86,7 @@ pub mod kvdb_impl { self.db.get(col, key) } - fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Option> { + fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Result> { self.ensure_is_indexed(col); self.db.get_by_prefix(col, prefix) } @@ -96,7 +96,7 @@ pub mod kvdb_impl { self.db.write(transaction) } - fn iter<'a>(&'a self, col: u32) -> Box, Box<[u8]>)> + 'a> { + fn iter<'a>(&'a self, col: u32) -> Box> + 'a> { self.ensure_is_indexed(col); self.db.iter(col) } @@ -105,15 +105,11 @@ pub mod kvdb_impl { &'a self, col: u32, prefix: &'a [u8], - ) -> Box, Box<[u8]>)> + 'a> { + ) -> Box> + 'a> { self.ensure_is_indexed(col); self.db.iter_with_prefix(col, prefix) } - fn restore(&self, _new_db: &str) -> Result<()> { - unimplemented!("restore is unsupported") - } - fn io_stats(&self, kind: IoStatsKind) -> IoStats { self.db.io_stats(kind) } @@ -122,7 +118,7 @@ pub mod kvdb_impl { self.db.has_key(col, key) } - fn has_prefix(&self, col: u32, prefix: &[u8]) -> bool { + fn has_prefix(&self, col: u32, prefix: &[u8]) -> Result { self.ensure_is_indexed(col); self.db.has_prefix(col, prefix) } @@ -138,8 +134,8 @@ pub mod kvdb_impl { /// Utilities for using parity-db database. pub mod paritydb_impl { - use super::{DBTransaction, DBValue, Database, KeyValueDB}; - use kvdb::{DBOp, IoStats, IoStatsKind}; + use super::{DBKeyValue, DBTransaction, DBValue, Database, KeyValueDB}; + use kvdb::DBOp; use parity_db::Db; use parking_lot::Mutex; use std::{collections::BTreeSet, io::Result, sync::Arc}; @@ -179,18 +175,20 @@ pub mod paritydb_impl { map_err(self.db.get(col as u8, key)) } - fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Option> { - self.iter_with_prefix(col, prefix).next().map(|(_, v)| v) + fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Result> { + self.iter_with_prefix(col, prefix) + .next() + .transpose() + .map(|mb| mb.map(|(_, v)| v)) } - fn iter<'a>(&'a self, col: u32) -> Box, Box<[u8]>)> + 'a> { - let mut iter = handle_err(self.db.iter(col as u8)); + fn iter<'a>(&'a self, col: u32) -> Box> + 'a> { + let mut iter = match self.db.iter(col as u8) { + Ok(iter) => iter, + Err(e) => return Box::new(std::iter::once(map_err(Err(e)))), + }; Box::new(std::iter::from_fn(move || { - if let Some((key, value)) = handle_err(iter.next()) { - Some((key.into_boxed_slice(), value.into_boxed_slice())) - } else { - None - } + iter.next().transpose().map(|r| map_err(r.map(|(k, v)| (k.into(), v)))) })) } @@ -198,39 +196,26 @@ pub mod paritydb_impl { &'a self, col: u32, prefix: &'a [u8], - ) -> Box, Box<[u8]>)> + 'a> { + ) -> Box> + 'a> { if prefix.len() == 0 { return self.iter(col) } - let mut iter = handle_err(self.db.iter(col as u8)); - handle_err(iter.seek(prefix)); + let mut iter = match self.db.iter(col as u8) { + Ok(iter) => iter, + Err(e) => return Box::new(std::iter::once(map_err(Err(e)))), + }; + if let Err(e) = iter.seek(prefix) { + return Box::new(std::iter::once(map_err(Err(e)))) + } Box::new(std::iter::from_fn(move || { - if let Some((key, value)) = handle_err(iter.next()) { - key.starts_with(prefix) - .then(|| (key.into_boxed_slice(), value.into_boxed_slice())) - } else { - None - } + iter.next().transpose().and_then(|r| { + map_err(r.map(|(k, v)| k.starts_with(prefix).then(|| (k.into(), v)))) + .transpose() + }) })) } - fn restore(&self, _new_db: &str) -> Result<()> { - unimplemented!("restore is unsupported") - } - - fn io_stats(&self, _kind: IoStatsKind) -> IoStats { - unimplemented!("io_stats not supported by parity_db"); - } - - fn has_key(&self, col: u32, key: &[u8]) -> Result { - map_err(self.db.get_size(col as u8, key).map(|r| r.is_some())) - } - - fn has_prefix(&self, col: u32, prefix: &[u8]) -> bool { - self.get_by_prefix(col, prefix).is_some() - } - - fn write(&self, transaction: DBTransaction) -> std::io::Result<()> { + fn write(&self, transaction: DBTransaction) -> Result<()> { let mut ops = transaction.ops.into_iter(); // TODO using a key iterator or native delete here would be faster. let mut current_prefix_iter: Option<(parity_db::BTreeIterator, u8, Vec)> = None; diff --git a/node/subsystem-util/src/rolling_session_window.rs b/node/subsystem-util/src/rolling_session_window.rs index dd9282b50fe5..0ff2dc6deb13 100644 --- a/node/subsystem-util/src/rolling_session_window.rs +++ b/node/subsystem-util/src/rolling_session_window.rs @@ -20,15 +20,17 @@ //! care about the state of particular blocks. pub use polkadot_node_primitives::{new_session_window_size, SessionWindowSize}; -use polkadot_primitives::v2::{Hash, SessionIndex, SessionInfo}; +use polkadot_primitives::v2::{BlockNumber, Hash, SessionIndex, SessionInfo}; use futures::channel::oneshot; use polkadot_node_subsystem::{ - errors::RuntimeApiError, - messages::{RuntimeApiMessage, RuntimeApiRequest}, + errors::{ChainApiError, RuntimeApiError}, + messages::{ChainApiMessage, RuntimeApiMessage, RuntimeApiRequest}, overseer, }; +const LOG_TARGET: &str = "parachain::rolling-session-window"; + /// Sessions unavailable in state to cache. #[derive(Debug, Clone, thiserror::Error)] pub enum SessionsUnavailableReason { @@ -38,9 +40,18 @@ pub enum SessionsUnavailableReason { /// The runtime API itself returned an error. #[error(transparent)] RuntimeApi(#[from] RuntimeApiError), + /// The chain API itself returned an error. + #[error(transparent)] + ChainApi(#[from] ChainApiError), /// Missing session info from runtime API for given `SessionIndex`. #[error("Missing session index {0:?}")] Missing(SessionIndex), + /// Missing last finalized block number. + #[error("Missing last finalized block number")] + MissingLastFinalizedBlock, + /// Missing last finalized block hash. + #[error("Missing last finalized block hash")] + MissingLastFinalizedBlockHash(BlockNumber), } /// Information about the sessions being fetched. @@ -98,11 +109,18 @@ impl RollingSessionWindow { block_hash: Hash, ) -> Result where - Sender: overseer::SubsystemSender, + Sender: overseer::SubsystemSender + + overseer::SubsystemSender, { let session_index = get_session_index_for_child(&mut sender, block_hash).await?; + let earliest_non_finalized_block_session = + Self::earliest_non_finalized_block_session(&mut sender).await?; - let window_start = session_index.saturating_sub(window_size.get() - 1); + // This will increase the session window to cover the full unfinalized chain. + let window_start = std::cmp::min( + session_index.saturating_sub(window_size.get() - 1), + earliest_non_finalized_block_session, + ); match load_all_sessions(&mut sender, block_hash, window_start, session_index).await { Err(kind) => Err(SessionsUnavailable { @@ -146,6 +164,87 @@ impl RollingSessionWindow { self.earliest_session + (self.session_info.len() as SessionIndex).saturating_sub(1) } + async fn earliest_non_finalized_block_session( + sender: &mut Sender, + ) -> Result + where + Sender: overseer::SubsystemSender + + overseer::SubsystemSender, + { + let last_finalized_height = { + let (tx, rx) = oneshot::channel(); + sender.send_message(ChainApiMessage::FinalizedBlockNumber(tx)).await; + match rx.await { + Ok(Ok(number)) => number, + Ok(Err(e)) => + return Err(SessionsUnavailable { + kind: SessionsUnavailableReason::ChainApi(e), + info: None, + }), + Err(err) => { + gum::warn!( + target: LOG_TARGET, + ?err, + "Failed fetching last finalized block number" + ); + return Err(SessionsUnavailable { + kind: SessionsUnavailableReason::MissingLastFinalizedBlock, + info: None, + }) + }, + } + }; + + let (tx, rx) = oneshot::channel(); + // We want to get the session index for the child of the last finalized block. + sender + .send_message(ChainApiMessage::FinalizedBlockHash(last_finalized_height, tx)) + .await; + let last_finalized_hash_parent = match rx.await { + Ok(Ok(maybe_hash)) => maybe_hash, + Ok(Err(e)) => + return Err(SessionsUnavailable { + kind: SessionsUnavailableReason::ChainApi(e), + info: None, + }), + Err(err) => { + gum::warn!(target: LOG_TARGET, ?err, "Failed fetching last finalized block hash"); + return Err(SessionsUnavailable { + kind: SessionsUnavailableReason::MissingLastFinalizedBlockHash( + last_finalized_height, + ), + info: None, + }) + }, + }; + + // Get the session in which the last finalized block was authored. + if let Some(last_finalized_hash_parent) = last_finalized_hash_parent { + let session = + match get_session_index_for_child(sender, last_finalized_hash_parent).await { + Ok(session_index) => session_index, + Err(err) => { + gum::warn!( + target: LOG_TARGET, + ?err, + ?last_finalized_hash_parent, + "Failed fetching session index" + ); + return Err(err) + }, + }; + + Ok(session) + } else { + return Err(SessionsUnavailable { + kind: SessionsUnavailableReason::MissingLastFinalizedBlockHash( + last_finalized_height, + ), + info: None, + }) + } + } + /// When inspecting a new import notification, updates the session info cache to match /// the session of the imported block's child. /// @@ -153,12 +252,18 @@ impl RollingSessionWindow { /// not change often and import notifications are expected to be typically increasing in session number. /// /// some backwards drift in session index is acceptable. - pub async fn cache_session_info_for_head( + pub async fn cache_session_info_for_head( &mut self, - sender: &mut impl overseer::SubsystemSender, + sender: &mut Sender, block_hash: Hash, - ) -> Result { + ) -> Result + where + Sender: overseer::SubsystemSender + + overseer::SubsystemSender, + { let session_index = get_session_index_for_child(sender, block_hash).await?; + let earliest_non_finalized_block_session = + Self::earliest_non_finalized_block_session(sender).await?; let old_window_start = self.earliest_session; @@ -171,7 +276,12 @@ impl RollingSessionWindow { let old_window_end = latest; - let window_start = session_index.saturating_sub(self.window_size.get() - 1); + // Ensure we keep sessions up to last finalized block by adjusting the window start. + // This will increase the session window to cover the full unfinalized chain. + let window_start = std::cmp::min( + session_index.saturating_sub(self.window_size.get() - 1), + earliest_non_finalized_block_session, + ); // keep some of the old window, if applicable. let overlap_start = window_start.saturating_sub(old_window_start); @@ -319,6 +429,14 @@ mod tests { parent_hash: Default::default(), }; + let finalized_header = Header { + digest: Default::default(), + extrinsics_root: Default::default(), + number: 0, + state_root: Default::default(), + parent_hash: Default::default(), + }; + let pool = TaskExecutor::new(); let (mut ctx, mut handle) = make_subsystem_context::(pool.clone()); @@ -358,6 +476,37 @@ mod tests { } ); + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( + s_tx, + )) => { + let _ = s_tx.send(Ok(finalized_header.number)); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( + block_number, + s_tx, + )) => { + assert_eq!(block_number, finalized_header.number); + let _ = s_tx.send(Ok(Some(finalized_header.hash()))); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionIndexForChild(s_tx), + )) => { + assert_eq!(h, finalized_header.hash()); + let _ = s_tx.send(Ok(session)); + } + ); + for i in expect_requests_from..=session { assert_matches!( handle.recv().await, @@ -485,6 +634,108 @@ mod tests { cache_session_info_test(0, 3, Some(window), 2); } + #[test] + fn any_session_stretch_for_unfinalized_chain() { + // Session index of the tip of our fake test chain. + let session: SessionIndex = 100; + let genesis_session: SessionIndex = 0; + + let header = Header { + digest: Default::default(), + extrinsics_root: Default::default(), + number: 5, + state_root: Default::default(), + parent_hash: Default::default(), + }; + + let finalized_header = Header { + digest: Default::default(), + extrinsics_root: Default::default(), + number: 0, + state_root: Default::default(), + parent_hash: Default::default(), + }; + + let pool = TaskExecutor::new(); + let (mut ctx, mut handle) = make_subsystem_context::<(), _>(pool.clone()); + + let hash = header.hash(); + + let test_fut = { + let sender = ctx.sender().clone(); + Box::pin(async move { + let res = RollingSessionWindow::new(sender, TEST_WINDOW_SIZE, hash).await; + assert!(res.is_err()); + }) + }; + + let aux_fut = Box::pin(async move { + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionIndexForChild(s_tx), + )) => { + assert_eq!(h, hash); + let _ = s_tx.send(Ok(session)); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( + s_tx, + )) => { + let _ = s_tx.send(Ok(finalized_header.number)); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( + block_number, + s_tx, + )) => { + assert_eq!(block_number, finalized_header.number); + let _ = s_tx.send(Ok(Some(finalized_header.hash()))); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionIndexForChild(s_tx), + )) => { + assert_eq!(h, finalized_header.hash()); + let _ = s_tx.send(Ok(0)); + } + ); + + // Unfinalized chain starts at geneisis block, so session 0 is how far we stretch. + for i in genesis_session..=session { + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionInfo(j, s_tx), + )) => { + assert_eq!(h, hash); + assert_eq!(i, j); + + let _ = s_tx.send(Ok(if i == session { + None + } else { + Some(dummy_session_info(i)) + })); + } + ); + } + }); + + futures::executor::block_on(futures::future::join(test_fut, aux_fut)); + } + #[test] fn any_session_unavailable_for_caching_means_no_change() { let session: SessionIndex = 6; @@ -498,6 +749,14 @@ mod tests { parent_hash: Default::default(), }; + let finalized_header = Header { + digest: Default::default(), + extrinsics_root: Default::default(), + number: 0, + state_root: Default::default(), + parent_hash: Default::default(), + }; + let pool = TaskExecutor::new(); let (mut ctx, mut handle) = make_subsystem_context::<(), _>(pool.clone()); @@ -523,6 +782,37 @@ mod tests { } ); + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( + s_tx, + )) => { + let _ = s_tx.send(Ok(finalized_header.number)); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( + block_number, + s_tx, + )) => { + assert_eq!(block_number, finalized_header.number); + let _ = s_tx.send(Ok(Some(finalized_header.hash()))); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionIndexForChild(s_tx), + )) => { + assert_eq!(h, finalized_header.hash()); + let _ = s_tx.send(Ok(session)); + } + ); + for i in start_session..=session { assert_matches!( handle.recv().await, @@ -586,6 +876,37 @@ mod tests { } ); + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( + s_tx, + )) => { + let _ = s_tx.send(Ok(header.number)); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( + block_number, + s_tx, + )) => { + assert_eq!(block_number, header.number); + let _ = s_tx.send(Ok(Some(header.hash()))); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionIndexForChild(s_tx), + )) => { + assert_eq!(h, header.hash()); + let _ = s_tx.send(Ok(session)); + } + ); + assert_matches!( handle.recv().await, AllMessages::RuntimeApi(RuntimeApiMessage::Request( diff --git a/node/subsystem-util/src/runtime/mod.rs b/node/subsystem-util/src/runtime/mod.rs index fc660a9dc6df..7fcae2c57b09 100644 --- a/node/subsystem-util/src/runtime/mod.rs +++ b/node/subsystem-util/src/runtime/mod.rs @@ -16,7 +16,7 @@ //! Convenient interface to runtime information. -use std::cmp::max; +use std::num::NonZeroUsize; use lru::LruCache; @@ -52,7 +52,7 @@ pub struct Config { pub keystore: Option, /// How many sessions should we keep in the cache? - pub session_cache_lru_size: usize, + pub session_cache_lru_size: NonZeroUsize, } /// Caching of session info. @@ -95,7 +95,7 @@ impl Default for Config { Self { keystore: None, // Usually we need to cache the current and the last session. - session_cache_lru_size: 2, + session_cache_lru_size: NonZeroUsize::new(2).expect("2 is larger than 0; qed"), } } } @@ -109,7 +109,10 @@ impl RuntimeInfo { /// Create with more elaborate configuration options. pub fn new_with_config(cfg: Config) -> Self { Self { - session_index_cache: LruCache::new(max(10, cfg.session_cache_lru_size)), + session_index_cache: LruCache::new( + cfg.session_cache_lru_size + .max(NonZeroUsize::new(10).expect("10 is larger than 0; qed")), + ), session_info_cache: LruCache::new(cfg.session_cache_lru_size), keystore: cfg.keystore, } diff --git a/node/test/performance-test/Cargo.toml b/node/test/performance-test/Cargo.toml index 783f5194a0f5..583b80e3c2f4 100644 --- a/node/test/performance-test/Cargo.toml +++ b/node/test/performance-test/Cargo.toml @@ -19,3 +19,6 @@ kusama-runtime = { path = "../../../runtime/kusama" } [[bin]] name = "gen-ref-constants" path = "src/gen_ref_constants.rs" + +[features] +runtime-benchmarks = ["kusama-runtime/runtime-benchmarks"] diff --git a/parachain/Cargo.toml b/parachain/Cargo.toml index 42ffbfab1fa6..c07ec98d7cb9 100644 --- a/parachain/Cargo.toml +++ b/parachain/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" # this crate for WASM. This is critical to avoid forcing all parachain WASM into implementing # various unnecessary Substrate-specific endpoints. parity-scale-codec = { version = "3.1.5", default-features = false, features = [ "derive" ] } -parity-util-mem = { version = "0.11.0", default-features = false, optional = true } +parity-util-mem = { version = "0.12.0", default-features = false, optional = true } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index d018cfdf9e54..67fc2d31cee8 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -27,7 +27,7 @@ trie = { package = "sp-trie", git = "https://github.com/paritytech/substrate", b bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } hex-literal = "0.3.4" -parity-util-mem = { version = "0.11.0", default-features = false, optional = true } +parity-util-mem = { version = "0.12.0", default-features = false, optional = true } [features] default = ["std"] diff --git a/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md b/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md index b63ea2bdcbf0..6b8e5ec03cf4 100644 --- a/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md +++ b/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md @@ -15,6 +15,13 @@ This design should result in a protocol that is: ## Protocol +Distributing disputes needs to be a reliable protocol. We would like to make as +sure as possible that our vote got properly delivered to all concerned +validators. For this to work, this subsystem won't be gossip based, but instead +will use a request/response protocol for application level confirmations. The +request will be the payload (the actual votes/statements), the response will +be the confirmation. See [below][#wire-format]. + ### Input [`DisputeDistributionMessage`][DisputeDistributionMessage] @@ -107,16 +114,7 @@ struct VotesResponse { } ``` -## Functionality - -Distributing disputes needs to be a reliable protocol. We would like to make as -sure as possible that our vote got properly delivered to all concerned -validators. For this to work, this subsystem won't be gossip based, but instead -will use a request/response protocol for application level confirmations. The -request will be the payload (the actual votes/statements), the response will -be the confirmation. See [above][#wire-format]. - -### Starting a Dispute +## Starting a Dispute A dispute is initiated once a node sends the first `DisputeRequest` wire message, which must contain an "invalid" vote and a "valid" vote. @@ -132,7 +130,7 @@ conflicting votes available, hence we have a valid dispute. Nodes will still need to check whether the disputing votes are somewhat current and not some stale ones. -### Participating in a Dispute +## Participating in a Dispute Upon receiving a `DisputeRequest` message, a dispute distribution will trigger the import of the received votes via the dispute coordinator @@ -144,13 +142,13 @@ except that if the local node deemed the candidate valid, the `SendDispute` message will contain a valid vote signed by our node and will contain the initially received `Invalid` vote. -Note, that we rely on the coordinator to check availability for spam protection -(see below). +Note, that we rely on `dispute-coordinator` to check validity of a dispute for spam +protection (see below). -### Sending of messages +## Sending of messages Starting and participating in a dispute are pretty similar from the perspective -of dispute distribution. Once we receive a `SendDispute` message we try to make +of dispute distribution. Once we receive a `SendDispute` message, we try to make sure to get the data out. We keep track of all the parachain validators that should see the message, which are all the parachain validators of the session where the dispute happened as they will want to participate in the dispute. In @@ -159,114 +157,185 @@ session (which might be the same or not and may change during the dispute). Those authorities will not participate in the dispute, but need to see the statements so they can include them in blocks. -We keep track of connected parachain validators and authorities and will issue -warnings in the logs if connected nodes are less than two thirds of the -corresponding sets. We also only consider a message transmitted, once we -received a confirmation message. If not, we will keep retrying getting that -message out as long as the dispute is deemed alive. To determine whether a -dispute is still alive we will issue a +### Reliability + +We only consider a message transmitted, once we received a confirmation message. +If not, we will keep retrying getting that message out as long as the dispute is +deemed alive. To determine whether a dispute is still alive we will ask the +`dispute-coordinator` for a list of all still active disputes via a `DisputeCoordinatorMessage::ActiveDisputes` message before each retry run. Once a dispute is no longer live, we will clean up the state accordingly. -### Reception & Spam Considerations - -Because we are not forwarding foreign statements, spam is less of an issue in -comparison to gossip based systems. Rate limiting should be implemented at the -substrate level, see -[#7750](https://github.com/paritytech/substrate/issues/7750). Still we should -make sure that it is not possible via spamming to prevent a dispute concluding -or worse from getting noticed. - -Considered attack vectors: - -1. Invalid disputes (candidate does not exist) could make us - run out of resources. E.g. if we recorded every statement, we could run out - of disk space eventually. -2. An attacker can just flood us with notifications on any notification - protocol, assuming flood protection is not effective enough, our unbounded - buffers can fill up and we will run out of memory eventually. -3. An attacker could participate in a valid dispute, but send its votes multiple - times. -4. Attackers could spam us at a high rate with invalid disputes. Our incoming - queue of requests could get monopolized by those malicious requests and we - won't be able to import any valid disputes and we could run out of resources, - if we tried to process them all in parallel. - -For tackling 1, we make sure to not occupy resources before we don't know a -candidate is available. So we will not record statements to disk until we -recovered availability for the candidate or know by some other means that the -dispute is legit. - -For 2, we will pick up on any dispute on restart, so assuming that any realistic -memory filling attack will take some time, we should be able to participate in a -dispute under such attacks. - -Importing/discarding redundant votes should be pretty quick, so measures with -regards to 4 should suffice to prevent 3, from doing any real harm. - -For 4, full monopolization of the incoming queue should not be possible assuming -substrate handles incoming requests in a somewhat fair way. Still we want some -defense mechanisms, at the very least we need to make sure to not exhaust -resources. - -The dispute coordinator will notify us on import about unavailable candidates or -otherwise invalid imports and we can disconnect from such peers/decrease their -reputation drastically. This alone should get us quite far with regards to queue -monopolization, as availability recovery is expected to fail relatively quickly -for unavailable data. - -Still if those spam messages come at a very high rate, we might still run out of -resources if we immediately call `DisputeCoordinatorMessage::ImportStatements` -on each one of them. Secondly with our assumption of 1/3 dishonest validators, -getting rid of all of them will take some time, depending on reputation timeouts -some of them might even be able to reconnect eventually. - -To mitigate those issues we will process dispute messages with a maximum -parallelism `N`. We initiate import processes for up to `N` candidates in -parallel. Once we reached `N` parallel requests we will start back pressuring on -the incoming requests. This saves us from resource exhaustion. - -To reduce impact of malicious nodes further, we can keep track from which nodes the -currently importing statements came from and will drop requests from nodes that -already have imports in flight. - -Honest nodes are not expected to send dispute statements at a high rate, but -even if they did: - -- we will import at least the first one and if it is valid it will trigger a - dispute, preventing finality. -- Chances are good that the first sent candidate from a peer is indeed the - oldest one (if they differ in age at all). -- for the dropped request any honest node will retry sending. -- there will be other nodes notifying us about that dispute as well. -- honest votes have a speed advantage on average. Apart from the very first - dispute statement for a candidate, which might cause the availability recovery - process, imports of honest votes will be super fast, while for spam imports - they will always take some time as we have to wait for availability to fail. - -So this general rate limit, that we drop requests from same peers if they come -faster than we can import the statements should not cause any problems for -honest nodes and is in their favor. - -Size of `N`: The larger `N` the better we can handle distributed flood attacks -(see previous paragraph), but we also get potentially more availability recovery -processes happening at the same time, which slows down the individual processes. -And we rather want to have one finish quickly than lots slowly at the same time. -On the other hand, valid disputes are expected to be rare, so if we ever exhaust -`N` it is very likely that this is caused by spam and spam recoveries don't cost -too much bandwidth due to empty responses. - -Considering that an attacker would need to attack many nodes in parallel to have -any effect, an `N` of 10 seems to be a good compromise. For honest requests, most -of those imports will likely concern the same candidate, and for dishonest ones -we get to disconnect from up to ten colluding adversaries at a time. - -For the size of the channel for incoming requests: Due to dropping of repeated -requests from same nodes we can make the channel relatively large without fear -of lots of spam requests sitting there wasting our time, even after we already -blocked a peer. For valid disputes, incoming requests can become bursty. On the -other hand we will also be very quick in processing them. A channel size of 100 -requests seems plenty and should be able to handle bursts adequately. +### Order + +We assume `SendDispute` messages are coming in an order of importance, hence +`dispute-distribution` will make sure to send out network messages in the same +order, even on retry. + +### Rate Limit + +For spam protection (see below), we employ an artificial rate limiting on sending +out messages in order to not hit the rate limit at the receiving side, which +would result in our messages getting dropped and our reputation getting reduced. + +## Reception + +As we shall see the receiving side is mostly about handling spam and ensuring +the dispute-coordinator learns about disputes as fast as possible. + +Goals for the receiving side: + +1. Get new disputes to the dispute-coordinator as fast as possible, so + prioritization can happen properly. +2. Batch votes per disputes as much as possible for good import performance. +3. Prevent malicious nodes exhausting node resources by sending lots of messages. +4. Prevent malicious nodes from sending so many messages/(fake) disputes, + preventing us from concluding good ones. +5. Limit ability of malicious nodes of delaying the vote import due to batching + logic. + +Goal 1 and 2 seem to be conflicting, but an easy compromise is possible: When +learning about a new dispute, we will import the vote immediately, making the +dispute coordinator aware and also getting immediate feedback on the validity. +Then if valid we can batch further incoming votes, with less time constraints as +the dispute-coordinator already knows about the dispute. + +Goal 3 and 4 are obviously very related and both can easily be solved via rate +limiting as we shall see below. Rate limits should already be implemented at the +substrate level, but [are not](https://github.com/paritytech/substrate/issues/7750) +at the time of writing. But even if they were, the enforced substrate limits would +likely not be configurable and thus would still be to high for our needs as we can +rely on the following observations: + +1. Each honest validator will only send one message (apart from duplicates on + timeout) per candidate/dispute. +2. An honest validator needs to fully recover availability and validate the + candidate for casting a vote. + +With these two observations, we can conclude that honest validators will usually +not send messages at a high rate. We can therefore enforce conservative rate +limits and thus minimize harm spamming malicious nodes can have. + +Before we dive into how rate limiting solves all spam issues elegantly, let's +discuss that honest behaviour further: + +What about session changes? Here we might have to inform a new validator set of +lots of already existing disputes at once. + +With observation 1) and a rate limit that is per peer, we are still good: + +Let's assume a rate limit of one message per 200ms per sender. This means 5 +messages from each validator per second. 5 messages means 5 disputes! +Conclusively, we will be able to conclude 5 disputes per second - no matter what +malicious actors are doing. This is assuming dispute messages are sent ordered, +but even if not perfectly ordered: On average it will be 5 disputes per second. + +This is good enough! All those disputes are valid ones and will result in +slashing and disabling of validators. Let's assume all of them conclude `valid`, +and we disable validators only after 100 raised concluding valid disputes, we +would still start disabling misbehaving validators in only 20 seconds. + +One could also think that in addition participation is expected to take longer, +which means on average we can import/conclude disputes faster than they are +generated - regardless of dispute spam. Unfortunately this is not necessarily +true: There might be parachains with very light load where recovery and +validation can be accomplished very quickly - maybe faster than we can import +those disputes. + +This is probably an argument for not imposing a too low rate limit, although the +issue is more general: Even without any rate limit, if an attacker generates +disputes at a very high rate, nodes will be having trouble keeping participation +up, hence the problem should be mitigated at a [more fundamental +layer](https://github.com/paritytech/polkadot/issues/5898). + +For nodes that have been offline for a while, the same argument as for session +changes holds, but matters even less: We assume 2/3 of nodes to be online, so +even if the worst case 1/3 offline happens and they could not import votes fast +enough (as argued above, they in fact can) it would not matter for consensus. + +### Rate Limiting + +As suggested previously, rate limiting allows to mitigate all threats that come +from malicious actors trying to overwhelm the system in order to get away without +a slash, when it comes to dispute-distribution. In this section we will explain +how in greater detail. + +The idea is to open a queue with limited size for each peer. We will process +incoming messages as fast as we can by doing the following: + +1. Check that the sending peer is actually a valid authority - otherwise drop + message and decrease reputation/disconnect. +2. Put message on the peer's queue, if queue is full - drop it. + +Every `RATE_LIMIT` seconds (or rather milliseconds), we pause processing +incoming requests to go a full circle and process one message from each queue. +Processing means `Batching` as explained in the next section. + +### Batching + +To achieve goal 2 we will batch incoming votes/messages together before passing +them on as a single batch to the `dispute-coordinator`. To adhere to goal 1 as +well, we will do the following: + +1. For an incoming message, we check whether we have an existing batch for that + candidate, if not we import directly to the dispute-coordinator, as we have + to assume this is concerning a new dispute. +2. We open a batch and start collecting incoming messages for that candidate, + instead of immediately forwarding. +4. We keep collecting votes in the batch until we receive less than + `MIN_KEEP_BATCH_ALIVE_VOTES` unique votes in the last `BATCH_COLLECTING_INTERVAL`. This is + important to accommodate for goal 5 and also 3. +5. We send the whole batch to the dispute-coordinator. + +This together with rate limiting explained above ensures we will be able to +process valid disputes: We can limit the number of simultaneous existing batches +to some high value, but can be rather certain that this limit will never be +reached - hence we won't drop valid disputes: + +Let's assume `MIN_KEEP_BATCH_ALIVE_VOTES` is 10, `BATCH_COLLECTING_INTERVAL` +is `500ms` and above `RATE_LIMIT` is `100ms`. 1/3 of validators are malicious, +so for 1000 this means around 330 malicious actors worst case. + +All those actors can send a message every `100ms`, that is 10 per second. This +means at the begining of an attack they can open up around 3300 batches. Each +containing two votes. So memory usage is still negligible. In reality it is even +less, as we also demand 10 new votes to trickle in per batch in order to keep it +alive, every `500ms`. Hence for the first second, each batch requires 20 votes +each. Each message is 2 votes, so this means 10 messages per batch. Hence to +keep those batches alive 10 attackers are needed for each batch. This reduces +the number of opened batches by a factor of 10: So we only have 330 batches in 1 +second - each containing 20 votes. + +The next second: In order to further grow memory usage, attackers have to +maintain 10 messages per batch and second. Number of batches equals the number +of attackers, each has 10 messages per second, all are needed to maintain the +batches in memory. Therefore we have a hard cap of around 330 (number of +malicious nodes) open batches. Each can be filled with number of malicious +actor's votes. So 330 batches with each 330 votes: Let's assume approximately 100 +bytes per signature/vote. This results in a worst case memory usage of 330 * 330 +* 100 ~= 10 MiB. + +For 10_000 validators, we are already in the Gigabyte range, which means that +with a validator set that large we might want to be more strict with the rate limit or +require a larger rate of incoming votes per batch to keep them alive. + +For a thousand validators a limit on batches of around 1000 should never be +reached in practice. Hence due to rate limiting we have a very good chance to +not ever having to drop a potential valid dispute due to some resource limit. + +Further safe guards are possible: The dispute-coordinator actually +confirms/denies imports. So once we receive a denial by the dispute-coordinator +for the initial imported votes, we can opt into flushing the batch immediately +and importing the votes. This swaps memory usage for more CPU usage, but if that +import is deemed invalid again we can immediately decrease the reputation of the +sending peers, so this should be a net win. For the time being we punt on this +for simplicity. + +Instead of filling batches to maximize memory usage, attackers could also try to +overwhelm the dispute coordinator by only sending votes for new candidates all +the time. This attack vector is mitigated also by above rate limit and +decreasing the peer's reputation on denial of the invalid imports by the +coordinator. ### Node Startup diff --git a/runtime/common/src/claims.rs b/runtime/common/src/claims.rs index cded9b289a4f..bb0663ec34f7 100644 --- a/runtime/common/src/claims.rs +++ b/runtime/common/src/claims.rs @@ -717,7 +717,7 @@ mod tests { assert_err, assert_noop, assert_ok, dispatch::{DispatchError::BadOrigin, GetDispatchInfo, Pays}, ord_parameter_types, parameter_types, - traits::{ExistenceRequirement, GenesisBuild}, + traits::{ExistenceRequirement, GenesisBuild, WithdrawReasons}, }; use pallet_balances; use sp_runtime::{ @@ -790,6 +790,8 @@ mod tests { parameter_types! { pub const MinVestedTransfer: u64 = 1; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Test { @@ -798,6 +800,7 @@ mod tests { type BlockNumberToBalance = Identity; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = (); + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 936feedde1c3..ac5fc69a28e4 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -52,6 +52,7 @@ pub use pallet_balances::Call as BalancesCall; pub use pallet_staking::StakerStatus; pub use pallet_timestamp::Call as TimestampCall; use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; +pub use sp_runtime::traits::Bounded; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -87,6 +88,8 @@ parameter_types! { /// that combined with `AdjustmentVariable`, we can recover from the minimum. /// See `multiplier_can_grow_from_zero`. pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 10u128); + /// The maximum amount of the multiplier. + pub MaximumMultiplier: Multiplier = Bounded::max_value(); /// Maximum length of block. Up to 5MB. pub BlockLength: limits::BlockLength = limits::BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); @@ -94,8 +97,13 @@ parameter_types! { /// Parameterized slow adjusting fee updated based on /// https://research.web3.foundation/en/latest/polkadot/overview/2-token-economics.html#-2.-slow-adjusting-mechanism -pub type SlowAdjustingFeeUpdate = - TargetedFeeAdjustment; +pub type SlowAdjustingFeeUpdate = TargetedFeeAdjustment< + R, + TargetBlockFullness, + AdjustmentVariable, + MinimumMultiplier, + MaximumMultiplier, +>; /// Implements the weight types for a runtime. /// It expects the passed runtime constants to contain a `weights` module. diff --git a/runtime/common/src/purchase.rs b/runtime/common/src/purchase.rs index 8c0fcebd5c12..52ad22bec2fb 100644 --- a/runtime/common/src/purchase.rs +++ b/runtime/common/src/purchase.rs @@ -474,8 +474,10 @@ mod tests { // or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use crate::purchase; use frame_support::{ - assert_noop, assert_ok, dispatch::DispatchError::BadOrigin, ord_parameter_types, - parameter_types, traits::Currency, + assert_noop, assert_ok, + dispatch::DispatchError::BadOrigin, + ord_parameter_types, parameter_types, + traits::{Currency, WithdrawReasons}, }; use pallet_balances::Error as BalancesError; use sp_runtime::{ @@ -550,6 +552,8 @@ mod tests { parameter_types! { pub const MinVestedTransfer: u64 = 1; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Test { @@ -558,6 +562,7 @@ mod tests { type BlockNumberToBalance = Identity; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = (); + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } diff --git a/runtime/kusama/src/governance/fellowship.rs b/runtime/kusama/src/governance/fellowship.rs index 66e2f6ee6d58..52ab8d0bebc8 100644 --- a/runtime/kusama/src/governance/fellowship.rs +++ b/runtime/kusama/src/governance/fellowship.rs @@ -314,6 +314,7 @@ impl pallet_referenda::Config for Runtime { type UndecidingTimeout = UndecidingTimeout; type AlarmInterval = AlarmInterval; type Tracks = TracksInfo; + type Preimages = Preimage; } pub type FellowshipCollectiveInstance = pallet_ranked_collective::Instance1; diff --git a/runtime/kusama/src/governance/mod.rs b/runtime/kusama/src/governance/mod.rs index 4dbf375f67f0..87cbfd7eea2f 100644 --- a/runtime/kusama/src/governance/mod.rs +++ b/runtime/kusama/src/governance/mod.rs @@ -91,4 +91,5 @@ impl pallet_referenda::Config for Runtime { type UndecidingTimeout = UndecidingTimeout; type AlarmInterval = AlarmInterval; type Tracks = TracksInfo; + type Preimages = Preimage; } diff --git a/runtime/kusama/src/governance/old.rs b/runtime/kusama/src/governance/old.rs index c16ca5eddd7a..9365c903198a 100644 --- a/runtime/kusama/src/governance/old.rs +++ b/runtime/kusama/src/governance/old.rs @@ -32,7 +32,6 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { - type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; @@ -74,14 +73,15 @@ impl pallet_democracy::Config for Runtime { // only do it once and it lasts only for the cooloff period. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; - type PreimageByteDeposit = PreimageByteDeposit; - type OperationalPreimageOrigin = pallet_collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; type WeightInfo = weights::pallet_democracy::WeightInfo; type MaxProposals = MaxProposals; + type Preimages = Preimage; + type MaxDeposits = ConstU32<100>; + type MaxBlacklisted = ConstU32<100>; } parameter_types! { diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index 48762d5e67ec..58a824ae1cc2 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -52,7 +52,7 @@ use frame_support::{ construct_runtime, parameter_types, traits::{ ConstU32, Contains, EitherOf, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, - LockIdentifier, PrivilegeCmp, + LockIdentifier, PrivilegeCmp, WithdrawReasons, }, weights::ConstantMultiplier, PalletId, RuntimeDebug, @@ -225,12 +225,10 @@ impl pallet_scheduler::Config for Runtime { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = OriginPrivilegeCmp; - type PreimageProvider = Preimage; - type NoPreimagePostponement = NoPreimagePostponement; + type Preimages = Preimage; } parameter_types! { - pub const PreimageMaxSize: u32 = 4096 * 1024; pub const PreimageBaseDeposit: Balance = deposit(2, 64); pub const PreimageByteDeposit: Balance = deposit(0, 1); } @@ -239,8 +237,7 @@ impl pallet_preimage::Config for Runtime { type WeightInfo = weights::pallet_preimage::WeightInfo; type RuntimeEvent = RuntimeEvent; type Currency = Balances; - type ManagerOrigin = EnsureRoot; // This might be too strong a requirenent? - type MaxSize = PreimageMaxSize; + type ManagerOrigin = EnsureRoot; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } @@ -934,6 +931,8 @@ impl pallet_society::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = 100 * CENTS; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -942,6 +941,7 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } @@ -1471,6 +1471,13 @@ pub type Executive = frame_executive::Executive< StakingMigrationV11OldPallet, >, pallet_staking::migrations::v12::MigrateToV12, + // "Bound uses of call" + pallet_preimage::migration::v1::Migration, + pallet_scheduler::migration::v3::MigrateToV4, + pallet_democracy::migrations::v1::Migration, + pallet_multisig::migrations::v1::MigrateToV1, + // "Properly migrate weights to v2" + parachains_configuration::migration::v3::MigrateToV3, ), >; /// The payload being signed in the transactions. diff --git a/runtime/kusama/src/weights/pallet_democracy.rs b/runtime/kusama/src/weights/pallet_democracy.rs index 76862dca3974..b9b4127c597e 100644 --- a/runtime/kusama/src/weights/pallet_democracy.rs +++ b/runtime/kusama/src/weights/pallet_democracy.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_democracy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 // Executed Command: @@ -32,13 +32,13 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ +// --output=./runtime/kusama/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_democracy`. @@ -49,134 +49,103 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(39_849_000 as u64) + Weight::from_ref_time(42_340_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy DepositOf (r:1 w:1) - /// The range of component `s` is `[0, 100]`. - fn second(s: u32, ) -> Weight { - Weight::from_ref_time(31_560_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(81_000 as u64).saturating_mul(s as u64)) + fn second() -> Weight { + Weight::from_ref_time(38_557_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn vote_new(r: u32, ) -> Weight { - Weight::from_ref_time(43_461_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(91_000 as u64).saturating_mul(r as u64)) + fn vote_new() -> Weight { + Weight::from_ref_time(48_480_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn vote_existing(r: u32, ) -> Weight { - Weight::from_ref_time(43_754_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(88_000 as u64).saturating_mul(r as u64)) + fn vote_existing() -> Weight { + Weight::from_ref_time(48_553_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(21_199_000 as u64) + Weight::from_ref_time(20_602_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) + // Storage: Democracy DepositOf (r:1 w:1) + // Storage: System Account (r:1 w:1) // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Blacklist (r:0 w:1) - // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:1 w:1) - /// The range of component `p` is `[1, 100]`. - fn blacklist(p: u32, ) -> Weight { - Weight::from_ref_time(55_593_000 as u64) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(161_000 as u64).saturating_mul(p as u64)) + fn blacklist() -> Weight { + Weight::from_ref_time(75_265_000 as u64) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) - /// The range of component `v` is `[1, 100]`. - fn external_propose(v: u32, ) -> Weight { - Weight::from_ref_time(14_747_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(13_000 as u64).saturating_mul(v as u64)) + fn external_propose() -> Weight { + Weight::from_ref_time(15_498_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(4_471_000 as u64) + Weight::from_ref_time(4_503_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(4_230_000 as u64) + Weight::from_ref_time(4_486_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(20_311_000 as u64) + Weight::from_ref_time(19_676_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) - /// The range of component `v` is `[0, 100]`. - fn veto_external(v: u32, ) -> Weight { - Weight::from_ref_time(22_052_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(26_000 as u64).saturating_mul(v as u64)) + fn veto_external() -> Weight { + Weight::from_ref_time(25_443_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `p` is `[1, 100]`. - fn cancel_proposal(p: u32, ) -> Weight { - Weight::from_ref_time(46_926_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(130_000 as u64).saturating_mul(p as u64)) + fn cancel_proposal() -> Weight { + Weight::from_ref_time(63_468_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(13_121_000 as u64) + Weight::from_ref_time(13_030_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Scheduler Lookup (r:1 w:1) - // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn cancel_queued(r: u32, ) -> Weight { - Weight::from_ref_time(27_805_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(1_112_000 as u64).saturating_mul(r as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:0) + /// The range of component `r` is `[0, 99]`. fn on_initialize_base(r: u32, ) -> Weight { - Weight::from_ref_time(9_815_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(1_996_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(5_941_000 as u64) + // Standard Error: 2_263 + .saturating_add(Weight::from_ref_time(2_136_731 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) @@ -186,36 +155,36 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy LastTabledWasExternal (r:1 w:0) // Storage: Democracy NextExternal (r:1 w:0) // Storage: Democracy PublicProps (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:0) + /// The range of component `r` is `[0, 99]`. fn on_initialize_base_with_launch_period(r: u32, ) -> Weight { - Weight::from_ref_time(12_343_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(2_001_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(8_085_000 as u64) + // Standard Error: 2_202 + .saturating_add(Weight::from_ref_time(2_143_624 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:3 w:3) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:2) + /// The range of component `r` is `[0, 99]`. fn delegate(r: u32, ) -> Weight { - Weight::from_ref_time(47_307_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(2_899_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(40_416_000 as u64) + // Standard Error: 4_125 + .saturating_add(Weight::from_ref_time(3_038_258 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(4 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(4 as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) } // Storage: Democracy VotingOf (r:2 w:2) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:2) + /// The range of component `r` is `[0, 99]`. fn undelegate(r: u32, ) -> Weight { - Weight::from_ref_time(27_872_000 as u64) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(2_861_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(24_459_000 as u64) + // Standard Error: 2_860 + .saturating_add(Weight::from_ref_time(2_984_453 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) @@ -223,76 +192,48 @@ impl pallet_democracy::WeightInfo for WeightInfo { } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(5_014_000 as u64) + Weight::from_ref_time(5_200_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Democracy Preimages (r:1 w:1) - /// The range of component `b` is `[0, 16384]`. - fn note_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(29_213_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - /// The range of component `b` is `[0, 16384]`. - fn note_imminent_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(21_778_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - // Storage: System Account (r:1 w:1) - /// The range of component `b` is `[0, 16384]`. - fn reap_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(36_642_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[0, 99]`. fn unlock_remove(r: u32, ) -> Weight { - Weight::from_ref_time(31_776_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(37_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(24_289_000 as u64) + // Standard Error: 2_579 + .saturating_add(Weight::from_ref_time(125_300 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[0, 99]`. fn unlock_set(r: u32, ) -> Weight { - Weight::from_ref_time(31_414_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(77_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(28_331_000 as u64) + // Standard Error: 755 + .saturating_add(Weight::from_ref_time(90_997 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[1, 100]`. fn remove_vote(r: u32, ) -> Weight { - Weight::from_ref_time(18_428_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(84_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(15_350_000 as u64) + // Standard Error: 1_015 + .saturating_add(Weight::from_ref_time(104_402 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[1, 100]`. fn remove_other_vote(r: u32, ) -> Weight { - Weight::from_ref_time(18_684_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(77_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(15_433_000 as u64) + // Standard Error: 980 + .saturating_add(Weight::from_ref_time(104_660 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/kusama/src/weights/pallet_preimage.rs b/runtime/kusama/src/weights/pallet_preimage.rs index 782deda50e27..2fc3687f4581 100644 --- a/runtime/kusama/src/weights/pallet_preimage.rs +++ b/runtime/kusama/src/weights/pallet_preimage.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 // Executed Command: @@ -32,103 +32,102 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ +// --output=./runtime/kusama/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_preimage`. pub struct WeightInfo(PhantomData); impl pallet_preimage::WeightInfo for WeightInfo { - // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) + Weight::from_ref_time(27_993_000 as u64) + // Standard Error: 5 + .saturating_add(Weight::from_ref_time(2_208 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + Weight::from_ref_time(19_503_000 as u64) + // Standard Error: 5 + .saturating_add(Weight::from_ref_time(2_264 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + Weight::from_ref_time(17_878_000 as u64) + // Standard Error: 2 + .saturating_add(Weight::from_ref_time(2_130 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(37_471_000 as u64) + Weight::from_ref_time(40_091_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(26_305_000 as u64) + Weight::from_ref_time(27_459_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(35_418_000 as u64) + Weight::from_ref_time(27_176_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(23_113_000 as u64) + Weight::from_ref_time(14_096_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(17_429_000 as u64) + Weight::from_ref_time(17_365_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(8_153_000 as u64) + Weight::from_ref_time(8_013_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(25_132_000 as u64) + Weight::from_ref_time(27_185_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(17_918_000 as u64) + Weight::from_ref_time(7_955_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(8_173_000 as u64) + Weight::from_ref_time(7_819_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/kusama/src/weights/pallet_scheduler.rs b/runtime/kusama/src/weights/pallet_scheduler.rs index f291bcd2c490..c6df2801dd69 100644 --- a/runtime/kusama/src/weights/pallet_scheduler.rs +++ b/runtime/kusama/src/weights/pallet_scheduler.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 // Executed Command: @@ -32,145 +32,66 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ +// --output=./runtime/kusama/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(11_217_000 as u64) - // Standard Error: 43_000 - .saturating_add(Weight::from_ref_time(19_456_000 as u64).saturating_mul(s as u64)) + // Storage: Scheduler IncompleteSince (r:1 w:1) + fn service_agendas_base() -> Weight { + Weight::from_ref_time(4_558_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(15_840_000 as u64) - // Standard Error: 23_000 - .saturating_add(Weight::from_ref_time(15_699_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[0, 50]`. + fn service_agenda_base(s: u32, ) -> Weight { + Weight::from_ref_time(3_715_000 as u64) + // Standard Error: 2_737 + .saturating_add(Weight::from_ref_time(624_353 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(10_761_000 as u64) - // Standard Error: 28_000 - .saturating_add(Weight::from_ref_time(17_063_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) + fn service_task_base() -> Weight { + Weight::from_ref_time(9_345_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(12_801_000 as u64) - // Standard Error: 27_000 - .saturating_add(Weight::from_ref_time(14_878_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(10_462_000 as u64) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(5_706_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[128, 4194304]`. + fn service_task_fetched(s: u32, ) -> Weight { + Weight::from_ref_time(20_078_000 as u64) + // Standard Error: 5 + .saturating_add(Weight::from_ref_time(1_153 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(9_952_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(3_762_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } - // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_named(s: u32, ) -> Weight { - Weight::from_ref_time(14_502_000 as u64) - // Standard Error: 14_000 - .saturating_add(Weight::from_ref_time(10_550_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + fn service_task_named() -> Weight { + Weight::from_ref_time(10_744_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:2 w:2) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic(s: u32, ) -> Weight { - Weight::from_ref_time(14_956_000 as u64) - // Standard Error: 12_000 - .saturating_add(Weight::from_ref_time(8_343_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) + fn service_task_periodic() -> Weight { + Weight::from_ref_time(9_556_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named(s: u32, ) -> Weight { - Weight::from_ref_time(13_862_000 as u64) - // Standard Error: 10_000 - .saturating_add(Weight::from_ref_time(7_398_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) + fn execute_dispatch_signed() -> Weight { + Weight::from_ref_time(4_130_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize(s: u32, ) -> Weight { - Weight::from_ref_time(14_529_000 as u64) - // Standard Error: 10_000 - .saturating_add(Weight::from_ref_time(6_467_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + fn execute_dispatch_unsigned() -> Weight { + Weight::from_ref_time(4_058_000 as u64) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. + /// The range of component `s` is `[0, 49]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(19_944_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(69_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(16_721_000 as u64) + // Standard Error: 3_319 + .saturating_add(Weight::from_ref_time(657_802 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -178,19 +99,19 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Lookup (r:0 w:1) /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(20_087_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(1_214_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_496_000 as u64) + // Standard Error: 1_368 + .saturating_add(Weight::from_ref_time(572_226 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. + /// The range of component `s` is `[0, 49]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(23_553_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(118_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_831_000 as u64) + // Standard Error: 3_559 + .saturating_add(Weight::from_ref_time(689_493 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -198,9 +119,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Agenda (r:1 w:1) /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(22_403_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(1_255_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(20_788_000 as u64) + // Standard Error: 1_758 + .saturating_add(Weight::from_ref_time(605_808 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/parachains/src/configuration.rs b/runtime/parachains/src/configuration.rs index bc97e84e95b5..2ebaff1b8282 100644 --- a/runtime/parachains/src/configuration.rs +++ b/runtime/parachains/src/configuration.rs @@ -285,7 +285,8 @@ impl> Default for HostConfiguration /// v1-v2: -pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(2); +/// v2-v3: +pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(3); + +pub mod v3 { + use super::*; + use frame_support::traits::OnRuntimeUpgrade; + use primitives::v2::{Balance, SessionIndex}; + + // Copied over from configuration.rs @ de9e147695b9f1be8bd44e07861a31e483c8343a and removed + // all the comments, and changed the Weight struct to OldWeight + #[derive(parity_scale_codec::Encode, parity_scale_codec::Decode, Debug)] + pub struct OldHostConfiguration { + pub max_code_size: u32, + pub max_head_data_size: u32, + pub max_upward_queue_count: u32, + pub max_upward_queue_size: u32, + pub max_upward_message_size: u32, + pub max_upward_message_num_per_candidate: u32, + pub hrmp_max_message_num_per_candidate: u32, + pub validation_upgrade_cooldown: BlockNumber, + pub validation_upgrade_delay: BlockNumber, + pub max_pov_size: u32, + pub max_downward_message_size: u32, + pub ump_service_total_weight: OldWeight, + pub hrmp_max_parachain_outbound_channels: u32, + pub hrmp_max_parathread_outbound_channels: u32, + pub hrmp_sender_deposit: Balance, + pub hrmp_recipient_deposit: Balance, + pub hrmp_channel_max_capacity: u32, + pub hrmp_channel_max_total_size: u32, + pub hrmp_max_parachain_inbound_channels: u32, + pub hrmp_max_parathread_inbound_channels: u32, + pub hrmp_channel_max_message_size: u32, + pub code_retention_period: BlockNumber, + pub parathread_cores: u32, + pub parathread_retries: u32, + pub group_rotation_frequency: BlockNumber, + pub chain_availability_period: BlockNumber, + pub thread_availability_period: BlockNumber, + pub scheduling_lookahead: u32, + pub max_validators_per_core: Option, + pub max_validators: Option, + pub dispute_period: SessionIndex, + pub dispute_post_conclusion_acceptance_period: BlockNumber, + pub dispute_max_spam_slots: u32, + pub dispute_conclusion_by_time_out_period: BlockNumber, + pub no_show_slots: u32, + pub n_delay_tranches: u32, + pub zeroth_delay_tranche_width: u32, + pub needed_approvals: u32, + pub relay_vrf_modulo_samples: u32, + pub ump_max_individual_weight: OldWeight, + pub pvf_checking_enabled: bool, + pub pvf_voting_ttl: SessionIndex, + pub minimum_validation_upgrade_delay: BlockNumber, + } + + impl> Default for OldHostConfiguration { + fn default() -> Self { + Self { + group_rotation_frequency: 1u32.into(), + chain_availability_period: 1u32.into(), + thread_availability_period: 1u32.into(), + no_show_slots: 1u32.into(), + validation_upgrade_cooldown: Default::default(), + validation_upgrade_delay: Default::default(), + code_retention_period: Default::default(), + max_code_size: Default::default(), + max_pov_size: Default::default(), + max_head_data_size: Default::default(), + parathread_cores: Default::default(), + parathread_retries: Default::default(), + scheduling_lookahead: Default::default(), + max_validators_per_core: Default::default(), + max_validators: None, + dispute_period: 6, + dispute_post_conclusion_acceptance_period: 100.into(), + dispute_max_spam_slots: 2, + dispute_conclusion_by_time_out_period: 200.into(), + n_delay_tranches: Default::default(), + zeroth_delay_tranche_width: Default::default(), + needed_approvals: Default::default(), + relay_vrf_modulo_samples: Default::default(), + max_upward_queue_count: Default::default(), + max_upward_queue_size: Default::default(), + max_downward_message_size: Default::default(), + ump_service_total_weight: OldWeight(Default::default()), + max_upward_message_size: Default::default(), + max_upward_message_num_per_candidate: Default::default(), + hrmp_sender_deposit: Default::default(), + hrmp_recipient_deposit: Default::default(), + hrmp_channel_max_capacity: Default::default(), + hrmp_channel_max_total_size: Default::default(), + hrmp_max_parachain_inbound_channels: Default::default(), + hrmp_max_parathread_inbound_channels: Default::default(), + hrmp_channel_max_message_size: Default::default(), + hrmp_max_parachain_outbound_channels: Default::default(), + hrmp_max_parathread_outbound_channels: Default::default(), + hrmp_max_message_num_per_candidate: Default::default(), + ump_max_individual_weight: OldWeight( + frame_support::weights::constants::WEIGHT_PER_MILLIS.ref_time() * 20, + ), + pvf_checking_enabled: false, + pvf_voting_ttl: 2u32.into(), + minimum_validation_upgrade_delay: 2.into(), + } + } + } + + pub struct MigrateToV3(sp_std::marker::PhantomData); + impl OnRuntimeUpgrade for MigrateToV3 { + fn on_runtime_upgrade() -> Weight { + if StorageVersion::get::>() == 2 { + let weight_consumed = migrate_to_v3::(); + + log::info!(target: configuration::LOG_TARGET, "MigrateToV3 executed successfully"); + STORAGE_VERSION.put::>(); + + weight_consumed + } else { + log::warn!(target: configuration::LOG_TARGET, "MigrateToV3 should be removed."); + T::DbWeight::get().reads(1) + } + } + } +} + +fn migrate_to_v3() -> Weight { + // Unusual formatting is justified: + // - make it easier to verify that fields assign what they supposed to assign. + // - this code is transient and will be removed after all migrations are done. + // - this code is important enough to optimize for legibility sacrificing consistency. + #[rustfmt::skip] + let translate = + |pre: v3::OldHostConfiguration>| -> +configuration::HostConfiguration> + { + super::HostConfiguration { +max_code_size : pre.max_code_size, +max_head_data_size : pre.max_head_data_size, +max_upward_queue_count : pre.max_upward_queue_count, +max_upward_queue_size : pre.max_upward_queue_size, +max_upward_message_size : pre.max_upward_message_size, +max_upward_message_num_per_candidate : pre.max_upward_message_num_per_candidate, +hrmp_max_message_num_per_candidate : pre.hrmp_max_message_num_per_candidate, +validation_upgrade_cooldown : pre.validation_upgrade_cooldown, +validation_upgrade_delay : pre.validation_upgrade_delay, +max_pov_size : pre.max_pov_size, +max_downward_message_size : pre.max_downward_message_size, +hrmp_max_parachain_outbound_channels : pre.hrmp_max_parachain_outbound_channels, +hrmp_max_parathread_outbound_channels : pre.hrmp_max_parathread_outbound_channels, +hrmp_sender_deposit : pre.hrmp_sender_deposit, +hrmp_recipient_deposit : pre.hrmp_recipient_deposit, +hrmp_channel_max_capacity : pre.hrmp_channel_max_capacity, +hrmp_channel_max_total_size : pre.hrmp_channel_max_total_size, +hrmp_max_parachain_inbound_channels : pre.hrmp_max_parachain_inbound_channels, +hrmp_max_parathread_inbound_channels : pre.hrmp_max_parathread_inbound_channels, +hrmp_channel_max_message_size : pre.hrmp_channel_max_message_size, +code_retention_period : pre.code_retention_period, +parathread_cores : pre.parathread_cores, +parathread_retries : pre.parathread_retries, +group_rotation_frequency : pre.group_rotation_frequency, +chain_availability_period : pre.chain_availability_period, +thread_availability_period : pre.thread_availability_period, +scheduling_lookahead : pre.scheduling_lookahead, +max_validators_per_core : pre.max_validators_per_core, +max_validators : pre.max_validators, +dispute_period : pre.dispute_period, +dispute_post_conclusion_acceptance_period: pre.dispute_post_conclusion_acceptance_period, +dispute_max_spam_slots : pre.dispute_max_spam_slots, +dispute_conclusion_by_time_out_period : pre.dispute_conclusion_by_time_out_period, +no_show_slots : pre.no_show_slots, +n_delay_tranches : pre.n_delay_tranches, +zeroth_delay_tranche_width : pre.zeroth_delay_tranche_width, +needed_approvals : pre.needed_approvals, +relay_vrf_modulo_samples : pre.relay_vrf_modulo_samples, +pvf_checking_enabled : pre.pvf_checking_enabled, +pvf_voting_ttl : pre.pvf_voting_ttl, +minimum_validation_upgrade_delay : pre.minimum_validation_upgrade_delay, + +ump_service_total_weight: Weight::from_ref_time(pre.ump_service_total_weight.0).set_proof_size(MAX_POV_SIZE as u64), +ump_max_individual_weight: Weight::from_ref_time(pre.ump_max_individual_weight.0).set_proof_size(MAX_POV_SIZE as u64), + } + }; + + if let Err(_) = as Store>::ActiveConfig::translate(|pre| pre.map(translate)) { + // `Err` is returned when the pre-migration type cannot be deserialized. This + // cannot happen if the migration runs correctly, i.e. against the expected version. + // + // This happening almost surely will lead to a panic somewhere else. Corruption seems + // to be unlikely to be caused by this. So we just log. Maybe it'll work out still? + log::error!( + target: configuration::LOG_TARGET, + "unexpected error when performing translation of the configuration type during storage upgrade to v2." + ); + } + + T::DbWeight::get().reads_writes(1, 1) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::mock::{new_test_ext, Test}; + + #[test] + fn v2_deserialized_from_actual_data() { + // Fetched at Kusama 14,703,780 (0x3b2c305d01bd4adf1973d32a2d55ca1260a55eea8dfb3168e317c57f2841fdf1) + // + // This exceeds the maximal line width length, but that's fine, since this is not code and + // doesn't need to be read and also leaving it as one line allows to easily copy it. + let raw_config = hex_literal::hex!["0000a000005000000a00000000c8000000c800000a0000000a000000100e0000580200000000500000c8000000e87648170000001e00000000000000005039278c0400000000000000000000005039278c0400000000000000000000e8030000009001001e00000000000000009001008070000000000000000000000a0000000a0000000a00000001000000010500000001c8000000060000005802000002000000580200000200000059000000000000001e0000002800000000c817a804000000000200000014000000"]; + + let v2 = + v3::OldHostConfiguration::::decode(&mut &raw_config[..]) + .unwrap(); + + // We check only a sample of the values here. If we missed any fields or messed up data types + // that would skew all the fields coming after. + assert_eq!(v2.max_code_size, 10_485_760); + assert_eq!(v2.validation_upgrade_cooldown, 3600); + assert_eq!(v2.max_pov_size, 5_242_880); + assert_eq!(v2.hrmp_channel_max_message_size, 102_400); + assert_eq!(v2.dispute_max_spam_slots, 2); + assert_eq!(v2.n_delay_tranches, 89); + assert_eq!(v2.ump_max_individual_weight, OldWeight(20_000_000_000)); + assert_eq!(v2.minimum_validation_upgrade_delay, 20); + } + + #[test] + fn test_migrate_to_v3() { + // Host configuration has lots of fields. However, in this migration we add only a couple of + // fields. The most important part to check are a couple of the last fields. We also pick + // extra fields to check arbitrarily, e.g. depending on their position (i.e. the middle) and + // also their type. + // + // We specify only the picked fields and the rest should be provided by the `Default` + // implementation. That implementation is copied over between the two types and should work + // fine. + let v2 = v3::OldHostConfiguration:: { + ump_max_individual_weight: OldWeight(0x71616e6f6e0au64), + needed_approvals: 69, + thread_availability_period: 55, + hrmp_recipient_deposit: 1337, + max_pov_size: 1111, + chain_availability_period: 33, + minimum_validation_upgrade_delay: 20, + ..Default::default() + }; + + new_test_ext(Default::default()).execute_with(|| { + // Implant the v2 version in the state. + frame_support::storage::unhashed::put_raw( + &configuration::ActiveConfig::::hashed_key(), + &v2.encode(), + ); + + migrate_to_v3::(); + + let v3 = configuration::ActiveConfig::::get(); + + #[rustfmt::skip] + { + assert_eq!(v2.max_code_size , v3.max_code_size); + assert_eq!(v2.max_head_data_size , v3.max_head_data_size); + assert_eq!(v2.max_upward_queue_count , v3.max_upward_queue_count); + assert_eq!(v2.max_upward_queue_size , v3.max_upward_queue_size); + assert_eq!(v2.max_upward_message_size , v3.max_upward_message_size); + assert_eq!(v2.max_upward_message_num_per_candidate , v3.max_upward_message_num_per_candidate); + assert_eq!(v2.hrmp_max_message_num_per_candidate , v3.hrmp_max_message_num_per_candidate); + assert_eq!(v2.validation_upgrade_cooldown , v3.validation_upgrade_cooldown); + assert_eq!(v2.validation_upgrade_delay , v3.validation_upgrade_delay); + assert_eq!(v2.max_pov_size , v3.max_pov_size); + assert_eq!(v2.max_downward_message_size , v3.max_downward_message_size); + assert_eq!(v2.hrmp_max_parachain_outbound_channels , v3.hrmp_max_parachain_outbound_channels); + assert_eq!(v2.hrmp_max_parathread_outbound_channels , v3.hrmp_max_parathread_outbound_channels); + assert_eq!(v2.hrmp_sender_deposit , v3.hrmp_sender_deposit); + assert_eq!(v2.hrmp_recipient_deposit , v3.hrmp_recipient_deposit); + assert_eq!(v2.hrmp_channel_max_capacity , v3.hrmp_channel_max_capacity); + assert_eq!(v2.hrmp_channel_max_total_size , v3.hrmp_channel_max_total_size); + assert_eq!(v2.hrmp_max_parachain_inbound_channels , v3.hrmp_max_parachain_inbound_channels); + assert_eq!(v2.hrmp_max_parathread_inbound_channels , v3.hrmp_max_parathread_inbound_channels); + assert_eq!(v2.hrmp_channel_max_message_size , v3.hrmp_channel_max_message_size); + assert_eq!(v2.code_retention_period , v3.code_retention_period); + assert_eq!(v2.parathread_cores , v3.parathread_cores); + assert_eq!(v2.parathread_retries , v3.parathread_retries); + assert_eq!(v2.group_rotation_frequency , v3.group_rotation_frequency); + assert_eq!(v2.chain_availability_period , v3.chain_availability_period); + assert_eq!(v2.thread_availability_period , v3.thread_availability_period); + assert_eq!(v2.scheduling_lookahead , v3.scheduling_lookahead); + assert_eq!(v2.max_validators_per_core , v3.max_validators_per_core); + assert_eq!(v2.max_validators , v3.max_validators); + assert_eq!(v2.dispute_period , v3.dispute_period); + assert_eq!(v2.dispute_post_conclusion_acceptance_period, v3.dispute_post_conclusion_acceptance_period); + assert_eq!(v2.dispute_max_spam_slots , v3.dispute_max_spam_slots); + assert_eq!(v2.dispute_conclusion_by_time_out_period , v3.dispute_conclusion_by_time_out_period); + assert_eq!(v2.no_show_slots , v3.no_show_slots); + assert_eq!(v2.n_delay_tranches , v3.n_delay_tranches); + assert_eq!(v2.zeroth_delay_tranche_width , v3.zeroth_delay_tranche_width); + assert_eq!(v2.needed_approvals , v3.needed_approvals); + assert_eq!(v2.relay_vrf_modulo_samples , v3.relay_vrf_modulo_samples); + assert_eq!(v2.pvf_checking_enabled , v3.pvf_checking_enabled); + assert_eq!(v2.pvf_voting_ttl , v3.pvf_voting_ttl); + assert_eq!(v2.minimum_validation_upgrade_delay , v3.minimum_validation_upgrade_delay); + + assert_eq!(v2.ump_service_total_weight, OldWeight(v3.ump_service_total_weight.ref_time())); + assert_eq!(v2.ump_max_individual_weight, OldWeight(v3.ump_max_individual_weight.ref_time())); + assert_eq!(v3.ump_service_total_weight.proof_size(), MAX_POV_SIZE as u64); + assert_eq!(v3.ump_max_individual_weight.proof_size(), MAX_POV_SIZE as u64); + }; // ; makes this a statement. `rustfmt::skip` cannot be put on an expression. + }); + } +} diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index 96a557712a76..8f6f2e4db47d 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -40,7 +40,10 @@ use beefy_primitives::crypto::AuthorityId as BeefyId; use frame_election_provider_support::{generate_solution_type, onchain, SequentialPhragmen}; use frame_support::{ construct_runtime, parameter_types, - traits::{EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, PrivilegeCmp}, + traits::{ + ConstU32, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, + PrivilegeCmp, WithdrawReasons, + }, weights::ConstantMultiplier, PalletId, RuntimeDebug, }; @@ -215,8 +218,7 @@ impl pallet_scheduler::Config for Runtime { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = OriginPrivilegeCmp; - type PreimageProvider = Preimage; - type NoPreimagePostponement = NoPreimagePostponement; + type Preimages = Preimage; } parameter_types! { @@ -230,7 +232,6 @@ impl pallet_preimage::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; - type MaxSize = PreimageMaxSize; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } @@ -615,7 +616,6 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { - type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; @@ -667,14 +667,15 @@ impl pallet_democracy::Config for Runtime { // only do it once and it lasts only for the cooloff period. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; - type PreimageByteDeposit = PreimageByteDeposit; - type OperationalPreimageOrigin = pallet_collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; type WeightInfo = weights::pallet_democracy::WeightInfo; type MaxProposals = MaxProposals; + type Preimages = Preimage; + type MaxDeposits = ConstU32<100>; + type MaxBlacklisted = ConstU32<100>; } parameter_types! { @@ -991,6 +992,8 @@ impl claims::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = 1 * DOLLARS; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -999,6 +1002,7 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } @@ -1560,6 +1564,13 @@ pub type Executive = frame_executive::Executive< StakingMigrationV11OldPallet, >, pallet_staking::migrations::v12::MigrateToV12, + // "Bound uses of call" + pallet_preimage::migration::v1::Migration, + pallet_scheduler::migration::v3::MigrateToV4, + pallet_democracy::migrations::v1::Migration, + pallet_multisig::migrations::v1::MigrateToV1, + // "Properly migrate weights to v2" + parachains_configuration::migration::v3::MigrateToV3, ), >; diff --git a/runtime/polkadot/src/weights/pallet_democracy.rs b/runtime/polkadot/src/weights/pallet_democracy.rs index 1e94d2b5deb0..136797abcf03 100644 --- a/runtime/polkadot/src/weights/pallet_democracy.rs +++ b/runtime/polkadot/src/weights/pallet_democracy.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_democracy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024 // Executed Command: @@ -32,13 +32,13 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ +// --output=./runtime/polkadot/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_democracy`. @@ -49,134 +49,103 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(40_082_000 as u64) + Weight::from_ref_time(42_048_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy DepositOf (r:1 w:1) - /// The range of component `s` is `[0, 100]`. - fn second(s: u32, ) -> Weight { - Weight::from_ref_time(31_920_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(82_000 as u64).saturating_mul(s as u64)) + fn second() -> Weight { + Weight::from_ref_time(38_631_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn vote_new(r: u32, ) -> Weight { - Weight::from_ref_time(43_490_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(82_000 as u64).saturating_mul(r as u64)) + fn vote_new() -> Weight { + Weight::from_ref_time(48_571_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn vote_existing(r: u32, ) -> Weight { - Weight::from_ref_time(42_957_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(88_000 as u64).saturating_mul(r as u64)) + fn vote_existing() -> Weight { + Weight::from_ref_time(48_556_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(20_818_000 as u64) + Weight::from_ref_time(20_104_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) + // Storage: Democracy DepositOf (r:1 w:1) + // Storage: System Account (r:1 w:1) // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Blacklist (r:0 w:1) - // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:1 w:1) - /// The range of component `p` is `[1, 100]`. - fn blacklist(p: u32, ) -> Weight { - Weight::from_ref_time(55_285_000 as u64) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(159_000 as u64).saturating_mul(p as u64)) + fn blacklist() -> Weight { + Weight::from_ref_time(75_289_000 as u64) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) - /// The range of component `v` is `[1, 100]`. - fn external_propose(v: u32, ) -> Weight { - Weight::from_ref_time(14_271_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(13_000 as u64).saturating_mul(v as u64)) + fn external_propose() -> Weight { + Weight::from_ref_time(15_734_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(4_129_000 as u64) + Weight::from_ref_time(4_507_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(4_215_000 as u64) + Weight::from_ref_time(4_603_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(20_440_000 as u64) + Weight::from_ref_time(19_816_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) - /// The range of component `v` is `[0, 100]`. - fn veto_external(v: u32, ) -> Weight { - Weight::from_ref_time(21_988_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(19_000 as u64).saturating_mul(v as u64)) + fn veto_external() -> Weight { + Weight::from_ref_time(25_722_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `p` is `[1, 100]`. - fn cancel_proposal(p: u32, ) -> Weight { - Weight::from_ref_time(46_176_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(134_000 as u64).saturating_mul(p as u64)) + fn cancel_proposal() -> Weight { + Weight::from_ref_time(63_768_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(12_940_000 as u64) + Weight::from_ref_time(13_183_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Scheduler Lookup (r:1 w:1) - // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn cancel_queued(r: u32, ) -> Weight { - Weight::from_ref_time(27_421_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(808_000 as u64).saturating_mul(r as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:0) + /// The range of component `r` is `[0, 99]`. fn on_initialize_base(r: u32, ) -> Weight { - Weight::from_ref_time(9_602_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(2_017_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(5_999_000 as u64) + // Standard Error: 2_072 + .saturating_add(Weight::from_ref_time(2_080_681 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) @@ -186,36 +155,36 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy LastTabledWasExternal (r:1 w:0) // Storage: Democracy NextExternal (r:1 w:0) // Storage: Democracy PublicProps (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:0) + /// The range of component `r` is `[0, 99]`. fn on_initialize_base_with_launch_period(r: u32, ) -> Weight { - Weight::from_ref_time(12_548_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(2_010_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(8_114_000 as u64) + // Standard Error: 2_286 + .saturating_add(Weight::from_ref_time(2_087_574 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:3 w:3) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:2) + /// The range of component `r` is `[0, 99]`. fn delegate(r: u32, ) -> Weight { - Weight::from_ref_time(46_940_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(2_877_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(40_509_000 as u64) + // Standard Error: 3_676 + .saturating_add(Weight::from_ref_time(2_999_395 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(4 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(4 as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) } // Storage: Democracy VotingOf (r:2 w:2) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:2) + /// The range of component `r` is `[0, 99]`. fn undelegate(r: u32, ) -> Weight { - Weight::from_ref_time(27_418_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(2_872_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(24_592_000 as u64) + // Standard Error: 2_506 + .saturating_add(Weight::from_ref_time(2_932_469 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) @@ -223,76 +192,48 @@ impl pallet_democracy::WeightInfo for WeightInfo { } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(4_996_000 as u64) + Weight::from_ref_time(5_070_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Democracy Preimages (r:1 w:1) - /// The range of component `b` is `[0, 16384]`. - fn note_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(28_635_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - /// The range of component `b` is `[0, 16384]`. - fn note_imminent_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(21_474_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - // Storage: System Account (r:1 w:1) - /// The range of component `b` is `[0, 16384]`. - fn reap_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(36_399_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[0, 99]`. fn unlock_remove(r: u32, ) -> Weight { - Weight::from_ref_time(32_139_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(30_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(23_860_000 as u64) + // Standard Error: 2_624 + .saturating_add(Weight::from_ref_time(129_209 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[0, 99]`. fn unlock_set(r: u32, ) -> Weight { - Weight::from_ref_time(31_338_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(70_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(28_512_000 as u64) + // Standard Error: 619 + .saturating_add(Weight::from_ref_time(84_477 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[1, 100]`. fn remove_vote(r: u32, ) -> Weight { - Weight::from_ref_time(18_298_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(78_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(15_612_000 as u64) + // Standard Error: 841 + .saturating_add(Weight::from_ref_time(98_567 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[1, 100]`. fn remove_other_vote(r: u32, ) -> Weight { - Weight::from_ref_time(18_456_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(75_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(15_282_000 as u64) + // Standard Error: 1_040 + .saturating_add(Weight::from_ref_time(104_928 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/polkadot/src/weights/pallet_preimage.rs b/runtime/polkadot/src/weights/pallet_preimage.rs index 15606f560519..bd316e310277 100644 --- a/runtime/polkadot/src/weights/pallet_preimage.rs +++ b/runtime/polkadot/src/weights/pallet_preimage.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024 // Executed Command: @@ -32,103 +32,102 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ +// --output=./runtime/polkadot/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_preimage`. pub struct WeightInfo(PhantomData); impl pallet_preimage::WeightInfo for WeightInfo { - // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) + Weight::from_ref_time(28_326_000 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(Weight::from_ref_time(2_116 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) + Weight::from_ref_time(20_011_000 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(Weight::from_ref_time(2_114 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + Weight::from_ref_time(18_805_000 as u64) + // Standard Error: 1 + .saturating_add(Weight::from_ref_time(2_116 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(40_028_000 as u64) + Weight::from_ref_time(39_007_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(27_637_000 as u64) + Weight::from_ref_time(27_523_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(37_505_000 as u64) + Weight::from_ref_time(26_477_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(26_628_000 as u64) + Weight::from_ref_time(13_236_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(17_156_000 as u64) + Weight::from_ref_time(17_975_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(8_109_000 as u64) + Weight::from_ref_time(8_295_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(27_209_000 as u64) + Weight::from_ref_time(26_186_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(17_931_000 as u64) + Weight::from_ref_time(8_176_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(7_951_000 as u64) + Weight::from_ref_time(8_005_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/polkadot/src/weights/pallet_scheduler.rs b/runtime/polkadot/src/weights/pallet_scheduler.rs index 6103794df8a5..9446fdc5efec 100644 --- a/runtime/polkadot/src/weights/pallet_scheduler.rs +++ b/runtime/polkadot/src/weights/pallet_scheduler.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024 // Executed Command: @@ -32,145 +32,69 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ +// --output=./runtime/polkadot/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(15_177_000 as u64) - // Standard Error: 21_000 - .saturating_add(Weight::from_ref_time(18_354_000 as u64).saturating_mul(s as u64)) + // Storage: Scheduler IncompleteSince (r:1 w:1) + fn service_agendas_base() -> Weight { + Weight::from_ref_time(4_522_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(12_632_000 as u64) - // Standard Error: 23_000 - .saturating_add(Weight::from_ref_time(14_845_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[0, 50]`. + fn service_agenda_base(s: u32, ) -> Weight { + Weight::from_ref_time(3_859_000 as u64) + // Standard Error: 2_692 + .saturating_add(Weight::from_ref_time(618_992 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(13_757_000 as u64) - // Standard Error: 20_000 - .saturating_add(Weight::from_ref_time(15_871_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) + fn service_task_base() -> Weight { + Weight::from_ref_time(12_288_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(15_338_000 as u64) - // Standard Error: 16_000 - .saturating_add(Weight::from_ref_time(13_610_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(10_335_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(5_073_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(10_095_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(3_021_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[128, 4194304]`. + fn service_task_fetched(s: u32, ) -> Weight { + Weight::from_ref_time(23_105_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_126 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_named(s: u32, ) -> Weight { - Weight::from_ref_time(15_328_000 as u64) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(9_601_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic(s: u32, ) -> Weight { - Weight::from_ref_time(18_306_000 as u64) - // Standard Error: 11_000 - .saturating_add(Weight::from_ref_time(7_155_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + fn service_task_named() -> Weight { + Weight::from_ref_time(13_382_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named(s: u32, ) -> Weight { - Weight::from_ref_time(16_079_000 as u64) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(6_321_000 as u64).saturating_mul(s as u64)) + fn service_task_periodic() -> Weight { + Weight::from_ref_time(19_246_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize(s: u32, ) -> Weight { - Weight::from_ref_time(16_074_000 as u64) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(5_352_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + fn execute_dispatch_signed() -> Weight { + Weight::from_ref_time(3_714_000 as u64) + } + fn execute_dispatch_unsigned() -> Weight { + Weight::from_ref_time(3_667_000 as u64) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. + /// The range of component `s` is `[0, 49]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(19_480_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(76_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(16_556_000 as u64) + // Standard Error: 3_431 + .saturating_add(Weight::from_ref_time(659_506 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -178,19 +102,19 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Lookup (r:0 w:1) /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(19_669_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(892_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(18_922_000 as u64) + // Standard Error: 1_665 + .saturating_add(Weight::from_ref_time(586_420 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. + /// The range of component `s` is `[0, 49]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(24_633_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(81_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_633_000 as u64) + // Standard Error: 3_740 + .saturating_add(Weight::from_ref_time(692_772 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -198,9 +122,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Agenda (r:1 w:1) /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(22_707_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(922_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(20_220_000 as u64) + // Standard Error: 2_111 + .saturating_add(Weight::from_ref_time(622_452 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index 94677cc07290..ac247248b9ea 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -55,7 +55,7 @@ use frame_support::{ construct_runtime, parameter_types, traits::{ Contains, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, - PrivilegeCmp, + PrivilegeCmp, WithdrawReasons, }, weights::ConstantMultiplier, PalletId, RuntimeDebug, @@ -70,8 +70,8 @@ use sp_mmr_primitives as mmr; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{ - AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, Extrinsic as ExtrinsicT, - Keccak256, OpaqueKeys, SaturatedConversion, Verify, + AccountIdLookup, BlakeTwo256, Block as BlockT, ConstU32, ConvertInto, + Extrinsic as ExtrinsicT, Keccak256, OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, ApplyExtrinsicResult, KeyTypeId, Perbill, Percent, Permill, @@ -216,12 +216,10 @@ impl pallet_scheduler::Config for Runtime { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = OriginPrivilegeCmp; - type PreimageProvider = Preimage; - type NoPreimagePostponement = NoPreimagePostponement; + type Preimages = Preimage; } parameter_types! { - pub const PreimageMaxSize: u32 = 4096 * 1024; pub const PreimageBaseDeposit: Balance = deposit(2, 64); pub const PreimageByteDeposit: Balance = deposit(0, 1); } @@ -231,7 +229,6 @@ impl pallet_preimage::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; - type MaxSize = PreimageMaxSize; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } @@ -399,7 +396,6 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { - type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; @@ -441,14 +437,15 @@ impl pallet_democracy::Config for Runtime { // only do it once and it lasts only for the cooloff period. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; - type PreimageByteDeposit = PreimageByteDeposit; - type OperationalPreimageOrigin = pallet_collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; type WeightInfo = weights::pallet_democracy::WeightInfo; type MaxProposals = MaxProposals; + type Preimages = Preimage; + type MaxDeposits = ConstU32<100>; + type MaxBlacklisted = ConstU32<100>; } parameter_types! { @@ -860,6 +857,8 @@ impl pallet_society::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = 100 * CENTS; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -868,6 +867,7 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } @@ -1257,7 +1257,7 @@ impl BeefyDataProvider for ParasProvider { .filter_map(|id| Paras::para_head(&id).map(|head| (id.into(), head.0))) .collect(); para_heads.sort(); - beefy_merkle_tree::merkle_root::, _, _>( + beefy_merkle_tree::merkle_root::<::Hashing, _>( para_heads.into_iter().map(|pair| pair.encode()), ) .into() @@ -1453,6 +1453,15 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, + ( + // "Bound uses of call" + pallet_preimage::migration::v1::Migration, + pallet_scheduler::migration::v3::MigrateToV4, + pallet_democracy::migrations::v1::Migration, + pallet_multisig::migrations::v1::MigrateToV1, + // "Properly migrate weights to v2" + parachains_configuration::migration::v3::MigrateToV3, + ), >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; diff --git a/runtime/rococo/src/weights/pallet_democracy.rs b/runtime/rococo/src/weights/pallet_democracy.rs index 317b0d4bb0a1..453385b594e7 100644 --- a/runtime/rococo/src/weights/pallet_democracy.rs +++ b/runtime/rococo/src/weights/pallet_democracy.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_democracy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-08-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 // Executed Command: @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/rococo/src/weights/pallet_democracy.rs +// --output=./runtime/rococo/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -49,134 +49,103 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(37_453_000 as u64) + Weight::from_ref_time(41_783_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy DepositOf (r:1 w:1) - /// The range of component `s` is `[0, 100]`. - fn second(s: u32, ) -> Weight { - Weight::from_ref_time(27_807_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(69_000 as u64).saturating_mul(s as u64)) + fn second() -> Weight { + Weight::from_ref_time(38_362_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn vote_new(r: u32, ) -> Weight { - Weight::from_ref_time(35_336_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(120_000 as u64).saturating_mul(r as u64)) + fn vote_new() -> Weight { + Weight::from_ref_time(48_307_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn vote_existing(r: u32, ) -> Weight { - Weight::from_ref_time(35_107_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(123_000 as u64).saturating_mul(r as u64)) + fn vote_existing() -> Weight { + Weight::from_ref_time(48_500_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(17_752_000 as u64) + Weight::from_ref_time(20_294_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) + // Storage: Democracy DepositOf (r:1 w:1) + // Storage: System Account (r:1 w:1) // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Blacklist (r:0 w:1) - // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:1 w:1) - /// The range of component `p` is `[1, 100]`. - fn blacklist(p: u32, ) -> Weight { - Weight::from_ref_time(52_116_000 as u64) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(194_000 as u64).saturating_mul(p as u64)) + fn blacklist() -> Weight { + Weight::from_ref_time(75_191_000 as u64) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) - /// The range of component `v` is `[1, 100]`. - fn external_propose(v: u32, ) -> Weight { - Weight::from_ref_time(10_194_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(10_000 as u64).saturating_mul(v as u64)) + fn external_propose() -> Weight { + Weight::from_ref_time(16_369_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(3_700_000 as u64) + Weight::from_ref_time(4_767_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(3_713_000 as u64) + Weight::from_ref_time(4_866_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(17_441_000 as u64) + Weight::from_ref_time(19_986_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) - /// The range of component `v` is `[0, 100]`. - fn veto_external(v: u32, ) -> Weight { - Weight::from_ref_time(18_536_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(42_000 as u64).saturating_mul(v as u64)) + fn veto_external() -> Weight { + Weight::from_ref_time(25_291_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `p` is `[1, 100]`. - fn cancel_proposal(p: u32, ) -> Weight { - Weight::from_ref_time(42_174_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(164_000 as u64).saturating_mul(p as u64)) + fn cancel_proposal() -> Weight { + Weight::from_ref_time(63_703_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(11_892_000 as u64) + Weight::from_ref_time(13_235_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Scheduler Lookup (r:1 w:1) - // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn cancel_queued(r: u32, ) -> Weight { - Weight::from_ref_time(23_252_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(2_242_000 as u64).saturating_mul(r as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:0) + /// The range of component `r` is `[0, 99]`. fn on_initialize_base(r: u32, ) -> Weight { - Weight::from_ref_time(1_457_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(2_956_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(5_980_000 as u64) + // Standard Error: 2_131 + .saturating_add(Weight::from_ref_time(2_104_197 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) @@ -186,36 +155,36 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy LastTabledWasExternal (r:1 w:0) // Storage: Democracy NextExternal (r:1 w:0) // Storage: Democracy PublicProps (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:0) + /// The range of component `r` is `[0, 99]`. fn on_initialize_base_with_launch_period(r: u32, ) -> Weight { - Weight::from_ref_time(6_240_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(2_963_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(8_351_000 as u64) + // Standard Error: 2_308 + .saturating_add(Weight::from_ref_time(2_117_411 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:3 w:3) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:2) + /// The range of component `r` is `[0, 99]`. fn delegate(r: u32, ) -> Weight { - Weight::from_ref_time(34_480_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(3_908_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(40_303_000 as u64) + // Standard Error: 3_789 + .saturating_add(Weight::from_ref_time(3_031_594 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(4 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(4 as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) } // Storage: Democracy VotingOf (r:2 w:2) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:2) + /// The range of component `r` is `[0, 99]`. fn undelegate(r: u32, ) -> Weight { - Weight::from_ref_time(17_446_000 as u64) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(3_917_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(24_342_000 as u64) + // Standard Error: 2_624 + .saturating_add(Weight::from_ref_time(2_962_125 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) @@ -223,76 +192,48 @@ impl pallet_democracy::WeightInfo for WeightInfo { } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(3_727_000 as u64) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - /// The range of component `b` is `[0, 16384]`. - fn note_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(25_720_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - /// The range of component `b` is `[0, 16384]`. - fn note_imminent_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(17_884_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - // Storage: System Account (r:1 w:0) - /// The range of component `b` is `[0, 16384]`. - fn reap_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(24_695_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) + Weight::from_ref_time(5_811_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[0, 99]`. fn unlock_remove(r: u32, ) -> Weight { - Weight::from_ref_time(22_207_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(36_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(22_894_000 as u64) + // Standard Error: 2_967 + .saturating_add(Weight::from_ref_time(142_001 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[0, 99]`. fn unlock_set(r: u32, ) -> Weight { - Weight::from_ref_time(21_561_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(110_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(28_227_000 as u64) + // Standard Error: 673 + .saturating_add(Weight::from_ref_time(87_748 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[1, 100]`. fn remove_vote(r: u32, ) -> Weight { - Weight::from_ref_time(13_204_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(105_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(15_578_000 as u64) + // Standard Error: 1_035 + .saturating_add(Weight::from_ref_time(105_378 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[1, 100]`. fn remove_other_vote(r: u32, ) -> Weight { - Weight::from_ref_time(12_994_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(106_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(15_542_000 as u64) + // Standard Error: 1_104 + .saturating_add(Weight::from_ref_time(109_552 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/rococo/src/weights/pallet_preimage.rs b/runtime/rococo/src/weights/pallet_preimage.rs index 5268e8054a13..1755de2b34e6 100644 --- a/runtime/rococo/src/weights/pallet_preimage.rs +++ b/runtime/rococo/src/weights/pallet_preimage.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-08-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 // Executed Command: @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/rococo/src/weights/pallet_preimage.rs +// --output=./runtime/rococo/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -44,91 +44,90 @@ use sp_std::marker::PhantomData; /// Weight functions for `pallet_preimage`. pub struct WeightInfo(PhantomData); impl pallet_preimage::WeightInfo for WeightInfo { - // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) + Weight::from_ref_time(29_017_000 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(Weight::from_ref_time(2_113 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + Weight::from_ref_time(19_793_000 as u64) + // Standard Error: 1 + .saturating_add(Weight::from_ref_time(2_115 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + Weight::from_ref_time(18_854_000 as u64) + // Standard Error: 1 + .saturating_add(Weight::from_ref_time(2_115 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(35_236_000 as u64) + Weight::from_ref_time(38_886_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(23_396_000 as u64) + Weight::from_ref_time(27_017_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(33_944_000 as u64) + Weight::from_ref_time(25_041_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(22_151_000 as u64) + Weight::from_ref_time(13_933_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(16_617_000 as u64) + Weight::from_ref_time(17_760_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(6_552_000 as u64) + Weight::from_ref_time(8_816_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(23_787_000 as u64) + Weight::from_ref_time(25_068_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(16_327_000 as u64) + Weight::from_ref_time(8_917_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(6_289_000 as u64) + Weight::from_ref_time(8_915_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/rococo/src/weights/pallet_scheduler.rs b/runtime/rococo/src/weights/pallet_scheduler.rs index 06a77fcee9cb..ae9dc6426622 100644 --- a/runtime/rococo/src/weights/pallet_scheduler.rs +++ b/runtime/rococo/src/weights/pallet_scheduler.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-08-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 // Executed Command: @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/rococo/src/weights/pallet_scheduler.rs +// --output=./runtime/rococo/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -44,133 +44,57 @@ use sp_std::marker::PhantomData; /// Weight functions for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(1_256_000 as u64) - // Standard Error: 42_000 - .saturating_add(Weight::from_ref_time(26_925_000 as u64).saturating_mul(s as u64)) + // Storage: Scheduler IncompleteSince (r:1 w:1) + fn service_agendas_base() -> Weight { + Weight::from_ref_time(4_700_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(921_000 as u64) - // Standard Error: 35_000 - .saturating_add(Weight::from_ref_time(21_922_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[0, 50]`. + fn service_agenda_base(s: u32, ) -> Weight { + Weight::from_ref_time(3_868_000 as u64) + // Standard Error: 2_747 + .saturating_add(Weight::from_ref_time(629_992 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 62_000 - .saturating_add(Weight::from_ref_time(24_926_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) + fn service_task_base() -> Weight { + Weight::from_ref_time(12_316_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(10_674_000 as u64) - // Standard Error: 31_000 - .saturating_add(Weight::from_ref_time(20_631_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(2_607_000 as u64) - // Standard Error: 20_000 - .saturating_add(Weight::from_ref_time(10_009_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(3_381_000 as u64) - // Standard Error: 17_000 - .saturating_add(Weight::from_ref_time(7_945_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[128, 4194304]`. + fn service_task_fetched(s: u32, ) -> Weight { + Weight::from_ref_time(24_103_000 as u64) + // Standard Error: 5 + .saturating_add(Weight::from_ref_time(1_154 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_named(s: u32, ) -> Weight { - Weight::from_ref_time(6_676_000 as u64) - // Standard Error: 25_000 - .saturating_add(Weight::from_ref_time(16_966_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic(s: u32, ) -> Weight { - Weight::from_ref_time(8_899_000 as u64) - // Standard Error: 24_000 - .saturating_add(Weight::from_ref_time(14_630_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + fn service_task_named() -> Weight { + Weight::from_ref_time(13_408_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named(s: u32, ) -> Weight { - Weight::from_ref_time(8_583_000 as u64) - // Standard Error: 19_000 - .saturating_add(Weight::from_ref_time(12_228_000 as u64).saturating_mul(s as u64)) + fn service_task_periodic() -> Weight { + Weight::from_ref_time(19_302_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize(s: u32, ) -> Weight { - Weight::from_ref_time(8_544_000 as u64) - // Standard Error: 19_000 - .saturating_add(Weight::from_ref_time(11_364_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + fn execute_dispatch_signed() -> Weight { + Weight::from_ref_time(3_885_000 as u64) + } + fn execute_dispatch_unsigned() -> Weight { + Weight::from_ref_time(4_037_000 as u64) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. + /// The range of component `s` is `[0, 49]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(19_060_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(46_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(16_768_000 as u64) + // Standard Error: 3_650 + .saturating_add(Weight::from_ref_time(667_428 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -178,19 +102,19 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Lookup (r:0 w:1) /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(17_694_000 as u64) - // Standard Error: 7_000 - .saturating_add(Weight::from_ref_time(2_368_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_239_000 as u64) + // Standard Error: 1_456 + .saturating_add(Weight::from_ref_time(578_125 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. + /// The range of component `s` is `[0, 49]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(22_258_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(60_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_065_000 as u64) + // Standard Error: 4_027 + .saturating_add(Weight::from_ref_time(719_766 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -198,9 +122,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Agenda (r:1 w:1) /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(18_882_000 as u64) - // Standard Error: 7_000 - .saturating_add(Weight::from_ref_time(2_379_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(20_039_000 as u64) + // Standard Error: 2_179 + .saturating_add(Weight::from_ref_time(627_335 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/test-runtime/src/lib.rs b/runtime/test-runtime/src/lib.rs index 2eade55e3877..a43e13eb015e 100644 --- a/runtime/test-runtime/src/lib.rs +++ b/runtime/test-runtime/src/lib.rs @@ -38,7 +38,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId; use frame_election_provider_support::{onchain, SequentialPhragmen}; use frame_support::{ construct_runtime, parameter_types, - traits::{Everything, KeyOwnerProofSystem}, + traits::{Everything, KeyOwnerProofSystem, WithdrawReasons}, }; use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; use pallet_session::historical as session_historical; @@ -455,6 +455,8 @@ impl claims::Config for Runtime { parameter_types! { pub storage MinVestedTransfer: Balance = 100 * DOLLARS; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -463,6 +465,7 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = (); + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 6aef1be3a267..454e367e2c15 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -25,7 +25,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId; use frame_election_provider_support::{onchain, SequentialPhragmen}; use frame_support::{ construct_runtime, parameter_types, - traits::{ConstU32, InstanceFilter, KeyOwnerProofSystem}, + traits::{ConstU32, InstanceFilter, KeyOwnerProofSystem, WithdrawReasons}, weights::ConstantMultiplier, PalletId, }; @@ -181,8 +181,7 @@ impl pallet_scheduler::Config for Runtime { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = frame_support::traits::EqualPrivilegeOnly; - type PreimageProvider = Preimage; - type NoPreimagePostponement = NoPreimagePostponement; + type Preimages = Preimage; } parameter_types! { @@ -196,7 +195,6 @@ impl pallet_preimage::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; - type MaxSize = PreimageMaxSize; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } @@ -714,6 +712,8 @@ impl pallet_recovery::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = 100 * CENTS; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -722,6 +722,7 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } @@ -1215,6 +1216,12 @@ pub type Executive = frame_executive::Executive< StakingMigrationV11OldPallet, >, pallet_staking::migrations::v12::MigrateToV12, + // "Bound uses of call" + pallet_preimage::migration::v1::Migration, + pallet_scheduler::migration::v3::MigrateToV4, + pallet_multisig::migrations::v1::MigrateToV1, + // "Properly migrate weights to v2" + parachains_configuration::migration::v3::MigrateToV3, ), >; /// The payload being signed in transactions. diff --git a/runtime/westend/src/weights/pallet_preimage.rs b/runtime/westend/src/weights/pallet_preimage.rs index afd51148cdde..97f066d7d40b 100644 --- a/runtime/westend/src/weights/pallet_preimage.rs +++ b/runtime/westend/src/weights/pallet_preimage.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024 // Executed Command: @@ -32,103 +32,102 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/westend/src/weights/ +// --output=./runtime/westend/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_preimage`. pub struct WeightInfo(PhantomData); impl pallet_preimage::WeightInfo for WeightInfo { - // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) + Weight::from_ref_time(28_888_000 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(Weight::from_ref_time(2_116 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) + Weight::from_ref_time(20_640_000 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(Weight::from_ref_time(2_115 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + Weight::from_ref_time(19_203_000 as u64) + // Standard Error: 1 + .saturating_add(Weight::from_ref_time(2_115 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(40_836_000 as u64) + Weight::from_ref_time(41_563_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(28_774_000 as u64) + Weight::from_ref_time(28_606_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(37_963_000 as u64) + Weight::from_ref_time(27_447_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(25_754_000 as u64) + Weight::from_ref_time(14_862_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(17_769_000 as u64) + Weight::from_ref_time(18_337_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(9_214_000 as u64) + Weight::from_ref_time(9_074_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(26_179_000 as u64) + Weight::from_ref_time(28_192_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(18_809_000 as u64) + Weight::from_ref_time(9_012_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(8_759_000 as u64) + Weight::from_ref_time(8_961_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/westend/src/weights/pallet_scheduler.rs b/runtime/westend/src/weights/pallet_scheduler.rs index edbd3187d1c9..f325f2311093 100644 --- a/runtime/westend/src/weights/pallet_scheduler.rs +++ b/runtime/westend/src/weights/pallet_scheduler.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024 // Executed Command: @@ -32,145 +32,69 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/westend/src/weights/ +// --output=./runtime/westend/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(16_183_000 as u64) - // Standard Error: 27_000 - .saturating_add(Weight::from_ref_time(18_374_000 as u64).saturating_mul(s as u64)) + // Storage: Scheduler IncompleteSince (r:1 w:1) + fn service_agendas_base() -> Weight { + Weight::from_ref_time(4_399_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(15_223_000 as u64) - // Standard Error: 28_000 - .saturating_add(Weight::from_ref_time(15_096_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[0, 50]`. + fn service_agenda_base(s: u32, ) -> Weight { + Weight::from_ref_time(3_771_000 as u64) + // Standard Error: 2_641 + .saturating_add(Weight::from_ref_time(610_848 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(13_305_000 as u64) - // Standard Error: 28_000 - .saturating_add(Weight::from_ref_time(16_211_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) + fn service_task_base() -> Weight { + Weight::from_ref_time(12_651_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(15_574_000 as u64) - // Standard Error: 22_000 - .saturating_add(Weight::from_ref_time(13_923_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(11_205_000 as u64) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(5_044_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(10_287_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(3_072_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[128, 4194304]`. + fn service_task_fetched(s: u32, ) -> Weight { + Weight::from_ref_time(24_280_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_126 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_named(s: u32, ) -> Weight { - Weight::from_ref_time(14_489_000 as u64) - // Standard Error: 16_000 - .saturating_add(Weight::from_ref_time(9_468_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic(s: u32, ) -> Weight { - Weight::from_ref_time(16_768_000 as u64) - // Standard Error: 10_000 - .saturating_add(Weight::from_ref_time(7_121_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + fn service_task_named() -> Weight { + Weight::from_ref_time(13_929_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named(s: u32, ) -> Weight { - Weight::from_ref_time(17_047_000 as u64) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(6_192_000 as u64).saturating_mul(s as u64)) + fn service_task_periodic() -> Weight { + Weight::from_ref_time(19_285_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize(s: u32, ) -> Weight { - Weight::from_ref_time(17_163_000 as u64) - // Standard Error: 10_000 - .saturating_add(Weight::from_ref_time(5_300_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + fn execute_dispatch_signed() -> Weight { + Weight::from_ref_time(4_026_000 as u64) + } + fn execute_dispatch_unsigned() -> Weight { + Weight::from_ref_time(4_078_000 as u64) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. + /// The range of component `s` is `[0, 49]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(19_757_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(75_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(17_176_000 as u64) + // Standard Error: 3_203 + .saturating_add(Weight::from_ref_time(645_757 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -178,19 +102,19 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Lookup (r:0 w:1) /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(20_399_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(880_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_408_000 as u64) + // Standard Error: 1_645 + .saturating_add(Weight::from_ref_time(575_558 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. + /// The range of component `s` is `[0, 49]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(23_671_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(121_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(20_173_000 as u64) + // Standard Error: 3_998 + .saturating_add(Weight::from_ref_time(684_714 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -198,9 +122,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Agenda (r:1 w:1) /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(23_233_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(924_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(20_330_000 as u64) + // Standard Error: 2_310 + .saturating_add(Weight::from_ref_time(621_196 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/scripts/ci/gitlab/lingua.dic b/scripts/ci/gitlab/lingua.dic index ea2da595908e..3add6a276cf0 100644 --- a/scripts/ci/gitlab/lingua.dic +++ b/scripts/ci/gitlab/lingua.dic @@ -138,6 +138,7 @@ KYC/M lib libp2p lifecycle/MS +liveness lookahead/MS lookup/MS LRU @@ -222,6 +223,7 @@ redhat/M register/CD relayer repo/MS +requesters reservable responder/SM retriability diff --git a/xcm/pallet-xcm/src/lib.rs b/xcm/pallet-xcm/src/lib.rs index f5e5d0f8c004..78dc5087d960 100644 --- a/xcm/pallet-xcm/src/lib.rs +++ b/xcm/pallet-xcm/src/lib.rs @@ -31,7 +31,7 @@ use sp_runtime::{ RuntimeDebug, }; use sp_std::{boxed::Box, marker::PhantomData, prelude::*, result::Result, vec}; -use xcm::prelude::*; +use xcm::{latest::Weight as XcmWeight, prelude::*}; use xcm_executor::traits::ConvertOrigin; use frame_support::PalletId; @@ -218,6 +218,10 @@ pub mod pallet { /// /// \[ location, query ID \] NotifyTargetMigrationFail(VersionedMultiLocation, QueryId), + /// Some assets have been claimed from an asset trap + /// + /// \[ hash, origin, assets \] + AssetsClaimed(H256, MultiLocation, VersionedMultiAssets), } #[pallet::origin] @@ -570,11 +574,11 @@ pub mod pallet { /// /// NOTE: A successful return to this does *not* imply that the `msg` was executed successfully /// to completion; only that *some* of it was executed. - #[pallet::weight(max_weight.saturating_add(Weight::from_ref_time(100_000_000u64)))] + #[pallet::weight(Weight::from_ref_time(max_weight.saturating_add(100_000_000u64)))] pub fn execute( origin: OriginFor, message: Box::RuntimeCall>>, - max_weight: Weight, + max_weight: XcmWeight, ) -> DispatchResultWithPostInfo { let origin_location = T::ExecuteXcmOrigin::ensure_origin(origin)?; let message = (*message).try_into().map_err(|()| Error::::BadVersion)?; @@ -584,8 +588,8 @@ pub mod pallet { let outcome = T::XcmExecutor::execute_xcm_in_credit( origin_location, message, - max_weight.ref_time(), - max_weight.ref_time(), + max_weight, + max_weight, ); let result = Ok(Some(outcome.weight_used().saturating_add(100_000_000)).into()); Self::deposit_event(Event::Attempted(outcome)); @@ -1312,12 +1316,13 @@ pub mod pallet { (0, Here) => (), _ => return false, }; - let hash = BlakeTwo256::hash_of(&(origin, versioned)); + let hash = BlakeTwo256::hash_of(&(origin, versioned.clone())); match AssetTraps::::get(hash) { 0 => return false, 1 => AssetTraps::::remove(hash), n => AssetTraps::::insert(hash, n - 1), } + Self::deposit_event(Event::AssetsClaimed(hash, origin.clone(), versioned)); return true } } diff --git a/xcm/pallet-xcm/src/tests.rs b/xcm/pallet-xcm/src/tests.rs index ddac7518e510..b619efefbe9b 100644 --- a/xcm/pallet-xcm/src/tests.rs +++ b/xcm/pallet-xcm/src/tests.rs @@ -517,7 +517,7 @@ fn execute_withdraw_to_deposit_works() { buy_execution((Here, SEND_AMOUNT)), DepositAsset { assets: All.into(), max_assets: 1, beneficiary: dest }, ]))), - Weight::from_ref_time(weight) + weight )); assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE - SEND_AMOUNT); assert_eq!(Balances::total_balance(&BOB), SEND_AMOUNT); @@ -549,7 +549,7 @@ fn trapped_assets_can_be_claimed() { // This would succeed, but we never get to it. DepositAsset { assets: All.into(), max_assets: 1, beneficiary: dest.clone() }, ]))), - Weight::from_ref_time(weight) + weight )); let source: MultiLocation = Junction::AccountId32 { network: NetworkId::Any, id: ALICE.into() }.into(); @@ -579,7 +579,7 @@ fn trapped_assets_can_be_claimed() { buy_execution((Here, SEND_AMOUNT)), DepositAsset { assets: All.into(), max_assets: 1, beneficiary: dest.clone() }, ]))), - Weight::from_ref_time(weight) + weight )); assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE - SEND_AMOUNT); @@ -594,7 +594,7 @@ fn trapped_assets_can_be_claimed() { buy_execution((Here, SEND_AMOUNT)), DepositAsset { assets: All.into(), max_assets: 1, beneficiary: dest }, ]))), - Weight::from_ref_time(weight) + weight )); assert_eq!( last_event(), diff --git a/xcm/xcm-executor/integration-tests/src/lib.rs b/xcm/xcm-executor/integration-tests/src/lib.rs index 6d263fe46245..272ceadfea01 100644 --- a/xcm/xcm-executor/integration-tests/src/lib.rs +++ b/xcm/xcm-executor/integration-tests/src/lib.rs @@ -17,7 +17,6 @@ #![cfg_attr(not(feature = "std"), no_std)] #![cfg(test)] -use frame_support::weights::Weight; use polkadot_test_client::{ BlockBuilderExt, ClientBlockImportExt, DefaultTestClientBuilderExt, ExecutionStrategy, InitPolkadotBlockBuilder, TestClientBuilder, TestClientBuilderExt, @@ -47,7 +46,7 @@ fn basic_buy_fees_message_executes() { &client, polkadot_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute { message: Box::new(VersionedXcm::from(msg)), - max_weight: Weight::from_ref_time(1_000_000_000), + max_weight: 1_000_000_000, }), sp_keyring::Sr25519Keyring::Alice, 0, @@ -129,7 +128,7 @@ fn query_response_fires() { &client, polkadot_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute { message: msg, - max_weight: Weight::from_ref_time(1_000_000_000), + max_weight: 1_000_000_000, }), sp_keyring::Sr25519Keyring::Alice, 1, @@ -217,7 +216,7 @@ fn query_response_elicits_handler() { &client, polkadot_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute { message: Box::new(VersionedXcm::from(msg)), - max_weight: Weight::from_ref_time(1_000_000_000), + max_weight: 1_000_000_000, }), sp_keyring::Sr25519Keyring::Alice, 1, From b6e446ed11da95bd0eb0c2d1b7311002ceb1b6f3 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Mon, 10 Oct 2022 11:38:46 +0100 Subject: [PATCH 19/49] Revert "Squashed commit of the following:" This reverts commit 5001fa5d1dcd366029d156f81c40b99ca29d8f77. --- Cargo.lock | 496 ++++++++--------- Cargo.toml | 9 +- cli/Cargo.toml | 6 +- core-primitives/Cargo.toml | 2 +- node/core/approval-voting/Cargo.toml | 6 +- node/core/approval-voting/src/import.rs | 32 -- node/core/approval-voting/src/lib.rs | 7 +- node/core/approval-voting/src/tests.rs | 31 -- node/core/av-store/Cargo.toml | 4 +- node/core/av-store/src/lib.rs | 28 +- node/core/chain-selection/Cargo.toml | 4 +- .../core/chain-selection/src/db_backend/v1.rs | 26 +- node/core/dispute-coordinator/Cargo.toml | 6 +- .../dispute-coordinator/src/scraping/mod.rs | 10 +- node/core/dispute-coordinator/src/tests.rs | 41 +- node/core/runtime-api/Cargo.toml | 2 +- node/malus/Cargo.toml | 2 +- node/metrics/src/tests.rs | 15 +- .../availability-distribution/Cargo.toml | 2 +- .../src/requester/session_cache.rs | 4 +- node/network/availability-recovery/Cargo.toml | 2 +- node/network/availability-recovery/src/lib.rs | 6 +- node/network/collator-protocol/Cargo.toml | 1 - .../src/collator_side/metrics.rs | 123 ----- .../src/collator_side/mod.rs | 254 ++++----- .../src/collator_side/tests.rs | 116 +--- .../src/collator_side/validators_buffer.rs | 317 ----------- node/network/collator-protocol/src/lib.rs | 27 +- .../src/validator_side/mod.rs | 33 +- .../src/validator_side/tests.rs | 50 +- node/network/dispute-distribution/Cargo.toml | 4 +- node/network/dispute-distribution/src/lib.rs | 41 +- .../dispute-distribution/src/metrics.rs | 7 +- .../src/receiver/batches/batch.rs | 209 ------- .../src/receiver/batches/mod.rs | 170 ------ .../src/receiver/batches/waiting_queue.rs | 204 ------- .../src/receiver/error.rs | 25 +- .../dispute-distribution/src/receiver/mod.rs | 511 +++++++----------- .../src/receiver/peer_queues.rs | 141 ----- .../dispute-distribution/src/sender/mod.rs | 110 +--- .../src/sender/send_task.rs | 30 +- .../dispute-distribution/src/tests/mock.rs | 28 +- .../dispute-distribution/src/tests/mod.rs | 453 ++++------------ .../protocol/src/request_response/mod.rs | 8 +- node/overseer/Cargo.toml | 4 +- node/overseer/src/lib.rs | 6 +- node/service/Cargo.toml | 6 +- node/service/src/lib.rs | 4 +- node/service/src/parachains_db/upgrade.rs | 2 +- node/subsystem-test-helpers/src/lib.rs | 29 - node/subsystem-util/Cargo.toml | 8 +- node/subsystem-util/src/database.rs | 79 +-- .../src/rolling_session_window.rs | 339 +----------- node/subsystem-util/src/runtime/mod.rs | 11 +- node/test/performance-test/Cargo.toml | 3 - parachain/Cargo.toml | 2 +- primitives/Cargo.toml | 2 +- .../src/node/disputes/dispute-distribution.md | 309 ++++------- runtime/common/src/claims.rs | 5 +- runtime/common/src/lib.rs | 12 +- runtime/common/src/purchase.rs | 9 +- runtime/kusama/src/governance/fellowship.rs | 1 - runtime/kusama/src/governance/mod.rs | 1 - runtime/kusama/src/governance/old.rs | 6 +- runtime/kusama/src/lib.rs | 19 +- .../kusama/src/weights/pallet_democracy.rs | 185 ++++--- runtime/kusama/src/weights/pallet_preimage.rs | 67 +-- .../kusama/src/weights/pallet_scheduler.rs | 161 ++++-- runtime/parachains/src/configuration.rs | 3 +- .../parachains/src/configuration/migration.rs | 322 +---------- runtime/polkadot/src/lib.rs | 25 +- .../polkadot/src/weights/pallet_democracy.rs | 185 ++++--- .../polkadot/src/weights/pallet_preimage.rs | 63 +-- .../polkadot/src/weights/pallet_scheduler.rs | 160 ++++-- runtime/rococo/src/lib.rs | 31 +- .../rococo/src/weights/pallet_democracy.rs | 183 ++++--- runtime/rococo/src/weights/pallet_preimage.rs | 63 +-- .../rococo/src/weights/pallet_scheduler.rs | 158 ++++-- runtime/test-runtime/src/lib.rs | 5 +- runtime/westend/src/lib.rs | 15 +- .../westend/src/weights/pallet_preimage.rs | 63 +-- .../westend/src/weights/pallet_scheduler.rs | 160 ++++-- scripts/ci/gitlab/lingua.dic | 2 - xcm/pallet-xcm/src/lib.rs | 17 +- xcm/pallet-xcm/src/tests.rs | 8 +- xcm/xcm-executor/integration-tests/src/lib.rs | 7 +- 86 files changed, 2058 insertions(+), 4285 deletions(-) delete mode 100644 node/network/collator-protocol/src/collator_side/metrics.rs delete mode 100644 node/network/collator-protocol/src/collator_side/validators_buffer.rs delete mode 100644 node/network/dispute-distribution/src/receiver/batches/batch.rs delete mode 100644 node/network/dispute-distribution/src/receiver/batches/mod.rs delete mode 100644 node/network/dispute-distribution/src/receiver/batches/waiting_queue.rs delete mode 100644 node/network/dispute-distribution/src/receiver/peer_queues.rs diff --git a/Cargo.lock b/Cargo.lock index 33b4d44fefb7..1f4ec51a3fd9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -435,7 +435,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "async-trait", @@ -472,7 +472,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -492,25 +492,22 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "beefy-primitives", "sp-api", - "sp-runtime", ] [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", "sp-application-crypto", "sp-core", - "sp-io", - "sp-mmr-primitives", "sp-runtime", "sp-std", ] @@ -532,9 +529,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.60.1" +version = "0.59.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" +checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" dependencies = [ "bitflags", "cexpr", @@ -557,9 +554,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitvec" -version = "1.0.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +checksum = "1489fcb93a5bb47da0462ca93ad252ad6af2145cce58d10d46a83931ba9f016b" dependencies = [ "funty", "radium", @@ -917,7 +914,7 @@ checksum = "fa66045b9cb23c2e9c1520732030608b02ee07e5cfaa5a521ec15ded7fa24c90" dependencies = [ "glob", "libc", - "libloading", + "libloading 0.7.2", ] [[package]] @@ -1948,9 +1945,9 @@ dependencies = [ [[package]] name = "fixed-hash" -version = "0.8.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" dependencies = [ "byteorder", "rand 0.8.5", @@ -2001,7 +1998,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", ] @@ -2019,7 +2016,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -2042,7 +2039,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "Inflector", "array-bytes", @@ -2093,7 +2090,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2104,7 +2101,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2120,7 +2117,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -2149,7 +2146,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "bitflags", "frame-metadata", @@ -2181,7 +2178,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "Inflector", "cfg-expr", @@ -2195,7 +2192,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2207,7 +2204,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "proc-macro2", "quote", @@ -2217,7 +2214,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2240,7 +2237,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -2251,7 +2248,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "log", @@ -2269,7 +2266,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -2284,7 +2281,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "sp-api", @@ -2293,7 +2290,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "parity-scale-codec", @@ -2308,6 +2305,18 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ebd3504ad6116843b8375ad70df74e7bfe83cac77a1f3fe73200c844d43bfe0" +[[package]] +name = "fs-swap" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5" +dependencies = [ + "lazy_static", + "libc", + "libloading 0.5.2", + "winapi", +] + [[package]] name = "fs2" version = "0.4.3" @@ -2464,7 +2473,7 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "chrono", "frame-election-provider-support", @@ -2900,9 +2909,9 @@ dependencies = [ [[package]] name = "impl-serde" -version = "0.4.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" dependencies = [ "serde", ] @@ -3317,9 +3326,9 @@ dependencies = [ [[package]] name = "kvdb" -version = "0.12.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585089ceadba0197ffe9af6740ab350b325e3c1f5fccfbc3522e0250c750409b" +checksum = "a301d8ecb7989d4a6e2c57a49baca77d353bdbf879909debe3f375fe25d61f86" dependencies = [ "parity-util-mem", "smallvec", @@ -3327,9 +3336,9 @@ dependencies = [ [[package]] name = "kvdb-memorydb" -version = "0.12.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40d109c87bfb7759edd2a49b2649c1afe25af785d930ad6a38479b4dc70dd873" +checksum = "ece7e668abd21387aeb6628130a6f4c802787f014fa46bc83221448322250357" dependencies = [ "kvdb", "parity-util-mem", @@ -3338,13 +3347,15 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.16.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c076cc2cdbac89b9910c853a36c957d3862a779f31c2661174222cefb49ee597" +checksum = "ca7fbdfd71cd663dceb0faf3367a99f8cf724514933e9867cec4995b6027cbc1" dependencies = [ + "fs-swap", "kvdb", "log", "num_cpus", + "owning_ref", "parity-util-mem", "parking_lot 0.12.1", "regex", @@ -3354,9 +3365,9 @@ dependencies = [ [[package]] name = "kvdb-shared-tests" -version = "0.10.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de82a1adb7ade192c0090dd56d059a626191c0638c795eb68aff4b0bd2c1f9be" +checksum = "7a9001edd3459aa1503ea84215cf4618a6e2e020f51682494cc6f5ab1150e68e" dependencies = [ "kvdb", ] @@ -3391,6 +3402,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libloading" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" +dependencies = [ + "cc", + "winapi", +] + [[package]] name = "libloading" version = "0.7.2" @@ -3924,9 +3945,9 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "0.8.0+7.4.4" +version = "0.6.1+6.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611804e4666a25136fcc5f8cf425ab4d26c7f74ea245ffe92ea23b85b6420b5d" +checksum = "81bc587013734dadb7cf23468e531aa120788b87243648be42e2d3a072186291" dependencies = [ "bindgen", "bzip2-sys", @@ -4203,9 +4224,9 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.30.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac11bb793c28fa095b7554466f53b3a60a2cd002afdac01bcf135cbd73a269" +checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" dependencies = [ "hash-db", "hashbrown", @@ -4813,7 +4834,7 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -4827,7 +4848,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -4843,7 +4864,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -4858,7 +4879,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -4882,7 +4903,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4902,7 +4923,7 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4921,7 +4942,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -4936,7 +4957,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "beefy-primitives", "frame-support", @@ -4952,7 +4973,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "beefy-merkle-tree", @@ -4975,7 +4996,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -4993,7 +5014,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5012,7 +5033,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5029,7 +5050,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#dbb72f3fd98253b72c0090375b738b9d00995090" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5046,16 +5067,14 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log", "parity-scale-codec", "scale-info", "serde", - "sp-core", "sp-io", "sp-runtime", "sp-std", @@ -5064,7 +5083,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5088,7 +5107,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5101,7 +5120,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5119,7 +5138,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5140,7 +5159,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5155,7 +5174,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5178,7 +5197,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5194,7 +5213,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5214,7 +5233,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5231,7 +5250,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5248,7 +5267,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5266,7 +5285,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -5281,12 +5300,11 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log", "parity-scale-codec", "scale-info", "sp-io", @@ -5297,7 +5315,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -5314,7 +5332,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5334,7 +5352,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "sp-api", @@ -5344,7 +5362,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -5361,7 +5379,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5384,12 +5402,11 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log", "parity-scale-codec", "scale-info", "sp-core", @@ -5401,7 +5418,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5416,7 +5433,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#dbb72f3fd98253b72c0090375b738b9d00995090" dependencies = [ "frame-benchmarking", "frame-support", @@ -5434,7 +5451,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5449,7 +5466,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#dbb72f3fd98253b72c0090375b738b9d00995090" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5467,7 +5484,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5483,7 +5500,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -5504,7 +5521,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5520,7 +5537,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -5534,7 +5551,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5557,7 +5574,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5568,7 +5585,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "log", "sp-arithmetic", @@ -5577,7 +5594,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -5591,7 +5608,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5609,7 +5626,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5628,7 +5645,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -5644,7 +5661,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5659,7 +5676,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5670,7 +5687,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5687,7 +5704,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5703,7 +5720,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5718,7 +5735,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#dbb72f3fd98253b72c0090375b738b9d00995090" dependencies = [ "frame-benchmarking", "frame-support", @@ -5831,9 +5848,9 @@ checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" [[package]] name = "parity-util-mem" -version = "0.12.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d32c34f4f5ca7f9196001c0aba5a1f9a5a12382c8944b8b0f90233282d1e8f8" +checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" dependencies = [ "cfg-if 1.0.0", "hashbrown", @@ -6018,18 +6035,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.12" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" dependencies = [ "proc-macro2", "quote", @@ -6149,7 +6166,7 @@ dependencies = [ "fatality", "futures", "futures-timer", - "lru 0.8.0", + "lru 0.7.8", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6179,7 +6196,7 @@ dependencies = [ "futures", "futures-timer", "log", - "lru 0.8.0", + "lru 0.7.8", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6272,7 +6289,6 @@ version = "0.9.29" dependencies = [ "always-assert", "assert_matches", - "bitvec", "env_logger 0.9.0", "fatality", "futures", @@ -6317,9 +6333,8 @@ dependencies = [ "fatality", "futures", "futures-timer", - "indexmap", "lazy_static", - "lru 0.8.0", + "lru 0.7.8", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6439,7 +6454,7 @@ dependencies = [ "futures-timer", "kvdb", "kvdb-memorydb", - "lru 0.8.0", + "lru 0.7.8", "merlin", "parity-scale-codec", "parking_lot 0.12.1", @@ -6608,7 +6623,7 @@ dependencies = [ "futures-timer", "kvdb", "kvdb-memorydb", - "lru 0.8.0", + "lru 0.7.8", "parity-scale-codec", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -6895,7 +6910,7 @@ dependencies = [ "kvdb-shared-tests", "lazy_static", "log", - "lru 0.8.0", + "lru 0.7.8", "parity-db", "parity-scale-codec", "parity-util-mem", @@ -6929,7 +6944,7 @@ dependencies = [ "femme", "futures", "futures-timer", - "lru 0.8.0", + "lru 0.7.8", "orchestra", "parity-util-mem", "parking_lot 0.12.1", @@ -7286,7 +7301,7 @@ dependencies = [ "kvdb", "kvdb-rocksdb", "log", - "lru 0.8.0", + "lru 0.7.8", "pallet-babe", "pallet-im-online", "pallet-staking", @@ -7710,9 +7725,9 @@ dependencies = [ [[package]] name = "primitive-types" -version = "0.12.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cfd65aea0c5fa0bfcc7c9e7ca828c921ef778f43d325325ec84bda371bfa75a" +checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" dependencies = [ "fixed-hash", "impl-codec", @@ -8252,7 +8267,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "env_logger 0.9.0", "jsonrpsee", @@ -8350,9 +8365,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.19.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9562ea1d70c0cc63a34a22d977753b50cca91cc6b6527750463bd5dd8697bc" +checksum = "620f4129485ff1a7128d184bc687470c21c7951b64779ebc9cfdad3dcd920290" dependencies = [ "libc", "librocksdb-sys", @@ -8600,7 +8615,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "log", "sp-core", @@ -8611,7 +8626,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "futures", @@ -8620,8 +8635,8 @@ dependencies = [ "libp2p", "log", "parity-scale-codec", - "prost 0.11.0", - "prost-build 0.11.1", + "prost 0.10.3", + "prost-build 0.10.4", "rand 0.7.3", "sc-client-api", "sc-network-common", @@ -8638,7 +8653,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "futures-timer", @@ -8661,7 +8676,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8677,7 +8692,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8694,7 +8709,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8705,7 +8720,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "chrono", @@ -8745,7 +8760,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "fnv", "futures", @@ -8773,7 +8788,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "hash-db", "kvdb", @@ -8798,7 +8813,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "futures", @@ -8822,7 +8837,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "fork-tree", @@ -8864,7 +8879,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "jsonrpsee", @@ -8886,7 +8901,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8899,7 +8914,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "futures", @@ -8923,7 +8938,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "lazy_static", "lru 0.7.8", @@ -8950,7 +8965,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "environmental", "parity-scale-codec", @@ -8966,7 +8981,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "log", "parity-scale-codec", @@ -8981,7 +8996,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "cfg-if 1.0.0", "libc", @@ -9001,7 +9016,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "ahash", "array-bytes", @@ -9042,7 +9057,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "finality-grandpa", "futures", @@ -9063,7 +9078,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "ansi_term", "futures", @@ -9080,7 +9095,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "async-trait", @@ -9095,7 +9110,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "async-trait", @@ -9117,7 +9132,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "pin-project", - "prost 0.11.0", + "prost 0.10.3", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -9142,7 +9157,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "cid", "futures", @@ -9162,7 +9177,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "bitflags", @@ -9172,7 +9187,7 @@ dependencies = [ "libp2p", "linked_hash_set", "parity-scale-codec", - "prost-build 0.11.1", + "prost-build 0.10.4", "sc-consensus", "sc-peerset", "serde", @@ -9188,7 +9203,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "ahash", "futures", @@ -9206,15 +9221,15 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "futures", "libp2p", "log", "parity-scale-codec", - "prost 0.11.0", - "prost-build 0.11.1", + "prost 0.10.3", + "prost-build 0.10.4", "sc-client-api", "sc-network-common", "sc-peerset", @@ -9227,7 +9242,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "fork-tree", @@ -9236,8 +9251,8 @@ dependencies = [ "log", "lru 0.7.8", "parity-scale-codec", - "prost 0.11.0", - "prost-build 0.11.1", + "prost 0.10.3", + "prost-build 0.10.4", "sc-client-api", "sc-consensus", "sc-network-common", @@ -9255,7 +9270,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "futures", @@ -9274,7 +9289,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "bytes", @@ -9304,7 +9319,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "libp2p", @@ -9317,7 +9332,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9326,7 +9341,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "hash-db", @@ -9356,7 +9371,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "jsonrpsee", @@ -9379,7 +9394,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "jsonrpsee", @@ -9392,7 +9407,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "directories", @@ -9462,7 +9477,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "log", "parity-scale-codec", @@ -9476,7 +9491,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -9495,7 +9510,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "libc", @@ -9514,7 +9529,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "chrono", "futures", @@ -9532,7 +9547,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "ansi_term", "atty", @@ -9563,7 +9578,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9574,7 +9589,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "futures-timer", @@ -9600,7 +9615,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "log", @@ -9613,7 +9628,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "futures-timer", @@ -10099,7 +10114,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "hash-db", "log", @@ -10117,7 +10132,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "blake2", "proc-macro-crate", @@ -10129,7 +10144,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "scale-info", @@ -10142,7 +10157,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "integer-sqrt", "num-traits", @@ -10157,7 +10172,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "scale-info", @@ -10170,7 +10185,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "parity-scale-codec", @@ -10182,7 +10197,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "sp-api", @@ -10194,7 +10209,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "log", @@ -10212,7 +10227,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "futures", @@ -10231,7 +10246,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "merlin", @@ -10254,7 +10269,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "scale-info", @@ -10268,7 +10283,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "scale-info", @@ -10281,7 +10296,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "base58", @@ -10327,7 +10342,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "blake2", "byteorder", @@ -10341,7 +10356,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "proc-macro2", "quote", @@ -10352,7 +10367,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -10361,7 +10376,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "proc-macro2", "quote", @@ -10371,7 +10386,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "environmental", "parity-scale-codec", @@ -10382,7 +10397,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "finality-grandpa", "log", @@ -10400,7 +10415,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10414,7 +10429,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "bytes", "futures", @@ -10440,7 +10455,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "lazy_static", "sp-core", @@ -10451,7 +10466,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "futures", @@ -10468,7 +10483,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "thiserror", "zstd", @@ -10477,11 +10492,10 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "log", "parity-scale-codec", - "scale-info", "serde", "sp-api", "sp-core", @@ -10493,7 +10507,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "scale-info", @@ -10507,7 +10521,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "sp-api", "sp-core", @@ -10517,7 +10531,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "backtrace", "lazy_static", @@ -10527,7 +10541,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "rustc-hash", "serde", @@ -10537,7 +10551,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "either", "hash256-std-hasher", @@ -10560,7 +10574,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -10578,7 +10592,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "Inflector", "proc-macro-crate", @@ -10590,7 +10604,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "log", "parity-scale-codec", @@ -10604,7 +10618,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "scale-info", @@ -10618,7 +10632,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "scale-info", @@ -10629,7 +10643,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "hash-db", "log", @@ -10651,12 +10665,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10669,7 +10683,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "log", "sp-core", @@ -10682,7 +10696,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "futures-timer", @@ -10698,7 +10712,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "sp-std", @@ -10710,7 +10724,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "sp-api", "sp-runtime", @@ -10719,7 +10733,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "log", @@ -10735,7 +10749,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "ahash", "hash-db", @@ -10758,7 +10772,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10775,7 +10789,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10786,7 +10800,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "impl-trait-for-tuples", "log", @@ -10799,7 +10813,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -11014,7 +11028,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "platforms", ] @@ -11022,7 +11036,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -11043,7 +11057,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures-util", "hyper", @@ -11056,7 +11070,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "jsonrpsee", "log", @@ -11077,7 +11091,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "async-trait", @@ -11103,7 +11117,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "substrate-test-utils-derive", @@ -11113,7 +11127,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11124,7 +11138,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "ansi_term", "build-helper", @@ -11434,9 +11448,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-ctl" -version = "0.5.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37706572f4b151dff7a0146e040804e9c26fe3a3118591112f05cf12a4216c1" +checksum = "eb833c46ecbf8b6daeccb347cefcabf9c1beb5c9b0f853e1cec45632d9963e69" dependencies = [ "libc", "paste", @@ -11445,9 +11459,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-sys" -version = "0.5.2+5.3.0-patched" +version = "0.4.2+5.2.1-patched.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec45c14da997d0925c7835883e4d5c181f196fa142f8c19d7643d1e9af2592c3" +checksum = "5844e429d797c62945a566f8da4e24c7fe3fbd5d6617fd8bf7a0b7dc1ee0f22e" dependencies = [ "cc", "fs_extra", @@ -11456,9 +11470,9 @@ dependencies = [ [[package]] name = "tikv-jemallocator" -version = "0.5.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20612db8a13a6c06d57ec83953694185a367e16945f66565e8028d2c0bd76979" +checksum = "3c14a5a604eb8715bc5785018a37d00739b180bcf609916ddf4393d33d49ccdf" dependencies = [ "libc", "tikv-jemalloc-sys", @@ -11837,7 +11851,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "clap", "frame-try-runtime", diff --git a/Cargo.toml b/Cargo.toml index 0ed0892593d9..ee886dafdc8a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ readme = "README.md" [dependencies] polkadot-cli = { path = "cli", features = [ "kusama-native", "westend-native", "rococo-native" ] } color-eyre = { version = "0.6.1", default-features = false } -parity-util-mem = { version = "0.12.0", default-features = false, features = ["jemalloc-global"] } +parity-util-mem = { version = "0.11.0", default-features = false, features = ["jemalloc-global"] } [dev-dependencies] assert_cmd = "2.0.4" @@ -125,9 +125,9 @@ maintenance = { status = "actively-developed" } # # This list is ordered alphabetically. [profile.dev.package] +blake2b_simd = { opt-level = 3 } blake2 = { opt-level = 3 } blake2-rfc = { opt-level = 3 } -blake2b_simd = { opt-level = 3 } chacha20poly1305 = { opt-level = 3 } cranelift-codegen = { opt-level = 3 } cranelift-wasm = { opt-level = 3 } @@ -138,8 +138,8 @@ curve25519-dalek = { opt-level = 3 } ed25519-dalek = { opt-level = 3 } flate2 = { opt-level = 3 } futures-channel = { opt-level = 3 } -hash-db = { opt-level = 3 } hashbrown = { opt-level = 3 } +hash-db = { opt-level = 3 } hmac = { opt-level = 3 } httparse = { opt-level = 3 } integer-sqrt = { opt-level = 3 } @@ -151,8 +151,8 @@ libz-sys = { opt-level = 3 } mio = { opt-level = 3 } nalgebra = { opt-level = 3 } num-bigint = { opt-level = 3 } -parking_lot = { opt-level = 3 } parking_lot_core = { opt-level = 3 } +parking_lot = { opt-level = 3 } percent-encoding = { opt-level = 3 } primitive-types = { opt-level = 3 } reed-solomon-novelpoly = { opt-level = 3 } @@ -162,7 +162,6 @@ sha2 = { opt-level = 3 } sha3 = { opt-level = 3 } smallvec = { opt-level = 3 } snow = { opt-level = 3 } -substrate-bip39 = {opt-level = 3} twox-hash = { opt-level = 3 } uint = { opt-level = 3 } wasmi = { opt-level = 3 } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 1be1b63c0cfb..1e770cd8715b 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -56,11 +56,7 @@ cli = [ "polkadot-client", "polkadot-node-core-pvf", ] -runtime-benchmarks = [ - "service/runtime-benchmarks", - "polkadot-node-metrics/runtime-benchmarks", - "polkadot-performance-test?/runtime-benchmarks" -] +runtime-benchmarks = ["service/runtime-benchmarks", "polkadot-node-metrics/runtime-benchmarks"] trie-memory-tracker = ["sp-trie/memory-tracker"] full-node = ["service/full-node"] try-runtime = ["service/try-runtime"] diff --git a/core-primitives/Cargo.toml b/core-primitives/Cargo.toml index a10b80b0c30f..9bbe8f516afb 100644 --- a/core-primitives/Cargo.toml +++ b/core-primitives/Cargo.toml @@ -10,7 +10,7 @@ sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", d sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } parity-scale-codec = { version = "3.1.5", default-features = false, features = [ "derive" ] } -parity-util-mem = { version = "0.12.0", default-features = false, optional = true } +parity-util-mem = { version = "0.11.0", default-features = false, optional = true } [features] default = [ "std" ] diff --git a/node/core/approval-voting/Cargo.toml b/node/core/approval-voting/Cargo.toml index 25fb51eb712b..f2572cac8232 100644 --- a/node/core/approval-voting/Cargo.toml +++ b/node/core/approval-voting/Cargo.toml @@ -10,10 +10,10 @@ futures-timer = "3.0.2" parity-scale-codec = { version = "3.1.5", default-features = false, features = ["bit-vec", "derive"] } gum = { package = "tracing-gum", path = "../../gum" } bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } -lru = "0.8" +lru = "0.7" merlin = "2.0" schnorrkel = "0.9.1" -kvdb = "0.12.0" +kvdb = "0.11.0" derive_more = "0.99.17" thiserror = "1.0.31" @@ -40,5 +40,5 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } assert_matches = "1.4.0" -kvdb-memorydb = "0.12.0" +kvdb-memorydb = "0.11.0" test-helpers = { package = "polkadot-primitives-test-helpers", path = "../../../primitives/test-helpers" } diff --git a/node/core/approval-voting/src/import.rs b/node/core/approval-voting/src/import.rs index 5413c271e0d6..d43bf40546ae 100644 --- a/node/core/approval-voting/src/import.rs +++ b/node/core/approval-voting/src/import.rs @@ -1296,38 +1296,6 @@ pub(crate) mod tests { } ); - // Caching of sesssions needs sessoion of first unfinalied block. - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( - s_tx, - )) => { - let _ = s_tx.send(Ok(header.number)); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( - block_number, - s_tx, - )) => { - assert_eq!(block_number, header.number); - let _ = s_tx.send(Ok(Some(header.hash()))); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionIndexForChild(s_tx), - )) => { - assert_eq!(h, header.hash()); - let _ = s_tx.send(Ok(session)); - } - ); - // determine_new_blocks exits early as the parent_hash is in the DB assert_matches!( diff --git a/node/core/approval-voting/src/lib.rs b/node/core/approval-voting/src/lib.rs index 467d8be612e9..ac025f366ab7 100644 --- a/node/core/approval-voting/src/lib.rs +++ b/node/core/approval-voting/src/lib.rs @@ -70,7 +70,6 @@ use std::{ collections::{ btree_map::Entry as BTMEntry, hash_map::Entry as HMEntry, BTreeMap, HashMap, HashSet, }, - num::NonZeroUsize, sync::Arc, time::Duration, }; @@ -105,11 +104,7 @@ const APPROVAL_CHECKING_TIMEOUT: Duration = Duration::from_secs(120); /// Value rather arbitrarily: Should not be hit in practice, it exists to more easily diagnose dead /// lock issues for example. const WAIT_FOR_SIGS_TIMEOUT: Duration = Duration::from_millis(500); -const APPROVAL_CACHE_SIZE: NonZeroUsize = match NonZeroUsize::new(1024) { - Some(cap) => cap, - None => panic!("Approval cache size must be non-zero."), -}; - +const APPROVAL_CACHE_SIZE: usize = 1024; const TICK_TOO_FAR_IN_FUTURE: Tick = 20; // 10 seconds. const APPROVAL_DELAY: Tick = 2; const LOG_TARGET: &str = "parachain::approval-voting"; diff --git a/node/core/approval-voting/src/tests.rs b/node/core/approval-voting/src/tests.rs index bdb7a8c929b3..66d1402ed6dc 100644 --- a/node/core/approval-voting/src/tests.rs +++ b/node/core/approval-voting/src/tests.rs @@ -807,37 +807,6 @@ async fn import_block( } ); - assert_matches!( - overseer_recv(overseer).await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( - s_tx, - )) => { - let _ = s_tx.send(Ok(number)); - } - ); - - assert_matches!( - overseer_recv(overseer).await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( - block_number, - s_tx, - )) => { - assert_eq!(block_number, number); - let _ = s_tx.send(Ok(Some(hashes[number as usize].0))); - } - ); - - assert_matches!( - overseer_recv(overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionIndexForChild(s_tx), - )) => { - assert_eq!(h, hashes[number as usize].0); - let _ = s_tx.send(Ok(number.into())); - } - ); - if !fork { assert_matches!( overseer_recv(overseer).await, diff --git a/node/core/av-store/Cargo.toml b/node/core/av-store/Cargo.toml index 4cec2cb637b9..9cea9f1bdc24 100644 --- a/node/core/av-store/Cargo.toml +++ b/node/core/av-store/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] futures = "0.3.21" futures-timer = "3.0.2" -kvdb = "0.12.0" +kvdb = "0.11.0" thiserror = "1.0.31" gum = { package = "tracing-gum", path = "../../gum" } bitvec = "1.0.0" @@ -24,7 +24,7 @@ polkadot-node-primitives = { path = "../../primitives" } log = "0.4.17" env_logger = "0.9.0" assert_matches = "1.4.0" -kvdb-memorydb = "0.12.0" +kvdb-memorydb = "0.11.0" sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } diff --git a/node/core/av-store/src/lib.rs b/node/core/av-store/src/lib.rs index 4fbbf3740ab0..cd1685e32ea8 100644 --- a/node/core/av-store/src/lib.rs +++ b/node/core/av-store/src/lib.rs @@ -792,9 +792,8 @@ fn note_block_included( macro_rules! peek_num { ($iter:ident) => { match $iter.peek() { - Some(Ok((k, _))) => Ok(decode_unfinalized_key(&k[..]).ok().map(|(b, _, _)| b)), - Some(Err(_)) => Err($iter.next().expect("peek returned Some(Err); qed").unwrap_err()), - None => Ok(None), + Some((k, _)) => decode_unfinalized_key(&k[..]).ok().map(|(b, _, _)| b), + None => None, } }; } @@ -820,10 +819,10 @@ async fn process_block_finalized( let mut iter = subsystem .db .iter_with_prefix(subsystem.config.col_meta, &start_prefix) - .take_while(|r| r.as_ref().map_or(true, |(k, _v)| &k[..] < &end_prefix[..])) + .take_while(|(k, _)| &k[..] < &end_prefix[..]) .peekable(); - match peek_num!(iter)? { + match peek_num!(iter) { None => break, // end of iterator. Some(n) => n, } @@ -868,10 +867,10 @@ async fn process_block_finalized( let iter = subsystem .db .iter_with_prefix(subsystem.config.col_meta, &start_prefix) - .take_while(|r| r.as_ref().map_or(true, |(k, _v)| &k[..] < &end_prefix[..])) + .take_while(|(k, _)| &k[..] < &end_prefix[..]) .peekable(); - let batch = load_all_at_finalized_height(iter, batch_num, batch_finalized_hash)?; + let batch = load_all_at_finalized_height(iter, batch_num, batch_finalized_hash); // Now that we've iterated over the entire batch at this finalized height, // update the meta. @@ -891,22 +890,22 @@ async fn process_block_finalized( // loads all candidates at the finalized height and maps them to `true` if finalized // and `false` if unfinalized. fn load_all_at_finalized_height( - mut iter: std::iter::Peekable>>, + mut iter: std::iter::Peekable, Box<[u8]>)>>, block_number: BlockNumber, finalized_hash: Hash, -) -> io::Result> { +) -> impl IntoIterator { // maps candidate hashes to true if finalized, false otherwise. let mut candidates = HashMap::new(); // Load all candidates that were included at this height. loop { - match peek_num!(iter)? { + match peek_num!(iter) { None => break, // end of iterator. Some(n) if n != block_number => break, // end of batch. _ => {}, } - let (k, _v) = iter.next().expect("`peek` used to check non-empty; qed")?; + let (k, _v) = iter.next().expect("`peek` used to check non-empty; qed"); let (_, block_hash, candidate_hash) = decode_unfinalized_key(&k[..]).expect("`peek_num` checks validity of key; qed"); @@ -917,7 +916,7 @@ fn load_all_at_finalized_height( } } - Ok(candidates) + candidates } fn update_blocks_at_finalized_height( @@ -1215,10 +1214,9 @@ fn prune_all(db: &Arc, config: &Config, clock: &dyn Clock) -> Resu let mut tx = DBTransaction::new(); let iter = db .iter_with_prefix(config.col_meta, &range_start[..]) - .take_while(|r| r.as_ref().map_or(true, |(k, _v)| &k[..] < &range_end[..])); + .take_while(|(k, _)| &k[..] < &range_end[..]); - for r in iter { - let (k, _v) = r?; + for (k, _v) in iter { tx.delete(config.col_meta, &k[..]); let (_, candidate_hash) = match decode_pruning_key(&k[..]) { diff --git a/node/core/chain-selection/Cargo.toml b/node/core/chain-selection/Cargo.toml index df6a5c24f10e..8d9875b6f389 100644 --- a/node/core/chain-selection/Cargo.toml +++ b/node/core/chain-selection/Cargo.toml @@ -13,7 +13,7 @@ polkadot-primitives = { path = "../../../primitives" } polkadot-node-primitives = { path = "../../primitives" } polkadot-node-subsystem = { path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } -kvdb = "0.12.0" +kvdb = "0.11.0" thiserror = "1.0.31" parity-scale-codec = "3.1.5" @@ -22,4 +22,4 @@ polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } parking_lot = "0.12.0" assert_matches = "1" -kvdb-memorydb = "0.12.0" +kvdb-memorydb = "0.11.0" diff --git a/node/core/chain-selection/src/db_backend/v1.rs b/node/core/chain-selection/src/db_backend/v1.rs index a037d27baaea..db117ff945df 100644 --- a/node/core/chain-selection/src/db_backend/v1.rs +++ b/node/core/chain-selection/src/db_backend/v1.rs @@ -235,21 +235,16 @@ impl Backend for DbBackend { self.inner.iter_with_prefix(self.config.col_data, &STAGNANT_AT_PREFIX[..]); let val = stagnant_at_iter - .filter_map(|r| match r { - Ok((k, v)) => - match (decode_stagnant_at_key(&mut &k[..]), >::decode(&mut &v[..]).ok()) - { - (Some(at), Some(stagnant_at)) => Some(Ok((at, stagnant_at))), - _ => None, - }, - Err(e) => Some(Err(e)), + .filter_map(|(k, v)| { + match (decode_stagnant_at_key(&mut &k[..]), >::decode(&mut &v[..]).ok()) { + (Some(at), Some(stagnant_at)) => Some((at, stagnant_at)), + _ => None, + } }) .enumerate() - .take_while(|(idx, r)| { - r.as_ref().map_or(true, |(at, _)| *at <= up_to.into() && *idx < max_elements) - }) + .take_while(|(idx, (at, _))| *at <= up_to.into() && *idx < max_elements) .map(|(_, v)| v) - .collect::, _>>()?; + .collect::>(); Ok(val) } @@ -259,13 +254,10 @@ impl Backend for DbBackend { self.inner.iter_with_prefix(self.config.col_data, &BLOCK_HEIGHT_PREFIX[..]); let val = blocks_at_height_iter - .filter_map(|r| match r { - Ok((k, _)) => decode_block_height_key(&k[..]).map(Ok), - Err(e) => Some(Err(e)), - }) + .filter_map(|(k, _)| decode_block_height_key(&k[..])) .next(); - val.transpose().map_err(Error::from) + Ok(val) } fn load_blocks_by_number(&self, number: BlockNumber) -> Result, Error> { diff --git a/node/core/dispute-coordinator/Cargo.toml b/node/core/dispute-coordinator/Cargo.toml index fd89b599f63c..bc22b40c8529 100644 --- a/node/core/dispute-coordinator/Cargo.toml +++ b/node/core/dispute-coordinator/Cargo.toml @@ -8,9 +8,9 @@ edition = "2021" futures = "0.3.21" gum = { package = "tracing-gum", path = "../../gum" } parity-scale-codec = "3.1.5" -kvdb = "0.12.0" +kvdb = "0.11.0" thiserror = "1.0.31" -lru = "0.8.0" +lru = "0.7.7" fatality = "0.0.6" polkadot-primitives = { path = "../../../primitives" } @@ -22,7 +22,7 @@ sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "maste [dev-dependencies] -kvdb-memorydb = "0.12.0" +kvdb-memorydb = "0.11.0" polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/core/dispute-coordinator/src/scraping/mod.rs b/node/core/dispute-coordinator/src/scraping/mod.rs index 7d5d33e1ff4b..b45dbfa95197 100644 --- a/node/core/dispute-coordinator/src/scraping/mod.rs +++ b/node/core/dispute-coordinator/src/scraping/mod.rs @@ -14,10 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::{ - collections::{BTreeMap, HashSet}, - num::NonZeroUsize, -}; +use std::collections::{BTreeMap, HashSet}; use futures::channel::oneshot; use lru::LruCache; @@ -47,10 +44,7 @@ mod tests; /// `last_observed_blocks` LRU. This means, this value should the very least be as large as the /// number of expected forks for keeping chain scraping efficient. Making the LRU much larger than /// that has very limited use. -const LRU_OBSERVED_BLOCKS_CAPACITY: NonZeroUsize = match NonZeroUsize::new(20) { - Some(cap) => cap, - None => panic!("Observed blocks cache size must be non-zero"), -}; +const LRU_OBSERVED_BLOCKS_CAPACITY: usize = 20; /// Chain scraper /// diff --git a/node/core/dispute-coordinator/src/tests.rs b/node/core/dispute-coordinator/src/tests.rs index aaef00999259..ff85319599ce 100644 --- a/node/core/dispute-coordinator/src/tests.rs +++ b/node/core/dispute-coordinator/src/tests.rs @@ -239,15 +239,13 @@ impl TestState { ))) .await; - self.handle_sync_queries(virtual_overseer, block_hash, block_number, session) - .await; + self.handle_sync_queries(virtual_overseer, block_hash, session).await; } async fn handle_sync_queries( &mut self, virtual_overseer: &mut VirtualOverseer, block_hash: Hash, - block_number: BlockNumber, session: SessionIndex, ) { // Order of messages is not fixed (different on initializing): @@ -280,45 +278,11 @@ impl TestState { finished_steps.got_session_information = true; assert_eq!(h, block_hash); let _ = tx.send(Ok(session)); - - // Queries for fetching earliest unfinalized block session. See `RollingSessionWindow`. - assert_matches!( - overseer_recv(virtual_overseer).await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( - s_tx, - )) => { - let _ = s_tx.send(Ok(block_number)); - } - ); - - assert_matches!( - overseer_recv(virtual_overseer).await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( - number, - s_tx, - )) => { - assert_eq!(block_number, number); - let _ = s_tx.send(Ok(Some(block_hash))); - } - ); - - assert_matches!( - overseer_recv(virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionIndexForChild(s_tx), - )) => { - assert_eq!(h, block_hash); - let _ = s_tx.send(Ok(session)); - } - ); - // No queries, if subsystem knows about this session already. if self.known_session == Some(session) { continue } self.known_session = Some(session); - loop { // answer session info queries until the current session is reached. assert_matches!( @@ -397,8 +361,7 @@ impl TestState { ))) .await; - self.handle_sync_queries(virtual_overseer, *leaf, n as BlockNumber, session) - .await; + self.handle_sync_queries(virtual_overseer, *leaf, session).await; } } diff --git a/node/core/runtime-api/Cargo.toml b/node/core/runtime-api/Cargo.toml index b7a9895e0c67..9ef6af06c5c2 100644 --- a/node/core/runtime-api/Cargo.toml +++ b/node/core/runtime-api/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" futures = "0.3.21" gum = { package = "tracing-gum", path = "../../gum" } memory-lru = "0.1.1" -parity-util-mem = { version = "0.12.0", default-features = false } +parity-util-mem = { version = "0.11.0", default-features = false } sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/malus/Cargo.toml b/node/malus/Cargo.toml index 9548857a03ed..b68adef1a1df 100644 --- a/node/malus/Cargo.toml +++ b/node/malus/Cargo.toml @@ -23,7 +23,7 @@ polkadot-node-core-backing = { path = "../core/backing" } polkadot-node-primitives = { path = "../primitives" } polkadot-primitives = { path = "../../primitives" } polkadot-node-core-pvf = { path = "../core/pvf" } -parity-util-mem = { version = "0.12.0", default-features = false, features = ["jemalloc-global"] } +parity-util-mem = { version = "0.11.0", default-features = false, features = ["jemalloc-global"] } color-eyre = { version = "0.6.1", default-features = false } assert_matches = "1.5" async-trait = "0.1.57" diff --git a/node/metrics/src/tests.rs b/node/metrics/src/tests.rs index 932cc7b68be7..56e07d96280d 100644 --- a/node/metrics/src/tests.rs +++ b/node/metrics/src/tests.rs @@ -92,11 +92,16 @@ async fn scrape_prometheus_metrics(metrics_uri: &str) -> HashMap { .expect("Scraper failed to parse Prometheus metrics") .samples .into_iter() - .filter_map(|prometheus_parse::Sample { metric, value, .. }| match value { - prometheus_parse::Value::Counter(value) => Some((metric, value as u64)), - prometheus_parse::Value::Gauge(value) => Some((metric, value as u64)), - prometheus_parse::Value::Untyped(value) => Some((metric, value as u64)), - _ => None, + .map(|sample| { + ( + sample.metric.to_owned(), + match sample.value { + prometheus_parse::Value::Counter(value) => value as u64, + prometheus_parse::Value::Gauge(value) => value as u64, + prometheus_parse::Value::Untyped(value) => value as u64, + _ => unreachable!("unexpected metric type"), + }, + ) }) .collect() } diff --git a/node/network/availability-distribution/Cargo.toml b/node/network/availability-distribution/Cargo.toml index 3e8626c18898..43d56a1ace24 100644 --- a/node/network/availability-distribution/Cargo.toml +++ b/node/network/availability-distribution/Cargo.toml @@ -19,7 +19,7 @@ sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "maste thiserror = "1.0.31" rand = "0.8.5" derive_more = "0.99.17" -lru = "0.8.0" +lru = "0.7.7" fatality = "0.0.6" [dev-dependencies] diff --git a/node/network/availability-distribution/src/requester/session_cache.rs b/node/network/availability-distribution/src/requester/session_cache.rs index cf01e448b70b..6d41d9301233 100644 --- a/node/network/availability-distribution/src/requester/session_cache.rs +++ b/node/network/availability-distribution/src/requester/session_cache.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::{collections::HashSet, num::NonZeroUsize}; +use std::collections::HashSet; use lru::LruCache; use rand::{seq::SliceRandom, thread_rng}; @@ -85,7 +85,7 @@ impl SessionCache { pub fn new() -> Self { SessionCache { // We need to cache the current and the last session the most: - session_info_cache: LruCache::new(NonZeroUsize::new(2).unwrap()), + session_info_cache: LruCache::new(2), } } diff --git a/node/network/availability-recovery/Cargo.toml b/node/network/availability-recovery/Cargo.toml index 86f6237740fa..fce9755a05a3 100644 --- a/node/network/availability-recovery/Cargo.toml +++ b/node/network/availability-recovery/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] futures = "0.3.21" -lru = "0.8.0" +lru = "0.7.7" rand = "0.8.5" fatality = "0.0.6" thiserror = "1.0.31" diff --git a/node/network/availability-recovery/src/lib.rs b/node/network/availability-recovery/src/lib.rs index f2f92cc54490..62401e3ad615 100644 --- a/node/network/availability-recovery/src/lib.rs +++ b/node/network/availability-recovery/src/lib.rs @@ -20,7 +20,6 @@ use std::{ collections::{HashMap, VecDeque}, - num::NonZeroUsize, pin::Pin, time::Duration, }; @@ -78,10 +77,7 @@ const LOG_TARGET: &str = "parachain::availability-recovery"; const N_PARALLEL: usize = 50; // Size of the LRU cache where we keep recovered data. -const LRU_SIZE: NonZeroUsize = match NonZeroUsize::new(16) { - Some(cap) => cap, - None => panic!("Availability-recovery cache size must be non-zero."), -}; +const LRU_SIZE: usize = 16; const COST_INVALID_REQUEST: Rep = Rep::CostMajor("Peer sent unparsable request"); diff --git a/node/network/collator-protocol/Cargo.toml b/node/network/collator-protocol/Cargo.toml index e089719106b5..df9e75c9e951 100644 --- a/node/network/collator-protocol/Cargo.toml +++ b/node/network/collator-protocol/Cargo.toml @@ -6,7 +6,6 @@ edition = "2021" [dependencies] always-assert = "0.1.2" -bitvec = { version = "1.0.1", default-features = false, features = ["alloc"] } futures = "0.3.21" futures-timer = "3" gum = { package = "tracing-gum", path = "../../gum" } diff --git a/node/network/collator-protocol/src/collator_side/metrics.rs b/node/network/collator-protocol/src/collator_side/metrics.rs deleted file mode 100644 index 85e00406b9ba..000000000000 --- a/node/network/collator-protocol/src/collator_side/metrics.rs +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2017-2022 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 . - -use polkadot_node_subsystem_util::metrics::{self, prometheus}; - -#[derive(Clone, Default)] -pub struct Metrics(Option); - -impl Metrics { - pub fn on_advertisment_made(&self) { - if let Some(metrics) = &self.0 { - metrics.advertisements_made.inc(); - } - } - - pub fn on_collation_sent_requested(&self) { - if let Some(metrics) = &self.0 { - metrics.collations_send_requested.inc(); - } - } - - pub fn on_collation_sent(&self) { - if let Some(metrics) = &self.0 { - metrics.collations_sent.inc(); - } - } - - /// Provide a timer for `process_msg` which observes on drop. - pub fn time_process_msg(&self) -> Option { - self.0.as_ref().map(|metrics| metrics.process_msg.start_timer()) - } - - /// Provide a timer for `distribute_collation` which observes on drop. - pub fn time_collation_distribution( - &self, - label: &'static str, - ) -> Option { - self.0.as_ref().map(|metrics| { - metrics.collation_distribution_time.with_label_values(&[label]).start_timer() - }) - } -} - -#[derive(Clone)] -struct MetricsInner { - advertisements_made: prometheus::Counter, - collations_sent: prometheus::Counter, - collations_send_requested: prometheus::Counter, - process_msg: prometheus::Histogram, - collation_distribution_time: prometheus::HistogramVec, -} - -impl metrics::Metrics for Metrics { - fn try_register( - registry: &prometheus::Registry, - ) -> std::result::Result { - let metrics = MetricsInner { - advertisements_made: prometheus::register( - prometheus::Counter::new( - "polkadot_parachain_collation_advertisements_made_total", - "A number of collation advertisements sent to validators.", - )?, - registry, - )?, - collations_send_requested: prometheus::register( - prometheus::Counter::new( - "polkadot_parachain_collations_sent_requested_total", - "A number of collations requested to be sent to validators.", - )?, - registry, - )?, - collations_sent: prometheus::register( - prometheus::Counter::new( - "polkadot_parachain_collations_sent_total", - "A number of collations sent to validators.", - )?, - registry, - )?, - process_msg: prometheus::register( - prometheus::Histogram::with_opts( - prometheus::HistogramOpts::new( - "polkadot_parachain_collator_protocol_collator_process_msg", - "Time spent within `collator_protocol_collator::process_msg`", - ) - .buckets(vec![ - 0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.35, 0.5, 0.75, - 1.0, - ]), - )?, - registry, - )?, - collation_distribution_time: prometheus::register( - prometheus::HistogramVec::new( - prometheus::HistogramOpts::new( - "polkadot_parachain_collator_protocol_collator_distribution_time", - "Time spent within `collator_protocol_collator::distribute_collation`", - ) - .buckets(vec![ - 0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.35, 0.5, 0.75, - 1.0, - ]), - &["state"], - )?, - registry, - )?, - }; - - Ok(Metrics(Some(metrics))) - } -} diff --git a/node/network/collator-protocol/src/collator_side/mod.rs b/node/network/collator-protocol/src/collator_side/mod.rs index 4f2eea2ca747..c1a20a2a670b 100644 --- a/node/network/collator-protocol/src/collator_side/mod.rs +++ b/node/network/collator-protocol/src/collator_side/mod.rs @@ -17,7 +17,7 @@ use std::{ collections::{HashMap, HashSet, VecDeque}, pin::Pin, - time::{Duration, Instant}, + time::Duration, }; use futures::{ @@ -44,25 +44,19 @@ use polkadot_node_subsystem::{ overseer, FromOrchestra, OverseerSignal, PerLeafSpan, }; use polkadot_node_subsystem_util::{ + metrics::{self, prometheus}, runtime::{get_availability_cores, get_group_rotation_info, RuntimeInfo}, TimeoutExt, }; use polkadot_primitives::v2::{ AuthorityDiscoveryId, CandidateHash, CandidateReceipt, CollatorPair, CoreIndex, CoreState, - GroupIndex, Hash, Id as ParaId, SessionIndex, + Hash, Id as ParaId, }; use super::LOG_TARGET; use crate::error::{log_error, Error, FatalError, Result}; use fatality::Split; -mod metrics; -mod validators_buffer; - -use validators_buffer::{ValidatorGroupsBuffer, VALIDATORS_BUFFER_CAPACITY}; - -pub use metrics::Metrics; - #[cfg(test)] mod tests; @@ -79,16 +73,111 @@ const COST_APPARENT_FLOOD: Rep = /// For considerations on this value, see: https://github.com/paritytech/polkadot/issues/4386 const MAX_UNSHARED_UPLOAD_TIME: Duration = Duration::from_millis(150); -/// Ensure that collator issues a connection request at least once every this many seconds. -/// Usually it's done when advertising new collation. However, if the core stays occupied or -/// it's not our turn to produce a candidate, it's important to disconnect from previous -/// peers. -/// -/// Validators are obtained from [`ValidatorGroupsBuffer::validators_to_connect`]. -const RECONNECT_TIMEOUT: Duration = Duration::from_secs(12); +#[derive(Clone, Default)] +pub struct Metrics(Option); + +impl Metrics { + fn on_advertisment_made(&self) { + if let Some(metrics) = &self.0 { + metrics.advertisements_made.inc(); + } + } + + fn on_collation_sent_requested(&self) { + if let Some(metrics) = &self.0 { + metrics.collations_send_requested.inc(); + } + } + + fn on_collation_sent(&self) { + if let Some(metrics) = &self.0 { + metrics.collations_sent.inc(); + } + } + + /// Provide a timer for `process_msg` which observes on drop. + fn time_process_msg(&self) -> Option { + self.0.as_ref().map(|metrics| metrics.process_msg.start_timer()) + } -/// How often to check for reconnect timeout. -const RECONNECT_POLL: Duration = Duration::from_secs(1); + /// Provide a timer for `distribute_collation` which observes on drop. + fn time_collation_distribution( + &self, + label: &'static str, + ) -> Option { + self.0.as_ref().map(|metrics| { + metrics.collation_distribution_time.with_label_values(&[label]).start_timer() + }) + } +} + +#[derive(Clone)] +struct MetricsInner { + advertisements_made: prometheus::Counter, + collations_sent: prometheus::Counter, + collations_send_requested: prometheus::Counter, + process_msg: prometheus::Histogram, + collation_distribution_time: prometheus::HistogramVec, +} + +impl metrics::Metrics for Metrics { + fn try_register( + registry: &prometheus::Registry, + ) -> std::result::Result { + let metrics = MetricsInner { + advertisements_made: prometheus::register( + prometheus::Counter::new( + "polkadot_parachain_collation_advertisements_made_total", + "A number of collation advertisements sent to validators.", + )?, + registry, + )?, + collations_send_requested: prometheus::register( + prometheus::Counter::new( + "polkadot_parachain_collations_sent_requested_total", + "A number of collations requested to be sent to validators.", + )?, + registry, + )?, + collations_sent: prometheus::register( + prometheus::Counter::new( + "polkadot_parachain_collations_sent_total", + "A number of collations sent to validators.", + )?, + registry, + )?, + process_msg: prometheus::register( + prometheus::Histogram::with_opts( + prometheus::HistogramOpts::new( + "polkadot_parachain_collator_protocol_collator_process_msg", + "Time spent within `collator_protocol_collator::process_msg`", + ) + .buckets(vec![ + 0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.35, 0.5, 0.75, + 1.0, + ]), + )?, + registry, + )?, + collation_distribution_time: prometheus::register( + prometheus::HistogramVec::new( + prometheus::HistogramOpts::new( + "polkadot_parachain_collator_protocol_collator_distribution_time", + "Time spent within `collator_protocol_collator::distribute_collation`", + ) + .buckets(vec![ + 0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.35, 0.5, 0.75, + 1.0, + ]), + &["state"], + )?, + registry, + )?, + }; + + Ok(Metrics(Some(metrics))) + } +} /// Info about validators we are currently connected to. /// @@ -180,14 +269,8 @@ struct WaitingCollationFetches { waiting_peers: HashSet, } -struct CollationSendResult { - relay_parent: Hash, - peer_id: PeerId, - timed_out: bool, -} - type ActiveCollationFetches = - FuturesUnordered + Send + 'static>>>; + FuturesUnordered + Send + 'static>>>; struct State { /// Our network peer id. @@ -225,13 +308,6 @@ struct State { /// by `PeerConnected` events. peer_ids: HashMap>, - /// Tracks which validators we want to stay connected to. - validator_groups_buf: ValidatorGroupsBuffer, - - /// Timestamp of the last connection request to a non-empty list of validators, - /// `None` otherwise. - last_connected_at: Option, - /// Metrics. metrics: Metrics, @@ -263,8 +339,6 @@ impl State { collation_result_senders: Default::default(), our_validators_groups: Default::default(), peer_ids: Default::default(), - validator_groups_buf: ValidatorGroupsBuffer::with_capacity(VALIDATORS_BUFFER_CAPACITY), - last_connected_at: None, waiting_collation_fetches: Default::default(), active_collation_fetches: Default::default(), } @@ -299,7 +373,6 @@ async fn distribute_collation( result_sender: Option>, ) -> Result<()> { let relay_parent = receipt.descriptor.relay_parent; - let candidate_hash = receipt.hash(); // This collation is not in the active-leaves set. if !state.view.contains(&relay_parent) { @@ -339,10 +412,10 @@ async fn distribute_collation( }; // Determine the group on that core. - let GroupValidators { validators, session_index, group_index } = + let current_validators = determine_our_validators(ctx, runtime, our_core, num_cores, relay_parent).await?; - if validators.is_empty() { + if current_validators.validators.is_empty() { gum::warn!( target: LOG_TARGET, core = ?our_core, @@ -352,36 +425,24 @@ async fn distribute_collation( return Ok(()) } - // It's important to insert new collation bits **before** - // issuing a connection request. - // - // If a validator managed to fetch all the relevant collations - // but still assigned to our core, we keep the connection alive. - state.validator_groups_buf.note_collation_advertised( - relay_parent, - session_index, - group_index, - &validators, - ); - gum::debug!( target: LOG_TARGET, para_id = %id, relay_parent = %relay_parent, - ?candidate_hash, + candidate_hash = ?receipt.hash(), pov_hash = ?pov.hash(), core = ?our_core, - current_validators = ?validators, + ?current_validators, "Accepted collation, connecting to validators." ); - // Update a set of connected validators if necessary. - state.last_connected_at = connect_to_validators(ctx, &state.validator_groups_buf).await; + // Issue a discovery request for the validators of the current group: + connect_to_validators(ctx, current_validators.validators.into_iter().collect()).await; state.our_validators_groups.insert(relay_parent, ValidatorGroup::new()); if let Some(result_sender) = result_sender { - state.collation_result_senders.insert(candidate_hash, result_sender); + state.collation_result_senders.insert(receipt.hash(), result_sender); } state @@ -422,9 +483,6 @@ async fn determine_core( struct GroupValidators { /// The validators of above group (their discovery keys). validators: Vec, - - session_index: SessionIndex, - group_index: GroupIndex, } /// Figure out current group of validators assigned to the para being collated on. @@ -458,11 +516,7 @@ async fn determine_our_validators( let current_validators = current_validators.iter().map(|i| validators[i.0 as usize].clone()).collect(); - let current_validators = GroupValidators { - validators: current_validators, - session_index, - group_index: current_group_index, - }; + let current_validators = GroupValidators { validators: current_validators }; Ok(current_validators) } @@ -487,19 +541,13 @@ async fn declare(ctx: &mut Context, state: &mut State, peer: PeerId) { } } -/// Updates a set of connected validators based on their advertisement-bits -/// in a validators buffer. -/// -/// Returns current timestamp if the connection request was non-empty, `None` -/// otherwise. +/// Issue a connection request to a set of validators and +/// revoke the previous connection request. #[overseer::contextbounds(CollatorProtocol, prefix = self::overseer)] async fn connect_to_validators( ctx: &mut Context, - validator_groups_buf: &ValidatorGroupsBuffer, -) -> Option { - let validator_ids = validator_groups_buf.validators_to_connect(); - let is_disconnect = validator_ids.is_empty(); - + validator_ids: Vec, +) { // ignore address resolution failure // will reissue a new request on new collation let (failed, _) = oneshot::channel(); @@ -509,8 +557,6 @@ async fn connect_to_validators( failed, }) .await; - - (!is_disconnect).then_some(Instant::now()) } /// Advertise collation to the given `peer`. @@ -669,9 +715,15 @@ async fn send_collation( state.active_collation_fetches.push( async move { let r = rx.timeout(MAX_UNSHARED_UPLOAD_TIME).await; - let timed_out = r.is_none(); - - CollationSendResult { relay_parent, peer_id, timed_out } + if r.is_none() { + gum::debug!( + target: LOG_TARGET, + ?relay_parent, + ?peer_id, + "Sending collation to validator timed out, carrying on with next validator." + ); + } + (relay_parent, peer_id) } .boxed(), ); @@ -934,7 +986,6 @@ async fn handle_our_view_change(state: &mut State, view: OurView) -> Result<()> state.our_validators_groups.remove(removed); state.span_per_relay_parent.remove(removed); state.waiting_collation_fetches.remove(removed); - state.validator_groups_buf.remove_relay_parent(removed); } state.view = view; @@ -956,9 +1007,6 @@ pub(crate) async fn run( let mut state = State::new(local_peer_id, collator_pair, metrics); let mut runtime = RuntimeInfo::new(None); - let reconnect_stream = super::tick_stream(RECONNECT_POLL); - pin_mut!(reconnect_stream); - loop { let recv_req = req_receiver.recv(|| vec![COST_INVALID_REQUEST]).fuse(); pin_mut!(recv_req); @@ -974,25 +1022,7 @@ pub(crate) async fn run( FromOrchestra::Signal(BlockFinalized(..)) => {} FromOrchestra::Signal(Conclude) => return Ok(()), }, - CollationSendResult { - relay_parent, - peer_id, - timed_out, - } = state.active_collation_fetches.select_next_some() => { - if timed_out { - gum::debug!( - target: LOG_TARGET, - ?relay_parent, - ?peer_id, - "Sending collation to validator timed out, carrying on with next validator", - ); - } else { - for authority_id in state.peer_ids.get(&peer_id).into_iter().flatten() { - // Timeout not hit, this peer is no longer interested in this relay parent. - state.validator_groups_buf.reset_validator_interest(relay_parent, authority_id); - } - } - + (relay_parent, peer_id) = state.active_collation_fetches.select_next_some() => { let next = if let Some(waiting) = state.waiting_collation_fetches.get_mut(&relay_parent) { waiting.waiting_peers.remove(&peer_id); if let Some(next) = waiting.waiting.pop_front() { @@ -1012,29 +1042,7 @@ pub(crate) async fn run( send_collation(&mut state, next, receipt, pov).await; } - }, - _ = reconnect_stream.next() => { - let now = Instant::now(); - if state - .last_connected_at - .map_or(false, |timestamp| now - timestamp > RECONNECT_TIMEOUT) - { - // Remove all advertisements from the buffer if the timeout was hit. - // Usually, it shouldn't be necessary as leaves get deactivated, rather - // serves as a safeguard against finality lags. - state.validator_groups_buf.clear_advertisements(); - // Returns `None` if connection request is empty. - state.last_connected_at = - connect_to_validators(&mut ctx, &state.validator_groups_buf).await; - - gum::debug!( - target: LOG_TARGET, - timeout = ?RECONNECT_TIMEOUT, - "Timeout hit, sent a connection request. Disconnected from all validators = {}", - state.last_connected_at.is_none(), - ); - } - }, + } in_req = recv_req => { match in_req { Ok(req) => { diff --git a/node/network/collator-protocol/src/collator_side/tests.rs b/node/network/collator-protocol/src/collator_side/tests.rs index c20a2d6c97a5..2d2f2cf043de 100644 --- a/node/network/collator-protocol/src/collator_side/tests.rs +++ b/node/network/collator-protocol/src/collator_side/tests.rs @@ -56,7 +56,7 @@ struct TestState { group_rotation_info: GroupRotationInfo, validator_peer_id: Vec, relay_parent: Hash, - availability_cores: Vec, + availability_core: CoreState, local_peer_id: PeerId, collator_pair: CollatorPair, session_index: SessionIndex, @@ -88,15 +88,14 @@ impl Default for TestState { let validator_peer_id = std::iter::repeat_with(|| PeerId::random()).take(discovery_keys.len()).collect(); - let validator_groups = vec![vec![2, 0, 4], vec![1, 3]] + let validator_groups = vec![vec![2, 0, 4], vec![3, 2, 4]] .into_iter() .map(|g| g.into_iter().map(ValidatorIndex).collect()) .collect(); let group_rotation_info = GroupRotationInfo { session_start_block: 0, group_rotation_frequency: 100, now: 1 }; - let availability_cores = - vec![CoreState::Scheduled(ScheduledCore { para_id, collator: None }), CoreState::Free]; + let availability_core = CoreState::Scheduled(ScheduledCore { para_id, collator: None }); let relay_parent = Hash::random(); @@ -123,7 +122,7 @@ impl Default for TestState { group_rotation_info, validator_peer_id, relay_parent, - availability_cores, + availability_core, local_peer_id, collator_pair, session_index: 1, @@ -133,9 +132,7 @@ impl Default for TestState { impl TestState { fn current_group_validator_indices(&self) -> &[ValidatorIndex] { - let core_num = self.availability_cores.len(); - let GroupIndex(group_idx) = self.group_rotation_info.group_for_core(CoreIndex(0), core_num); - &self.session_info.validator_groups[group_idx as usize] + &self.session_info.validator_groups[0] } fn current_session_index(&self) -> SessionIndex { @@ -336,7 +333,7 @@ async fn distribute_collation( RuntimeApiRequest::AvailabilityCores(tx) )) => { assert_eq!(relay_parent, test_state.relay_parent); - tx.send(Ok(test_state.availability_cores.clone())).unwrap(); + tx.send(Ok(vec![test_state.availability_core.clone()])).unwrap(); } ); @@ -990,104 +987,3 @@ where test_harness }); } - -#[test] -fn connect_to_buffered_groups() { - let mut test_state = TestState::default(); - let local_peer_id = test_state.local_peer_id.clone(); - let collator_pair = test_state.collator_pair.clone(); - - test_harness(local_peer_id, collator_pair, |test_harness| async move { - let mut virtual_overseer = test_harness.virtual_overseer; - let mut req_cfg = test_harness.req_cfg; - - setup_system(&mut virtual_overseer, &test_state).await; - - let group_a = test_state.current_group_validator_authority_ids(); - let peers_a = test_state.current_group_validator_peer_ids(); - assert!(group_a.len() > 1); - - distribute_collation(&mut virtual_overseer, &test_state, false).await; - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::NetworkBridgeTx( - NetworkBridgeTxMessage::ConnectToValidators { validator_ids, .. } - ) => { - assert_eq!(group_a, validator_ids); - } - ); - - let head_a = test_state.relay_parent; - - for (val, peer) in group_a.iter().zip(&peers_a) { - connect_peer(&mut virtual_overseer, peer.clone(), Some(val.clone())).await; - } - - for peer_id in &peers_a { - expect_declare_msg(&mut virtual_overseer, &test_state, peer_id).await; - } - - // Update views. - for peed_id in &peers_a { - send_peer_view_change(&mut virtual_overseer, peed_id, vec![head_a]).await; - expect_advertise_collation_msg(&mut virtual_overseer, peed_id, head_a).await; - } - - let peer = peers_a[0]; - // Peer from the group fetches the collation. - let (pending_response, rx) = oneshot::channel(); - req_cfg - .inbound_queue - .as_mut() - .unwrap() - .send(RawIncomingRequest { - peer, - payload: CollationFetchingRequest { - relay_parent: head_a, - para_id: test_state.para_id, - } - .encode(), - pending_response, - }) - .await - .unwrap(); - assert_matches!( - rx.await, - Ok(full_response) => { - let CollationFetchingResponse::Collation(..): CollationFetchingResponse = - CollationFetchingResponse::decode( - &mut full_response.result.expect("We should have a proper answer").as_ref(), - ) - .expect("Decoding should work"); - } - ); - - test_state.advance_to_new_round(&mut virtual_overseer, true).await; - test_state.group_rotation_info = test_state.group_rotation_info.bump_rotation(); - - let head_b = test_state.relay_parent; - let group_b = test_state.current_group_validator_authority_ids(); - assert_ne!(head_a, head_b); - assert_ne!(group_a, group_b); - - distribute_collation(&mut virtual_overseer, &test_state, false).await; - - // Should be connected to both groups except for the validator that fetched advertised - // collation. - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::NetworkBridgeTx( - NetworkBridgeTxMessage::ConnectToValidators { validator_ids, .. } - ) => { - assert!(!validator_ids.contains(&group_a[0])); - - for validator in group_a[1..].iter().chain(&group_b) { - assert!(validator_ids.contains(validator)); - } - } - ); - - TestHarness { virtual_overseer, req_cfg } - }); -} diff --git a/node/network/collator-protocol/src/collator_side/validators_buffer.rs b/node/network/collator-protocol/src/collator_side/validators_buffer.rs deleted file mode 100644 index 5bb31c72d6c5..000000000000 --- a/node/network/collator-protocol/src/collator_side/validators_buffer.rs +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright 2017-2022 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 . - -//! Validator groups buffer for connection managements. -//! -//! Solves 2 problems: -//! 1. A collator may want to stay connected to multiple groups on rotation boundaries. -//! 2. It's important to disconnect from validator when there're no collations to be fetched. -//! -//! We keep a simple FIFO buffer of N validator groups and a bitvec for each advertisement, -//! 1 indicating we want to be connected to i-th validator in a buffer, 0 otherwise. -//! -//! The bit is set to 1 for the whole **group** whenever it's inserted into the buffer. Given a relay -//! parent, one can reset a bit back to 0 for particular **validator**. For example, if a collation -//! was fetched or some timeout has been hit. -//! -//! The bitwise OR over known advertisements gives us validators indices for connection request. - -use std::{ - collections::{HashMap, VecDeque}, - num::NonZeroUsize, - ops::Range, -}; - -use bitvec::{bitvec, vec::BitVec}; - -use polkadot_primitives::v2::{AuthorityDiscoveryId, GroupIndex, Hash, SessionIndex}; - -/// The ring buffer stores at most this many unique validator groups. -/// -/// This value should be chosen in way that all groups assigned to our para -/// in the view can fit into the buffer. -pub const VALIDATORS_BUFFER_CAPACITY: NonZeroUsize = match NonZeroUsize::new(3) { - Some(cap) => cap, - None => panic!("buffer capacity must be non-zero"), -}; - -/// Unique identifier of a validators group. -#[derive(Debug)] -struct ValidatorsGroupInfo { - /// Number of validators in the group. - len: usize, - session_index: SessionIndex, - group_index: GroupIndex, -} - -/// Ring buffer of validator groups. -/// -/// Tracks which peers we want to be connected to with respect to advertised collations. -#[derive(Debug)] -pub struct ValidatorGroupsBuffer { - /// Validator groups identifiers we **had** advertisements for. - group_infos: VecDeque, - /// Continuous buffer of validators discovery keys. - validators: VecDeque, - /// Mapping from relay-parent to bit-vectors with bits for all `validators`. - /// Invariants kept: All bit-vectors are guaranteed to have the same size. - should_be_connected: HashMap, - /// Buffer capacity, limits the number of **groups** tracked. - cap: NonZeroUsize, -} - -impl ValidatorGroupsBuffer { - /// Creates a new buffer with a non-zero capacity. - pub fn with_capacity(cap: NonZeroUsize) -> Self { - Self { - group_infos: VecDeque::new(), - validators: VecDeque::new(), - should_be_connected: HashMap::new(), - cap, - } - } - - /// Returns discovery ids of validators we have at least one advertised-but-not-fetched - /// collation for. - pub fn validators_to_connect(&self) -> Vec { - let validators_num = self.validators.len(); - let bits = self - .should_be_connected - .values() - .fold(bitvec![0; validators_num], |acc, next| acc | next); - - self.validators - .iter() - .enumerate() - .filter_map(|(idx, authority_id)| bits[idx].then_some(authority_id.clone())) - .collect() - } - - /// Note a new advertisement, marking that we want to be connected to validators - /// from this group. - /// - /// If max capacity is reached and the group is new, drops validators from the back - /// of the buffer. - pub fn note_collation_advertised( - &mut self, - relay_parent: Hash, - session_index: SessionIndex, - group_index: GroupIndex, - validators: &[AuthorityDiscoveryId], - ) { - if validators.is_empty() { - return - } - - match self.group_infos.iter().enumerate().find(|(_, group)| { - group.session_index == session_index && group.group_index == group_index - }) { - Some((idx, group)) => { - let group_start_idx = self.group_lengths_iter().take(idx).sum(); - self.set_bits(relay_parent, group_start_idx..(group_start_idx + group.len)); - }, - None => self.push(relay_parent, session_index, group_index, validators), - } - } - - /// Note that a validator is no longer interested in a given relay parent. - pub fn reset_validator_interest( - &mut self, - relay_parent: Hash, - authority_id: &AuthorityDiscoveryId, - ) { - let bits = match self.should_be_connected.get_mut(&relay_parent) { - Some(bits) => bits, - None => return, - }; - - for (idx, auth_id) in self.validators.iter().enumerate() { - if auth_id == authority_id { - bits.set(idx, false); - } - } - } - - /// Remove relay parent from the buffer. - /// - /// The buffer will no longer track which validators are interested in a corresponding - /// advertisement. - pub fn remove_relay_parent(&mut self, relay_parent: &Hash) { - self.should_be_connected.remove(relay_parent); - } - - /// Removes all advertisements from the buffer. - pub fn clear_advertisements(&mut self) { - self.should_be_connected.clear(); - } - - /// Pushes a new group to the buffer along with advertisement, setting all validators - /// bits to 1. - /// - /// If the buffer is full, drops group from the tail. - fn push( - &mut self, - relay_parent: Hash, - session_index: SessionIndex, - group_index: GroupIndex, - validators: &[AuthorityDiscoveryId], - ) { - let new_group_info = - ValidatorsGroupInfo { len: validators.len(), session_index, group_index }; - - let buf = &mut self.group_infos; - let cap = self.cap.get(); - - if buf.len() >= cap { - let pruned_group = buf.pop_front().expect("buf is not empty; qed"); - self.validators.drain(..pruned_group.len); - - self.should_be_connected.values_mut().for_each(|bits| { - bits.as_mut_bitslice().shift_left(pruned_group.len); - }); - } - - self.validators.extend(validators.iter().cloned()); - buf.push_back(new_group_info); - let buf_len = buf.len(); - let group_start_idx = self.group_lengths_iter().take(buf_len - 1).sum(); - - let new_len = self.validators.len(); - self.should_be_connected - .values_mut() - .for_each(|bits| bits.resize(new_len, false)); - self.set_bits(relay_parent, group_start_idx..(group_start_idx + validators.len())); - } - - /// Sets advertisement bits to 1 in a given range (usually corresponding to some group). - /// If the relay parent is unknown, inserts 0-initialized bitvec first. - /// - /// The range must be ensured to be within bounds. - fn set_bits(&mut self, relay_parent: Hash, range: Range) { - let bits = self - .should_be_connected - .entry(relay_parent) - .or_insert_with(|| bitvec![0; self.validators.len()]); - - bits[range].fill(true); - } - - /// Returns iterator over numbers of validators in groups. - /// - /// Useful for getting an index of the first validator in i-th group. - fn group_lengths_iter(&self) -> impl Iterator + '_ { - self.group_infos.iter().map(|group| group.len) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use sp_keyring::Sr25519Keyring; - - #[test] - fn one_capacity_buffer() { - let cap = NonZeroUsize::new(1).unwrap(); - let mut buf = ValidatorGroupsBuffer::with_capacity(cap); - - let hash_a = Hash::repeat_byte(0x1); - let hash_b = Hash::repeat_byte(0x2); - - let validators: Vec<_> = [ - Sr25519Keyring::Alice, - Sr25519Keyring::Bob, - Sr25519Keyring::Charlie, - Sr25519Keyring::Dave, - Sr25519Keyring::Ferdie, - ] - .into_iter() - .map(|key| AuthorityDiscoveryId::from(key.public())) - .collect(); - - assert!(buf.validators_to_connect().is_empty()); - - buf.note_collation_advertised(hash_a, 0, GroupIndex(0), &validators[..2]); - assert_eq!(buf.validators_to_connect(), validators[..2].to_vec()); - - buf.reset_validator_interest(hash_a, &validators[1]); - assert_eq!(buf.validators_to_connect(), vec![validators[0].clone()]); - - buf.note_collation_advertised(hash_b, 0, GroupIndex(1), &validators[2..]); - assert_eq!(buf.validators_to_connect(), validators[2..].to_vec()); - - for validator in &validators[2..] { - buf.reset_validator_interest(hash_b, validator); - } - assert!(buf.validators_to_connect().is_empty()); - } - - #[test] - fn buffer_works() { - let cap = NonZeroUsize::new(3).unwrap(); - let mut buf = ValidatorGroupsBuffer::with_capacity(cap); - - let hashes: Vec<_> = (0..5).map(Hash::repeat_byte).collect(); - - let validators: Vec<_> = [ - Sr25519Keyring::Alice, - Sr25519Keyring::Bob, - Sr25519Keyring::Charlie, - Sr25519Keyring::Dave, - Sr25519Keyring::Ferdie, - ] - .into_iter() - .map(|key| AuthorityDiscoveryId::from(key.public())) - .collect(); - - buf.note_collation_advertised(hashes[0], 0, GroupIndex(0), &validators[..2]); - buf.note_collation_advertised(hashes[1], 0, GroupIndex(0), &validators[..2]); - buf.note_collation_advertised(hashes[2], 0, GroupIndex(1), &validators[2..4]); - buf.note_collation_advertised(hashes[2], 0, GroupIndex(1), &validators[2..4]); - - assert_eq!(buf.validators_to_connect(), validators[..4].to_vec()); - - for validator in &validators[2..4] { - buf.reset_validator_interest(hashes[2], validator); - } - - buf.reset_validator_interest(hashes[1], &validators[0]); - assert_eq!(buf.validators_to_connect(), validators[..2].to_vec()); - - buf.reset_validator_interest(hashes[0], &validators[0]); - assert_eq!(buf.validators_to_connect(), vec![validators[1].clone()]); - - buf.note_collation_advertised(hashes[3], 0, GroupIndex(1), &validators[2..4]); - buf.note_collation_advertised( - hashes[4], - 0, - GroupIndex(2), - std::slice::from_ref(&validators[4]), - ); - - buf.reset_validator_interest(hashes[3], &validators[2]); - buf.note_collation_advertised( - hashes[4], - 0, - GroupIndex(3), - std::slice::from_ref(&validators[0]), - ); - - assert_eq!( - buf.validators_to_connect(), - vec![validators[3].clone(), validators[4].clone(), validators[0].clone()] - ); - } -} diff --git a/node/network/collator-protocol/src/lib.rs b/node/network/collator-protocol/src/lib.rs index b71acc127c88..66659e4b5bee 100644 --- a/node/network/collator-protocol/src/lib.rs +++ b/node/network/collator-protocol/src/lib.rs @@ -21,12 +21,9 @@ #![deny(unused_crate_dependencies)] #![recursion_limit = "256"] -use std::time::{Duration, Instant}; +use std::time::Duration; -use futures::{ - stream::{FusedStream, StreamExt}, - FutureExt, TryFutureExt, -}; +use futures::{FutureExt, TryFutureExt}; use sp_keystore::SyncCryptoStorePtr; @@ -137,23 +134,3 @@ async fn modify_reputation( sender.send_message(NetworkBridgeTxMessage::ReportPeer(peer, rep)).await; } - -/// Wait until tick and return the timestamp for the following one. -async fn wait_until_next_tick(last_poll: Instant, period: Duration) -> Instant { - let now = Instant::now(); - let next_poll = last_poll + period; - - if next_poll > now { - futures_timer::Delay::new(next_poll - now).await - } - - Instant::now() -} - -/// Returns an infinite stream that yields with an interval of `period`. -fn tick_stream(period: Duration) -> impl FusedStream { - futures::stream::unfold(Instant::now(), move |next_check| async move { - Some(((), wait_until_next_tick(next_check, period).await)) - }) - .fuse() -} diff --git a/node/network/collator-protocol/src/validator_side/mod.rs b/node/network/collator-protocol/src/validator_side/mod.rs index b2b3dc4824b5..47795aac0ce2 100644 --- a/node/network/collator-protocol/src/validator_side/mod.rs +++ b/node/network/collator-protocol/src/validator_side/mod.rs @@ -19,7 +19,7 @@ use futures::{ channel::oneshot, future::{BoxFuture, Fuse, FusedFuture}, select, - stream::FuturesUnordered, + stream::{FusedStream, FuturesUnordered}, FutureExt, StreamExt, }; use futures_timer::Delay; @@ -57,7 +57,7 @@ use polkadot_primitives::v2::{CandidateReceipt, CollatorId, Hash, Id as ParaId}; use crate::error::Result; -use super::{modify_reputation, tick_stream, LOG_TARGET}; +use super::{modify_reputation, LOG_TARGET}; #[cfg(test)] mod tests; @@ -85,23 +85,19 @@ const BENEFIT_NOTIFY_GOOD: Rep = /// to finish on time. /// /// There is debug logging output, so we can adjust this value based on production results. -#[cfg(not(test))] const MAX_UNSHARED_DOWNLOAD_TIME: Duration = Duration::from_millis(400); // How often to check all peers with activity. #[cfg(not(test))] const ACTIVITY_POLL: Duration = Duration::from_secs(1); -#[cfg(test)] -const MAX_UNSHARED_DOWNLOAD_TIME: Duration = Duration::from_millis(100); - #[cfg(test)] const ACTIVITY_POLL: Duration = Duration::from_millis(10); // How often to poll collation responses. // This is a hack that should be removed in a refactoring. // See https://github.com/paritytech/polkadot/issues/4182 -const CHECK_COLLATIONS_POLL: Duration = Duration::from_millis(50); +const CHECK_COLLATIONS_POLL: Duration = Duration::from_millis(5); #[derive(Clone, Default)] pub struct Metrics(Option); @@ -1171,6 +1167,25 @@ async fn process_msg( } } +// wait until next inactivity check. returns the instant for the following check. +async fn wait_until_next_check(last_poll: Instant) -> Instant { + let now = Instant::now(); + let next_poll = last_poll + ACTIVITY_POLL; + + if next_poll > now { + Delay::new(next_poll - now).await + } + + Instant::now() +} + +fn infinite_stream(every: Duration) -> impl FusedStream { + futures::stream::unfold(Instant::now() + every, |next_check| async move { + Some(((), wait_until_next_check(next_check).await)) + }) + .fuse() +} + /// The main run loop. #[overseer::contextbounds(CollatorProtocol, prefix = self::overseer)] pub(crate) async fn run( @@ -1181,10 +1196,10 @@ pub(crate) async fn run( ) -> std::result::Result<(), crate::error::FatalError> { let mut state = State { metrics, ..Default::default() }; - let next_inactivity_stream = tick_stream(ACTIVITY_POLL); + let next_inactivity_stream = infinite_stream(ACTIVITY_POLL); futures::pin_mut!(next_inactivity_stream); - let check_collations_stream = tick_stream(CHECK_COLLATIONS_POLL); + let check_collations_stream = infinite_stream(CHECK_COLLATIONS_POLL); futures::pin_mut!(check_collations_stream); loop { diff --git a/node/network/collator-protocol/src/validator_side/tests.rs b/node/network/collator-protocol/src/validator_side/tests.rs index ae8644cea521..15740e5d5efa 100644 --- a/node/network/collator-protocol/src/validator_side/tests.rs +++ b/node/network/collator-protocol/src/validator_side/tests.rs @@ -20,7 +20,7 @@ use futures::{executor, future, Future}; use sp_core::{crypto::Pair, Encode}; use sp_keyring::Sr25519Keyring; use sp_keystore::{testing::KeyStore as TestKeyStore, SyncCryptoStore}; -use std::{iter, sync::Arc, task::Poll, time::Duration}; +use std::{iter, sync::Arc, time::Duration}; use polkadot_node_network_protocol::{ our_view, @@ -493,11 +493,17 @@ fn collator_authentication_verification_works() { }); } -/// Tests that a validator fetches only one collation at any moment of time -/// per relay parent and ignores other advertisements once a candidate gets -/// seconded. +// A test scenario that takes the following steps +// - Two collators connect, declare themselves and advertise a collation relevant to +// our view. +// - Collation protocol should request one PoV. +// - Collation protocol should disconnect both collators after having received the collation. +// - The same collators plus an additional collator connect again and send `PoV`s for a different relay parent. +// - Collation protocol will request one PoV, but we will cancel it. +// - Collation protocol should request the second PoV which does not succeed in time. +// - Collation protocol should request third PoV. #[test] -fn fetch_one_collation_at_a_time() { +fn fetch_collations_works() { let test_state = TestState::default(); test_harness(|test_harness| async move { @@ -569,37 +575,21 @@ fn fetch_one_collation_at_a_time() { ) .await; - // Ensure the subsystem is polled. - test_helpers::Yield::new().await; - - // Second collation is not requested since there's already seconded one. - assert_matches!(futures::poll!(virtual_overseer.recv().boxed()), Poll::Pending); - - virtual_overseer - }) -} - -/// Tests that a validator starts fetching next queued collations on [`MAX_UNSHARED_DOWNLOAD_TIME`] -/// timeout and in case of an error. -#[test] -fn fetches_next_collation() { - let test_state = TestState::default(); - - test_harness(|test_harness| async move { - let TestHarness { mut virtual_overseer } = test_harness; - - let second = Hash::random(); - overseer_send( &mut virtual_overseer, - CollatorProtocolMessage::NetworkBridgeUpdate(NetworkBridgeEvent::OurViewChange( - our_view![test_state.relay_parent, second], + CollatorProtocolMessage::NetworkBridgeUpdate(NetworkBridgeEvent::PeerDisconnected( + peer_b.clone(), )), ) .await; - respond_to_core_info_queries(&mut virtual_overseer, &test_state).await; - respond_to_core_info_queries(&mut virtual_overseer, &test_state).await; + overseer_send( + &mut virtual_overseer, + CollatorProtocolMessage::NetworkBridgeUpdate(NetworkBridgeEvent::PeerDisconnected( + peer_c.clone(), + )), + ) + .await; let peer_b = PeerId::random(); let peer_c = PeerId::random(); diff --git a/node/network/dispute-distribution/Cargo.toml b/node/network/dispute-distribution/Cargo.toml index a731175f0521..f50f24bf42c8 100644 --- a/node/network/dispute-distribution/Cargo.toml +++ b/node/network/dispute-distribution/Cargo.toml @@ -6,7 +6,6 @@ edition = "2021" [dependencies] futures = "0.3.21" -futures-timer = "3.0.2" gum = { package = "tracing-gum", path = "../../gum" } derive_more = "0.99.17" parity-scale-codec = { version = "3.1.5", features = ["std"] } @@ -21,8 +20,7 @@ sp-application-crypto = { git = "https://github.com/paritytech/substrate", branc sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } thiserror = "1.0.31" fatality = "0.0.6" -lru = "0.8.0" -indexmap = "1.9.1" +lru = "0.7.7" [dev-dependencies] async-trait = "0.1.57" diff --git a/node/network/dispute-distribution/src/lib.rs b/node/network/dispute-distribution/src/lib.rs index f109d5e6a40e..aefd66e0ae79 100644 --- a/node/network/dispute-distribution/src/lib.rs +++ b/node/network/dispute-distribution/src/lib.rs @@ -24,8 +24,6 @@ //! The sender is responsible for getting our vote out, see [`sender`]. The receiver handles //! incoming [`DisputeRequest`]s and offers spam protection, see [`receiver`]. -use std::{num::NonZeroUsize, time::Duration}; - use futures::{channel::mpsc, FutureExt, StreamExt, TryFutureExt}; use polkadot_node_network_protocol::authority_discovery::AuthorityDiscovery; @@ -66,19 +64,16 @@ use self::sender::{DisputeSender, TaskFinish}; /// via a dedicated channel and forwarding them to the dispute coordinator via /// `DisputeCoordinatorMessage::ImportStatements`. Being the interface to the network and untrusted /// nodes, the reality is not that simple of course. Before importing statements the receiver will -/// batch up imports as well as possible for efficient imports while maintaining timely dispute -/// resolution and handling of spamming validators: +/// make sure as good as it can to filter out malicious/unwanted/spammy requests. For this it does +/// the following: /// /// - Drop all messages from non validator nodes, for this it requires the [`AuthorityDiscovery`] /// service. -/// - Drop messages from a node, if it sends at a too high rate. -/// - Filter out duplicate messages (over some period of time). +/// - Drop messages from a node, if we are already importing a message from that node (flood). +/// - Drop messages from nodes, that provided us messages where the statement import failed. /// - Drop any obviously invalid votes (invalid signatures for example). /// - Ban peers whose votes were deemed invalid. /// -/// In general dispute-distribution works on limiting the work the dispute-coordinator will have to -/// do, while at the same time making it aware of new disputes as fast as possible. -/// /// For successfully imported votes, we will confirm the receipt of the message back to the sender. /// This way a received confirmation guarantees, that the vote has been stored to disk by the /// receiver. @@ -98,20 +93,6 @@ pub use metrics::Metrics; const LOG_TARGET: &'static str = "parachain::dispute-distribution"; -/// Rate limit on the `receiver` side. -/// -/// If messages from one peer come in at a higher rate than every `RECEIVE_RATE_LIMIT` on average, we -/// start dropping messages from that peer to enforce that limit. -pub const RECEIVE_RATE_LIMIT: Duration = Duration::from_millis(100); - -/// Rate limit on the `sender` side. -/// -/// In order to not hit the `RECEIVE_RATE_LIMIT` on the receiving side, we limit out sending rate as -/// well. -/// -/// We add 50ms extra, just to have some save margin to the `RECEIVE_RATE_LIMIT`. -pub const SEND_RATE_LIMIT: Duration = RECEIVE_RATE_LIMIT.saturating_add(Duration::from_millis(50)); - /// The dispute distribution subsystem. pub struct DisputeDistributionSubsystem { /// Easy and efficient runtime access for this subsystem. @@ -164,8 +145,7 @@ where ) -> Self { let runtime = RuntimeInfo::new_with_config(runtime::Config { keystore: Some(keystore), - session_cache_lru_size: NonZeroUsize::new(DISPUTE_WINDOW.get() as usize) - .expect("Dispute window can not be 0; qed"), + session_cache_lru_size: DISPUTE_WINDOW.get() as usize, }); let (tx, sender_rx) = mpsc::channel(1); let disputes_sender = DisputeSender::new(tx, metrics.clone()); @@ -192,12 +172,6 @@ where ctx.spawn("disputes-receiver", receiver.run().boxed()) .map_err(FatalError::SpawnTask)?; - // Process messages for sending side. - // - // Note: We want the sender to be rate limited and we are currently taking advantage of the - // fact that the root task of this subsystem is only concerned with sending: Functions of - // `DisputeSender` might back pressure if the rate limit is hit, which will slow down this - // loop. If this fact ever changes, we will likely need another task. loop { let message = MuxedMessage::receive(&mut ctx, &mut self.sender_rx).await; match message { @@ -273,10 +247,9 @@ impl MuxedMessage { // ends. let from_overseer = ctx.recv().fuse(); futures::pin_mut!(from_overseer, from_sender); - // We select biased to make sure we finish up loose ends, before starting new work. - futures::select_biased!( - msg = from_sender.next() => MuxedMessage::Sender(msg), + futures::select!( msg = from_overseer => MuxedMessage::Subsystem(msg.map_err(FatalError::SubsystemReceive)), + msg = from_sender.next() => MuxedMessage::Sender(msg), ) } } diff --git a/node/network/dispute-distribution/src/metrics.rs b/node/network/dispute-distribution/src/metrics.rs index aa2feeaad3a0..3f717bd105c3 100644 --- a/node/network/dispute-distribution/src/metrics.rs +++ b/node/network/dispute-distribution/src/metrics.rs @@ -72,12 +72,9 @@ impl Metrics { } /// Statements have been imported. - pub fn on_imported(&self, label: &'static str, num_requests: usize) { + pub fn on_imported(&self, label: &'static str) { if let Some(metrics) = &self.0 { - metrics - .imported_requests - .with_label_values(&[label]) - .inc_by(num_requests as u64) + metrics.imported_requests.with_label_values(&[label]).inc() } } diff --git a/node/network/dispute-distribution/src/receiver/batches/batch.rs b/node/network/dispute-distribution/src/receiver/batches/batch.rs deleted file mode 100644 index eebed25ed790..000000000000 --- a/node/network/dispute-distribution/src/receiver/batches/batch.rs +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright 2022 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 . - -use std::{collections::HashMap, time::Instant}; - -use gum::CandidateHash; -use polkadot_node_network_protocol::{ - request_response::{incoming::OutgoingResponseSender, v1::DisputeRequest}, - PeerId, -}; -use polkadot_node_primitives::SignedDisputeStatement; -use polkadot_primitives::v2::{CandidateReceipt, ValidatorIndex}; - -use crate::receiver::{BATCH_COLLECTING_INTERVAL, MIN_KEEP_BATCH_ALIVE_VOTES}; - -use super::MAX_BATCH_LIFETIME; - -/// A batch of votes to be imported into the `dispute-coordinator`. -/// -/// Vote imports are way more efficient when performed in batches, hence we batch together incoming -/// votes until the rate of incoming votes falls below a threshold, then we import into the dispute -/// coordinator. -/// -/// A `Batch` keeps track of the votes to be imported and the current incoming rate, on rate update -/// it will "flush" in case the incoming rate dropped too low, preparing the import. -pub struct Batch { - /// The actual candidate this batch is concerned with. - candidate_receipt: CandidateReceipt, - - /// Cache of `CandidateHash` (candidate_receipt.hash()). - candidate_hash: CandidateHash, - - /// All valid votes received in this batch so far. - /// - /// We differentiate between valid and invalid votes, so we can detect (and drop) duplicates, - /// while still allowing validators to equivocate. - /// - /// Detecting and rejecting duplicates is crucial in order to effectively enforce - /// `MIN_KEEP_BATCH_ALIVE_VOTES` per `BATCH_COLLECTING_INTERVAL`. If we would count duplicates - /// here, the mechanism would be broken. - valid_votes: HashMap, - - /// All invalid votes received in this batch so far. - invalid_votes: HashMap, - - /// How many votes have been batched since the last tick/creation. - votes_batched_since_last_tick: u32, - - /// Expiry time for the batch. - /// - /// By this time the latest this batch will get flushed. - best_before: Instant, - - /// Requesters waiting for a response. - requesters: Vec<(PeerId, OutgoingResponseSender)>, -} - -/// Result of checking a batch every `BATCH_COLLECTING_INTERVAL`. -pub(super) enum TickResult { - /// Batch is still alive, please call `tick` again at the given `Instant`. - Alive(Batch, Instant), - /// Batch is done, ready for import! - Done(PreparedImport), -} - -/// Ready for import. -pub struct PreparedImport { - pub candidate_receipt: CandidateReceipt, - pub statements: Vec<(SignedDisputeStatement, ValidatorIndex)>, - /// Information about original requesters. - pub requesters: Vec<(PeerId, OutgoingResponseSender)>, -} - -impl From for PreparedImport { - fn from(batch: Batch) -> Self { - let Batch { - candidate_receipt, - valid_votes, - invalid_votes, - requesters: pending_responses, - .. - } = batch; - - let statements = valid_votes - .into_iter() - .chain(invalid_votes.into_iter()) - .map(|(index, statement)| (statement, index)) - .collect(); - - Self { candidate_receipt, statements, requesters: pending_responses } - } -} - -impl Batch { - /// Create a new empty batch based on the given `CandidateReceipt`. - /// - /// To create a `Batch` use Batches::find_batch`. - /// - /// Arguments: - /// - /// * `candidate_receipt` - The candidate this batch is meant to track votes for. - /// * `now` - current time stamp for calculating the first tick. - /// - /// Returns: A batch and the first `Instant` you are supposed to call `tick`. - pub(super) fn new(candidate_receipt: CandidateReceipt, now: Instant) -> (Self, Instant) { - let s = Self { - candidate_hash: candidate_receipt.hash(), - candidate_receipt, - valid_votes: HashMap::new(), - invalid_votes: HashMap::new(), - votes_batched_since_last_tick: 0, - best_before: Instant::now() + MAX_BATCH_LIFETIME, - requesters: Vec::new(), - }; - let next_tick = s.calculate_next_tick(now); - (s, next_tick) - } - - /// Receipt of the candidate this batch is batching votes for. - pub fn candidate_receipt(&self) -> &CandidateReceipt { - &self.candidate_receipt - } - - /// Add votes from a validator into the batch. - /// - /// The statements are supposed to be the valid and invalid statements received in a - /// `DisputeRequest`. - /// - /// The given `pending_response` is the corresponding response sender for responding to `peer`. - /// If at least one of the votes is new as far as this batch is concerned we record the - /// pending_response, for later use. In case both votes are known already, we return the - /// response sender as an `Err` value. - pub fn add_votes( - &mut self, - valid_vote: (SignedDisputeStatement, ValidatorIndex), - invalid_vote: (SignedDisputeStatement, ValidatorIndex), - peer: PeerId, - pending_response: OutgoingResponseSender, - ) -> Result<(), OutgoingResponseSender> { - debug_assert!(valid_vote.0.candidate_hash() == invalid_vote.0.candidate_hash()); - debug_assert!(valid_vote.0.candidate_hash() == &self.candidate_hash); - - let mut duplicate = true; - - if self.valid_votes.insert(valid_vote.1, valid_vote.0).is_none() { - self.votes_batched_since_last_tick += 1; - duplicate = false; - } - if self.invalid_votes.insert(invalid_vote.1, invalid_vote.0).is_none() { - self.votes_batched_since_last_tick += 1; - duplicate = false; - } - - if duplicate { - Err(pending_response) - } else { - self.requesters.push((peer, pending_response)); - Ok(()) - } - } - - /// Check batch for liveness. - /// - /// This function is supposed to be called at instants given at construction and as returned as - /// part of `TickResult`. - pub(super) fn tick(mut self, now: Instant) -> TickResult { - if self.votes_batched_since_last_tick >= MIN_KEEP_BATCH_ALIVE_VOTES && - now < self.best_before - { - // Still good: - let next_tick = self.calculate_next_tick(now); - // Reset counter: - self.votes_batched_since_last_tick = 0; - TickResult::Alive(self, next_tick) - } else { - TickResult::Done(PreparedImport::from(self)) - } - } - - /// Calculate when the next tick should happen. - /// - /// This will usually return `now + BATCH_COLLECTING_INTERVAL`, except if the lifetime of this batch - /// would exceed `MAX_BATCH_LIFETIME`. - /// - /// # Arguments - /// - /// * `now` - The current time. - fn calculate_next_tick(&self, now: Instant) -> Instant { - let next_tick = now + BATCH_COLLECTING_INTERVAL; - if next_tick < self.best_before { - next_tick - } else { - self.best_before - } - } -} diff --git a/node/network/dispute-distribution/src/receiver/batches/mod.rs b/node/network/dispute-distribution/src/receiver/batches/mod.rs deleted file mode 100644 index b343b55e0b04..000000000000 --- a/node/network/dispute-distribution/src/receiver/batches/mod.rs +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2022 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 . - -use std::{ - collections::{hash_map, HashMap}, - time::{Duration, Instant}, -}; - -use futures::future::pending; - -use polkadot_node_network_protocol::request_response::DISPUTE_REQUEST_TIMEOUT; -use polkadot_primitives::v2::{CandidateHash, CandidateReceipt}; - -use crate::{ - receiver::batches::{batch::TickResult, waiting_queue::PendingWake}, - LOG_TARGET, -}; - -pub use self::batch::{Batch, PreparedImport}; -use self::waiting_queue::WaitingQueue; - -use super::{ - error::{JfyiError, JfyiResult}, - BATCH_COLLECTING_INTERVAL, -}; - -/// A single batch (per candidate) as managed by `Batches`. -mod batch; - -/// Queue events in time and wait for them to become ready. -mod waiting_queue; - -/// Safe-guard in case votes trickle in real slow. -/// -/// If the batch life time exceeded the time the sender is willing to wait for a confirmation, we -/// would trigger pointless re-sends. -const MAX_BATCH_LIFETIME: Duration = DISPUTE_REQUEST_TIMEOUT.saturating_sub(Duration::from_secs(2)); - -/// Limit the number of batches that can be alive at any given time. -/// -/// Reasoning for this number, see guide. -pub const MAX_BATCHES: usize = 1000; - -/// Manage batches. -/// -/// - Batches can be found via `find_batch()` in order to add votes to them/check they exist. -/// - Batches can be checked for being ready for flushing in order to import contained votes. -pub struct Batches { - /// The batches we manage. - /// - /// Kept invariants: - /// For each entry in `batches`, there exists an entry in `waiting_queue` as well - we wait on - /// all batches! - batches: HashMap, - /// Waiting queue for waiting for batches to become ready for `tick`. - /// - /// Kept invariants by `Batches`: - /// For each entry in the `waiting_queue` there exists a corresponding entry in `batches`. - waiting_queue: WaitingQueue, -} - -/// A found batch is either really found or got created so it can be found. -pub enum FoundBatch<'a> { - /// Batch just got created. - Created(&'a mut Batch), - /// Batch already existed. - Found(&'a mut Batch), -} - -impl Batches { - /// Create new empty `Batches`. - pub fn new() -> Self { - debug_assert!( - MAX_BATCH_LIFETIME > BATCH_COLLECTING_INTERVAL, - "Unexpectedly low `MAX_BATCH_LIFETIME`, please check parameters." - ); - Self { batches: HashMap::new(), waiting_queue: WaitingQueue::new() } - } - - /// Find a particular batch. - /// - /// That is either find it, or we create it as reflected by the result `FoundBatch`. - pub fn find_batch( - &mut self, - candidate_hash: CandidateHash, - candidate_receipt: CandidateReceipt, - ) -> JfyiResult { - if self.batches.len() >= MAX_BATCHES { - return Err(JfyiError::MaxBatchLimitReached) - } - debug_assert!(candidate_hash == candidate_receipt.hash()); - let result = match self.batches.entry(candidate_hash) { - hash_map::Entry::Vacant(vacant) => { - let now = Instant::now(); - let (created, ready_at) = Batch::new(candidate_receipt, now); - let pending_wake = PendingWake { payload: candidate_hash, ready_at }; - self.waiting_queue.push(pending_wake); - FoundBatch::Created(vacant.insert(created)) - }, - hash_map::Entry::Occupied(occupied) => FoundBatch::Found(occupied.into_mut()), - }; - Ok(result) - } - - /// Wait for the next `tick` to check for ready batches. - /// - /// This function blocks (returns `Poll::Pending`) until at least one batch can be - /// checked for readiness meaning that `BATCH_COLLECTING_INTERVAL` has passed since the last - /// check for that batch or it reached end of life. - /// - /// If this `Batches` instance is empty (does not actually contain any batches), then this - /// function will always return `Poll::Pending`. - /// - /// Returns: A `Vec` of all `PreparedImport`s from batches that became ready. - pub async fn check_batches(&mut self) -> Vec { - let now = Instant::now(); - - let mut imports = Vec::new(); - - // Wait for at least one batch to become ready: - self.waiting_queue.wait_ready(now).await; - - // Process all ready entries: - while let Some(wake) = self.waiting_queue.pop_ready(now) { - let batch = self.batches.remove(&wake.payload); - debug_assert!( - batch.is_some(), - "Entries referenced in `waiting_queue` are supposed to exist!" - ); - let batch = match batch { - None => return pending().await, - Some(batch) => batch, - }; - match batch.tick(now) { - TickResult::Done(import) => { - gum::trace!( - target: LOG_TARGET, - candidate_hash = ?wake.payload, - "Batch became ready." - ); - imports.push(import); - }, - TickResult::Alive(old_batch, next_tick) => { - gum::trace!( - target: LOG_TARGET, - candidate_hash = ?wake.payload, - "Batch found to be still alive on check." - ); - let pending_wake = PendingWake { payload: wake.payload, ready_at: next_tick }; - self.waiting_queue.push(pending_wake); - self.batches.insert(wake.payload, old_batch); - }, - } - } - imports - } -} diff --git a/node/network/dispute-distribution/src/receiver/batches/waiting_queue.rs b/node/network/dispute-distribution/src/receiver/batches/waiting_queue.rs deleted file mode 100644 index 995dc74d358f..000000000000 --- a/node/network/dispute-distribution/src/receiver/batches/waiting_queue.rs +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright 2022 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 . - -use std::{cmp::Ordering, collections::BinaryHeap, time::Instant}; - -use futures::future::pending; -use futures_timer::Delay; - -/// Wait asynchronously for given `Instant`s one after the other. -/// -/// `PendingWake`s can be inserted and `WaitingQueue` makes `wait_ready()` to always wait for the -/// next `Instant` in the queue. -pub struct WaitingQueue { - /// All pending wakes we are supposed to wait on in order. - pending_wakes: BinaryHeap>, - /// Wait for next `PendingWake`. - timer: Option, -} - -/// Represents some event waiting to be processed at `ready_at`. -/// -/// This is an event in `WaitingQueue`. It provides an `Ord` instance, that sorts descending with -/// regard to `Instant` (so we get a `min-heap` with the earliest `Instant` at the top). -#[derive(Eq, PartialEq)] -pub struct PendingWake { - pub payload: Payload, - pub ready_at: Instant, -} - -impl WaitingQueue { - /// Get a new empty `WaitingQueue`. - /// - /// If you call `pop` on this queue immediately, it will always return `Poll::Pending`. - pub fn new() -> Self { - Self { pending_wakes: BinaryHeap::new(), timer: None } - } - - /// Push a `PendingWake`. - /// - /// The next call to `wait_ready` will make sure to wake soon enough to process that new event in a - /// timely manner. - pub fn push(&mut self, wake: PendingWake) { - self.pending_wakes.push(wake); - // Reset timer as it is potentially obsolete now: - self.timer = None; - } - - /// Pop the next ready item. - /// - /// This function does not wait, if nothing is ready right now as determined by the passed - /// `now` time stamp, this function simply returns `None`. - pub fn pop_ready(&mut self, now: Instant) -> Option> { - let is_ready = self.pending_wakes.peek().map_or(false, |p| p.ready_at <= now); - if is_ready { - Some(self.pending_wakes.pop().expect("We just peeked. qed.")) - } else { - None - } - } - - /// Don't pop, just wait until something is ready. - /// - /// Once this function returns `Poll::Ready(())` `pop_ready()` will return `Some`, if passed - /// the same `Instant`. - /// - /// Whether ready or not is determined based on the passed time stamp `now` which should be the - /// current time as returned by `Instant::now()` - /// - /// This function waits asynchronously for an item to become ready. If there is no more item, - /// this call will wait forever (return Poll::Pending without scheduling a wake). - pub async fn wait_ready(&mut self, now: Instant) { - if let Some(timer) = &mut self.timer { - // Previous timer was not done yet. - timer.await - } - - let next_waiting = self.pending_wakes.peek(); - let is_ready = next_waiting.map_or(false, |p| p.ready_at <= now); - if is_ready { - return - } - - self.timer = next_waiting.map(|p| Delay::new(p.ready_at.duration_since(now))); - match &mut self.timer { - None => return pending().await, - Some(timer) => timer.await, - } - } -} - -impl PartialOrd> for PendingWake { - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) - } -} - -impl Ord for PendingWake { - fn cmp(&self, other: &Self) -> Ordering { - // Reverse order for min-heap: - match other.ready_at.cmp(&self.ready_at) { - Ordering::Equal => other.payload.cmp(&self.payload), - o => o, - } - } -} -#[cfg(test)] -mod tests { - use std::{ - task::Poll, - time::{Duration, Instant}, - }; - - use assert_matches::assert_matches; - use futures::{future::poll_fn, pin_mut, Future}; - - use crate::LOG_TARGET; - - use super::{PendingWake, WaitingQueue}; - - #[test] - fn wait_ready_waits_for_earliest_event_always() { - sp_tracing::try_init_simple(); - let mut queue = WaitingQueue::new(); - let now = Instant::now(); - let start = now; - queue.push(PendingWake { payload: 1u32, ready_at: now + Duration::from_millis(3) }); - // Push another one in order: - queue.push(PendingWake { payload: 2u32, ready_at: now + Duration::from_millis(5) }); - // Push one out of order: - queue.push(PendingWake { payload: 0u32, ready_at: now + Duration::from_millis(1) }); - // Push another one at same timestamp (should become ready at the same time) - queue.push(PendingWake { payload: 10u32, ready_at: now + Duration::from_millis(1) }); - - futures::executor::block_on(async move { - // No time passed yet - nothing should be ready. - assert!(queue.pop_ready(now).is_none(), "No time has passed, nothing should be ready"); - - // Receive them in order at expected times: - queue.wait_ready(now).await; - gum::trace!(target: LOG_TARGET, "After first wait."); - - let now = start + Duration::from_millis(1); - assert!(Instant::now() - start >= Duration::from_millis(1)); - assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(0u32)); - // One more should be ready: - assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(10u32)); - assert!(queue.pop_ready(now).is_none(), "No more entry expected to be ready."); - - queue.wait_ready(now).await; - gum::trace!(target: LOG_TARGET, "After second wait."); - let now = start + Duration::from_millis(3); - assert!(Instant::now() - start >= Duration::from_millis(3)); - assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(1u32)); - assert!(queue.pop_ready(now).is_none(), "No more entry expected to be ready."); - - // Push in between wait: - poll_fn(|cx| { - let fut = queue.wait_ready(now); - pin_mut!(fut); - assert_matches!(fut.poll(cx), Poll::Pending); - Poll::Ready(()) - }) - .await; - queue.push(PendingWake { payload: 3u32, ready_at: start + Duration::from_millis(4) }); - - queue.wait_ready(now).await; - // Newly pushed element should have become ready: - gum::trace!(target: LOG_TARGET, "After third wait."); - let now = start + Duration::from_millis(4); - assert!(Instant::now() - start >= Duration::from_millis(4)); - assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(3u32)); - assert!(queue.pop_ready(now).is_none(), "No more entry expected to be ready."); - - queue.wait_ready(now).await; - gum::trace!(target: LOG_TARGET, "After fourth wait."); - let now = start + Duration::from_millis(5); - assert!(Instant::now() - start >= Duration::from_millis(5)); - assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(2u32)); - assert!(queue.pop_ready(now).is_none(), "No more entry expected to be ready."); - - // queue empty - should wait forever now: - poll_fn(|cx| { - let fut = queue.wait_ready(now); - pin_mut!(fut); - assert_matches!(fut.poll(cx), Poll::Pending); - Poll::Ready(()) - }) - .await; - }); - } -} diff --git a/node/network/dispute-distribution/src/receiver/error.rs b/node/network/dispute-distribution/src/receiver/error.rs index 4477335440d0..ce578cc8e0f9 100644 --- a/node/network/dispute-distribution/src/receiver/error.rs +++ b/node/network/dispute-distribution/src/receiver/error.rs @@ -19,10 +19,8 @@ use fatality::Nested; -use gum::CandidateHash; use polkadot_node_network_protocol::{request_response::incoming, PeerId}; use polkadot_node_subsystem_util::runtime; -use polkadot_primitives::v2::AuthorityDiscoveryId; use crate::LOG_TARGET; @@ -37,8 +35,8 @@ pub enum Error { #[error("Retrieving next incoming request failed.")] IncomingRequest(#[from] incoming::Error), - #[error("Sending back response to peers {0:#?} failed.")] - SendResponses(Vec), + #[error("Sending back response to peer {0} failed.")] + SendResponse(PeerId), #[error("Changing peer's ({0}) reputation failed.")] SetPeerReputation(PeerId), @@ -46,29 +44,16 @@ pub enum Error { #[error("Dispute request with invalid signatures, from peer {0}.")] InvalidSignature(PeerId), - #[error("Received votes from peer {0} have been completely redundant.")] - RedundantMessage(PeerId), - - #[error("Import of dispute got canceled for candidate {0} - import failed for some reason.")] - ImportCanceled(CandidateHash), + #[error("Import of dispute got canceled for peer {0} - import failed for some reason.")] + ImportCanceled(PeerId), #[error("Peer {0} attempted to participate in dispute and is not a validator.")] NotAValidator(PeerId), - - #[error("Force flush for batch that could not be found attempted, candidate hash: {0}")] - ForceFlushBatchDoesNotExist(CandidateHash), - - // Should never happen in practice: - #[error("We needed to drop messages, because we reached limit on concurrent batches.")] - MaxBatchLimitReached, - - #[error("Authority {0} sent messages at a too high rate.")] - AuthorityFlooding(AuthorityDiscoveryId), } pub type Result = std::result::Result; -pub type JfyiResult = std::result::Result; +pub type JfyiErrorResult = std::result::Result; /// Utility for eating top level errors and log them. /// diff --git a/node/network/dispute-distribution/src/receiver/mod.rs b/node/network/dispute-distribution/src/receiver/mod.rs index 158c66e20655..9193947e78d1 100644 --- a/node/network/dispute-distribution/src/receiver/mod.rs +++ b/node/network/dispute-distribution/src/receiver/mod.rs @@ -15,21 +15,20 @@ // along with Polkadot. If not, see . use std::{ - num::NonZeroUsize, + collections::HashSet, pin::Pin, task::{Context, Poll}, - time::Duration, }; use futures::{ channel::oneshot, - future::poll_fn, + future::{poll_fn, BoxFuture}, pin_mut, - stream::{FuturesUnordered, StreamExt}, - Future, + stream::{FusedStream, FuturesUnordered, StreamExt}, + Future, FutureExt, Stream, }; +use lru::LruCache; -use gum::CandidateHash; use polkadot_node_network_protocol::{ authority_discovery::AuthorityDiscovery, request_response::{ @@ -52,47 +51,20 @@ use crate::{ }; mod error; - -/// Rate limiting queues for incoming requests by peers. -mod peer_queues; - -/// Batch imports together. -mod batches; - -use self::{ - batches::{Batches, FoundBatch, PreparedImport}, - error::{log_error, JfyiError, JfyiResult, Result}, - peer_queues::PeerQueues, -}; +use self::error::{log_error, JfyiError, JfyiErrorResult, Result}; const COST_INVALID_REQUEST: Rep = Rep::CostMajor("Received message could not be decoded."); const COST_INVALID_SIGNATURE: Rep = Rep::Malicious("Signatures were invalid."); -const COST_INVALID_IMPORT: Rep = - Rep::Malicious("Import was deemed invalid by dispute-coordinator."); +const COST_INVALID_CANDIDATE: Rep = Rep::Malicious("Reported candidate was not available."); const COST_NOT_A_VALIDATOR: Rep = Rep::CostMajor("Reporting peer was not a validator."); -/// Mildly punish peers exceeding their rate limit. -/// -/// For honest peers this should rarely happen, but if it happens we would not want to disconnect -/// too quickly. Minor cost should suffice for disconnecting any real flooder. -const COST_APPARENT_FLOOD: Rep = Rep::CostMinor("Peer exceeded the rate limit."); - -/// How many votes must have arrived in the last `BATCH_COLLECTING_INTERVAL` -/// -/// in order for a batch to stay alive and not get flushed/imported to the dispute-coordinator. -/// -/// This ensures a timely import of batches. -#[cfg(not(test))] -pub const MIN_KEEP_BATCH_ALIVE_VOTES: u32 = 10; -#[cfg(test)] -pub const MIN_KEEP_BATCH_ALIVE_VOTES: u32 = 2; -/// Time we allow to pass for new votes to trickle in. -/// -/// See `MIN_KEEP_BATCH_ALIVE_VOTES` above. -/// Should be greater or equal to `RECEIVE_RATE_LIMIT` (there is no point in checking any faster). -pub const BATCH_COLLECTING_INTERVAL: Duration = Duration::from_millis(500); +/// How many statement imports we want to issue in parallel: +pub const MAX_PARALLEL_IMPORTS: usize = 10; /// State for handling incoming `DisputeRequest` messages. +/// +/// This is supposed to run as its own task in order to easily impose back pressure on the incoming +/// request channel and at the same time to drop flood messages as fast as possible. pub struct DisputesReceiver { /// Access to session information. runtime: RuntimeInfo, @@ -103,17 +75,18 @@ pub struct DisputesReceiver { /// Channel to retrieve incoming requests from. receiver: IncomingRequestReceiver, - /// Rate limiting queue for each peer (only authorities). - peer_queues: PeerQueues, - - /// Currently active batches of imports per candidate. - batches: Batches, - /// Authority discovery service: authority_discovery: AD, - /// Imports currently being processed by the `dispute-coordinator`. - pending_imports: FuturesUnordered, + /// Imports currently being processed. + pending_imports: PendingImports, + + /// We keep record of the last banned peers. + /// + /// This is needed because once we ban a peer, we will very likely still have pending requests + /// in the incoming channel - we should not waste time recovering availability for those, as we + /// already know the peer is malicious. + banned_peers: LruCache, /// Log received requests. metrics: Metrics, @@ -127,24 +100,36 @@ enum MuxedMessage { /// /// - We need to make sure responses are actually sent (therefore we need to await futures /// promptly). - /// - We need to punish peers whose import got rejected. - ConfirmedImport(ImportResult), + /// - We need to update `banned_peers` accordingly to the result. + ConfirmedImport(JfyiErrorResult<(PeerId, ImportStatementsResult)>), /// A new request has arrived and should be handled. NewRequest(IncomingRequest), +} - /// Rate limit timer hit - is is time to process one row of messages. - /// - /// This is the result of calling `self.peer_queues.pop_reqs()`. - WakePeerQueuesPopReqs(Vec>), - - /// It is time to check batches. - /// - /// Every `BATCH_COLLECTING_INTERVAL` we check whether less than `MIN_KEEP_BATCH_ALIVE_VOTES` - /// new votes arrived, if so the batch is ready for import. - /// - /// This is the result of calling `self.batches.check_batches()`. - WakeCheckBatches(Vec), +impl MuxedMessage { + async fn receive( + pending_imports: &mut PendingImports, + pending_requests: &mut IncomingRequestReceiver, + ) -> Result { + poll_fn(|ctx| { + let next_req = pending_requests.recv(|| vec![COST_INVALID_REQUEST]); + pin_mut!(next_req); + if let Poll::Ready(r) = next_req.poll(ctx) { + return match r { + Err(e) => Poll::Ready(Err(incoming::Error::from(e).into())), + Ok(v) => Poll::Ready(Ok(Self::NewRequest(v))), + } + } + // In case of Ready(None) return `Pending` below - we want to wait for the next request + // in that case. + if let Poll::Ready(Some(v)) = pending_imports.poll_next_unpin(ctx) { + return Poll::Ready(Ok(Self::ConfirmedImport(v))) + } + Poll::Pending + }) + .await + } } impl DisputesReceiver @@ -161,17 +146,17 @@ where ) -> Self { let runtime = RuntimeInfo::new_with_config(runtime::Config { keystore: None, - session_cache_lru_size: NonZeroUsize::new(DISPUTE_WINDOW.get() as usize) - .expect("Dispute window can not be 0; qed"), + session_cache_lru_size: DISPUTE_WINDOW.get() as usize, }); Self { runtime, sender, receiver, - peer_queues: PeerQueues::new(), - batches: Batches::new(), authority_discovery, - pending_imports: FuturesUnordered::new(), + pending_imports: PendingImports::new(), + // Size of MAX_PARALLEL_IMPORTS ensures we are going to immediately get rid of any + // malicious requests still pending in the incoming queue. + banned_peers: LruCache::new(MAX_PARALLEL_IMPORTS), metrics, } } @@ -195,132 +180,60 @@ where } } - /// Actual work happening here in three phases: - /// - /// 1. Receive and queue incoming messages until the rate limit timer hits. - /// 2. Do import/batching for the head of all queues. - /// 3. Check and flush any ready batches. + /// Actual work happening here. async fn run_inner(&mut self) -> Result<()> { - let msg = self.receive_message().await?; + let msg = MuxedMessage::receive(&mut self.pending_imports, &mut self.receiver).await?; - match msg { - MuxedMessage::NewRequest(req) => { - // Phase 1: - self.metrics.on_received_request(); - self.dispatch_to_queues(req).await?; + let incoming = match msg { + // We need to clean up futures, to make sure responses are sent: + MuxedMessage::ConfirmedImport(m_bad) => { + self.ban_bad_peer(m_bad)?; + return Ok(()) }, - MuxedMessage::WakePeerQueuesPopReqs(reqs) => { - // Phase 2: - for req in reqs { - // No early return - we cannot cancel imports of one peer, because the import of - // another failed: - match log_error(self.start_import_or_batch(req).await) { - Ok(()) => {}, - Err(fatal) => return Err(fatal.into()), - } - } - }, - MuxedMessage::WakeCheckBatches(ready_imports) => { - // Phase 3: - self.import_ready_batches(ready_imports).await; - }, - MuxedMessage::ConfirmedImport(import_result) => { - self.update_imported_requests_metrics(&import_result); - // Confirm imports to requesters/punish them on invalid imports: - send_responses_to_requesters(import_result).await?; - }, - } - - Ok(()) - } - - /// Receive one `MuxedMessage`. - /// - /// - /// Dispatching events to messages as they happen. - async fn receive_message(&mut self) -> Result { - poll_fn(|ctx| { - // In case of Ready(None), we want to wait for pending requests: - if let Poll::Ready(Some(v)) = self.pending_imports.poll_next_unpin(ctx) { - return Poll::Ready(Ok(MuxedMessage::ConfirmedImport(v?))) - } - - let rate_limited = self.peer_queues.pop_reqs(); - pin_mut!(rate_limited); - // We poll rate_limit before batches, so we don't unnecessarily delay importing to - // batches. - if let Poll::Ready(reqs) = rate_limited.poll(ctx) { - return Poll::Ready(Ok(MuxedMessage::WakePeerQueuesPopReqs(reqs))) - } + MuxedMessage::NewRequest(req) => req, + }; - let ready_batches = self.batches.check_batches(); - pin_mut!(ready_batches); - if let Poll::Ready(ready_batches) = ready_batches.poll(ctx) { - return Poll::Ready(Ok(MuxedMessage::WakeCheckBatches(ready_batches))) - } + self.metrics.on_received_request(); - let next_req = self.receiver.recv(|| vec![COST_INVALID_REQUEST]); - pin_mut!(next_req); - if let Poll::Ready(r) = next_req.poll(ctx) { - return match r { - Err(e) => Poll::Ready(Err(incoming::Error::from(e).into())), - Ok(v) => Poll::Ready(Ok(MuxedMessage::NewRequest(v))), - } - } - Poll::Pending - }) - .await - } + let peer = incoming.peer; - /// Process incoming requests. - /// - /// - Check sender is authority - /// - Dispatch message to corresponding queue in `peer_queues`. - /// - If queue is full, drop message and change reputation of sender. - async fn dispatch_to_queues(&mut self, req: IncomingRequest) -> JfyiResult<()> { - let peer = req.peer; - // Only accept messages from validators, in case there are multiple `AuthorityId`s, we - // just take the first one. On session boundaries this might allow validators to double - // their rate limit for a short period of time, which seems acceptable. - let authority_id = match self - .authority_discovery - .get_authority_ids_by_peer_id(peer) - .await - .and_then(|s| s.into_iter().next()) - { - None => { - req.send_outgoing_response(OutgoingResponse { + // Only accept messages from validators: + if self.authority_discovery.get_authority_ids_by_peer_id(peer).await.is_none() { + incoming + .send_outgoing_response(OutgoingResponse { result: Err(()), reputation_changes: vec![COST_NOT_A_VALIDATOR], sent_feedback: None, }) - .map_err(|_| JfyiError::SendResponses(vec![peer]))?; - return Err(JfyiError::NotAValidator(peer).into()) - }, - Some(auth_id) => auth_id, - }; + .map_err(|_| JfyiError::SendResponse(peer))?; - // Queue request: - if let Err((authority_id, req)) = self.peer_queues.push_req(authority_id, req) { - req.send_outgoing_response(OutgoingResponse { - result: Err(()), - reputation_changes: vec![COST_APPARENT_FLOOD], - sent_feedback: None, - }) - .map_err(|_| JfyiError::SendResponses(vec![peer]))?; - return Err(JfyiError::AuthorityFlooding(authority_id)) + return Err(JfyiError::NotAValidator(peer).into()) } - Ok(()) + + // Immediately drop requests from peers that already have requests in flight or have + // been banned recently (flood protection): + if self.pending_imports.peer_is_pending(&peer) || self.banned_peers.contains(&peer) { + gum::trace!( + target: LOG_TARGET, + ?peer, + "Dropping message from peer (banned/pending import)" + ); + return Ok(()) + } + + // Wait for a free slot: + if self.pending_imports.len() >= MAX_PARALLEL_IMPORTS as usize { + // Wait for one to finish: + let r = self.pending_imports.next().await; + self.ban_bad_peer(r.expect("pending_imports.len() is greater 0. qed."))?; + } + + // All good - initiate import. + self.start_import(incoming).await } - /// Start importing votes for the given request or batch. - /// - /// Signature check and in case we already have an existing batch we import to that batch, - /// otherwise import to `dispute-coordinator` directly and open a batch. - async fn start_import_or_batch( - &mut self, - incoming: IncomingRequest, - ) -> Result<()> { + /// Start importing votes for the given request. + async fn start_import(&mut self, incoming: IncomingRequest) -> Result<()> { let IncomingRequest { peer, payload, pending_response } = incoming; let info = self @@ -350,172 +263,128 @@ where Ok(votes) => votes, }; - let candidate_hash = *valid_vote.0.candidate_hash(); - - match self.batches.find_batch(candidate_hash, candidate_receipt)? { - FoundBatch::Created(batch) => { - // There was no entry yet - start import immediately: - gum::trace!( - target: LOG_TARGET, - ?candidate_hash, - ?peer, - "No batch yet - triggering immediate import" - ); - let import = PreparedImport { - candidate_receipt: batch.candidate_receipt().clone(), - statements: vec![valid_vote, invalid_vote], - requesters: vec![(peer, pending_response)], - }; - self.start_import(import).await; - }, - FoundBatch::Found(batch) => { - gum::trace!(target: LOG_TARGET, ?candidate_hash, "Batch exists - batching request"); - let batch_result = - batch.add_votes(valid_vote, invalid_vote, peer, pending_response); - - if let Err(pending_response) = batch_result { - // We don't expect honest peers to send redundant votes within a single batch, - // as the timeout for retry is much higher. Still we don't want to punish the - // node as it might not be the node's fault. Some other (malicious) node could have been - // faster sending the same votes in order to harm the reputation of that honest - // node. Given that we already have a rate limit, if a validator chooses to - // waste available rate with redundant votes - so be it. The actual dispute - // resolution is unaffected. - gum::debug!( - target: LOG_TARGET, - ?peer, - "Peer sent completely redundant votes within a single batch - that looks fishy!", - ); - pending_response - .send_outgoing_response(OutgoingResponse { - // While we have seen duplicate votes, we cannot confirm as we don't - // know yet whether the batch is going to be confirmed, so we assume - // the worst. We don't want to push the pending response to the batch - // either as that would be unbounded, only limited by the rate limit. - result: Err(()), - reputation_changes: Vec::new(), - sent_feedback: None, - }) - .map_err(|_| JfyiError::SendResponses(vec![peer]))?; - return Err(From::from(JfyiError::RedundantMessage(peer))) - } - }, - } + let (pending_confirmation, confirmation_rx) = oneshot::channel(); + self.sender + .send_message(DisputeCoordinatorMessage::ImportStatements { + candidate_receipt, + session: valid_vote.0.session_index(), + statements: vec![valid_vote, invalid_vote], + pending_confirmation: Some(pending_confirmation), + }) + .await; + self.pending_imports.push(peer, confirmation_rx, pending_response); Ok(()) } - /// Trigger import into the dispute-coordinator of ready batches (`PreparedImport`s). - async fn import_ready_batches(&mut self, ready_imports: Vec) { - for import in ready_imports { - self.start_import(import).await; + /// Await an import and ban any misbehaving peers. + /// + /// In addition we report import metrics. + fn ban_bad_peer( + &mut self, + result: JfyiErrorResult<(PeerId, ImportStatementsResult)>, + ) -> JfyiErrorResult<()> { + match result? { + (_, ImportStatementsResult::ValidImport) => { + self.metrics.on_imported(SUCCEEDED); + }, + (bad_peer, ImportStatementsResult::InvalidImport) => { + self.metrics.on_imported(FAILED); + self.banned_peers.put(bad_peer, ()); + }, } + Ok(()) } +} - /// Start import and add response receiver to `pending_imports`. - async fn start_import(&mut self, import: PreparedImport) { - let PreparedImport { candidate_receipt, statements, requesters } = import; - let (session_index, candidate_hash) = match statements.iter().next() { - None => { - gum::debug!( - target: LOG_TARGET, - candidate_hash = ?candidate_receipt.hash(), - "Not importing empty batch" - ); - return - }, - Some(vote) => (vote.0.session_index(), vote.0.candidate_hash().clone()), - }; +/// Manage pending imports in a way that preserves invariants. +struct PendingImports { + /// Futures in flight. + futures: + FuturesUnordered)>>, + /// Peers whose requests are currently in flight. + peers: HashSet, +} - let (pending_confirmation, confirmation_rx) = oneshot::channel(); - self.sender - .send_message(DisputeCoordinatorMessage::ImportStatements { - candidate_receipt, - session: session_index, - statements, - pending_confirmation: Some(pending_confirmation), - }) - .await; +impl PendingImports { + pub fn new() -> Self { + Self { futures: FuturesUnordered::new(), peers: HashSet::new() } + } - let pending = - PendingImport { candidate_hash, requesters, pending_response: confirmation_rx }; + pub fn push( + &mut self, + peer: PeerId, + handled: oneshot::Receiver, + pending_response: OutgoingResponseSender, + ) { + self.peers.insert(peer); + self.futures.push( + async move { + let r = respond_to_request(peer, handled, pending_response).await; + (peer, r) + } + .boxed(), + ) + } - self.pending_imports.push(pending); + /// Returns the number of contained futures. + pub fn len(&self) -> usize { + self.futures.len() } - fn update_imported_requests_metrics(&self, result: &ImportResult) { - let label = match result.result { - ImportStatementsResult::ValidImport => SUCCEEDED, - ImportStatementsResult::InvalidImport => FAILED, - }; - self.metrics.on_imported(label, result.requesters.len()); + /// Check whether a peer has a pending import. + pub fn peer_is_pending(&self, peer: &PeerId) -> bool { + self.peers.contains(peer) } } -async fn send_responses_to_requesters(import_result: ImportResult) -> JfyiResult<()> { - let ImportResult { requesters, result } = import_result; +impl Stream for PendingImports { + type Item = JfyiErrorResult<(PeerId, ImportStatementsResult)>; + fn poll_next(mut self: Pin<&mut Self>, ctx: &mut Context<'_>) -> Poll> { + match Pin::new(&mut self.futures).poll_next(ctx) { + Poll::Pending => Poll::Pending, + Poll::Ready(None) => Poll::Ready(None), + Poll::Ready(Some((peer, result))) => { + self.peers.remove(&peer); + Poll::Ready(Some(result.map(|r| (peer, r)))) + }, + } + } +} +impl FusedStream for PendingImports { + fn is_terminated(&self) -> bool { + self.futures.is_terminated() + } +} - let mk_response = match result { - ImportStatementsResult::ValidImport => || OutgoingResponse { +// Future for `PendingImports` +// +// - Wait for import +// - Punish peer +// - Deliver result +async fn respond_to_request( + peer: PeerId, + handled: oneshot::Receiver, + pending_response: OutgoingResponseSender, +) -> JfyiErrorResult { + let result = handled.await.map_err(|_| JfyiError::ImportCanceled(peer))?; + + let response = match result { + ImportStatementsResult::ValidImport => OutgoingResponse { result: Ok(DisputeResponse::Confirmed), reputation_changes: Vec::new(), sent_feedback: None, }, - ImportStatementsResult::InvalidImport => || OutgoingResponse { + ImportStatementsResult::InvalidImport => OutgoingResponse { result: Err(()), - reputation_changes: vec![COST_INVALID_IMPORT], + reputation_changes: vec![COST_INVALID_CANDIDATE], sent_feedback: None, }, }; - let mut sending_failed_for = Vec::new(); - for (peer, pending_response) in requesters { - if let Err(()) = pending_response.send_outgoing_response(mk_response()) { - sending_failed_for.push(peer); - } - } - - if !sending_failed_for.is_empty() { - Err(JfyiError::SendResponses(sending_failed_for)) - } else { - Ok(()) - } -} + pending_response + .send_outgoing_response(response) + .map_err(|_| JfyiError::SendResponse(peer))?; -/// A future that resolves into an `ImportResult` when ready. -/// -/// This future is used on `dispute-coordinator` import messages for the oneshot response receiver -/// to: -/// - Keep track of concerned `CandidateHash` for reporting errors. -/// - Keep track of requesting peers so we can confirm the import/punish them on invalid imports. -struct PendingImport { - candidate_hash: CandidateHash, - requesters: Vec<(PeerId, OutgoingResponseSender)>, - pending_response: oneshot::Receiver, -} - -/// A `PendingImport` becomes an `ImportResult` once done. -struct ImportResult { - /// Requesters of that import. - requesters: Vec<(PeerId, OutgoingResponseSender)>, - /// Actual result of the import. - result: ImportStatementsResult, -} - -impl PendingImport { - async fn wait_for_result(&mut self) -> JfyiResult { - let result = (&mut self.pending_response) - .await - .map_err(|_| JfyiError::ImportCanceled(self.candidate_hash))?; - Ok(ImportResult { requesters: std::mem::take(&mut self.requesters), result }) - } -} - -impl Future for PendingImport { - type Output = JfyiResult; - fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - let fut = self.wait_for_result(); - pin_mut!(fut); - fut.poll(cx) - } + Ok(result) } diff --git a/node/network/dispute-distribution/src/receiver/peer_queues.rs b/node/network/dispute-distribution/src/receiver/peer_queues.rs deleted file mode 100644 index 138b59c3f867..000000000000 --- a/node/network/dispute-distribution/src/receiver/peer_queues.rs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright 2022 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 . - -use std::collections::{hash_map::Entry, HashMap, VecDeque}; - -use futures::future::pending; -use futures_timer::Delay; -use polkadot_node_network_protocol::request_response::{v1::DisputeRequest, IncomingRequest}; -use polkadot_primitives::v2::AuthorityDiscoveryId; - -use crate::RECEIVE_RATE_LIMIT; - -/// How many messages we are willing to queue per peer (validator). -/// -/// The larger this value is, the larger bursts are allowed to be without us dropping messages. On -/// the flip side this gets allocated per validator, so for a size of 10 this will result -/// in `10_000 * size_of(IncomingRequest)` in the worst case. -/// -/// `PEER_QUEUE_CAPACITY` must not be 0 for obvious reasons. -#[cfg(not(test))] -pub const PEER_QUEUE_CAPACITY: usize = 10; -#[cfg(test)] -pub const PEER_QUEUE_CAPACITY: usize = 2; - -/// Queues for messages from authority peers for rate limiting. -/// -/// Invariants ensured: -/// -/// 1. No queue will ever have more than `PEER_QUEUE_CAPACITY` elements. -/// 2. There are no empty queues. Whenever a queue gets empty, it is removed. This way checking -/// whether there are any messages queued is cheap. -/// 3. As long as not empty, `pop_reqs` will, if called in sequence, not return `Ready` more often -/// than once for every `RECEIVE_RATE_LIMIT`, but it will always return Ready eventually. -/// 4. If empty `pop_reqs` will never return `Ready`, but will always be `Pending`. -pub struct PeerQueues { - /// Actual queues. - queues: HashMap>>, - - /// Delay timer for establishing the rate limit. - rate_limit_timer: Option, -} - -impl PeerQueues { - /// New empty `PeerQueues`. - pub fn new() -> Self { - Self { queues: HashMap::new(), rate_limit_timer: None } - } - - /// Push an incoming request for a given authority. - /// - /// Returns: `Ok(())` if succeeded, `Err((args))` if capacity is reached. - pub fn push_req( - &mut self, - peer: AuthorityDiscoveryId, - req: IncomingRequest, - ) -> Result<(), (AuthorityDiscoveryId, IncomingRequest)> { - let queue = match self.queues.entry(peer) { - Entry::Vacant(vacant) => vacant.insert(VecDeque::new()), - Entry::Occupied(occupied) => { - if occupied.get().len() >= PEER_QUEUE_CAPACITY { - return Err((occupied.key().clone(), req)) - } - occupied.into_mut() - }, - }; - queue.push_back(req); - - // We have at least one element to process - rate limit `timer` needs to exist now: - self.ensure_timer(); - Ok(()) - } - - /// Pop all heads and return them for processing. - /// - /// This gets one message from each peer that has sent at least one. - /// - /// This function is rate limited, if called in sequence it will not return more often than - /// every `RECEIVE_RATE_LIMIT`. - /// - /// NOTE: If empty this function will not return `Ready` at all, but will always be `Pending`. - pub async fn pop_reqs(&mut self) -> Vec> { - self.wait_for_timer().await; - - let mut heads = Vec::with_capacity(self.queues.len()); - let old_queues = std::mem::replace(&mut self.queues, HashMap::new()); - for (k, mut queue) in old_queues.into_iter() { - let front = queue.pop_front(); - debug_assert!(front.is_some(), "Invariant that queues are never empty is broken."); - - if let Some(front) = front { - heads.push(front); - } - if !queue.is_empty() { - self.queues.insert(k, queue); - } - } - - if !self.is_empty() { - // Still not empty - we should get woken at some point. - self.ensure_timer(); - } - - heads - } - - /// Whether or not all queues are empty. - pub fn is_empty(&self) -> bool { - self.queues.is_empty() - } - - /// Ensure there is an active `timer`. - /// - /// Checks whether one exists and if not creates one. - fn ensure_timer(&mut self) -> &mut Delay { - self.rate_limit_timer.get_or_insert(Delay::new(RECEIVE_RATE_LIMIT)) - } - - /// Wait for `timer` if it exists, or be `Pending` forever. - /// - /// Afterwards it gets set back to `None`. - async fn wait_for_timer(&mut self) { - match self.rate_limit_timer.as_mut() { - None => pending().await, - Some(timer) => timer.await, - } - self.rate_limit_timer = None; - } -} diff --git a/node/network/dispute-distribution/src/sender/mod.rs b/node/network/dispute-distribution/src/sender/mod.rs index 09b902173ede..5312528b413e 100644 --- a/node/network/dispute-distribution/src/sender/mod.rs +++ b/node/network/dispute-distribution/src/sender/mod.rs @@ -14,21 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::{ - collections::{HashMap, HashSet}, - pin::Pin, - task::Poll, - time::Duration, -}; - -use futures::{ - channel::{mpsc, oneshot}, - future::poll_fn, - Future, -}; - -use futures_timer::Delay; -use indexmap::{map::Entry, IndexMap}; +use std::collections::{hash_map::Entry, HashMap, HashSet}; + +use futures::channel::{mpsc, oneshot}; + use polkadot_node_network_protocol::request_response::v1::DisputeRequest; use polkadot_node_primitives::{CandidateVotes, DisputeMessage, SignedDisputeStatement}; use polkadot_node_subsystem::{messages::DisputeCoordinatorMessage, overseer, ActiveLeavesUpdate}; @@ -39,27 +28,22 @@ use polkadot_primitives::v2::{CandidateHash, DisputeStatement, Hash, SessionInde /// /// It is going to spawn real tasks as it sees fit for getting the votes of the particular dispute /// out. -/// -/// As we assume disputes have a priority, we start sending for disputes in the order -/// `start_sender` got called. mod send_task; use send_task::SendTask; pub use send_task::TaskFinish; -/// Error and [`Result`] type for sender. +/// Error and [`Result`] type for sender mod error; pub use error::{Error, FatalError, JfyiError, Result}; use self::error::JfyiErrorResult; -use crate::{Metrics, LOG_TARGET, SEND_RATE_LIMIT}; +use crate::{Metrics, LOG_TARGET}; /// The `DisputeSender` keeps track of all ongoing disputes we need to send statements out. /// /// For each dispute a `SendTask` is responsible for sending to the concerned validators for that /// particular dispute. The `DisputeSender` keeps track of those tasks, informs them about new /// sessions/validator sets and cleans them up when they become obsolete. -/// -/// The unit of work for the `DisputeSender` is a dispute, represented by `SendTask`s. pub struct DisputeSender { /// All heads we currently consider active. active_heads: Vec, @@ -70,16 +54,11 @@ pub struct DisputeSender { active_sessions: HashMap, /// All ongoing dispute sendings this subsystem is aware of. - /// - /// Using an `IndexMap` so items can be iterated in the order of insertion. - disputes: IndexMap, + disputes: HashMap, /// Sender to be cloned for `SendTask`s. tx: mpsc::Sender, - /// Future for delaying too frequent creation of dispute sending tasks. - rate_limit: RateLimit, - /// Metrics for reporting stats about sent requests. metrics: Metrics, } @@ -91,25 +70,19 @@ impl DisputeSender { Self { active_heads: Vec::new(), active_sessions: HashMap::new(), - disputes: IndexMap::new(), + disputes: HashMap::new(), tx, - rate_limit: RateLimit::new(), metrics, } } /// Create a `SendTask` for a particular new dispute. - /// - /// This function is rate-limited by `SEND_RATE_LIMIT`. It will block if called too frequently - /// in order to maintain the limit. pub async fn start_sender( &mut self, ctx: &mut Context, runtime: &mut RuntimeInfo, msg: DisputeMessage, ) -> Result<()> { - self.rate_limit.limit().await; - let req: DisputeRequest = msg.into(); let candidate_hash = req.0.candidate_receipt.hash(); match self.disputes.entry(candidate_hash) { @@ -139,8 +112,6 @@ impl DisputeSender { /// - Get new authorities to send messages to. /// - Get rid of obsolete tasks and disputes. /// - Get dispute sending started in case we missed one for some reason (e.g. on node startup) - /// - /// This function ensures the `SEND_RATE_LIMIT`, therefore it might block. pub async fn update_leaves( &mut self, ctx: &mut Context, @@ -163,38 +134,21 @@ impl DisputeSender { let active_disputes: HashSet<_> = active_disputes.into_iter().map(|(_, c)| c).collect(); - // Cleanup obsolete senders (retain keeps order of remaining elements): + // Cleanup obsolete senders: self.disputes .retain(|candidate_hash, _| active_disputes.contains(candidate_hash)); - // Iterates in order of insertion: - let mut should_rate_limit = true; for dispute in self.disputes.values_mut() { if have_new_sessions || dispute.has_failed_sends() { - if should_rate_limit { - self.rate_limit.limit().await; - } - let sends_happened = dispute + dispute .refresh_sends(ctx, runtime, &self.active_sessions, &self.metrics) .await?; - // Only rate limit if we actually sent something out _and_ it was not just because - // of errors on previous sends. - // - // Reasoning: It would not be acceptable to slow down the whole subsystem, just - // because of a few bad peers having problems. It is actually better to risk - // running into their rate limit in that case and accept a minor reputation change. - should_rate_limit = sends_happened && have_new_sessions; } } - // This should only be non-empty on startup, but if not - we got you covered. - // - // Initial order will not be maintained in that case, but that should be fine as disputes - // recovered at startup will be relatively "old" anyway and we assume that no more than a - // third of the validators will go offline at any point in time anyway. + // This should only be non-empty on startup, but if not - we got you covered: for dispute in unknown_disputes { - self.rate_limit.limit().await; - self.start_send_for_dispute(ctx, runtime, dispute).await?; + self.start_send_for_dispute(ctx, runtime, dispute).await? } Ok(()) } @@ -363,46 +317,6 @@ impl DisputeSender { } } -/// Rate limiting logic. -/// -/// Suitable for the sending side. -struct RateLimit { - limit: Delay, -} - -impl RateLimit { - /// Create new `RateLimit` that is immediately ready. - fn new() -> Self { - // Start with an empty duration, as there has not been any previous call. - Self { limit: Delay::new(Duration::new(0, 0)) } - } - - /// Initialized with actual `SEND_RATE_LIMIT` duration. - fn new_limit() -> Self { - Self { limit: Delay::new(SEND_RATE_LIMIT) } - } - - /// Wait until ready and prepare for next call. - async fn limit(&mut self) { - // Wait for rate limit and add some logging: - poll_fn(|cx| { - let old_limit = Pin::new(&mut self.limit); - match old_limit.poll(cx) { - Poll::Pending => { - gum::debug!( - target: LOG_TARGET, - "Sending rate limit hit, slowing down requests" - ); - Poll::Pending - }, - Poll::Ready(()) => Poll::Ready(()), - } - }) - .await; - *self = Self::new_limit(); - } -} - /// Retrieve the currently active sessions. /// /// List is all indices of all active sessions together with the head that was used for the query. diff --git a/node/network/dispute-distribution/src/sender/send_task.rs b/node/network/dispute-distribution/src/sender/send_task.rs index 89b5c099bde9..a2b8cdcf7441 100644 --- a/node/network/dispute-distribution/src/sender/send_task.rs +++ b/node/network/dispute-distribution/src/sender/send_task.rs @@ -42,15 +42,13 @@ use crate::{ /// Delivery status for a particular dispute. /// /// Keeps track of all the validators that have to be reached for a dispute. -/// -/// The unit of work for a `SendTask` is an authority/validator. pub struct SendTask { - /// The request we are supposed to get out to all `parachain` validators of the dispute's session + /// The request we are supposed to get out to all parachain validators of the dispute's session /// and to all current authorities. request: DisputeRequest, /// The set of authorities we need to send our messages to. This set will change at session - /// boundaries. It will always be at least the `parachain` validators of the session where the + /// boundaries. It will always be at least the parachain validators of the session where the /// dispute happened and the authorities of the current sessions as determined by active heads. deliveries: HashMap, @@ -102,10 +100,6 @@ impl TaskResult { #[overseer::contextbounds(DisputeDistribution, prefix = self::overseer)] impl SendTask { /// Initiates sending a dispute message to peers. - /// - /// Creation of new `SendTask`s is subject to rate limiting. As each `SendTask` will trigger - /// sending a message to each validator, hence for employing a per-peer rate limit, we need to - /// limit the construction of new `SendTask`s. pub async fn new( ctx: &mut Context, runtime: &mut RuntimeInfo, @@ -124,22 +118,15 @@ impl SendTask { /// /// This function is called at construction and should also be called whenever a session change /// happens and on a regular basis to ensure we are retrying failed attempts. - /// - /// This might resend to validators and is thus subject to any rate limiting we might want. - /// Calls to this function for different instances should be rate limited according to - /// `SEND_RATE_LIMIT`. - /// - /// Returns: `True` if this call resulted in new requests. pub async fn refresh_sends( &mut self, ctx: &mut Context, runtime: &mut RuntimeInfo, active_sessions: &HashMap, metrics: &Metrics, - ) -> Result { + ) -> Result<()> { let new_authorities = self.get_relevant_validators(ctx, runtime, active_sessions).await?; - // Note this will also contain all authorities for which sending failed previously: let add_authorities = new_authorities .iter() .filter(|a| !self.deliveries.contains_key(a)) @@ -154,14 +141,12 @@ impl SendTask { send_requests(ctx, self.tx.clone(), add_authorities, self.request.clone(), metrics) .await?; - let was_empty = new_statuses.is_empty(); - self.has_failed_sends = false; self.deliveries.extend(new_statuses.into_iter()); - Ok(!was_empty) + Ok(()) } - /// Whether any sends have failed since the last refresh. + /// Whether any sends have failed since the last refreshed. pub fn has_failed_sends(&self) -> bool { self.has_failed_sends } @@ -208,8 +193,9 @@ impl SendTask { /// Determine all validators that should receive the given dispute requests. /// - /// This is all `parachain` validators of the session the candidate occurred and all authorities + /// This is all parachain validators of the session the candidate occurred and all authorities /// of all currently active sessions, determined by currently active heads. + async fn get_relevant_validators( &self, ctx: &mut Context, @@ -307,7 +293,7 @@ async fn wait_response_task( gum::debug!( target: LOG_TARGET, %err, - "Failed to notify subsystem about dispute sending result." + "Failed to notify susystem about dispute sending result." ); } } diff --git a/node/network/dispute-distribution/src/tests/mock.rs b/node/network/dispute-distribution/src/tests/mock.rs index aa2a4485d480..08428d5852cc 100644 --- a/node/network/dispute-distribution/src/tests/mock.rs +++ b/node/network/dispute-distribution/src/tests/mock.rs @@ -20,7 +20,6 @@ use std::{ collections::{HashMap, HashSet}, sync::Arc, - time::Instant, }; use async_trait::async_trait; @@ -39,8 +38,6 @@ use polkadot_primitives::v2::{ }; use polkadot_primitives_test_helpers::dummy_candidate_descriptor; -use crate::LOG_TARGET; - pub const MOCK_SESSION_INDEX: SessionIndex = 1; pub const MOCK_NEXT_SESSION_INDEX: SessionIndex = 2; pub const MOCK_VALIDATORS: [Sr25519Keyring; 6] = [ @@ -57,8 +54,6 @@ pub const MOCK_AUTHORITIES_NEXT_SESSION: [Sr25519Keyring; 2] = pub const FERDIE_INDEX: ValidatorIndex = ValidatorIndex(0); pub const ALICE_INDEX: ValidatorIndex = ValidatorIndex(1); -pub const BOB_INDEX: ValidatorIndex = ValidatorIndex(2); -pub const CHARLIE_INDEX: ValidatorIndex = ValidatorIndex(3); lazy_static! { @@ -153,22 +148,12 @@ pub async fn make_dispute_message( invalid_validator: ValidatorIndex, ) -> DisputeMessage { let candidate_hash = candidate.hash(); - let before_request = Instant::now(); let valid_vote = make_explicit_signed(MOCK_VALIDATORS[valid_validator.0 as usize], candidate_hash, true) .await; - gum::trace!( - "Passed time for valid vote: {:#?}", - Instant::now().saturating_duration_since(before_request) - ); - let before_request = Instant::now(); let invalid_vote = make_explicit_signed(MOCK_VALIDATORS[invalid_validator.0 as usize], candidate_hash, false) .await; - gum::trace!( - "Passed time for invald vote: {:#?}", - Instant::now().saturating_duration_since(before_request) - ); DisputeMessage::from_signed_statements( valid_vote, valid_validator, @@ -221,15 +206,10 @@ impl AuthorityDiscovery for MockAuthorityDiscovery { ) -> Option> { for (a, p) in self.peer_ids.iter() { if p == &peer_id { - let result = - HashSet::from([MOCK_VALIDATORS_DISCOVERY_KEYS.get(&a).unwrap().clone()]); - gum::trace!( - target: LOG_TARGET, - %peer_id, - ?result, - "Returning authority ids for peer id" - ); - return Some(result) + return Some(HashSet::from([MOCK_VALIDATORS_DISCOVERY_KEYS + .get(&a) + .unwrap() + .clone()])) } } diff --git a/node/network/dispute-distribution/src/tests/mod.rs b/node/network/dispute-distribution/src/tests/mod.rs index 56cdd467fd62..8ef8286ea197 100644 --- a/node/network/dispute-distribution/src/tests/mod.rs +++ b/node/network/dispute-distribution/src/tests/mod.rs @@ -17,17 +17,12 @@ //! Subsystem unit tests -use std::{ - collections::HashSet, - sync::Arc, - task::Poll, - time::{Duration, Instant}, -}; +use std::{collections::HashSet, sync::Arc, task::Poll, time::Duration}; use assert_matches::assert_matches; use futures::{ channel::{mpsc, oneshot}, - future::{poll_fn, ready}, + future::poll_fn, pin_mut, Future, SinkExt, }; use futures_timer::Delay; @@ -57,7 +52,7 @@ use polkadot_node_subsystem_test_helpers::{ mock::make_ferdie_keystore, subsystem_test_harness, TestSubsystemContextHandle, }; use polkadot_primitives::v2::{ - AuthorityDiscoveryId, CandidateHash, CandidateReceipt, Hash, SessionIndex, SessionInfo, + AuthorityDiscoveryId, CandidateHash, Hash, SessionIndex, SessionInfo, }; use self::mock::{ @@ -65,11 +60,7 @@ use self::mock::{ MOCK_AUTHORITY_DISCOVERY, MOCK_NEXT_SESSION_INDEX, MOCK_NEXT_SESSION_INFO, MOCK_SESSION_INDEX, MOCK_SESSION_INFO, }; -use crate::{ - receiver::BATCH_COLLECTING_INTERVAL, - tests::mock::{BOB_INDEX, CHARLIE_INDEX}, - DisputeDistributionSubsystem, Metrics, LOG_TARGET, SEND_RATE_LIMIT, -}; +use crate::{DisputeDistributionSubsystem, Metrics, LOG_TARGET}; /// Useful mock providers. pub mod mock; @@ -81,108 +72,49 @@ fn send_dispute_sends_dispute() { let relay_parent = Hash::random(); let candidate = make_candidate_receipt(relay_parent); - send_dispute(&mut handle, candidate, true).await; - conclude(&mut handle).await; - }; - test_harness(test); -} - -#[test] -fn send_honors_rate_limit() { - sp_tracing::try_init_simple(); - let test = |mut handle: TestSubsystemContextHandle, _req_cfg| async move { - let _ = handle_subsystem_startup(&mut handle, None).await; - - let relay_parent = Hash::random(); - let candidate = make_candidate_receipt(relay_parent); - let before_request = Instant::now(); - send_dispute(&mut handle, candidate, true).await; - // First send should not be rate limited: - gum::trace!("Passed time: {:#?}", Instant::now().saturating_duration_since(before_request)); - // This test would likely be flaky on CI: - //assert!(Instant::now().saturating_duration_since(before_request) < SEND_RATE_LIMIT); - - let relay_parent = Hash::random(); - let candidate = make_candidate_receipt(relay_parent); - send_dispute(&mut handle, candidate, false).await; - // Second send should be rate limited: - gum::trace!( - "Passed time for send_dispute: {:#?}", - Instant::now().saturating_duration_since(before_request) - ); - assert!(Instant::now() - before_request >= SEND_RATE_LIMIT); - conclude(&mut handle).await; - }; - test_harness(test); -} - -/// Helper for sending a new dispute to dispute-distribution sender and handling resulting messages. -async fn send_dispute( - handle: &mut TestSubsystemContextHandle, - candidate: CandidateReceipt, - needs_session_info: bool, -) { - let before_request = Instant::now(); - let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; - gum::trace!( - "Passed time for making message: {:#?}", - Instant::now().saturating_duration_since(before_request) - ); - let before_request = Instant::now(); - handle - .send(FromOrchestra::Communication { - msg: DisputeDistributionMessage::SendDispute(message.clone()), - }) - .await; - gum::trace!( - "Passed time for sending message: {:#?}", - Instant::now().saturating_duration_since(before_request) - ); - if needs_session_info { + let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; + handle + .send(FromOrchestra::Communication { + msg: DisputeDistributionMessage::SendDispute(message.clone()), + }) + .await; // Requests needed session info: assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi( - RuntimeApiMessage::Request( - hash, - RuntimeApiRequest::SessionInfo(session_index, tx) + handle.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request( + hash, + RuntimeApiRequest::SessionInfo(session_index, tx) ) ) => { - assert_eq!(session_index, MOCK_SESSION_INDEX); - assert_eq!( - hash, - message.candidate_receipt().descriptor.relay_parent + assert_eq!(session_index, MOCK_SESSION_INDEX); + assert_eq!( + hash, + message.candidate_receipt().descriptor.relay_parent ); - tx.send(Ok(Some(MOCK_SESSION_INFO.clone()))).expect("Receiver should stay alive."); - } + tx.send(Ok(Some(MOCK_SESSION_INFO.clone()))).expect("Receiver should stay alive."); + } ); - } - let expected_receivers = { - let info = &MOCK_SESSION_INFO; - info.discovery_keys - .clone() - .into_iter() - .filter(|a| a != &Sr25519Keyring::Ferdie.public().into()) - .collect() - // All validators are also authorities in the first session, so we are - // done here. + let expected_receivers = { + let info = &MOCK_SESSION_INFO; + info.discovery_keys + .clone() + .into_iter() + .filter(|a| a != &Sr25519Keyring::Ferdie.public().into()) + .collect() + // All validators are also authorities in the first session, so we are + // done here. + }; + check_sent_requests(&mut handle, expected_receivers, true).await; + + conclude(&mut handle).await; }; - check_sent_requests(handle, expected_receivers, true).await; + test_harness(test); } -// Things to test: -// x Request triggers import -// x Subsequent imports get batched -// x Batch gets flushed. -// x Batch gets renewed. -// x Non authority requests get dropped. -// x Sending rate limit is honored. -// x Receiving rate limit is honored. -// x Duplicate requests on batch are dropped - #[test] -fn received_non_authorities_are_dropped() { +fn received_request_triggers_import() { let test = |mut handle: TestSubsystemContextHandle, mut req_cfg: RequestResponseConfig| async move { let req_tx = req_cfg.inbound_queue.as_mut().unwrap(); @@ -208,271 +140,110 @@ fn received_non_authorities_are_dropped() { assert_eq!(reputation_changes.len(), 1); } ); - conclude(&mut handle).await; - }; - test_harness(test); -} - -#[test] -fn received_request_triggers_import() { - let test = |mut handle: TestSubsystemContextHandle, - mut req_cfg: RequestResponseConfig| async move { - let req_tx = req_cfg.inbound_queue.as_mut().unwrap(); - let _ = handle_subsystem_startup(&mut handle, None).await; - - let relay_parent = Hash::random(); - let candidate = make_candidate_receipt(relay_parent); - let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; - - nested_network_dispute_request( - &mut handle, - req_tx, - MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Alice), - message.clone().into(), - ImportStatementsResult::ValidImport, - true, - move |_handle, _req_tx, _message| ready(()), - ) - .await; - - gum::trace!(target: LOG_TARGET, "Concluding."); - conclude(&mut handle).await; - }; - test_harness(test); -} - -#[test] -fn batching_works() { - let test = |mut handle: TestSubsystemContextHandle, - mut req_cfg: RequestResponseConfig| async move { - let req_tx = req_cfg.inbound_queue.as_mut().unwrap(); - let _ = handle_subsystem_startup(&mut handle, None).await; - let relay_parent = Hash::random(); - let candidate = make_candidate_receipt(relay_parent); - let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; - - // Initial request should get forwarded immediately: + // Nested valid and invalid import. + // + // Nested requests from same peer should get dropped. For the invalid request even + // subsequent requests should get dropped. nested_network_dispute_request( &mut handle, req_tx, MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Alice), message.clone().into(), - ImportStatementsResult::ValidImport, + ImportStatementsResult::InvalidImport, true, - move |_handle, _req_tx, _message| ready(()), + move |handle, req_tx, message| { + nested_network_dispute_request( + handle, + req_tx, + MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob), + message.clone().into(), + ImportStatementsResult::ValidImport, + false, + move |_, req_tx, message| async move { + // Another request from Alice should get dropped (request already in + // flight): + { + let rx_response = send_network_dispute_request( + req_tx, + MOCK_AUTHORITY_DISCOVERY + .get_peer_id_by_authority(Sr25519Keyring::Alice), + message.clone(), + ) + .await; + + assert_matches!( + rx_response.await, + Err(err) => { + gum::trace!( + target: LOG_TARGET, + ?err, + "Request got dropped - other request already in flight" + ); + } + ); + } + // Another request from Bob should get dropped (request already in + // flight): + { + let rx_response = send_network_dispute_request( + req_tx, + MOCK_AUTHORITY_DISCOVERY + .get_peer_id_by_authority(Sr25519Keyring::Bob), + message.clone(), + ) + .await; + + assert_matches!( + rx_response.await, + Err(err) => { + gum::trace!( + target: LOG_TARGET, + ?err, + "Request got dropped - other request already in flight" + ); + } + ); + } + }, + ) + }, ) .await; - let mut rx_responses = Vec::new(); - - let message = make_dispute_message(candidate.clone(), BOB_INDEX, FERDIE_INDEX).await; - let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob); - rx_responses.push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); - - let message = make_dispute_message(candidate.clone(), CHARLIE_INDEX, FERDIE_INDEX).await; - let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Charlie); - rx_responses.push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); - gum::trace!("Imported 3 votes into batch"); - - Delay::new(BATCH_COLLECTING_INTERVAL).await; - gum::trace!("Batch should still be alive"); - // Batch should still be alive (2 new votes): - // Let's import two more votes, but fully duplicates - should not extend batch live. - gum::trace!("Importing duplicate votes"); - let mut rx_responses_duplicate = Vec::new(); - let message = make_dispute_message(candidate.clone(), BOB_INDEX, FERDIE_INDEX).await; - let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob); - rx_responses_duplicate - .push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); - - let message = make_dispute_message(candidate.clone(), CHARLIE_INDEX, FERDIE_INDEX).await; - let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Charlie); - rx_responses_duplicate - .push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); - - for rx_response in rx_responses_duplicate { - assert_matches!( - rx_response.await, - Ok(resp) => { - let sc_network::config::OutgoingResponse { - result, - reputation_changes, - sent_feedback: _, - } = resp; - gum::trace!( - target: LOG_TARGET, - ?reputation_changes, - "Received reputation changes." - ); - // We don't punish on that. - assert_eq!(reputation_changes.len(), 0); - - assert_matches!(result, Err(())); - } - ); - } - - Delay::new(BATCH_COLLECTING_INTERVAL).await; - gum::trace!("Batch should be ready now (only duplicates have been added)"); - - let pending_confirmation = assert_matches!( - handle.recv().await, - AllMessages::DisputeCoordinator( - DisputeCoordinatorMessage::ImportStatements { - candidate_receipt: _, - session, - statements, - pending_confirmation: Some(pending_confirmation), - } - ) => { - assert_eq!(session, MOCK_SESSION_INDEX); - assert_eq!(statements.len(), 3); - pending_confirmation - } - ); - pending_confirmation.send(ImportStatementsResult::ValidImport).unwrap(); + // Subsequent sends from Alice should fail (peer is banned): + { + let rx_response = send_network_dispute_request( + req_tx, + MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Alice), + message.clone().into(), + ) + .await; - for rx_response in rx_responses { assert_matches!( rx_response.await, - Ok(resp) => { - let sc_network::config::OutgoingResponse { - result, - reputation_changes: _, - sent_feedback, - } = resp; - - let result = result.unwrap(); - let decoded = - ::decode(&mut result.as_slice()).unwrap(); - - assert!(decoded == DisputeResponse::Confirmed); - if let Some(sent_feedback) = sent_feedback { - sent_feedback.send(()).unwrap(); - } + Err(err) => { gum::trace!( target: LOG_TARGET, - "Valid import happened." + ?err, + "Request got dropped - peer is banned." ); - } ); } - gum::trace!(target: LOG_TARGET, "Concluding."); - conclude(&mut handle).await; - }; - test_harness(test); -} - -#[test] -fn receive_rate_limit_is_enforced() { - let test = |mut handle: TestSubsystemContextHandle, - mut req_cfg: RequestResponseConfig| async move { - let req_tx = req_cfg.inbound_queue.as_mut().unwrap(); - let _ = handle_subsystem_startup(&mut handle, None).await; - - let relay_parent = Hash::random(); - let candidate = make_candidate_receipt(relay_parent); - let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; - - // Initial request should get forwarded immediately: + // But should work fine for Bob: nested_network_dispute_request( &mut handle, req_tx, - MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Alice), + MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob), message.clone().into(), ImportStatementsResult::ValidImport, - true, - move |_handle, _req_tx, _message| ready(()), + false, + |_, _, _| async {}, ) .await; - let mut rx_responses = Vec::new(); - - let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob); - - let message = make_dispute_message(candidate.clone(), BOB_INDEX, FERDIE_INDEX).await; - rx_responses.push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); - - let message = make_dispute_message(candidate.clone(), CHARLIE_INDEX, FERDIE_INDEX).await; - rx_responses.push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); - - gum::trace!("Import one too much:"); - - let message = make_dispute_message(candidate.clone(), CHARLIE_INDEX, ALICE_INDEX).await; - let rx_response_flood = - send_network_dispute_request(req_tx, peer, message.clone().into()).await; - - assert_matches!( - rx_response_flood.await, - Ok(resp) => { - let sc_network::config::OutgoingResponse { - result: _, - reputation_changes, - sent_feedback: _, - } = resp; - gum::trace!( - target: LOG_TARGET, - ?reputation_changes, - "Received reputation changes." - ); - // Received punishment for flood: - assert_eq!(reputation_changes.len(), 1); - } - ); - gum::trace!("Need to wait 2 patch intervals:"); - Delay::new(BATCH_COLLECTING_INTERVAL).await; - Delay::new(BATCH_COLLECTING_INTERVAL).await; - - gum::trace!("Batch should be ready now"); - - let pending_confirmation = assert_matches!( - handle.recv().await, - AllMessages::DisputeCoordinator( - DisputeCoordinatorMessage::ImportStatements { - candidate_receipt: _, - session, - statements, - pending_confirmation: Some(pending_confirmation), - } - ) => { - assert_eq!(session, MOCK_SESSION_INDEX); - // Only 3 as fourth was flood: - assert_eq!(statements.len(), 3); - pending_confirmation - } - ); - pending_confirmation.send(ImportStatementsResult::ValidImport).unwrap(); - - for rx_response in rx_responses { - assert_matches!( - rx_response.await, - Ok(resp) => { - let sc_network::config::OutgoingResponse { - result, - reputation_changes: _, - sent_feedback, - } = resp; - - let result = result.unwrap(); - let decoded = - ::decode(&mut result.as_slice()).unwrap(); - - assert!(decoded == DisputeResponse::Confirmed); - if let Some(sent_feedback) = sent_feedback { - sent_feedback.send(()).unwrap(); - } - gum::trace!( - target: LOG_TARGET, - "Valid import happened." - ); - - } - ); - } - gum::trace!(target: LOG_TARGET, "Concluding."); conclude(&mut handle).await; }; diff --git a/node/network/protocol/src/request_response/mod.rs b/node/network/protocol/src/request_response/mod.rs index d24537e219c7..5f4740279ef6 100644 --- a/node/network/protocol/src/request_response/mod.rs +++ b/node/network/protocol/src/request_response/mod.rs @@ -121,10 +121,6 @@ const POV_RESPONSE_SIZE: u64 = MAX_POV_SIZE as u64 + 10_000; /// This is `MAX_CODE_SIZE` plus some additional space for protocol overhead. const STATEMENT_RESPONSE_SIZE: u64 = MAX_CODE_SIZE as u64 + 10_000; -/// We can have relative large timeouts here, there is no value of hitting a -/// timeout as we want to get statements through to each node in any case. -pub const DISPUTE_REQUEST_TIMEOUT: Duration = Duration::from_secs(12); - impl Protocol { /// Get a configuration for a given Request response protocol. /// @@ -198,7 +194,9 @@ impl Protocol { /// Responses are just confirmation, in essence not even a bit. So 100 seems /// plenty. max_response_size: 100, - request_timeout: DISPUTE_REQUEST_TIMEOUT, + /// We can have relative large timeouts here, there is no value of hitting a + /// timeout as we want to get statements through to each node in any case. + request_timeout: Duration::from_secs(12), inbound_queue: Some(tx), }, }; diff --git a/node/overseer/Cargo.toml b/node/overseer/Cargo.toml index 8ee3fc6fb3cd..0db382e4e783 100644 --- a/node/overseer/Cargo.toml +++ b/node/overseer/Cargo.toml @@ -17,8 +17,8 @@ polkadot-node-metrics = { path = "../metrics" } polkadot-primitives = { path = "../../primitives" } orchestra = "0.0.2" gum = { package = "tracing-gum", path = "../gum" } -lru = "0.8" -parity-util-mem = { version = "0.12.0", default-features = false } +lru = "0.7" +parity-util-mem = { version = "0.11.0", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } async-trait = "0.1.57" diff --git a/node/overseer/src/lib.rs b/node/overseer/src/lib.rs index 70dbe92b2432..1ce6a6fdb658 100644 --- a/node/overseer/src/lib.rs +++ b/node/overseer/src/lib.rs @@ -62,7 +62,6 @@ use std::{ collections::{hash_map, HashMap}, fmt::{self, Debug}, - num::NonZeroUsize, pin::Pin, sync::Arc, time::Duration, @@ -113,10 +112,7 @@ pub use orchestra::{ /// Store 2 days worth of blocks, not accounting for forks, /// in the LRU cache. Assumes a 6-second block time. -pub const KNOWN_LEAVES_CACHE_SIZE: NonZeroUsize = match NonZeroUsize::new(2 * 24 * 3600 / 6) { - Some(cap) => cap, - None => panic!("Known leaves cache size must be non-zero"), -}; +pub const KNOWN_LEAVES_CACHE_SIZE: usize = 2 * 24 * 3600 / 6; #[cfg(test)] mod tests; diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 63a5f189a32a..a9c9484b6eba 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -69,11 +69,11 @@ gum = { package = "tracing-gum", path = "../gum/" } serde = { version = "1.0.137", features = ["derive"] } serde_json = "1.0.81" thiserror = "1.0.31" -kvdb = "0.12.0" -kvdb-rocksdb = { version = "0.16.0", optional = true } +kvdb = "0.11.0" +kvdb-rocksdb = { version = "0.15.2", optional = true } parity-db = { version = "0.3.16", optional = true } async-trait = "0.1.57" -lru = "0.8" +lru = "0.7" # Polkadot polkadot-node-core-parachains-inherent = { path = "../core/parachains-inherent" } diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index 3619d05c7592..6425ee7a7536 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -1192,11 +1192,9 @@ where justifications_protocol_name, _phantom: core::marker::PhantomData::, }; - let payload_provider = beefy_primitives::mmr::MmrRootProvider::new(client.clone()); let beefy_params = beefy_gadget::BeefyParams { client: client.clone(), backend: backend.clone(), - payload_provider, runtime: client.clone(), key_store: keystore_opt.clone(), network_params, @@ -1206,7 +1204,7 @@ where on_demand_justifications_handler: beefy_on_demand_justifications_handler, }; - let gadget = beefy_gadget::start_beefy_gadget::<_, _, _, _, _, _>(beefy_params); + let gadget = beefy_gadget::start_beefy_gadget::<_, _, _, _, _>(beefy_params); // Wococo's purpose is to be a testbed for BEEFY, so if it fails we'll // bring the node down with it to make sure it is noticed. diff --git a/node/service/src/parachains_db/upgrade.rs b/node/service/src/parachains_db/upgrade.rs index 73321ae04c09..ad995f41ed82 100644 --- a/node/service/src/parachains_db/upgrade.rs +++ b/node/service/src/parachains_db/upgrade.rs @@ -121,7 +121,7 @@ fn rocksdb_migrate_from_version_0_to_1(path: &Path) -> Result<(), Error> { .to_str() .ok_or_else(|| super::other_io_error("Invalid database path".into()))?; let db_cfg = DatabaseConfig::with_columns(super::columns::v0::NUM_COLUMNS); - let mut db = Database::open(&db_cfg, db_path)?; + let db = Database::open(&db_cfg, db_path)?; db.add_column()?; db.add_column()?; diff --git a/node/subsystem-test-helpers/src/lib.rs b/node/subsystem-test-helpers/src/lib.rs index 79f833b7558c..e2e61c2006d8 100644 --- a/node/subsystem-test-helpers/src/lib.rs +++ b/node/subsystem-test-helpers/src/lib.rs @@ -30,7 +30,6 @@ use sp_core::testing::TaskExecutor; use std::{ convert::Infallible, - future::Future, pin::Pin, sync::Arc, task::{Context, Poll, Waker}, @@ -392,34 +391,6 @@ macro_rules! arbitrary_order { }; } -/// Future that yields the execution once and resolves -/// immediately after. -/// -/// Useful when one wants to poll the background task to completion -/// before sending messages to it in order to avoid races. -pub struct Yield(bool); - -impl Yield { - /// Returns new `Yield` future. - pub fn new() -> Self { - Self(false) - } -} - -impl Future for Yield { - type Output = (); - - fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - if !self.0 { - self.0 = true; - cx.waker().wake_by_ref(); - Poll::Pending - } else { - Poll::Ready(()) - } - } -} - #[cfg(test)] mod tests { use super::*; diff --git a/node/subsystem-util/Cargo.toml b/node/subsystem-util/Cargo.toml index 26eca7aa8f1f..a3985a898849 100644 --- a/node/subsystem-util/Cargo.toml +++ b/node/subsystem-util/Cargo.toml @@ -17,7 +17,7 @@ thiserror = "1.0.31" fatality = "0.0.6" gum = { package = "tracing-gum", path = "../gum" } derive_more = "0.99.17" -lru = "0.8.0" +lru = "0.7.7" polkadot-node-subsystem = {path = "../subsystem" } polkadot-node-jaeger = { path = "../jaeger" } @@ -32,8 +32,8 @@ 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" } -kvdb = "0.12.0" -parity-util-mem = { version = "0.12.0", default-features = false } +kvdb = "0.11.0" +parity-util-mem = { version = "0.11", default-features = false } parity-db = { version = "0.3.13" } [dev-dependencies] @@ -44,5 +44,5 @@ log = "0.4.17" polkadot-node-subsystem-test-helpers = { path = "../subsystem-test-helpers" } lazy_static = "1.4.0" polkadot-primitives-test-helpers = { path = "../../primitives/test-helpers" } -kvdb-shared-tests = "0.10.0" +kvdb-shared-tests = "0.9.0" tempfile = "3.1.0" diff --git a/node/subsystem-util/src/database.rs b/node/subsystem-util/src/database.rs index 6f338b5d6440..a6b31043302f 100644 --- a/node/subsystem-util/src/database.rs +++ b/node/subsystem-util/src/database.rs @@ -16,7 +16,7 @@ //! Database trait for polkadot db. -pub use kvdb::{DBKeyValue, DBTransaction, DBValue, KeyValueDB}; +pub use kvdb::{DBTransaction, DBValue, KeyValueDB}; /// Database trait with ordered key capacity. pub trait Database: KeyValueDB { @@ -27,7 +27,7 @@ pub trait Database: KeyValueDB { /// Implementation for database supporting `KeyValueDB` already. pub mod kvdb_impl { - use super::{DBKeyValue, DBTransaction, DBValue, Database, KeyValueDB}; + use super::{DBTransaction, DBValue, Database, KeyValueDB}; use kvdb::{DBOp, IoStats, IoStatsKind}; use parity_util_mem::{MallocSizeOf, MallocSizeOfOps}; use std::{collections::BTreeSet, io::Result}; @@ -86,7 +86,7 @@ pub mod kvdb_impl { self.db.get(col, key) } - fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Result> { + fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Option> { self.ensure_is_indexed(col); self.db.get_by_prefix(col, prefix) } @@ -96,7 +96,7 @@ pub mod kvdb_impl { self.db.write(transaction) } - fn iter<'a>(&'a self, col: u32) -> Box> + 'a> { + fn iter<'a>(&'a self, col: u32) -> Box, Box<[u8]>)> + 'a> { self.ensure_is_indexed(col); self.db.iter(col) } @@ -105,11 +105,15 @@ pub mod kvdb_impl { &'a self, col: u32, prefix: &'a [u8], - ) -> Box> + 'a> { + ) -> Box, Box<[u8]>)> + 'a> { self.ensure_is_indexed(col); self.db.iter_with_prefix(col, prefix) } + fn restore(&self, _new_db: &str) -> Result<()> { + unimplemented!("restore is unsupported") + } + fn io_stats(&self, kind: IoStatsKind) -> IoStats { self.db.io_stats(kind) } @@ -118,7 +122,7 @@ pub mod kvdb_impl { self.db.has_key(col, key) } - fn has_prefix(&self, col: u32, prefix: &[u8]) -> Result { + fn has_prefix(&self, col: u32, prefix: &[u8]) -> bool { self.ensure_is_indexed(col); self.db.has_prefix(col, prefix) } @@ -134,8 +138,8 @@ pub mod kvdb_impl { /// Utilities for using parity-db database. pub mod paritydb_impl { - use super::{DBKeyValue, DBTransaction, DBValue, Database, KeyValueDB}; - use kvdb::DBOp; + use super::{DBTransaction, DBValue, Database, KeyValueDB}; + use kvdb::{DBOp, IoStats, IoStatsKind}; use parity_db::Db; use parking_lot::Mutex; use std::{collections::BTreeSet, io::Result, sync::Arc}; @@ -175,20 +179,18 @@ pub mod paritydb_impl { map_err(self.db.get(col as u8, key)) } - fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Result> { - self.iter_with_prefix(col, prefix) - .next() - .transpose() - .map(|mb| mb.map(|(_, v)| v)) + fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Option> { + self.iter_with_prefix(col, prefix).next().map(|(_, v)| v) } - fn iter<'a>(&'a self, col: u32) -> Box> + 'a> { - let mut iter = match self.db.iter(col as u8) { - Ok(iter) => iter, - Err(e) => return Box::new(std::iter::once(map_err(Err(e)))), - }; + fn iter<'a>(&'a self, col: u32) -> Box, Box<[u8]>)> + 'a> { + let mut iter = handle_err(self.db.iter(col as u8)); Box::new(std::iter::from_fn(move || { - iter.next().transpose().map(|r| map_err(r.map(|(k, v)| (k.into(), v)))) + if let Some((key, value)) = handle_err(iter.next()) { + Some((key.into_boxed_slice(), value.into_boxed_slice())) + } else { + None + } })) } @@ -196,26 +198,39 @@ pub mod paritydb_impl { &'a self, col: u32, prefix: &'a [u8], - ) -> Box> + 'a> { + ) -> Box, Box<[u8]>)> + 'a> { if prefix.len() == 0 { return self.iter(col) } - let mut iter = match self.db.iter(col as u8) { - Ok(iter) => iter, - Err(e) => return Box::new(std::iter::once(map_err(Err(e)))), - }; - if let Err(e) = iter.seek(prefix) { - return Box::new(std::iter::once(map_err(Err(e)))) - } + let mut iter = handle_err(self.db.iter(col as u8)); + handle_err(iter.seek(prefix)); Box::new(std::iter::from_fn(move || { - iter.next().transpose().and_then(|r| { - map_err(r.map(|(k, v)| k.starts_with(prefix).then(|| (k.into(), v)))) - .transpose() - }) + if let Some((key, value)) = handle_err(iter.next()) { + key.starts_with(prefix) + .then(|| (key.into_boxed_slice(), value.into_boxed_slice())) + } else { + None + } })) } - fn write(&self, transaction: DBTransaction) -> Result<()> { + fn restore(&self, _new_db: &str) -> Result<()> { + unimplemented!("restore is unsupported") + } + + fn io_stats(&self, _kind: IoStatsKind) -> IoStats { + unimplemented!("io_stats not supported by parity_db"); + } + + fn has_key(&self, col: u32, key: &[u8]) -> Result { + map_err(self.db.get_size(col as u8, key).map(|r| r.is_some())) + } + + fn has_prefix(&self, col: u32, prefix: &[u8]) -> bool { + self.get_by_prefix(col, prefix).is_some() + } + + fn write(&self, transaction: DBTransaction) -> std::io::Result<()> { let mut ops = transaction.ops.into_iter(); // TODO using a key iterator or native delete here would be faster. let mut current_prefix_iter: Option<(parity_db::BTreeIterator, u8, Vec)> = None; diff --git a/node/subsystem-util/src/rolling_session_window.rs b/node/subsystem-util/src/rolling_session_window.rs index 0ff2dc6deb13..dd9282b50fe5 100644 --- a/node/subsystem-util/src/rolling_session_window.rs +++ b/node/subsystem-util/src/rolling_session_window.rs @@ -20,17 +20,15 @@ //! care about the state of particular blocks. pub use polkadot_node_primitives::{new_session_window_size, SessionWindowSize}; -use polkadot_primitives::v2::{BlockNumber, Hash, SessionIndex, SessionInfo}; +use polkadot_primitives::v2::{Hash, SessionIndex, SessionInfo}; use futures::channel::oneshot; use polkadot_node_subsystem::{ - errors::{ChainApiError, RuntimeApiError}, - messages::{ChainApiMessage, RuntimeApiMessage, RuntimeApiRequest}, + errors::RuntimeApiError, + messages::{RuntimeApiMessage, RuntimeApiRequest}, overseer, }; -const LOG_TARGET: &str = "parachain::rolling-session-window"; - /// Sessions unavailable in state to cache. #[derive(Debug, Clone, thiserror::Error)] pub enum SessionsUnavailableReason { @@ -40,18 +38,9 @@ pub enum SessionsUnavailableReason { /// The runtime API itself returned an error. #[error(transparent)] RuntimeApi(#[from] RuntimeApiError), - /// The chain API itself returned an error. - #[error(transparent)] - ChainApi(#[from] ChainApiError), /// Missing session info from runtime API for given `SessionIndex`. #[error("Missing session index {0:?}")] Missing(SessionIndex), - /// Missing last finalized block number. - #[error("Missing last finalized block number")] - MissingLastFinalizedBlock, - /// Missing last finalized block hash. - #[error("Missing last finalized block hash")] - MissingLastFinalizedBlockHash(BlockNumber), } /// Information about the sessions being fetched. @@ -109,18 +98,11 @@ impl RollingSessionWindow { block_hash: Hash, ) -> Result where - Sender: overseer::SubsystemSender - + overseer::SubsystemSender, + Sender: overseer::SubsystemSender, { let session_index = get_session_index_for_child(&mut sender, block_hash).await?; - let earliest_non_finalized_block_session = - Self::earliest_non_finalized_block_session(&mut sender).await?; - // This will increase the session window to cover the full unfinalized chain. - let window_start = std::cmp::min( - session_index.saturating_sub(window_size.get() - 1), - earliest_non_finalized_block_session, - ); + let window_start = session_index.saturating_sub(window_size.get() - 1); match load_all_sessions(&mut sender, block_hash, window_start, session_index).await { Err(kind) => Err(SessionsUnavailable { @@ -164,87 +146,6 @@ impl RollingSessionWindow { self.earliest_session + (self.session_info.len() as SessionIndex).saturating_sub(1) } - async fn earliest_non_finalized_block_session( - sender: &mut Sender, - ) -> Result - where - Sender: overseer::SubsystemSender - + overseer::SubsystemSender, - { - let last_finalized_height = { - let (tx, rx) = oneshot::channel(); - sender.send_message(ChainApiMessage::FinalizedBlockNumber(tx)).await; - match rx.await { - Ok(Ok(number)) => number, - Ok(Err(e)) => - return Err(SessionsUnavailable { - kind: SessionsUnavailableReason::ChainApi(e), - info: None, - }), - Err(err) => { - gum::warn!( - target: LOG_TARGET, - ?err, - "Failed fetching last finalized block number" - ); - return Err(SessionsUnavailable { - kind: SessionsUnavailableReason::MissingLastFinalizedBlock, - info: None, - }) - }, - } - }; - - let (tx, rx) = oneshot::channel(); - // We want to get the session index for the child of the last finalized block. - sender - .send_message(ChainApiMessage::FinalizedBlockHash(last_finalized_height, tx)) - .await; - let last_finalized_hash_parent = match rx.await { - Ok(Ok(maybe_hash)) => maybe_hash, - Ok(Err(e)) => - return Err(SessionsUnavailable { - kind: SessionsUnavailableReason::ChainApi(e), - info: None, - }), - Err(err) => { - gum::warn!(target: LOG_TARGET, ?err, "Failed fetching last finalized block hash"); - return Err(SessionsUnavailable { - kind: SessionsUnavailableReason::MissingLastFinalizedBlockHash( - last_finalized_height, - ), - info: None, - }) - }, - }; - - // Get the session in which the last finalized block was authored. - if let Some(last_finalized_hash_parent) = last_finalized_hash_parent { - let session = - match get_session_index_for_child(sender, last_finalized_hash_parent).await { - Ok(session_index) => session_index, - Err(err) => { - gum::warn!( - target: LOG_TARGET, - ?err, - ?last_finalized_hash_parent, - "Failed fetching session index" - ); - return Err(err) - }, - }; - - Ok(session) - } else { - return Err(SessionsUnavailable { - kind: SessionsUnavailableReason::MissingLastFinalizedBlockHash( - last_finalized_height, - ), - info: None, - }) - } - } - /// When inspecting a new import notification, updates the session info cache to match /// the session of the imported block's child. /// @@ -252,18 +153,12 @@ impl RollingSessionWindow { /// not change often and import notifications are expected to be typically increasing in session number. /// /// some backwards drift in session index is acceptable. - pub async fn cache_session_info_for_head( + pub async fn cache_session_info_for_head( &mut self, - sender: &mut Sender, + sender: &mut impl overseer::SubsystemSender, block_hash: Hash, - ) -> Result - where - Sender: overseer::SubsystemSender - + overseer::SubsystemSender, - { + ) -> Result { let session_index = get_session_index_for_child(sender, block_hash).await?; - let earliest_non_finalized_block_session = - Self::earliest_non_finalized_block_session(sender).await?; let old_window_start = self.earliest_session; @@ -276,12 +171,7 @@ impl RollingSessionWindow { let old_window_end = latest; - // Ensure we keep sessions up to last finalized block by adjusting the window start. - // This will increase the session window to cover the full unfinalized chain. - let window_start = std::cmp::min( - session_index.saturating_sub(self.window_size.get() - 1), - earliest_non_finalized_block_session, - ); + let window_start = session_index.saturating_sub(self.window_size.get() - 1); // keep some of the old window, if applicable. let overlap_start = window_start.saturating_sub(old_window_start); @@ -429,14 +319,6 @@ mod tests { parent_hash: Default::default(), }; - let finalized_header = Header { - digest: Default::default(), - extrinsics_root: Default::default(), - number: 0, - state_root: Default::default(), - parent_hash: Default::default(), - }; - let pool = TaskExecutor::new(); let (mut ctx, mut handle) = make_subsystem_context::(pool.clone()); @@ -476,37 +358,6 @@ mod tests { } ); - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( - s_tx, - )) => { - let _ = s_tx.send(Ok(finalized_header.number)); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( - block_number, - s_tx, - )) => { - assert_eq!(block_number, finalized_header.number); - let _ = s_tx.send(Ok(Some(finalized_header.hash()))); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionIndexForChild(s_tx), - )) => { - assert_eq!(h, finalized_header.hash()); - let _ = s_tx.send(Ok(session)); - } - ); - for i in expect_requests_from..=session { assert_matches!( handle.recv().await, @@ -634,108 +485,6 @@ mod tests { cache_session_info_test(0, 3, Some(window), 2); } - #[test] - fn any_session_stretch_for_unfinalized_chain() { - // Session index of the tip of our fake test chain. - let session: SessionIndex = 100; - let genesis_session: SessionIndex = 0; - - let header = Header { - digest: Default::default(), - extrinsics_root: Default::default(), - number: 5, - state_root: Default::default(), - parent_hash: Default::default(), - }; - - let finalized_header = Header { - digest: Default::default(), - extrinsics_root: Default::default(), - number: 0, - state_root: Default::default(), - parent_hash: Default::default(), - }; - - let pool = TaskExecutor::new(); - let (mut ctx, mut handle) = make_subsystem_context::<(), _>(pool.clone()); - - let hash = header.hash(); - - let test_fut = { - let sender = ctx.sender().clone(); - Box::pin(async move { - let res = RollingSessionWindow::new(sender, TEST_WINDOW_SIZE, hash).await; - assert!(res.is_err()); - }) - }; - - let aux_fut = Box::pin(async move { - assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionIndexForChild(s_tx), - )) => { - assert_eq!(h, hash); - let _ = s_tx.send(Ok(session)); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( - s_tx, - )) => { - let _ = s_tx.send(Ok(finalized_header.number)); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( - block_number, - s_tx, - )) => { - assert_eq!(block_number, finalized_header.number); - let _ = s_tx.send(Ok(Some(finalized_header.hash()))); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionIndexForChild(s_tx), - )) => { - assert_eq!(h, finalized_header.hash()); - let _ = s_tx.send(Ok(0)); - } - ); - - // Unfinalized chain starts at geneisis block, so session 0 is how far we stretch. - for i in genesis_session..=session { - assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionInfo(j, s_tx), - )) => { - assert_eq!(h, hash); - assert_eq!(i, j); - - let _ = s_tx.send(Ok(if i == session { - None - } else { - Some(dummy_session_info(i)) - })); - } - ); - } - }); - - futures::executor::block_on(futures::future::join(test_fut, aux_fut)); - } - #[test] fn any_session_unavailable_for_caching_means_no_change() { let session: SessionIndex = 6; @@ -749,14 +498,6 @@ mod tests { parent_hash: Default::default(), }; - let finalized_header = Header { - digest: Default::default(), - extrinsics_root: Default::default(), - number: 0, - state_root: Default::default(), - parent_hash: Default::default(), - }; - let pool = TaskExecutor::new(); let (mut ctx, mut handle) = make_subsystem_context::<(), _>(pool.clone()); @@ -782,37 +523,6 @@ mod tests { } ); - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( - s_tx, - )) => { - let _ = s_tx.send(Ok(finalized_header.number)); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( - block_number, - s_tx, - )) => { - assert_eq!(block_number, finalized_header.number); - let _ = s_tx.send(Ok(Some(finalized_header.hash()))); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionIndexForChild(s_tx), - )) => { - assert_eq!(h, finalized_header.hash()); - let _ = s_tx.send(Ok(session)); - } - ); - for i in start_session..=session { assert_matches!( handle.recv().await, @@ -876,37 +586,6 @@ mod tests { } ); - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( - s_tx, - )) => { - let _ = s_tx.send(Ok(header.number)); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( - block_number, - s_tx, - )) => { - assert_eq!(block_number, header.number); - let _ = s_tx.send(Ok(Some(header.hash()))); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionIndexForChild(s_tx), - )) => { - assert_eq!(h, header.hash()); - let _ = s_tx.send(Ok(session)); - } - ); - assert_matches!( handle.recv().await, AllMessages::RuntimeApi(RuntimeApiMessage::Request( diff --git a/node/subsystem-util/src/runtime/mod.rs b/node/subsystem-util/src/runtime/mod.rs index 7fcae2c57b09..fc660a9dc6df 100644 --- a/node/subsystem-util/src/runtime/mod.rs +++ b/node/subsystem-util/src/runtime/mod.rs @@ -16,7 +16,7 @@ //! Convenient interface to runtime information. -use std::num::NonZeroUsize; +use std::cmp::max; use lru::LruCache; @@ -52,7 +52,7 @@ pub struct Config { pub keystore: Option, /// How many sessions should we keep in the cache? - pub session_cache_lru_size: NonZeroUsize, + pub session_cache_lru_size: usize, } /// Caching of session info. @@ -95,7 +95,7 @@ impl Default for Config { Self { keystore: None, // Usually we need to cache the current and the last session. - session_cache_lru_size: NonZeroUsize::new(2).expect("2 is larger than 0; qed"), + session_cache_lru_size: 2, } } } @@ -109,10 +109,7 @@ impl RuntimeInfo { /// Create with more elaborate configuration options. pub fn new_with_config(cfg: Config) -> Self { Self { - session_index_cache: LruCache::new( - cfg.session_cache_lru_size - .max(NonZeroUsize::new(10).expect("10 is larger than 0; qed")), - ), + session_index_cache: LruCache::new(max(10, cfg.session_cache_lru_size)), session_info_cache: LruCache::new(cfg.session_cache_lru_size), keystore: cfg.keystore, } diff --git a/node/test/performance-test/Cargo.toml b/node/test/performance-test/Cargo.toml index 583b80e3c2f4..783f5194a0f5 100644 --- a/node/test/performance-test/Cargo.toml +++ b/node/test/performance-test/Cargo.toml @@ -19,6 +19,3 @@ kusama-runtime = { path = "../../../runtime/kusama" } [[bin]] name = "gen-ref-constants" path = "src/gen_ref_constants.rs" - -[features] -runtime-benchmarks = ["kusama-runtime/runtime-benchmarks"] diff --git a/parachain/Cargo.toml b/parachain/Cargo.toml index c07ec98d7cb9..42ffbfab1fa6 100644 --- a/parachain/Cargo.toml +++ b/parachain/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" # this crate for WASM. This is critical to avoid forcing all parachain WASM into implementing # various unnecessary Substrate-specific endpoints. parity-scale-codec = { version = "3.1.5", default-features = false, features = [ "derive" ] } -parity-util-mem = { version = "0.12.0", default-features = false, optional = true } +parity-util-mem = { version = "0.11.0", default-features = false, optional = true } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 67fc2d31cee8..d018cfdf9e54 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -27,7 +27,7 @@ trie = { package = "sp-trie", git = "https://github.com/paritytech/substrate", b bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } hex-literal = "0.3.4" -parity-util-mem = { version = "0.12.0", default-features = false, optional = true } +parity-util-mem = { version = "0.11.0", default-features = false, optional = true } [features] default = ["std"] diff --git a/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md b/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md index 6b8e5ec03cf4..b63ea2bdcbf0 100644 --- a/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md +++ b/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md @@ -15,13 +15,6 @@ This design should result in a protocol that is: ## Protocol -Distributing disputes needs to be a reliable protocol. We would like to make as -sure as possible that our vote got properly delivered to all concerned -validators. For this to work, this subsystem won't be gossip based, but instead -will use a request/response protocol for application level confirmations. The -request will be the payload (the actual votes/statements), the response will -be the confirmation. See [below][#wire-format]. - ### Input [`DisputeDistributionMessage`][DisputeDistributionMessage] @@ -114,7 +107,16 @@ struct VotesResponse { } ``` -## Starting a Dispute +## Functionality + +Distributing disputes needs to be a reliable protocol. We would like to make as +sure as possible that our vote got properly delivered to all concerned +validators. For this to work, this subsystem won't be gossip based, but instead +will use a request/response protocol for application level confirmations. The +request will be the payload (the actual votes/statements), the response will +be the confirmation. See [above][#wire-format]. + +### Starting a Dispute A dispute is initiated once a node sends the first `DisputeRequest` wire message, which must contain an "invalid" vote and a "valid" vote. @@ -130,7 +132,7 @@ conflicting votes available, hence we have a valid dispute. Nodes will still need to check whether the disputing votes are somewhat current and not some stale ones. -## Participating in a Dispute +### Participating in a Dispute Upon receiving a `DisputeRequest` message, a dispute distribution will trigger the import of the received votes via the dispute coordinator @@ -142,13 +144,13 @@ except that if the local node deemed the candidate valid, the `SendDispute` message will contain a valid vote signed by our node and will contain the initially received `Invalid` vote. -Note, that we rely on `dispute-coordinator` to check validity of a dispute for spam -protection (see below). +Note, that we rely on the coordinator to check availability for spam protection +(see below). -## Sending of messages +### Sending of messages Starting and participating in a dispute are pretty similar from the perspective -of dispute distribution. Once we receive a `SendDispute` message, we try to make +of dispute distribution. Once we receive a `SendDispute` message we try to make sure to get the data out. We keep track of all the parachain validators that should see the message, which are all the parachain validators of the session where the dispute happened as they will want to participate in the dispute. In @@ -157,185 +159,114 @@ session (which might be the same or not and may change during the dispute). Those authorities will not participate in the dispute, but need to see the statements so they can include them in blocks. -### Reliability - -We only consider a message transmitted, once we received a confirmation message. -If not, we will keep retrying getting that message out as long as the dispute is -deemed alive. To determine whether a dispute is still alive we will ask the -`dispute-coordinator` for a list of all still active disputes via a +We keep track of connected parachain validators and authorities and will issue +warnings in the logs if connected nodes are less than two thirds of the +corresponding sets. We also only consider a message transmitted, once we +received a confirmation message. If not, we will keep retrying getting that +message out as long as the dispute is deemed alive. To determine whether a +dispute is still alive we will issue a `DisputeCoordinatorMessage::ActiveDisputes` message before each retry run. Once a dispute is no longer live, we will clean up the state accordingly. -### Order - -We assume `SendDispute` messages are coming in an order of importance, hence -`dispute-distribution` will make sure to send out network messages in the same -order, even on retry. - -### Rate Limit - -For spam protection (see below), we employ an artificial rate limiting on sending -out messages in order to not hit the rate limit at the receiving side, which -would result in our messages getting dropped and our reputation getting reduced. - -## Reception - -As we shall see the receiving side is mostly about handling spam and ensuring -the dispute-coordinator learns about disputes as fast as possible. - -Goals for the receiving side: - -1. Get new disputes to the dispute-coordinator as fast as possible, so - prioritization can happen properly. -2. Batch votes per disputes as much as possible for good import performance. -3. Prevent malicious nodes exhausting node resources by sending lots of messages. -4. Prevent malicious nodes from sending so many messages/(fake) disputes, - preventing us from concluding good ones. -5. Limit ability of malicious nodes of delaying the vote import due to batching - logic. - -Goal 1 and 2 seem to be conflicting, but an easy compromise is possible: When -learning about a new dispute, we will import the vote immediately, making the -dispute coordinator aware and also getting immediate feedback on the validity. -Then if valid we can batch further incoming votes, with less time constraints as -the dispute-coordinator already knows about the dispute. - -Goal 3 and 4 are obviously very related and both can easily be solved via rate -limiting as we shall see below. Rate limits should already be implemented at the -substrate level, but [are not](https://github.com/paritytech/substrate/issues/7750) -at the time of writing. But even if they were, the enforced substrate limits would -likely not be configurable and thus would still be to high for our needs as we can -rely on the following observations: - -1. Each honest validator will only send one message (apart from duplicates on - timeout) per candidate/dispute. -2. An honest validator needs to fully recover availability and validate the - candidate for casting a vote. - -With these two observations, we can conclude that honest validators will usually -not send messages at a high rate. We can therefore enforce conservative rate -limits and thus minimize harm spamming malicious nodes can have. - -Before we dive into how rate limiting solves all spam issues elegantly, let's -discuss that honest behaviour further: - -What about session changes? Here we might have to inform a new validator set of -lots of already existing disputes at once. - -With observation 1) and a rate limit that is per peer, we are still good: - -Let's assume a rate limit of one message per 200ms per sender. This means 5 -messages from each validator per second. 5 messages means 5 disputes! -Conclusively, we will be able to conclude 5 disputes per second - no matter what -malicious actors are doing. This is assuming dispute messages are sent ordered, -but even if not perfectly ordered: On average it will be 5 disputes per second. - -This is good enough! All those disputes are valid ones and will result in -slashing and disabling of validators. Let's assume all of them conclude `valid`, -and we disable validators only after 100 raised concluding valid disputes, we -would still start disabling misbehaving validators in only 20 seconds. - -One could also think that in addition participation is expected to take longer, -which means on average we can import/conclude disputes faster than they are -generated - regardless of dispute spam. Unfortunately this is not necessarily -true: There might be parachains with very light load where recovery and -validation can be accomplished very quickly - maybe faster than we can import -those disputes. - -This is probably an argument for not imposing a too low rate limit, although the -issue is more general: Even without any rate limit, if an attacker generates -disputes at a very high rate, nodes will be having trouble keeping participation -up, hence the problem should be mitigated at a [more fundamental -layer](https://github.com/paritytech/polkadot/issues/5898). - -For nodes that have been offline for a while, the same argument as for session -changes holds, but matters even less: We assume 2/3 of nodes to be online, so -even if the worst case 1/3 offline happens and they could not import votes fast -enough (as argued above, they in fact can) it would not matter for consensus. - -### Rate Limiting - -As suggested previously, rate limiting allows to mitigate all threats that come -from malicious actors trying to overwhelm the system in order to get away without -a slash, when it comes to dispute-distribution. In this section we will explain -how in greater detail. - -The idea is to open a queue with limited size for each peer. We will process -incoming messages as fast as we can by doing the following: - -1. Check that the sending peer is actually a valid authority - otherwise drop - message and decrease reputation/disconnect. -2. Put message on the peer's queue, if queue is full - drop it. - -Every `RATE_LIMIT` seconds (or rather milliseconds), we pause processing -incoming requests to go a full circle and process one message from each queue. -Processing means `Batching` as explained in the next section. - -### Batching - -To achieve goal 2 we will batch incoming votes/messages together before passing -them on as a single batch to the `dispute-coordinator`. To adhere to goal 1 as -well, we will do the following: - -1. For an incoming message, we check whether we have an existing batch for that - candidate, if not we import directly to the dispute-coordinator, as we have - to assume this is concerning a new dispute. -2. We open a batch and start collecting incoming messages for that candidate, - instead of immediately forwarding. -4. We keep collecting votes in the batch until we receive less than - `MIN_KEEP_BATCH_ALIVE_VOTES` unique votes in the last `BATCH_COLLECTING_INTERVAL`. This is - important to accommodate for goal 5 and also 3. -5. We send the whole batch to the dispute-coordinator. - -This together with rate limiting explained above ensures we will be able to -process valid disputes: We can limit the number of simultaneous existing batches -to some high value, but can be rather certain that this limit will never be -reached - hence we won't drop valid disputes: - -Let's assume `MIN_KEEP_BATCH_ALIVE_VOTES` is 10, `BATCH_COLLECTING_INTERVAL` -is `500ms` and above `RATE_LIMIT` is `100ms`. 1/3 of validators are malicious, -so for 1000 this means around 330 malicious actors worst case. - -All those actors can send a message every `100ms`, that is 10 per second. This -means at the begining of an attack they can open up around 3300 batches. Each -containing two votes. So memory usage is still negligible. In reality it is even -less, as we also demand 10 new votes to trickle in per batch in order to keep it -alive, every `500ms`. Hence for the first second, each batch requires 20 votes -each. Each message is 2 votes, so this means 10 messages per batch. Hence to -keep those batches alive 10 attackers are needed for each batch. This reduces -the number of opened batches by a factor of 10: So we only have 330 batches in 1 -second - each containing 20 votes. - -The next second: In order to further grow memory usage, attackers have to -maintain 10 messages per batch and second. Number of batches equals the number -of attackers, each has 10 messages per second, all are needed to maintain the -batches in memory. Therefore we have a hard cap of around 330 (number of -malicious nodes) open batches. Each can be filled with number of malicious -actor's votes. So 330 batches with each 330 votes: Let's assume approximately 100 -bytes per signature/vote. This results in a worst case memory usage of 330 * 330 -* 100 ~= 10 MiB. - -For 10_000 validators, we are already in the Gigabyte range, which means that -with a validator set that large we might want to be more strict with the rate limit or -require a larger rate of incoming votes per batch to keep them alive. - -For a thousand validators a limit on batches of around 1000 should never be -reached in practice. Hence due to rate limiting we have a very good chance to -not ever having to drop a potential valid dispute due to some resource limit. - -Further safe guards are possible: The dispute-coordinator actually -confirms/denies imports. So once we receive a denial by the dispute-coordinator -for the initial imported votes, we can opt into flushing the batch immediately -and importing the votes. This swaps memory usage for more CPU usage, but if that -import is deemed invalid again we can immediately decrease the reputation of the -sending peers, so this should be a net win. For the time being we punt on this -for simplicity. - -Instead of filling batches to maximize memory usage, attackers could also try to -overwhelm the dispute coordinator by only sending votes for new candidates all -the time. This attack vector is mitigated also by above rate limit and -decreasing the peer's reputation on denial of the invalid imports by the -coordinator. +### Reception & Spam Considerations + +Because we are not forwarding foreign statements, spam is less of an issue in +comparison to gossip based systems. Rate limiting should be implemented at the +substrate level, see +[#7750](https://github.com/paritytech/substrate/issues/7750). Still we should +make sure that it is not possible via spamming to prevent a dispute concluding +or worse from getting noticed. + +Considered attack vectors: + +1. Invalid disputes (candidate does not exist) could make us + run out of resources. E.g. if we recorded every statement, we could run out + of disk space eventually. +2. An attacker can just flood us with notifications on any notification + protocol, assuming flood protection is not effective enough, our unbounded + buffers can fill up and we will run out of memory eventually. +3. An attacker could participate in a valid dispute, but send its votes multiple + times. +4. Attackers could spam us at a high rate with invalid disputes. Our incoming + queue of requests could get monopolized by those malicious requests and we + won't be able to import any valid disputes and we could run out of resources, + if we tried to process them all in parallel. + +For tackling 1, we make sure to not occupy resources before we don't know a +candidate is available. So we will not record statements to disk until we +recovered availability for the candidate or know by some other means that the +dispute is legit. + +For 2, we will pick up on any dispute on restart, so assuming that any realistic +memory filling attack will take some time, we should be able to participate in a +dispute under such attacks. + +Importing/discarding redundant votes should be pretty quick, so measures with +regards to 4 should suffice to prevent 3, from doing any real harm. + +For 4, full monopolization of the incoming queue should not be possible assuming +substrate handles incoming requests in a somewhat fair way. Still we want some +defense mechanisms, at the very least we need to make sure to not exhaust +resources. + +The dispute coordinator will notify us on import about unavailable candidates or +otherwise invalid imports and we can disconnect from such peers/decrease their +reputation drastically. This alone should get us quite far with regards to queue +monopolization, as availability recovery is expected to fail relatively quickly +for unavailable data. + +Still if those spam messages come at a very high rate, we might still run out of +resources if we immediately call `DisputeCoordinatorMessage::ImportStatements` +on each one of them. Secondly with our assumption of 1/3 dishonest validators, +getting rid of all of them will take some time, depending on reputation timeouts +some of them might even be able to reconnect eventually. + +To mitigate those issues we will process dispute messages with a maximum +parallelism `N`. We initiate import processes for up to `N` candidates in +parallel. Once we reached `N` parallel requests we will start back pressuring on +the incoming requests. This saves us from resource exhaustion. + +To reduce impact of malicious nodes further, we can keep track from which nodes the +currently importing statements came from and will drop requests from nodes that +already have imports in flight. + +Honest nodes are not expected to send dispute statements at a high rate, but +even if they did: + +- we will import at least the first one and if it is valid it will trigger a + dispute, preventing finality. +- Chances are good that the first sent candidate from a peer is indeed the + oldest one (if they differ in age at all). +- for the dropped request any honest node will retry sending. +- there will be other nodes notifying us about that dispute as well. +- honest votes have a speed advantage on average. Apart from the very first + dispute statement for a candidate, which might cause the availability recovery + process, imports of honest votes will be super fast, while for spam imports + they will always take some time as we have to wait for availability to fail. + +So this general rate limit, that we drop requests from same peers if they come +faster than we can import the statements should not cause any problems for +honest nodes and is in their favor. + +Size of `N`: The larger `N` the better we can handle distributed flood attacks +(see previous paragraph), but we also get potentially more availability recovery +processes happening at the same time, which slows down the individual processes. +And we rather want to have one finish quickly than lots slowly at the same time. +On the other hand, valid disputes are expected to be rare, so if we ever exhaust +`N` it is very likely that this is caused by spam and spam recoveries don't cost +too much bandwidth due to empty responses. + +Considering that an attacker would need to attack many nodes in parallel to have +any effect, an `N` of 10 seems to be a good compromise. For honest requests, most +of those imports will likely concern the same candidate, and for dishonest ones +we get to disconnect from up to ten colluding adversaries at a time. + +For the size of the channel for incoming requests: Due to dropping of repeated +requests from same nodes we can make the channel relatively large without fear +of lots of spam requests sitting there wasting our time, even after we already +blocked a peer. For valid disputes, incoming requests can become bursty. On the +other hand we will also be very quick in processing them. A channel size of 100 +requests seems plenty and should be able to handle bursts adequately. ### Node Startup diff --git a/runtime/common/src/claims.rs b/runtime/common/src/claims.rs index bb0663ec34f7..cded9b289a4f 100644 --- a/runtime/common/src/claims.rs +++ b/runtime/common/src/claims.rs @@ -717,7 +717,7 @@ mod tests { assert_err, assert_noop, assert_ok, dispatch::{DispatchError::BadOrigin, GetDispatchInfo, Pays}, ord_parameter_types, parameter_types, - traits::{ExistenceRequirement, GenesisBuild, WithdrawReasons}, + traits::{ExistenceRequirement, GenesisBuild}, }; use pallet_balances; use sp_runtime::{ @@ -790,8 +790,6 @@ mod tests { parameter_types! { pub const MinVestedTransfer: u64 = 1; - pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = - WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Test { @@ -800,7 +798,6 @@ mod tests { type BlockNumberToBalance = Identity; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = (); - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index ac5fc69a28e4..936feedde1c3 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -52,7 +52,6 @@ pub use pallet_balances::Call as BalancesCall; pub use pallet_staking::StakerStatus; pub use pallet_timestamp::Call as TimestampCall; use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; -pub use sp_runtime::traits::Bounded; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -88,8 +87,6 @@ parameter_types! { /// that combined with `AdjustmentVariable`, we can recover from the minimum. /// See `multiplier_can_grow_from_zero`. pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 10u128); - /// The maximum amount of the multiplier. - pub MaximumMultiplier: Multiplier = Bounded::max_value(); /// Maximum length of block. Up to 5MB. pub BlockLength: limits::BlockLength = limits::BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); @@ -97,13 +94,8 @@ parameter_types! { /// Parameterized slow adjusting fee updated based on /// https://research.web3.foundation/en/latest/polkadot/overview/2-token-economics.html#-2.-slow-adjusting-mechanism -pub type SlowAdjustingFeeUpdate = TargetedFeeAdjustment< - R, - TargetBlockFullness, - AdjustmentVariable, - MinimumMultiplier, - MaximumMultiplier, ->; +pub type SlowAdjustingFeeUpdate = + TargetedFeeAdjustment; /// Implements the weight types for a runtime. /// It expects the passed runtime constants to contain a `weights` module. diff --git a/runtime/common/src/purchase.rs b/runtime/common/src/purchase.rs index 52ad22bec2fb..8c0fcebd5c12 100644 --- a/runtime/common/src/purchase.rs +++ b/runtime/common/src/purchase.rs @@ -474,10 +474,8 @@ mod tests { // or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use crate::purchase; use frame_support::{ - assert_noop, assert_ok, - dispatch::DispatchError::BadOrigin, - ord_parameter_types, parameter_types, - traits::{Currency, WithdrawReasons}, + assert_noop, assert_ok, dispatch::DispatchError::BadOrigin, ord_parameter_types, + parameter_types, traits::Currency, }; use pallet_balances::Error as BalancesError; use sp_runtime::{ @@ -552,8 +550,6 @@ mod tests { parameter_types! { pub const MinVestedTransfer: u64 = 1; - pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = - WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Test { @@ -562,7 +558,6 @@ mod tests { type BlockNumberToBalance = Identity; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = (); - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } diff --git a/runtime/kusama/src/governance/fellowship.rs b/runtime/kusama/src/governance/fellowship.rs index 52ab8d0bebc8..66e2f6ee6d58 100644 --- a/runtime/kusama/src/governance/fellowship.rs +++ b/runtime/kusama/src/governance/fellowship.rs @@ -314,7 +314,6 @@ impl pallet_referenda::Config for Runtime { type UndecidingTimeout = UndecidingTimeout; type AlarmInterval = AlarmInterval; type Tracks = TracksInfo; - type Preimages = Preimage; } pub type FellowshipCollectiveInstance = pallet_ranked_collective::Instance1; diff --git a/runtime/kusama/src/governance/mod.rs b/runtime/kusama/src/governance/mod.rs index 87cbfd7eea2f..4dbf375f67f0 100644 --- a/runtime/kusama/src/governance/mod.rs +++ b/runtime/kusama/src/governance/mod.rs @@ -91,5 +91,4 @@ impl pallet_referenda::Config for Runtime { type UndecidingTimeout = UndecidingTimeout; type AlarmInterval = AlarmInterval; type Tracks = TracksInfo; - type Preimages = Preimage; } diff --git a/runtime/kusama/src/governance/old.rs b/runtime/kusama/src/governance/old.rs index 9365c903198a..c16ca5eddd7a 100644 --- a/runtime/kusama/src/governance/old.rs +++ b/runtime/kusama/src/governance/old.rs @@ -32,6 +32,7 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { + type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; @@ -73,15 +74,14 @@ impl pallet_democracy::Config for Runtime { // only do it once and it lasts only for the cooloff period. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; + type PreimageByteDeposit = PreimageByteDeposit; + type OperationalPreimageOrigin = pallet_collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; type WeightInfo = weights::pallet_democracy::WeightInfo; type MaxProposals = MaxProposals; - type Preimages = Preimage; - type MaxDeposits = ConstU32<100>; - type MaxBlacklisted = ConstU32<100>; } parameter_types! { diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index 58a824ae1cc2..48762d5e67ec 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -52,7 +52,7 @@ use frame_support::{ construct_runtime, parameter_types, traits::{ ConstU32, Contains, EitherOf, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, - LockIdentifier, PrivilegeCmp, WithdrawReasons, + LockIdentifier, PrivilegeCmp, }, weights::ConstantMultiplier, PalletId, RuntimeDebug, @@ -225,10 +225,12 @@ impl pallet_scheduler::Config for Runtime { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = OriginPrivilegeCmp; - type Preimages = Preimage; + type PreimageProvider = Preimage; + type NoPreimagePostponement = NoPreimagePostponement; } parameter_types! { + pub const PreimageMaxSize: u32 = 4096 * 1024; pub const PreimageBaseDeposit: Balance = deposit(2, 64); pub const PreimageByteDeposit: Balance = deposit(0, 1); } @@ -237,7 +239,8 @@ impl pallet_preimage::Config for Runtime { type WeightInfo = weights::pallet_preimage::WeightInfo; type RuntimeEvent = RuntimeEvent; type Currency = Balances; - type ManagerOrigin = EnsureRoot; + type ManagerOrigin = EnsureRoot; // This might be too strong a requirenent? + type MaxSize = PreimageMaxSize; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } @@ -931,8 +934,6 @@ impl pallet_society::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = 100 * CENTS; - pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = - WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -941,7 +942,6 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } @@ -1471,13 +1471,6 @@ pub type Executive = frame_executive::Executive< StakingMigrationV11OldPallet, >, pallet_staking::migrations::v12::MigrateToV12, - // "Bound uses of call" - pallet_preimage::migration::v1::Migration, - pallet_scheduler::migration::v3::MigrateToV4, - pallet_democracy::migrations::v1::Migration, - pallet_multisig::migrations::v1::MigrateToV1, - // "Properly migrate weights to v2" - parachains_configuration::migration::v3::MigrateToV3, ), >; /// The payload being signed in the transactions. diff --git a/runtime/kusama/src/weights/pallet_democracy.rs b/runtime/kusama/src/weights/pallet_democracy.rs index b9b4127c597e..76862dca3974 100644 --- a/runtime/kusama/src/weights/pallet_democracy.rs +++ b/runtime/kusama/src/weights/pallet_democracy.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_democracy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 // Executed Command: @@ -32,13 +32,13 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/kusama/src/weights +// --output=./runtime/kusama/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight}}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_democracy`. @@ -49,103 +49,134 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(42_340_000 as u64) + Weight::from_ref_time(39_849_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy DepositOf (r:1 w:1) - fn second() -> Weight { - Weight::from_ref_time(38_557_000 as u64) + /// The range of component `s` is `[0, 100]`. + fn second(s: u32, ) -> Weight { + Weight::from_ref_time(31_560_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(81_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_new() -> Weight { - Weight::from_ref_time(48_480_000 as u64) + /// The range of component `r` is `[1, 99]`. + fn vote_new(r: u32, ) -> Weight { + Weight::from_ref_time(43_461_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(91_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_existing() -> Weight { - Weight::from_ref_time(48_553_000 as u64) + /// The range of component `r` is `[1, 99]`. + fn vote_existing(r: u32, ) -> Weight { + Weight::from_ref_time(43_754_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(88_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(20_602_000 as u64) + Weight::from_ref_time(21_199_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) - // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:1 w:1) // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Blacklist (r:0 w:1) - fn blacklist() -> Weight { - Weight::from_ref_time(75_265_000 as u64) + // Storage: Democracy DepositOf (r:1 w:1) + // Storage: System Account (r:1 w:1) + /// The range of component `p` is `[1, 100]`. + fn blacklist(p: u32, ) -> Weight { + Weight::from_ref_time(55_593_000 as u64) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(161_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) - fn external_propose() -> Weight { - Weight::from_ref_time(15_498_000 as u64) + /// The range of component `v` is `[1, 100]`. + fn external_propose(v: u32, ) -> Weight { + Weight::from_ref_time(14_747_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(13_000 as u64).saturating_mul(v as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(4_503_000 as u64) + Weight::from_ref_time(4_471_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(4_486_000 as u64) + Weight::from_ref_time(4_230_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(19_676_000 as u64) + Weight::from_ref_time(20_311_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) - fn veto_external() -> Weight { - Weight::from_ref_time(25_443_000 as u64) + /// The range of component `v` is `[0, 100]`. + fn veto_external(v: u32, ) -> Weight { + Weight::from_ref_time(22_052_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(26_000 as u64).saturating_mul(v as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:1 w:1) - fn cancel_proposal() -> Weight { - Weight::from_ref_time(63_468_000 as u64) + /// The range of component `p` is `[1, 100]`. + fn cancel_proposal(p: u32, ) -> Weight { + Weight::from_ref_time(46_926_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(130_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(13_030_000 as u64) + Weight::from_ref_time(13_121_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } + // Storage: Scheduler Lookup (r:1 w:1) + // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `r` is `[1, 99]`. + fn cancel_queued(r: u32, ) -> Weight { + Weight::from_ref_time(27_805_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(1_112_000 as u64).saturating_mul(r as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:2 w:0) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:0) + /// The range of component `r` is `[1, 99]`. fn on_initialize_base(r: u32, ) -> Weight { - Weight::from_ref_time(5_941_000 as u64) - // Standard Error: 2_263 - .saturating_add(Weight::from_ref_time(2_136_731 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(9_815_000 as u64) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(1_996_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) @@ -155,36 +186,36 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy LastTabledWasExternal (r:1 w:0) // Storage: Democracy NextExternal (r:1 w:0) // Storage: Democracy PublicProps (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:2 w:0) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:0) + /// The range of component `r` is `[1, 99]`. fn on_initialize_base_with_launch_period(r: u32, ) -> Weight { - Weight::from_ref_time(8_085_000 as u64) - // Standard Error: 2_202 - .saturating_add(Weight::from_ref_time(2_143_624 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(12_343_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(2_001_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:3 w:3) + // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - // Storage: Democracy ReferendumInfoOf (r:2 w:2) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn delegate(r: u32, ) -> Weight { - Weight::from_ref_time(40_416_000 as u64) - // Standard Error: 4_125 - .saturating_add(Weight::from_ref_time(3_038_258 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(47_307_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(2_899_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(4 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(4 as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) } // Storage: Democracy VotingOf (r:2 w:2) - // Storage: Democracy ReferendumInfoOf (r:2 w:2) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:1) + /// The range of component `r` is `[1, 99]`. fn undelegate(r: u32, ) -> Weight { - Weight::from_ref_time(24_459_000 as u64) - // Standard Error: 2_860 - .saturating_add(Weight::from_ref_time(2_984_453 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(27_872_000 as u64) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(2_861_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) @@ -192,48 +223,76 @@ impl pallet_democracy::WeightInfo for WeightInfo { } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(5_200_000 as u64) + Weight::from_ref_time(5_014_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } + // Storage: Democracy Preimages (r:1 w:1) + /// The range of component `b` is `[0, 16384]`. + fn note_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(29_213_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Democracy Preimages (r:1 w:1) + /// The range of component `b` is `[0, 16384]`. + fn note_imminent_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(21_778_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Democracy Preimages (r:1 w:1) + // Storage: System Account (r:1 w:1) + /// The range of component `b` is `[0, 16384]`. + fn reap_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(36_642_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn unlock_remove(r: u32, ) -> Weight { - Weight::from_ref_time(24_289_000 as u64) - // Standard Error: 2_579 - .saturating_add(Weight::from_ref_time(125_300 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(31_776_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(37_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn unlock_set(r: u32, ) -> Weight { - Weight::from_ref_time(28_331_000 as u64) - // Standard Error: 755 - .saturating_add(Weight::from_ref_time(90_997 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(31_414_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(77_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 100]`. + /// The range of component `r` is `[1, 99]`. fn remove_vote(r: u32, ) -> Weight { - Weight::from_ref_time(15_350_000 as u64) - // Standard Error: 1_015 - .saturating_add(Weight::from_ref_time(104_402 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(18_428_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(84_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 100]`. + /// The range of component `r` is `[1, 99]`. fn remove_other_vote(r: u32, ) -> Weight { - Weight::from_ref_time(15_433_000 as u64) - // Standard Error: 980 - .saturating_add(Weight::from_ref_time(104_660 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(18_684_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(77_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/kusama/src/weights/pallet_preimage.rs b/runtime/kusama/src/weights/pallet_preimage.rs index 2fc3687f4581..782deda50e27 100644 --- a/runtime/kusama/src/weights/pallet_preimage.rs +++ b/runtime/kusama/src/weights/pallet_preimage.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 // Executed Command: @@ -32,102 +32,103 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/kusama/src/weights +// --output=./runtime/kusama/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight}}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_preimage`. pub struct WeightInfo(PhantomData); impl pallet_preimage::WeightInfo for WeightInfo { + // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(27_993_000 as u64) - // Standard Error: 5 - .saturating_add(Weight::from_ref_time(2_208 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + Weight::from_ref_time(0 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:0) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(19_503_000 as u64) - // Standard Error: 5 - .saturating_add(Weight::from_ref_time(2_264 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + Weight::from_ref_time(0 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:0) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(17_878_000 as u64) - // Standard Error: 2 - .saturating_add(Weight::from_ref_time(2_130 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + Weight::from_ref_time(0 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(40_091_000 as u64) + Weight::from_ref_time(37_471_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(27_459_000 as u64) + Weight::from_ref_time(26_305_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(27_176_000 as u64) + Weight::from_ref_time(35_418_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(14_096_000 as u64) + Weight::from_ref_time(23_113_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(17_365_000 as u64) + Weight::from_ref_time(17_429_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(8_013_000 as u64) + Weight::from_ref_time(8_153_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(27_185_000 as u64) + Weight::from_ref_time(25_132_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(7_955_000 as u64) + Weight::from_ref_time(17_918_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(7_819_000 as u64) + Weight::from_ref_time(8_173_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/kusama/src/weights/pallet_scheduler.rs b/runtime/kusama/src/weights/pallet_scheduler.rs index c6df2801dd69..f291bcd2c490 100644 --- a/runtime/kusama/src/weights/pallet_scheduler.rs +++ b/runtime/kusama/src/weights/pallet_scheduler.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 // Executed Command: @@ -32,66 +32,145 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/kusama/src/weights +// --output=./runtime/kusama/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight}}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler IncompleteSince (r:1 w:1) - fn service_agendas_base() -> Weight { - Weight::from_ref_time(4_558_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(11_217_000 as u64) + // Standard Error: 43_000 + .saturating_add(Weight::from_ref_time(19_456_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. - fn service_agenda_base(s: u32, ) -> Weight { - Weight::from_ref_time(3_715_000 as u64) - // Standard Error: 2_737 - .saturating_add(Weight::from_ref_time(624_353 as u64).saturating_mul(s as u64)) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(15_840_000 as u64) + // Standard Error: 23_000 + .saturating_add(Weight::from_ref_time(15_699_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - fn service_task_base() -> Weight { - Weight::from_ref_time(9_345_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(10_761_000 as u64) + // Standard Error: 28_000 + .saturating_add(Weight::from_ref_time(17_063_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } + // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[128, 4194304]`. - fn service_task_fetched(s: u32, ) -> Weight { - Weight::from_ref_time(20_078_000 as u64) - // Standard Error: 5 - .saturating_add(Weight::from_ref_time(1_153 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(12_801_000 as u64) + // Standard Error: 27_000 + .saturating_add(Weight::from_ref_time(14_878_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) + } + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:0) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named_aborted(s: u32, ) -> Weight { + Weight::from_ref_time(10_462_000 as u64) + // Standard Error: 8_000 + .saturating_add(Weight::from_ref_time(5_706_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:0) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_aborted(s: u32, ) -> Weight { + Weight::from_ref_time(9_952_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(3_762_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - fn service_task_named() -> Weight { - Weight::from_ref_time(10_744_000 as u64) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_named(s: u32, ) -> Weight { + Weight::from_ref_time(14_502_000 as u64) + // Standard Error: 14_000 + .saturating_add(Weight::from_ref_time(10_550_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } - fn service_task_periodic() -> Weight { - Weight::from_ref_time(9_556_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic(s: u32, ) -> Weight { + Weight::from_ref_time(14_956_000 as u64) + // Standard Error: 12_000 + .saturating_add(Weight::from_ref_time(8_343_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - fn execute_dispatch_signed() -> Weight { - Weight::from_ref_time(4_130_000 as u64) + // Storage: Scheduler Agenda (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named(s: u32, ) -> Weight { + Weight::from_ref_time(13_862_000 as u64) + // Standard Error: 10_000 + .saturating_add(Weight::from_ref_time(7_398_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - fn execute_dispatch_unsigned() -> Weight { - Weight::from_ref_time(4_058_000 as u64) + // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize(s: u32, ) -> Weight { + Weight::from_ref_time(14_529_000 as u64) + // Standard Error: 10_000 + .saturating_add(Weight::from_ref_time(6_467_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 49]`. + /// The range of component `s` is `[0, 50]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(16_721_000 as u64) - // Standard Error: 3_319 - .saturating_add(Weight::from_ref_time(657_802 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_944_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(69_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -99,19 +178,19 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Lookup (r:0 w:1) /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(19_496_000 as u64) - // Standard Error: 1_368 - .saturating_add(Weight::from_ref_time(572_226 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(20_087_000 as u64) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(1_214_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 49]`. + /// The range of component `s` is `[0, 50]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(19_831_000 as u64) - // Standard Error: 3_559 - .saturating_add(Weight::from_ref_time(689_493 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(23_553_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(118_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -119,9 +198,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Agenda (r:1 w:1) /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(20_788_000 as u64) - // Standard Error: 1_758 - .saturating_add(Weight::from_ref_time(605_808 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(22_403_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(1_255_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/parachains/src/configuration.rs b/runtime/parachains/src/configuration.rs index 2ebaff1b8282..bc97e84e95b5 100644 --- a/runtime/parachains/src/configuration.rs +++ b/runtime/parachains/src/configuration.rs @@ -285,8 +285,7 @@ impl> Default for HostConfiguration /// v1-v2: -/// v2-v3: -pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(3); - -pub mod v3 { - use super::*; - use frame_support::traits::OnRuntimeUpgrade; - use primitives::v2::{Balance, SessionIndex}; - - // Copied over from configuration.rs @ de9e147695b9f1be8bd44e07861a31e483c8343a and removed - // all the comments, and changed the Weight struct to OldWeight - #[derive(parity_scale_codec::Encode, parity_scale_codec::Decode, Debug)] - pub struct OldHostConfiguration { - pub max_code_size: u32, - pub max_head_data_size: u32, - pub max_upward_queue_count: u32, - pub max_upward_queue_size: u32, - pub max_upward_message_size: u32, - pub max_upward_message_num_per_candidate: u32, - pub hrmp_max_message_num_per_candidate: u32, - pub validation_upgrade_cooldown: BlockNumber, - pub validation_upgrade_delay: BlockNumber, - pub max_pov_size: u32, - pub max_downward_message_size: u32, - pub ump_service_total_weight: OldWeight, - pub hrmp_max_parachain_outbound_channels: u32, - pub hrmp_max_parathread_outbound_channels: u32, - pub hrmp_sender_deposit: Balance, - pub hrmp_recipient_deposit: Balance, - pub hrmp_channel_max_capacity: u32, - pub hrmp_channel_max_total_size: u32, - pub hrmp_max_parachain_inbound_channels: u32, - pub hrmp_max_parathread_inbound_channels: u32, - pub hrmp_channel_max_message_size: u32, - pub code_retention_period: BlockNumber, - pub parathread_cores: u32, - pub parathread_retries: u32, - pub group_rotation_frequency: BlockNumber, - pub chain_availability_period: BlockNumber, - pub thread_availability_period: BlockNumber, - pub scheduling_lookahead: u32, - pub max_validators_per_core: Option, - pub max_validators: Option, - pub dispute_period: SessionIndex, - pub dispute_post_conclusion_acceptance_period: BlockNumber, - pub dispute_max_spam_slots: u32, - pub dispute_conclusion_by_time_out_period: BlockNumber, - pub no_show_slots: u32, - pub n_delay_tranches: u32, - pub zeroth_delay_tranche_width: u32, - pub needed_approvals: u32, - pub relay_vrf_modulo_samples: u32, - pub ump_max_individual_weight: OldWeight, - pub pvf_checking_enabled: bool, - pub pvf_voting_ttl: SessionIndex, - pub minimum_validation_upgrade_delay: BlockNumber, - } - - impl> Default for OldHostConfiguration { - fn default() -> Self { - Self { - group_rotation_frequency: 1u32.into(), - chain_availability_period: 1u32.into(), - thread_availability_period: 1u32.into(), - no_show_slots: 1u32.into(), - validation_upgrade_cooldown: Default::default(), - validation_upgrade_delay: Default::default(), - code_retention_period: Default::default(), - max_code_size: Default::default(), - max_pov_size: Default::default(), - max_head_data_size: Default::default(), - parathread_cores: Default::default(), - parathread_retries: Default::default(), - scheduling_lookahead: Default::default(), - max_validators_per_core: Default::default(), - max_validators: None, - dispute_period: 6, - dispute_post_conclusion_acceptance_period: 100.into(), - dispute_max_spam_slots: 2, - dispute_conclusion_by_time_out_period: 200.into(), - n_delay_tranches: Default::default(), - zeroth_delay_tranche_width: Default::default(), - needed_approvals: Default::default(), - relay_vrf_modulo_samples: Default::default(), - max_upward_queue_count: Default::default(), - max_upward_queue_size: Default::default(), - max_downward_message_size: Default::default(), - ump_service_total_weight: OldWeight(Default::default()), - max_upward_message_size: Default::default(), - max_upward_message_num_per_candidate: Default::default(), - hrmp_sender_deposit: Default::default(), - hrmp_recipient_deposit: Default::default(), - hrmp_channel_max_capacity: Default::default(), - hrmp_channel_max_total_size: Default::default(), - hrmp_max_parachain_inbound_channels: Default::default(), - hrmp_max_parathread_inbound_channels: Default::default(), - hrmp_channel_max_message_size: Default::default(), - hrmp_max_parachain_outbound_channels: Default::default(), - hrmp_max_parathread_outbound_channels: Default::default(), - hrmp_max_message_num_per_candidate: Default::default(), - ump_max_individual_weight: OldWeight( - frame_support::weights::constants::WEIGHT_PER_MILLIS.ref_time() * 20, - ), - pvf_checking_enabled: false, - pvf_voting_ttl: 2u32.into(), - minimum_validation_upgrade_delay: 2.into(), - } - } - } - - pub struct MigrateToV3(sp_std::marker::PhantomData); - impl OnRuntimeUpgrade for MigrateToV3 { - fn on_runtime_upgrade() -> Weight { - if StorageVersion::get::>() == 2 { - let weight_consumed = migrate_to_v3::(); - - log::info!(target: configuration::LOG_TARGET, "MigrateToV3 executed successfully"); - STORAGE_VERSION.put::>(); - - weight_consumed - } else { - log::warn!(target: configuration::LOG_TARGET, "MigrateToV3 should be removed."); - T::DbWeight::get().reads(1) - } - } - } -} - -fn migrate_to_v3() -> Weight { - // Unusual formatting is justified: - // - make it easier to verify that fields assign what they supposed to assign. - // - this code is transient and will be removed after all migrations are done. - // - this code is important enough to optimize for legibility sacrificing consistency. - #[rustfmt::skip] - let translate = - |pre: v3::OldHostConfiguration>| -> -configuration::HostConfiguration> - { - super::HostConfiguration { -max_code_size : pre.max_code_size, -max_head_data_size : pre.max_head_data_size, -max_upward_queue_count : pre.max_upward_queue_count, -max_upward_queue_size : pre.max_upward_queue_size, -max_upward_message_size : pre.max_upward_message_size, -max_upward_message_num_per_candidate : pre.max_upward_message_num_per_candidate, -hrmp_max_message_num_per_candidate : pre.hrmp_max_message_num_per_candidate, -validation_upgrade_cooldown : pre.validation_upgrade_cooldown, -validation_upgrade_delay : pre.validation_upgrade_delay, -max_pov_size : pre.max_pov_size, -max_downward_message_size : pre.max_downward_message_size, -hrmp_max_parachain_outbound_channels : pre.hrmp_max_parachain_outbound_channels, -hrmp_max_parathread_outbound_channels : pre.hrmp_max_parathread_outbound_channels, -hrmp_sender_deposit : pre.hrmp_sender_deposit, -hrmp_recipient_deposit : pre.hrmp_recipient_deposit, -hrmp_channel_max_capacity : pre.hrmp_channel_max_capacity, -hrmp_channel_max_total_size : pre.hrmp_channel_max_total_size, -hrmp_max_parachain_inbound_channels : pre.hrmp_max_parachain_inbound_channels, -hrmp_max_parathread_inbound_channels : pre.hrmp_max_parathread_inbound_channels, -hrmp_channel_max_message_size : pre.hrmp_channel_max_message_size, -code_retention_period : pre.code_retention_period, -parathread_cores : pre.parathread_cores, -parathread_retries : pre.parathread_retries, -group_rotation_frequency : pre.group_rotation_frequency, -chain_availability_period : pre.chain_availability_period, -thread_availability_period : pre.thread_availability_period, -scheduling_lookahead : pre.scheduling_lookahead, -max_validators_per_core : pre.max_validators_per_core, -max_validators : pre.max_validators, -dispute_period : pre.dispute_period, -dispute_post_conclusion_acceptance_period: pre.dispute_post_conclusion_acceptance_period, -dispute_max_spam_slots : pre.dispute_max_spam_slots, -dispute_conclusion_by_time_out_period : pre.dispute_conclusion_by_time_out_period, -no_show_slots : pre.no_show_slots, -n_delay_tranches : pre.n_delay_tranches, -zeroth_delay_tranche_width : pre.zeroth_delay_tranche_width, -needed_approvals : pre.needed_approvals, -relay_vrf_modulo_samples : pre.relay_vrf_modulo_samples, -pvf_checking_enabled : pre.pvf_checking_enabled, -pvf_voting_ttl : pre.pvf_voting_ttl, -minimum_validation_upgrade_delay : pre.minimum_validation_upgrade_delay, - -ump_service_total_weight: Weight::from_ref_time(pre.ump_service_total_weight.0).set_proof_size(MAX_POV_SIZE as u64), -ump_max_individual_weight: Weight::from_ref_time(pre.ump_max_individual_weight.0).set_proof_size(MAX_POV_SIZE as u64), - } - }; - - if let Err(_) = as Store>::ActiveConfig::translate(|pre| pre.map(translate)) { - // `Err` is returned when the pre-migration type cannot be deserialized. This - // cannot happen if the migration runs correctly, i.e. against the expected version. - // - // This happening almost surely will lead to a panic somewhere else. Corruption seems - // to be unlikely to be caused by this. So we just log. Maybe it'll work out still? - log::error!( - target: configuration::LOG_TARGET, - "unexpected error when performing translation of the configuration type during storage upgrade to v2." - ); - } - - T::DbWeight::get().reads_writes(1, 1) -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::mock::{new_test_ext, Test}; - - #[test] - fn v2_deserialized_from_actual_data() { - // Fetched at Kusama 14,703,780 (0x3b2c305d01bd4adf1973d32a2d55ca1260a55eea8dfb3168e317c57f2841fdf1) - // - // This exceeds the maximal line width length, but that's fine, since this is not code and - // doesn't need to be read and also leaving it as one line allows to easily copy it. - let raw_config = hex_literal::hex!["0000a000005000000a00000000c8000000c800000a0000000a000000100e0000580200000000500000c8000000e87648170000001e00000000000000005039278c0400000000000000000000005039278c0400000000000000000000e8030000009001001e00000000000000009001008070000000000000000000000a0000000a0000000a00000001000000010500000001c8000000060000005802000002000000580200000200000059000000000000001e0000002800000000c817a804000000000200000014000000"]; - - let v2 = - v3::OldHostConfiguration::::decode(&mut &raw_config[..]) - .unwrap(); - - // We check only a sample of the values here. If we missed any fields or messed up data types - // that would skew all the fields coming after. - assert_eq!(v2.max_code_size, 10_485_760); - assert_eq!(v2.validation_upgrade_cooldown, 3600); - assert_eq!(v2.max_pov_size, 5_242_880); - assert_eq!(v2.hrmp_channel_max_message_size, 102_400); - assert_eq!(v2.dispute_max_spam_slots, 2); - assert_eq!(v2.n_delay_tranches, 89); - assert_eq!(v2.ump_max_individual_weight, OldWeight(20_000_000_000)); - assert_eq!(v2.minimum_validation_upgrade_delay, 20); - } - - #[test] - fn test_migrate_to_v3() { - // Host configuration has lots of fields. However, in this migration we add only a couple of - // fields. The most important part to check are a couple of the last fields. We also pick - // extra fields to check arbitrarily, e.g. depending on their position (i.e. the middle) and - // also their type. - // - // We specify only the picked fields and the rest should be provided by the `Default` - // implementation. That implementation is copied over between the two types and should work - // fine. - let v2 = v3::OldHostConfiguration:: { - ump_max_individual_weight: OldWeight(0x71616e6f6e0au64), - needed_approvals: 69, - thread_availability_period: 55, - hrmp_recipient_deposit: 1337, - max_pov_size: 1111, - chain_availability_period: 33, - minimum_validation_upgrade_delay: 20, - ..Default::default() - }; - - new_test_ext(Default::default()).execute_with(|| { - // Implant the v2 version in the state. - frame_support::storage::unhashed::put_raw( - &configuration::ActiveConfig::::hashed_key(), - &v2.encode(), - ); - - migrate_to_v3::(); - - let v3 = configuration::ActiveConfig::::get(); - - #[rustfmt::skip] - { - assert_eq!(v2.max_code_size , v3.max_code_size); - assert_eq!(v2.max_head_data_size , v3.max_head_data_size); - assert_eq!(v2.max_upward_queue_count , v3.max_upward_queue_count); - assert_eq!(v2.max_upward_queue_size , v3.max_upward_queue_size); - assert_eq!(v2.max_upward_message_size , v3.max_upward_message_size); - assert_eq!(v2.max_upward_message_num_per_candidate , v3.max_upward_message_num_per_candidate); - assert_eq!(v2.hrmp_max_message_num_per_candidate , v3.hrmp_max_message_num_per_candidate); - assert_eq!(v2.validation_upgrade_cooldown , v3.validation_upgrade_cooldown); - assert_eq!(v2.validation_upgrade_delay , v3.validation_upgrade_delay); - assert_eq!(v2.max_pov_size , v3.max_pov_size); - assert_eq!(v2.max_downward_message_size , v3.max_downward_message_size); - assert_eq!(v2.hrmp_max_parachain_outbound_channels , v3.hrmp_max_parachain_outbound_channels); - assert_eq!(v2.hrmp_max_parathread_outbound_channels , v3.hrmp_max_parathread_outbound_channels); - assert_eq!(v2.hrmp_sender_deposit , v3.hrmp_sender_deposit); - assert_eq!(v2.hrmp_recipient_deposit , v3.hrmp_recipient_deposit); - assert_eq!(v2.hrmp_channel_max_capacity , v3.hrmp_channel_max_capacity); - assert_eq!(v2.hrmp_channel_max_total_size , v3.hrmp_channel_max_total_size); - assert_eq!(v2.hrmp_max_parachain_inbound_channels , v3.hrmp_max_parachain_inbound_channels); - assert_eq!(v2.hrmp_max_parathread_inbound_channels , v3.hrmp_max_parathread_inbound_channels); - assert_eq!(v2.hrmp_channel_max_message_size , v3.hrmp_channel_max_message_size); - assert_eq!(v2.code_retention_period , v3.code_retention_period); - assert_eq!(v2.parathread_cores , v3.parathread_cores); - assert_eq!(v2.parathread_retries , v3.parathread_retries); - assert_eq!(v2.group_rotation_frequency , v3.group_rotation_frequency); - assert_eq!(v2.chain_availability_period , v3.chain_availability_period); - assert_eq!(v2.thread_availability_period , v3.thread_availability_period); - assert_eq!(v2.scheduling_lookahead , v3.scheduling_lookahead); - assert_eq!(v2.max_validators_per_core , v3.max_validators_per_core); - assert_eq!(v2.max_validators , v3.max_validators); - assert_eq!(v2.dispute_period , v3.dispute_period); - assert_eq!(v2.dispute_post_conclusion_acceptance_period, v3.dispute_post_conclusion_acceptance_period); - assert_eq!(v2.dispute_max_spam_slots , v3.dispute_max_spam_slots); - assert_eq!(v2.dispute_conclusion_by_time_out_period , v3.dispute_conclusion_by_time_out_period); - assert_eq!(v2.no_show_slots , v3.no_show_slots); - assert_eq!(v2.n_delay_tranches , v3.n_delay_tranches); - assert_eq!(v2.zeroth_delay_tranche_width , v3.zeroth_delay_tranche_width); - assert_eq!(v2.needed_approvals , v3.needed_approvals); - assert_eq!(v2.relay_vrf_modulo_samples , v3.relay_vrf_modulo_samples); - assert_eq!(v2.pvf_checking_enabled , v3.pvf_checking_enabled); - assert_eq!(v2.pvf_voting_ttl , v3.pvf_voting_ttl); - assert_eq!(v2.minimum_validation_upgrade_delay , v3.minimum_validation_upgrade_delay); - - assert_eq!(v2.ump_service_total_weight, OldWeight(v3.ump_service_total_weight.ref_time())); - assert_eq!(v2.ump_max_individual_weight, OldWeight(v3.ump_max_individual_weight.ref_time())); - assert_eq!(v3.ump_service_total_weight.proof_size(), MAX_POV_SIZE as u64); - assert_eq!(v3.ump_max_individual_weight.proof_size(), MAX_POV_SIZE as u64); - }; // ; makes this a statement. `rustfmt::skip` cannot be put on an expression. - }); - } -} +pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(2); diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index 8f6f2e4db47d..96a557712a76 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -40,10 +40,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId; use frame_election_provider_support::{generate_solution_type, onchain, SequentialPhragmen}; use frame_support::{ construct_runtime, parameter_types, - traits::{ - ConstU32, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, - PrivilegeCmp, WithdrawReasons, - }, + traits::{EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, PrivilegeCmp}, weights::ConstantMultiplier, PalletId, RuntimeDebug, }; @@ -218,7 +215,8 @@ impl pallet_scheduler::Config for Runtime { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = OriginPrivilegeCmp; - type Preimages = Preimage; + type PreimageProvider = Preimage; + type NoPreimagePostponement = NoPreimagePostponement; } parameter_types! { @@ -232,6 +230,7 @@ impl pallet_preimage::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; + type MaxSize = PreimageMaxSize; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } @@ -616,6 +615,7 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { + type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; @@ -667,15 +667,14 @@ impl pallet_democracy::Config for Runtime { // only do it once and it lasts only for the cooloff period. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; + type PreimageByteDeposit = PreimageByteDeposit; + type OperationalPreimageOrigin = pallet_collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; type WeightInfo = weights::pallet_democracy::WeightInfo; type MaxProposals = MaxProposals; - type Preimages = Preimage; - type MaxDeposits = ConstU32<100>; - type MaxBlacklisted = ConstU32<100>; } parameter_types! { @@ -992,8 +991,6 @@ impl claims::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = 1 * DOLLARS; - pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = - WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -1002,7 +999,6 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } @@ -1564,13 +1560,6 @@ pub type Executive = frame_executive::Executive< StakingMigrationV11OldPallet, >, pallet_staking::migrations::v12::MigrateToV12, - // "Bound uses of call" - pallet_preimage::migration::v1::Migration, - pallet_scheduler::migration::v3::MigrateToV4, - pallet_democracy::migrations::v1::Migration, - pallet_multisig::migrations::v1::MigrateToV1, - // "Properly migrate weights to v2" - parachains_configuration::migration::v3::MigrateToV3, ), >; diff --git a/runtime/polkadot/src/weights/pallet_democracy.rs b/runtime/polkadot/src/weights/pallet_democracy.rs index 136797abcf03..1e94d2b5deb0 100644 --- a/runtime/polkadot/src/weights/pallet_democracy.rs +++ b/runtime/polkadot/src/weights/pallet_democracy.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_democracy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024 // Executed Command: @@ -32,13 +32,13 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/polkadot/src/weights +// --output=./runtime/polkadot/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight}}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_democracy`. @@ -49,103 +49,134 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(42_048_000 as u64) + Weight::from_ref_time(40_082_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy DepositOf (r:1 w:1) - fn second() -> Weight { - Weight::from_ref_time(38_631_000 as u64) + /// The range of component `s` is `[0, 100]`. + fn second(s: u32, ) -> Weight { + Weight::from_ref_time(31_920_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(82_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_new() -> Weight { - Weight::from_ref_time(48_571_000 as u64) + /// The range of component `r` is `[1, 99]`. + fn vote_new(r: u32, ) -> Weight { + Weight::from_ref_time(43_490_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(82_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_existing() -> Weight { - Weight::from_ref_time(48_556_000 as u64) + /// The range of component `r` is `[1, 99]`. + fn vote_existing(r: u32, ) -> Weight { + Weight::from_ref_time(42_957_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(88_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(20_104_000 as u64) + Weight::from_ref_time(20_818_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) - // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:1 w:1) // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Blacklist (r:0 w:1) - fn blacklist() -> Weight { - Weight::from_ref_time(75_289_000 as u64) + // Storage: Democracy DepositOf (r:1 w:1) + // Storage: System Account (r:1 w:1) + /// The range of component `p` is `[1, 100]`. + fn blacklist(p: u32, ) -> Weight { + Weight::from_ref_time(55_285_000 as u64) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(159_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) - fn external_propose() -> Weight { - Weight::from_ref_time(15_734_000 as u64) + /// The range of component `v` is `[1, 100]`. + fn external_propose(v: u32, ) -> Weight { + Weight::from_ref_time(14_271_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(13_000 as u64).saturating_mul(v as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(4_507_000 as u64) + Weight::from_ref_time(4_129_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(4_603_000 as u64) + Weight::from_ref_time(4_215_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(19_816_000 as u64) + Weight::from_ref_time(20_440_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) - fn veto_external() -> Weight { - Weight::from_ref_time(25_722_000 as u64) + /// The range of component `v` is `[0, 100]`. + fn veto_external(v: u32, ) -> Weight { + Weight::from_ref_time(21_988_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(19_000 as u64).saturating_mul(v as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:1 w:1) - fn cancel_proposal() -> Weight { - Weight::from_ref_time(63_768_000 as u64) + /// The range of component `p` is `[1, 100]`. + fn cancel_proposal(p: u32, ) -> Weight { + Weight::from_ref_time(46_176_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(134_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(13_183_000 as u64) + Weight::from_ref_time(12_940_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } + // Storage: Scheduler Lookup (r:1 w:1) + // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `r` is `[1, 99]`. + fn cancel_queued(r: u32, ) -> Weight { + Weight::from_ref_time(27_421_000 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(808_000 as u64).saturating_mul(r as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:2 w:0) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:0) + /// The range of component `r` is `[1, 99]`. fn on_initialize_base(r: u32, ) -> Weight { - Weight::from_ref_time(5_999_000 as u64) - // Standard Error: 2_072 - .saturating_add(Weight::from_ref_time(2_080_681 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(9_602_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(2_017_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) @@ -155,36 +186,36 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy LastTabledWasExternal (r:1 w:0) // Storage: Democracy NextExternal (r:1 w:0) // Storage: Democracy PublicProps (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:2 w:0) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:0) + /// The range of component `r` is `[1, 99]`. fn on_initialize_base_with_launch_period(r: u32, ) -> Weight { - Weight::from_ref_time(8_114_000 as u64) - // Standard Error: 2_286 - .saturating_add(Weight::from_ref_time(2_087_574 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(12_548_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(2_010_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:3 w:3) + // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - // Storage: Democracy ReferendumInfoOf (r:2 w:2) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn delegate(r: u32, ) -> Weight { - Weight::from_ref_time(40_509_000 as u64) - // Standard Error: 3_676 - .saturating_add(Weight::from_ref_time(2_999_395 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(46_940_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(2_877_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(4 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(4 as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) } // Storage: Democracy VotingOf (r:2 w:2) - // Storage: Democracy ReferendumInfoOf (r:2 w:2) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:1) + /// The range of component `r` is `[1, 99]`. fn undelegate(r: u32, ) -> Weight { - Weight::from_ref_time(24_592_000 as u64) - // Standard Error: 2_506 - .saturating_add(Weight::from_ref_time(2_932_469 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(27_418_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(2_872_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) @@ -192,48 +223,76 @@ impl pallet_democracy::WeightInfo for WeightInfo { } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(5_070_000 as u64) + Weight::from_ref_time(4_996_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } + // Storage: Democracy Preimages (r:1 w:1) + /// The range of component `b` is `[0, 16384]`. + fn note_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(28_635_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Democracy Preimages (r:1 w:1) + /// The range of component `b` is `[0, 16384]`. + fn note_imminent_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(21_474_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Democracy Preimages (r:1 w:1) + // Storage: System Account (r:1 w:1) + /// The range of component `b` is `[0, 16384]`. + fn reap_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(36_399_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn unlock_remove(r: u32, ) -> Weight { - Weight::from_ref_time(23_860_000 as u64) - // Standard Error: 2_624 - .saturating_add(Weight::from_ref_time(129_209 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(32_139_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(30_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn unlock_set(r: u32, ) -> Weight { - Weight::from_ref_time(28_512_000 as u64) - // Standard Error: 619 - .saturating_add(Weight::from_ref_time(84_477 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(31_338_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(70_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 100]`. + /// The range of component `r` is `[1, 99]`. fn remove_vote(r: u32, ) -> Weight { - Weight::from_ref_time(15_612_000 as u64) - // Standard Error: 841 - .saturating_add(Weight::from_ref_time(98_567 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(18_298_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(78_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 100]`. + /// The range of component `r` is `[1, 99]`. fn remove_other_vote(r: u32, ) -> Weight { - Weight::from_ref_time(15_282_000 as u64) - // Standard Error: 1_040 - .saturating_add(Weight::from_ref_time(104_928 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(18_456_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(75_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/polkadot/src/weights/pallet_preimage.rs b/runtime/polkadot/src/weights/pallet_preimage.rs index bd316e310277..15606f560519 100644 --- a/runtime/polkadot/src/weights/pallet_preimage.rs +++ b/runtime/polkadot/src/weights/pallet_preimage.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024 // Executed Command: @@ -32,102 +32,103 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/polkadot/src/weights +// --output=./runtime/polkadot/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight}}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_preimage`. pub struct WeightInfo(PhantomData); impl pallet_preimage::WeightInfo for WeightInfo { + // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(28_326_000 as u64) + Weight::from_ref_time(0 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_116 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:0) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(20_011_000 as u64) + Weight::from_ref_time(0 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_114 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:0) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(18_805_000 as u64) - // Standard Error: 1 - .saturating_add(Weight::from_ref_time(2_116 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + Weight::from_ref_time(0 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(39_007_000 as u64) + Weight::from_ref_time(40_028_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(27_523_000 as u64) + Weight::from_ref_time(27_637_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(26_477_000 as u64) + Weight::from_ref_time(37_505_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(13_236_000 as u64) + Weight::from_ref_time(26_628_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(17_975_000 as u64) + Weight::from_ref_time(17_156_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(8_295_000 as u64) + Weight::from_ref_time(8_109_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(26_186_000 as u64) + Weight::from_ref_time(27_209_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(8_176_000 as u64) + Weight::from_ref_time(17_931_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(8_005_000 as u64) + Weight::from_ref_time(7_951_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/polkadot/src/weights/pallet_scheduler.rs b/runtime/polkadot/src/weights/pallet_scheduler.rs index 9446fdc5efec..6103794df8a5 100644 --- a/runtime/polkadot/src/weights/pallet_scheduler.rs +++ b/runtime/polkadot/src/weights/pallet_scheduler.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024 // Executed Command: @@ -32,69 +32,145 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/polkadot/src/weights +// --output=./runtime/polkadot/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight}}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler IncompleteSince (r:1 w:1) - fn service_agendas_base() -> Weight { - Weight::from_ref_time(4_522_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(15_177_000 as u64) + // Standard Error: 21_000 + .saturating_add(Weight::from_ref_time(18_354_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. - fn service_agenda_base(s: u32, ) -> Weight { - Weight::from_ref_time(3_859_000 as u64) - // Standard Error: 2_692 - .saturating_add(Weight::from_ref_time(618_992 as u64).saturating_mul(s as u64)) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(12_632_000 as u64) + // Standard Error: 23_000 + .saturating_add(Weight::from_ref_time(14_845_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - fn service_task_base() -> Weight { - Weight::from_ref_time(12_288_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(13_757_000 as u64) + // Standard Error: 20_000 + .saturating_add(Weight::from_ref_time(15_871_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } + // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[128, 4194304]`. - fn service_task_fetched(s: u32, ) -> Weight { - Weight::from_ref_time(23_105_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_126 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(15_338_000 as u64) + // Standard Error: 16_000 + .saturating_add(Weight::from_ref_time(13_610_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) + } + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:0) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named_aborted(s: u32, ) -> Weight { + Weight::from_ref_time(10_335_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(5_073_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) + } + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:0) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_aborted(s: u32, ) -> Weight { + Weight::from_ref_time(10_095_000 as u64) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(3_021_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) } + // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - fn service_task_named() -> Weight { - Weight::from_ref_time(13_382_000 as u64) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_named(s: u32, ) -> Weight { + Weight::from_ref_time(15_328_000 as u64) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(9_601_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:1 w:1) - fn service_task_periodic() -> Weight { - Weight::from_ref_time(19_246_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic(s: u32, ) -> Weight { + Weight::from_ref_time(18_306_000 as u64) + // Standard Error: 11_000 + .saturating_add(Weight::from_ref_time(7_155_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - fn execute_dispatch_signed() -> Weight { - Weight::from_ref_time(3_714_000 as u64) + // Storage: Scheduler Agenda (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named(s: u32, ) -> Weight { + Weight::from_ref_time(16_079_000 as u64) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(6_321_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - fn execute_dispatch_unsigned() -> Weight { - Weight::from_ref_time(3_667_000 as u64) + // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize(s: u32, ) -> Weight { + Weight::from_ref_time(16_074_000 as u64) + // Standard Error: 8_000 + .saturating_add(Weight::from_ref_time(5_352_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 49]`. + /// The range of component `s` is `[0, 50]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(16_556_000 as u64) - // Standard Error: 3_431 - .saturating_add(Weight::from_ref_time(659_506 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_480_000 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(76_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -102,19 +178,19 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Lookup (r:0 w:1) /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(18_922_000 as u64) - // Standard Error: 1_665 - .saturating_add(Weight::from_ref_time(586_420 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_669_000 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(892_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 49]`. + /// The range of component `s` is `[0, 50]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(19_633_000 as u64) - // Standard Error: 3_740 - .saturating_add(Weight::from_ref_time(692_772 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(24_633_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(81_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -122,9 +198,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Agenda (r:1 w:1) /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(20_220_000 as u64) - // Standard Error: 2_111 - .saturating_add(Weight::from_ref_time(622_452 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(22_707_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(922_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index ac247248b9ea..94677cc07290 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -55,7 +55,7 @@ use frame_support::{ construct_runtime, parameter_types, traits::{ Contains, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, - PrivilegeCmp, WithdrawReasons, + PrivilegeCmp, }, weights::ConstantMultiplier, PalletId, RuntimeDebug, @@ -70,8 +70,8 @@ use sp_mmr_primitives as mmr; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{ - AccountIdLookup, BlakeTwo256, Block as BlockT, ConstU32, ConvertInto, - Extrinsic as ExtrinsicT, Keccak256, OpaqueKeys, SaturatedConversion, Verify, + AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, Extrinsic as ExtrinsicT, + Keccak256, OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, ApplyExtrinsicResult, KeyTypeId, Perbill, Percent, Permill, @@ -216,10 +216,12 @@ impl pallet_scheduler::Config for Runtime { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = OriginPrivilegeCmp; - type Preimages = Preimage; + type PreimageProvider = Preimage; + type NoPreimagePostponement = NoPreimagePostponement; } parameter_types! { + pub const PreimageMaxSize: u32 = 4096 * 1024; pub const PreimageBaseDeposit: Balance = deposit(2, 64); pub const PreimageByteDeposit: Balance = deposit(0, 1); } @@ -229,6 +231,7 @@ impl pallet_preimage::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; + type MaxSize = PreimageMaxSize; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } @@ -396,6 +399,7 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { + type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; @@ -437,15 +441,14 @@ impl pallet_democracy::Config for Runtime { // only do it once and it lasts only for the cooloff period. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; + type PreimageByteDeposit = PreimageByteDeposit; + type OperationalPreimageOrigin = pallet_collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; type WeightInfo = weights::pallet_democracy::WeightInfo; type MaxProposals = MaxProposals; - type Preimages = Preimage; - type MaxDeposits = ConstU32<100>; - type MaxBlacklisted = ConstU32<100>; } parameter_types! { @@ -857,8 +860,6 @@ impl pallet_society::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = 100 * CENTS; - pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = - WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -867,7 +868,6 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } @@ -1257,7 +1257,7 @@ impl BeefyDataProvider for ParasProvider { .filter_map(|id| Paras::para_head(&id).map(|head| (id.into(), head.0))) .collect(); para_heads.sort(); - beefy_merkle_tree::merkle_root::<::Hashing, _>( + beefy_merkle_tree::merkle_root::, _, _>( para_heads.into_iter().map(|pair| pair.encode()), ) .into() @@ -1453,15 +1453,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - ( - // "Bound uses of call" - pallet_preimage::migration::v1::Migration, - pallet_scheduler::migration::v3::MigrateToV4, - pallet_democracy::migrations::v1::Migration, - pallet_multisig::migrations::v1::MigrateToV1, - // "Properly migrate weights to v2" - parachains_configuration::migration::v3::MigrateToV3, - ), >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; diff --git a/runtime/rococo/src/weights/pallet_democracy.rs b/runtime/rococo/src/weights/pallet_democracy.rs index 453385b594e7..317b0d4bb0a1 100644 --- a/runtime/rococo/src/weights/pallet_democracy.rs +++ b/runtime/rococo/src/weights/pallet_democracy.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_democracy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-08-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 // Executed Command: @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/rococo/src/weights +// --output=./runtime/rococo/src/weights/pallet_democracy.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -49,103 +49,134 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(41_783_000 as u64) + Weight::from_ref_time(37_453_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy DepositOf (r:1 w:1) - fn second() -> Weight { - Weight::from_ref_time(38_362_000 as u64) + /// The range of component `s` is `[0, 100]`. + fn second(s: u32, ) -> Weight { + Weight::from_ref_time(27_807_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(69_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_new() -> Weight { - Weight::from_ref_time(48_307_000 as u64) + /// The range of component `r` is `[1, 99]`. + fn vote_new(r: u32, ) -> Weight { + Weight::from_ref_time(35_336_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(120_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_existing() -> Weight { - Weight::from_ref_time(48_500_000 as u64) + /// The range of component `r` is `[1, 99]`. + fn vote_existing(r: u32, ) -> Weight { + Weight::from_ref_time(35_107_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(123_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(20_294_000 as u64) + Weight::from_ref_time(17_752_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) - // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:1 w:1) // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Blacklist (r:0 w:1) - fn blacklist() -> Weight { - Weight::from_ref_time(75_191_000 as u64) + // Storage: Democracy DepositOf (r:1 w:1) + // Storage: System Account (r:1 w:1) + /// The range of component `p` is `[1, 100]`. + fn blacklist(p: u32, ) -> Weight { + Weight::from_ref_time(52_116_000 as u64) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(194_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) - fn external_propose() -> Weight { - Weight::from_ref_time(16_369_000 as u64) + /// The range of component `v` is `[1, 100]`. + fn external_propose(v: u32, ) -> Weight { + Weight::from_ref_time(10_194_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(10_000 as u64).saturating_mul(v as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(4_767_000 as u64) + Weight::from_ref_time(3_700_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(4_866_000 as u64) + Weight::from_ref_time(3_713_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(19_986_000 as u64) + Weight::from_ref_time(17_441_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) - fn veto_external() -> Weight { - Weight::from_ref_time(25_291_000 as u64) + /// The range of component `v` is `[0, 100]`. + fn veto_external(v: u32, ) -> Weight { + Weight::from_ref_time(18_536_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(42_000 as u64).saturating_mul(v as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:1 w:1) - fn cancel_proposal() -> Weight { - Weight::from_ref_time(63_703_000 as u64) + /// The range of component `p` is `[1, 100]`. + fn cancel_proposal(p: u32, ) -> Weight { + Weight::from_ref_time(42_174_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(164_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(13_235_000 as u64) + Weight::from_ref_time(11_892_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } + // Storage: Scheduler Lookup (r:1 w:1) + // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `r` is `[1, 99]`. + fn cancel_queued(r: u32, ) -> Weight { + Weight::from_ref_time(23_252_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(2_242_000 as u64).saturating_mul(r as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:2 w:0) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:0) + /// The range of component `r` is `[1, 99]`. fn on_initialize_base(r: u32, ) -> Weight { - Weight::from_ref_time(5_980_000 as u64) - // Standard Error: 2_131 - .saturating_add(Weight::from_ref_time(2_104_197 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(1_457_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(2_956_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) @@ -155,36 +186,36 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy LastTabledWasExternal (r:1 w:0) // Storage: Democracy NextExternal (r:1 w:0) // Storage: Democracy PublicProps (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:2 w:0) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:0) + /// The range of component `r` is `[1, 99]`. fn on_initialize_base_with_launch_period(r: u32, ) -> Weight { - Weight::from_ref_time(8_351_000 as u64) - // Standard Error: 2_308 - .saturating_add(Weight::from_ref_time(2_117_411 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(6_240_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(2_963_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:3 w:3) + // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - // Storage: Democracy ReferendumInfoOf (r:2 w:2) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn delegate(r: u32, ) -> Weight { - Weight::from_ref_time(40_303_000 as u64) - // Standard Error: 3_789 - .saturating_add(Weight::from_ref_time(3_031_594 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(34_480_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(3_908_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(4 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(4 as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) } // Storage: Democracy VotingOf (r:2 w:2) - // Storage: Democracy ReferendumInfoOf (r:2 w:2) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:1) + /// The range of component `r` is `[1, 99]`. fn undelegate(r: u32, ) -> Weight { - Weight::from_ref_time(24_342_000 as u64) - // Standard Error: 2_624 - .saturating_add(Weight::from_ref_time(2_962_125 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(17_446_000 as u64) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(3_917_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) @@ -192,48 +223,76 @@ impl pallet_democracy::WeightInfo for WeightInfo { } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(5_811_000 as u64) + Weight::from_ref_time(3_727_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Democracy Preimages (r:1 w:1) + /// The range of component `b` is `[0, 16384]`. + fn note_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(25_720_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Democracy Preimages (r:1 w:1) + /// The range of component `b` is `[0, 16384]`. + fn note_imminent_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(17_884_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Democracy Preimages (r:1 w:1) + // Storage: System Account (r:1 w:0) + /// The range of component `b` is `[0, 16384]`. + fn reap_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(24_695_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn unlock_remove(r: u32, ) -> Weight { - Weight::from_ref_time(22_894_000 as u64) - // Standard Error: 2_967 - .saturating_add(Weight::from_ref_time(142_001 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(22_207_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(36_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn unlock_set(r: u32, ) -> Weight { - Weight::from_ref_time(28_227_000 as u64) - // Standard Error: 673 - .saturating_add(Weight::from_ref_time(87_748 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(21_561_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(110_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 100]`. + /// The range of component `r` is `[1, 99]`. fn remove_vote(r: u32, ) -> Weight { - Weight::from_ref_time(15_578_000 as u64) - // Standard Error: 1_035 - .saturating_add(Weight::from_ref_time(105_378 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(13_204_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(105_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 100]`. + /// The range of component `r` is `[1, 99]`. fn remove_other_vote(r: u32, ) -> Weight { - Weight::from_ref_time(15_542_000 as u64) - // Standard Error: 1_104 - .saturating_add(Weight::from_ref_time(109_552 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(12_994_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(106_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/rococo/src/weights/pallet_preimage.rs b/runtime/rococo/src/weights/pallet_preimage.rs index 1755de2b34e6..5268e8054a13 100644 --- a/runtime/rococo/src/weights/pallet_preimage.rs +++ b/runtime/rococo/src/weights/pallet_preimage.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-08-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 // Executed Command: @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/rococo/src/weights +// --output=./runtime/rococo/src/weights/pallet_preimage.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -44,90 +44,91 @@ use sp_std::marker::PhantomData; /// Weight functions for `pallet_preimage`. pub struct WeightInfo(PhantomData); impl pallet_preimage::WeightInfo for WeightInfo { + // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(29_017_000 as u64) + Weight::from_ref_time(0 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_113 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:0) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(19_793_000 as u64) - // Standard Error: 1 - .saturating_add(Weight::from_ref_time(2_115 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + Weight::from_ref_time(0 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:0) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(18_854_000 as u64) - // Standard Error: 1 - .saturating_add(Weight::from_ref_time(2_115 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + Weight::from_ref_time(0 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(38_886_000 as u64) + Weight::from_ref_time(35_236_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(27_017_000 as u64) + Weight::from_ref_time(23_396_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(25_041_000 as u64) + Weight::from_ref_time(33_944_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(13_933_000 as u64) + Weight::from_ref_time(22_151_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(17_760_000 as u64) + Weight::from_ref_time(16_617_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(8_816_000 as u64) + Weight::from_ref_time(6_552_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(25_068_000 as u64) + Weight::from_ref_time(23_787_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(8_917_000 as u64) + Weight::from_ref_time(16_327_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(8_915_000 as u64) + Weight::from_ref_time(6_289_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/rococo/src/weights/pallet_scheduler.rs b/runtime/rococo/src/weights/pallet_scheduler.rs index ae9dc6426622..06a77fcee9cb 100644 --- a/runtime/rococo/src/weights/pallet_scheduler.rs +++ b/runtime/rococo/src/weights/pallet_scheduler.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-08-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 // Executed Command: @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/rococo/src/weights +// --output=./runtime/rococo/src/weights/pallet_scheduler.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -44,57 +44,133 @@ use sp_std::marker::PhantomData; /// Weight functions for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler IncompleteSince (r:1 w:1) - fn service_agendas_base() -> Weight { - Weight::from_ref_time(4_700_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(1_256_000 as u64) + // Standard Error: 42_000 + .saturating_add(Weight::from_ref_time(26_925_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. - fn service_agenda_base(s: u32, ) -> Weight { - Weight::from_ref_time(3_868_000 as u64) - // Standard Error: 2_747 - .saturating_add(Weight::from_ref_time(629_992 as u64).saturating_mul(s as u64)) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(921_000 as u64) + // Standard Error: 35_000 + .saturating_add(Weight::from_ref_time(21_922_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - fn service_task_base() -> Weight { - Weight::from_ref_time(12_316_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(0 as u64) + // Standard Error: 62_000 + .saturating_add(Weight::from_ref_time(24_926_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } + // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[128, 4194304]`. - fn service_task_fetched(s: u32, ) -> Weight { - Weight::from_ref_time(24_103_000 as u64) - // Standard Error: 5 - .saturating_add(Weight::from_ref_time(1_154 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(10_674_000 as u64) + // Standard Error: 31_000 + .saturating_add(Weight::from_ref_time(20_631_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) + } + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:0) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named_aborted(s: u32, ) -> Weight { + Weight::from_ref_time(2_607_000 as u64) + // Standard Error: 20_000 + .saturating_add(Weight::from_ref_time(10_009_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) + } + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:0) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_aborted(s: u32, ) -> Weight { + Weight::from_ref_time(3_381_000 as u64) + // Standard Error: 17_000 + .saturating_add(Weight::from_ref_time(7_945_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) } + // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - fn service_task_named() -> Weight { - Weight::from_ref_time(13_408_000 as u64) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_named(s: u32, ) -> Weight { + Weight::from_ref_time(6_676_000 as u64) + // Standard Error: 25_000 + .saturating_add(Weight::from_ref_time(16_966_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:1 w:1) - fn service_task_periodic() -> Weight { - Weight::from_ref_time(19_302_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic(s: u32, ) -> Weight { + Weight::from_ref_time(8_899_000 as u64) + // Standard Error: 24_000 + .saturating_add(Weight::from_ref_time(14_630_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - fn execute_dispatch_signed() -> Weight { - Weight::from_ref_time(3_885_000 as u64) + // Storage: Scheduler Agenda (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named(s: u32, ) -> Weight { + Weight::from_ref_time(8_583_000 as u64) + // Standard Error: 19_000 + .saturating_add(Weight::from_ref_time(12_228_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - fn execute_dispatch_unsigned() -> Weight { - Weight::from_ref_time(4_037_000 as u64) + // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize(s: u32, ) -> Weight { + Weight::from_ref_time(8_544_000 as u64) + // Standard Error: 19_000 + .saturating_add(Weight::from_ref_time(11_364_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 49]`. + /// The range of component `s` is `[0, 50]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(16_768_000 as u64) - // Standard Error: 3_650 - .saturating_add(Weight::from_ref_time(667_428 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_060_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(46_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -102,19 +178,19 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Lookup (r:0 w:1) /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(19_239_000 as u64) - // Standard Error: 1_456 - .saturating_add(Weight::from_ref_time(578_125 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(17_694_000 as u64) + // Standard Error: 7_000 + .saturating_add(Weight::from_ref_time(2_368_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 49]`. + /// The range of component `s` is `[0, 50]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(19_065_000 as u64) - // Standard Error: 4_027 - .saturating_add(Weight::from_ref_time(719_766 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(22_258_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(60_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -122,9 +198,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Agenda (r:1 w:1) /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(20_039_000 as u64) - // Standard Error: 2_179 - .saturating_add(Weight::from_ref_time(627_335 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(18_882_000 as u64) + // Standard Error: 7_000 + .saturating_add(Weight::from_ref_time(2_379_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/test-runtime/src/lib.rs b/runtime/test-runtime/src/lib.rs index a43e13eb015e..2eade55e3877 100644 --- a/runtime/test-runtime/src/lib.rs +++ b/runtime/test-runtime/src/lib.rs @@ -38,7 +38,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId; use frame_election_provider_support::{onchain, SequentialPhragmen}; use frame_support::{ construct_runtime, parameter_types, - traits::{Everything, KeyOwnerProofSystem, WithdrawReasons}, + traits::{Everything, KeyOwnerProofSystem}, }; use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; use pallet_session::historical as session_historical; @@ -455,8 +455,6 @@ impl claims::Config for Runtime { parameter_types! { pub storage MinVestedTransfer: Balance = 100 * DOLLARS; - pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = - WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -465,7 +463,6 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = (); - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 454e367e2c15..6aef1be3a267 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -25,7 +25,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId; use frame_election_provider_support::{onchain, SequentialPhragmen}; use frame_support::{ construct_runtime, parameter_types, - traits::{ConstU32, InstanceFilter, KeyOwnerProofSystem, WithdrawReasons}, + traits::{ConstU32, InstanceFilter, KeyOwnerProofSystem}, weights::ConstantMultiplier, PalletId, }; @@ -181,7 +181,8 @@ impl pallet_scheduler::Config for Runtime { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = frame_support::traits::EqualPrivilegeOnly; - type Preimages = Preimage; + type PreimageProvider = Preimage; + type NoPreimagePostponement = NoPreimagePostponement; } parameter_types! { @@ -195,6 +196,7 @@ impl pallet_preimage::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; + type MaxSize = PreimageMaxSize; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } @@ -712,8 +714,6 @@ impl pallet_recovery::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = 100 * CENTS; - pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = - WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -722,7 +722,6 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } @@ -1216,12 +1215,6 @@ pub type Executive = frame_executive::Executive< StakingMigrationV11OldPallet, >, pallet_staking::migrations::v12::MigrateToV12, - // "Bound uses of call" - pallet_preimage::migration::v1::Migration, - pallet_scheduler::migration::v3::MigrateToV4, - pallet_multisig::migrations::v1::MigrateToV1, - // "Properly migrate weights to v2" - parachains_configuration::migration::v3::MigrateToV3, ), >; /// The payload being signed in transactions. diff --git a/runtime/westend/src/weights/pallet_preimage.rs b/runtime/westend/src/weights/pallet_preimage.rs index 97f066d7d40b..afd51148cdde 100644 --- a/runtime/westend/src/weights/pallet_preimage.rs +++ b/runtime/westend/src/weights/pallet_preimage.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024 // Executed Command: @@ -32,102 +32,103 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/westend/src/weights +// --output=./runtime/westend/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight}}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_preimage`. pub struct WeightInfo(PhantomData); impl pallet_preimage::WeightInfo for WeightInfo { + // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(28_888_000 as u64) + Weight::from_ref_time(0 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_116 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:0) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(20_640_000 as u64) + Weight::from_ref_time(0 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_115 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:0) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(19_203_000 as u64) - // Standard Error: 1 - .saturating_add(Weight::from_ref_time(2_115 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + Weight::from_ref_time(0 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(41_563_000 as u64) + Weight::from_ref_time(40_836_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(28_606_000 as u64) + Weight::from_ref_time(28_774_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(27_447_000 as u64) + Weight::from_ref_time(37_963_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(14_862_000 as u64) + Weight::from_ref_time(25_754_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(18_337_000 as u64) + Weight::from_ref_time(17_769_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(9_074_000 as u64) + Weight::from_ref_time(9_214_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(28_192_000 as u64) + Weight::from_ref_time(26_179_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(9_012_000 as u64) + Weight::from_ref_time(18_809_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(8_961_000 as u64) + Weight::from_ref_time(8_759_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/westend/src/weights/pallet_scheduler.rs b/runtime/westend/src/weights/pallet_scheduler.rs index f325f2311093..edbd3187d1c9 100644 --- a/runtime/westend/src/weights/pallet_scheduler.rs +++ b/runtime/westend/src/weights/pallet_scheduler.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024 // Executed Command: @@ -32,69 +32,145 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/westend/src/weights +// --output=./runtime/westend/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight}}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler IncompleteSince (r:1 w:1) - fn service_agendas_base() -> Weight { - Weight::from_ref_time(4_399_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(16_183_000 as u64) + // Standard Error: 27_000 + .saturating_add(Weight::from_ref_time(18_374_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. - fn service_agenda_base(s: u32, ) -> Weight { - Weight::from_ref_time(3_771_000 as u64) - // Standard Error: 2_641 - .saturating_add(Weight::from_ref_time(610_848 as u64).saturating_mul(s as u64)) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(15_223_000 as u64) + // Standard Error: 28_000 + .saturating_add(Weight::from_ref_time(15_096_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - fn service_task_base() -> Weight { - Weight::from_ref_time(12_651_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(13_305_000 as u64) + // Standard Error: 28_000 + .saturating_add(Weight::from_ref_time(16_211_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } + // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[128, 4194304]`. - fn service_task_fetched(s: u32, ) -> Weight { - Weight::from_ref_time(24_280_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_126 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(15_574_000 as u64) + // Standard Error: 22_000 + .saturating_add(Weight::from_ref_time(13_923_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) + } + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:0) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named_aborted(s: u32, ) -> Weight { + Weight::from_ref_time(11_205_000 as u64) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(5_044_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) + } + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:0) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_aborted(s: u32, ) -> Weight { + Weight::from_ref_time(10_287_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(3_072_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) } + // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - fn service_task_named() -> Weight { - Weight::from_ref_time(13_929_000 as u64) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_named(s: u32, ) -> Weight { + Weight::from_ref_time(14_489_000 as u64) + // Standard Error: 16_000 + .saturating_add(Weight::from_ref_time(9_468_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:1 w:1) - fn service_task_periodic() -> Weight { - Weight::from_ref_time(19_285_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic(s: u32, ) -> Weight { + Weight::from_ref_time(16_768_000 as u64) + // Standard Error: 10_000 + .saturating_add(Weight::from_ref_time(7_121_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - fn execute_dispatch_signed() -> Weight { - Weight::from_ref_time(4_026_000 as u64) + // Storage: Scheduler Agenda (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named(s: u32, ) -> Weight { + Weight::from_ref_time(17_047_000 as u64) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(6_192_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - fn execute_dispatch_unsigned() -> Weight { - Weight::from_ref_time(4_078_000 as u64) + // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize(s: u32, ) -> Weight { + Weight::from_ref_time(17_163_000 as u64) + // Standard Error: 10_000 + .saturating_add(Weight::from_ref_time(5_300_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 49]`. + /// The range of component `s` is `[0, 50]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(17_176_000 as u64) - // Standard Error: 3_203 - .saturating_add(Weight::from_ref_time(645_757 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_757_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(75_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -102,19 +178,19 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Lookup (r:0 w:1) /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(19_408_000 as u64) - // Standard Error: 1_645 - .saturating_add(Weight::from_ref_time(575_558 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(20_399_000 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(880_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 49]`. + /// The range of component `s` is `[0, 50]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(20_173_000 as u64) - // Standard Error: 3_998 - .saturating_add(Weight::from_ref_time(684_714 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(23_671_000 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(121_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -122,9 +198,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Agenda (r:1 w:1) /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(20_330_000 as u64) - // Standard Error: 2_310 - .saturating_add(Weight::from_ref_time(621_196 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(23_233_000 as u64) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(924_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/scripts/ci/gitlab/lingua.dic b/scripts/ci/gitlab/lingua.dic index 3add6a276cf0..ea2da595908e 100644 --- a/scripts/ci/gitlab/lingua.dic +++ b/scripts/ci/gitlab/lingua.dic @@ -138,7 +138,6 @@ KYC/M lib libp2p lifecycle/MS -liveness lookahead/MS lookup/MS LRU @@ -223,7 +222,6 @@ redhat/M register/CD relayer repo/MS -requesters reservable responder/SM retriability diff --git a/xcm/pallet-xcm/src/lib.rs b/xcm/pallet-xcm/src/lib.rs index 78dc5087d960..f5e5d0f8c004 100644 --- a/xcm/pallet-xcm/src/lib.rs +++ b/xcm/pallet-xcm/src/lib.rs @@ -31,7 +31,7 @@ use sp_runtime::{ RuntimeDebug, }; use sp_std::{boxed::Box, marker::PhantomData, prelude::*, result::Result, vec}; -use xcm::{latest::Weight as XcmWeight, prelude::*}; +use xcm::prelude::*; use xcm_executor::traits::ConvertOrigin; use frame_support::PalletId; @@ -218,10 +218,6 @@ pub mod pallet { /// /// \[ location, query ID \] NotifyTargetMigrationFail(VersionedMultiLocation, QueryId), - /// Some assets have been claimed from an asset trap - /// - /// \[ hash, origin, assets \] - AssetsClaimed(H256, MultiLocation, VersionedMultiAssets), } #[pallet::origin] @@ -574,11 +570,11 @@ pub mod pallet { /// /// NOTE: A successful return to this does *not* imply that the `msg` was executed successfully /// to completion; only that *some* of it was executed. - #[pallet::weight(Weight::from_ref_time(max_weight.saturating_add(100_000_000u64)))] + #[pallet::weight(max_weight.saturating_add(Weight::from_ref_time(100_000_000u64)))] pub fn execute( origin: OriginFor, message: Box::RuntimeCall>>, - max_weight: XcmWeight, + max_weight: Weight, ) -> DispatchResultWithPostInfo { let origin_location = T::ExecuteXcmOrigin::ensure_origin(origin)?; let message = (*message).try_into().map_err(|()| Error::::BadVersion)?; @@ -588,8 +584,8 @@ pub mod pallet { let outcome = T::XcmExecutor::execute_xcm_in_credit( origin_location, message, - max_weight, - max_weight, + max_weight.ref_time(), + max_weight.ref_time(), ); let result = Ok(Some(outcome.weight_used().saturating_add(100_000_000)).into()); Self::deposit_event(Event::Attempted(outcome)); @@ -1316,13 +1312,12 @@ pub mod pallet { (0, Here) => (), _ => return false, }; - let hash = BlakeTwo256::hash_of(&(origin, versioned.clone())); + let hash = BlakeTwo256::hash_of(&(origin, versioned)); match AssetTraps::::get(hash) { 0 => return false, 1 => AssetTraps::::remove(hash), n => AssetTraps::::insert(hash, n - 1), } - Self::deposit_event(Event::AssetsClaimed(hash, origin.clone(), versioned)); return true } } diff --git a/xcm/pallet-xcm/src/tests.rs b/xcm/pallet-xcm/src/tests.rs index b619efefbe9b..ddac7518e510 100644 --- a/xcm/pallet-xcm/src/tests.rs +++ b/xcm/pallet-xcm/src/tests.rs @@ -517,7 +517,7 @@ fn execute_withdraw_to_deposit_works() { buy_execution((Here, SEND_AMOUNT)), DepositAsset { assets: All.into(), max_assets: 1, beneficiary: dest }, ]))), - weight + Weight::from_ref_time(weight) )); assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE - SEND_AMOUNT); assert_eq!(Balances::total_balance(&BOB), SEND_AMOUNT); @@ -549,7 +549,7 @@ fn trapped_assets_can_be_claimed() { // This would succeed, but we never get to it. DepositAsset { assets: All.into(), max_assets: 1, beneficiary: dest.clone() }, ]))), - weight + Weight::from_ref_time(weight) )); let source: MultiLocation = Junction::AccountId32 { network: NetworkId::Any, id: ALICE.into() }.into(); @@ -579,7 +579,7 @@ fn trapped_assets_can_be_claimed() { buy_execution((Here, SEND_AMOUNT)), DepositAsset { assets: All.into(), max_assets: 1, beneficiary: dest.clone() }, ]))), - weight + Weight::from_ref_time(weight) )); assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE - SEND_AMOUNT); @@ -594,7 +594,7 @@ fn trapped_assets_can_be_claimed() { buy_execution((Here, SEND_AMOUNT)), DepositAsset { assets: All.into(), max_assets: 1, beneficiary: dest }, ]))), - weight + Weight::from_ref_time(weight) )); assert_eq!( last_event(), diff --git a/xcm/xcm-executor/integration-tests/src/lib.rs b/xcm/xcm-executor/integration-tests/src/lib.rs index 272ceadfea01..6d263fe46245 100644 --- a/xcm/xcm-executor/integration-tests/src/lib.rs +++ b/xcm/xcm-executor/integration-tests/src/lib.rs @@ -17,6 +17,7 @@ #![cfg_attr(not(feature = "std"), no_std)] #![cfg(test)] +use frame_support::weights::Weight; use polkadot_test_client::{ BlockBuilderExt, ClientBlockImportExt, DefaultTestClientBuilderExt, ExecutionStrategy, InitPolkadotBlockBuilder, TestClientBuilder, TestClientBuilderExt, @@ -46,7 +47,7 @@ fn basic_buy_fees_message_executes() { &client, polkadot_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute { message: Box::new(VersionedXcm::from(msg)), - max_weight: 1_000_000_000, + max_weight: Weight::from_ref_time(1_000_000_000), }), sp_keyring::Sr25519Keyring::Alice, 0, @@ -128,7 +129,7 @@ fn query_response_fires() { &client, polkadot_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute { message: msg, - max_weight: 1_000_000_000, + max_weight: Weight::from_ref_time(1_000_000_000), }), sp_keyring::Sr25519Keyring::Alice, 1, @@ -216,7 +217,7 @@ fn query_response_elicits_handler() { &client, polkadot_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute { message: Box::new(VersionedXcm::from(msg)), - max_weight: 1_000_000_000, + max_weight: Weight::from_ref_time(1_000_000_000), }), sp_keyring::Sr25519Keyring::Alice, 1, From 0a4d2b9be7cbe99670f48678df8cdc6c38e8d9b9 Mon Sep 17 00:00:00 2001 From: Serban Iorga Date: Tue, 4 Oct 2022 12:25:48 +0300 Subject: [PATCH 20/49] Companion for BEEFY: Simplify hashing for pallet-beefy-mmr (#6098) * beefy-mmr: Simplify hashing * update lockfile for {"substrate"} Co-authored-by: parity-processbot <> --- Cargo.lock | 357 +++++++++++++++++++------------------- runtime/rococo/src/lib.rs | 2 +- 2 files changed, 180 insertions(+), 179 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1f4ec51a3fd9..05b361d42820 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -435,7 +435,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "array-bytes", "async-trait", @@ -472,7 +472,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -492,16 +492,17 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "beefy-primitives", "sp-api", + "sp-runtime", ] [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "parity-scale-codec", "scale-info", @@ -1998,7 +1999,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "parity-scale-codec", ] @@ -2016,7 +2017,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-support", "frame-system", @@ -2039,7 +2040,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "Inflector", "array-bytes", @@ -2090,7 +2091,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2101,7 +2102,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2117,7 +2118,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-support", "frame-system", @@ -2146,7 +2147,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "bitflags", "frame-metadata", @@ -2178,7 +2179,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "Inflector", "cfg-expr", @@ -2192,7 +2193,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2204,7 +2205,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "proc-macro2", "quote", @@ -2214,7 +2215,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2237,7 +2238,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-support", "frame-system", @@ -2248,7 +2249,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-support", "log", @@ -2266,7 +2267,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -2281,7 +2282,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "parity-scale-codec", "sp-api", @@ -2290,7 +2291,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-support", "parity-scale-codec", @@ -2473,7 +2474,7 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "chrono", "frame-election-provider-support", @@ -4834,7 +4835,7 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -4848,7 +4849,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-support", "frame-system", @@ -4864,7 +4865,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-support", "frame-system", @@ -4879,7 +4880,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -4903,7 +4904,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4923,7 +4924,7 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4942,7 +4943,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -4957,7 +4958,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "beefy-primitives", "frame-support", @@ -4973,7 +4974,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "array-bytes", "beefy-merkle-tree", @@ -4996,7 +4997,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5014,7 +5015,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5033,7 +5034,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5050,7 +5051,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#dbb72f3fd98253b72c0090375b738b9d00995090" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5067,7 +5068,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5083,7 +5084,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5107,7 +5108,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5120,7 +5121,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5138,7 +5139,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5159,7 +5160,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5174,7 +5175,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5197,7 +5198,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5213,7 +5214,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5233,7 +5234,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5250,7 +5251,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5267,7 +5268,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5285,7 +5286,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -5300,7 +5301,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5315,7 +5316,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-support", "frame-system", @@ -5332,7 +5333,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5352,7 +5353,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "parity-scale-codec", "sp-api", @@ -5362,7 +5363,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-support", "frame-system", @@ -5379,7 +5380,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5402,7 +5403,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5418,7 +5419,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5433,7 +5434,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#dbb72f3fd98253b72c0090375b738b9d00995090" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5451,7 +5452,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5466,7 +5467,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#dbb72f3fd98253b72c0090375b738b9d00995090" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5484,7 +5485,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5500,7 +5501,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-support", "frame-system", @@ -5521,7 +5522,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5537,7 +5538,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-support", "frame-system", @@ -5551,7 +5552,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5574,7 +5575,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5585,7 +5586,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "log", "sp-arithmetic", @@ -5594,7 +5595,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-support", "frame-system", @@ -5608,7 +5609,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5626,7 +5627,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5645,7 +5646,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-support", "frame-system", @@ -5661,7 +5662,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5676,7 +5677,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5687,7 +5688,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5704,7 +5705,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5720,7 +5721,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -5735,7 +5736,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#dbb72f3fd98253b72c0090375b738b9d00995090" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-benchmarking", "frame-support", @@ -8267,7 +8268,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "env_logger 0.9.0", "jsonrpsee", @@ -8615,7 +8616,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "log", "sp-core", @@ -8626,7 +8627,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "async-trait", "futures", @@ -8653,7 +8654,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "futures", "futures-timer", @@ -8676,7 +8677,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8692,7 +8693,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8709,7 +8710,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8720,7 +8721,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "array-bytes", "chrono", @@ -8760,7 +8761,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "fnv", "futures", @@ -8788,7 +8789,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "hash-db", "kvdb", @@ -8813,7 +8814,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "async-trait", "futures", @@ -8837,7 +8838,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "async-trait", "fork-tree", @@ -8879,7 +8880,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "futures", "jsonrpsee", @@ -8901,7 +8902,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8914,7 +8915,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "async-trait", "futures", @@ -8938,7 +8939,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "lazy_static", "lru 0.7.8", @@ -8965,7 +8966,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "environmental", "parity-scale-codec", @@ -8981,7 +8982,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "log", "parity-scale-codec", @@ -8996,7 +8997,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "cfg-if 1.0.0", "libc", @@ -9016,7 +9017,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "ahash", "array-bytes", @@ -9057,7 +9058,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "finality-grandpa", "futures", @@ -9078,7 +9079,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "ansi_term", "futures", @@ -9095,7 +9096,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "array-bytes", "async-trait", @@ -9110,7 +9111,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "array-bytes", "async-trait", @@ -9157,7 +9158,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "cid", "futures", @@ -9177,7 +9178,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "async-trait", "bitflags", @@ -9203,7 +9204,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "ahash", "futures", @@ -9221,7 +9222,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "array-bytes", "futures", @@ -9242,7 +9243,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "array-bytes", "fork-tree", @@ -9270,7 +9271,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "array-bytes", "futures", @@ -9289,7 +9290,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "array-bytes", "bytes", @@ -9319,7 +9320,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "futures", "libp2p", @@ -9332,7 +9333,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9341,7 +9342,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "futures", "hash-db", @@ -9371,7 +9372,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "futures", "jsonrpsee", @@ -9394,7 +9395,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "futures", "jsonrpsee", @@ -9407,7 +9408,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "async-trait", "directories", @@ -9477,7 +9478,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "log", "parity-scale-codec", @@ -9491,7 +9492,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -9510,7 +9511,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "futures", "libc", @@ -9529,7 +9530,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "chrono", "futures", @@ -9547,7 +9548,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "ansi_term", "atty", @@ -9578,7 +9579,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9589,7 +9590,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "futures", "futures-timer", @@ -9615,7 +9616,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "futures", "log", @@ -9628,7 +9629,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "futures", "futures-timer", @@ -10114,7 +10115,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "hash-db", "log", @@ -10132,7 +10133,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "blake2", "proc-macro-crate", @@ -10144,7 +10145,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "parity-scale-codec", "scale-info", @@ -10157,7 +10158,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "integer-sqrt", "num-traits", @@ -10172,7 +10173,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "parity-scale-codec", "scale-info", @@ -10185,7 +10186,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "async-trait", "parity-scale-codec", @@ -10197,7 +10198,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "parity-scale-codec", "sp-api", @@ -10209,7 +10210,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "futures", "log", @@ -10227,7 +10228,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "async-trait", "futures", @@ -10246,7 +10247,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "async-trait", "merlin", @@ -10269,7 +10270,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "parity-scale-codec", "scale-info", @@ -10283,7 +10284,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "parity-scale-codec", "scale-info", @@ -10296,7 +10297,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "array-bytes", "base58", @@ -10342,7 +10343,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "blake2", "byteorder", @@ -10356,7 +10357,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "proc-macro2", "quote", @@ -10367,7 +10368,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -10376,7 +10377,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "proc-macro2", "quote", @@ -10386,7 +10387,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "environmental", "parity-scale-codec", @@ -10397,7 +10398,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "finality-grandpa", "log", @@ -10415,7 +10416,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10429,7 +10430,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "bytes", "futures", @@ -10455,7 +10456,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "lazy_static", "sp-core", @@ -10466,7 +10467,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "async-trait", "futures", @@ -10483,7 +10484,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "thiserror", "zstd", @@ -10492,7 +10493,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "log", "parity-scale-codec", @@ -10507,7 +10508,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "parity-scale-codec", "scale-info", @@ -10521,7 +10522,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "sp-api", "sp-core", @@ -10531,7 +10532,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "backtrace", "lazy_static", @@ -10541,7 +10542,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "rustc-hash", "serde", @@ -10551,7 +10552,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "either", "hash256-std-hasher", @@ -10574,7 +10575,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -10592,7 +10593,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "Inflector", "proc-macro-crate", @@ -10604,7 +10605,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "log", "parity-scale-codec", @@ -10618,7 +10619,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "parity-scale-codec", "scale-info", @@ -10632,7 +10633,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "parity-scale-codec", "scale-info", @@ -10643,7 +10644,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "hash-db", "log", @@ -10665,12 +10666,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10683,7 +10684,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "log", "sp-core", @@ -10696,7 +10697,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "async-trait", "futures-timer", @@ -10712,7 +10713,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "parity-scale-codec", "sp-std", @@ -10724,7 +10725,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "sp-api", "sp-runtime", @@ -10733,7 +10734,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "async-trait", "log", @@ -10749,7 +10750,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "ahash", "hash-db", @@ -10772,7 +10773,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10789,7 +10790,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10800,7 +10801,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "impl-trait-for-tuples", "log", @@ -10813,7 +10814,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -11028,7 +11029,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "platforms", ] @@ -11036,7 +11037,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -11057,7 +11058,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "futures-util", "hyper", @@ -11070,7 +11071,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "jsonrpsee", "log", @@ -11091,7 +11092,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "array-bytes", "async-trait", @@ -11117,7 +11118,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "futures", "substrate-test-utils-derive", @@ -11127,7 +11128,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11138,7 +11139,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "ansi_term", "build-helper", @@ -11851,7 +11852,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" +source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" dependencies = [ "clap", "frame-try-runtime", diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index 94677cc07290..c10715ee0ee1 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -1257,7 +1257,7 @@ impl BeefyDataProvider for ParasProvider { .filter_map(|id| Paras::para_head(&id).map(|head| (id.into(), head.0))) .collect(); para_heads.sort(); - beefy_merkle_tree::merkle_root::, _, _>( + beefy_merkle_tree::merkle_root::<::Hashing, _>( para_heads.into_iter().map(|pair| pair.encode()), ) .into() From dffb9768832ee502f00b26f57e80f921ea51996e Mon Sep 17 00:00:00 2001 From: Andrei Sandu <54316454+sandreim@users.noreply.github.com> Date: Tue, 4 Oct 2022 13:36:42 +0300 Subject: [PATCH 21/49] Keep sessions in window for the full unfinalized chain (#6054) * Impl dynamic window size. Keep sessions for unfinalized chain Signed-off-by: Andrei Sandu * feedback Signed-off-by: Andrei Sandu * Stretch also in contructor plus tests Signed-off-by: Andrei Sandu * review feedback Signed-off-by: Andrei Sandu * fix approval-voting tests Signed-off-by: Andrei Sandu * grunting: dispute coordinator tests Signed-off-by: Andrei Sandu Signed-off-by: Andrei Sandu --- node/core/approval-voting/src/import.rs | 32 ++ node/core/approval-voting/src/tests.rs | 31 ++ node/core/dispute-coordinator/src/tests.rs | 41 ++- .../src/rolling_session_window.rs | 339 +++++++++++++++++- 4 files changed, 432 insertions(+), 11 deletions(-) diff --git a/node/core/approval-voting/src/import.rs b/node/core/approval-voting/src/import.rs index d43bf40546ae..5413c271e0d6 100644 --- a/node/core/approval-voting/src/import.rs +++ b/node/core/approval-voting/src/import.rs @@ -1296,6 +1296,38 @@ pub(crate) mod tests { } ); + // Caching of sesssions needs sessoion of first unfinalied block. + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( + s_tx, + )) => { + let _ = s_tx.send(Ok(header.number)); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( + block_number, + s_tx, + )) => { + assert_eq!(block_number, header.number); + let _ = s_tx.send(Ok(Some(header.hash()))); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionIndexForChild(s_tx), + )) => { + assert_eq!(h, header.hash()); + let _ = s_tx.send(Ok(session)); + } + ); + // determine_new_blocks exits early as the parent_hash is in the DB assert_matches!( diff --git a/node/core/approval-voting/src/tests.rs b/node/core/approval-voting/src/tests.rs index 66d1402ed6dc..bdb7a8c929b3 100644 --- a/node/core/approval-voting/src/tests.rs +++ b/node/core/approval-voting/src/tests.rs @@ -807,6 +807,37 @@ async fn import_block( } ); + assert_matches!( + overseer_recv(overseer).await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( + s_tx, + )) => { + let _ = s_tx.send(Ok(number)); + } + ); + + assert_matches!( + overseer_recv(overseer).await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( + block_number, + s_tx, + )) => { + assert_eq!(block_number, number); + let _ = s_tx.send(Ok(Some(hashes[number as usize].0))); + } + ); + + assert_matches!( + overseer_recv(overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionIndexForChild(s_tx), + )) => { + assert_eq!(h, hashes[number as usize].0); + let _ = s_tx.send(Ok(number.into())); + } + ); + if !fork { assert_matches!( overseer_recv(overseer).await, diff --git a/node/core/dispute-coordinator/src/tests.rs b/node/core/dispute-coordinator/src/tests.rs index ff85319599ce..aaef00999259 100644 --- a/node/core/dispute-coordinator/src/tests.rs +++ b/node/core/dispute-coordinator/src/tests.rs @@ -239,13 +239,15 @@ impl TestState { ))) .await; - self.handle_sync_queries(virtual_overseer, block_hash, session).await; + self.handle_sync_queries(virtual_overseer, block_hash, block_number, session) + .await; } async fn handle_sync_queries( &mut self, virtual_overseer: &mut VirtualOverseer, block_hash: Hash, + block_number: BlockNumber, session: SessionIndex, ) { // Order of messages is not fixed (different on initializing): @@ -278,11 +280,45 @@ impl TestState { finished_steps.got_session_information = true; assert_eq!(h, block_hash); let _ = tx.send(Ok(session)); + + // Queries for fetching earliest unfinalized block session. See `RollingSessionWindow`. + assert_matches!( + overseer_recv(virtual_overseer).await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( + s_tx, + )) => { + let _ = s_tx.send(Ok(block_number)); + } + ); + + assert_matches!( + overseer_recv(virtual_overseer).await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( + number, + s_tx, + )) => { + assert_eq!(block_number, number); + let _ = s_tx.send(Ok(Some(block_hash))); + } + ); + + assert_matches!( + overseer_recv(virtual_overseer).await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionIndexForChild(s_tx), + )) => { + assert_eq!(h, block_hash); + let _ = s_tx.send(Ok(session)); + } + ); + // No queries, if subsystem knows about this session already. if self.known_session == Some(session) { continue } self.known_session = Some(session); + loop { // answer session info queries until the current session is reached. assert_matches!( @@ -361,7 +397,8 @@ impl TestState { ))) .await; - self.handle_sync_queries(virtual_overseer, *leaf, session).await; + self.handle_sync_queries(virtual_overseer, *leaf, n as BlockNumber, session) + .await; } } diff --git a/node/subsystem-util/src/rolling_session_window.rs b/node/subsystem-util/src/rolling_session_window.rs index dd9282b50fe5..0ff2dc6deb13 100644 --- a/node/subsystem-util/src/rolling_session_window.rs +++ b/node/subsystem-util/src/rolling_session_window.rs @@ -20,15 +20,17 @@ //! care about the state of particular blocks. pub use polkadot_node_primitives::{new_session_window_size, SessionWindowSize}; -use polkadot_primitives::v2::{Hash, SessionIndex, SessionInfo}; +use polkadot_primitives::v2::{BlockNumber, Hash, SessionIndex, SessionInfo}; use futures::channel::oneshot; use polkadot_node_subsystem::{ - errors::RuntimeApiError, - messages::{RuntimeApiMessage, RuntimeApiRequest}, + errors::{ChainApiError, RuntimeApiError}, + messages::{ChainApiMessage, RuntimeApiMessage, RuntimeApiRequest}, overseer, }; +const LOG_TARGET: &str = "parachain::rolling-session-window"; + /// Sessions unavailable in state to cache. #[derive(Debug, Clone, thiserror::Error)] pub enum SessionsUnavailableReason { @@ -38,9 +40,18 @@ pub enum SessionsUnavailableReason { /// The runtime API itself returned an error. #[error(transparent)] RuntimeApi(#[from] RuntimeApiError), + /// The chain API itself returned an error. + #[error(transparent)] + ChainApi(#[from] ChainApiError), /// Missing session info from runtime API for given `SessionIndex`. #[error("Missing session index {0:?}")] Missing(SessionIndex), + /// Missing last finalized block number. + #[error("Missing last finalized block number")] + MissingLastFinalizedBlock, + /// Missing last finalized block hash. + #[error("Missing last finalized block hash")] + MissingLastFinalizedBlockHash(BlockNumber), } /// Information about the sessions being fetched. @@ -98,11 +109,18 @@ impl RollingSessionWindow { block_hash: Hash, ) -> Result where - Sender: overseer::SubsystemSender, + Sender: overseer::SubsystemSender + + overseer::SubsystemSender, { let session_index = get_session_index_for_child(&mut sender, block_hash).await?; + let earliest_non_finalized_block_session = + Self::earliest_non_finalized_block_session(&mut sender).await?; - let window_start = session_index.saturating_sub(window_size.get() - 1); + // This will increase the session window to cover the full unfinalized chain. + let window_start = std::cmp::min( + session_index.saturating_sub(window_size.get() - 1), + earliest_non_finalized_block_session, + ); match load_all_sessions(&mut sender, block_hash, window_start, session_index).await { Err(kind) => Err(SessionsUnavailable { @@ -146,6 +164,87 @@ impl RollingSessionWindow { self.earliest_session + (self.session_info.len() as SessionIndex).saturating_sub(1) } + async fn earliest_non_finalized_block_session( + sender: &mut Sender, + ) -> Result + where + Sender: overseer::SubsystemSender + + overseer::SubsystemSender, + { + let last_finalized_height = { + let (tx, rx) = oneshot::channel(); + sender.send_message(ChainApiMessage::FinalizedBlockNumber(tx)).await; + match rx.await { + Ok(Ok(number)) => number, + Ok(Err(e)) => + return Err(SessionsUnavailable { + kind: SessionsUnavailableReason::ChainApi(e), + info: None, + }), + Err(err) => { + gum::warn!( + target: LOG_TARGET, + ?err, + "Failed fetching last finalized block number" + ); + return Err(SessionsUnavailable { + kind: SessionsUnavailableReason::MissingLastFinalizedBlock, + info: None, + }) + }, + } + }; + + let (tx, rx) = oneshot::channel(); + // We want to get the session index for the child of the last finalized block. + sender + .send_message(ChainApiMessage::FinalizedBlockHash(last_finalized_height, tx)) + .await; + let last_finalized_hash_parent = match rx.await { + Ok(Ok(maybe_hash)) => maybe_hash, + Ok(Err(e)) => + return Err(SessionsUnavailable { + kind: SessionsUnavailableReason::ChainApi(e), + info: None, + }), + Err(err) => { + gum::warn!(target: LOG_TARGET, ?err, "Failed fetching last finalized block hash"); + return Err(SessionsUnavailable { + kind: SessionsUnavailableReason::MissingLastFinalizedBlockHash( + last_finalized_height, + ), + info: None, + }) + }, + }; + + // Get the session in which the last finalized block was authored. + if let Some(last_finalized_hash_parent) = last_finalized_hash_parent { + let session = + match get_session_index_for_child(sender, last_finalized_hash_parent).await { + Ok(session_index) => session_index, + Err(err) => { + gum::warn!( + target: LOG_TARGET, + ?err, + ?last_finalized_hash_parent, + "Failed fetching session index" + ); + return Err(err) + }, + }; + + Ok(session) + } else { + return Err(SessionsUnavailable { + kind: SessionsUnavailableReason::MissingLastFinalizedBlockHash( + last_finalized_height, + ), + info: None, + }) + } + } + /// When inspecting a new import notification, updates the session info cache to match /// the session of the imported block's child. /// @@ -153,12 +252,18 @@ impl RollingSessionWindow { /// not change often and import notifications are expected to be typically increasing in session number. /// /// some backwards drift in session index is acceptable. - pub async fn cache_session_info_for_head( + pub async fn cache_session_info_for_head( &mut self, - sender: &mut impl overseer::SubsystemSender, + sender: &mut Sender, block_hash: Hash, - ) -> Result { + ) -> Result + where + Sender: overseer::SubsystemSender + + overseer::SubsystemSender, + { let session_index = get_session_index_for_child(sender, block_hash).await?; + let earliest_non_finalized_block_session = + Self::earliest_non_finalized_block_session(sender).await?; let old_window_start = self.earliest_session; @@ -171,7 +276,12 @@ impl RollingSessionWindow { let old_window_end = latest; - let window_start = session_index.saturating_sub(self.window_size.get() - 1); + // Ensure we keep sessions up to last finalized block by adjusting the window start. + // This will increase the session window to cover the full unfinalized chain. + let window_start = std::cmp::min( + session_index.saturating_sub(self.window_size.get() - 1), + earliest_non_finalized_block_session, + ); // keep some of the old window, if applicable. let overlap_start = window_start.saturating_sub(old_window_start); @@ -319,6 +429,14 @@ mod tests { parent_hash: Default::default(), }; + let finalized_header = Header { + digest: Default::default(), + extrinsics_root: Default::default(), + number: 0, + state_root: Default::default(), + parent_hash: Default::default(), + }; + let pool = TaskExecutor::new(); let (mut ctx, mut handle) = make_subsystem_context::(pool.clone()); @@ -358,6 +476,37 @@ mod tests { } ); + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( + s_tx, + )) => { + let _ = s_tx.send(Ok(finalized_header.number)); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( + block_number, + s_tx, + )) => { + assert_eq!(block_number, finalized_header.number); + let _ = s_tx.send(Ok(Some(finalized_header.hash()))); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionIndexForChild(s_tx), + )) => { + assert_eq!(h, finalized_header.hash()); + let _ = s_tx.send(Ok(session)); + } + ); + for i in expect_requests_from..=session { assert_matches!( handle.recv().await, @@ -485,6 +634,108 @@ mod tests { cache_session_info_test(0, 3, Some(window), 2); } + #[test] + fn any_session_stretch_for_unfinalized_chain() { + // Session index of the tip of our fake test chain. + let session: SessionIndex = 100; + let genesis_session: SessionIndex = 0; + + let header = Header { + digest: Default::default(), + extrinsics_root: Default::default(), + number: 5, + state_root: Default::default(), + parent_hash: Default::default(), + }; + + let finalized_header = Header { + digest: Default::default(), + extrinsics_root: Default::default(), + number: 0, + state_root: Default::default(), + parent_hash: Default::default(), + }; + + let pool = TaskExecutor::new(); + let (mut ctx, mut handle) = make_subsystem_context::<(), _>(pool.clone()); + + let hash = header.hash(); + + let test_fut = { + let sender = ctx.sender().clone(); + Box::pin(async move { + let res = RollingSessionWindow::new(sender, TEST_WINDOW_SIZE, hash).await; + assert!(res.is_err()); + }) + }; + + let aux_fut = Box::pin(async move { + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionIndexForChild(s_tx), + )) => { + assert_eq!(h, hash); + let _ = s_tx.send(Ok(session)); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( + s_tx, + )) => { + let _ = s_tx.send(Ok(finalized_header.number)); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( + block_number, + s_tx, + )) => { + assert_eq!(block_number, finalized_header.number); + let _ = s_tx.send(Ok(Some(finalized_header.hash()))); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionIndexForChild(s_tx), + )) => { + assert_eq!(h, finalized_header.hash()); + let _ = s_tx.send(Ok(0)); + } + ); + + // Unfinalized chain starts at geneisis block, so session 0 is how far we stretch. + for i in genesis_session..=session { + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionInfo(j, s_tx), + )) => { + assert_eq!(h, hash); + assert_eq!(i, j); + + let _ = s_tx.send(Ok(if i == session { + None + } else { + Some(dummy_session_info(i)) + })); + } + ); + } + }); + + futures::executor::block_on(futures::future::join(test_fut, aux_fut)); + } + #[test] fn any_session_unavailable_for_caching_means_no_change() { let session: SessionIndex = 6; @@ -498,6 +749,14 @@ mod tests { parent_hash: Default::default(), }; + let finalized_header = Header { + digest: Default::default(), + extrinsics_root: Default::default(), + number: 0, + state_root: Default::default(), + parent_hash: Default::default(), + }; + let pool = TaskExecutor::new(); let (mut ctx, mut handle) = make_subsystem_context::<(), _>(pool.clone()); @@ -523,6 +782,37 @@ mod tests { } ); + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( + s_tx, + )) => { + let _ = s_tx.send(Ok(finalized_header.number)); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( + block_number, + s_tx, + )) => { + assert_eq!(block_number, finalized_header.number); + let _ = s_tx.send(Ok(Some(finalized_header.hash()))); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionIndexForChild(s_tx), + )) => { + assert_eq!(h, finalized_header.hash()); + let _ = s_tx.send(Ok(session)); + } + ); + for i in start_session..=session { assert_matches!( handle.recv().await, @@ -586,6 +876,37 @@ mod tests { } ); + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( + s_tx, + )) => { + let _ = s_tx.send(Ok(header.number)); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( + block_number, + s_tx, + )) => { + assert_eq!(block_number, header.number); + let _ = s_tx.send(Ok(Some(header.hash()))); + } + ); + + assert_matches!( + handle.recv().await, + AllMessages::RuntimeApi(RuntimeApiMessage::Request( + h, + RuntimeApiRequest::SessionIndexForChild(s_tx), + )) => { + assert_eq!(h, header.hash()); + let _ = s_tx.send(Ok(session)); + } + ); + assert_matches!( handle.recv().await, AllMessages::RuntimeApi(RuntimeApiMessage::Request( From 89d1f3164d2fd74b2daa76822f6347be2c1f358a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Oct 2022 11:28:21 +0000 Subject: [PATCH 22/49] Bump lru from 0.7.8 to 0.8.0 (#6060) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump lru from 0.7.8 to 0.8.0 Bumps [lru](https://github.com/jeromefroe/lru-rs) from 0.7.8 to 0.8.0. - [Release notes](https://github.com/jeromefroe/lru-rs/releases) - [Changelog](https://github.com/jeromefroe/lru-rs/blob/master/CHANGELOG.md) - [Commits](https://github.com/jeromefroe/lru-rs/compare/0.7.8...0.8.0) --- updated-dependencies: - dependency-name: lru dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Change `LruCache` paramerter to `NonZeroUsize` * Change type of `session_cache_lru_size` to `NonZeroUsize` * Add expects instead of unwrap Co-authored-by: Bastian Köcher * Use match to get rid of expects Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sebastian Kunert Co-authored-by: Bastian Köcher --- Cargo.lock | 18 +++++++++--------- node/core/approval-voting/Cargo.toml | 2 +- node/core/approval-voting/src/lib.rs | 7 ++++++- node/core/dispute-coordinator/Cargo.toml | 2 +- .../dispute-coordinator/src/scraping/mod.rs | 10 ++++++++-- .../availability-distribution/Cargo.toml | 2 +- .../src/requester/session_cache.rs | 4 ++-- node/network/availability-recovery/Cargo.toml | 2 +- node/network/availability-recovery/src/lib.rs | 6 +++++- node/network/dispute-distribution/Cargo.toml | 2 +- node/network/dispute-distribution/src/lib.rs | 5 ++++- .../dispute-distribution/src/receiver/mod.rs | 13 ++++++++++--- node/overseer/Cargo.toml | 2 +- node/overseer/src/lib.rs | 6 +++++- node/service/Cargo.toml | 2 +- node/subsystem-util/Cargo.toml | 2 +- node/subsystem-util/src/runtime/mod.rs | 11 +++++++---- 17 files changed, 64 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 05b361d42820..6e86aa901131 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6167,7 +6167,7 @@ dependencies = [ "fatality", "futures", "futures-timer", - "lru 0.7.8", + "lru 0.8.0", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6197,7 +6197,7 @@ dependencies = [ "futures", "futures-timer", "log", - "lru 0.7.8", + "lru 0.8.0", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6335,7 +6335,7 @@ dependencies = [ "futures", "futures-timer", "lazy_static", - "lru 0.7.8", + "lru 0.8.0", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6455,7 +6455,7 @@ dependencies = [ "futures-timer", "kvdb", "kvdb-memorydb", - "lru 0.7.8", + "lru 0.8.0", "merlin", "parity-scale-codec", "parking_lot 0.12.1", @@ -6624,7 +6624,7 @@ dependencies = [ "futures-timer", "kvdb", "kvdb-memorydb", - "lru 0.7.8", + "lru 0.8.0", "parity-scale-codec", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -6911,7 +6911,7 @@ dependencies = [ "kvdb-shared-tests", "lazy_static", "log", - "lru 0.7.8", + "lru 0.8.0", "parity-db", "parity-scale-codec", "parity-util-mem", @@ -6945,7 +6945,7 @@ dependencies = [ "femme", "futures", "futures-timer", - "lru 0.7.8", + "lru 0.8.0", "orchestra", "parity-util-mem", "parking_lot 0.12.1", @@ -7302,7 +7302,7 @@ dependencies = [ "kvdb", "kvdb-rocksdb", "log", - "lru 0.7.8", + "lru 0.8.0", "pallet-babe", "pallet-im-online", "pallet-staking", @@ -11922,7 +11922,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "digest 0.10.3", "rand 0.8.5", "static_assertions", diff --git a/node/core/approval-voting/Cargo.toml b/node/core/approval-voting/Cargo.toml index f2572cac8232..e39a589b5675 100644 --- a/node/core/approval-voting/Cargo.toml +++ b/node/core/approval-voting/Cargo.toml @@ -10,7 +10,7 @@ futures-timer = "3.0.2" parity-scale-codec = { version = "3.1.5", default-features = false, features = ["bit-vec", "derive"] } gum = { package = "tracing-gum", path = "../../gum" } bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } -lru = "0.7" +lru = "0.8" merlin = "2.0" schnorrkel = "0.9.1" kvdb = "0.11.0" diff --git a/node/core/approval-voting/src/lib.rs b/node/core/approval-voting/src/lib.rs index ac025f366ab7..467d8be612e9 100644 --- a/node/core/approval-voting/src/lib.rs +++ b/node/core/approval-voting/src/lib.rs @@ -70,6 +70,7 @@ use std::{ collections::{ btree_map::Entry as BTMEntry, hash_map::Entry as HMEntry, BTreeMap, HashMap, HashSet, }, + num::NonZeroUsize, sync::Arc, time::Duration, }; @@ -104,7 +105,11 @@ const APPROVAL_CHECKING_TIMEOUT: Duration = Duration::from_secs(120); /// Value rather arbitrarily: Should not be hit in practice, it exists to more easily diagnose dead /// lock issues for example. const WAIT_FOR_SIGS_TIMEOUT: Duration = Duration::from_millis(500); -const APPROVAL_CACHE_SIZE: usize = 1024; +const APPROVAL_CACHE_SIZE: NonZeroUsize = match NonZeroUsize::new(1024) { + Some(cap) => cap, + None => panic!("Approval cache size must be non-zero."), +}; + const TICK_TOO_FAR_IN_FUTURE: Tick = 20; // 10 seconds. const APPROVAL_DELAY: Tick = 2; const LOG_TARGET: &str = "parachain::approval-voting"; diff --git a/node/core/dispute-coordinator/Cargo.toml b/node/core/dispute-coordinator/Cargo.toml index bc22b40c8529..7d7bc25e91d4 100644 --- a/node/core/dispute-coordinator/Cargo.toml +++ b/node/core/dispute-coordinator/Cargo.toml @@ -10,7 +10,7 @@ gum = { package = "tracing-gum", path = "../../gum" } parity-scale-codec = "3.1.5" kvdb = "0.11.0" thiserror = "1.0.31" -lru = "0.7.7" +lru = "0.8.0" fatality = "0.0.6" polkadot-primitives = { path = "../../../primitives" } diff --git a/node/core/dispute-coordinator/src/scraping/mod.rs b/node/core/dispute-coordinator/src/scraping/mod.rs index b45dbfa95197..7d5d33e1ff4b 100644 --- a/node/core/dispute-coordinator/src/scraping/mod.rs +++ b/node/core/dispute-coordinator/src/scraping/mod.rs @@ -14,7 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::collections::{BTreeMap, HashSet}; +use std::{ + collections::{BTreeMap, HashSet}, + num::NonZeroUsize, +}; use futures::channel::oneshot; use lru::LruCache; @@ -44,7 +47,10 @@ mod tests; /// `last_observed_blocks` LRU. This means, this value should the very least be as large as the /// number of expected forks for keeping chain scraping efficient. Making the LRU much larger than /// that has very limited use. -const LRU_OBSERVED_BLOCKS_CAPACITY: usize = 20; +const LRU_OBSERVED_BLOCKS_CAPACITY: NonZeroUsize = match NonZeroUsize::new(20) { + Some(cap) => cap, + None => panic!("Observed blocks cache size must be non-zero"), +}; /// Chain scraper /// diff --git a/node/network/availability-distribution/Cargo.toml b/node/network/availability-distribution/Cargo.toml index 43d56a1ace24..3e8626c18898 100644 --- a/node/network/availability-distribution/Cargo.toml +++ b/node/network/availability-distribution/Cargo.toml @@ -19,7 +19,7 @@ sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "maste thiserror = "1.0.31" rand = "0.8.5" derive_more = "0.99.17" -lru = "0.7.7" +lru = "0.8.0" fatality = "0.0.6" [dev-dependencies] diff --git a/node/network/availability-distribution/src/requester/session_cache.rs b/node/network/availability-distribution/src/requester/session_cache.rs index 6d41d9301233..cf01e448b70b 100644 --- a/node/network/availability-distribution/src/requester/session_cache.rs +++ b/node/network/availability-distribution/src/requester/session_cache.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::collections::HashSet; +use std::{collections::HashSet, num::NonZeroUsize}; use lru::LruCache; use rand::{seq::SliceRandom, thread_rng}; @@ -85,7 +85,7 @@ impl SessionCache { pub fn new() -> Self { SessionCache { // We need to cache the current and the last session the most: - session_info_cache: LruCache::new(2), + session_info_cache: LruCache::new(NonZeroUsize::new(2).unwrap()), } } diff --git a/node/network/availability-recovery/Cargo.toml b/node/network/availability-recovery/Cargo.toml index fce9755a05a3..86f6237740fa 100644 --- a/node/network/availability-recovery/Cargo.toml +++ b/node/network/availability-recovery/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] futures = "0.3.21" -lru = "0.7.7" +lru = "0.8.0" rand = "0.8.5" fatality = "0.0.6" thiserror = "1.0.31" diff --git a/node/network/availability-recovery/src/lib.rs b/node/network/availability-recovery/src/lib.rs index 62401e3ad615..f2f92cc54490 100644 --- a/node/network/availability-recovery/src/lib.rs +++ b/node/network/availability-recovery/src/lib.rs @@ -20,6 +20,7 @@ use std::{ collections::{HashMap, VecDeque}, + num::NonZeroUsize, pin::Pin, time::Duration, }; @@ -77,7 +78,10 @@ const LOG_TARGET: &str = "parachain::availability-recovery"; const N_PARALLEL: usize = 50; // Size of the LRU cache where we keep recovered data. -const LRU_SIZE: usize = 16; +const LRU_SIZE: NonZeroUsize = match NonZeroUsize::new(16) { + Some(cap) => cap, + None => panic!("Availability-recovery cache size must be non-zero."), +}; const COST_INVALID_REQUEST: Rep = Rep::CostMajor("Peer sent unparsable request"); diff --git a/node/network/dispute-distribution/Cargo.toml b/node/network/dispute-distribution/Cargo.toml index f50f24bf42c8..c37f26f7bece 100644 --- a/node/network/dispute-distribution/Cargo.toml +++ b/node/network/dispute-distribution/Cargo.toml @@ -20,7 +20,7 @@ sp-application-crypto = { git = "https://github.com/paritytech/substrate", branc sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } thiserror = "1.0.31" fatality = "0.0.6" -lru = "0.7.7" +lru = "0.8.0" [dev-dependencies] async-trait = "0.1.57" diff --git a/node/network/dispute-distribution/src/lib.rs b/node/network/dispute-distribution/src/lib.rs index aefd66e0ae79..440b70b786d5 100644 --- a/node/network/dispute-distribution/src/lib.rs +++ b/node/network/dispute-distribution/src/lib.rs @@ -24,6 +24,8 @@ //! The sender is responsible for getting our vote out, see [`sender`]. The receiver handles //! incoming [`DisputeRequest`]s and offers spam protection, see [`receiver`]. +use std::num::NonZeroUsize; + use futures::{channel::mpsc, FutureExt, StreamExt, TryFutureExt}; use polkadot_node_network_protocol::authority_discovery::AuthorityDiscovery; @@ -145,7 +147,8 @@ where ) -> Self { let runtime = RuntimeInfo::new_with_config(runtime::Config { keystore: Some(keystore), - session_cache_lru_size: DISPUTE_WINDOW.get() as usize, + session_cache_lru_size: NonZeroUsize::new(DISPUTE_WINDOW.get() as usize) + .expect("Dispute window can not be 0; qed"), }); let (tx, sender_rx) = mpsc::channel(1); let disputes_sender = DisputeSender::new(tx, metrics.clone()); diff --git a/node/network/dispute-distribution/src/receiver/mod.rs b/node/network/dispute-distribution/src/receiver/mod.rs index 9193947e78d1..c38ca2133f54 100644 --- a/node/network/dispute-distribution/src/receiver/mod.rs +++ b/node/network/dispute-distribution/src/receiver/mod.rs @@ -16,6 +16,7 @@ use std::{ collections::HashSet, + num::NonZeroUsize, pin::Pin, task::{Context, Poll}, }; @@ -61,6 +62,11 @@ const COST_NOT_A_VALIDATOR: Rep = Rep::CostMajor("Reporting peer was not a valid /// How many statement imports we want to issue in parallel: pub const MAX_PARALLEL_IMPORTS: usize = 10; +const BANNED_PEERS_CACHE_SIZE: NonZeroUsize = match NonZeroUsize::new(MAX_PARALLEL_IMPORTS) { + Some(cap) => cap, + None => panic!("Banned peers cache size should not be 0."), +}; + /// State for handling incoming `DisputeRequest` messages. /// /// This is supposed to run as its own task in order to easily impose back pressure on the incoming @@ -146,7 +152,8 @@ where ) -> Self { let runtime = RuntimeInfo::new_with_config(runtime::Config { keystore: None, - session_cache_lru_size: DISPUTE_WINDOW.get() as usize, + session_cache_lru_size: NonZeroUsize::new(DISPUTE_WINDOW.get() as usize) + .expect("Dispute window can not be 0; qed"), }); Self { runtime, @@ -156,7 +163,7 @@ where pending_imports: PendingImports::new(), // Size of MAX_PARALLEL_IMPORTS ensures we are going to immediately get rid of any // malicious requests still pending in the incoming queue. - banned_peers: LruCache::new(MAX_PARALLEL_IMPORTS), + banned_peers: LruCache::new(BANNED_PEERS_CACHE_SIZE), metrics, } } @@ -222,7 +229,7 @@ where } // Wait for a free slot: - if self.pending_imports.len() >= MAX_PARALLEL_IMPORTS as usize { + if self.pending_imports.len() >= MAX_PARALLEL_IMPORTS { // Wait for one to finish: let r = self.pending_imports.next().await; self.ban_bad_peer(r.expect("pending_imports.len() is greater 0. qed."))?; diff --git a/node/overseer/Cargo.toml b/node/overseer/Cargo.toml index 0db382e4e783..4bc360df47e3 100644 --- a/node/overseer/Cargo.toml +++ b/node/overseer/Cargo.toml @@ -17,7 +17,7 @@ polkadot-node-metrics = { path = "../metrics" } polkadot-primitives = { path = "../../primitives" } orchestra = "0.0.2" gum = { package = "tracing-gum", path = "../gum" } -lru = "0.7" +lru = "0.8" parity-util-mem = { version = "0.11.0", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } async-trait = "0.1.57" diff --git a/node/overseer/src/lib.rs b/node/overseer/src/lib.rs index 1ce6a6fdb658..70dbe92b2432 100644 --- a/node/overseer/src/lib.rs +++ b/node/overseer/src/lib.rs @@ -62,6 +62,7 @@ use std::{ collections::{hash_map, HashMap}, fmt::{self, Debug}, + num::NonZeroUsize, pin::Pin, sync::Arc, time::Duration, @@ -112,7 +113,10 @@ pub use orchestra::{ /// Store 2 days worth of blocks, not accounting for forks, /// in the LRU cache. Assumes a 6-second block time. -pub const KNOWN_LEAVES_CACHE_SIZE: usize = 2 * 24 * 3600 / 6; +pub const KNOWN_LEAVES_CACHE_SIZE: NonZeroUsize = match NonZeroUsize::new(2 * 24 * 3600 / 6) { + Some(cap) => cap, + None => panic!("Known leaves cache size must be non-zero"), +}; #[cfg(test)] mod tests; diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index a9c9484b6eba..1d2613537814 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -73,7 +73,7 @@ kvdb = "0.11.0" kvdb-rocksdb = { version = "0.15.2", optional = true } parity-db = { version = "0.3.16", optional = true } async-trait = "0.1.57" -lru = "0.7" +lru = "0.8" # Polkadot polkadot-node-core-parachains-inherent = { path = "../core/parachains-inherent" } diff --git a/node/subsystem-util/Cargo.toml b/node/subsystem-util/Cargo.toml index a3985a898849..6f120beec7cb 100644 --- a/node/subsystem-util/Cargo.toml +++ b/node/subsystem-util/Cargo.toml @@ -17,7 +17,7 @@ thiserror = "1.0.31" fatality = "0.0.6" gum = { package = "tracing-gum", path = "../gum" } derive_more = "0.99.17" -lru = "0.7.7" +lru = "0.8.0" polkadot-node-subsystem = {path = "../subsystem" } polkadot-node-jaeger = { path = "../jaeger" } diff --git a/node/subsystem-util/src/runtime/mod.rs b/node/subsystem-util/src/runtime/mod.rs index fc660a9dc6df..7fcae2c57b09 100644 --- a/node/subsystem-util/src/runtime/mod.rs +++ b/node/subsystem-util/src/runtime/mod.rs @@ -16,7 +16,7 @@ //! Convenient interface to runtime information. -use std::cmp::max; +use std::num::NonZeroUsize; use lru::LruCache; @@ -52,7 +52,7 @@ pub struct Config { pub keystore: Option, /// How many sessions should we keep in the cache? - pub session_cache_lru_size: usize, + pub session_cache_lru_size: NonZeroUsize, } /// Caching of session info. @@ -95,7 +95,7 @@ impl Default for Config { Self { keystore: None, // Usually we need to cache the current and the last session. - session_cache_lru_size: 2, + session_cache_lru_size: NonZeroUsize::new(2).expect("2 is larger than 0; qed"), } } } @@ -109,7 +109,10 @@ impl RuntimeInfo { /// Create with more elaborate configuration options. pub fn new_with_config(cfg: Config) -> Self { Self { - session_index_cache: LruCache::new(max(10, cfg.session_cache_lru_size)), + session_index_cache: LruCache::new( + cfg.session_cache_lru_size + .max(NonZeroUsize::new(10).expect("10 is larger than 0; qed")), + ), session_info_cache: LruCache::new(cfg.session_cache_lru_size), keystore: cfg.keystore, } From b012597a7b18c0c82127d389a925822c48a348e2 Mon Sep 17 00:00:00 2001 From: Robert Klotzner Date: Tue, 4 Oct 2022 18:02:05 +0200 Subject: [PATCH 23/49] Batch vote import in dispute-distribution (#5894) * Start work on batching in dispute-distribution. * Guide work. * More guide changes. Still very much WIP. * Finish guide changes. * Clarification * Adjust argument about slashing. * WIP: Add constants to receiver. * Maintain order of disputes. * dispute-distribuion sender Rate limit. * Cleanup * WIP: dispute-distribution receiver. - [ ] Rate limiting - [ ] Batching * WIP: Batching. * fmt * Update `PeerQueues` to maintain more invariants. * WIP: Batching. * Small cleanup * Batching logic. * Some integration work. * Finish. Missing: Tests * Typo. * Docs. * Report missing metric. * Doc pass. * Tests for waiting_queue. * Speed up some crypto by 10x. * Fix redundant import. * Add some tracing. * Better sender rate limit * Some tests. * Tests * Add logging to rate limiter * Update roadmap/implementers-guide/src/node/disputes/dispute-distribution.md Co-authored-by: Tsvetomir Dimitrov * Update roadmap/implementers-guide/src/node/disputes/dispute-distribution.md Co-authored-by: Tsvetomir Dimitrov * Update node/network/dispute-distribution/src/receiver/mod.rs Co-authored-by: Tsvetomir Dimitrov * Review feedback. * Also log peer in log messages. * Fix indentation. * waker -> timer * Guide improvement. * Remove obsolete comment. * waker -> timer * Fix spell complaints. * Fix Cargo.lock Co-authored-by: Tsvetomir Dimitrov --- Cargo.lock | 1 + Cargo.toml | 7 +- node/network/dispute-distribution/Cargo.toml | 2 + node/network/dispute-distribution/src/lib.rs | 38 +- .../dispute-distribution/src/metrics.rs | 7 +- .../src/receiver/batches/batch.rs | 209 +++++++ .../src/receiver/batches/mod.rs | 170 ++++++ .../src/receiver/batches/waiting_queue.rs | 204 +++++++ .../src/receiver/error.rs | 25 +- .../dispute-distribution/src/receiver/mod.rs | 510 +++++++++++------- .../src/receiver/peer_queues.rs | 141 +++++ .../dispute-distribution/src/sender/mod.rs | 110 +++- .../src/sender/send_task.rs | 30 +- .../dispute-distribution/src/tests/mock.rs | 28 +- .../dispute-distribution/src/tests/mod.rs | 453 ++++++++++++---- .../protocol/src/request_response/mod.rs | 8 +- .../src/node/disputes/dispute-distribution.md | 309 ++++++----- 17 files changed, 1783 insertions(+), 469 deletions(-) create mode 100644 node/network/dispute-distribution/src/receiver/batches/batch.rs create mode 100644 node/network/dispute-distribution/src/receiver/batches/mod.rs create mode 100644 node/network/dispute-distribution/src/receiver/batches/waiting_queue.rs create mode 100644 node/network/dispute-distribution/src/receiver/peer_queues.rs diff --git a/Cargo.lock b/Cargo.lock index 6e86aa901131..35cfaf7e9228 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6334,6 +6334,7 @@ dependencies = [ "fatality", "futures", "futures-timer", + "indexmap", "lazy_static", "lru 0.8.0", "parity-scale-codec", diff --git a/Cargo.toml b/Cargo.toml index ee886dafdc8a..c7edd0621319 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -125,9 +125,9 @@ maintenance = { status = "actively-developed" } # # This list is ordered alphabetically. [profile.dev.package] -blake2b_simd = { opt-level = 3 } blake2 = { opt-level = 3 } blake2-rfc = { opt-level = 3 } +blake2b_simd = { opt-level = 3 } chacha20poly1305 = { opt-level = 3 } cranelift-codegen = { opt-level = 3 } cranelift-wasm = { opt-level = 3 } @@ -138,8 +138,8 @@ curve25519-dalek = { opt-level = 3 } ed25519-dalek = { opt-level = 3 } flate2 = { opt-level = 3 } futures-channel = { opt-level = 3 } -hashbrown = { opt-level = 3 } hash-db = { opt-level = 3 } +hashbrown = { opt-level = 3 } hmac = { opt-level = 3 } httparse = { opt-level = 3 } integer-sqrt = { opt-level = 3 } @@ -151,8 +151,8 @@ libz-sys = { opt-level = 3 } mio = { opt-level = 3 } nalgebra = { opt-level = 3 } num-bigint = { opt-level = 3 } -parking_lot_core = { opt-level = 3 } parking_lot = { opt-level = 3 } +parking_lot_core = { opt-level = 3 } percent-encoding = { opt-level = 3 } primitive-types = { opt-level = 3 } reed-solomon-novelpoly = { opt-level = 3 } @@ -162,6 +162,7 @@ sha2 = { opt-level = 3 } sha3 = { opt-level = 3 } smallvec = { opt-level = 3 } snow = { opt-level = 3 } +substrate-bip39 = {opt-level = 3} twox-hash = { opt-level = 3 } uint = { opt-level = 3 } wasmi = { opt-level = 3 } diff --git a/node/network/dispute-distribution/Cargo.toml b/node/network/dispute-distribution/Cargo.toml index c37f26f7bece..a731175f0521 100644 --- a/node/network/dispute-distribution/Cargo.toml +++ b/node/network/dispute-distribution/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [dependencies] futures = "0.3.21" +futures-timer = "3.0.2" gum = { package = "tracing-gum", path = "../../gum" } derive_more = "0.99.17" parity-scale-codec = { version = "3.1.5", features = ["std"] } @@ -21,6 +22,7 @@ sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "maste thiserror = "1.0.31" fatality = "0.0.6" lru = "0.8.0" +indexmap = "1.9.1" [dev-dependencies] async-trait = "0.1.57" diff --git a/node/network/dispute-distribution/src/lib.rs b/node/network/dispute-distribution/src/lib.rs index 440b70b786d5..f109d5e6a40e 100644 --- a/node/network/dispute-distribution/src/lib.rs +++ b/node/network/dispute-distribution/src/lib.rs @@ -24,7 +24,7 @@ //! The sender is responsible for getting our vote out, see [`sender`]. The receiver handles //! incoming [`DisputeRequest`]s and offers spam protection, see [`receiver`]. -use std::num::NonZeroUsize; +use std::{num::NonZeroUsize, time::Duration}; use futures::{channel::mpsc, FutureExt, StreamExt, TryFutureExt}; @@ -66,16 +66,19 @@ use self::sender::{DisputeSender, TaskFinish}; /// via a dedicated channel and forwarding them to the dispute coordinator via /// `DisputeCoordinatorMessage::ImportStatements`. Being the interface to the network and untrusted /// nodes, the reality is not that simple of course. Before importing statements the receiver will -/// make sure as good as it can to filter out malicious/unwanted/spammy requests. For this it does -/// the following: +/// batch up imports as well as possible for efficient imports while maintaining timely dispute +/// resolution and handling of spamming validators: /// /// - Drop all messages from non validator nodes, for this it requires the [`AuthorityDiscovery`] /// service. -/// - Drop messages from a node, if we are already importing a message from that node (flood). -/// - Drop messages from nodes, that provided us messages where the statement import failed. +/// - Drop messages from a node, if it sends at a too high rate. +/// - Filter out duplicate messages (over some period of time). /// - Drop any obviously invalid votes (invalid signatures for example). /// - Ban peers whose votes were deemed invalid. /// +/// In general dispute-distribution works on limiting the work the dispute-coordinator will have to +/// do, while at the same time making it aware of new disputes as fast as possible. +/// /// For successfully imported votes, we will confirm the receipt of the message back to the sender. /// This way a received confirmation guarantees, that the vote has been stored to disk by the /// receiver. @@ -95,6 +98,20 @@ pub use metrics::Metrics; const LOG_TARGET: &'static str = "parachain::dispute-distribution"; +/// Rate limit on the `receiver` side. +/// +/// If messages from one peer come in at a higher rate than every `RECEIVE_RATE_LIMIT` on average, we +/// start dropping messages from that peer to enforce that limit. +pub const RECEIVE_RATE_LIMIT: Duration = Duration::from_millis(100); + +/// Rate limit on the `sender` side. +/// +/// In order to not hit the `RECEIVE_RATE_LIMIT` on the receiving side, we limit out sending rate as +/// well. +/// +/// We add 50ms extra, just to have some save margin to the `RECEIVE_RATE_LIMIT`. +pub const SEND_RATE_LIMIT: Duration = RECEIVE_RATE_LIMIT.saturating_add(Duration::from_millis(50)); + /// The dispute distribution subsystem. pub struct DisputeDistributionSubsystem { /// Easy and efficient runtime access for this subsystem. @@ -175,6 +192,12 @@ where ctx.spawn("disputes-receiver", receiver.run().boxed()) .map_err(FatalError::SpawnTask)?; + // Process messages for sending side. + // + // Note: We want the sender to be rate limited and we are currently taking advantage of the + // fact that the root task of this subsystem is only concerned with sending: Functions of + // `DisputeSender` might back pressure if the rate limit is hit, which will slow down this + // loop. If this fact ever changes, we will likely need another task. loop { let message = MuxedMessage::receive(&mut ctx, &mut self.sender_rx).await; match message { @@ -250,9 +273,10 @@ impl MuxedMessage { // ends. let from_overseer = ctx.recv().fuse(); futures::pin_mut!(from_overseer, from_sender); - futures::select!( - msg = from_overseer => MuxedMessage::Subsystem(msg.map_err(FatalError::SubsystemReceive)), + // We select biased to make sure we finish up loose ends, before starting new work. + futures::select_biased!( msg = from_sender.next() => MuxedMessage::Sender(msg), + msg = from_overseer => MuxedMessage::Subsystem(msg.map_err(FatalError::SubsystemReceive)), ) } } diff --git a/node/network/dispute-distribution/src/metrics.rs b/node/network/dispute-distribution/src/metrics.rs index 3f717bd105c3..aa2feeaad3a0 100644 --- a/node/network/dispute-distribution/src/metrics.rs +++ b/node/network/dispute-distribution/src/metrics.rs @@ -72,9 +72,12 @@ impl Metrics { } /// Statements have been imported. - pub fn on_imported(&self, label: &'static str) { + pub fn on_imported(&self, label: &'static str, num_requests: usize) { if let Some(metrics) = &self.0 { - metrics.imported_requests.with_label_values(&[label]).inc() + metrics + .imported_requests + .with_label_values(&[label]) + .inc_by(num_requests as u64) } } diff --git a/node/network/dispute-distribution/src/receiver/batches/batch.rs b/node/network/dispute-distribution/src/receiver/batches/batch.rs new file mode 100644 index 000000000000..eebed25ed790 --- /dev/null +++ b/node/network/dispute-distribution/src/receiver/batches/batch.rs @@ -0,0 +1,209 @@ +// Copyright 2022 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 . + +use std::{collections::HashMap, time::Instant}; + +use gum::CandidateHash; +use polkadot_node_network_protocol::{ + request_response::{incoming::OutgoingResponseSender, v1::DisputeRequest}, + PeerId, +}; +use polkadot_node_primitives::SignedDisputeStatement; +use polkadot_primitives::v2::{CandidateReceipt, ValidatorIndex}; + +use crate::receiver::{BATCH_COLLECTING_INTERVAL, MIN_KEEP_BATCH_ALIVE_VOTES}; + +use super::MAX_BATCH_LIFETIME; + +/// A batch of votes to be imported into the `dispute-coordinator`. +/// +/// Vote imports are way more efficient when performed in batches, hence we batch together incoming +/// votes until the rate of incoming votes falls below a threshold, then we import into the dispute +/// coordinator. +/// +/// A `Batch` keeps track of the votes to be imported and the current incoming rate, on rate update +/// it will "flush" in case the incoming rate dropped too low, preparing the import. +pub struct Batch { + /// The actual candidate this batch is concerned with. + candidate_receipt: CandidateReceipt, + + /// Cache of `CandidateHash` (candidate_receipt.hash()). + candidate_hash: CandidateHash, + + /// All valid votes received in this batch so far. + /// + /// We differentiate between valid and invalid votes, so we can detect (and drop) duplicates, + /// while still allowing validators to equivocate. + /// + /// Detecting and rejecting duplicates is crucial in order to effectively enforce + /// `MIN_KEEP_BATCH_ALIVE_VOTES` per `BATCH_COLLECTING_INTERVAL`. If we would count duplicates + /// here, the mechanism would be broken. + valid_votes: HashMap, + + /// All invalid votes received in this batch so far. + invalid_votes: HashMap, + + /// How many votes have been batched since the last tick/creation. + votes_batched_since_last_tick: u32, + + /// Expiry time for the batch. + /// + /// By this time the latest this batch will get flushed. + best_before: Instant, + + /// Requesters waiting for a response. + requesters: Vec<(PeerId, OutgoingResponseSender)>, +} + +/// Result of checking a batch every `BATCH_COLLECTING_INTERVAL`. +pub(super) enum TickResult { + /// Batch is still alive, please call `tick` again at the given `Instant`. + Alive(Batch, Instant), + /// Batch is done, ready for import! + Done(PreparedImport), +} + +/// Ready for import. +pub struct PreparedImport { + pub candidate_receipt: CandidateReceipt, + pub statements: Vec<(SignedDisputeStatement, ValidatorIndex)>, + /// Information about original requesters. + pub requesters: Vec<(PeerId, OutgoingResponseSender)>, +} + +impl From for PreparedImport { + fn from(batch: Batch) -> Self { + let Batch { + candidate_receipt, + valid_votes, + invalid_votes, + requesters: pending_responses, + .. + } = batch; + + let statements = valid_votes + .into_iter() + .chain(invalid_votes.into_iter()) + .map(|(index, statement)| (statement, index)) + .collect(); + + Self { candidate_receipt, statements, requesters: pending_responses } + } +} + +impl Batch { + /// Create a new empty batch based on the given `CandidateReceipt`. + /// + /// To create a `Batch` use Batches::find_batch`. + /// + /// Arguments: + /// + /// * `candidate_receipt` - The candidate this batch is meant to track votes for. + /// * `now` - current time stamp for calculating the first tick. + /// + /// Returns: A batch and the first `Instant` you are supposed to call `tick`. + pub(super) fn new(candidate_receipt: CandidateReceipt, now: Instant) -> (Self, Instant) { + let s = Self { + candidate_hash: candidate_receipt.hash(), + candidate_receipt, + valid_votes: HashMap::new(), + invalid_votes: HashMap::new(), + votes_batched_since_last_tick: 0, + best_before: Instant::now() + MAX_BATCH_LIFETIME, + requesters: Vec::new(), + }; + let next_tick = s.calculate_next_tick(now); + (s, next_tick) + } + + /// Receipt of the candidate this batch is batching votes for. + pub fn candidate_receipt(&self) -> &CandidateReceipt { + &self.candidate_receipt + } + + /// Add votes from a validator into the batch. + /// + /// The statements are supposed to be the valid and invalid statements received in a + /// `DisputeRequest`. + /// + /// The given `pending_response` is the corresponding response sender for responding to `peer`. + /// If at least one of the votes is new as far as this batch is concerned we record the + /// pending_response, for later use. In case both votes are known already, we return the + /// response sender as an `Err` value. + pub fn add_votes( + &mut self, + valid_vote: (SignedDisputeStatement, ValidatorIndex), + invalid_vote: (SignedDisputeStatement, ValidatorIndex), + peer: PeerId, + pending_response: OutgoingResponseSender, + ) -> Result<(), OutgoingResponseSender> { + debug_assert!(valid_vote.0.candidate_hash() == invalid_vote.0.candidate_hash()); + debug_assert!(valid_vote.0.candidate_hash() == &self.candidate_hash); + + let mut duplicate = true; + + if self.valid_votes.insert(valid_vote.1, valid_vote.0).is_none() { + self.votes_batched_since_last_tick += 1; + duplicate = false; + } + if self.invalid_votes.insert(invalid_vote.1, invalid_vote.0).is_none() { + self.votes_batched_since_last_tick += 1; + duplicate = false; + } + + if duplicate { + Err(pending_response) + } else { + self.requesters.push((peer, pending_response)); + Ok(()) + } + } + + /// Check batch for liveness. + /// + /// This function is supposed to be called at instants given at construction and as returned as + /// part of `TickResult`. + pub(super) fn tick(mut self, now: Instant) -> TickResult { + if self.votes_batched_since_last_tick >= MIN_KEEP_BATCH_ALIVE_VOTES && + now < self.best_before + { + // Still good: + let next_tick = self.calculate_next_tick(now); + // Reset counter: + self.votes_batched_since_last_tick = 0; + TickResult::Alive(self, next_tick) + } else { + TickResult::Done(PreparedImport::from(self)) + } + } + + /// Calculate when the next tick should happen. + /// + /// This will usually return `now + BATCH_COLLECTING_INTERVAL`, except if the lifetime of this batch + /// would exceed `MAX_BATCH_LIFETIME`. + /// + /// # Arguments + /// + /// * `now` - The current time. + fn calculate_next_tick(&self, now: Instant) -> Instant { + let next_tick = now + BATCH_COLLECTING_INTERVAL; + if next_tick < self.best_before { + next_tick + } else { + self.best_before + } + } +} diff --git a/node/network/dispute-distribution/src/receiver/batches/mod.rs b/node/network/dispute-distribution/src/receiver/batches/mod.rs new file mode 100644 index 000000000000..b343b55e0b04 --- /dev/null +++ b/node/network/dispute-distribution/src/receiver/batches/mod.rs @@ -0,0 +1,170 @@ +// Copyright 2022 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 . + +use std::{ + collections::{hash_map, HashMap}, + time::{Duration, Instant}, +}; + +use futures::future::pending; + +use polkadot_node_network_protocol::request_response::DISPUTE_REQUEST_TIMEOUT; +use polkadot_primitives::v2::{CandidateHash, CandidateReceipt}; + +use crate::{ + receiver::batches::{batch::TickResult, waiting_queue::PendingWake}, + LOG_TARGET, +}; + +pub use self::batch::{Batch, PreparedImport}; +use self::waiting_queue::WaitingQueue; + +use super::{ + error::{JfyiError, JfyiResult}, + BATCH_COLLECTING_INTERVAL, +}; + +/// A single batch (per candidate) as managed by `Batches`. +mod batch; + +/// Queue events in time and wait for them to become ready. +mod waiting_queue; + +/// Safe-guard in case votes trickle in real slow. +/// +/// If the batch life time exceeded the time the sender is willing to wait for a confirmation, we +/// would trigger pointless re-sends. +const MAX_BATCH_LIFETIME: Duration = DISPUTE_REQUEST_TIMEOUT.saturating_sub(Duration::from_secs(2)); + +/// Limit the number of batches that can be alive at any given time. +/// +/// Reasoning for this number, see guide. +pub const MAX_BATCHES: usize = 1000; + +/// Manage batches. +/// +/// - Batches can be found via `find_batch()` in order to add votes to them/check they exist. +/// - Batches can be checked for being ready for flushing in order to import contained votes. +pub struct Batches { + /// The batches we manage. + /// + /// Kept invariants: + /// For each entry in `batches`, there exists an entry in `waiting_queue` as well - we wait on + /// all batches! + batches: HashMap, + /// Waiting queue for waiting for batches to become ready for `tick`. + /// + /// Kept invariants by `Batches`: + /// For each entry in the `waiting_queue` there exists a corresponding entry in `batches`. + waiting_queue: WaitingQueue, +} + +/// A found batch is either really found or got created so it can be found. +pub enum FoundBatch<'a> { + /// Batch just got created. + Created(&'a mut Batch), + /// Batch already existed. + Found(&'a mut Batch), +} + +impl Batches { + /// Create new empty `Batches`. + pub fn new() -> Self { + debug_assert!( + MAX_BATCH_LIFETIME > BATCH_COLLECTING_INTERVAL, + "Unexpectedly low `MAX_BATCH_LIFETIME`, please check parameters." + ); + Self { batches: HashMap::new(), waiting_queue: WaitingQueue::new() } + } + + /// Find a particular batch. + /// + /// That is either find it, or we create it as reflected by the result `FoundBatch`. + pub fn find_batch( + &mut self, + candidate_hash: CandidateHash, + candidate_receipt: CandidateReceipt, + ) -> JfyiResult { + if self.batches.len() >= MAX_BATCHES { + return Err(JfyiError::MaxBatchLimitReached) + } + debug_assert!(candidate_hash == candidate_receipt.hash()); + let result = match self.batches.entry(candidate_hash) { + hash_map::Entry::Vacant(vacant) => { + let now = Instant::now(); + let (created, ready_at) = Batch::new(candidate_receipt, now); + let pending_wake = PendingWake { payload: candidate_hash, ready_at }; + self.waiting_queue.push(pending_wake); + FoundBatch::Created(vacant.insert(created)) + }, + hash_map::Entry::Occupied(occupied) => FoundBatch::Found(occupied.into_mut()), + }; + Ok(result) + } + + /// Wait for the next `tick` to check for ready batches. + /// + /// This function blocks (returns `Poll::Pending`) until at least one batch can be + /// checked for readiness meaning that `BATCH_COLLECTING_INTERVAL` has passed since the last + /// check for that batch or it reached end of life. + /// + /// If this `Batches` instance is empty (does not actually contain any batches), then this + /// function will always return `Poll::Pending`. + /// + /// Returns: A `Vec` of all `PreparedImport`s from batches that became ready. + pub async fn check_batches(&mut self) -> Vec { + let now = Instant::now(); + + let mut imports = Vec::new(); + + // Wait for at least one batch to become ready: + self.waiting_queue.wait_ready(now).await; + + // Process all ready entries: + while let Some(wake) = self.waiting_queue.pop_ready(now) { + let batch = self.batches.remove(&wake.payload); + debug_assert!( + batch.is_some(), + "Entries referenced in `waiting_queue` are supposed to exist!" + ); + let batch = match batch { + None => return pending().await, + Some(batch) => batch, + }; + match batch.tick(now) { + TickResult::Done(import) => { + gum::trace!( + target: LOG_TARGET, + candidate_hash = ?wake.payload, + "Batch became ready." + ); + imports.push(import); + }, + TickResult::Alive(old_batch, next_tick) => { + gum::trace!( + target: LOG_TARGET, + candidate_hash = ?wake.payload, + "Batch found to be still alive on check." + ); + let pending_wake = PendingWake { payload: wake.payload, ready_at: next_tick }; + self.waiting_queue.push(pending_wake); + self.batches.insert(wake.payload, old_batch); + }, + } + } + imports + } +} diff --git a/node/network/dispute-distribution/src/receiver/batches/waiting_queue.rs b/node/network/dispute-distribution/src/receiver/batches/waiting_queue.rs new file mode 100644 index 000000000000..995dc74d358f --- /dev/null +++ b/node/network/dispute-distribution/src/receiver/batches/waiting_queue.rs @@ -0,0 +1,204 @@ +// Copyright 2022 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 . + +use std::{cmp::Ordering, collections::BinaryHeap, time::Instant}; + +use futures::future::pending; +use futures_timer::Delay; + +/// Wait asynchronously for given `Instant`s one after the other. +/// +/// `PendingWake`s can be inserted and `WaitingQueue` makes `wait_ready()` to always wait for the +/// next `Instant` in the queue. +pub struct WaitingQueue { + /// All pending wakes we are supposed to wait on in order. + pending_wakes: BinaryHeap>, + /// Wait for next `PendingWake`. + timer: Option, +} + +/// Represents some event waiting to be processed at `ready_at`. +/// +/// This is an event in `WaitingQueue`. It provides an `Ord` instance, that sorts descending with +/// regard to `Instant` (so we get a `min-heap` with the earliest `Instant` at the top). +#[derive(Eq, PartialEq)] +pub struct PendingWake { + pub payload: Payload, + pub ready_at: Instant, +} + +impl WaitingQueue { + /// Get a new empty `WaitingQueue`. + /// + /// If you call `pop` on this queue immediately, it will always return `Poll::Pending`. + pub fn new() -> Self { + Self { pending_wakes: BinaryHeap::new(), timer: None } + } + + /// Push a `PendingWake`. + /// + /// The next call to `wait_ready` will make sure to wake soon enough to process that new event in a + /// timely manner. + pub fn push(&mut self, wake: PendingWake) { + self.pending_wakes.push(wake); + // Reset timer as it is potentially obsolete now: + self.timer = None; + } + + /// Pop the next ready item. + /// + /// This function does not wait, if nothing is ready right now as determined by the passed + /// `now` time stamp, this function simply returns `None`. + pub fn pop_ready(&mut self, now: Instant) -> Option> { + let is_ready = self.pending_wakes.peek().map_or(false, |p| p.ready_at <= now); + if is_ready { + Some(self.pending_wakes.pop().expect("We just peeked. qed.")) + } else { + None + } + } + + /// Don't pop, just wait until something is ready. + /// + /// Once this function returns `Poll::Ready(())` `pop_ready()` will return `Some`, if passed + /// the same `Instant`. + /// + /// Whether ready or not is determined based on the passed time stamp `now` which should be the + /// current time as returned by `Instant::now()` + /// + /// This function waits asynchronously for an item to become ready. If there is no more item, + /// this call will wait forever (return Poll::Pending without scheduling a wake). + pub async fn wait_ready(&mut self, now: Instant) { + if let Some(timer) = &mut self.timer { + // Previous timer was not done yet. + timer.await + } + + let next_waiting = self.pending_wakes.peek(); + let is_ready = next_waiting.map_or(false, |p| p.ready_at <= now); + if is_ready { + return + } + + self.timer = next_waiting.map(|p| Delay::new(p.ready_at.duration_since(now))); + match &mut self.timer { + None => return pending().await, + Some(timer) => timer.await, + } + } +} + +impl PartialOrd> for PendingWake { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } +} + +impl Ord for PendingWake { + fn cmp(&self, other: &Self) -> Ordering { + // Reverse order for min-heap: + match other.ready_at.cmp(&self.ready_at) { + Ordering::Equal => other.payload.cmp(&self.payload), + o => o, + } + } +} +#[cfg(test)] +mod tests { + use std::{ + task::Poll, + time::{Duration, Instant}, + }; + + use assert_matches::assert_matches; + use futures::{future::poll_fn, pin_mut, Future}; + + use crate::LOG_TARGET; + + use super::{PendingWake, WaitingQueue}; + + #[test] + fn wait_ready_waits_for_earliest_event_always() { + sp_tracing::try_init_simple(); + let mut queue = WaitingQueue::new(); + let now = Instant::now(); + let start = now; + queue.push(PendingWake { payload: 1u32, ready_at: now + Duration::from_millis(3) }); + // Push another one in order: + queue.push(PendingWake { payload: 2u32, ready_at: now + Duration::from_millis(5) }); + // Push one out of order: + queue.push(PendingWake { payload: 0u32, ready_at: now + Duration::from_millis(1) }); + // Push another one at same timestamp (should become ready at the same time) + queue.push(PendingWake { payload: 10u32, ready_at: now + Duration::from_millis(1) }); + + futures::executor::block_on(async move { + // No time passed yet - nothing should be ready. + assert!(queue.pop_ready(now).is_none(), "No time has passed, nothing should be ready"); + + // Receive them in order at expected times: + queue.wait_ready(now).await; + gum::trace!(target: LOG_TARGET, "After first wait."); + + let now = start + Duration::from_millis(1); + assert!(Instant::now() - start >= Duration::from_millis(1)); + assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(0u32)); + // One more should be ready: + assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(10u32)); + assert!(queue.pop_ready(now).is_none(), "No more entry expected to be ready."); + + queue.wait_ready(now).await; + gum::trace!(target: LOG_TARGET, "After second wait."); + let now = start + Duration::from_millis(3); + assert!(Instant::now() - start >= Duration::from_millis(3)); + assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(1u32)); + assert!(queue.pop_ready(now).is_none(), "No more entry expected to be ready."); + + // Push in between wait: + poll_fn(|cx| { + let fut = queue.wait_ready(now); + pin_mut!(fut); + assert_matches!(fut.poll(cx), Poll::Pending); + Poll::Ready(()) + }) + .await; + queue.push(PendingWake { payload: 3u32, ready_at: start + Duration::from_millis(4) }); + + queue.wait_ready(now).await; + // Newly pushed element should have become ready: + gum::trace!(target: LOG_TARGET, "After third wait."); + let now = start + Duration::from_millis(4); + assert!(Instant::now() - start >= Duration::from_millis(4)); + assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(3u32)); + assert!(queue.pop_ready(now).is_none(), "No more entry expected to be ready."); + + queue.wait_ready(now).await; + gum::trace!(target: LOG_TARGET, "After fourth wait."); + let now = start + Duration::from_millis(5); + assert!(Instant::now() - start >= Duration::from_millis(5)); + assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(2u32)); + assert!(queue.pop_ready(now).is_none(), "No more entry expected to be ready."); + + // queue empty - should wait forever now: + poll_fn(|cx| { + let fut = queue.wait_ready(now); + pin_mut!(fut); + assert_matches!(fut.poll(cx), Poll::Pending); + Poll::Ready(()) + }) + .await; + }); + } +} diff --git a/node/network/dispute-distribution/src/receiver/error.rs b/node/network/dispute-distribution/src/receiver/error.rs index ce578cc8e0f9..4477335440d0 100644 --- a/node/network/dispute-distribution/src/receiver/error.rs +++ b/node/network/dispute-distribution/src/receiver/error.rs @@ -19,8 +19,10 @@ use fatality::Nested; +use gum::CandidateHash; use polkadot_node_network_protocol::{request_response::incoming, PeerId}; use polkadot_node_subsystem_util::runtime; +use polkadot_primitives::v2::AuthorityDiscoveryId; use crate::LOG_TARGET; @@ -35,8 +37,8 @@ pub enum Error { #[error("Retrieving next incoming request failed.")] IncomingRequest(#[from] incoming::Error), - #[error("Sending back response to peer {0} failed.")] - SendResponse(PeerId), + #[error("Sending back response to peers {0:#?} failed.")] + SendResponses(Vec), #[error("Changing peer's ({0}) reputation failed.")] SetPeerReputation(PeerId), @@ -44,16 +46,29 @@ pub enum Error { #[error("Dispute request with invalid signatures, from peer {0}.")] InvalidSignature(PeerId), - #[error("Import of dispute got canceled for peer {0} - import failed for some reason.")] - ImportCanceled(PeerId), + #[error("Received votes from peer {0} have been completely redundant.")] + RedundantMessage(PeerId), + + #[error("Import of dispute got canceled for candidate {0} - import failed for some reason.")] + ImportCanceled(CandidateHash), #[error("Peer {0} attempted to participate in dispute and is not a validator.")] NotAValidator(PeerId), + + #[error("Force flush for batch that could not be found attempted, candidate hash: {0}")] + ForceFlushBatchDoesNotExist(CandidateHash), + + // Should never happen in practice: + #[error("We needed to drop messages, because we reached limit on concurrent batches.")] + MaxBatchLimitReached, + + #[error("Authority {0} sent messages at a too high rate.")] + AuthorityFlooding(AuthorityDiscoveryId), } pub type Result = std::result::Result; -pub type JfyiErrorResult = std::result::Result; +pub type JfyiResult = std::result::Result; /// Utility for eating top level errors and log them. /// diff --git a/node/network/dispute-distribution/src/receiver/mod.rs b/node/network/dispute-distribution/src/receiver/mod.rs index c38ca2133f54..158c66e20655 100644 --- a/node/network/dispute-distribution/src/receiver/mod.rs +++ b/node/network/dispute-distribution/src/receiver/mod.rs @@ -15,21 +15,21 @@ // along with Polkadot. If not, see . use std::{ - collections::HashSet, num::NonZeroUsize, pin::Pin, task::{Context, Poll}, + time::Duration, }; use futures::{ channel::oneshot, - future::{poll_fn, BoxFuture}, + future::poll_fn, pin_mut, - stream::{FusedStream, FuturesUnordered, StreamExt}, - Future, FutureExt, Stream, + stream::{FuturesUnordered, StreamExt}, + Future, }; -use lru::LruCache; +use gum::CandidateHash; use polkadot_node_network_protocol::{ authority_discovery::AuthorityDiscovery, request_response::{ @@ -52,25 +52,47 @@ use crate::{ }; mod error; -use self::error::{log_error, JfyiError, JfyiErrorResult, Result}; + +/// Rate limiting queues for incoming requests by peers. +mod peer_queues; + +/// Batch imports together. +mod batches; + +use self::{ + batches::{Batches, FoundBatch, PreparedImport}, + error::{log_error, JfyiError, JfyiResult, Result}, + peer_queues::PeerQueues, +}; const COST_INVALID_REQUEST: Rep = Rep::CostMajor("Received message could not be decoded."); const COST_INVALID_SIGNATURE: Rep = Rep::Malicious("Signatures were invalid."); -const COST_INVALID_CANDIDATE: Rep = Rep::Malicious("Reported candidate was not available."); +const COST_INVALID_IMPORT: Rep = + Rep::Malicious("Import was deemed invalid by dispute-coordinator."); const COST_NOT_A_VALIDATOR: Rep = Rep::CostMajor("Reporting peer was not a validator."); +/// Mildly punish peers exceeding their rate limit. +/// +/// For honest peers this should rarely happen, but if it happens we would not want to disconnect +/// too quickly. Minor cost should suffice for disconnecting any real flooder. +const COST_APPARENT_FLOOD: Rep = Rep::CostMinor("Peer exceeded the rate limit."); -/// How many statement imports we want to issue in parallel: -pub const MAX_PARALLEL_IMPORTS: usize = 10; +/// How many votes must have arrived in the last `BATCH_COLLECTING_INTERVAL` +/// +/// in order for a batch to stay alive and not get flushed/imported to the dispute-coordinator. +/// +/// This ensures a timely import of batches. +#[cfg(not(test))] +pub const MIN_KEEP_BATCH_ALIVE_VOTES: u32 = 10; +#[cfg(test)] +pub const MIN_KEEP_BATCH_ALIVE_VOTES: u32 = 2; -const BANNED_PEERS_CACHE_SIZE: NonZeroUsize = match NonZeroUsize::new(MAX_PARALLEL_IMPORTS) { - Some(cap) => cap, - None => panic!("Banned peers cache size should not be 0."), -}; +/// Time we allow to pass for new votes to trickle in. +/// +/// See `MIN_KEEP_BATCH_ALIVE_VOTES` above. +/// Should be greater or equal to `RECEIVE_RATE_LIMIT` (there is no point in checking any faster). +pub const BATCH_COLLECTING_INTERVAL: Duration = Duration::from_millis(500); /// State for handling incoming `DisputeRequest` messages. -/// -/// This is supposed to run as its own task in order to easily impose back pressure on the incoming -/// request channel and at the same time to drop flood messages as fast as possible. pub struct DisputesReceiver { /// Access to session information. runtime: RuntimeInfo, @@ -81,18 +103,17 @@ pub struct DisputesReceiver { /// Channel to retrieve incoming requests from. receiver: IncomingRequestReceiver, + /// Rate limiting queue for each peer (only authorities). + peer_queues: PeerQueues, + + /// Currently active batches of imports per candidate. + batches: Batches, + /// Authority discovery service: authority_discovery: AD, - /// Imports currently being processed. - pending_imports: PendingImports, - - /// We keep record of the last banned peers. - /// - /// This is needed because once we ban a peer, we will very likely still have pending requests - /// in the incoming channel - we should not waste time recovering availability for those, as we - /// already know the peer is malicious. - banned_peers: LruCache, + /// Imports currently being processed by the `dispute-coordinator`. + pending_imports: FuturesUnordered, /// Log received requests. metrics: Metrics, @@ -106,36 +127,24 @@ enum MuxedMessage { /// /// - We need to make sure responses are actually sent (therefore we need to await futures /// promptly). - /// - We need to update `banned_peers` accordingly to the result. - ConfirmedImport(JfyiErrorResult<(PeerId, ImportStatementsResult)>), + /// - We need to punish peers whose import got rejected. + ConfirmedImport(ImportResult), /// A new request has arrived and should be handled. NewRequest(IncomingRequest), -} -impl MuxedMessage { - async fn receive( - pending_imports: &mut PendingImports, - pending_requests: &mut IncomingRequestReceiver, - ) -> Result { - poll_fn(|ctx| { - let next_req = pending_requests.recv(|| vec![COST_INVALID_REQUEST]); - pin_mut!(next_req); - if let Poll::Ready(r) = next_req.poll(ctx) { - return match r { - Err(e) => Poll::Ready(Err(incoming::Error::from(e).into())), - Ok(v) => Poll::Ready(Ok(Self::NewRequest(v))), - } - } - // In case of Ready(None) return `Pending` below - we want to wait for the next request - // in that case. - if let Poll::Ready(Some(v)) = pending_imports.poll_next_unpin(ctx) { - return Poll::Ready(Ok(Self::ConfirmedImport(v))) - } - Poll::Pending - }) - .await - } + /// Rate limit timer hit - is is time to process one row of messages. + /// + /// This is the result of calling `self.peer_queues.pop_reqs()`. + WakePeerQueuesPopReqs(Vec>), + + /// It is time to check batches. + /// + /// Every `BATCH_COLLECTING_INTERVAL` we check whether less than `MIN_KEEP_BATCH_ALIVE_VOTES` + /// new votes arrived, if so the batch is ready for import. + /// + /// This is the result of calling `self.batches.check_batches()`. + WakeCheckBatches(Vec), } impl DisputesReceiver @@ -159,11 +168,10 @@ where runtime, sender, receiver, + peer_queues: PeerQueues::new(), + batches: Batches::new(), authority_discovery, - pending_imports: PendingImports::new(), - // Size of MAX_PARALLEL_IMPORTS ensures we are going to immediately get rid of any - // malicious requests still pending in the incoming queue. - banned_peers: LruCache::new(BANNED_PEERS_CACHE_SIZE), + pending_imports: FuturesUnordered::new(), metrics, } } @@ -187,60 +195,132 @@ where } } - /// Actual work happening here. + /// Actual work happening here in three phases: + /// + /// 1. Receive and queue incoming messages until the rate limit timer hits. + /// 2. Do import/batching for the head of all queues. + /// 3. Check and flush any ready batches. async fn run_inner(&mut self) -> Result<()> { - let msg = MuxedMessage::receive(&mut self.pending_imports, &mut self.receiver).await?; + let msg = self.receive_message().await?; - let incoming = match msg { - // We need to clean up futures, to make sure responses are sent: - MuxedMessage::ConfirmedImport(m_bad) => { - self.ban_bad_peer(m_bad)?; - return Ok(()) + match msg { + MuxedMessage::NewRequest(req) => { + // Phase 1: + self.metrics.on_received_request(); + self.dispatch_to_queues(req).await?; }, - MuxedMessage::NewRequest(req) => req, - }; + MuxedMessage::WakePeerQueuesPopReqs(reqs) => { + // Phase 2: + for req in reqs { + // No early return - we cannot cancel imports of one peer, because the import of + // another failed: + match log_error(self.start_import_or_batch(req).await) { + Ok(()) => {}, + Err(fatal) => return Err(fatal.into()), + } + } + }, + MuxedMessage::WakeCheckBatches(ready_imports) => { + // Phase 3: + self.import_ready_batches(ready_imports).await; + }, + MuxedMessage::ConfirmedImport(import_result) => { + self.update_imported_requests_metrics(&import_result); + // Confirm imports to requesters/punish them on invalid imports: + send_responses_to_requesters(import_result).await?; + }, + } + + Ok(()) + } + + /// Receive one `MuxedMessage`. + /// + /// + /// Dispatching events to messages as they happen. + async fn receive_message(&mut self) -> Result { + poll_fn(|ctx| { + // In case of Ready(None), we want to wait for pending requests: + if let Poll::Ready(Some(v)) = self.pending_imports.poll_next_unpin(ctx) { + return Poll::Ready(Ok(MuxedMessage::ConfirmedImport(v?))) + } + + let rate_limited = self.peer_queues.pop_reqs(); + pin_mut!(rate_limited); + // We poll rate_limit before batches, so we don't unnecessarily delay importing to + // batches. + if let Poll::Ready(reqs) = rate_limited.poll(ctx) { + return Poll::Ready(Ok(MuxedMessage::WakePeerQueuesPopReqs(reqs))) + } - self.metrics.on_received_request(); + let ready_batches = self.batches.check_batches(); + pin_mut!(ready_batches); + if let Poll::Ready(ready_batches) = ready_batches.poll(ctx) { + return Poll::Ready(Ok(MuxedMessage::WakeCheckBatches(ready_batches))) + } - let peer = incoming.peer; + let next_req = self.receiver.recv(|| vec![COST_INVALID_REQUEST]); + pin_mut!(next_req); + if let Poll::Ready(r) = next_req.poll(ctx) { + return match r { + Err(e) => Poll::Ready(Err(incoming::Error::from(e).into())), + Ok(v) => Poll::Ready(Ok(MuxedMessage::NewRequest(v))), + } + } + Poll::Pending + }) + .await + } - // Only accept messages from validators: - if self.authority_discovery.get_authority_ids_by_peer_id(peer).await.is_none() { - incoming - .send_outgoing_response(OutgoingResponse { + /// Process incoming requests. + /// + /// - Check sender is authority + /// - Dispatch message to corresponding queue in `peer_queues`. + /// - If queue is full, drop message and change reputation of sender. + async fn dispatch_to_queues(&mut self, req: IncomingRequest) -> JfyiResult<()> { + let peer = req.peer; + // Only accept messages from validators, in case there are multiple `AuthorityId`s, we + // just take the first one. On session boundaries this might allow validators to double + // their rate limit for a short period of time, which seems acceptable. + let authority_id = match self + .authority_discovery + .get_authority_ids_by_peer_id(peer) + .await + .and_then(|s| s.into_iter().next()) + { + None => { + req.send_outgoing_response(OutgoingResponse { result: Err(()), reputation_changes: vec![COST_NOT_A_VALIDATOR], sent_feedback: None, }) - .map_err(|_| JfyiError::SendResponse(peer))?; - - return Err(JfyiError::NotAValidator(peer).into()) - } - - // Immediately drop requests from peers that already have requests in flight or have - // been banned recently (flood protection): - if self.pending_imports.peer_is_pending(&peer) || self.banned_peers.contains(&peer) { - gum::trace!( - target: LOG_TARGET, - ?peer, - "Dropping message from peer (banned/pending import)" - ); - return Ok(()) - } + .map_err(|_| JfyiError::SendResponses(vec![peer]))?; + return Err(JfyiError::NotAValidator(peer).into()) + }, + Some(auth_id) => auth_id, + }; - // Wait for a free slot: - if self.pending_imports.len() >= MAX_PARALLEL_IMPORTS { - // Wait for one to finish: - let r = self.pending_imports.next().await; - self.ban_bad_peer(r.expect("pending_imports.len() is greater 0. qed."))?; + // Queue request: + if let Err((authority_id, req)) = self.peer_queues.push_req(authority_id, req) { + req.send_outgoing_response(OutgoingResponse { + result: Err(()), + reputation_changes: vec![COST_APPARENT_FLOOD], + sent_feedback: None, + }) + .map_err(|_| JfyiError::SendResponses(vec![peer]))?; + return Err(JfyiError::AuthorityFlooding(authority_id)) } - - // All good - initiate import. - self.start_import(incoming).await + Ok(()) } - /// Start importing votes for the given request. - async fn start_import(&mut self, incoming: IncomingRequest) -> Result<()> { + /// Start importing votes for the given request or batch. + /// + /// Signature check and in case we already have an existing batch we import to that batch, + /// otherwise import to `dispute-coordinator` directly and open a batch. + async fn start_import_or_batch( + &mut self, + incoming: IncomingRequest, + ) -> Result<()> { let IncomingRequest { peer, payload, pending_response } = incoming; let info = self @@ -270,128 +350,172 @@ where Ok(votes) => votes, }; - let (pending_confirmation, confirmation_rx) = oneshot::channel(); - self.sender - .send_message(DisputeCoordinatorMessage::ImportStatements { - candidate_receipt, - session: valid_vote.0.session_index(), - statements: vec![valid_vote, invalid_vote], - pending_confirmation: Some(pending_confirmation), - }) - .await; + let candidate_hash = *valid_vote.0.candidate_hash(); + + match self.batches.find_batch(candidate_hash, candidate_receipt)? { + FoundBatch::Created(batch) => { + // There was no entry yet - start import immediately: + gum::trace!( + target: LOG_TARGET, + ?candidate_hash, + ?peer, + "No batch yet - triggering immediate import" + ); + let import = PreparedImport { + candidate_receipt: batch.candidate_receipt().clone(), + statements: vec![valid_vote, invalid_vote], + requesters: vec![(peer, pending_response)], + }; + self.start_import(import).await; + }, + FoundBatch::Found(batch) => { + gum::trace!(target: LOG_TARGET, ?candidate_hash, "Batch exists - batching request"); + let batch_result = + batch.add_votes(valid_vote, invalid_vote, peer, pending_response); + + if let Err(pending_response) = batch_result { + // We don't expect honest peers to send redundant votes within a single batch, + // as the timeout for retry is much higher. Still we don't want to punish the + // node as it might not be the node's fault. Some other (malicious) node could have been + // faster sending the same votes in order to harm the reputation of that honest + // node. Given that we already have a rate limit, if a validator chooses to + // waste available rate with redundant votes - so be it. The actual dispute + // resolution is unaffected. + gum::debug!( + target: LOG_TARGET, + ?peer, + "Peer sent completely redundant votes within a single batch - that looks fishy!", + ); + pending_response + .send_outgoing_response(OutgoingResponse { + // While we have seen duplicate votes, we cannot confirm as we don't + // know yet whether the batch is going to be confirmed, so we assume + // the worst. We don't want to push the pending response to the batch + // either as that would be unbounded, only limited by the rate limit. + result: Err(()), + reputation_changes: Vec::new(), + sent_feedback: None, + }) + .map_err(|_| JfyiError::SendResponses(vec![peer]))?; + return Err(From::from(JfyiError::RedundantMessage(peer))) + } + }, + } - self.pending_imports.push(peer, confirmation_rx, pending_response); Ok(()) } - /// Await an import and ban any misbehaving peers. - /// - /// In addition we report import metrics. - fn ban_bad_peer( - &mut self, - result: JfyiErrorResult<(PeerId, ImportStatementsResult)>, - ) -> JfyiErrorResult<()> { - match result? { - (_, ImportStatementsResult::ValidImport) => { - self.metrics.on_imported(SUCCEEDED); - }, - (bad_peer, ImportStatementsResult::InvalidImport) => { - self.metrics.on_imported(FAILED); - self.banned_peers.put(bad_peer, ()); - }, + /// Trigger import into the dispute-coordinator of ready batches (`PreparedImport`s). + async fn import_ready_batches(&mut self, ready_imports: Vec) { + for import in ready_imports { + self.start_import(import).await; } - Ok(()) } -} -/// Manage pending imports in a way that preserves invariants. -struct PendingImports { - /// Futures in flight. - futures: - FuturesUnordered)>>, - /// Peers whose requests are currently in flight. - peers: HashSet, -} + /// Start import and add response receiver to `pending_imports`. + async fn start_import(&mut self, import: PreparedImport) { + let PreparedImport { candidate_receipt, statements, requesters } = import; + let (session_index, candidate_hash) = match statements.iter().next() { + None => { + gum::debug!( + target: LOG_TARGET, + candidate_hash = ?candidate_receipt.hash(), + "Not importing empty batch" + ); + return + }, + Some(vote) => (vote.0.session_index(), vote.0.candidate_hash().clone()), + }; -impl PendingImports { - pub fn new() -> Self { - Self { futures: FuturesUnordered::new(), peers: HashSet::new() } - } + let (pending_confirmation, confirmation_rx) = oneshot::channel(); + self.sender + .send_message(DisputeCoordinatorMessage::ImportStatements { + candidate_receipt, + session: session_index, + statements, + pending_confirmation: Some(pending_confirmation), + }) + .await; - pub fn push( - &mut self, - peer: PeerId, - handled: oneshot::Receiver, - pending_response: OutgoingResponseSender, - ) { - self.peers.insert(peer); - self.futures.push( - async move { - let r = respond_to_request(peer, handled, pending_response).await; - (peer, r) - } - .boxed(), - ) - } + let pending = + PendingImport { candidate_hash, requesters, pending_response: confirmation_rx }; - /// Returns the number of contained futures. - pub fn len(&self) -> usize { - self.futures.len() + self.pending_imports.push(pending); } - /// Check whether a peer has a pending import. - pub fn peer_is_pending(&self, peer: &PeerId) -> bool { - self.peers.contains(peer) + fn update_imported_requests_metrics(&self, result: &ImportResult) { + let label = match result.result { + ImportStatementsResult::ValidImport => SUCCEEDED, + ImportStatementsResult::InvalidImport => FAILED, + }; + self.metrics.on_imported(label, result.requesters.len()); } } -impl Stream for PendingImports { - type Item = JfyiErrorResult<(PeerId, ImportStatementsResult)>; - fn poll_next(mut self: Pin<&mut Self>, ctx: &mut Context<'_>) -> Poll> { - match Pin::new(&mut self.futures).poll_next(ctx) { - Poll::Pending => Poll::Pending, - Poll::Ready(None) => Poll::Ready(None), - Poll::Ready(Some((peer, result))) => { - self.peers.remove(&peer); - Poll::Ready(Some(result.map(|r| (peer, r)))) - }, - } - } -} -impl FusedStream for PendingImports { - fn is_terminated(&self) -> bool { - self.futures.is_terminated() - } -} +async fn send_responses_to_requesters(import_result: ImportResult) -> JfyiResult<()> { + let ImportResult { requesters, result } = import_result; -// Future for `PendingImports` -// -// - Wait for import -// - Punish peer -// - Deliver result -async fn respond_to_request( - peer: PeerId, - handled: oneshot::Receiver, - pending_response: OutgoingResponseSender, -) -> JfyiErrorResult { - let result = handled.await.map_err(|_| JfyiError::ImportCanceled(peer))?; - - let response = match result { - ImportStatementsResult::ValidImport => OutgoingResponse { + let mk_response = match result { + ImportStatementsResult::ValidImport => || OutgoingResponse { result: Ok(DisputeResponse::Confirmed), reputation_changes: Vec::new(), sent_feedback: None, }, - ImportStatementsResult::InvalidImport => OutgoingResponse { + ImportStatementsResult::InvalidImport => || OutgoingResponse { result: Err(()), - reputation_changes: vec![COST_INVALID_CANDIDATE], + reputation_changes: vec![COST_INVALID_IMPORT], sent_feedback: None, }, }; - pending_response - .send_outgoing_response(response) - .map_err(|_| JfyiError::SendResponse(peer))?; + let mut sending_failed_for = Vec::new(); + for (peer, pending_response) in requesters { + if let Err(()) = pending_response.send_outgoing_response(mk_response()) { + sending_failed_for.push(peer); + } + } + + if !sending_failed_for.is_empty() { + Err(JfyiError::SendResponses(sending_failed_for)) + } else { + Ok(()) + } +} - Ok(result) +/// A future that resolves into an `ImportResult` when ready. +/// +/// This future is used on `dispute-coordinator` import messages for the oneshot response receiver +/// to: +/// - Keep track of concerned `CandidateHash` for reporting errors. +/// - Keep track of requesting peers so we can confirm the import/punish them on invalid imports. +struct PendingImport { + candidate_hash: CandidateHash, + requesters: Vec<(PeerId, OutgoingResponseSender)>, + pending_response: oneshot::Receiver, +} + +/// A `PendingImport` becomes an `ImportResult` once done. +struct ImportResult { + /// Requesters of that import. + requesters: Vec<(PeerId, OutgoingResponseSender)>, + /// Actual result of the import. + result: ImportStatementsResult, +} + +impl PendingImport { + async fn wait_for_result(&mut self) -> JfyiResult { + let result = (&mut self.pending_response) + .await + .map_err(|_| JfyiError::ImportCanceled(self.candidate_hash))?; + Ok(ImportResult { requesters: std::mem::take(&mut self.requesters), result }) + } +} + +impl Future for PendingImport { + type Output = JfyiResult; + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + let fut = self.wait_for_result(); + pin_mut!(fut); + fut.poll(cx) + } } diff --git a/node/network/dispute-distribution/src/receiver/peer_queues.rs b/node/network/dispute-distribution/src/receiver/peer_queues.rs new file mode 100644 index 000000000000..138b59c3f867 --- /dev/null +++ b/node/network/dispute-distribution/src/receiver/peer_queues.rs @@ -0,0 +1,141 @@ +// Copyright 2022 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 . + +use std::collections::{hash_map::Entry, HashMap, VecDeque}; + +use futures::future::pending; +use futures_timer::Delay; +use polkadot_node_network_protocol::request_response::{v1::DisputeRequest, IncomingRequest}; +use polkadot_primitives::v2::AuthorityDiscoveryId; + +use crate::RECEIVE_RATE_LIMIT; + +/// How many messages we are willing to queue per peer (validator). +/// +/// The larger this value is, the larger bursts are allowed to be without us dropping messages. On +/// the flip side this gets allocated per validator, so for a size of 10 this will result +/// in `10_000 * size_of(IncomingRequest)` in the worst case. +/// +/// `PEER_QUEUE_CAPACITY` must not be 0 for obvious reasons. +#[cfg(not(test))] +pub const PEER_QUEUE_CAPACITY: usize = 10; +#[cfg(test)] +pub const PEER_QUEUE_CAPACITY: usize = 2; + +/// Queues for messages from authority peers for rate limiting. +/// +/// Invariants ensured: +/// +/// 1. No queue will ever have more than `PEER_QUEUE_CAPACITY` elements. +/// 2. There are no empty queues. Whenever a queue gets empty, it is removed. This way checking +/// whether there are any messages queued is cheap. +/// 3. As long as not empty, `pop_reqs` will, if called in sequence, not return `Ready` more often +/// than once for every `RECEIVE_RATE_LIMIT`, but it will always return Ready eventually. +/// 4. If empty `pop_reqs` will never return `Ready`, but will always be `Pending`. +pub struct PeerQueues { + /// Actual queues. + queues: HashMap>>, + + /// Delay timer for establishing the rate limit. + rate_limit_timer: Option, +} + +impl PeerQueues { + /// New empty `PeerQueues`. + pub fn new() -> Self { + Self { queues: HashMap::new(), rate_limit_timer: None } + } + + /// Push an incoming request for a given authority. + /// + /// Returns: `Ok(())` if succeeded, `Err((args))` if capacity is reached. + pub fn push_req( + &mut self, + peer: AuthorityDiscoveryId, + req: IncomingRequest, + ) -> Result<(), (AuthorityDiscoveryId, IncomingRequest)> { + let queue = match self.queues.entry(peer) { + Entry::Vacant(vacant) => vacant.insert(VecDeque::new()), + Entry::Occupied(occupied) => { + if occupied.get().len() >= PEER_QUEUE_CAPACITY { + return Err((occupied.key().clone(), req)) + } + occupied.into_mut() + }, + }; + queue.push_back(req); + + // We have at least one element to process - rate limit `timer` needs to exist now: + self.ensure_timer(); + Ok(()) + } + + /// Pop all heads and return them for processing. + /// + /// This gets one message from each peer that has sent at least one. + /// + /// This function is rate limited, if called in sequence it will not return more often than + /// every `RECEIVE_RATE_LIMIT`. + /// + /// NOTE: If empty this function will not return `Ready` at all, but will always be `Pending`. + pub async fn pop_reqs(&mut self) -> Vec> { + self.wait_for_timer().await; + + let mut heads = Vec::with_capacity(self.queues.len()); + let old_queues = std::mem::replace(&mut self.queues, HashMap::new()); + for (k, mut queue) in old_queues.into_iter() { + let front = queue.pop_front(); + debug_assert!(front.is_some(), "Invariant that queues are never empty is broken."); + + if let Some(front) = front { + heads.push(front); + } + if !queue.is_empty() { + self.queues.insert(k, queue); + } + } + + if !self.is_empty() { + // Still not empty - we should get woken at some point. + self.ensure_timer(); + } + + heads + } + + /// Whether or not all queues are empty. + pub fn is_empty(&self) -> bool { + self.queues.is_empty() + } + + /// Ensure there is an active `timer`. + /// + /// Checks whether one exists and if not creates one. + fn ensure_timer(&mut self) -> &mut Delay { + self.rate_limit_timer.get_or_insert(Delay::new(RECEIVE_RATE_LIMIT)) + } + + /// Wait for `timer` if it exists, or be `Pending` forever. + /// + /// Afterwards it gets set back to `None`. + async fn wait_for_timer(&mut self) { + match self.rate_limit_timer.as_mut() { + None => pending().await, + Some(timer) => timer.await, + } + self.rate_limit_timer = None; + } +} diff --git a/node/network/dispute-distribution/src/sender/mod.rs b/node/network/dispute-distribution/src/sender/mod.rs index 5312528b413e..09b902173ede 100644 --- a/node/network/dispute-distribution/src/sender/mod.rs +++ b/node/network/dispute-distribution/src/sender/mod.rs @@ -14,10 +14,21 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::collections::{hash_map::Entry, HashMap, HashSet}; - -use futures::channel::{mpsc, oneshot}; - +use std::{ + collections::{HashMap, HashSet}, + pin::Pin, + task::Poll, + time::Duration, +}; + +use futures::{ + channel::{mpsc, oneshot}, + future::poll_fn, + Future, +}; + +use futures_timer::Delay; +use indexmap::{map::Entry, IndexMap}; use polkadot_node_network_protocol::request_response::v1::DisputeRequest; use polkadot_node_primitives::{CandidateVotes, DisputeMessage, SignedDisputeStatement}; use polkadot_node_subsystem::{messages::DisputeCoordinatorMessage, overseer, ActiveLeavesUpdate}; @@ -28,22 +39,27 @@ use polkadot_primitives::v2::{CandidateHash, DisputeStatement, Hash, SessionInde /// /// It is going to spawn real tasks as it sees fit for getting the votes of the particular dispute /// out. +/// +/// As we assume disputes have a priority, we start sending for disputes in the order +/// `start_sender` got called. mod send_task; use send_task::SendTask; pub use send_task::TaskFinish; -/// Error and [`Result`] type for sender +/// Error and [`Result`] type for sender. mod error; pub use error::{Error, FatalError, JfyiError, Result}; use self::error::JfyiErrorResult; -use crate::{Metrics, LOG_TARGET}; +use crate::{Metrics, LOG_TARGET, SEND_RATE_LIMIT}; /// The `DisputeSender` keeps track of all ongoing disputes we need to send statements out. /// /// For each dispute a `SendTask` is responsible for sending to the concerned validators for that /// particular dispute. The `DisputeSender` keeps track of those tasks, informs them about new /// sessions/validator sets and cleans them up when they become obsolete. +/// +/// The unit of work for the `DisputeSender` is a dispute, represented by `SendTask`s. pub struct DisputeSender { /// All heads we currently consider active. active_heads: Vec, @@ -54,11 +70,16 @@ pub struct DisputeSender { active_sessions: HashMap, /// All ongoing dispute sendings this subsystem is aware of. - disputes: HashMap, + /// + /// Using an `IndexMap` so items can be iterated in the order of insertion. + disputes: IndexMap, /// Sender to be cloned for `SendTask`s. tx: mpsc::Sender, + /// Future for delaying too frequent creation of dispute sending tasks. + rate_limit: RateLimit, + /// Metrics for reporting stats about sent requests. metrics: Metrics, } @@ -70,19 +91,25 @@ impl DisputeSender { Self { active_heads: Vec::new(), active_sessions: HashMap::new(), - disputes: HashMap::new(), + disputes: IndexMap::new(), tx, + rate_limit: RateLimit::new(), metrics, } } /// Create a `SendTask` for a particular new dispute. + /// + /// This function is rate-limited by `SEND_RATE_LIMIT`. It will block if called too frequently + /// in order to maintain the limit. pub async fn start_sender( &mut self, ctx: &mut Context, runtime: &mut RuntimeInfo, msg: DisputeMessage, ) -> Result<()> { + self.rate_limit.limit().await; + let req: DisputeRequest = msg.into(); let candidate_hash = req.0.candidate_receipt.hash(); match self.disputes.entry(candidate_hash) { @@ -112,6 +139,8 @@ impl DisputeSender { /// - Get new authorities to send messages to. /// - Get rid of obsolete tasks and disputes. /// - Get dispute sending started in case we missed one for some reason (e.g. on node startup) + /// + /// This function ensures the `SEND_RATE_LIMIT`, therefore it might block. pub async fn update_leaves( &mut self, ctx: &mut Context, @@ -134,21 +163,38 @@ impl DisputeSender { let active_disputes: HashSet<_> = active_disputes.into_iter().map(|(_, c)| c).collect(); - // Cleanup obsolete senders: + // Cleanup obsolete senders (retain keeps order of remaining elements): self.disputes .retain(|candidate_hash, _| active_disputes.contains(candidate_hash)); + // Iterates in order of insertion: + let mut should_rate_limit = true; for dispute in self.disputes.values_mut() { if have_new_sessions || dispute.has_failed_sends() { - dispute + if should_rate_limit { + self.rate_limit.limit().await; + } + let sends_happened = dispute .refresh_sends(ctx, runtime, &self.active_sessions, &self.metrics) .await?; + // Only rate limit if we actually sent something out _and_ it was not just because + // of errors on previous sends. + // + // Reasoning: It would not be acceptable to slow down the whole subsystem, just + // because of a few bad peers having problems. It is actually better to risk + // running into their rate limit in that case and accept a minor reputation change. + should_rate_limit = sends_happened && have_new_sessions; } } - // This should only be non-empty on startup, but if not - we got you covered: + // This should only be non-empty on startup, but if not - we got you covered. + // + // Initial order will not be maintained in that case, but that should be fine as disputes + // recovered at startup will be relatively "old" anyway and we assume that no more than a + // third of the validators will go offline at any point in time anyway. for dispute in unknown_disputes { - self.start_send_for_dispute(ctx, runtime, dispute).await? + self.rate_limit.limit().await; + self.start_send_for_dispute(ctx, runtime, dispute).await?; } Ok(()) } @@ -317,6 +363,46 @@ impl DisputeSender { } } +/// Rate limiting logic. +/// +/// Suitable for the sending side. +struct RateLimit { + limit: Delay, +} + +impl RateLimit { + /// Create new `RateLimit` that is immediately ready. + fn new() -> Self { + // Start with an empty duration, as there has not been any previous call. + Self { limit: Delay::new(Duration::new(0, 0)) } + } + + /// Initialized with actual `SEND_RATE_LIMIT` duration. + fn new_limit() -> Self { + Self { limit: Delay::new(SEND_RATE_LIMIT) } + } + + /// Wait until ready and prepare for next call. + async fn limit(&mut self) { + // Wait for rate limit and add some logging: + poll_fn(|cx| { + let old_limit = Pin::new(&mut self.limit); + match old_limit.poll(cx) { + Poll::Pending => { + gum::debug!( + target: LOG_TARGET, + "Sending rate limit hit, slowing down requests" + ); + Poll::Pending + }, + Poll::Ready(()) => Poll::Ready(()), + } + }) + .await; + *self = Self::new_limit(); + } +} + /// Retrieve the currently active sessions. /// /// List is all indices of all active sessions together with the head that was used for the query. diff --git a/node/network/dispute-distribution/src/sender/send_task.rs b/node/network/dispute-distribution/src/sender/send_task.rs index a2b8cdcf7441..89b5c099bde9 100644 --- a/node/network/dispute-distribution/src/sender/send_task.rs +++ b/node/network/dispute-distribution/src/sender/send_task.rs @@ -42,13 +42,15 @@ use crate::{ /// Delivery status for a particular dispute. /// /// Keeps track of all the validators that have to be reached for a dispute. +/// +/// The unit of work for a `SendTask` is an authority/validator. pub struct SendTask { - /// The request we are supposed to get out to all parachain validators of the dispute's session + /// The request we are supposed to get out to all `parachain` validators of the dispute's session /// and to all current authorities. request: DisputeRequest, /// The set of authorities we need to send our messages to. This set will change at session - /// boundaries. It will always be at least the parachain validators of the session where the + /// boundaries. It will always be at least the `parachain` validators of the session where the /// dispute happened and the authorities of the current sessions as determined by active heads. deliveries: HashMap, @@ -100,6 +102,10 @@ impl TaskResult { #[overseer::contextbounds(DisputeDistribution, prefix = self::overseer)] impl SendTask { /// Initiates sending a dispute message to peers. + /// + /// Creation of new `SendTask`s is subject to rate limiting. As each `SendTask` will trigger + /// sending a message to each validator, hence for employing a per-peer rate limit, we need to + /// limit the construction of new `SendTask`s. pub async fn new( ctx: &mut Context, runtime: &mut RuntimeInfo, @@ -118,15 +124,22 @@ impl SendTask { /// /// This function is called at construction and should also be called whenever a session change /// happens and on a regular basis to ensure we are retrying failed attempts. + /// + /// This might resend to validators and is thus subject to any rate limiting we might want. + /// Calls to this function for different instances should be rate limited according to + /// `SEND_RATE_LIMIT`. + /// + /// Returns: `True` if this call resulted in new requests. pub async fn refresh_sends( &mut self, ctx: &mut Context, runtime: &mut RuntimeInfo, active_sessions: &HashMap, metrics: &Metrics, - ) -> Result<()> { + ) -> Result { let new_authorities = self.get_relevant_validators(ctx, runtime, active_sessions).await?; + // Note this will also contain all authorities for which sending failed previously: let add_authorities = new_authorities .iter() .filter(|a| !self.deliveries.contains_key(a)) @@ -141,12 +154,14 @@ impl SendTask { send_requests(ctx, self.tx.clone(), add_authorities, self.request.clone(), metrics) .await?; + let was_empty = new_statuses.is_empty(); + self.has_failed_sends = false; self.deliveries.extend(new_statuses.into_iter()); - Ok(()) + Ok(!was_empty) } - /// Whether any sends have failed since the last refreshed. + /// Whether any sends have failed since the last refresh. pub fn has_failed_sends(&self) -> bool { self.has_failed_sends } @@ -193,9 +208,8 @@ impl SendTask { /// Determine all validators that should receive the given dispute requests. /// - /// This is all parachain validators of the session the candidate occurred and all authorities + /// This is all `parachain` validators of the session the candidate occurred and all authorities /// of all currently active sessions, determined by currently active heads. - async fn get_relevant_validators( &self, ctx: &mut Context, @@ -293,7 +307,7 @@ async fn wait_response_task( gum::debug!( target: LOG_TARGET, %err, - "Failed to notify susystem about dispute sending result." + "Failed to notify subsystem about dispute sending result." ); } } diff --git a/node/network/dispute-distribution/src/tests/mock.rs b/node/network/dispute-distribution/src/tests/mock.rs index 08428d5852cc..aa2a4485d480 100644 --- a/node/network/dispute-distribution/src/tests/mock.rs +++ b/node/network/dispute-distribution/src/tests/mock.rs @@ -20,6 +20,7 @@ use std::{ collections::{HashMap, HashSet}, sync::Arc, + time::Instant, }; use async_trait::async_trait; @@ -38,6 +39,8 @@ use polkadot_primitives::v2::{ }; use polkadot_primitives_test_helpers::dummy_candidate_descriptor; +use crate::LOG_TARGET; + pub const MOCK_SESSION_INDEX: SessionIndex = 1; pub const MOCK_NEXT_SESSION_INDEX: SessionIndex = 2; pub const MOCK_VALIDATORS: [Sr25519Keyring; 6] = [ @@ -54,6 +57,8 @@ pub const MOCK_AUTHORITIES_NEXT_SESSION: [Sr25519Keyring; 2] = pub const FERDIE_INDEX: ValidatorIndex = ValidatorIndex(0); pub const ALICE_INDEX: ValidatorIndex = ValidatorIndex(1); +pub const BOB_INDEX: ValidatorIndex = ValidatorIndex(2); +pub const CHARLIE_INDEX: ValidatorIndex = ValidatorIndex(3); lazy_static! { @@ -148,12 +153,22 @@ pub async fn make_dispute_message( invalid_validator: ValidatorIndex, ) -> DisputeMessage { let candidate_hash = candidate.hash(); + let before_request = Instant::now(); let valid_vote = make_explicit_signed(MOCK_VALIDATORS[valid_validator.0 as usize], candidate_hash, true) .await; + gum::trace!( + "Passed time for valid vote: {:#?}", + Instant::now().saturating_duration_since(before_request) + ); + let before_request = Instant::now(); let invalid_vote = make_explicit_signed(MOCK_VALIDATORS[invalid_validator.0 as usize], candidate_hash, false) .await; + gum::trace!( + "Passed time for invald vote: {:#?}", + Instant::now().saturating_duration_since(before_request) + ); DisputeMessage::from_signed_statements( valid_vote, valid_validator, @@ -206,10 +221,15 @@ impl AuthorityDiscovery for MockAuthorityDiscovery { ) -> Option> { for (a, p) in self.peer_ids.iter() { if p == &peer_id { - return Some(HashSet::from([MOCK_VALIDATORS_DISCOVERY_KEYS - .get(&a) - .unwrap() - .clone()])) + let result = + HashSet::from([MOCK_VALIDATORS_DISCOVERY_KEYS.get(&a).unwrap().clone()]); + gum::trace!( + target: LOG_TARGET, + %peer_id, + ?result, + "Returning authority ids for peer id" + ); + return Some(result) } } diff --git a/node/network/dispute-distribution/src/tests/mod.rs b/node/network/dispute-distribution/src/tests/mod.rs index 8ef8286ea197..56cdd467fd62 100644 --- a/node/network/dispute-distribution/src/tests/mod.rs +++ b/node/network/dispute-distribution/src/tests/mod.rs @@ -17,12 +17,17 @@ //! Subsystem unit tests -use std::{collections::HashSet, sync::Arc, task::Poll, time::Duration}; +use std::{ + collections::HashSet, + sync::Arc, + task::Poll, + time::{Duration, Instant}, +}; use assert_matches::assert_matches; use futures::{ channel::{mpsc, oneshot}, - future::poll_fn, + future::{poll_fn, ready}, pin_mut, Future, SinkExt, }; use futures_timer::Delay; @@ -52,7 +57,7 @@ use polkadot_node_subsystem_test_helpers::{ mock::make_ferdie_keystore, subsystem_test_harness, TestSubsystemContextHandle, }; use polkadot_primitives::v2::{ - AuthorityDiscoveryId, CandidateHash, Hash, SessionIndex, SessionInfo, + AuthorityDiscoveryId, CandidateHash, CandidateReceipt, Hash, SessionIndex, SessionInfo, }; use self::mock::{ @@ -60,7 +65,11 @@ use self::mock::{ MOCK_AUTHORITY_DISCOVERY, MOCK_NEXT_SESSION_INDEX, MOCK_NEXT_SESSION_INFO, MOCK_SESSION_INDEX, MOCK_SESSION_INFO, }; -use crate::{DisputeDistributionSubsystem, Metrics, LOG_TARGET}; +use crate::{ + receiver::BATCH_COLLECTING_INTERVAL, + tests::mock::{BOB_INDEX, CHARLIE_INDEX}, + DisputeDistributionSubsystem, Metrics, LOG_TARGET, SEND_RATE_LIMIT, +}; /// Useful mock providers. pub mod mock; @@ -72,49 +81,108 @@ fn send_dispute_sends_dispute() { let relay_parent = Hash::random(); let candidate = make_candidate_receipt(relay_parent); - let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; - handle - .send(FromOrchestra::Communication { - msg: DisputeDistributionMessage::SendDispute(message.clone()), - }) - .await; + send_dispute(&mut handle, candidate, true).await; + conclude(&mut handle).await; + }; + test_harness(test); +} + +#[test] +fn send_honors_rate_limit() { + sp_tracing::try_init_simple(); + let test = |mut handle: TestSubsystemContextHandle, _req_cfg| async move { + let _ = handle_subsystem_startup(&mut handle, None).await; + + let relay_parent = Hash::random(); + let candidate = make_candidate_receipt(relay_parent); + let before_request = Instant::now(); + send_dispute(&mut handle, candidate, true).await; + // First send should not be rate limited: + gum::trace!("Passed time: {:#?}", Instant::now().saturating_duration_since(before_request)); + // This test would likely be flaky on CI: + //assert!(Instant::now().saturating_duration_since(before_request) < SEND_RATE_LIMIT); + + let relay_parent = Hash::random(); + let candidate = make_candidate_receipt(relay_parent); + send_dispute(&mut handle, candidate, false).await; + // Second send should be rate limited: + gum::trace!( + "Passed time for send_dispute: {:#?}", + Instant::now().saturating_duration_since(before_request) + ); + assert!(Instant::now() - before_request >= SEND_RATE_LIMIT); + conclude(&mut handle).await; + }; + test_harness(test); +} + +/// Helper for sending a new dispute to dispute-distribution sender and handling resulting messages. +async fn send_dispute( + handle: &mut TestSubsystemContextHandle, + candidate: CandidateReceipt, + needs_session_info: bool, +) { + let before_request = Instant::now(); + let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; + gum::trace!( + "Passed time for making message: {:#?}", + Instant::now().saturating_duration_since(before_request) + ); + let before_request = Instant::now(); + handle + .send(FromOrchestra::Communication { + msg: DisputeDistributionMessage::SendDispute(message.clone()), + }) + .await; + gum::trace!( + "Passed time for sending message: {:#?}", + Instant::now().saturating_duration_since(before_request) + ); + if needs_session_info { // Requests needed session info: assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi( - RuntimeApiMessage::Request( - hash, - RuntimeApiRequest::SessionInfo(session_index, tx) + handle.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request( + hash, + RuntimeApiRequest::SessionInfo(session_index, tx) ) ) => { - assert_eq!(session_index, MOCK_SESSION_INDEX); - assert_eq!( - hash, - message.candidate_receipt().descriptor.relay_parent + assert_eq!(session_index, MOCK_SESSION_INDEX); + assert_eq!( + hash, + message.candidate_receipt().descriptor.relay_parent ); - tx.send(Ok(Some(MOCK_SESSION_INFO.clone()))).expect("Receiver should stay alive."); - } + tx.send(Ok(Some(MOCK_SESSION_INFO.clone()))).expect("Receiver should stay alive."); + } ); + } - let expected_receivers = { - let info = &MOCK_SESSION_INFO; - info.discovery_keys - .clone() - .into_iter() - .filter(|a| a != &Sr25519Keyring::Ferdie.public().into()) - .collect() - // All validators are also authorities in the first session, so we are - // done here. - }; - check_sent_requests(&mut handle, expected_receivers, true).await; - - conclude(&mut handle).await; + let expected_receivers = { + let info = &MOCK_SESSION_INFO; + info.discovery_keys + .clone() + .into_iter() + .filter(|a| a != &Sr25519Keyring::Ferdie.public().into()) + .collect() + // All validators are also authorities in the first session, so we are + // done here. }; - test_harness(test); + check_sent_requests(handle, expected_receivers, true).await; } +// Things to test: +// x Request triggers import +// x Subsequent imports get batched +// x Batch gets flushed. +// x Batch gets renewed. +// x Non authority requests get dropped. +// x Sending rate limit is honored. +// x Receiving rate limit is honored. +// x Duplicate requests on batch are dropped + #[test] -fn received_request_triggers_import() { +fn received_non_authorities_are_dropped() { let test = |mut handle: TestSubsystemContextHandle, mut req_cfg: RequestResponseConfig| async move { let req_tx = req_cfg.inbound_queue.as_mut().unwrap(); @@ -140,110 +208,271 @@ fn received_request_triggers_import() { assert_eq!(reputation_changes.len(), 1); } ); + conclude(&mut handle).await; + }; + test_harness(test); +} + +#[test] +fn received_request_triggers_import() { + let test = |mut handle: TestSubsystemContextHandle, + mut req_cfg: RequestResponseConfig| async move { + let req_tx = req_cfg.inbound_queue.as_mut().unwrap(); + let _ = handle_subsystem_startup(&mut handle, None).await; + + let relay_parent = Hash::random(); + let candidate = make_candidate_receipt(relay_parent); + let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; - // Nested valid and invalid import. - // - // Nested requests from same peer should get dropped. For the invalid request even - // subsequent requests should get dropped. nested_network_dispute_request( &mut handle, req_tx, MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Alice), message.clone().into(), - ImportStatementsResult::InvalidImport, + ImportStatementsResult::ValidImport, true, - move |handle, req_tx, message| { - nested_network_dispute_request( - handle, - req_tx, - MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob), - message.clone().into(), - ImportStatementsResult::ValidImport, - false, - move |_, req_tx, message| async move { - // Another request from Alice should get dropped (request already in - // flight): - { - let rx_response = send_network_dispute_request( - req_tx, - MOCK_AUTHORITY_DISCOVERY - .get_peer_id_by_authority(Sr25519Keyring::Alice), - message.clone(), - ) - .await; - - assert_matches!( - rx_response.await, - Err(err) => { - gum::trace!( - target: LOG_TARGET, - ?err, - "Request got dropped - other request already in flight" - ); - } - ); - } - // Another request from Bob should get dropped (request already in - // flight): - { - let rx_response = send_network_dispute_request( - req_tx, - MOCK_AUTHORITY_DISCOVERY - .get_peer_id_by_authority(Sr25519Keyring::Bob), - message.clone(), - ) - .await; - - assert_matches!( - rx_response.await, - Err(err) => { - gum::trace!( - target: LOG_TARGET, - ?err, - "Request got dropped - other request already in flight" - ); - } - ); - } - }, - ) - }, + move |_handle, _req_tx, _message| ready(()), ) .await; - // Subsequent sends from Alice should fail (peer is banned): - { - let rx_response = send_network_dispute_request( - req_tx, - MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Alice), - message.clone().into(), - ) - .await; + gum::trace!(target: LOG_TARGET, "Concluding."); + conclude(&mut handle).await; + }; + test_harness(test); +} + +#[test] +fn batching_works() { + let test = |mut handle: TestSubsystemContextHandle, + mut req_cfg: RequestResponseConfig| async move { + let req_tx = req_cfg.inbound_queue.as_mut().unwrap(); + let _ = handle_subsystem_startup(&mut handle, None).await; + + let relay_parent = Hash::random(); + let candidate = make_candidate_receipt(relay_parent); + let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; + + // Initial request should get forwarded immediately: + nested_network_dispute_request( + &mut handle, + req_tx, + MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Alice), + message.clone().into(), + ImportStatementsResult::ValidImport, + true, + move |_handle, _req_tx, _message| ready(()), + ) + .await; + let mut rx_responses = Vec::new(); + + let message = make_dispute_message(candidate.clone(), BOB_INDEX, FERDIE_INDEX).await; + let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob); + rx_responses.push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); + + let message = make_dispute_message(candidate.clone(), CHARLIE_INDEX, FERDIE_INDEX).await; + let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Charlie); + rx_responses.push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); + gum::trace!("Imported 3 votes into batch"); + + Delay::new(BATCH_COLLECTING_INTERVAL).await; + gum::trace!("Batch should still be alive"); + // Batch should still be alive (2 new votes): + // Let's import two more votes, but fully duplicates - should not extend batch live. + gum::trace!("Importing duplicate votes"); + let mut rx_responses_duplicate = Vec::new(); + let message = make_dispute_message(candidate.clone(), BOB_INDEX, FERDIE_INDEX).await; + let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob); + rx_responses_duplicate + .push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); + + let message = make_dispute_message(candidate.clone(), CHARLIE_INDEX, FERDIE_INDEX).await; + let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Charlie); + rx_responses_duplicate + .push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); + + for rx_response in rx_responses_duplicate { assert_matches!( rx_response.await, - Err(err) => { + Ok(resp) => { + let sc_network::config::OutgoingResponse { + result, + reputation_changes, + sent_feedback: _, + } = resp; gum::trace!( target: LOG_TARGET, - ?err, - "Request got dropped - peer is banned." + ?reputation_changes, + "Received reputation changes." + ); + // We don't punish on that. + assert_eq!(reputation_changes.len(), 0); + + assert_matches!(result, Err(())); + } + ); + } + + Delay::new(BATCH_COLLECTING_INTERVAL).await; + gum::trace!("Batch should be ready now (only duplicates have been added)"); + + let pending_confirmation = assert_matches!( + handle.recv().await, + AllMessages::DisputeCoordinator( + DisputeCoordinatorMessage::ImportStatements { + candidate_receipt: _, + session, + statements, + pending_confirmation: Some(pending_confirmation), + } + ) => { + assert_eq!(session, MOCK_SESSION_INDEX); + assert_eq!(statements.len(), 3); + pending_confirmation + } + ); + pending_confirmation.send(ImportStatementsResult::ValidImport).unwrap(); + + for rx_response in rx_responses { + assert_matches!( + rx_response.await, + Ok(resp) => { + let sc_network::config::OutgoingResponse { + result, + reputation_changes: _, + sent_feedback, + } = resp; + + let result = result.unwrap(); + let decoded = + ::decode(&mut result.as_slice()).unwrap(); + + assert!(decoded == DisputeResponse::Confirmed); + if let Some(sent_feedback) = sent_feedback { + sent_feedback.send(()).unwrap(); + } + gum::trace!( + target: LOG_TARGET, + "Valid import happened." ); + } ); } - // But should work fine for Bob: + gum::trace!(target: LOG_TARGET, "Concluding."); + conclude(&mut handle).await; + }; + test_harness(test); +} + +#[test] +fn receive_rate_limit_is_enforced() { + let test = |mut handle: TestSubsystemContextHandle, + mut req_cfg: RequestResponseConfig| async move { + let req_tx = req_cfg.inbound_queue.as_mut().unwrap(); + let _ = handle_subsystem_startup(&mut handle, None).await; + + let relay_parent = Hash::random(); + let candidate = make_candidate_receipt(relay_parent); + let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; + + // Initial request should get forwarded immediately: nested_network_dispute_request( &mut handle, req_tx, - MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob), + MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Alice), message.clone().into(), ImportStatementsResult::ValidImport, - false, - |_, _, _| async {}, + true, + move |_handle, _req_tx, _message| ready(()), ) .await; + let mut rx_responses = Vec::new(); + + let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob); + + let message = make_dispute_message(candidate.clone(), BOB_INDEX, FERDIE_INDEX).await; + rx_responses.push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); + + let message = make_dispute_message(candidate.clone(), CHARLIE_INDEX, FERDIE_INDEX).await; + rx_responses.push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); + + gum::trace!("Import one too much:"); + + let message = make_dispute_message(candidate.clone(), CHARLIE_INDEX, ALICE_INDEX).await; + let rx_response_flood = + send_network_dispute_request(req_tx, peer, message.clone().into()).await; + + assert_matches!( + rx_response_flood.await, + Ok(resp) => { + let sc_network::config::OutgoingResponse { + result: _, + reputation_changes, + sent_feedback: _, + } = resp; + gum::trace!( + target: LOG_TARGET, + ?reputation_changes, + "Received reputation changes." + ); + // Received punishment for flood: + assert_eq!(reputation_changes.len(), 1); + } + ); + gum::trace!("Need to wait 2 patch intervals:"); + Delay::new(BATCH_COLLECTING_INTERVAL).await; + Delay::new(BATCH_COLLECTING_INTERVAL).await; + + gum::trace!("Batch should be ready now"); + + let pending_confirmation = assert_matches!( + handle.recv().await, + AllMessages::DisputeCoordinator( + DisputeCoordinatorMessage::ImportStatements { + candidate_receipt: _, + session, + statements, + pending_confirmation: Some(pending_confirmation), + } + ) => { + assert_eq!(session, MOCK_SESSION_INDEX); + // Only 3 as fourth was flood: + assert_eq!(statements.len(), 3); + pending_confirmation + } + ); + pending_confirmation.send(ImportStatementsResult::ValidImport).unwrap(); + + for rx_response in rx_responses { + assert_matches!( + rx_response.await, + Ok(resp) => { + let sc_network::config::OutgoingResponse { + result, + reputation_changes: _, + sent_feedback, + } = resp; + + let result = result.unwrap(); + let decoded = + ::decode(&mut result.as_slice()).unwrap(); + + assert!(decoded == DisputeResponse::Confirmed); + if let Some(sent_feedback) = sent_feedback { + sent_feedback.send(()).unwrap(); + } + gum::trace!( + target: LOG_TARGET, + "Valid import happened." + ); + + } + ); + } + gum::trace!(target: LOG_TARGET, "Concluding."); conclude(&mut handle).await; }; diff --git a/node/network/protocol/src/request_response/mod.rs b/node/network/protocol/src/request_response/mod.rs index 5f4740279ef6..d24537e219c7 100644 --- a/node/network/protocol/src/request_response/mod.rs +++ b/node/network/protocol/src/request_response/mod.rs @@ -121,6 +121,10 @@ const POV_RESPONSE_SIZE: u64 = MAX_POV_SIZE as u64 + 10_000; /// This is `MAX_CODE_SIZE` plus some additional space for protocol overhead. const STATEMENT_RESPONSE_SIZE: u64 = MAX_CODE_SIZE as u64 + 10_000; +/// We can have relative large timeouts here, there is no value of hitting a +/// timeout as we want to get statements through to each node in any case. +pub const DISPUTE_REQUEST_TIMEOUT: Duration = Duration::from_secs(12); + impl Protocol { /// Get a configuration for a given Request response protocol. /// @@ -194,9 +198,7 @@ impl Protocol { /// Responses are just confirmation, in essence not even a bit. So 100 seems /// plenty. max_response_size: 100, - /// We can have relative large timeouts here, there is no value of hitting a - /// timeout as we want to get statements through to each node in any case. - request_timeout: Duration::from_secs(12), + request_timeout: DISPUTE_REQUEST_TIMEOUT, inbound_queue: Some(tx), }, }; diff --git a/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md b/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md index b63ea2bdcbf0..6b8e5ec03cf4 100644 --- a/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md +++ b/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md @@ -15,6 +15,13 @@ This design should result in a protocol that is: ## Protocol +Distributing disputes needs to be a reliable protocol. We would like to make as +sure as possible that our vote got properly delivered to all concerned +validators. For this to work, this subsystem won't be gossip based, but instead +will use a request/response protocol for application level confirmations. The +request will be the payload (the actual votes/statements), the response will +be the confirmation. See [below][#wire-format]. + ### Input [`DisputeDistributionMessage`][DisputeDistributionMessage] @@ -107,16 +114,7 @@ struct VotesResponse { } ``` -## Functionality - -Distributing disputes needs to be a reliable protocol. We would like to make as -sure as possible that our vote got properly delivered to all concerned -validators. For this to work, this subsystem won't be gossip based, but instead -will use a request/response protocol for application level confirmations. The -request will be the payload (the actual votes/statements), the response will -be the confirmation. See [above][#wire-format]. - -### Starting a Dispute +## Starting a Dispute A dispute is initiated once a node sends the first `DisputeRequest` wire message, which must contain an "invalid" vote and a "valid" vote. @@ -132,7 +130,7 @@ conflicting votes available, hence we have a valid dispute. Nodes will still need to check whether the disputing votes are somewhat current and not some stale ones. -### Participating in a Dispute +## Participating in a Dispute Upon receiving a `DisputeRequest` message, a dispute distribution will trigger the import of the received votes via the dispute coordinator @@ -144,13 +142,13 @@ except that if the local node deemed the candidate valid, the `SendDispute` message will contain a valid vote signed by our node and will contain the initially received `Invalid` vote. -Note, that we rely on the coordinator to check availability for spam protection -(see below). +Note, that we rely on `dispute-coordinator` to check validity of a dispute for spam +protection (see below). -### Sending of messages +## Sending of messages Starting and participating in a dispute are pretty similar from the perspective -of dispute distribution. Once we receive a `SendDispute` message we try to make +of dispute distribution. Once we receive a `SendDispute` message, we try to make sure to get the data out. We keep track of all the parachain validators that should see the message, which are all the parachain validators of the session where the dispute happened as they will want to participate in the dispute. In @@ -159,114 +157,185 @@ session (which might be the same or not and may change during the dispute). Those authorities will not participate in the dispute, but need to see the statements so they can include them in blocks. -We keep track of connected parachain validators and authorities and will issue -warnings in the logs if connected nodes are less than two thirds of the -corresponding sets. We also only consider a message transmitted, once we -received a confirmation message. If not, we will keep retrying getting that -message out as long as the dispute is deemed alive. To determine whether a -dispute is still alive we will issue a +### Reliability + +We only consider a message transmitted, once we received a confirmation message. +If not, we will keep retrying getting that message out as long as the dispute is +deemed alive. To determine whether a dispute is still alive we will ask the +`dispute-coordinator` for a list of all still active disputes via a `DisputeCoordinatorMessage::ActiveDisputes` message before each retry run. Once a dispute is no longer live, we will clean up the state accordingly. -### Reception & Spam Considerations - -Because we are not forwarding foreign statements, spam is less of an issue in -comparison to gossip based systems. Rate limiting should be implemented at the -substrate level, see -[#7750](https://github.com/paritytech/substrate/issues/7750). Still we should -make sure that it is not possible via spamming to prevent a dispute concluding -or worse from getting noticed. - -Considered attack vectors: - -1. Invalid disputes (candidate does not exist) could make us - run out of resources. E.g. if we recorded every statement, we could run out - of disk space eventually. -2. An attacker can just flood us with notifications on any notification - protocol, assuming flood protection is not effective enough, our unbounded - buffers can fill up and we will run out of memory eventually. -3. An attacker could participate in a valid dispute, but send its votes multiple - times. -4. Attackers could spam us at a high rate with invalid disputes. Our incoming - queue of requests could get monopolized by those malicious requests and we - won't be able to import any valid disputes and we could run out of resources, - if we tried to process them all in parallel. - -For tackling 1, we make sure to not occupy resources before we don't know a -candidate is available. So we will not record statements to disk until we -recovered availability for the candidate or know by some other means that the -dispute is legit. - -For 2, we will pick up on any dispute on restart, so assuming that any realistic -memory filling attack will take some time, we should be able to participate in a -dispute under such attacks. - -Importing/discarding redundant votes should be pretty quick, so measures with -regards to 4 should suffice to prevent 3, from doing any real harm. - -For 4, full monopolization of the incoming queue should not be possible assuming -substrate handles incoming requests in a somewhat fair way. Still we want some -defense mechanisms, at the very least we need to make sure to not exhaust -resources. - -The dispute coordinator will notify us on import about unavailable candidates or -otherwise invalid imports and we can disconnect from such peers/decrease their -reputation drastically. This alone should get us quite far with regards to queue -monopolization, as availability recovery is expected to fail relatively quickly -for unavailable data. - -Still if those spam messages come at a very high rate, we might still run out of -resources if we immediately call `DisputeCoordinatorMessage::ImportStatements` -on each one of them. Secondly with our assumption of 1/3 dishonest validators, -getting rid of all of them will take some time, depending on reputation timeouts -some of them might even be able to reconnect eventually. - -To mitigate those issues we will process dispute messages with a maximum -parallelism `N`. We initiate import processes for up to `N` candidates in -parallel. Once we reached `N` parallel requests we will start back pressuring on -the incoming requests. This saves us from resource exhaustion. - -To reduce impact of malicious nodes further, we can keep track from which nodes the -currently importing statements came from and will drop requests from nodes that -already have imports in flight. - -Honest nodes are not expected to send dispute statements at a high rate, but -even if they did: - -- we will import at least the first one and if it is valid it will trigger a - dispute, preventing finality. -- Chances are good that the first sent candidate from a peer is indeed the - oldest one (if they differ in age at all). -- for the dropped request any honest node will retry sending. -- there will be other nodes notifying us about that dispute as well. -- honest votes have a speed advantage on average. Apart from the very first - dispute statement for a candidate, which might cause the availability recovery - process, imports of honest votes will be super fast, while for spam imports - they will always take some time as we have to wait for availability to fail. - -So this general rate limit, that we drop requests from same peers if they come -faster than we can import the statements should not cause any problems for -honest nodes and is in their favor. - -Size of `N`: The larger `N` the better we can handle distributed flood attacks -(see previous paragraph), but we also get potentially more availability recovery -processes happening at the same time, which slows down the individual processes. -And we rather want to have one finish quickly than lots slowly at the same time. -On the other hand, valid disputes are expected to be rare, so if we ever exhaust -`N` it is very likely that this is caused by spam and spam recoveries don't cost -too much bandwidth due to empty responses. - -Considering that an attacker would need to attack many nodes in parallel to have -any effect, an `N` of 10 seems to be a good compromise. For honest requests, most -of those imports will likely concern the same candidate, and for dishonest ones -we get to disconnect from up to ten colluding adversaries at a time. - -For the size of the channel for incoming requests: Due to dropping of repeated -requests from same nodes we can make the channel relatively large without fear -of lots of spam requests sitting there wasting our time, even after we already -blocked a peer. For valid disputes, incoming requests can become bursty. On the -other hand we will also be very quick in processing them. A channel size of 100 -requests seems plenty and should be able to handle bursts adequately. +### Order + +We assume `SendDispute` messages are coming in an order of importance, hence +`dispute-distribution` will make sure to send out network messages in the same +order, even on retry. + +### Rate Limit + +For spam protection (see below), we employ an artificial rate limiting on sending +out messages in order to not hit the rate limit at the receiving side, which +would result in our messages getting dropped and our reputation getting reduced. + +## Reception + +As we shall see the receiving side is mostly about handling spam and ensuring +the dispute-coordinator learns about disputes as fast as possible. + +Goals for the receiving side: + +1. Get new disputes to the dispute-coordinator as fast as possible, so + prioritization can happen properly. +2. Batch votes per disputes as much as possible for good import performance. +3. Prevent malicious nodes exhausting node resources by sending lots of messages. +4. Prevent malicious nodes from sending so many messages/(fake) disputes, + preventing us from concluding good ones. +5. Limit ability of malicious nodes of delaying the vote import due to batching + logic. + +Goal 1 and 2 seem to be conflicting, but an easy compromise is possible: When +learning about a new dispute, we will import the vote immediately, making the +dispute coordinator aware and also getting immediate feedback on the validity. +Then if valid we can batch further incoming votes, with less time constraints as +the dispute-coordinator already knows about the dispute. + +Goal 3 and 4 are obviously very related and both can easily be solved via rate +limiting as we shall see below. Rate limits should already be implemented at the +substrate level, but [are not](https://github.com/paritytech/substrate/issues/7750) +at the time of writing. But even if they were, the enforced substrate limits would +likely not be configurable and thus would still be to high for our needs as we can +rely on the following observations: + +1. Each honest validator will only send one message (apart from duplicates on + timeout) per candidate/dispute. +2. An honest validator needs to fully recover availability and validate the + candidate for casting a vote. + +With these two observations, we can conclude that honest validators will usually +not send messages at a high rate. We can therefore enforce conservative rate +limits and thus minimize harm spamming malicious nodes can have. + +Before we dive into how rate limiting solves all spam issues elegantly, let's +discuss that honest behaviour further: + +What about session changes? Here we might have to inform a new validator set of +lots of already existing disputes at once. + +With observation 1) and a rate limit that is per peer, we are still good: + +Let's assume a rate limit of one message per 200ms per sender. This means 5 +messages from each validator per second. 5 messages means 5 disputes! +Conclusively, we will be able to conclude 5 disputes per second - no matter what +malicious actors are doing. This is assuming dispute messages are sent ordered, +but even if not perfectly ordered: On average it will be 5 disputes per second. + +This is good enough! All those disputes are valid ones and will result in +slashing and disabling of validators. Let's assume all of them conclude `valid`, +and we disable validators only after 100 raised concluding valid disputes, we +would still start disabling misbehaving validators in only 20 seconds. + +One could also think that in addition participation is expected to take longer, +which means on average we can import/conclude disputes faster than they are +generated - regardless of dispute spam. Unfortunately this is not necessarily +true: There might be parachains with very light load where recovery and +validation can be accomplished very quickly - maybe faster than we can import +those disputes. + +This is probably an argument for not imposing a too low rate limit, although the +issue is more general: Even without any rate limit, if an attacker generates +disputes at a very high rate, nodes will be having trouble keeping participation +up, hence the problem should be mitigated at a [more fundamental +layer](https://github.com/paritytech/polkadot/issues/5898). + +For nodes that have been offline for a while, the same argument as for session +changes holds, but matters even less: We assume 2/3 of nodes to be online, so +even if the worst case 1/3 offline happens and they could not import votes fast +enough (as argued above, they in fact can) it would not matter for consensus. + +### Rate Limiting + +As suggested previously, rate limiting allows to mitigate all threats that come +from malicious actors trying to overwhelm the system in order to get away without +a slash, when it comes to dispute-distribution. In this section we will explain +how in greater detail. + +The idea is to open a queue with limited size for each peer. We will process +incoming messages as fast as we can by doing the following: + +1. Check that the sending peer is actually a valid authority - otherwise drop + message and decrease reputation/disconnect. +2. Put message on the peer's queue, if queue is full - drop it. + +Every `RATE_LIMIT` seconds (or rather milliseconds), we pause processing +incoming requests to go a full circle and process one message from each queue. +Processing means `Batching` as explained in the next section. + +### Batching + +To achieve goal 2 we will batch incoming votes/messages together before passing +them on as a single batch to the `dispute-coordinator`. To adhere to goal 1 as +well, we will do the following: + +1. For an incoming message, we check whether we have an existing batch for that + candidate, if not we import directly to the dispute-coordinator, as we have + to assume this is concerning a new dispute. +2. We open a batch and start collecting incoming messages for that candidate, + instead of immediately forwarding. +4. We keep collecting votes in the batch until we receive less than + `MIN_KEEP_BATCH_ALIVE_VOTES` unique votes in the last `BATCH_COLLECTING_INTERVAL`. This is + important to accommodate for goal 5 and also 3. +5. We send the whole batch to the dispute-coordinator. + +This together with rate limiting explained above ensures we will be able to +process valid disputes: We can limit the number of simultaneous existing batches +to some high value, but can be rather certain that this limit will never be +reached - hence we won't drop valid disputes: + +Let's assume `MIN_KEEP_BATCH_ALIVE_VOTES` is 10, `BATCH_COLLECTING_INTERVAL` +is `500ms` and above `RATE_LIMIT` is `100ms`. 1/3 of validators are malicious, +so for 1000 this means around 330 malicious actors worst case. + +All those actors can send a message every `100ms`, that is 10 per second. This +means at the begining of an attack they can open up around 3300 batches. Each +containing two votes. So memory usage is still negligible. In reality it is even +less, as we also demand 10 new votes to trickle in per batch in order to keep it +alive, every `500ms`. Hence for the first second, each batch requires 20 votes +each. Each message is 2 votes, so this means 10 messages per batch. Hence to +keep those batches alive 10 attackers are needed for each batch. This reduces +the number of opened batches by a factor of 10: So we only have 330 batches in 1 +second - each containing 20 votes. + +The next second: In order to further grow memory usage, attackers have to +maintain 10 messages per batch and second. Number of batches equals the number +of attackers, each has 10 messages per second, all are needed to maintain the +batches in memory. Therefore we have a hard cap of around 330 (number of +malicious nodes) open batches. Each can be filled with number of malicious +actor's votes. So 330 batches with each 330 votes: Let's assume approximately 100 +bytes per signature/vote. This results in a worst case memory usage of 330 * 330 +* 100 ~= 10 MiB. + +For 10_000 validators, we are already in the Gigabyte range, which means that +with a validator set that large we might want to be more strict with the rate limit or +require a larger rate of incoming votes per batch to keep them alive. + +For a thousand validators a limit on batches of around 1000 should never be +reached in practice. Hence due to rate limiting we have a very good chance to +not ever having to drop a potential valid dispute due to some resource limit. + +Further safe guards are possible: The dispute-coordinator actually +confirms/denies imports. So once we receive a denial by the dispute-coordinator +for the initial imported votes, we can opt into flushing the batch immediately +and importing the votes. This swaps memory usage for more CPU usage, but if that +import is deemed invalid again we can immediately decrease the reputation of the +sending peers, so this should be a net win. For the time being we punt on this +for simplicity. + +Instead of filling batches to maximize memory usage, attackers could also try to +overwhelm the dispute coordinator by only sending votes for new candidates all +the time. This attack vector is mitigated also by above rate limit and +decreasing the peer's reputation on denial of the invalid imports by the +coordinator. ### Node Startup From 2fd74d94d9dcfa5c87649afef2b62170de490953 Mon Sep 17 00:00:00 2001 From: Robert Klotzner Date: Tue, 4 Oct 2022 18:47:52 +0200 Subject: [PATCH 24/49] Add unknown words (#6105) --- scripts/ci/gitlab/lingua.dic | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/ci/gitlab/lingua.dic b/scripts/ci/gitlab/lingua.dic index ea2da595908e..3add6a276cf0 100644 --- a/scripts/ci/gitlab/lingua.dic +++ b/scripts/ci/gitlab/lingua.dic @@ -138,6 +138,7 @@ KYC/M lib libp2p lifecycle/MS +liveness lookahead/MS lookup/MS LRU @@ -222,6 +223,7 @@ redhat/M register/CD relayer repo/MS +requesters reservable responder/SM retriability From 7e89bab93e2dd07201f7833dbde54eab98e6f637 Mon Sep 17 00:00:00 2001 From: Chris Sosnin <48099298+slumber@users.noreply.github.com> Date: Wed, 5 Oct 2022 11:48:50 +0400 Subject: [PATCH 25/49] Buffered connection management for collator-protocol (#6022) * Extract metrics into a separate module * Introduce validators buffer * Integrate buffer into the subsystem * Only reconnect on new advertisements * Test * comma * doc comment * Make capacity buffer compile time non-zero * Add doc comments * nits * remove derives * review * better naming * check timeout * Extract interval stream into lib * Ensure collator disconnects after timeout * spellcheck * rename buf * Remove double interval * Add a log on timeout * Cleanup buffer on timeout --- Cargo.lock | 5 +- node/network/collator-protocol/Cargo.toml | 1 + .../src/collator_side/metrics.rs | 123 +++++++ .../src/collator_side/mod.rs | 254 +++++++------- .../src/collator_side/tests.rs | 116 ++++++- .../src/collator_side/validators_buffer.rs | 317 ++++++++++++++++++ node/network/collator-protocol/src/lib.rs | 27 +- .../src/validator_side/mod.rs | 29 +- 8 files changed, 707 insertions(+), 165 deletions(-) create mode 100644 node/network/collator-protocol/src/collator_side/metrics.rs create mode 100644 node/network/collator-protocol/src/collator_side/validators_buffer.rs diff --git a/Cargo.lock b/Cargo.lock index 35cfaf7e9228..c6b5762e9750 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -555,9 +555,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitvec" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1489fcb93a5bb47da0462ca93ad252ad6af2145cce58d10d46a83931ba9f016b" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", "radium", @@ -6290,6 +6290,7 @@ version = "0.9.29" dependencies = [ "always-assert", "assert_matches", + "bitvec", "env_logger 0.9.0", "fatality", "futures", diff --git a/node/network/collator-protocol/Cargo.toml b/node/network/collator-protocol/Cargo.toml index df9e75c9e951..e089719106b5 100644 --- a/node/network/collator-protocol/Cargo.toml +++ b/node/network/collator-protocol/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [dependencies] always-assert = "0.1.2" +bitvec = { version = "1.0.1", default-features = false, features = ["alloc"] } futures = "0.3.21" futures-timer = "3" gum = { package = "tracing-gum", path = "../../gum" } diff --git a/node/network/collator-protocol/src/collator_side/metrics.rs b/node/network/collator-protocol/src/collator_side/metrics.rs new file mode 100644 index 000000000000..85e00406b9ba --- /dev/null +++ b/node/network/collator-protocol/src/collator_side/metrics.rs @@ -0,0 +1,123 @@ +// Copyright 2017-2022 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 . + +use polkadot_node_subsystem_util::metrics::{self, prometheus}; + +#[derive(Clone, Default)] +pub struct Metrics(Option); + +impl Metrics { + pub fn on_advertisment_made(&self) { + if let Some(metrics) = &self.0 { + metrics.advertisements_made.inc(); + } + } + + pub fn on_collation_sent_requested(&self) { + if let Some(metrics) = &self.0 { + metrics.collations_send_requested.inc(); + } + } + + pub fn on_collation_sent(&self) { + if let Some(metrics) = &self.0 { + metrics.collations_sent.inc(); + } + } + + /// Provide a timer for `process_msg` which observes on drop. + pub fn time_process_msg(&self) -> Option { + self.0.as_ref().map(|metrics| metrics.process_msg.start_timer()) + } + + /// Provide a timer for `distribute_collation` which observes on drop. + pub fn time_collation_distribution( + &self, + label: &'static str, + ) -> Option { + self.0.as_ref().map(|metrics| { + metrics.collation_distribution_time.with_label_values(&[label]).start_timer() + }) + } +} + +#[derive(Clone)] +struct MetricsInner { + advertisements_made: prometheus::Counter, + collations_sent: prometheus::Counter, + collations_send_requested: prometheus::Counter, + process_msg: prometheus::Histogram, + collation_distribution_time: prometheus::HistogramVec, +} + +impl metrics::Metrics for Metrics { + fn try_register( + registry: &prometheus::Registry, + ) -> std::result::Result { + let metrics = MetricsInner { + advertisements_made: prometheus::register( + prometheus::Counter::new( + "polkadot_parachain_collation_advertisements_made_total", + "A number of collation advertisements sent to validators.", + )?, + registry, + )?, + collations_send_requested: prometheus::register( + prometheus::Counter::new( + "polkadot_parachain_collations_sent_requested_total", + "A number of collations requested to be sent to validators.", + )?, + registry, + )?, + collations_sent: prometheus::register( + prometheus::Counter::new( + "polkadot_parachain_collations_sent_total", + "A number of collations sent to validators.", + )?, + registry, + )?, + process_msg: prometheus::register( + prometheus::Histogram::with_opts( + prometheus::HistogramOpts::new( + "polkadot_parachain_collator_protocol_collator_process_msg", + "Time spent within `collator_protocol_collator::process_msg`", + ) + .buckets(vec![ + 0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.35, 0.5, 0.75, + 1.0, + ]), + )?, + registry, + )?, + collation_distribution_time: prometheus::register( + prometheus::HistogramVec::new( + prometheus::HistogramOpts::new( + "polkadot_parachain_collator_protocol_collator_distribution_time", + "Time spent within `collator_protocol_collator::distribute_collation`", + ) + .buckets(vec![ + 0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.35, 0.5, 0.75, + 1.0, + ]), + &["state"], + )?, + registry, + )?, + }; + + Ok(Metrics(Some(metrics))) + } +} diff --git a/node/network/collator-protocol/src/collator_side/mod.rs b/node/network/collator-protocol/src/collator_side/mod.rs index c1a20a2a670b..4f2eea2ca747 100644 --- a/node/network/collator-protocol/src/collator_side/mod.rs +++ b/node/network/collator-protocol/src/collator_side/mod.rs @@ -17,7 +17,7 @@ use std::{ collections::{HashMap, HashSet, VecDeque}, pin::Pin, - time::Duration, + time::{Duration, Instant}, }; use futures::{ @@ -44,19 +44,25 @@ use polkadot_node_subsystem::{ overseer, FromOrchestra, OverseerSignal, PerLeafSpan, }; use polkadot_node_subsystem_util::{ - metrics::{self, prometheus}, runtime::{get_availability_cores, get_group_rotation_info, RuntimeInfo}, TimeoutExt, }; use polkadot_primitives::v2::{ AuthorityDiscoveryId, CandidateHash, CandidateReceipt, CollatorPair, CoreIndex, CoreState, - Hash, Id as ParaId, + GroupIndex, Hash, Id as ParaId, SessionIndex, }; use super::LOG_TARGET; use crate::error::{log_error, Error, FatalError, Result}; use fatality::Split; +mod metrics; +mod validators_buffer; + +use validators_buffer::{ValidatorGroupsBuffer, VALIDATORS_BUFFER_CAPACITY}; + +pub use metrics::Metrics; + #[cfg(test)] mod tests; @@ -73,111 +79,16 @@ const COST_APPARENT_FLOOD: Rep = /// For considerations on this value, see: https://github.com/paritytech/polkadot/issues/4386 const MAX_UNSHARED_UPLOAD_TIME: Duration = Duration::from_millis(150); -#[derive(Clone, Default)] -pub struct Metrics(Option); - -impl Metrics { - fn on_advertisment_made(&self) { - if let Some(metrics) = &self.0 { - metrics.advertisements_made.inc(); - } - } - - fn on_collation_sent_requested(&self) { - if let Some(metrics) = &self.0 { - metrics.collations_send_requested.inc(); - } - } - - fn on_collation_sent(&self) { - if let Some(metrics) = &self.0 { - metrics.collations_sent.inc(); - } - } - - /// Provide a timer for `process_msg` which observes on drop. - fn time_process_msg(&self) -> Option { - self.0.as_ref().map(|metrics| metrics.process_msg.start_timer()) - } - - /// Provide a timer for `distribute_collation` which observes on drop. - fn time_collation_distribution( - &self, - label: &'static str, - ) -> Option { - self.0.as_ref().map(|metrics| { - metrics.collation_distribution_time.with_label_values(&[label]).start_timer() - }) - } -} - -#[derive(Clone)] -struct MetricsInner { - advertisements_made: prometheus::Counter, - collations_sent: prometheus::Counter, - collations_send_requested: prometheus::Counter, - process_msg: prometheus::Histogram, - collation_distribution_time: prometheus::HistogramVec, -} +/// Ensure that collator issues a connection request at least once every this many seconds. +/// Usually it's done when advertising new collation. However, if the core stays occupied or +/// it's not our turn to produce a candidate, it's important to disconnect from previous +/// peers. +/// +/// Validators are obtained from [`ValidatorGroupsBuffer::validators_to_connect`]. +const RECONNECT_TIMEOUT: Duration = Duration::from_secs(12); -impl metrics::Metrics for Metrics { - fn try_register( - registry: &prometheus::Registry, - ) -> std::result::Result { - let metrics = MetricsInner { - advertisements_made: prometheus::register( - prometheus::Counter::new( - "polkadot_parachain_collation_advertisements_made_total", - "A number of collation advertisements sent to validators.", - )?, - registry, - )?, - collations_send_requested: prometheus::register( - prometheus::Counter::new( - "polkadot_parachain_collations_sent_requested_total", - "A number of collations requested to be sent to validators.", - )?, - registry, - )?, - collations_sent: prometheus::register( - prometheus::Counter::new( - "polkadot_parachain_collations_sent_total", - "A number of collations sent to validators.", - )?, - registry, - )?, - process_msg: prometheus::register( - prometheus::Histogram::with_opts( - prometheus::HistogramOpts::new( - "polkadot_parachain_collator_protocol_collator_process_msg", - "Time spent within `collator_protocol_collator::process_msg`", - ) - .buckets(vec![ - 0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.35, 0.5, 0.75, - 1.0, - ]), - )?, - registry, - )?, - collation_distribution_time: prometheus::register( - prometheus::HistogramVec::new( - prometheus::HistogramOpts::new( - "polkadot_parachain_collator_protocol_collator_distribution_time", - "Time spent within `collator_protocol_collator::distribute_collation`", - ) - .buckets(vec![ - 0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.35, 0.5, 0.75, - 1.0, - ]), - &["state"], - )?, - registry, - )?, - }; - - Ok(Metrics(Some(metrics))) - } -} +/// How often to check for reconnect timeout. +const RECONNECT_POLL: Duration = Duration::from_secs(1); /// Info about validators we are currently connected to. /// @@ -269,8 +180,14 @@ struct WaitingCollationFetches { waiting_peers: HashSet, } +struct CollationSendResult { + relay_parent: Hash, + peer_id: PeerId, + timed_out: bool, +} + type ActiveCollationFetches = - FuturesUnordered + Send + 'static>>>; + FuturesUnordered + Send + 'static>>>; struct State { /// Our network peer id. @@ -308,6 +225,13 @@ struct State { /// by `PeerConnected` events. peer_ids: HashMap>, + /// Tracks which validators we want to stay connected to. + validator_groups_buf: ValidatorGroupsBuffer, + + /// Timestamp of the last connection request to a non-empty list of validators, + /// `None` otherwise. + last_connected_at: Option, + /// Metrics. metrics: Metrics, @@ -339,6 +263,8 @@ impl State { collation_result_senders: Default::default(), our_validators_groups: Default::default(), peer_ids: Default::default(), + validator_groups_buf: ValidatorGroupsBuffer::with_capacity(VALIDATORS_BUFFER_CAPACITY), + last_connected_at: None, waiting_collation_fetches: Default::default(), active_collation_fetches: Default::default(), } @@ -373,6 +299,7 @@ async fn distribute_collation( result_sender: Option>, ) -> Result<()> { let relay_parent = receipt.descriptor.relay_parent; + let candidate_hash = receipt.hash(); // This collation is not in the active-leaves set. if !state.view.contains(&relay_parent) { @@ -412,10 +339,10 @@ async fn distribute_collation( }; // Determine the group on that core. - let current_validators = + let GroupValidators { validators, session_index, group_index } = determine_our_validators(ctx, runtime, our_core, num_cores, relay_parent).await?; - if current_validators.validators.is_empty() { + if validators.is_empty() { gum::warn!( target: LOG_TARGET, core = ?our_core, @@ -425,24 +352,36 @@ async fn distribute_collation( return Ok(()) } + // It's important to insert new collation bits **before** + // issuing a connection request. + // + // If a validator managed to fetch all the relevant collations + // but still assigned to our core, we keep the connection alive. + state.validator_groups_buf.note_collation_advertised( + relay_parent, + session_index, + group_index, + &validators, + ); + gum::debug!( target: LOG_TARGET, para_id = %id, relay_parent = %relay_parent, - candidate_hash = ?receipt.hash(), + ?candidate_hash, pov_hash = ?pov.hash(), core = ?our_core, - ?current_validators, + current_validators = ?validators, "Accepted collation, connecting to validators." ); - // Issue a discovery request for the validators of the current group: - connect_to_validators(ctx, current_validators.validators.into_iter().collect()).await; + // Update a set of connected validators if necessary. + state.last_connected_at = connect_to_validators(ctx, &state.validator_groups_buf).await; state.our_validators_groups.insert(relay_parent, ValidatorGroup::new()); if let Some(result_sender) = result_sender { - state.collation_result_senders.insert(receipt.hash(), result_sender); + state.collation_result_senders.insert(candidate_hash, result_sender); } state @@ -483,6 +422,9 @@ async fn determine_core( struct GroupValidators { /// The validators of above group (their discovery keys). validators: Vec, + + session_index: SessionIndex, + group_index: GroupIndex, } /// Figure out current group of validators assigned to the para being collated on. @@ -516,7 +458,11 @@ async fn determine_our_validators( let current_validators = current_validators.iter().map(|i| validators[i.0 as usize].clone()).collect(); - let current_validators = GroupValidators { validators: current_validators }; + let current_validators = GroupValidators { + validators: current_validators, + session_index, + group_index: current_group_index, + }; Ok(current_validators) } @@ -541,13 +487,19 @@ async fn declare(ctx: &mut Context, state: &mut State, peer: PeerId) { } } -/// Issue a connection request to a set of validators and -/// revoke the previous connection request. +/// Updates a set of connected validators based on their advertisement-bits +/// in a validators buffer. +/// +/// Returns current timestamp if the connection request was non-empty, `None` +/// otherwise. #[overseer::contextbounds(CollatorProtocol, prefix = self::overseer)] async fn connect_to_validators( ctx: &mut Context, - validator_ids: Vec, -) { + validator_groups_buf: &ValidatorGroupsBuffer, +) -> Option { + let validator_ids = validator_groups_buf.validators_to_connect(); + let is_disconnect = validator_ids.is_empty(); + // ignore address resolution failure // will reissue a new request on new collation let (failed, _) = oneshot::channel(); @@ -557,6 +509,8 @@ async fn connect_to_validators( failed, }) .await; + + (!is_disconnect).then_some(Instant::now()) } /// Advertise collation to the given `peer`. @@ -715,15 +669,9 @@ async fn send_collation( state.active_collation_fetches.push( async move { let r = rx.timeout(MAX_UNSHARED_UPLOAD_TIME).await; - if r.is_none() { - gum::debug!( - target: LOG_TARGET, - ?relay_parent, - ?peer_id, - "Sending collation to validator timed out, carrying on with next validator." - ); - } - (relay_parent, peer_id) + let timed_out = r.is_none(); + + CollationSendResult { relay_parent, peer_id, timed_out } } .boxed(), ); @@ -986,6 +934,7 @@ async fn handle_our_view_change(state: &mut State, view: OurView) -> Result<()> state.our_validators_groups.remove(removed); state.span_per_relay_parent.remove(removed); state.waiting_collation_fetches.remove(removed); + state.validator_groups_buf.remove_relay_parent(removed); } state.view = view; @@ -1007,6 +956,9 @@ pub(crate) async fn run( let mut state = State::new(local_peer_id, collator_pair, metrics); let mut runtime = RuntimeInfo::new(None); + let reconnect_stream = super::tick_stream(RECONNECT_POLL); + pin_mut!(reconnect_stream); + loop { let recv_req = req_receiver.recv(|| vec![COST_INVALID_REQUEST]).fuse(); pin_mut!(recv_req); @@ -1022,7 +974,25 @@ pub(crate) async fn run( FromOrchestra::Signal(BlockFinalized(..)) => {} FromOrchestra::Signal(Conclude) => return Ok(()), }, - (relay_parent, peer_id) = state.active_collation_fetches.select_next_some() => { + CollationSendResult { + relay_parent, + peer_id, + timed_out, + } = state.active_collation_fetches.select_next_some() => { + if timed_out { + gum::debug!( + target: LOG_TARGET, + ?relay_parent, + ?peer_id, + "Sending collation to validator timed out, carrying on with next validator", + ); + } else { + for authority_id in state.peer_ids.get(&peer_id).into_iter().flatten() { + // Timeout not hit, this peer is no longer interested in this relay parent. + state.validator_groups_buf.reset_validator_interest(relay_parent, authority_id); + } + } + let next = if let Some(waiting) = state.waiting_collation_fetches.get_mut(&relay_parent) { waiting.waiting_peers.remove(&peer_id); if let Some(next) = waiting.waiting.pop_front() { @@ -1042,7 +1012,29 @@ pub(crate) async fn run( send_collation(&mut state, next, receipt, pov).await; } - } + }, + _ = reconnect_stream.next() => { + let now = Instant::now(); + if state + .last_connected_at + .map_or(false, |timestamp| now - timestamp > RECONNECT_TIMEOUT) + { + // Remove all advertisements from the buffer if the timeout was hit. + // Usually, it shouldn't be necessary as leaves get deactivated, rather + // serves as a safeguard against finality lags. + state.validator_groups_buf.clear_advertisements(); + // Returns `None` if connection request is empty. + state.last_connected_at = + connect_to_validators(&mut ctx, &state.validator_groups_buf).await; + + gum::debug!( + target: LOG_TARGET, + timeout = ?RECONNECT_TIMEOUT, + "Timeout hit, sent a connection request. Disconnected from all validators = {}", + state.last_connected_at.is_none(), + ); + } + }, in_req = recv_req => { match in_req { Ok(req) => { diff --git a/node/network/collator-protocol/src/collator_side/tests.rs b/node/network/collator-protocol/src/collator_side/tests.rs index 2d2f2cf043de..c20a2d6c97a5 100644 --- a/node/network/collator-protocol/src/collator_side/tests.rs +++ b/node/network/collator-protocol/src/collator_side/tests.rs @@ -56,7 +56,7 @@ struct TestState { group_rotation_info: GroupRotationInfo, validator_peer_id: Vec, relay_parent: Hash, - availability_core: CoreState, + availability_cores: Vec, local_peer_id: PeerId, collator_pair: CollatorPair, session_index: SessionIndex, @@ -88,14 +88,15 @@ impl Default for TestState { let validator_peer_id = std::iter::repeat_with(|| PeerId::random()).take(discovery_keys.len()).collect(); - let validator_groups = vec![vec![2, 0, 4], vec![3, 2, 4]] + let validator_groups = vec![vec![2, 0, 4], vec![1, 3]] .into_iter() .map(|g| g.into_iter().map(ValidatorIndex).collect()) .collect(); let group_rotation_info = GroupRotationInfo { session_start_block: 0, group_rotation_frequency: 100, now: 1 }; - let availability_core = CoreState::Scheduled(ScheduledCore { para_id, collator: None }); + let availability_cores = + vec![CoreState::Scheduled(ScheduledCore { para_id, collator: None }), CoreState::Free]; let relay_parent = Hash::random(); @@ -122,7 +123,7 @@ impl Default for TestState { group_rotation_info, validator_peer_id, relay_parent, - availability_core, + availability_cores, local_peer_id, collator_pair, session_index: 1, @@ -132,7 +133,9 @@ impl Default for TestState { impl TestState { fn current_group_validator_indices(&self) -> &[ValidatorIndex] { - &self.session_info.validator_groups[0] + let core_num = self.availability_cores.len(); + let GroupIndex(group_idx) = self.group_rotation_info.group_for_core(CoreIndex(0), core_num); + &self.session_info.validator_groups[group_idx as usize] } fn current_session_index(&self) -> SessionIndex { @@ -333,7 +336,7 @@ async fn distribute_collation( RuntimeApiRequest::AvailabilityCores(tx) )) => { assert_eq!(relay_parent, test_state.relay_parent); - tx.send(Ok(vec![test_state.availability_core.clone()])).unwrap(); + tx.send(Ok(test_state.availability_cores.clone())).unwrap(); } ); @@ -987,3 +990,104 @@ where test_harness }); } + +#[test] +fn connect_to_buffered_groups() { + let mut test_state = TestState::default(); + let local_peer_id = test_state.local_peer_id.clone(); + let collator_pair = test_state.collator_pair.clone(); + + test_harness(local_peer_id, collator_pair, |test_harness| async move { + let mut virtual_overseer = test_harness.virtual_overseer; + let mut req_cfg = test_harness.req_cfg; + + setup_system(&mut virtual_overseer, &test_state).await; + + let group_a = test_state.current_group_validator_authority_ids(); + let peers_a = test_state.current_group_validator_peer_ids(); + assert!(group_a.len() > 1); + + distribute_collation(&mut virtual_overseer, &test_state, false).await; + + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::NetworkBridgeTx( + NetworkBridgeTxMessage::ConnectToValidators { validator_ids, .. } + ) => { + assert_eq!(group_a, validator_ids); + } + ); + + let head_a = test_state.relay_parent; + + for (val, peer) in group_a.iter().zip(&peers_a) { + connect_peer(&mut virtual_overseer, peer.clone(), Some(val.clone())).await; + } + + for peer_id in &peers_a { + expect_declare_msg(&mut virtual_overseer, &test_state, peer_id).await; + } + + // Update views. + for peed_id in &peers_a { + send_peer_view_change(&mut virtual_overseer, peed_id, vec![head_a]).await; + expect_advertise_collation_msg(&mut virtual_overseer, peed_id, head_a).await; + } + + let peer = peers_a[0]; + // Peer from the group fetches the collation. + let (pending_response, rx) = oneshot::channel(); + req_cfg + .inbound_queue + .as_mut() + .unwrap() + .send(RawIncomingRequest { + peer, + payload: CollationFetchingRequest { + relay_parent: head_a, + para_id: test_state.para_id, + } + .encode(), + pending_response, + }) + .await + .unwrap(); + assert_matches!( + rx.await, + Ok(full_response) => { + let CollationFetchingResponse::Collation(..): CollationFetchingResponse = + CollationFetchingResponse::decode( + &mut full_response.result.expect("We should have a proper answer").as_ref(), + ) + .expect("Decoding should work"); + } + ); + + test_state.advance_to_new_round(&mut virtual_overseer, true).await; + test_state.group_rotation_info = test_state.group_rotation_info.bump_rotation(); + + let head_b = test_state.relay_parent; + let group_b = test_state.current_group_validator_authority_ids(); + assert_ne!(head_a, head_b); + assert_ne!(group_a, group_b); + + distribute_collation(&mut virtual_overseer, &test_state, false).await; + + // Should be connected to both groups except for the validator that fetched advertised + // collation. + assert_matches!( + overseer_recv(&mut virtual_overseer).await, + AllMessages::NetworkBridgeTx( + NetworkBridgeTxMessage::ConnectToValidators { validator_ids, .. } + ) => { + assert!(!validator_ids.contains(&group_a[0])); + + for validator in group_a[1..].iter().chain(&group_b) { + assert!(validator_ids.contains(validator)); + } + } + ); + + TestHarness { virtual_overseer, req_cfg } + }); +} diff --git a/node/network/collator-protocol/src/collator_side/validators_buffer.rs b/node/network/collator-protocol/src/collator_side/validators_buffer.rs new file mode 100644 index 000000000000..5bb31c72d6c5 --- /dev/null +++ b/node/network/collator-protocol/src/collator_side/validators_buffer.rs @@ -0,0 +1,317 @@ +// Copyright 2017-2022 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 . + +//! Validator groups buffer for connection managements. +//! +//! Solves 2 problems: +//! 1. A collator may want to stay connected to multiple groups on rotation boundaries. +//! 2. It's important to disconnect from validator when there're no collations to be fetched. +//! +//! We keep a simple FIFO buffer of N validator groups and a bitvec for each advertisement, +//! 1 indicating we want to be connected to i-th validator in a buffer, 0 otherwise. +//! +//! The bit is set to 1 for the whole **group** whenever it's inserted into the buffer. Given a relay +//! parent, one can reset a bit back to 0 for particular **validator**. For example, if a collation +//! was fetched or some timeout has been hit. +//! +//! The bitwise OR over known advertisements gives us validators indices for connection request. + +use std::{ + collections::{HashMap, VecDeque}, + num::NonZeroUsize, + ops::Range, +}; + +use bitvec::{bitvec, vec::BitVec}; + +use polkadot_primitives::v2::{AuthorityDiscoveryId, GroupIndex, Hash, SessionIndex}; + +/// The ring buffer stores at most this many unique validator groups. +/// +/// This value should be chosen in way that all groups assigned to our para +/// in the view can fit into the buffer. +pub const VALIDATORS_BUFFER_CAPACITY: NonZeroUsize = match NonZeroUsize::new(3) { + Some(cap) => cap, + None => panic!("buffer capacity must be non-zero"), +}; + +/// Unique identifier of a validators group. +#[derive(Debug)] +struct ValidatorsGroupInfo { + /// Number of validators in the group. + len: usize, + session_index: SessionIndex, + group_index: GroupIndex, +} + +/// Ring buffer of validator groups. +/// +/// Tracks which peers we want to be connected to with respect to advertised collations. +#[derive(Debug)] +pub struct ValidatorGroupsBuffer { + /// Validator groups identifiers we **had** advertisements for. + group_infos: VecDeque, + /// Continuous buffer of validators discovery keys. + validators: VecDeque, + /// Mapping from relay-parent to bit-vectors with bits for all `validators`. + /// Invariants kept: All bit-vectors are guaranteed to have the same size. + should_be_connected: HashMap, + /// Buffer capacity, limits the number of **groups** tracked. + cap: NonZeroUsize, +} + +impl ValidatorGroupsBuffer { + /// Creates a new buffer with a non-zero capacity. + pub fn with_capacity(cap: NonZeroUsize) -> Self { + Self { + group_infos: VecDeque::new(), + validators: VecDeque::new(), + should_be_connected: HashMap::new(), + cap, + } + } + + /// Returns discovery ids of validators we have at least one advertised-but-not-fetched + /// collation for. + pub fn validators_to_connect(&self) -> Vec { + let validators_num = self.validators.len(); + let bits = self + .should_be_connected + .values() + .fold(bitvec![0; validators_num], |acc, next| acc | next); + + self.validators + .iter() + .enumerate() + .filter_map(|(idx, authority_id)| bits[idx].then_some(authority_id.clone())) + .collect() + } + + /// Note a new advertisement, marking that we want to be connected to validators + /// from this group. + /// + /// If max capacity is reached and the group is new, drops validators from the back + /// of the buffer. + pub fn note_collation_advertised( + &mut self, + relay_parent: Hash, + session_index: SessionIndex, + group_index: GroupIndex, + validators: &[AuthorityDiscoveryId], + ) { + if validators.is_empty() { + return + } + + match self.group_infos.iter().enumerate().find(|(_, group)| { + group.session_index == session_index && group.group_index == group_index + }) { + Some((idx, group)) => { + let group_start_idx = self.group_lengths_iter().take(idx).sum(); + self.set_bits(relay_parent, group_start_idx..(group_start_idx + group.len)); + }, + None => self.push(relay_parent, session_index, group_index, validators), + } + } + + /// Note that a validator is no longer interested in a given relay parent. + pub fn reset_validator_interest( + &mut self, + relay_parent: Hash, + authority_id: &AuthorityDiscoveryId, + ) { + let bits = match self.should_be_connected.get_mut(&relay_parent) { + Some(bits) => bits, + None => return, + }; + + for (idx, auth_id) in self.validators.iter().enumerate() { + if auth_id == authority_id { + bits.set(idx, false); + } + } + } + + /// Remove relay parent from the buffer. + /// + /// The buffer will no longer track which validators are interested in a corresponding + /// advertisement. + pub fn remove_relay_parent(&mut self, relay_parent: &Hash) { + self.should_be_connected.remove(relay_parent); + } + + /// Removes all advertisements from the buffer. + pub fn clear_advertisements(&mut self) { + self.should_be_connected.clear(); + } + + /// Pushes a new group to the buffer along with advertisement, setting all validators + /// bits to 1. + /// + /// If the buffer is full, drops group from the tail. + fn push( + &mut self, + relay_parent: Hash, + session_index: SessionIndex, + group_index: GroupIndex, + validators: &[AuthorityDiscoveryId], + ) { + let new_group_info = + ValidatorsGroupInfo { len: validators.len(), session_index, group_index }; + + let buf = &mut self.group_infos; + let cap = self.cap.get(); + + if buf.len() >= cap { + let pruned_group = buf.pop_front().expect("buf is not empty; qed"); + self.validators.drain(..pruned_group.len); + + self.should_be_connected.values_mut().for_each(|bits| { + bits.as_mut_bitslice().shift_left(pruned_group.len); + }); + } + + self.validators.extend(validators.iter().cloned()); + buf.push_back(new_group_info); + let buf_len = buf.len(); + let group_start_idx = self.group_lengths_iter().take(buf_len - 1).sum(); + + let new_len = self.validators.len(); + self.should_be_connected + .values_mut() + .for_each(|bits| bits.resize(new_len, false)); + self.set_bits(relay_parent, group_start_idx..(group_start_idx + validators.len())); + } + + /// Sets advertisement bits to 1 in a given range (usually corresponding to some group). + /// If the relay parent is unknown, inserts 0-initialized bitvec first. + /// + /// The range must be ensured to be within bounds. + fn set_bits(&mut self, relay_parent: Hash, range: Range) { + let bits = self + .should_be_connected + .entry(relay_parent) + .or_insert_with(|| bitvec![0; self.validators.len()]); + + bits[range].fill(true); + } + + /// Returns iterator over numbers of validators in groups. + /// + /// Useful for getting an index of the first validator in i-th group. + fn group_lengths_iter(&self) -> impl Iterator + '_ { + self.group_infos.iter().map(|group| group.len) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use sp_keyring::Sr25519Keyring; + + #[test] + fn one_capacity_buffer() { + let cap = NonZeroUsize::new(1).unwrap(); + let mut buf = ValidatorGroupsBuffer::with_capacity(cap); + + let hash_a = Hash::repeat_byte(0x1); + let hash_b = Hash::repeat_byte(0x2); + + let validators: Vec<_> = [ + Sr25519Keyring::Alice, + Sr25519Keyring::Bob, + Sr25519Keyring::Charlie, + Sr25519Keyring::Dave, + Sr25519Keyring::Ferdie, + ] + .into_iter() + .map(|key| AuthorityDiscoveryId::from(key.public())) + .collect(); + + assert!(buf.validators_to_connect().is_empty()); + + buf.note_collation_advertised(hash_a, 0, GroupIndex(0), &validators[..2]); + assert_eq!(buf.validators_to_connect(), validators[..2].to_vec()); + + buf.reset_validator_interest(hash_a, &validators[1]); + assert_eq!(buf.validators_to_connect(), vec![validators[0].clone()]); + + buf.note_collation_advertised(hash_b, 0, GroupIndex(1), &validators[2..]); + assert_eq!(buf.validators_to_connect(), validators[2..].to_vec()); + + for validator in &validators[2..] { + buf.reset_validator_interest(hash_b, validator); + } + assert!(buf.validators_to_connect().is_empty()); + } + + #[test] + fn buffer_works() { + let cap = NonZeroUsize::new(3).unwrap(); + let mut buf = ValidatorGroupsBuffer::with_capacity(cap); + + let hashes: Vec<_> = (0..5).map(Hash::repeat_byte).collect(); + + let validators: Vec<_> = [ + Sr25519Keyring::Alice, + Sr25519Keyring::Bob, + Sr25519Keyring::Charlie, + Sr25519Keyring::Dave, + Sr25519Keyring::Ferdie, + ] + .into_iter() + .map(|key| AuthorityDiscoveryId::from(key.public())) + .collect(); + + buf.note_collation_advertised(hashes[0], 0, GroupIndex(0), &validators[..2]); + buf.note_collation_advertised(hashes[1], 0, GroupIndex(0), &validators[..2]); + buf.note_collation_advertised(hashes[2], 0, GroupIndex(1), &validators[2..4]); + buf.note_collation_advertised(hashes[2], 0, GroupIndex(1), &validators[2..4]); + + assert_eq!(buf.validators_to_connect(), validators[..4].to_vec()); + + for validator in &validators[2..4] { + buf.reset_validator_interest(hashes[2], validator); + } + + buf.reset_validator_interest(hashes[1], &validators[0]); + assert_eq!(buf.validators_to_connect(), validators[..2].to_vec()); + + buf.reset_validator_interest(hashes[0], &validators[0]); + assert_eq!(buf.validators_to_connect(), vec![validators[1].clone()]); + + buf.note_collation_advertised(hashes[3], 0, GroupIndex(1), &validators[2..4]); + buf.note_collation_advertised( + hashes[4], + 0, + GroupIndex(2), + std::slice::from_ref(&validators[4]), + ); + + buf.reset_validator_interest(hashes[3], &validators[2]); + buf.note_collation_advertised( + hashes[4], + 0, + GroupIndex(3), + std::slice::from_ref(&validators[0]), + ); + + assert_eq!( + buf.validators_to_connect(), + vec![validators[3].clone(), validators[4].clone(), validators[0].clone()] + ); + } +} diff --git a/node/network/collator-protocol/src/lib.rs b/node/network/collator-protocol/src/lib.rs index 66659e4b5bee..b71acc127c88 100644 --- a/node/network/collator-protocol/src/lib.rs +++ b/node/network/collator-protocol/src/lib.rs @@ -21,9 +21,12 @@ #![deny(unused_crate_dependencies)] #![recursion_limit = "256"] -use std::time::Duration; +use std::time::{Duration, Instant}; -use futures::{FutureExt, TryFutureExt}; +use futures::{ + stream::{FusedStream, StreamExt}, + FutureExt, TryFutureExt, +}; use sp_keystore::SyncCryptoStorePtr; @@ -134,3 +137,23 @@ async fn modify_reputation( sender.send_message(NetworkBridgeTxMessage::ReportPeer(peer, rep)).await; } + +/// Wait until tick and return the timestamp for the following one. +async fn wait_until_next_tick(last_poll: Instant, period: Duration) -> Instant { + let now = Instant::now(); + let next_poll = last_poll + period; + + if next_poll > now { + futures_timer::Delay::new(next_poll - now).await + } + + Instant::now() +} + +/// Returns an infinite stream that yields with an interval of `period`. +fn tick_stream(period: Duration) -> impl FusedStream { + futures::stream::unfold(Instant::now(), move |next_check| async move { + Some(((), wait_until_next_tick(next_check, period).await)) + }) + .fuse() +} diff --git a/node/network/collator-protocol/src/validator_side/mod.rs b/node/network/collator-protocol/src/validator_side/mod.rs index 47795aac0ce2..b74c1d5b5a4f 100644 --- a/node/network/collator-protocol/src/validator_side/mod.rs +++ b/node/network/collator-protocol/src/validator_side/mod.rs @@ -19,7 +19,7 @@ use futures::{ channel::oneshot, future::{BoxFuture, Fuse, FusedFuture}, select, - stream::{FusedStream, FuturesUnordered}, + stream::FuturesUnordered, FutureExt, StreamExt, }; use futures_timer::Delay; @@ -57,7 +57,7 @@ use polkadot_primitives::v2::{CandidateReceipt, CollatorId, Hash, Id as ParaId}; use crate::error::Result; -use super::{modify_reputation, LOG_TARGET}; +use super::{modify_reputation, tick_stream, LOG_TARGET}; #[cfg(test)] mod tests; @@ -97,7 +97,7 @@ const ACTIVITY_POLL: Duration = Duration::from_millis(10); // How often to poll collation responses. // This is a hack that should be removed in a refactoring. // See https://github.com/paritytech/polkadot/issues/4182 -const CHECK_COLLATIONS_POLL: Duration = Duration::from_millis(5); +const CHECK_COLLATIONS_POLL: Duration = Duration::from_millis(50); #[derive(Clone, Default)] pub struct Metrics(Option); @@ -1167,25 +1167,6 @@ async fn process_msg( } } -// wait until next inactivity check. returns the instant for the following check. -async fn wait_until_next_check(last_poll: Instant) -> Instant { - let now = Instant::now(); - let next_poll = last_poll + ACTIVITY_POLL; - - if next_poll > now { - Delay::new(next_poll - now).await - } - - Instant::now() -} - -fn infinite_stream(every: Duration) -> impl FusedStream { - futures::stream::unfold(Instant::now() + every, |next_check| async move { - Some(((), wait_until_next_check(next_check).await)) - }) - .fuse() -} - /// The main run loop. #[overseer::contextbounds(CollatorProtocol, prefix = self::overseer)] pub(crate) async fn run( @@ -1196,10 +1177,10 @@ pub(crate) async fn run( ) -> std::result::Result<(), crate::error::FatalError> { let mut state = State { metrics, ..Default::default() }; - let next_inactivity_stream = infinite_stream(ACTIVITY_POLL); + let next_inactivity_stream = tick_stream(ACTIVITY_POLL); futures::pin_mut!(next_inactivity_stream); - let check_collations_stream = infinite_stream(CHECK_COLLATIONS_POLL); + let check_collations_stream = tick_stream(CHECK_COLLATIONS_POLL); futures::pin_mut!(check_collations_stream); loop { From c1692797fcb9527ea6ff57cdc684b52615c34ccb Mon Sep 17 00:00:00 2001 From: Keith Yeung Date: Wed, 5 Oct 2022 17:47:15 +0800 Subject: [PATCH 26/49] Properly migrate weights to v2 (#6091) * Create migration for config pallet * Use XcmWeight in XCM pallet extrinsics * Link to PR in doc comment * cargo fmt * Fix tests * Fix tests * Remove unused import * Update runtime/parachains/src/configuration/migration.rs Co-authored-by: Oliver Tale-Yazdi * Add missing on_runtime_upgrade implementation * Use new migration API * cargo fmt * Fix log message Co-authored-by: Oliver Tale-Yazdi --- runtime/kusama/src/lib.rs | 1 + runtime/parachains/src/configuration.rs | 3 +- .../parachains/src/configuration/migration.rs | 322 +++++++++++++++++- runtime/polkadot/src/lib.rs | 1 + runtime/rococo/src/lib.rs | 1 + runtime/westend/src/lib.rs | 1 + xcm/pallet-xcm/src/lib.rs | 10 +- xcm/pallet-xcm/src/tests.rs | 8 +- xcm/xcm-executor/integration-tests/src/lib.rs | 7 +- 9 files changed, 338 insertions(+), 16 deletions(-) diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index 48762d5e67ec..c17e744af175 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -1471,6 +1471,7 @@ pub type Executive = frame_executive::Executive< StakingMigrationV11OldPallet, >, pallet_staking::migrations::v12::MigrateToV12, + parachains_configuration::migration::v3::MigrateToV3, ), >; /// The payload being signed in the transactions. diff --git a/runtime/parachains/src/configuration.rs b/runtime/parachains/src/configuration.rs index bc97e84e95b5..2ebaff1b8282 100644 --- a/runtime/parachains/src/configuration.rs +++ b/runtime/parachains/src/configuration.rs @@ -285,7 +285,8 @@ impl> Default for HostConfiguration /// v1-v2: -pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(2); +/// v2-v3: +pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(3); + +pub mod v3 { + use super::*; + use frame_support::traits::OnRuntimeUpgrade; + use primitives::v2::{Balance, SessionIndex}; + + // Copied over from configuration.rs @ de9e147695b9f1be8bd44e07861a31e483c8343a and removed + // all the comments, and changed the Weight struct to OldWeight + #[derive(parity_scale_codec::Encode, parity_scale_codec::Decode, Debug)] + pub struct OldHostConfiguration { + pub max_code_size: u32, + pub max_head_data_size: u32, + pub max_upward_queue_count: u32, + pub max_upward_queue_size: u32, + pub max_upward_message_size: u32, + pub max_upward_message_num_per_candidate: u32, + pub hrmp_max_message_num_per_candidate: u32, + pub validation_upgrade_cooldown: BlockNumber, + pub validation_upgrade_delay: BlockNumber, + pub max_pov_size: u32, + pub max_downward_message_size: u32, + pub ump_service_total_weight: OldWeight, + pub hrmp_max_parachain_outbound_channels: u32, + pub hrmp_max_parathread_outbound_channels: u32, + pub hrmp_sender_deposit: Balance, + pub hrmp_recipient_deposit: Balance, + pub hrmp_channel_max_capacity: u32, + pub hrmp_channel_max_total_size: u32, + pub hrmp_max_parachain_inbound_channels: u32, + pub hrmp_max_parathread_inbound_channels: u32, + pub hrmp_channel_max_message_size: u32, + pub code_retention_period: BlockNumber, + pub parathread_cores: u32, + pub parathread_retries: u32, + pub group_rotation_frequency: BlockNumber, + pub chain_availability_period: BlockNumber, + pub thread_availability_period: BlockNumber, + pub scheduling_lookahead: u32, + pub max_validators_per_core: Option, + pub max_validators: Option, + pub dispute_period: SessionIndex, + pub dispute_post_conclusion_acceptance_period: BlockNumber, + pub dispute_max_spam_slots: u32, + pub dispute_conclusion_by_time_out_period: BlockNumber, + pub no_show_slots: u32, + pub n_delay_tranches: u32, + pub zeroth_delay_tranche_width: u32, + pub needed_approvals: u32, + pub relay_vrf_modulo_samples: u32, + pub ump_max_individual_weight: OldWeight, + pub pvf_checking_enabled: bool, + pub pvf_voting_ttl: SessionIndex, + pub minimum_validation_upgrade_delay: BlockNumber, + } + + impl> Default for OldHostConfiguration { + fn default() -> Self { + Self { + group_rotation_frequency: 1u32.into(), + chain_availability_period: 1u32.into(), + thread_availability_period: 1u32.into(), + no_show_slots: 1u32.into(), + validation_upgrade_cooldown: Default::default(), + validation_upgrade_delay: Default::default(), + code_retention_period: Default::default(), + max_code_size: Default::default(), + max_pov_size: Default::default(), + max_head_data_size: Default::default(), + parathread_cores: Default::default(), + parathread_retries: Default::default(), + scheduling_lookahead: Default::default(), + max_validators_per_core: Default::default(), + max_validators: None, + dispute_period: 6, + dispute_post_conclusion_acceptance_period: 100.into(), + dispute_max_spam_slots: 2, + dispute_conclusion_by_time_out_period: 200.into(), + n_delay_tranches: Default::default(), + zeroth_delay_tranche_width: Default::default(), + needed_approvals: Default::default(), + relay_vrf_modulo_samples: Default::default(), + max_upward_queue_count: Default::default(), + max_upward_queue_size: Default::default(), + max_downward_message_size: Default::default(), + ump_service_total_weight: OldWeight(Default::default()), + max_upward_message_size: Default::default(), + max_upward_message_num_per_candidate: Default::default(), + hrmp_sender_deposit: Default::default(), + hrmp_recipient_deposit: Default::default(), + hrmp_channel_max_capacity: Default::default(), + hrmp_channel_max_total_size: Default::default(), + hrmp_max_parachain_inbound_channels: Default::default(), + hrmp_max_parathread_inbound_channels: Default::default(), + hrmp_channel_max_message_size: Default::default(), + hrmp_max_parachain_outbound_channels: Default::default(), + hrmp_max_parathread_outbound_channels: Default::default(), + hrmp_max_message_num_per_candidate: Default::default(), + ump_max_individual_weight: OldWeight( + frame_support::weights::constants::WEIGHT_PER_MILLIS.ref_time() * 20, + ), + pvf_checking_enabled: false, + pvf_voting_ttl: 2u32.into(), + minimum_validation_upgrade_delay: 2.into(), + } + } + } + + pub struct MigrateToV3(sp_std::marker::PhantomData); + impl OnRuntimeUpgrade for MigrateToV3 { + fn on_runtime_upgrade() -> Weight { + if StorageVersion::get::>() == 2 { + let weight_consumed = migrate_to_v3::(); + + log::info!(target: configuration::LOG_TARGET, "MigrateToV3 executed successfully"); + STORAGE_VERSION.put::>(); + + weight_consumed + } else { + log::warn!(target: configuration::LOG_TARGET, "MigrateToV3 should be removed."); + T::DbWeight::get().reads(1) + } + } + } +} + +fn migrate_to_v3() -> Weight { + // Unusual formatting is justified: + // - make it easier to verify that fields assign what they supposed to assign. + // - this code is transient and will be removed after all migrations are done. + // - this code is important enough to optimize for legibility sacrificing consistency. + #[rustfmt::skip] + let translate = + |pre: v3::OldHostConfiguration>| -> +configuration::HostConfiguration> + { + super::HostConfiguration { +max_code_size : pre.max_code_size, +max_head_data_size : pre.max_head_data_size, +max_upward_queue_count : pre.max_upward_queue_count, +max_upward_queue_size : pre.max_upward_queue_size, +max_upward_message_size : pre.max_upward_message_size, +max_upward_message_num_per_candidate : pre.max_upward_message_num_per_candidate, +hrmp_max_message_num_per_candidate : pre.hrmp_max_message_num_per_candidate, +validation_upgrade_cooldown : pre.validation_upgrade_cooldown, +validation_upgrade_delay : pre.validation_upgrade_delay, +max_pov_size : pre.max_pov_size, +max_downward_message_size : pre.max_downward_message_size, +hrmp_max_parachain_outbound_channels : pre.hrmp_max_parachain_outbound_channels, +hrmp_max_parathread_outbound_channels : pre.hrmp_max_parathread_outbound_channels, +hrmp_sender_deposit : pre.hrmp_sender_deposit, +hrmp_recipient_deposit : pre.hrmp_recipient_deposit, +hrmp_channel_max_capacity : pre.hrmp_channel_max_capacity, +hrmp_channel_max_total_size : pre.hrmp_channel_max_total_size, +hrmp_max_parachain_inbound_channels : pre.hrmp_max_parachain_inbound_channels, +hrmp_max_parathread_inbound_channels : pre.hrmp_max_parathread_inbound_channels, +hrmp_channel_max_message_size : pre.hrmp_channel_max_message_size, +code_retention_period : pre.code_retention_period, +parathread_cores : pre.parathread_cores, +parathread_retries : pre.parathread_retries, +group_rotation_frequency : pre.group_rotation_frequency, +chain_availability_period : pre.chain_availability_period, +thread_availability_period : pre.thread_availability_period, +scheduling_lookahead : pre.scheduling_lookahead, +max_validators_per_core : pre.max_validators_per_core, +max_validators : pre.max_validators, +dispute_period : pre.dispute_period, +dispute_post_conclusion_acceptance_period: pre.dispute_post_conclusion_acceptance_period, +dispute_max_spam_slots : pre.dispute_max_spam_slots, +dispute_conclusion_by_time_out_period : pre.dispute_conclusion_by_time_out_period, +no_show_slots : pre.no_show_slots, +n_delay_tranches : pre.n_delay_tranches, +zeroth_delay_tranche_width : pre.zeroth_delay_tranche_width, +needed_approvals : pre.needed_approvals, +relay_vrf_modulo_samples : pre.relay_vrf_modulo_samples, +pvf_checking_enabled : pre.pvf_checking_enabled, +pvf_voting_ttl : pre.pvf_voting_ttl, +minimum_validation_upgrade_delay : pre.minimum_validation_upgrade_delay, + +ump_service_total_weight: Weight::from_ref_time(pre.ump_service_total_weight.0).set_proof_size(MAX_POV_SIZE as u64), +ump_max_individual_weight: Weight::from_ref_time(pre.ump_max_individual_weight.0).set_proof_size(MAX_POV_SIZE as u64), + } + }; + + if let Err(_) = as Store>::ActiveConfig::translate(|pre| pre.map(translate)) { + // `Err` is returned when the pre-migration type cannot be deserialized. This + // cannot happen if the migration runs correctly, i.e. against the expected version. + // + // This happening almost surely will lead to a panic somewhere else. Corruption seems + // to be unlikely to be caused by this. So we just log. Maybe it'll work out still? + log::error!( + target: configuration::LOG_TARGET, + "unexpected error when performing translation of the configuration type during storage upgrade to v2." + ); + } + + T::DbWeight::get().reads_writes(1, 1) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::mock::{new_test_ext, Test}; + + #[test] + fn v2_deserialized_from_actual_data() { + // Fetched at Kusama 14,703,780 (0x3b2c305d01bd4adf1973d32a2d55ca1260a55eea8dfb3168e317c57f2841fdf1) + // + // This exceeds the maximal line width length, but that's fine, since this is not code and + // doesn't need to be read and also leaving it as one line allows to easily copy it. + let raw_config = hex_literal::hex!["0000a000005000000a00000000c8000000c800000a0000000a000000100e0000580200000000500000c8000000e87648170000001e00000000000000005039278c0400000000000000000000005039278c0400000000000000000000e8030000009001001e00000000000000009001008070000000000000000000000a0000000a0000000a00000001000000010500000001c8000000060000005802000002000000580200000200000059000000000000001e0000002800000000c817a804000000000200000014000000"]; + + let v2 = + v3::OldHostConfiguration::::decode(&mut &raw_config[..]) + .unwrap(); + + // We check only a sample of the values here. If we missed any fields or messed up data types + // that would skew all the fields coming after. + assert_eq!(v2.max_code_size, 10_485_760); + assert_eq!(v2.validation_upgrade_cooldown, 3600); + assert_eq!(v2.max_pov_size, 5_242_880); + assert_eq!(v2.hrmp_channel_max_message_size, 102_400); + assert_eq!(v2.dispute_max_spam_slots, 2); + assert_eq!(v2.n_delay_tranches, 89); + assert_eq!(v2.ump_max_individual_weight, OldWeight(20_000_000_000)); + assert_eq!(v2.minimum_validation_upgrade_delay, 20); + } + + #[test] + fn test_migrate_to_v3() { + // Host configuration has lots of fields. However, in this migration we add only a couple of + // fields. The most important part to check are a couple of the last fields. We also pick + // extra fields to check arbitrarily, e.g. depending on their position (i.e. the middle) and + // also their type. + // + // We specify only the picked fields and the rest should be provided by the `Default` + // implementation. That implementation is copied over between the two types and should work + // fine. + let v2 = v3::OldHostConfiguration:: { + ump_max_individual_weight: OldWeight(0x71616e6f6e0au64), + needed_approvals: 69, + thread_availability_period: 55, + hrmp_recipient_deposit: 1337, + max_pov_size: 1111, + chain_availability_period: 33, + minimum_validation_upgrade_delay: 20, + ..Default::default() + }; + + new_test_ext(Default::default()).execute_with(|| { + // Implant the v2 version in the state. + frame_support::storage::unhashed::put_raw( + &configuration::ActiveConfig::::hashed_key(), + &v2.encode(), + ); + + migrate_to_v3::(); + + let v3 = configuration::ActiveConfig::::get(); + + #[rustfmt::skip] + { + assert_eq!(v2.max_code_size , v3.max_code_size); + assert_eq!(v2.max_head_data_size , v3.max_head_data_size); + assert_eq!(v2.max_upward_queue_count , v3.max_upward_queue_count); + assert_eq!(v2.max_upward_queue_size , v3.max_upward_queue_size); + assert_eq!(v2.max_upward_message_size , v3.max_upward_message_size); + assert_eq!(v2.max_upward_message_num_per_candidate , v3.max_upward_message_num_per_candidate); + assert_eq!(v2.hrmp_max_message_num_per_candidate , v3.hrmp_max_message_num_per_candidate); + assert_eq!(v2.validation_upgrade_cooldown , v3.validation_upgrade_cooldown); + assert_eq!(v2.validation_upgrade_delay , v3.validation_upgrade_delay); + assert_eq!(v2.max_pov_size , v3.max_pov_size); + assert_eq!(v2.max_downward_message_size , v3.max_downward_message_size); + assert_eq!(v2.hrmp_max_parachain_outbound_channels , v3.hrmp_max_parachain_outbound_channels); + assert_eq!(v2.hrmp_max_parathread_outbound_channels , v3.hrmp_max_parathread_outbound_channels); + assert_eq!(v2.hrmp_sender_deposit , v3.hrmp_sender_deposit); + assert_eq!(v2.hrmp_recipient_deposit , v3.hrmp_recipient_deposit); + assert_eq!(v2.hrmp_channel_max_capacity , v3.hrmp_channel_max_capacity); + assert_eq!(v2.hrmp_channel_max_total_size , v3.hrmp_channel_max_total_size); + assert_eq!(v2.hrmp_max_parachain_inbound_channels , v3.hrmp_max_parachain_inbound_channels); + assert_eq!(v2.hrmp_max_parathread_inbound_channels , v3.hrmp_max_parathread_inbound_channels); + assert_eq!(v2.hrmp_channel_max_message_size , v3.hrmp_channel_max_message_size); + assert_eq!(v2.code_retention_period , v3.code_retention_period); + assert_eq!(v2.parathread_cores , v3.parathread_cores); + assert_eq!(v2.parathread_retries , v3.parathread_retries); + assert_eq!(v2.group_rotation_frequency , v3.group_rotation_frequency); + assert_eq!(v2.chain_availability_period , v3.chain_availability_period); + assert_eq!(v2.thread_availability_period , v3.thread_availability_period); + assert_eq!(v2.scheduling_lookahead , v3.scheduling_lookahead); + assert_eq!(v2.max_validators_per_core , v3.max_validators_per_core); + assert_eq!(v2.max_validators , v3.max_validators); + assert_eq!(v2.dispute_period , v3.dispute_period); + assert_eq!(v2.dispute_post_conclusion_acceptance_period, v3.dispute_post_conclusion_acceptance_period); + assert_eq!(v2.dispute_max_spam_slots , v3.dispute_max_spam_slots); + assert_eq!(v2.dispute_conclusion_by_time_out_period , v3.dispute_conclusion_by_time_out_period); + assert_eq!(v2.no_show_slots , v3.no_show_slots); + assert_eq!(v2.n_delay_tranches , v3.n_delay_tranches); + assert_eq!(v2.zeroth_delay_tranche_width , v3.zeroth_delay_tranche_width); + assert_eq!(v2.needed_approvals , v3.needed_approvals); + assert_eq!(v2.relay_vrf_modulo_samples , v3.relay_vrf_modulo_samples); + assert_eq!(v2.pvf_checking_enabled , v3.pvf_checking_enabled); + assert_eq!(v2.pvf_voting_ttl , v3.pvf_voting_ttl); + assert_eq!(v2.minimum_validation_upgrade_delay , v3.minimum_validation_upgrade_delay); + + assert_eq!(v2.ump_service_total_weight, OldWeight(v3.ump_service_total_weight.ref_time())); + assert_eq!(v2.ump_max_individual_weight, OldWeight(v3.ump_max_individual_weight.ref_time())); + assert_eq!(v3.ump_service_total_weight.proof_size(), MAX_POV_SIZE as u64); + assert_eq!(v3.ump_max_individual_weight.proof_size(), MAX_POV_SIZE as u64); + }; // ; makes this a statement. `rustfmt::skip` cannot be put on an expression. + }); + } +} diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index 96a557712a76..93efc260523c 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -1560,6 +1560,7 @@ pub type Executive = frame_executive::Executive< StakingMigrationV11OldPallet, >, pallet_staking::migrations::v12::MigrateToV12, + parachains_configuration::migration::v3::MigrateToV3, ), >; diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index c10715ee0ee1..5680d1b25403 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -1453,6 +1453,7 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, + (parachains_configuration::migration::v3::MigrateToV3,), >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 6aef1be3a267..5cdb6e81ae36 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -1215,6 +1215,7 @@ pub type Executive = frame_executive::Executive< StakingMigrationV11OldPallet, >, pallet_staking::migrations::v12::MigrateToV12, + parachains_configuration::migration::v3::MigrateToV3, ), >; /// The payload being signed in transactions. diff --git a/xcm/pallet-xcm/src/lib.rs b/xcm/pallet-xcm/src/lib.rs index f5e5d0f8c004..c29b374dd078 100644 --- a/xcm/pallet-xcm/src/lib.rs +++ b/xcm/pallet-xcm/src/lib.rs @@ -31,7 +31,7 @@ use sp_runtime::{ RuntimeDebug, }; use sp_std::{boxed::Box, marker::PhantomData, prelude::*, result::Result, vec}; -use xcm::prelude::*; +use xcm::{latest::Weight as XcmWeight, prelude::*}; use xcm_executor::traits::ConvertOrigin; use frame_support::PalletId; @@ -570,11 +570,11 @@ pub mod pallet { /// /// NOTE: A successful return to this does *not* imply that the `msg` was executed successfully /// to completion; only that *some* of it was executed. - #[pallet::weight(max_weight.saturating_add(Weight::from_ref_time(100_000_000u64)))] + #[pallet::weight(Weight::from_ref_time(max_weight.saturating_add(100_000_000u64)))] pub fn execute( origin: OriginFor, message: Box::RuntimeCall>>, - max_weight: Weight, + max_weight: XcmWeight, ) -> DispatchResultWithPostInfo { let origin_location = T::ExecuteXcmOrigin::ensure_origin(origin)?; let message = (*message).try_into().map_err(|()| Error::::BadVersion)?; @@ -584,8 +584,8 @@ pub mod pallet { let outcome = T::XcmExecutor::execute_xcm_in_credit( origin_location, message, - max_weight.ref_time(), - max_weight.ref_time(), + max_weight, + max_weight, ); let result = Ok(Some(outcome.weight_used().saturating_add(100_000_000)).into()); Self::deposit_event(Event::Attempted(outcome)); diff --git a/xcm/pallet-xcm/src/tests.rs b/xcm/pallet-xcm/src/tests.rs index ddac7518e510..b619efefbe9b 100644 --- a/xcm/pallet-xcm/src/tests.rs +++ b/xcm/pallet-xcm/src/tests.rs @@ -517,7 +517,7 @@ fn execute_withdraw_to_deposit_works() { buy_execution((Here, SEND_AMOUNT)), DepositAsset { assets: All.into(), max_assets: 1, beneficiary: dest }, ]))), - Weight::from_ref_time(weight) + weight )); assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE - SEND_AMOUNT); assert_eq!(Balances::total_balance(&BOB), SEND_AMOUNT); @@ -549,7 +549,7 @@ fn trapped_assets_can_be_claimed() { // This would succeed, but we never get to it. DepositAsset { assets: All.into(), max_assets: 1, beneficiary: dest.clone() }, ]))), - Weight::from_ref_time(weight) + weight )); let source: MultiLocation = Junction::AccountId32 { network: NetworkId::Any, id: ALICE.into() }.into(); @@ -579,7 +579,7 @@ fn trapped_assets_can_be_claimed() { buy_execution((Here, SEND_AMOUNT)), DepositAsset { assets: All.into(), max_assets: 1, beneficiary: dest.clone() }, ]))), - Weight::from_ref_time(weight) + weight )); assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE - SEND_AMOUNT); @@ -594,7 +594,7 @@ fn trapped_assets_can_be_claimed() { buy_execution((Here, SEND_AMOUNT)), DepositAsset { assets: All.into(), max_assets: 1, beneficiary: dest }, ]))), - Weight::from_ref_time(weight) + weight )); assert_eq!( last_event(), diff --git a/xcm/xcm-executor/integration-tests/src/lib.rs b/xcm/xcm-executor/integration-tests/src/lib.rs index 6d263fe46245..272ceadfea01 100644 --- a/xcm/xcm-executor/integration-tests/src/lib.rs +++ b/xcm/xcm-executor/integration-tests/src/lib.rs @@ -17,7 +17,6 @@ #![cfg_attr(not(feature = "std"), no_std)] #![cfg(test)] -use frame_support::weights::Weight; use polkadot_test_client::{ BlockBuilderExt, ClientBlockImportExt, DefaultTestClientBuilderExt, ExecutionStrategy, InitPolkadotBlockBuilder, TestClientBuilder, TestClientBuilderExt, @@ -47,7 +46,7 @@ fn basic_buy_fees_message_executes() { &client, polkadot_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute { message: Box::new(VersionedXcm::from(msg)), - max_weight: Weight::from_ref_time(1_000_000_000), + max_weight: 1_000_000_000, }), sp_keyring::Sr25519Keyring::Alice, 0, @@ -129,7 +128,7 @@ fn query_response_fires() { &client, polkadot_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute { message: msg, - max_weight: Weight::from_ref_time(1_000_000_000), + max_weight: 1_000_000_000, }), sp_keyring::Sr25519Keyring::Alice, 1, @@ -217,7 +216,7 @@ fn query_response_elicits_handler() { &client, polkadot_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute { message: Box::new(VersionedXcm::from(msg)), - max_weight: Weight::from_ref_time(1_000_000_000), + max_weight: 1_000_000_000, }), sp_keyring::Sr25519Keyring::Alice, 1, From 233c1582e9ab5fe5e9899d2a42a0b236a42d34e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Wed, 5 Oct 2022 15:15:07 +0200 Subject: [PATCH 27/49] Pass through `runtime-benchmark` feature (#6110) --- cli/Cargo.toml | 6 +++++- node/test/performance-test/Cargo.toml | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 1e770cd8715b..1be1b63c0cfb 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -56,7 +56,11 @@ cli = [ "polkadot-client", "polkadot-node-core-pvf", ] -runtime-benchmarks = ["service/runtime-benchmarks", "polkadot-node-metrics/runtime-benchmarks"] +runtime-benchmarks = [ + "service/runtime-benchmarks", + "polkadot-node-metrics/runtime-benchmarks", + "polkadot-performance-test?/runtime-benchmarks" +] trie-memory-tracker = ["sp-trie/memory-tracker"] full-node = ["service/full-node"] try-runtime = ["service/try-runtime"] diff --git a/node/test/performance-test/Cargo.toml b/node/test/performance-test/Cargo.toml index 783f5194a0f5..583b80e3c2f4 100644 --- a/node/test/performance-test/Cargo.toml +++ b/node/test/performance-test/Cargo.toml @@ -19,3 +19,6 @@ kusama-runtime = { path = "../../../runtime/kusama" } [[bin]] name = "gen-ref-constants" path = "src/gen_ref_constants.rs" + +[features] +runtime-benchmarks = ["kusama-runtime/runtime-benchmarks"] From 1655839dc4f206fcfa9ec0773fa8a99d7de9d981 Mon Sep 17 00:00:00 2001 From: Gavin Wood Date: Wed, 5 Oct 2022 22:17:59 +0100 Subject: [PATCH 28/49] Companion for #11649: Bound uses of `Call` (#5729) * Fixes * Clear out old weights Signed-off-by: Oliver Tale-Yazdi * Resolve merges Signed-off-by: Oliver Tale-Yazdi * Fix weight traits Signed-off-by: Oliver Tale-Yazdi * polkadot runtime: Clippy Signed-off-by: Oliver Tale-Yazdi * rococo runtime: update pallet configs Signed-off-by: Oliver Tale-Yazdi * Add preimage migration Signed-off-by: Oliver Tale-Yazdi * Add all migrations Signed-off-by: Oliver Tale-Yazdi * Democracy is not on Westend Signed-off-by: Oliver Tale-Yazdi * [Migration] Refund stored multisig calls (#6075) * Add Preimages to referenda config Needed since Gov V2 just merged. Signed-off-by: Oliver Tale-Yazdi * Update weights Signed-off-by: Oliver Tale-Yazdi * Add multisig migration to Westend+Rococo Signed-off-by: Oliver Tale-Yazdi * Fix Executive syntax Signed-off-by: Oliver Tale-Yazdi * Bump Substrate Signed-off-by: Oliver Tale-Yazdi Co-authored-by: Oliver Tale-Yazdi Co-authored-by: parity-processbot <> Co-authored-by: Roman Useinov --- Cargo.lock | 379 +++++++++--------- runtime/kusama/src/governance/fellowship.rs | 1 + runtime/kusama/src/governance/mod.rs | 1 + runtime/kusama/src/governance/old.rs | 6 +- runtime/kusama/src/lib.rs | 13 +- .../kusama/src/weights/pallet_democracy.rs | 185 +++------ runtime/kusama/src/weights/pallet_preimage.rs | 67 ++-- .../kusama/src/weights/pallet_scheduler.rs | 161 ++------ runtime/polkadot/src/lib.rs | 21 +- .../polkadot/src/weights/pallet_democracy.rs | 185 +++------ .../polkadot/src/weights/pallet_preimage.rs | 63 ++- .../polkadot/src/weights/pallet_scheduler.rs | 160 ++------ runtime/rococo/src/lib.rs | 25 +- .../rococo/src/weights/pallet_democracy.rs | 183 +++------ runtime/rococo/src/weights/pallet_preimage.rs | 63 ++- .../rococo/src/weights/pallet_scheduler.rs | 158 ++------ runtime/westend/src/lib.rs | 9 +- .../westend/src/weights/pallet_preimage.rs | 63 ++- .../westend/src/weights/pallet_scheduler.rs | 160 ++------ 19 files changed, 720 insertions(+), 1183 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c6b5762e9750..53eaa9fa29dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -435,7 +435,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "array-bytes", "async-trait", @@ -472,7 +472,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -492,7 +492,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "beefy-primitives", "sp-api", @@ -502,7 +502,7 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "parity-scale-codec", "scale-info", @@ -1999,7 +1999,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "parity-scale-codec", ] @@ -2017,7 +2017,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-support", "frame-system", @@ -2040,7 +2040,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "Inflector", "array-bytes", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2102,7 +2102,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2118,7 +2118,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-support", "frame-system", @@ -2147,7 +2147,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "bitflags", "frame-metadata", @@ -2179,7 +2179,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "Inflector", "cfg-expr", @@ -2193,7 +2193,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2205,7 +2205,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "proc-macro2", "quote", @@ -2215,7 +2215,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2238,7 +2238,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-support", "frame-system", @@ -2249,7 +2249,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-support", "log", @@ -2267,7 +2267,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -2282,7 +2282,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "parity-scale-codec", "sp-api", @@ -2291,7 +2291,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-support", "parity-scale-codec", @@ -2474,7 +2474,7 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "chrono", "frame-election-provider-support", @@ -4835,7 +4835,7 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -4849,7 +4849,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-support", "frame-system", @@ -4865,7 +4865,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-support", "frame-system", @@ -4880,7 +4880,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -4904,7 +4904,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4924,7 +4924,7 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4943,7 +4943,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -4958,7 +4958,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "beefy-primitives", "frame-support", @@ -4974,7 +4974,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "array-bytes", "beefy-merkle-tree", @@ -4997,7 +4997,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5015,7 +5015,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5034,7 +5034,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5051,7 +5051,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5068,14 +5068,16 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "serde", + "sp-core", "sp-io", "sp-runtime", "sp-std", @@ -5084,7 +5086,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5108,7 +5110,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5121,7 +5123,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5139,7 +5141,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5160,7 +5162,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5175,7 +5177,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5198,7 +5200,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5214,7 +5216,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5234,7 +5236,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5251,7 +5253,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5268,7 +5270,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5286,7 +5288,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -5301,11 +5303,12 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-io", @@ -5316,7 +5319,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-support", "frame-system", @@ -5333,7 +5336,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5353,7 +5356,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "parity-scale-codec", "sp-api", @@ -5363,7 +5366,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-support", "frame-system", @@ -5380,7 +5383,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5403,11 +5406,12 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-core", @@ -5419,7 +5423,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5434,7 +5438,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5452,7 +5456,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5467,7 +5471,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5485,7 +5489,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5501,7 +5505,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-support", "frame-system", @@ -5522,7 +5526,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5538,7 +5542,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-support", "frame-system", @@ -5552,7 +5556,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5575,7 +5579,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5586,7 +5590,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "log", "sp-arithmetic", @@ -5595,7 +5599,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-support", "frame-system", @@ -5609,7 +5613,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5627,7 +5631,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5646,7 +5650,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-support", "frame-system", @@ -5662,7 +5666,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5677,7 +5681,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5688,7 +5692,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5705,7 +5709,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5721,7 +5725,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -5736,7 +5740,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-benchmarking", "frame-support", @@ -8270,7 +8274,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "env_logger 0.9.0", "jsonrpsee", @@ -8618,7 +8622,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "log", "sp-core", @@ -8629,7 +8633,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "async-trait", "futures", @@ -8638,8 +8642,8 @@ dependencies = [ "libp2p", "log", "parity-scale-codec", - "prost 0.10.3", - "prost-build 0.10.4", + "prost 0.11.0", + "prost-build 0.11.1", "rand 0.7.3", "sc-client-api", "sc-network-common", @@ -8656,7 +8660,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "futures", "futures-timer", @@ -8679,7 +8683,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8695,7 +8699,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8712,7 +8716,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8723,7 +8727,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "array-bytes", "chrono", @@ -8763,7 +8767,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "fnv", "futures", @@ -8791,7 +8795,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "hash-db", "kvdb", @@ -8816,7 +8820,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "async-trait", "futures", @@ -8840,7 +8844,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "async-trait", "fork-tree", @@ -8882,7 +8886,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "futures", "jsonrpsee", @@ -8904,7 +8908,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8917,7 +8921,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "async-trait", "futures", @@ -8941,7 +8945,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "lazy_static", "lru 0.7.8", @@ -8968,7 +8972,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "environmental", "parity-scale-codec", @@ -8984,7 +8988,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "log", "parity-scale-codec", @@ -8999,7 +9003,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "cfg-if 1.0.0", "libc", @@ -9019,7 +9023,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "ahash", "array-bytes", @@ -9060,7 +9064,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "finality-grandpa", "futures", @@ -9081,7 +9085,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "ansi_term", "futures", @@ -9098,7 +9102,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "array-bytes", "async-trait", @@ -9113,7 +9117,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "array-bytes", "async-trait", @@ -9135,7 +9139,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "pin-project", - "prost 0.10.3", + "prost 0.11.0", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -9160,7 +9164,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "cid", "futures", @@ -9180,7 +9184,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "async-trait", "bitflags", @@ -9190,7 +9194,7 @@ dependencies = [ "libp2p", "linked_hash_set", "parity-scale-codec", - "prost-build 0.10.4", + "prost-build 0.11.1", "sc-consensus", "sc-peerset", "serde", @@ -9206,7 +9210,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "ahash", "futures", @@ -9224,15 +9228,15 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "array-bytes", "futures", "libp2p", "log", "parity-scale-codec", - "prost 0.10.3", - "prost-build 0.10.4", + "prost 0.11.0", + "prost-build 0.11.1", "sc-client-api", "sc-network-common", "sc-peerset", @@ -9245,7 +9249,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "array-bytes", "fork-tree", @@ -9254,8 +9258,8 @@ dependencies = [ "log", "lru 0.7.8", "parity-scale-codec", - "prost 0.10.3", - "prost-build 0.10.4", + "prost 0.11.0", + "prost-build 0.11.1", "sc-client-api", "sc-consensus", "sc-network-common", @@ -9273,7 +9277,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "array-bytes", "futures", @@ -9292,7 +9296,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "array-bytes", "bytes", @@ -9322,7 +9326,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "futures", "libp2p", @@ -9335,7 +9339,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9344,7 +9348,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "futures", "hash-db", @@ -9374,7 +9378,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "futures", "jsonrpsee", @@ -9397,7 +9401,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "futures", "jsonrpsee", @@ -9410,7 +9414,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "async-trait", "directories", @@ -9480,7 +9484,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "log", "parity-scale-codec", @@ -9494,7 +9498,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -9513,7 +9517,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "futures", "libc", @@ -9532,7 +9536,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "chrono", "futures", @@ -9550,7 +9554,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "ansi_term", "atty", @@ -9581,7 +9585,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9592,7 +9596,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "futures", "futures-timer", @@ -9618,7 +9622,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "futures", "log", @@ -9631,7 +9635,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "futures", "futures-timer", @@ -10117,7 +10121,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "hash-db", "log", @@ -10135,7 +10139,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "blake2", "proc-macro-crate", @@ -10147,7 +10151,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "parity-scale-codec", "scale-info", @@ -10160,7 +10164,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "integer-sqrt", "num-traits", @@ -10175,7 +10179,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "parity-scale-codec", "scale-info", @@ -10188,7 +10192,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "async-trait", "parity-scale-codec", @@ -10200,7 +10204,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "parity-scale-codec", "sp-api", @@ -10212,7 +10216,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "futures", "log", @@ -10230,7 +10234,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "async-trait", "futures", @@ -10249,7 +10253,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "async-trait", "merlin", @@ -10272,7 +10276,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "parity-scale-codec", "scale-info", @@ -10286,7 +10290,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "parity-scale-codec", "scale-info", @@ -10299,7 +10303,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "array-bytes", "base58", @@ -10345,7 +10349,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "blake2", "byteorder", @@ -10359,7 +10363,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "proc-macro2", "quote", @@ -10370,7 +10374,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -10379,7 +10383,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "proc-macro2", "quote", @@ -10389,7 +10393,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "environmental", "parity-scale-codec", @@ -10400,7 +10404,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "finality-grandpa", "log", @@ -10418,7 +10422,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10432,7 +10436,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "bytes", "futures", @@ -10458,7 +10462,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "lazy_static", "sp-core", @@ -10469,7 +10473,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "async-trait", "futures", @@ -10486,7 +10490,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "thiserror", "zstd", @@ -10495,10 +10499,11 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "log", "parity-scale-codec", + "scale-info", "serde", "sp-api", "sp-core", @@ -10510,7 +10515,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "parity-scale-codec", "scale-info", @@ -10524,7 +10529,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "sp-api", "sp-core", @@ -10534,7 +10539,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "backtrace", "lazy_static", @@ -10544,7 +10549,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "rustc-hash", "serde", @@ -10554,7 +10559,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "either", "hash256-std-hasher", @@ -10577,7 +10582,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -10595,7 +10600,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "Inflector", "proc-macro-crate", @@ -10607,7 +10612,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "log", "parity-scale-codec", @@ -10621,7 +10626,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "parity-scale-codec", "scale-info", @@ -10635,7 +10640,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "parity-scale-codec", "scale-info", @@ -10646,7 +10651,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "hash-db", "log", @@ -10668,12 +10673,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10686,7 +10691,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "log", "sp-core", @@ -10699,7 +10704,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "async-trait", "futures-timer", @@ -10715,7 +10720,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "parity-scale-codec", "sp-std", @@ -10727,7 +10732,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "sp-api", "sp-runtime", @@ -10736,7 +10741,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "async-trait", "log", @@ -10752,7 +10757,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "ahash", "hash-db", @@ -10775,7 +10780,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10792,7 +10797,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10803,7 +10808,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "impl-trait-for-tuples", "log", @@ -10816,7 +10821,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -11031,7 +11036,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "platforms", ] @@ -11039,7 +11044,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -11060,7 +11065,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "futures-util", "hyper", @@ -11073,7 +11078,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "jsonrpsee", "log", @@ -11094,7 +11099,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "array-bytes", "async-trait", @@ -11120,7 +11125,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "futures", "substrate-test-utils-derive", @@ -11130,7 +11135,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11141,7 +11146,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "ansi_term", "build-helper", @@ -11854,7 +11859,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#e77cbe39c4d1bfd978bb03c686fc9f60d86a3d06" +source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" dependencies = [ "clap", "frame-try-runtime", @@ -11924,7 +11929,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "digest 0.10.3", "rand 0.8.5", "static_assertions", diff --git a/runtime/kusama/src/governance/fellowship.rs b/runtime/kusama/src/governance/fellowship.rs index 66e2f6ee6d58..52ab8d0bebc8 100644 --- a/runtime/kusama/src/governance/fellowship.rs +++ b/runtime/kusama/src/governance/fellowship.rs @@ -314,6 +314,7 @@ impl pallet_referenda::Config for Runtime { type UndecidingTimeout = UndecidingTimeout; type AlarmInterval = AlarmInterval; type Tracks = TracksInfo; + type Preimages = Preimage; } pub type FellowshipCollectiveInstance = pallet_ranked_collective::Instance1; diff --git a/runtime/kusama/src/governance/mod.rs b/runtime/kusama/src/governance/mod.rs index 4dbf375f67f0..87cbfd7eea2f 100644 --- a/runtime/kusama/src/governance/mod.rs +++ b/runtime/kusama/src/governance/mod.rs @@ -91,4 +91,5 @@ impl pallet_referenda::Config for Runtime { type UndecidingTimeout = UndecidingTimeout; type AlarmInterval = AlarmInterval; type Tracks = TracksInfo; + type Preimages = Preimage; } diff --git a/runtime/kusama/src/governance/old.rs b/runtime/kusama/src/governance/old.rs index c16ca5eddd7a..9365c903198a 100644 --- a/runtime/kusama/src/governance/old.rs +++ b/runtime/kusama/src/governance/old.rs @@ -32,7 +32,6 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { - type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; @@ -74,14 +73,15 @@ impl pallet_democracy::Config for Runtime { // only do it once and it lasts only for the cooloff period. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; - type PreimageByteDeposit = PreimageByteDeposit; - type OperationalPreimageOrigin = pallet_collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; type WeightInfo = weights::pallet_democracy::WeightInfo; type MaxProposals = MaxProposals; + type Preimages = Preimage; + type MaxDeposits = ConstU32<100>; + type MaxBlacklisted = ConstU32<100>; } parameter_types! { diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index c17e744af175..a4a3a05e1173 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -225,12 +225,10 @@ impl pallet_scheduler::Config for Runtime { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = OriginPrivilegeCmp; - type PreimageProvider = Preimage; - type NoPreimagePostponement = NoPreimagePostponement; + type Preimages = Preimage; } parameter_types! { - pub const PreimageMaxSize: u32 = 4096 * 1024; pub const PreimageBaseDeposit: Balance = deposit(2, 64); pub const PreimageByteDeposit: Balance = deposit(0, 1); } @@ -239,8 +237,7 @@ impl pallet_preimage::Config for Runtime { type WeightInfo = weights::pallet_preimage::WeightInfo; type RuntimeEvent = RuntimeEvent; type Currency = Balances; - type ManagerOrigin = EnsureRoot; // This might be too strong a requirenent? - type MaxSize = PreimageMaxSize; + type ManagerOrigin = EnsureRoot; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } @@ -1471,6 +1468,12 @@ pub type Executive = frame_executive::Executive< StakingMigrationV11OldPallet, >, pallet_staking::migrations::v12::MigrateToV12, + // "Bound uses of call" + pallet_preimage::migration::v1::Migration, + pallet_scheduler::migration::v3::MigrateToV4, + pallet_democracy::migrations::v1::Migration, + pallet_multisig::migrations::v1::MigrateToV1, + // "Properly migrate weights to v2" parachains_configuration::migration::v3::MigrateToV3, ), >; diff --git a/runtime/kusama/src/weights/pallet_democracy.rs b/runtime/kusama/src/weights/pallet_democracy.rs index 76862dca3974..b9b4127c597e 100644 --- a/runtime/kusama/src/weights/pallet_democracy.rs +++ b/runtime/kusama/src/weights/pallet_democracy.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_democracy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 // Executed Command: @@ -32,13 +32,13 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ +// --output=./runtime/kusama/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_democracy`. @@ -49,134 +49,103 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(39_849_000 as u64) + Weight::from_ref_time(42_340_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy DepositOf (r:1 w:1) - /// The range of component `s` is `[0, 100]`. - fn second(s: u32, ) -> Weight { - Weight::from_ref_time(31_560_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(81_000 as u64).saturating_mul(s as u64)) + fn second() -> Weight { + Weight::from_ref_time(38_557_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn vote_new(r: u32, ) -> Weight { - Weight::from_ref_time(43_461_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(91_000 as u64).saturating_mul(r as u64)) + fn vote_new() -> Weight { + Weight::from_ref_time(48_480_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn vote_existing(r: u32, ) -> Weight { - Weight::from_ref_time(43_754_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(88_000 as u64).saturating_mul(r as u64)) + fn vote_existing() -> Weight { + Weight::from_ref_time(48_553_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(21_199_000 as u64) + Weight::from_ref_time(20_602_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) + // Storage: Democracy DepositOf (r:1 w:1) + // Storage: System Account (r:1 w:1) // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Blacklist (r:0 w:1) - // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:1 w:1) - /// The range of component `p` is `[1, 100]`. - fn blacklist(p: u32, ) -> Weight { - Weight::from_ref_time(55_593_000 as u64) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(161_000 as u64).saturating_mul(p as u64)) + fn blacklist() -> Weight { + Weight::from_ref_time(75_265_000 as u64) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) - /// The range of component `v` is `[1, 100]`. - fn external_propose(v: u32, ) -> Weight { - Weight::from_ref_time(14_747_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(13_000 as u64).saturating_mul(v as u64)) + fn external_propose() -> Weight { + Weight::from_ref_time(15_498_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(4_471_000 as u64) + Weight::from_ref_time(4_503_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(4_230_000 as u64) + Weight::from_ref_time(4_486_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(20_311_000 as u64) + Weight::from_ref_time(19_676_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) - /// The range of component `v` is `[0, 100]`. - fn veto_external(v: u32, ) -> Weight { - Weight::from_ref_time(22_052_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(26_000 as u64).saturating_mul(v as u64)) + fn veto_external() -> Weight { + Weight::from_ref_time(25_443_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `p` is `[1, 100]`. - fn cancel_proposal(p: u32, ) -> Weight { - Weight::from_ref_time(46_926_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(130_000 as u64).saturating_mul(p as u64)) + fn cancel_proposal() -> Weight { + Weight::from_ref_time(63_468_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(13_121_000 as u64) + Weight::from_ref_time(13_030_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Scheduler Lookup (r:1 w:1) - // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn cancel_queued(r: u32, ) -> Weight { - Weight::from_ref_time(27_805_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(1_112_000 as u64).saturating_mul(r as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:0) + /// The range of component `r` is `[0, 99]`. fn on_initialize_base(r: u32, ) -> Weight { - Weight::from_ref_time(9_815_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(1_996_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(5_941_000 as u64) + // Standard Error: 2_263 + .saturating_add(Weight::from_ref_time(2_136_731 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) @@ -186,36 +155,36 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy LastTabledWasExternal (r:1 w:0) // Storage: Democracy NextExternal (r:1 w:0) // Storage: Democracy PublicProps (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:0) + /// The range of component `r` is `[0, 99]`. fn on_initialize_base_with_launch_period(r: u32, ) -> Weight { - Weight::from_ref_time(12_343_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(2_001_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(8_085_000 as u64) + // Standard Error: 2_202 + .saturating_add(Weight::from_ref_time(2_143_624 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:3 w:3) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:2) + /// The range of component `r` is `[0, 99]`. fn delegate(r: u32, ) -> Weight { - Weight::from_ref_time(47_307_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(2_899_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(40_416_000 as u64) + // Standard Error: 4_125 + .saturating_add(Weight::from_ref_time(3_038_258 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(4 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(4 as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) } // Storage: Democracy VotingOf (r:2 w:2) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:2) + /// The range of component `r` is `[0, 99]`. fn undelegate(r: u32, ) -> Weight { - Weight::from_ref_time(27_872_000 as u64) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(2_861_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(24_459_000 as u64) + // Standard Error: 2_860 + .saturating_add(Weight::from_ref_time(2_984_453 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) @@ -223,76 +192,48 @@ impl pallet_democracy::WeightInfo for WeightInfo { } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(5_014_000 as u64) + Weight::from_ref_time(5_200_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Democracy Preimages (r:1 w:1) - /// The range of component `b` is `[0, 16384]`. - fn note_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(29_213_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - /// The range of component `b` is `[0, 16384]`. - fn note_imminent_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(21_778_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - // Storage: System Account (r:1 w:1) - /// The range of component `b` is `[0, 16384]`. - fn reap_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(36_642_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[0, 99]`. fn unlock_remove(r: u32, ) -> Weight { - Weight::from_ref_time(31_776_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(37_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(24_289_000 as u64) + // Standard Error: 2_579 + .saturating_add(Weight::from_ref_time(125_300 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[0, 99]`. fn unlock_set(r: u32, ) -> Weight { - Weight::from_ref_time(31_414_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(77_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(28_331_000 as u64) + // Standard Error: 755 + .saturating_add(Weight::from_ref_time(90_997 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[1, 100]`. fn remove_vote(r: u32, ) -> Weight { - Weight::from_ref_time(18_428_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(84_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(15_350_000 as u64) + // Standard Error: 1_015 + .saturating_add(Weight::from_ref_time(104_402 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[1, 100]`. fn remove_other_vote(r: u32, ) -> Weight { - Weight::from_ref_time(18_684_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(77_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(15_433_000 as u64) + // Standard Error: 980 + .saturating_add(Weight::from_ref_time(104_660 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/kusama/src/weights/pallet_preimage.rs b/runtime/kusama/src/weights/pallet_preimage.rs index 782deda50e27..2fc3687f4581 100644 --- a/runtime/kusama/src/weights/pallet_preimage.rs +++ b/runtime/kusama/src/weights/pallet_preimage.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 // Executed Command: @@ -32,103 +32,102 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ +// --output=./runtime/kusama/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_preimage`. pub struct WeightInfo(PhantomData); impl pallet_preimage::WeightInfo for WeightInfo { - // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) + Weight::from_ref_time(27_993_000 as u64) + // Standard Error: 5 + .saturating_add(Weight::from_ref_time(2_208 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + Weight::from_ref_time(19_503_000 as u64) + // Standard Error: 5 + .saturating_add(Weight::from_ref_time(2_264 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + Weight::from_ref_time(17_878_000 as u64) + // Standard Error: 2 + .saturating_add(Weight::from_ref_time(2_130 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(37_471_000 as u64) + Weight::from_ref_time(40_091_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(26_305_000 as u64) + Weight::from_ref_time(27_459_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(35_418_000 as u64) + Weight::from_ref_time(27_176_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(23_113_000 as u64) + Weight::from_ref_time(14_096_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(17_429_000 as u64) + Weight::from_ref_time(17_365_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(8_153_000 as u64) + Weight::from_ref_time(8_013_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(25_132_000 as u64) + Weight::from_ref_time(27_185_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(17_918_000 as u64) + Weight::from_ref_time(7_955_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(8_173_000 as u64) + Weight::from_ref_time(7_819_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/kusama/src/weights/pallet_scheduler.rs b/runtime/kusama/src/weights/pallet_scheduler.rs index f291bcd2c490..c6df2801dd69 100644 --- a/runtime/kusama/src/weights/pallet_scheduler.rs +++ b/runtime/kusama/src/weights/pallet_scheduler.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 // Executed Command: @@ -32,145 +32,66 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/kusama/src/weights/ +// --output=./runtime/kusama/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(11_217_000 as u64) - // Standard Error: 43_000 - .saturating_add(Weight::from_ref_time(19_456_000 as u64).saturating_mul(s as u64)) + // Storage: Scheduler IncompleteSince (r:1 w:1) + fn service_agendas_base() -> Weight { + Weight::from_ref_time(4_558_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(15_840_000 as u64) - // Standard Error: 23_000 - .saturating_add(Weight::from_ref_time(15_699_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[0, 50]`. + fn service_agenda_base(s: u32, ) -> Weight { + Weight::from_ref_time(3_715_000 as u64) + // Standard Error: 2_737 + .saturating_add(Weight::from_ref_time(624_353 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(10_761_000 as u64) - // Standard Error: 28_000 - .saturating_add(Weight::from_ref_time(17_063_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) + fn service_task_base() -> Weight { + Weight::from_ref_time(9_345_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(12_801_000 as u64) - // Standard Error: 27_000 - .saturating_add(Weight::from_ref_time(14_878_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(10_462_000 as u64) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(5_706_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[128, 4194304]`. + fn service_task_fetched(s: u32, ) -> Weight { + Weight::from_ref_time(20_078_000 as u64) + // Standard Error: 5 + .saturating_add(Weight::from_ref_time(1_153 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(9_952_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(3_762_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } - // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_named(s: u32, ) -> Weight { - Weight::from_ref_time(14_502_000 as u64) - // Standard Error: 14_000 - .saturating_add(Weight::from_ref_time(10_550_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + fn service_task_named() -> Weight { + Weight::from_ref_time(10_744_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:2 w:2) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic(s: u32, ) -> Weight { - Weight::from_ref_time(14_956_000 as u64) - // Standard Error: 12_000 - .saturating_add(Weight::from_ref_time(8_343_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) + fn service_task_periodic() -> Weight { + Weight::from_ref_time(9_556_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named(s: u32, ) -> Weight { - Weight::from_ref_time(13_862_000 as u64) - // Standard Error: 10_000 - .saturating_add(Weight::from_ref_time(7_398_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) + fn execute_dispatch_signed() -> Weight { + Weight::from_ref_time(4_130_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize(s: u32, ) -> Weight { - Weight::from_ref_time(14_529_000 as u64) - // Standard Error: 10_000 - .saturating_add(Weight::from_ref_time(6_467_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + fn execute_dispatch_unsigned() -> Weight { + Weight::from_ref_time(4_058_000 as u64) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. + /// The range of component `s` is `[0, 49]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(19_944_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(69_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(16_721_000 as u64) + // Standard Error: 3_319 + .saturating_add(Weight::from_ref_time(657_802 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -178,19 +99,19 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Lookup (r:0 w:1) /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(20_087_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(1_214_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_496_000 as u64) + // Standard Error: 1_368 + .saturating_add(Weight::from_ref_time(572_226 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. + /// The range of component `s` is `[0, 49]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(23_553_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(118_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_831_000 as u64) + // Standard Error: 3_559 + .saturating_add(Weight::from_ref_time(689_493 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -198,9 +119,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Agenda (r:1 w:1) /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(22_403_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(1_255_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(20_788_000 as u64) + // Standard Error: 1_758 + .saturating_add(Weight::from_ref_time(605_808 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index 93efc260523c..054fb421babd 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -40,7 +40,10 @@ use beefy_primitives::crypto::AuthorityId as BeefyId; use frame_election_provider_support::{generate_solution_type, onchain, SequentialPhragmen}; use frame_support::{ construct_runtime, parameter_types, - traits::{EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, PrivilegeCmp}, + traits::{ + ConstU32, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, + PrivilegeCmp, + }, weights::ConstantMultiplier, PalletId, RuntimeDebug, }; @@ -215,8 +218,7 @@ impl pallet_scheduler::Config for Runtime { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = OriginPrivilegeCmp; - type PreimageProvider = Preimage; - type NoPreimagePostponement = NoPreimagePostponement; + type Preimages = Preimage; } parameter_types! { @@ -230,7 +232,6 @@ impl pallet_preimage::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; - type MaxSize = PreimageMaxSize; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } @@ -615,7 +616,6 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { - type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; @@ -667,14 +667,15 @@ impl pallet_democracy::Config for Runtime { // only do it once and it lasts only for the cooloff period. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; - type PreimageByteDeposit = PreimageByteDeposit; - type OperationalPreimageOrigin = pallet_collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; type WeightInfo = weights::pallet_democracy::WeightInfo; type MaxProposals = MaxProposals; + type Preimages = Preimage; + type MaxDeposits = ConstU32<100>; + type MaxBlacklisted = ConstU32<100>; } parameter_types! { @@ -1560,6 +1561,12 @@ pub type Executive = frame_executive::Executive< StakingMigrationV11OldPallet, >, pallet_staking::migrations::v12::MigrateToV12, + // "Bound uses of call" + pallet_preimage::migration::v1::Migration, + pallet_scheduler::migration::v3::MigrateToV4, + pallet_democracy::migrations::v1::Migration, + pallet_multisig::migrations::v1::MigrateToV1, + // "Properly migrate weights to v2" parachains_configuration::migration::v3::MigrateToV3, ), >; diff --git a/runtime/polkadot/src/weights/pallet_democracy.rs b/runtime/polkadot/src/weights/pallet_democracy.rs index 1e94d2b5deb0..136797abcf03 100644 --- a/runtime/polkadot/src/weights/pallet_democracy.rs +++ b/runtime/polkadot/src/weights/pallet_democracy.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_democracy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024 // Executed Command: @@ -32,13 +32,13 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ +// --output=./runtime/polkadot/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_democracy`. @@ -49,134 +49,103 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(40_082_000 as u64) + Weight::from_ref_time(42_048_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy DepositOf (r:1 w:1) - /// The range of component `s` is `[0, 100]`. - fn second(s: u32, ) -> Weight { - Weight::from_ref_time(31_920_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(82_000 as u64).saturating_mul(s as u64)) + fn second() -> Weight { + Weight::from_ref_time(38_631_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn vote_new(r: u32, ) -> Weight { - Weight::from_ref_time(43_490_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(82_000 as u64).saturating_mul(r as u64)) + fn vote_new() -> Weight { + Weight::from_ref_time(48_571_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn vote_existing(r: u32, ) -> Weight { - Weight::from_ref_time(42_957_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(88_000 as u64).saturating_mul(r as u64)) + fn vote_existing() -> Weight { + Weight::from_ref_time(48_556_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(20_818_000 as u64) + Weight::from_ref_time(20_104_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) + // Storage: Democracy DepositOf (r:1 w:1) + // Storage: System Account (r:1 w:1) // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Blacklist (r:0 w:1) - // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:1 w:1) - /// The range of component `p` is `[1, 100]`. - fn blacklist(p: u32, ) -> Weight { - Weight::from_ref_time(55_285_000 as u64) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(159_000 as u64).saturating_mul(p as u64)) + fn blacklist() -> Weight { + Weight::from_ref_time(75_289_000 as u64) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) - /// The range of component `v` is `[1, 100]`. - fn external_propose(v: u32, ) -> Weight { - Weight::from_ref_time(14_271_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(13_000 as u64).saturating_mul(v as u64)) + fn external_propose() -> Weight { + Weight::from_ref_time(15_734_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(4_129_000 as u64) + Weight::from_ref_time(4_507_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(4_215_000 as u64) + Weight::from_ref_time(4_603_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(20_440_000 as u64) + Weight::from_ref_time(19_816_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) - /// The range of component `v` is `[0, 100]`. - fn veto_external(v: u32, ) -> Weight { - Weight::from_ref_time(21_988_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(19_000 as u64).saturating_mul(v as u64)) + fn veto_external() -> Weight { + Weight::from_ref_time(25_722_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `p` is `[1, 100]`. - fn cancel_proposal(p: u32, ) -> Weight { - Weight::from_ref_time(46_176_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(134_000 as u64).saturating_mul(p as u64)) + fn cancel_proposal() -> Weight { + Weight::from_ref_time(63_768_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(12_940_000 as u64) + Weight::from_ref_time(13_183_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Scheduler Lookup (r:1 w:1) - // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn cancel_queued(r: u32, ) -> Weight { - Weight::from_ref_time(27_421_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(808_000 as u64).saturating_mul(r as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:0) + /// The range of component `r` is `[0, 99]`. fn on_initialize_base(r: u32, ) -> Weight { - Weight::from_ref_time(9_602_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(2_017_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(5_999_000 as u64) + // Standard Error: 2_072 + .saturating_add(Weight::from_ref_time(2_080_681 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) @@ -186,36 +155,36 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy LastTabledWasExternal (r:1 w:0) // Storage: Democracy NextExternal (r:1 w:0) // Storage: Democracy PublicProps (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:0) + /// The range of component `r` is `[0, 99]`. fn on_initialize_base_with_launch_period(r: u32, ) -> Weight { - Weight::from_ref_time(12_548_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(2_010_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(8_114_000 as u64) + // Standard Error: 2_286 + .saturating_add(Weight::from_ref_time(2_087_574 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:3 w:3) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:2) + /// The range of component `r` is `[0, 99]`. fn delegate(r: u32, ) -> Weight { - Weight::from_ref_time(46_940_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(2_877_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(40_509_000 as u64) + // Standard Error: 3_676 + .saturating_add(Weight::from_ref_time(2_999_395 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(4 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(4 as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) } // Storage: Democracy VotingOf (r:2 w:2) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:2) + /// The range of component `r` is `[0, 99]`. fn undelegate(r: u32, ) -> Weight { - Weight::from_ref_time(27_418_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(2_872_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(24_592_000 as u64) + // Standard Error: 2_506 + .saturating_add(Weight::from_ref_time(2_932_469 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) @@ -223,76 +192,48 @@ impl pallet_democracy::WeightInfo for WeightInfo { } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(4_996_000 as u64) + Weight::from_ref_time(5_070_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Democracy Preimages (r:1 w:1) - /// The range of component `b` is `[0, 16384]`. - fn note_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(28_635_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - /// The range of component `b` is `[0, 16384]`. - fn note_imminent_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(21_474_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - // Storage: System Account (r:1 w:1) - /// The range of component `b` is `[0, 16384]`. - fn reap_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(36_399_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[0, 99]`. fn unlock_remove(r: u32, ) -> Weight { - Weight::from_ref_time(32_139_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(30_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(23_860_000 as u64) + // Standard Error: 2_624 + .saturating_add(Weight::from_ref_time(129_209 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[0, 99]`. fn unlock_set(r: u32, ) -> Weight { - Weight::from_ref_time(31_338_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(70_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(28_512_000 as u64) + // Standard Error: 619 + .saturating_add(Weight::from_ref_time(84_477 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[1, 100]`. fn remove_vote(r: u32, ) -> Weight { - Weight::from_ref_time(18_298_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(78_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(15_612_000 as u64) + // Standard Error: 841 + .saturating_add(Weight::from_ref_time(98_567 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[1, 100]`. fn remove_other_vote(r: u32, ) -> Weight { - Weight::from_ref_time(18_456_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(75_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(15_282_000 as u64) + // Standard Error: 1_040 + .saturating_add(Weight::from_ref_time(104_928 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/polkadot/src/weights/pallet_preimage.rs b/runtime/polkadot/src/weights/pallet_preimage.rs index 15606f560519..bd316e310277 100644 --- a/runtime/polkadot/src/weights/pallet_preimage.rs +++ b/runtime/polkadot/src/weights/pallet_preimage.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024 // Executed Command: @@ -32,103 +32,102 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ +// --output=./runtime/polkadot/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_preimage`. pub struct WeightInfo(PhantomData); impl pallet_preimage::WeightInfo for WeightInfo { - // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) + Weight::from_ref_time(28_326_000 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(Weight::from_ref_time(2_116 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) + Weight::from_ref_time(20_011_000 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(Weight::from_ref_time(2_114 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + Weight::from_ref_time(18_805_000 as u64) + // Standard Error: 1 + .saturating_add(Weight::from_ref_time(2_116 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(40_028_000 as u64) + Weight::from_ref_time(39_007_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(27_637_000 as u64) + Weight::from_ref_time(27_523_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(37_505_000 as u64) + Weight::from_ref_time(26_477_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(26_628_000 as u64) + Weight::from_ref_time(13_236_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(17_156_000 as u64) + Weight::from_ref_time(17_975_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(8_109_000 as u64) + Weight::from_ref_time(8_295_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(27_209_000 as u64) + Weight::from_ref_time(26_186_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(17_931_000 as u64) + Weight::from_ref_time(8_176_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(7_951_000 as u64) + Weight::from_ref_time(8_005_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/polkadot/src/weights/pallet_scheduler.rs b/runtime/polkadot/src/weights/pallet_scheduler.rs index 6103794df8a5..9446fdc5efec 100644 --- a/runtime/polkadot/src/weights/pallet_scheduler.rs +++ b/runtime/polkadot/src/weights/pallet_scheduler.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024 // Executed Command: @@ -32,145 +32,69 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/polkadot/src/weights/ +// --output=./runtime/polkadot/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(15_177_000 as u64) - // Standard Error: 21_000 - .saturating_add(Weight::from_ref_time(18_354_000 as u64).saturating_mul(s as u64)) + // Storage: Scheduler IncompleteSince (r:1 w:1) + fn service_agendas_base() -> Weight { + Weight::from_ref_time(4_522_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(12_632_000 as u64) - // Standard Error: 23_000 - .saturating_add(Weight::from_ref_time(14_845_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[0, 50]`. + fn service_agenda_base(s: u32, ) -> Weight { + Weight::from_ref_time(3_859_000 as u64) + // Standard Error: 2_692 + .saturating_add(Weight::from_ref_time(618_992 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(13_757_000 as u64) - // Standard Error: 20_000 - .saturating_add(Weight::from_ref_time(15_871_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) + fn service_task_base() -> Weight { + Weight::from_ref_time(12_288_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(15_338_000 as u64) - // Standard Error: 16_000 - .saturating_add(Weight::from_ref_time(13_610_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(10_335_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(5_073_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(10_095_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(3_021_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[128, 4194304]`. + fn service_task_fetched(s: u32, ) -> Weight { + Weight::from_ref_time(23_105_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_126 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_named(s: u32, ) -> Weight { - Weight::from_ref_time(15_328_000 as u64) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(9_601_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic(s: u32, ) -> Weight { - Weight::from_ref_time(18_306_000 as u64) - // Standard Error: 11_000 - .saturating_add(Weight::from_ref_time(7_155_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + fn service_task_named() -> Weight { + Weight::from_ref_time(13_382_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named(s: u32, ) -> Weight { - Weight::from_ref_time(16_079_000 as u64) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(6_321_000 as u64).saturating_mul(s as u64)) + fn service_task_periodic() -> Weight { + Weight::from_ref_time(19_246_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize(s: u32, ) -> Weight { - Weight::from_ref_time(16_074_000 as u64) - // Standard Error: 8_000 - .saturating_add(Weight::from_ref_time(5_352_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + fn execute_dispatch_signed() -> Weight { + Weight::from_ref_time(3_714_000 as u64) + } + fn execute_dispatch_unsigned() -> Weight { + Weight::from_ref_time(3_667_000 as u64) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. + /// The range of component `s` is `[0, 49]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(19_480_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(76_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(16_556_000 as u64) + // Standard Error: 3_431 + .saturating_add(Weight::from_ref_time(659_506 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -178,19 +102,19 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Lookup (r:0 w:1) /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(19_669_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(892_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(18_922_000 as u64) + // Standard Error: 1_665 + .saturating_add(Weight::from_ref_time(586_420 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. + /// The range of component `s` is `[0, 49]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(24_633_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(81_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_633_000 as u64) + // Standard Error: 3_740 + .saturating_add(Weight::from_ref_time(692_772 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -198,9 +122,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Agenda (r:1 w:1) /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(22_707_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(922_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(20_220_000 as u64) + // Standard Error: 2_111 + .saturating_add(Weight::from_ref_time(622_452 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index 5680d1b25403..a13bc5932db2 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -70,8 +70,8 @@ use sp_mmr_primitives as mmr; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{ - AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, Extrinsic as ExtrinsicT, - Keccak256, OpaqueKeys, SaturatedConversion, Verify, + AccountIdLookup, BlakeTwo256, Block as BlockT, ConstU32, ConvertInto, + Extrinsic as ExtrinsicT, Keccak256, OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, ApplyExtrinsicResult, KeyTypeId, Perbill, Percent, Permill, @@ -216,12 +216,10 @@ impl pallet_scheduler::Config for Runtime { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = OriginPrivilegeCmp; - type PreimageProvider = Preimage; - type NoPreimagePostponement = NoPreimagePostponement; + type Preimages = Preimage; } parameter_types! { - pub const PreimageMaxSize: u32 = 4096 * 1024; pub const PreimageBaseDeposit: Balance = deposit(2, 64); pub const PreimageByteDeposit: Balance = deposit(0, 1); } @@ -231,7 +229,6 @@ impl pallet_preimage::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; - type MaxSize = PreimageMaxSize; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } @@ -399,7 +396,6 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { - type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; @@ -441,14 +437,15 @@ impl pallet_democracy::Config for Runtime { // only do it once and it lasts only for the cooloff period. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; - type PreimageByteDeposit = PreimageByteDeposit; - type OperationalPreimageOrigin = pallet_collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; type WeightInfo = weights::pallet_democracy::WeightInfo; type MaxProposals = MaxProposals; + type Preimages = Preimage; + type MaxDeposits = ConstU32<100>; + type MaxBlacklisted = ConstU32<100>; } parameter_types! { @@ -1453,7 +1450,15 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - (parachains_configuration::migration::v3::MigrateToV3,), + ( + // "Bound uses of call" + pallet_preimage::migration::v1::Migration, + pallet_scheduler::migration::v3::MigrateToV4, + pallet_democracy::migrations::v1::Migration, + pallet_multisig::migrations::v1::MigrateToV1, + // "Properly migrate weights to v2" + parachains_configuration::migration::v3::MigrateToV3, + ), >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; diff --git a/runtime/rococo/src/weights/pallet_democracy.rs b/runtime/rococo/src/weights/pallet_democracy.rs index 317b0d4bb0a1..453385b594e7 100644 --- a/runtime/rococo/src/weights/pallet_democracy.rs +++ b/runtime/rococo/src/weights/pallet_democracy.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_democracy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-08-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 // Executed Command: @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/rococo/src/weights/pallet_democracy.rs +// --output=./runtime/rococo/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -49,134 +49,103 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(37_453_000 as u64) + Weight::from_ref_time(41_783_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy DepositOf (r:1 w:1) - /// The range of component `s` is `[0, 100]`. - fn second(s: u32, ) -> Weight { - Weight::from_ref_time(27_807_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(69_000 as u64).saturating_mul(s as u64)) + fn second() -> Weight { + Weight::from_ref_time(38_362_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn vote_new(r: u32, ) -> Weight { - Weight::from_ref_time(35_336_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(120_000 as u64).saturating_mul(r as u64)) + fn vote_new() -> Weight { + Weight::from_ref_time(48_307_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn vote_existing(r: u32, ) -> Weight { - Weight::from_ref_time(35_107_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(123_000 as u64).saturating_mul(r as u64)) + fn vote_existing() -> Weight { + Weight::from_ref_time(48_500_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(17_752_000 as u64) + Weight::from_ref_time(20_294_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) + // Storage: Democracy DepositOf (r:1 w:1) + // Storage: System Account (r:1 w:1) // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Blacklist (r:0 w:1) - // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:1 w:1) - /// The range of component `p` is `[1, 100]`. - fn blacklist(p: u32, ) -> Weight { - Weight::from_ref_time(52_116_000 as u64) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(194_000 as u64).saturating_mul(p as u64)) + fn blacklist() -> Weight { + Weight::from_ref_time(75_191_000 as u64) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) - /// The range of component `v` is `[1, 100]`. - fn external_propose(v: u32, ) -> Weight { - Weight::from_ref_time(10_194_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(10_000 as u64).saturating_mul(v as u64)) + fn external_propose() -> Weight { + Weight::from_ref_time(16_369_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(3_700_000 as u64) + Weight::from_ref_time(4_767_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(3_713_000 as u64) + Weight::from_ref_time(4_866_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(17_441_000 as u64) + Weight::from_ref_time(19_986_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) - /// The range of component `v` is `[0, 100]`. - fn veto_external(v: u32, ) -> Weight { - Weight::from_ref_time(18_536_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(42_000 as u64).saturating_mul(v as u64)) + fn veto_external() -> Weight { + Weight::from_ref_time(25_291_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `p` is `[1, 100]`. - fn cancel_proposal(p: u32, ) -> Weight { - Weight::from_ref_time(42_174_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(164_000 as u64).saturating_mul(p as u64)) + fn cancel_proposal() -> Weight { + Weight::from_ref_time(63_703_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(11_892_000 as u64) + Weight::from_ref_time(13_235_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Scheduler Lookup (r:1 w:1) - // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `r` is `[1, 99]`. - fn cancel_queued(r: u32, ) -> Weight { - Weight::from_ref_time(23_252_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(2_242_000 as u64).saturating_mul(r as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:0) + /// The range of component `r` is `[0, 99]`. fn on_initialize_base(r: u32, ) -> Weight { - Weight::from_ref_time(1_457_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(2_956_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(5_980_000 as u64) + // Standard Error: 2_131 + .saturating_add(Weight::from_ref_time(2_104_197 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) @@ -186,36 +155,36 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy LastTabledWasExternal (r:1 w:0) // Storage: Democracy NextExternal (r:1 w:0) // Storage: Democracy PublicProps (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:1 w:0) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:0) + /// The range of component `r` is `[0, 99]`. fn on_initialize_base_with_launch_period(r: u32, ) -> Weight { - Weight::from_ref_time(6_240_000 as u64) - // Standard Error: 3_000 - .saturating_add(Weight::from_ref_time(2_963_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(8_351_000 as u64) + // Standard Error: 2_308 + .saturating_add(Weight::from_ref_time(2_117_411 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:3 w:3) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:2) + /// The range of component `r` is `[0, 99]`. fn delegate(r: u32, ) -> Weight { - Weight::from_ref_time(34_480_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(3_908_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(40_303_000 as u64) + // Standard Error: 3_789 + .saturating_add(Weight::from_ref_time(3_031_594 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(4 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(4 as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) } // Storage: Democracy VotingOf (r:2 w:2) - // Storage: Democracy ReferendumInfoOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + // Storage: Democracy ReferendumInfoOf (r:2 w:2) + /// The range of component `r` is `[0, 99]`. fn undelegate(r: u32, ) -> Weight { - Weight::from_ref_time(17_446_000 as u64) - // Standard Error: 6_000 - .saturating_add(Weight::from_ref_time(3_917_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(24_342_000 as u64) + // Standard Error: 2_624 + .saturating_add(Weight::from_ref_time(2_962_125 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) @@ -223,76 +192,48 @@ impl pallet_democracy::WeightInfo for WeightInfo { } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(3_727_000 as u64) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - /// The range of component `b` is `[0, 16384]`. - fn note_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(25_720_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - /// The range of component `b` is `[0, 16384]`. - fn note_imminent_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(17_884_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - } - // Storage: Democracy Preimages (r:1 w:1) - // Storage: System Account (r:1 w:0) - /// The range of component `b` is `[0, 16384]`. - fn reap_preimage(b: u32, ) -> Weight { - Weight::from_ref_time(24_695_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) + Weight::from_ref_time(5_811_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[0, 99]`. fn unlock_remove(r: u32, ) -> Weight { - Weight::from_ref_time(22_207_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(36_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(22_894_000 as u64) + // Standard Error: 2_967 + .saturating_add(Weight::from_ref_time(142_001 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[0, 99]`. fn unlock_set(r: u32, ) -> Weight { - Weight::from_ref_time(21_561_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(110_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(28_227_000 as u64) + // Standard Error: 673 + .saturating_add(Weight::from_ref_time(87_748 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[1, 100]`. fn remove_vote(r: u32, ) -> Weight { - Weight::from_ref_time(13_204_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(105_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(15_578_000 as u64) + // Standard Error: 1_035 + .saturating_add(Weight::from_ref_time(105_378 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 99]`. + /// The range of component `r` is `[1, 100]`. fn remove_other_vote(r: u32, ) -> Weight { - Weight::from_ref_time(12_994_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(106_000 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(15_542_000 as u64) + // Standard Error: 1_104 + .saturating_add(Weight::from_ref_time(109_552 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/rococo/src/weights/pallet_preimage.rs b/runtime/rococo/src/weights/pallet_preimage.rs index 5268e8054a13..1755de2b34e6 100644 --- a/runtime/rococo/src/weights/pallet_preimage.rs +++ b/runtime/rococo/src/weights/pallet_preimage.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-08-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 // Executed Command: @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/rococo/src/weights/pallet_preimage.rs +// --output=./runtime/rococo/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -44,91 +44,90 @@ use sp_std::marker::PhantomData; /// Weight functions for `pallet_preimage`. pub struct WeightInfo(PhantomData); impl pallet_preimage::WeightInfo for WeightInfo { - // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) + Weight::from_ref_time(29_017_000 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(Weight::from_ref_time(2_113 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + Weight::from_ref_time(19_793_000 as u64) + // Standard Error: 1 + .saturating_add(Weight::from_ref_time(2_115 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + Weight::from_ref_time(18_854_000 as u64) + // Standard Error: 1 + .saturating_add(Weight::from_ref_time(2_115 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(35_236_000 as u64) + Weight::from_ref_time(38_886_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(23_396_000 as u64) + Weight::from_ref_time(27_017_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(33_944_000 as u64) + Weight::from_ref_time(25_041_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(22_151_000 as u64) + Weight::from_ref_time(13_933_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(16_617_000 as u64) + Weight::from_ref_time(17_760_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(6_552_000 as u64) + Weight::from_ref_time(8_816_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(23_787_000 as u64) + Weight::from_ref_time(25_068_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(16_327_000 as u64) + Weight::from_ref_time(8_917_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(6_289_000 as u64) + Weight::from_ref_time(8_915_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/rococo/src/weights/pallet_scheduler.rs b/runtime/rococo/src/weights/pallet_scheduler.rs index 06a77fcee9cb..ae9dc6426622 100644 --- a/runtime/rococo/src/weights/pallet_scheduler.rs +++ b/runtime/rococo/src/weights/pallet_scheduler.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-08-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 // Executed Command: @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/rococo/src/weights/pallet_scheduler.rs +// --output=./runtime/rococo/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -44,133 +44,57 @@ use sp_std::marker::PhantomData; /// Weight functions for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(1_256_000 as u64) - // Standard Error: 42_000 - .saturating_add(Weight::from_ref_time(26_925_000 as u64).saturating_mul(s as u64)) + // Storage: Scheduler IncompleteSince (r:1 w:1) + fn service_agendas_base() -> Weight { + Weight::from_ref_time(4_700_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(921_000 as u64) - // Standard Error: 35_000 - .saturating_add(Weight::from_ref_time(21_922_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[0, 50]`. + fn service_agenda_base(s: u32, ) -> Weight { + Weight::from_ref_time(3_868_000 as u64) + // Standard Error: 2_747 + .saturating_add(Weight::from_ref_time(629_992 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 62_000 - .saturating_add(Weight::from_ref_time(24_926_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) + fn service_task_base() -> Weight { + Weight::from_ref_time(12_316_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(10_674_000 as u64) - // Standard Error: 31_000 - .saturating_add(Weight::from_ref_time(20_631_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(2_607_000 as u64) - // Standard Error: 20_000 - .saturating_add(Weight::from_ref_time(10_009_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(3_381_000 as u64) - // Standard Error: 17_000 - .saturating_add(Weight::from_ref_time(7_945_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[128, 4194304]`. + fn service_task_fetched(s: u32, ) -> Weight { + Weight::from_ref_time(24_103_000 as u64) + // Standard Error: 5 + .saturating_add(Weight::from_ref_time(1_154 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_named(s: u32, ) -> Weight { - Weight::from_ref_time(6_676_000 as u64) - // Standard Error: 25_000 - .saturating_add(Weight::from_ref_time(16_966_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic(s: u32, ) -> Weight { - Weight::from_ref_time(8_899_000 as u64) - // Standard Error: 24_000 - .saturating_add(Weight::from_ref_time(14_630_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + fn service_task_named() -> Weight { + Weight::from_ref_time(13_408_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named(s: u32, ) -> Weight { - Weight::from_ref_time(8_583_000 as u64) - // Standard Error: 19_000 - .saturating_add(Weight::from_ref_time(12_228_000 as u64).saturating_mul(s as u64)) + fn service_task_periodic() -> Weight { + Weight::from_ref_time(19_302_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize(s: u32, ) -> Weight { - Weight::from_ref_time(8_544_000 as u64) - // Standard Error: 19_000 - .saturating_add(Weight::from_ref_time(11_364_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + fn execute_dispatch_signed() -> Weight { + Weight::from_ref_time(3_885_000 as u64) + } + fn execute_dispatch_unsigned() -> Weight { + Weight::from_ref_time(4_037_000 as u64) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. + /// The range of component `s` is `[0, 49]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(19_060_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(46_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(16_768_000 as u64) + // Standard Error: 3_650 + .saturating_add(Weight::from_ref_time(667_428 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -178,19 +102,19 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Lookup (r:0 w:1) /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(17_694_000 as u64) - // Standard Error: 7_000 - .saturating_add(Weight::from_ref_time(2_368_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_239_000 as u64) + // Standard Error: 1_456 + .saturating_add(Weight::from_ref_time(578_125 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. + /// The range of component `s` is `[0, 49]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(22_258_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(60_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_065_000 as u64) + // Standard Error: 4_027 + .saturating_add(Weight::from_ref_time(719_766 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -198,9 +122,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Agenda (r:1 w:1) /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(18_882_000 as u64) - // Standard Error: 7_000 - .saturating_add(Weight::from_ref_time(2_379_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(20_039_000 as u64) + // Standard Error: 2_179 + .saturating_add(Weight::from_ref_time(627_335 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 5cdb6e81ae36..61a909b4806d 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -181,8 +181,7 @@ impl pallet_scheduler::Config for Runtime { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = frame_support::traits::EqualPrivilegeOnly; - type PreimageProvider = Preimage; - type NoPreimagePostponement = NoPreimagePostponement; + type Preimages = Preimage; } parameter_types! { @@ -196,7 +195,6 @@ impl pallet_preimage::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; - type MaxSize = PreimageMaxSize; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } @@ -1215,6 +1213,11 @@ pub type Executive = frame_executive::Executive< StakingMigrationV11OldPallet, >, pallet_staking::migrations::v12::MigrateToV12, + // "Bound uses of call" + pallet_preimage::migration::v1::Migration, + pallet_scheduler::migration::v3::MigrateToV4, + pallet_multisig::migrations::v1::MigrateToV1, + // "Properly migrate weights to v2" parachains_configuration::migration::v3::MigrateToV3, ), >; diff --git a/runtime/westend/src/weights/pallet_preimage.rs b/runtime/westend/src/weights/pallet_preimage.rs index afd51148cdde..97f066d7d40b 100644 --- a/runtime/westend/src/weights/pallet_preimage.rs +++ b/runtime/westend/src/weights/pallet_preimage.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024 // Executed Command: @@ -32,103 +32,102 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/westend/src/weights/ +// --output=./runtime/westend/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_preimage`. pub struct WeightInfo(PhantomData); impl pallet_preimage::WeightInfo for WeightInfo { - // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) + Weight::from_ref_time(28_888_000 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(Weight::from_ref_time(2_116 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) + Weight::from_ref_time(20_640_000 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(Weight::from_ref_time(2_115 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:0) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(0 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + Weight::from_ref_time(19_203_000 as u64) + // Standard Error: 1 + .saturating_add(Weight::from_ref_time(2_115 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(40_836_000 as u64) + Weight::from_ref_time(41_563_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(28_774_000 as u64) + Weight::from_ref_time(28_606_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(37_963_000 as u64) + Weight::from_ref_time(27_447_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(25_754_000 as u64) + Weight::from_ref_time(14_862_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(17_769_000 as u64) + Weight::from_ref_time(18_337_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(9_214_000 as u64) + Weight::from_ref_time(9_074_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(26_179_000 as u64) + Weight::from_ref_time(28_192_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(18_809_000 as u64) + Weight::from_ref_time(9_012_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(8_759_000 as u64) + Weight::from_ref_time(8_961_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/westend/src/weights/pallet_scheduler.rs b/runtime/westend/src/weights/pallet_scheduler.rs index edbd3187d1c9..f325f2311093 100644 --- a/runtime/westend/src/weights/pallet_scheduler.rs +++ b/runtime/westend/src/weights/pallet_scheduler.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024 // Executed Command: @@ -32,145 +32,69 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/westend/src/weights/ +// --output=./runtime/westend/src/weights #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::{Weight}}; +use frame_support::{traits::Get, weights::Weight}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(16_183_000 as u64) - // Standard Error: 27_000 - .saturating_add(Weight::from_ref_time(18_374_000 as u64).saturating_mul(s as u64)) + // Storage: Scheduler IncompleteSince (r:1 w:1) + fn service_agendas_base() -> Weight { + Weight::from_ref_time(4_399_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(15_223_000 as u64) - // Standard Error: 28_000 - .saturating_add(Weight::from_ref_time(15_096_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[0, 50]`. + fn service_agenda_base(s: u32, ) -> Weight { + Weight::from_ref_time(3_771_000 as u64) + // Standard Error: 2_641 + .saturating_add(Weight::from_ref_time(610_848 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:1) - // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(13_305_000 as u64) - // Standard Error: 28_000 - .saturating_add(Weight::from_ref_time(16_211_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) + fn service_task_base() -> Weight { + Weight::from_ref_time(12_651_000 as u64) } - // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_resolved(s: u32, ) -> Weight { - Weight::from_ref_time(15_574_000 as u64) - // Standard Error: 22_000 - .saturating_add(Weight::from_ref_time(13_923_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(11_205_000 as u64) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(5_044_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(2 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - // Storage: Preimage PreimageFor (r:1 w:0) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_aborted(s: u32, ) -> Weight { - Weight::from_ref_time(10_287_000 as u64) - // Standard Error: 5_000 - .saturating_add(Weight::from_ref_time(3_072_000 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[128, 4194304]`. + fn service_task_fetched(s: u32, ) -> Weight { + Weight::from_ref_time(24_280_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_126 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic_named(s: u32, ) -> Weight { - Weight::from_ref_time(14_489_000 as u64) - // Standard Error: 16_000 - .saturating_add(Weight::from_ref_time(9_468_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) - .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) - } - // Storage: Scheduler Agenda (r:2 w:2) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_periodic(s: u32, ) -> Weight { - Weight::from_ref_time(16_768_000 as u64) - // Standard Error: 10_000 - .saturating_add(Weight::from_ref_time(7_121_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + fn service_task_named() -> Weight { + Weight::from_ref_time(13_929_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - // Storage: Scheduler Lookup (r:0 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize_named(s: u32, ) -> Weight { - Weight::from_ref_time(17_047_000 as u64) - // Standard Error: 9_000 - .saturating_add(Weight::from_ref_time(6_192_000 as u64).saturating_mul(s as u64)) + fn service_task_periodic() -> Weight { + Weight::from_ref_time(19_285_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) - .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[1, 50]`. - fn on_initialize(s: u32, ) -> Weight { - Weight::from_ref_time(17_163_000 as u64) - // Standard Error: 10_000 - .saturating_add(Weight::from_ref_time(5_300_000 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + fn execute_dispatch_signed() -> Weight { + Weight::from_ref_time(4_026_000 as u64) + } + fn execute_dispatch_unsigned() -> Weight { + Weight::from_ref_time(4_078_000 as u64) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. + /// The range of component `s` is `[0, 49]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(19_757_000 as u64) - // Standard Error: 1_000 - .saturating_add(Weight::from_ref_time(75_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(17_176_000 as u64) + // Standard Error: 3_203 + .saturating_add(Weight::from_ref_time(645_757 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -178,19 +102,19 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Lookup (r:0 w:1) /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(20_399_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(880_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_408_000 as u64) + // Standard Error: 1_645 + .saturating_add(Weight::from_ref_time(575_558 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. + /// The range of component `s` is `[0, 49]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(23_671_000 as u64) - // Standard Error: 2_000 - .saturating_add(Weight::from_ref_time(121_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(20_173_000 as u64) + // Standard Error: 3_998 + .saturating_add(Weight::from_ref_time(684_714 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -198,9 +122,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Agenda (r:1 w:1) /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(23_233_000 as u64) - // Standard Error: 4_000 - .saturating_add(Weight::from_ref_time(924_000 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(20_330_000 as u64) + // Standard Error: 2_310 + .saturating_add(Weight::from_ref_time(621_196 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } From e2a977a5898ab670bdc8db6dc3cb0cf4644e23ee Mon Sep 17 00:00:00 2001 From: Andronik Date: Thu, 6 Oct 2022 00:36:51 +0200 Subject: [PATCH 29/49] update kvdb & co (#6111) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * toml changes * REVERTME: patch * adapt parachains db interface * fix Cargo.toml patch after master rebase * fix av-store * fix chain-selection * fix parachains-db? * Revert "fix Cargo.toml patch after master rebase" This reverts commit 3afcbf033c86027b3f2b909d83ec703591bdd287. * Revert "REVERTME: patch" This reverts commit 464b717cf4142d3d09c3d77b83700b632d8c5f54. * Use `Ok` imported from prelude Co-authored-by: Bastian Köcher * update lockfile for {"substrate"} * Revert "update lockfile for {"substrate"}" This reverts commit fdc623de226f7645741b86c4b1a7d030fed2172d. * cargo update -p sp-io Co-authored-by: Bastian Köcher Co-authored-by: parity-processbot <> --- Cargo.lock | 442 +++++++++--------- Cargo.toml | 2 +- core-primitives/Cargo.toml | 2 +- node/core/approval-voting/Cargo.toml | 4 +- node/core/av-store/Cargo.toml | 4 +- node/core/av-store/src/lib.rs | 28 +- node/core/chain-selection/Cargo.toml | 4 +- .../core/chain-selection/src/db_backend/v1.rs | 26 +- node/core/dispute-coordinator/Cargo.toml | 4 +- node/core/runtime-api/Cargo.toml | 2 +- node/malus/Cargo.toml | 2 +- node/overseer/Cargo.toml | 2 +- node/service/Cargo.toml | 4 +- node/service/src/parachains_db/upgrade.rs | 2 +- node/subsystem-util/Cargo.toml | 6 +- node/subsystem-util/src/database.rs | 79 ++-- parachain/Cargo.toml | 2 +- primitives/Cargo.toml | 2 +- 18 files changed, 294 insertions(+), 323 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 53eaa9fa29dd..ddd603dabb44 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -435,7 +435,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "array-bytes", "async-trait", @@ -472,7 +472,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -492,7 +492,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "beefy-primitives", "sp-api", @@ -502,7 +502,7 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "parity-scale-codec", "scale-info", @@ -530,9 +530,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.59.2" +version = "0.60.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" dependencies = [ "bitflags", "cexpr", @@ -915,7 +915,7 @@ checksum = "fa66045b9cb23c2e9c1520732030608b02ee07e5cfaa5a521ec15ded7fa24c90" dependencies = [ "glob", "libc", - "libloading 0.7.2", + "libloading", ] [[package]] @@ -1946,9 +1946,9 @@ dependencies = [ [[package]] name = "fixed-hash" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", "rand 0.8.5", @@ -1999,7 +1999,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "parity-scale-codec", ] @@ -2017,7 +2017,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-support", "frame-system", @@ -2040,7 +2040,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "Inflector", "array-bytes", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2102,7 +2102,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2118,7 +2118,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-support", "frame-system", @@ -2147,7 +2147,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "bitflags", "frame-metadata", @@ -2179,7 +2179,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "Inflector", "cfg-expr", @@ -2193,7 +2193,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2205,7 +2205,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "proc-macro2", "quote", @@ -2215,7 +2215,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2238,7 +2238,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-support", "frame-system", @@ -2249,7 +2249,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-support", "log", @@ -2267,7 +2267,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -2282,7 +2282,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "parity-scale-codec", "sp-api", @@ -2291,7 +2291,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-support", "parity-scale-codec", @@ -2306,18 +2306,6 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ebd3504ad6116843b8375ad70df74e7bfe83cac77a1f3fe73200c844d43bfe0" -[[package]] -name = "fs-swap" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5" -dependencies = [ - "lazy_static", - "libc", - "libloading 0.5.2", - "winapi", -] - [[package]] name = "fs2" version = "0.4.3" @@ -2474,7 +2462,7 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "chrono", "frame-election-provider-support", @@ -2910,9 +2898,9 @@ dependencies = [ [[package]] name = "impl-serde" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" dependencies = [ "serde", ] @@ -3327,9 +3315,9 @@ dependencies = [ [[package]] name = "kvdb" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a301d8ecb7989d4a6e2c57a49baca77d353bdbf879909debe3f375fe25d61f86" +checksum = "585089ceadba0197ffe9af6740ab350b325e3c1f5fccfbc3522e0250c750409b" dependencies = [ "parity-util-mem", "smallvec", @@ -3337,9 +3325,9 @@ dependencies = [ [[package]] name = "kvdb-memorydb" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece7e668abd21387aeb6628130a6f4c802787f014fa46bc83221448322250357" +checksum = "40d109c87bfb7759edd2a49b2649c1afe25af785d930ad6a38479b4dc70dd873" dependencies = [ "kvdb", "parity-util-mem", @@ -3348,15 +3336,13 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.15.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca7fbdfd71cd663dceb0faf3367a99f8cf724514933e9867cec4995b6027cbc1" +checksum = "c076cc2cdbac89b9910c853a36c957d3862a779f31c2661174222cefb49ee597" dependencies = [ - "fs-swap", "kvdb", "log", "num_cpus", - "owning_ref", "parity-util-mem", "parking_lot 0.12.1", "regex", @@ -3366,9 +3352,9 @@ dependencies = [ [[package]] name = "kvdb-shared-tests" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9001edd3459aa1503ea84215cf4618a6e2e020f51682494cc6f5ab1150e68e" +checksum = "de82a1adb7ade192c0090dd56d059a626191c0638c795eb68aff4b0bd2c1f9be" dependencies = [ "kvdb", ] @@ -3403,16 +3389,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "libloading" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -dependencies = [ - "cc", - "winapi", -] - [[package]] name = "libloading" version = "0.7.2" @@ -3946,9 +3922,9 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "0.6.1+6.28.2" +version = "0.8.0+7.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bc587013734dadb7cf23468e531aa120788b87243648be42e2d3a072186291" +checksum = "611804e4666a25136fcc5f8cf425ab4d26c7f74ea245ffe92ea23b85b6420b5d" dependencies = [ "bindgen", "bzip2-sys", @@ -4225,9 +4201,9 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" +checksum = "34ac11bb793c28fa095b7554466f53b3a60a2cd002afdac01bcf135cbd73a269" dependencies = [ "hash-db", "hashbrown", @@ -4835,7 +4811,7 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -4849,7 +4825,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-support", "frame-system", @@ -4865,7 +4841,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-support", "frame-system", @@ -4880,7 +4856,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -4904,7 +4880,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4924,7 +4900,7 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4943,7 +4919,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -4958,7 +4934,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "beefy-primitives", "frame-support", @@ -4974,7 +4950,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "array-bytes", "beefy-merkle-tree", @@ -4997,7 +4973,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5015,7 +4991,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5034,7 +5010,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5051,7 +5027,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5068,7 +5044,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5086,7 +5062,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5110,7 +5086,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5123,7 +5099,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5141,7 +5117,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5162,7 +5138,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5177,7 +5153,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5200,7 +5176,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5216,7 +5192,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5236,7 +5212,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5253,7 +5229,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5270,7 +5246,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5288,7 +5264,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -5303,7 +5279,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5319,7 +5295,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-support", "frame-system", @@ -5336,7 +5312,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5356,7 +5332,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "parity-scale-codec", "sp-api", @@ -5366,7 +5342,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-support", "frame-system", @@ -5383,7 +5359,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5406,7 +5382,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5423,7 +5399,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5438,7 +5414,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5456,7 +5432,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5471,7 +5447,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5489,7 +5465,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5505,7 +5481,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-support", "frame-system", @@ -5526,7 +5502,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5542,7 +5518,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-support", "frame-system", @@ -5556,7 +5532,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5579,7 +5555,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5590,7 +5566,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "log", "sp-arithmetic", @@ -5599,7 +5575,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-support", "frame-system", @@ -5613,7 +5589,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5631,7 +5607,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5650,7 +5626,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-support", "frame-system", @@ -5666,7 +5642,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5681,7 +5657,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5692,7 +5668,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5709,7 +5685,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5725,7 +5701,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5740,7 +5716,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-benchmarking", "frame-support", @@ -5853,9 +5829,9 @@ checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" [[package]] name = "parity-util-mem" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" +checksum = "0d32c34f4f5ca7f9196001c0aba5a1f9a5a12382c8944b8b0f90233282d1e8f8" dependencies = [ "cfg-if 1.0.0", "hashbrown", @@ -7732,9 +7708,9 @@ dependencies = [ [[package]] name = "primitive-types" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" +checksum = "5cfd65aea0c5fa0bfcc7c9e7ca828c921ef778f43d325325ec84bda371bfa75a" dependencies = [ "fixed-hash", "impl-codec", @@ -8274,7 +8250,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "env_logger 0.9.0", "jsonrpsee", @@ -8372,9 +8348,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620f4129485ff1a7128d184bc687470c21c7951b64779ebc9cfdad3dcd920290" +checksum = "7e9562ea1d70c0cc63a34a22d977753b50cca91cc6b6527750463bd5dd8697bc" dependencies = [ "libc", "librocksdb-sys", @@ -8622,7 +8598,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "log", "sp-core", @@ -8633,7 +8609,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "async-trait", "futures", @@ -8660,7 +8636,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "futures", "futures-timer", @@ -8683,7 +8659,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8699,7 +8675,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8716,7 +8692,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8727,7 +8703,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "array-bytes", "chrono", @@ -8767,7 +8743,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "fnv", "futures", @@ -8795,7 +8771,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "hash-db", "kvdb", @@ -8820,7 +8796,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "async-trait", "futures", @@ -8844,7 +8820,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "async-trait", "fork-tree", @@ -8886,7 +8862,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "futures", "jsonrpsee", @@ -8908,7 +8884,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8921,7 +8897,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "async-trait", "futures", @@ -8945,7 +8921,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "lazy_static", "lru 0.7.8", @@ -8972,7 +8948,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "environmental", "parity-scale-codec", @@ -8988,7 +8964,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "log", "parity-scale-codec", @@ -9003,7 +8979,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "cfg-if 1.0.0", "libc", @@ -9023,7 +8999,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "ahash", "array-bytes", @@ -9064,7 +9040,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "finality-grandpa", "futures", @@ -9085,7 +9061,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "ansi_term", "futures", @@ -9102,7 +9078,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "array-bytes", "async-trait", @@ -9117,7 +9093,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "array-bytes", "async-trait", @@ -9164,7 +9140,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "cid", "futures", @@ -9184,7 +9160,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "async-trait", "bitflags", @@ -9210,7 +9186,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "ahash", "futures", @@ -9228,7 +9204,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "array-bytes", "futures", @@ -9249,7 +9225,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "array-bytes", "fork-tree", @@ -9277,7 +9253,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "array-bytes", "futures", @@ -9296,7 +9272,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "array-bytes", "bytes", @@ -9326,7 +9302,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "futures", "libp2p", @@ -9339,7 +9315,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9348,7 +9324,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "futures", "hash-db", @@ -9378,7 +9354,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "futures", "jsonrpsee", @@ -9401,7 +9377,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "futures", "jsonrpsee", @@ -9414,7 +9390,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "async-trait", "directories", @@ -9484,7 +9460,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "log", "parity-scale-codec", @@ -9498,7 +9474,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -9517,7 +9493,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "futures", "libc", @@ -9536,7 +9512,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "chrono", "futures", @@ -9554,7 +9530,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "ansi_term", "atty", @@ -9585,7 +9561,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9596,7 +9572,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "futures", "futures-timer", @@ -9622,7 +9598,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "futures", "log", @@ -9635,7 +9611,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "futures", "futures-timer", @@ -10121,7 +10097,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "hash-db", "log", @@ -10139,7 +10115,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "blake2", "proc-macro-crate", @@ -10151,7 +10127,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "parity-scale-codec", "scale-info", @@ -10164,7 +10140,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "integer-sqrt", "num-traits", @@ -10179,7 +10155,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "parity-scale-codec", "scale-info", @@ -10192,7 +10168,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "async-trait", "parity-scale-codec", @@ -10204,7 +10180,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "parity-scale-codec", "sp-api", @@ -10216,7 +10192,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "futures", "log", @@ -10234,7 +10210,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "async-trait", "futures", @@ -10253,7 +10229,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "async-trait", "merlin", @@ -10276,7 +10252,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "parity-scale-codec", "scale-info", @@ -10290,7 +10266,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "parity-scale-codec", "scale-info", @@ -10303,7 +10279,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "array-bytes", "base58", @@ -10349,7 +10325,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "blake2", "byteorder", @@ -10363,7 +10339,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "proc-macro2", "quote", @@ -10374,7 +10350,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -10383,7 +10359,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "proc-macro2", "quote", @@ -10393,7 +10369,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "environmental", "parity-scale-codec", @@ -10404,7 +10380,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "finality-grandpa", "log", @@ -10422,7 +10398,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10436,7 +10412,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "bytes", "futures", @@ -10462,7 +10438,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "lazy_static", "sp-core", @@ -10473,7 +10449,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "async-trait", "futures", @@ -10490,7 +10466,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "thiserror", "zstd", @@ -10499,7 +10475,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "log", "parity-scale-codec", @@ -10515,7 +10491,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "parity-scale-codec", "scale-info", @@ -10529,7 +10505,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "sp-api", "sp-core", @@ -10539,7 +10515,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "backtrace", "lazy_static", @@ -10549,7 +10525,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "rustc-hash", "serde", @@ -10559,7 +10535,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "either", "hash256-std-hasher", @@ -10582,7 +10558,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -10600,7 +10576,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "Inflector", "proc-macro-crate", @@ -10612,7 +10588,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "log", "parity-scale-codec", @@ -10626,7 +10602,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "parity-scale-codec", "scale-info", @@ -10640,7 +10616,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "parity-scale-codec", "scale-info", @@ -10651,7 +10627,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "hash-db", "log", @@ -10673,12 +10649,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10691,7 +10667,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "log", "sp-core", @@ -10704,7 +10680,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "async-trait", "futures-timer", @@ -10720,7 +10696,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "parity-scale-codec", "sp-std", @@ -10732,7 +10708,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "sp-api", "sp-runtime", @@ -10741,7 +10717,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "async-trait", "log", @@ -10757,7 +10733,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "ahash", "hash-db", @@ -10780,7 +10756,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10797,7 +10773,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10808,7 +10784,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "impl-trait-for-tuples", "log", @@ -10821,7 +10797,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -11036,7 +11012,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "platforms", ] @@ -11044,7 +11020,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -11065,7 +11041,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "futures-util", "hyper", @@ -11078,7 +11054,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "jsonrpsee", "log", @@ -11099,7 +11075,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "array-bytes", "async-trait", @@ -11125,7 +11101,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "futures", "substrate-test-utils-derive", @@ -11135,7 +11111,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11146,7 +11122,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "ansi_term", "build-helper", @@ -11456,9 +11432,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-ctl" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb833c46ecbf8b6daeccb347cefcabf9c1beb5c9b0f853e1cec45632d9963e69" +checksum = "e37706572f4b151dff7a0146e040804e9c26fe3a3118591112f05cf12a4216c1" dependencies = [ "libc", "paste", @@ -11467,9 +11443,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-sys" -version = "0.4.2+5.2.1-patched.2" +version = "0.5.2+5.3.0-patched" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5844e429d797c62945a566f8da4e24c7fe3fbd5d6617fd8bf7a0b7dc1ee0f22e" +checksum = "ec45c14da997d0925c7835883e4d5c181f196fa142f8c19d7643d1e9af2592c3" dependencies = [ "cc", "fs_extra", @@ -11478,9 +11454,9 @@ dependencies = [ [[package]] name = "tikv-jemallocator" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c14a5a604eb8715bc5785018a37d00739b180bcf609916ddf4393d33d49ccdf" +checksum = "20612db8a13a6c06d57ec83953694185a367e16945f66565e8028d2c0bd76979" dependencies = [ "libc", "tikv-jemalloc-sys", @@ -11859,7 +11835,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#eefba93cf62ff80e1011dbe1cd3a543b711f7bb9" +source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" dependencies = [ "clap", "frame-try-runtime", diff --git a/Cargo.toml b/Cargo.toml index c7edd0621319..0ed0892593d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ readme = "README.md" [dependencies] polkadot-cli = { path = "cli", features = [ "kusama-native", "westend-native", "rococo-native" ] } color-eyre = { version = "0.6.1", default-features = false } -parity-util-mem = { version = "0.11.0", default-features = false, features = ["jemalloc-global"] } +parity-util-mem = { version = "0.12.0", default-features = false, features = ["jemalloc-global"] } [dev-dependencies] assert_cmd = "2.0.4" diff --git a/core-primitives/Cargo.toml b/core-primitives/Cargo.toml index 9bbe8f516afb..a10b80b0c30f 100644 --- a/core-primitives/Cargo.toml +++ b/core-primitives/Cargo.toml @@ -10,7 +10,7 @@ sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", d sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } parity-scale-codec = { version = "3.1.5", default-features = false, features = [ "derive" ] } -parity-util-mem = { version = "0.11.0", default-features = false, optional = true } +parity-util-mem = { version = "0.12.0", default-features = false, optional = true } [features] default = [ "std" ] diff --git a/node/core/approval-voting/Cargo.toml b/node/core/approval-voting/Cargo.toml index e39a589b5675..25fb51eb712b 100644 --- a/node/core/approval-voting/Cargo.toml +++ b/node/core/approval-voting/Cargo.toml @@ -13,7 +13,7 @@ bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } lru = "0.8" merlin = "2.0" schnorrkel = "0.9.1" -kvdb = "0.11.0" +kvdb = "0.12.0" derive_more = "0.99.17" thiserror = "1.0.31" @@ -40,5 +40,5 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } assert_matches = "1.4.0" -kvdb-memorydb = "0.11.0" +kvdb-memorydb = "0.12.0" test-helpers = { package = "polkadot-primitives-test-helpers", path = "../../../primitives/test-helpers" } diff --git a/node/core/av-store/Cargo.toml b/node/core/av-store/Cargo.toml index 9cea9f1bdc24..4cec2cb637b9 100644 --- a/node/core/av-store/Cargo.toml +++ b/node/core/av-store/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] futures = "0.3.21" futures-timer = "3.0.2" -kvdb = "0.11.0" +kvdb = "0.12.0" thiserror = "1.0.31" gum = { package = "tracing-gum", path = "../../gum" } bitvec = "1.0.0" @@ -24,7 +24,7 @@ polkadot-node-primitives = { path = "../../primitives" } log = "0.4.17" env_logger = "0.9.0" assert_matches = "1.4.0" -kvdb-memorydb = "0.11.0" +kvdb-memorydb = "0.12.0" sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } diff --git a/node/core/av-store/src/lib.rs b/node/core/av-store/src/lib.rs index cd1685e32ea8..4fbbf3740ab0 100644 --- a/node/core/av-store/src/lib.rs +++ b/node/core/av-store/src/lib.rs @@ -792,8 +792,9 @@ fn note_block_included( macro_rules! peek_num { ($iter:ident) => { match $iter.peek() { - Some((k, _)) => decode_unfinalized_key(&k[..]).ok().map(|(b, _, _)| b), - None => None, + Some(Ok((k, _))) => Ok(decode_unfinalized_key(&k[..]).ok().map(|(b, _, _)| b)), + Some(Err(_)) => Err($iter.next().expect("peek returned Some(Err); qed").unwrap_err()), + None => Ok(None), } }; } @@ -819,10 +820,10 @@ async fn process_block_finalized( let mut iter = subsystem .db .iter_with_prefix(subsystem.config.col_meta, &start_prefix) - .take_while(|(k, _)| &k[..] < &end_prefix[..]) + .take_while(|r| r.as_ref().map_or(true, |(k, _v)| &k[..] < &end_prefix[..])) .peekable(); - match peek_num!(iter) { + match peek_num!(iter)? { None => break, // end of iterator. Some(n) => n, } @@ -867,10 +868,10 @@ async fn process_block_finalized( let iter = subsystem .db .iter_with_prefix(subsystem.config.col_meta, &start_prefix) - .take_while(|(k, _)| &k[..] < &end_prefix[..]) + .take_while(|r| r.as_ref().map_or(true, |(k, _v)| &k[..] < &end_prefix[..])) .peekable(); - let batch = load_all_at_finalized_height(iter, batch_num, batch_finalized_hash); + let batch = load_all_at_finalized_height(iter, batch_num, batch_finalized_hash)?; // Now that we've iterated over the entire batch at this finalized height, // update the meta. @@ -890,22 +891,22 @@ async fn process_block_finalized( // loads all candidates at the finalized height and maps them to `true` if finalized // and `false` if unfinalized. fn load_all_at_finalized_height( - mut iter: std::iter::Peekable, Box<[u8]>)>>, + mut iter: std::iter::Peekable>>, block_number: BlockNumber, finalized_hash: Hash, -) -> impl IntoIterator { +) -> io::Result> { // maps candidate hashes to true if finalized, false otherwise. let mut candidates = HashMap::new(); // Load all candidates that were included at this height. loop { - match peek_num!(iter) { + match peek_num!(iter)? { None => break, // end of iterator. Some(n) if n != block_number => break, // end of batch. _ => {}, } - let (k, _v) = iter.next().expect("`peek` used to check non-empty; qed"); + let (k, _v) = iter.next().expect("`peek` used to check non-empty; qed")?; let (_, block_hash, candidate_hash) = decode_unfinalized_key(&k[..]).expect("`peek_num` checks validity of key; qed"); @@ -916,7 +917,7 @@ fn load_all_at_finalized_height( } } - candidates + Ok(candidates) } fn update_blocks_at_finalized_height( @@ -1214,9 +1215,10 @@ fn prune_all(db: &Arc, config: &Config, clock: &dyn Clock) -> Resu let mut tx = DBTransaction::new(); let iter = db .iter_with_prefix(config.col_meta, &range_start[..]) - .take_while(|(k, _)| &k[..] < &range_end[..]); + .take_while(|r| r.as_ref().map_or(true, |(k, _v)| &k[..] < &range_end[..])); - for (k, _v) in iter { + for r in iter { + let (k, _v) = r?; tx.delete(config.col_meta, &k[..]); let (_, candidate_hash) = match decode_pruning_key(&k[..]) { diff --git a/node/core/chain-selection/Cargo.toml b/node/core/chain-selection/Cargo.toml index 8d9875b6f389..df6a5c24f10e 100644 --- a/node/core/chain-selection/Cargo.toml +++ b/node/core/chain-selection/Cargo.toml @@ -13,7 +13,7 @@ polkadot-primitives = { path = "../../../primitives" } polkadot-node-primitives = { path = "../../primitives" } polkadot-node-subsystem = { path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } -kvdb = "0.11.0" +kvdb = "0.12.0" thiserror = "1.0.31" parity-scale-codec = "3.1.5" @@ -22,4 +22,4 @@ polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } parking_lot = "0.12.0" assert_matches = "1" -kvdb-memorydb = "0.11.0" +kvdb-memorydb = "0.12.0" diff --git a/node/core/chain-selection/src/db_backend/v1.rs b/node/core/chain-selection/src/db_backend/v1.rs index db117ff945df..a037d27baaea 100644 --- a/node/core/chain-selection/src/db_backend/v1.rs +++ b/node/core/chain-selection/src/db_backend/v1.rs @@ -235,16 +235,21 @@ impl Backend for DbBackend { self.inner.iter_with_prefix(self.config.col_data, &STAGNANT_AT_PREFIX[..]); let val = stagnant_at_iter - .filter_map(|(k, v)| { - match (decode_stagnant_at_key(&mut &k[..]), >::decode(&mut &v[..]).ok()) { - (Some(at), Some(stagnant_at)) => Some((at, stagnant_at)), - _ => None, - } + .filter_map(|r| match r { + Ok((k, v)) => + match (decode_stagnant_at_key(&mut &k[..]), >::decode(&mut &v[..]).ok()) + { + (Some(at), Some(stagnant_at)) => Some(Ok((at, stagnant_at))), + _ => None, + }, + Err(e) => Some(Err(e)), }) .enumerate() - .take_while(|(idx, (at, _))| *at <= up_to.into() && *idx < max_elements) + .take_while(|(idx, r)| { + r.as_ref().map_or(true, |(at, _)| *at <= up_to.into() && *idx < max_elements) + }) .map(|(_, v)| v) - .collect::>(); + .collect::, _>>()?; Ok(val) } @@ -254,10 +259,13 @@ impl Backend for DbBackend { self.inner.iter_with_prefix(self.config.col_data, &BLOCK_HEIGHT_PREFIX[..]); let val = blocks_at_height_iter - .filter_map(|(k, _)| decode_block_height_key(&k[..])) + .filter_map(|r| match r { + Ok((k, _)) => decode_block_height_key(&k[..]).map(Ok), + Err(e) => Some(Err(e)), + }) .next(); - Ok(val) + val.transpose().map_err(Error::from) } fn load_blocks_by_number(&self, number: BlockNumber) -> Result, Error> { diff --git a/node/core/dispute-coordinator/Cargo.toml b/node/core/dispute-coordinator/Cargo.toml index 7d7bc25e91d4..fd89b599f63c 100644 --- a/node/core/dispute-coordinator/Cargo.toml +++ b/node/core/dispute-coordinator/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" futures = "0.3.21" gum = { package = "tracing-gum", path = "../../gum" } parity-scale-codec = "3.1.5" -kvdb = "0.11.0" +kvdb = "0.12.0" thiserror = "1.0.31" lru = "0.8.0" fatality = "0.0.6" @@ -22,7 +22,7 @@ sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "maste [dev-dependencies] -kvdb-memorydb = "0.11.0" +kvdb-memorydb = "0.12.0" polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/core/runtime-api/Cargo.toml b/node/core/runtime-api/Cargo.toml index 9ef6af06c5c2..b7a9895e0c67 100644 --- a/node/core/runtime-api/Cargo.toml +++ b/node/core/runtime-api/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" futures = "0.3.21" gum = { package = "tracing-gum", path = "../../gum" } memory-lru = "0.1.1" -parity-util-mem = { version = "0.11.0", default-features = false } +parity-util-mem = { version = "0.12.0", default-features = false } sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/malus/Cargo.toml b/node/malus/Cargo.toml index b68adef1a1df..9548857a03ed 100644 --- a/node/malus/Cargo.toml +++ b/node/malus/Cargo.toml @@ -23,7 +23,7 @@ polkadot-node-core-backing = { path = "../core/backing" } polkadot-node-primitives = { path = "../primitives" } polkadot-primitives = { path = "../../primitives" } polkadot-node-core-pvf = { path = "../core/pvf" } -parity-util-mem = { version = "0.11.0", default-features = false, features = ["jemalloc-global"] } +parity-util-mem = { version = "0.12.0", default-features = false, features = ["jemalloc-global"] } color-eyre = { version = "0.6.1", default-features = false } assert_matches = "1.5" async-trait = "0.1.57" diff --git a/node/overseer/Cargo.toml b/node/overseer/Cargo.toml index 4bc360df47e3..8ee3fc6fb3cd 100644 --- a/node/overseer/Cargo.toml +++ b/node/overseer/Cargo.toml @@ -18,7 +18,7 @@ polkadot-primitives = { path = "../../primitives" } orchestra = "0.0.2" gum = { package = "tracing-gum", path = "../gum" } lru = "0.8" -parity-util-mem = { version = "0.11.0", default-features = false } +parity-util-mem = { version = "0.12.0", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } async-trait = "0.1.57" diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 1d2613537814..63a5f189a32a 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -69,8 +69,8 @@ gum = { package = "tracing-gum", path = "../gum/" } serde = { version = "1.0.137", features = ["derive"] } serde_json = "1.0.81" thiserror = "1.0.31" -kvdb = "0.11.0" -kvdb-rocksdb = { version = "0.15.2", optional = true } +kvdb = "0.12.0" +kvdb-rocksdb = { version = "0.16.0", optional = true } parity-db = { version = "0.3.16", optional = true } async-trait = "0.1.57" lru = "0.8" diff --git a/node/service/src/parachains_db/upgrade.rs b/node/service/src/parachains_db/upgrade.rs index ad995f41ed82..73321ae04c09 100644 --- a/node/service/src/parachains_db/upgrade.rs +++ b/node/service/src/parachains_db/upgrade.rs @@ -121,7 +121,7 @@ fn rocksdb_migrate_from_version_0_to_1(path: &Path) -> Result<(), Error> { .to_str() .ok_or_else(|| super::other_io_error("Invalid database path".into()))?; let db_cfg = DatabaseConfig::with_columns(super::columns::v0::NUM_COLUMNS); - let db = Database::open(&db_cfg, db_path)?; + let mut db = Database::open(&db_cfg, db_path)?; db.add_column()?; db.add_column()?; diff --git a/node/subsystem-util/Cargo.toml b/node/subsystem-util/Cargo.toml index 6f120beec7cb..26eca7aa8f1f 100644 --- a/node/subsystem-util/Cargo.toml +++ b/node/subsystem-util/Cargo.toml @@ -32,8 +32,8 @@ 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" } -kvdb = "0.11.0" -parity-util-mem = { version = "0.11", default-features = false } +kvdb = "0.12.0" +parity-util-mem = { version = "0.12.0", default-features = false } parity-db = { version = "0.3.13" } [dev-dependencies] @@ -44,5 +44,5 @@ log = "0.4.17" polkadot-node-subsystem-test-helpers = { path = "../subsystem-test-helpers" } lazy_static = "1.4.0" polkadot-primitives-test-helpers = { path = "../../primitives/test-helpers" } -kvdb-shared-tests = "0.9.0" +kvdb-shared-tests = "0.10.0" tempfile = "3.1.0" diff --git a/node/subsystem-util/src/database.rs b/node/subsystem-util/src/database.rs index a6b31043302f..6f338b5d6440 100644 --- a/node/subsystem-util/src/database.rs +++ b/node/subsystem-util/src/database.rs @@ -16,7 +16,7 @@ //! Database trait for polkadot db. -pub use kvdb::{DBTransaction, DBValue, KeyValueDB}; +pub use kvdb::{DBKeyValue, DBTransaction, DBValue, KeyValueDB}; /// Database trait with ordered key capacity. pub trait Database: KeyValueDB { @@ -27,7 +27,7 @@ pub trait Database: KeyValueDB { /// Implementation for database supporting `KeyValueDB` already. pub mod kvdb_impl { - use super::{DBTransaction, DBValue, Database, KeyValueDB}; + use super::{DBKeyValue, DBTransaction, DBValue, Database, KeyValueDB}; use kvdb::{DBOp, IoStats, IoStatsKind}; use parity_util_mem::{MallocSizeOf, MallocSizeOfOps}; use std::{collections::BTreeSet, io::Result}; @@ -86,7 +86,7 @@ pub mod kvdb_impl { self.db.get(col, key) } - fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Option> { + fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Result> { self.ensure_is_indexed(col); self.db.get_by_prefix(col, prefix) } @@ -96,7 +96,7 @@ pub mod kvdb_impl { self.db.write(transaction) } - fn iter<'a>(&'a self, col: u32) -> Box, Box<[u8]>)> + 'a> { + fn iter<'a>(&'a self, col: u32) -> Box> + 'a> { self.ensure_is_indexed(col); self.db.iter(col) } @@ -105,15 +105,11 @@ pub mod kvdb_impl { &'a self, col: u32, prefix: &'a [u8], - ) -> Box, Box<[u8]>)> + 'a> { + ) -> Box> + 'a> { self.ensure_is_indexed(col); self.db.iter_with_prefix(col, prefix) } - fn restore(&self, _new_db: &str) -> Result<()> { - unimplemented!("restore is unsupported") - } - fn io_stats(&self, kind: IoStatsKind) -> IoStats { self.db.io_stats(kind) } @@ -122,7 +118,7 @@ pub mod kvdb_impl { self.db.has_key(col, key) } - fn has_prefix(&self, col: u32, prefix: &[u8]) -> bool { + fn has_prefix(&self, col: u32, prefix: &[u8]) -> Result { self.ensure_is_indexed(col); self.db.has_prefix(col, prefix) } @@ -138,8 +134,8 @@ pub mod kvdb_impl { /// Utilities for using parity-db database. pub mod paritydb_impl { - use super::{DBTransaction, DBValue, Database, KeyValueDB}; - use kvdb::{DBOp, IoStats, IoStatsKind}; + use super::{DBKeyValue, DBTransaction, DBValue, Database, KeyValueDB}; + use kvdb::DBOp; use parity_db::Db; use parking_lot::Mutex; use std::{collections::BTreeSet, io::Result, sync::Arc}; @@ -179,18 +175,20 @@ pub mod paritydb_impl { map_err(self.db.get(col as u8, key)) } - fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Option> { - self.iter_with_prefix(col, prefix).next().map(|(_, v)| v) + fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Result> { + self.iter_with_prefix(col, prefix) + .next() + .transpose() + .map(|mb| mb.map(|(_, v)| v)) } - fn iter<'a>(&'a self, col: u32) -> Box, Box<[u8]>)> + 'a> { - let mut iter = handle_err(self.db.iter(col as u8)); + fn iter<'a>(&'a self, col: u32) -> Box> + 'a> { + let mut iter = match self.db.iter(col as u8) { + Ok(iter) => iter, + Err(e) => return Box::new(std::iter::once(map_err(Err(e)))), + }; Box::new(std::iter::from_fn(move || { - if let Some((key, value)) = handle_err(iter.next()) { - Some((key.into_boxed_slice(), value.into_boxed_slice())) - } else { - None - } + iter.next().transpose().map(|r| map_err(r.map(|(k, v)| (k.into(), v)))) })) } @@ -198,39 +196,26 @@ pub mod paritydb_impl { &'a self, col: u32, prefix: &'a [u8], - ) -> Box, Box<[u8]>)> + 'a> { + ) -> Box> + 'a> { if prefix.len() == 0 { return self.iter(col) } - let mut iter = handle_err(self.db.iter(col as u8)); - handle_err(iter.seek(prefix)); + let mut iter = match self.db.iter(col as u8) { + Ok(iter) => iter, + Err(e) => return Box::new(std::iter::once(map_err(Err(e)))), + }; + if let Err(e) = iter.seek(prefix) { + return Box::new(std::iter::once(map_err(Err(e)))) + } Box::new(std::iter::from_fn(move || { - if let Some((key, value)) = handle_err(iter.next()) { - key.starts_with(prefix) - .then(|| (key.into_boxed_slice(), value.into_boxed_slice())) - } else { - None - } + iter.next().transpose().and_then(|r| { + map_err(r.map(|(k, v)| k.starts_with(prefix).then(|| (k.into(), v)))) + .transpose() + }) })) } - fn restore(&self, _new_db: &str) -> Result<()> { - unimplemented!("restore is unsupported") - } - - fn io_stats(&self, _kind: IoStatsKind) -> IoStats { - unimplemented!("io_stats not supported by parity_db"); - } - - fn has_key(&self, col: u32, key: &[u8]) -> Result { - map_err(self.db.get_size(col as u8, key).map(|r| r.is_some())) - } - - fn has_prefix(&self, col: u32, prefix: &[u8]) -> bool { - self.get_by_prefix(col, prefix).is_some() - } - - fn write(&self, transaction: DBTransaction) -> std::io::Result<()> { + fn write(&self, transaction: DBTransaction) -> Result<()> { let mut ops = transaction.ops.into_iter(); // TODO using a key iterator or native delete here would be faster. let mut current_prefix_iter: Option<(parity_db::BTreeIterator, u8, Vec)> = None; diff --git a/parachain/Cargo.toml b/parachain/Cargo.toml index 42ffbfab1fa6..c07ec98d7cb9 100644 --- a/parachain/Cargo.toml +++ b/parachain/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" # this crate for WASM. This is critical to avoid forcing all parachain WASM into implementing # various unnecessary Substrate-specific endpoints. parity-scale-codec = { version = "3.1.5", default-features = false, features = [ "derive" ] } -parity-util-mem = { version = "0.11.0", default-features = false, optional = true } +parity-util-mem = { version = "0.12.0", default-features = false, optional = true } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index d018cfdf9e54..67fc2d31cee8 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -27,7 +27,7 @@ trie = { package = "sp-trie", git = "https://github.com/paritytech/substrate", b bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } hex-literal = "0.3.4" -parity-util-mem = { version = "0.11.0", default-features = false, optional = true } +parity-util-mem = { version = "0.12.0", default-features = false, optional = true } [features] default = ["std"] From 4a6cf48b8f478560e07d09cb32e03ee6a4a982d7 Mon Sep 17 00:00:00 2001 From: Branislav Kontur Date: Thu, 6 Oct 2022 10:03:34 +0200 Subject: [PATCH 30/49] Skip `unexpected metric type` * Dump more info for `unexpected metric type` * Skip `unexpected metric type` --- node/metrics/src/tests.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/node/metrics/src/tests.rs b/node/metrics/src/tests.rs index 56e07d96280d..932cc7b68be7 100644 --- a/node/metrics/src/tests.rs +++ b/node/metrics/src/tests.rs @@ -92,16 +92,11 @@ async fn scrape_prometheus_metrics(metrics_uri: &str) -> HashMap { .expect("Scraper failed to parse Prometheus metrics") .samples .into_iter() - .map(|sample| { - ( - sample.metric.to_owned(), - match sample.value { - prometheus_parse::Value::Counter(value) => value as u64, - prometheus_parse::Value::Gauge(value) => value as u64, - prometheus_parse::Value::Untyped(value) => value as u64, - _ => unreachable!("unexpected metric type"), - }, - ) + .filter_map(|prometheus_parse::Sample { metric, value, .. }| match value { + prometheus_parse::Value::Counter(value) => Some((metric, value as u64)), + prometheus_parse::Value::Gauge(value) => Some((metric, value as u64)), + prometheus_parse::Value::Untyped(value) => Some((metric, value as u64)), + _ => None, }) .collect() } From 78b82943d68ceb924496a1fbe9e7e97644fc43f8 Mon Sep 17 00:00:00 2001 From: Adrian Catangiu Date: Thu, 6 Oct 2022 12:58:39 +0300 Subject: [PATCH 31/49] service: use MmrRootProvider as custom BEEFY payload provider (companion for 12428) (#6112) * service: use MmrRootProvider as custom BEEFY payload provider * update lockfile for {"substrate"} Co-authored-by: parity-processbot <> --- Cargo.lock | 357 ++++++++++++++++++++-------------------- node/service/src/lib.rs | 4 +- 2 files changed, 182 insertions(+), 179 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ddd603dabb44..3b12207a7624 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -435,7 +435,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "array-bytes", "async-trait", @@ -472,7 +472,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -492,7 +492,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "beefy-primitives", "sp-api", @@ -502,13 +502,14 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", "sp-application-crypto", "sp-core", + "sp-mmr-primitives", "sp-runtime", "sp-std", ] @@ -1999,7 +2000,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "parity-scale-codec", ] @@ -2017,7 +2018,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-support", "frame-system", @@ -2040,7 +2041,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "Inflector", "array-bytes", @@ -2091,7 +2092,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2102,7 +2103,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2118,7 +2119,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-support", "frame-system", @@ -2147,7 +2148,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "bitflags", "frame-metadata", @@ -2179,7 +2180,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "Inflector", "cfg-expr", @@ -2193,7 +2194,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2205,7 +2206,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "proc-macro2", "quote", @@ -2215,7 +2216,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2238,7 +2239,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-support", "frame-system", @@ -2249,7 +2250,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-support", "log", @@ -2267,7 +2268,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -2282,7 +2283,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "parity-scale-codec", "sp-api", @@ -2291,7 +2292,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-support", "parity-scale-codec", @@ -2462,7 +2463,7 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "chrono", "frame-election-provider-support", @@ -4811,7 +4812,7 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -4825,7 +4826,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-support", "frame-system", @@ -4841,7 +4842,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-support", "frame-system", @@ -4856,7 +4857,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -4880,7 +4881,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4900,7 +4901,7 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4919,7 +4920,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -4934,7 +4935,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "beefy-primitives", "frame-support", @@ -4950,7 +4951,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "array-bytes", "beefy-merkle-tree", @@ -4973,7 +4974,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -4991,7 +4992,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5010,7 +5011,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5027,7 +5028,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5044,7 +5045,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5062,7 +5063,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5086,7 +5087,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5099,7 +5100,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5117,7 +5118,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5138,7 +5139,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5153,7 +5154,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5176,7 +5177,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5192,7 +5193,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5212,7 +5213,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5229,7 +5230,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5246,7 +5247,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5264,7 +5265,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -5279,7 +5280,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5295,7 +5296,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-support", "frame-system", @@ -5312,7 +5313,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5332,7 +5333,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "parity-scale-codec", "sp-api", @@ -5342,7 +5343,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-support", "frame-system", @@ -5359,7 +5360,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5382,7 +5383,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5399,7 +5400,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5414,7 +5415,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5432,7 +5433,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5447,7 +5448,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5465,7 +5466,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5481,7 +5482,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-support", "frame-system", @@ -5502,7 +5503,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5518,7 +5519,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-support", "frame-system", @@ -5532,7 +5533,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5555,7 +5556,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5566,7 +5567,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "log", "sp-arithmetic", @@ -5575,7 +5576,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-support", "frame-system", @@ -5589,7 +5590,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5607,7 +5608,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5626,7 +5627,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-support", "frame-system", @@ -5642,7 +5643,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5657,7 +5658,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5668,7 +5669,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5685,7 +5686,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5701,7 +5702,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5716,7 +5717,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8250,7 +8251,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "env_logger 0.9.0", "jsonrpsee", @@ -8598,7 +8599,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "log", "sp-core", @@ -8609,7 +8610,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "async-trait", "futures", @@ -8636,7 +8637,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "futures", "futures-timer", @@ -8659,7 +8660,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8675,7 +8676,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8692,7 +8693,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8703,7 +8704,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "array-bytes", "chrono", @@ -8743,7 +8744,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "fnv", "futures", @@ -8771,7 +8772,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "hash-db", "kvdb", @@ -8796,7 +8797,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "async-trait", "futures", @@ -8820,7 +8821,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "async-trait", "fork-tree", @@ -8862,7 +8863,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "futures", "jsonrpsee", @@ -8884,7 +8885,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8897,7 +8898,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "async-trait", "futures", @@ -8921,7 +8922,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "lazy_static", "lru 0.7.8", @@ -8948,7 +8949,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "environmental", "parity-scale-codec", @@ -8964,7 +8965,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "log", "parity-scale-codec", @@ -8979,7 +8980,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "cfg-if 1.0.0", "libc", @@ -8999,7 +9000,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "ahash", "array-bytes", @@ -9040,7 +9041,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "finality-grandpa", "futures", @@ -9061,7 +9062,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "ansi_term", "futures", @@ -9078,7 +9079,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "array-bytes", "async-trait", @@ -9093,7 +9094,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "array-bytes", "async-trait", @@ -9140,7 +9141,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "cid", "futures", @@ -9160,7 +9161,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "async-trait", "bitflags", @@ -9186,7 +9187,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "ahash", "futures", @@ -9204,7 +9205,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "array-bytes", "futures", @@ -9225,7 +9226,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "array-bytes", "fork-tree", @@ -9253,7 +9254,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "array-bytes", "futures", @@ -9272,7 +9273,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "array-bytes", "bytes", @@ -9302,7 +9303,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "futures", "libp2p", @@ -9315,7 +9316,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9324,7 +9325,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "futures", "hash-db", @@ -9354,7 +9355,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "futures", "jsonrpsee", @@ -9377,7 +9378,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "futures", "jsonrpsee", @@ -9390,7 +9391,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "async-trait", "directories", @@ -9460,7 +9461,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "log", "parity-scale-codec", @@ -9474,7 +9475,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -9493,7 +9494,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "futures", "libc", @@ -9512,7 +9513,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "chrono", "futures", @@ -9530,7 +9531,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "ansi_term", "atty", @@ -9561,7 +9562,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9572,7 +9573,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "futures", "futures-timer", @@ -9598,7 +9599,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "futures", "log", @@ -9611,7 +9612,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "futures", "futures-timer", @@ -10097,7 +10098,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "hash-db", "log", @@ -10115,7 +10116,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "blake2", "proc-macro-crate", @@ -10127,7 +10128,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10140,7 +10141,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "integer-sqrt", "num-traits", @@ -10155,7 +10156,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10168,7 +10169,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "async-trait", "parity-scale-codec", @@ -10180,7 +10181,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "parity-scale-codec", "sp-api", @@ -10192,7 +10193,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "futures", "log", @@ -10210,7 +10211,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "async-trait", "futures", @@ -10229,7 +10230,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "async-trait", "merlin", @@ -10252,7 +10253,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10266,7 +10267,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10279,7 +10280,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "array-bytes", "base58", @@ -10325,7 +10326,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "blake2", "byteorder", @@ -10339,7 +10340,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "proc-macro2", "quote", @@ -10350,7 +10351,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -10359,7 +10360,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "proc-macro2", "quote", @@ -10369,7 +10370,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "environmental", "parity-scale-codec", @@ -10380,7 +10381,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "finality-grandpa", "log", @@ -10398,7 +10399,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10412,7 +10413,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "bytes", "futures", @@ -10438,7 +10439,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "lazy_static", "sp-core", @@ -10449,7 +10450,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "async-trait", "futures", @@ -10466,7 +10467,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "thiserror", "zstd", @@ -10475,7 +10476,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "log", "parity-scale-codec", @@ -10491,7 +10492,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10505,7 +10506,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "sp-api", "sp-core", @@ -10515,7 +10516,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "backtrace", "lazy_static", @@ -10525,7 +10526,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "rustc-hash", "serde", @@ -10535,7 +10536,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "either", "hash256-std-hasher", @@ -10558,7 +10559,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -10576,7 +10577,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "Inflector", "proc-macro-crate", @@ -10588,7 +10589,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "log", "parity-scale-codec", @@ -10602,7 +10603,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10616,7 +10617,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10627,7 +10628,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "hash-db", "log", @@ -10649,12 +10650,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10667,7 +10668,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "log", "sp-core", @@ -10680,7 +10681,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "async-trait", "futures-timer", @@ -10696,7 +10697,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "parity-scale-codec", "sp-std", @@ -10708,7 +10709,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "sp-api", "sp-runtime", @@ -10717,7 +10718,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "async-trait", "log", @@ -10733,7 +10734,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "ahash", "hash-db", @@ -10756,7 +10757,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10773,7 +10774,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10784,7 +10785,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "impl-trait-for-tuples", "log", @@ -10797,7 +10798,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -11012,7 +11013,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "platforms", ] @@ -11020,7 +11021,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -11041,7 +11042,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "futures-util", "hyper", @@ -11054,7 +11055,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "jsonrpsee", "log", @@ -11075,7 +11076,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "array-bytes", "async-trait", @@ -11101,7 +11102,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "futures", "substrate-test-utils-derive", @@ -11111,7 +11112,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11122,7 +11123,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "ansi_term", "build-helper", @@ -11835,7 +11836,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#fc67cbb66d8c484bc7b7506fc1300344d12ecbad" +source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" dependencies = [ "clap", "frame-try-runtime", diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index 6425ee7a7536..3619d05c7592 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -1192,9 +1192,11 @@ where justifications_protocol_name, _phantom: core::marker::PhantomData::, }; + let payload_provider = beefy_primitives::mmr::MmrRootProvider::new(client.clone()); let beefy_params = beefy_gadget::BeefyParams { client: client.clone(), backend: backend.clone(), + payload_provider, runtime: client.clone(), key_store: keystore_opt.clone(), network_params, @@ -1204,7 +1206,7 @@ where on_demand_justifications_handler: beefy_on_demand_justifications_handler, }; - let gadget = beefy_gadget::start_beefy_gadget::<_, _, _, _, _>(beefy_params); + let gadget = beefy_gadget::start_beefy_gadget::<_, _, _, _, _, _>(beefy_params); // Wococo's purpose is to be a testbed for BEEFY, so if it fails we'll // bring the node down with it to make sure it is noticed. From 82f7ad5709889d927436cbc67db74e469ff7079c Mon Sep 17 00:00:00 2001 From: Sergej Sakac <73715684+Szegoo@users.noreply.github.com> Date: Thu, 6 Oct 2022 19:20:58 +0200 Subject: [PATCH 32/49] Maximum value for `MultiplierUpdate` (#6021) * update multiplier * fix * update lockfile for {"substrate"} * fmt * fix typo Co-authored-by: parity-processbot <> --- Cargo.lock | 356 +++++++++++++++++++------------------- runtime/common/src/lib.rs | 12 +- 2 files changed, 188 insertions(+), 180 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3b12207a7624..687ab40daf11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -435,7 +435,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "array-bytes", "async-trait", @@ -472,7 +472,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -492,7 +492,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "beefy-primitives", "sp-api", @@ -502,7 +502,7 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "parity-scale-codec", "scale-info", @@ -2000,7 +2000,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "parity-scale-codec", ] @@ -2018,7 +2018,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-support", "frame-system", @@ -2041,7 +2041,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "Inflector", "array-bytes", @@ -2092,7 +2092,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2103,7 +2103,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2119,7 +2119,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-support", "frame-system", @@ -2148,7 +2148,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "bitflags", "frame-metadata", @@ -2180,7 +2180,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "Inflector", "cfg-expr", @@ -2194,7 +2194,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2206,7 +2206,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "proc-macro2", "quote", @@ -2216,7 +2216,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2239,7 +2239,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-support", "frame-system", @@ -2250,7 +2250,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-support", "log", @@ -2268,7 +2268,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -2283,7 +2283,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "parity-scale-codec", "sp-api", @@ -2292,7 +2292,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-support", "parity-scale-codec", @@ -2463,7 +2463,7 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "chrono", "frame-election-provider-support", @@ -4812,7 +4812,7 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -4826,7 +4826,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-support", "frame-system", @@ -4842,7 +4842,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-support", "frame-system", @@ -4857,7 +4857,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -4881,7 +4881,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4901,7 +4901,7 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4920,7 +4920,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -4935,7 +4935,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "beefy-primitives", "frame-support", @@ -4951,7 +4951,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "array-bytes", "beefy-merkle-tree", @@ -4974,7 +4974,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -4992,7 +4992,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5011,7 +5011,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5028,7 +5028,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5045,7 +5045,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5063,7 +5063,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5087,7 +5087,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5100,7 +5100,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5118,7 +5118,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5139,7 +5139,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5154,7 +5154,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5177,7 +5177,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5193,7 +5193,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5213,7 +5213,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5230,7 +5230,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5247,7 +5247,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5265,7 +5265,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -5280,7 +5280,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5296,7 +5296,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-support", "frame-system", @@ -5313,7 +5313,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5333,7 +5333,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "parity-scale-codec", "sp-api", @@ -5343,7 +5343,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-support", "frame-system", @@ -5360,7 +5360,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5383,7 +5383,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5400,7 +5400,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5415,7 +5415,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5433,7 +5433,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5448,7 +5448,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5466,7 +5466,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5482,7 +5482,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-support", "frame-system", @@ -5503,7 +5503,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5519,7 +5519,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-support", "frame-system", @@ -5533,7 +5533,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5556,7 +5556,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5567,7 +5567,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "log", "sp-arithmetic", @@ -5576,7 +5576,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-support", "frame-system", @@ -5590,7 +5590,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5608,7 +5608,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5627,7 +5627,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-support", "frame-system", @@ -5643,7 +5643,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5658,7 +5658,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5669,7 +5669,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5686,7 +5686,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5702,7 +5702,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -5717,7 +5717,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-benchmarking", "frame-support", @@ -8251,7 +8251,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "env_logger 0.9.0", "jsonrpsee", @@ -8599,7 +8599,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "log", "sp-core", @@ -8610,7 +8610,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "async-trait", "futures", @@ -8637,7 +8637,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "futures", "futures-timer", @@ -8660,7 +8660,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8676,7 +8676,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8693,7 +8693,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8704,7 +8704,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "array-bytes", "chrono", @@ -8744,7 +8744,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "fnv", "futures", @@ -8772,7 +8772,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "hash-db", "kvdb", @@ -8797,7 +8797,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "async-trait", "futures", @@ -8821,7 +8821,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "async-trait", "fork-tree", @@ -8863,7 +8863,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "futures", "jsonrpsee", @@ -8885,7 +8885,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8898,7 +8898,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "async-trait", "futures", @@ -8922,7 +8922,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "lazy_static", "lru 0.7.8", @@ -8949,7 +8949,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "environmental", "parity-scale-codec", @@ -8965,7 +8965,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "log", "parity-scale-codec", @@ -8980,7 +8980,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "cfg-if 1.0.0", "libc", @@ -9000,7 +9000,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "ahash", "array-bytes", @@ -9041,7 +9041,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "finality-grandpa", "futures", @@ -9062,7 +9062,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "ansi_term", "futures", @@ -9079,7 +9079,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "array-bytes", "async-trait", @@ -9094,7 +9094,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "array-bytes", "async-trait", @@ -9141,7 +9141,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "cid", "futures", @@ -9161,7 +9161,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "async-trait", "bitflags", @@ -9187,7 +9187,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "ahash", "futures", @@ -9205,7 +9205,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "array-bytes", "futures", @@ -9226,7 +9226,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "array-bytes", "fork-tree", @@ -9254,7 +9254,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "array-bytes", "futures", @@ -9273,7 +9273,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "array-bytes", "bytes", @@ -9303,7 +9303,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "futures", "libp2p", @@ -9316,7 +9316,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9325,7 +9325,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "futures", "hash-db", @@ -9355,7 +9355,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "futures", "jsonrpsee", @@ -9378,7 +9378,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "futures", "jsonrpsee", @@ -9391,7 +9391,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "async-trait", "directories", @@ -9461,7 +9461,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "log", "parity-scale-codec", @@ -9475,7 +9475,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -9494,7 +9494,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "futures", "libc", @@ -9513,7 +9513,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "chrono", "futures", @@ -9531,7 +9531,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "ansi_term", "atty", @@ -9562,7 +9562,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9573,7 +9573,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "futures", "futures-timer", @@ -9599,7 +9599,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "futures", "log", @@ -9612,7 +9612,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "futures", "futures-timer", @@ -10098,7 +10098,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "hash-db", "log", @@ -10116,7 +10116,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "blake2", "proc-macro-crate", @@ -10128,7 +10128,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "parity-scale-codec", "scale-info", @@ -10141,7 +10141,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "integer-sqrt", "num-traits", @@ -10156,7 +10156,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "parity-scale-codec", "scale-info", @@ -10169,7 +10169,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "async-trait", "parity-scale-codec", @@ -10181,7 +10181,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "parity-scale-codec", "sp-api", @@ -10193,7 +10193,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "futures", "log", @@ -10211,7 +10211,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "async-trait", "futures", @@ -10230,7 +10230,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "async-trait", "merlin", @@ -10253,7 +10253,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "parity-scale-codec", "scale-info", @@ -10267,7 +10267,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "parity-scale-codec", "scale-info", @@ -10280,7 +10280,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "array-bytes", "base58", @@ -10326,7 +10326,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "blake2", "byteorder", @@ -10340,7 +10340,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "proc-macro2", "quote", @@ -10351,7 +10351,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -10360,7 +10360,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "proc-macro2", "quote", @@ -10370,7 +10370,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "environmental", "parity-scale-codec", @@ -10381,7 +10381,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "finality-grandpa", "log", @@ -10399,7 +10399,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10413,7 +10413,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "bytes", "futures", @@ -10439,7 +10439,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "lazy_static", "sp-core", @@ -10450,7 +10450,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "async-trait", "futures", @@ -10467,7 +10467,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "thiserror", "zstd", @@ -10476,7 +10476,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "log", "parity-scale-codec", @@ -10492,7 +10492,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "parity-scale-codec", "scale-info", @@ -10506,7 +10506,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "sp-api", "sp-core", @@ -10516,7 +10516,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "backtrace", "lazy_static", @@ -10526,7 +10526,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "rustc-hash", "serde", @@ -10536,7 +10536,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "either", "hash256-std-hasher", @@ -10559,7 +10559,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -10577,7 +10577,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "Inflector", "proc-macro-crate", @@ -10589,7 +10589,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "log", "parity-scale-codec", @@ -10603,7 +10603,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "parity-scale-codec", "scale-info", @@ -10617,7 +10617,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "parity-scale-codec", "scale-info", @@ -10628,7 +10628,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "hash-db", "log", @@ -10650,12 +10650,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10668,7 +10668,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "log", "sp-core", @@ -10681,7 +10681,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "async-trait", "futures-timer", @@ -10697,7 +10697,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "parity-scale-codec", "sp-std", @@ -10709,7 +10709,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "sp-api", "sp-runtime", @@ -10718,7 +10718,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "async-trait", "log", @@ -10734,7 +10734,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "ahash", "hash-db", @@ -10757,7 +10757,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10774,7 +10774,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10785,7 +10785,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "impl-trait-for-tuples", "log", @@ -10798,7 +10798,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -11013,7 +11013,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "platforms", ] @@ -11021,7 +11021,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -11042,7 +11042,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "futures-util", "hyper", @@ -11055,7 +11055,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "jsonrpsee", "log", @@ -11076,7 +11076,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "array-bytes", "async-trait", @@ -11102,7 +11102,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "futures", "substrate-test-utils-derive", @@ -11112,7 +11112,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11123,7 +11123,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "ansi_term", "build-helper", @@ -11836,7 +11836,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#3cb5a4069974cdfae3f6aad18626e1dde19ce3fb" +source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" dependencies = [ "clap", "frame-try-runtime", diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 936feedde1c3..ac5fc69a28e4 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -52,6 +52,7 @@ pub use pallet_balances::Call as BalancesCall; pub use pallet_staking::StakerStatus; pub use pallet_timestamp::Call as TimestampCall; use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; +pub use sp_runtime::traits::Bounded; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -87,6 +88,8 @@ parameter_types! { /// that combined with `AdjustmentVariable`, we can recover from the minimum. /// See `multiplier_can_grow_from_zero`. pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 10u128); + /// The maximum amount of the multiplier. + pub MaximumMultiplier: Multiplier = Bounded::max_value(); /// Maximum length of block. Up to 5MB. pub BlockLength: limits::BlockLength = limits::BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); @@ -94,8 +97,13 @@ parameter_types! { /// Parameterized slow adjusting fee updated based on /// https://research.web3.foundation/en/latest/polkadot/overview/2-token-economics.html#-2.-slow-adjusting-mechanism -pub type SlowAdjustingFeeUpdate = - TargetedFeeAdjustment; +pub type SlowAdjustingFeeUpdate = TargetedFeeAdjustment< + R, + TargetBlockFullness, + AdjustmentVariable, + MinimumMultiplier, + MaximumMultiplier, +>; /// Implements the weight types for a runtime. /// It expects the passed runtime constants to contain a `weights` module. From 978d87f608793109c70b4fe3ce3db06938592609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 7 Oct 2022 13:40:40 +0200 Subject: [PATCH 33/49] Companion for upgrading pin-project (#6118) * Companion for upgrading pin-project This will remove some warnings with the latest rustc nightly/stable. https://github.com/paritytech/substrate/pull/12426 * update lockfile for {"substrate"} Co-authored-by: parity-processbot <> --- Cargo.lock | 364 ++++++++++++++++++++++++++--------------------------- 1 file changed, 182 insertions(+), 182 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 687ab40daf11..a7f74b124d7a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -435,7 +435,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "array-bytes", "async-trait", @@ -472,7 +472,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -492,7 +492,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "beefy-primitives", "sp-api", @@ -502,7 +502,7 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "parity-scale-codec", "scale-info", @@ -2000,7 +2000,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "parity-scale-codec", ] @@ -2018,7 +2018,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-support", "frame-system", @@ -2041,7 +2041,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "Inflector", "array-bytes", @@ -2092,7 +2092,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2103,7 +2103,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2119,7 +2119,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-support", "frame-system", @@ -2148,7 +2148,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "bitflags", "frame-metadata", @@ -2180,7 +2180,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "Inflector", "cfg-expr", @@ -2194,7 +2194,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2206,7 +2206,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "proc-macro2", "quote", @@ -2216,7 +2216,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2239,7 +2239,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-support", "frame-system", @@ -2250,7 +2250,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-support", "log", @@ -2268,7 +2268,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -2283,7 +2283,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "parity-scale-codec", "sp-api", @@ -2292,7 +2292,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-support", "parity-scale-codec", @@ -2463,7 +2463,7 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "chrono", "frame-election-provider-support", @@ -4812,7 +4812,7 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -4826,7 +4826,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-support", "frame-system", @@ -4842,7 +4842,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-support", "frame-system", @@ -4857,7 +4857,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -4881,7 +4881,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4901,7 +4901,7 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4920,7 +4920,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -4935,7 +4935,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "beefy-primitives", "frame-support", @@ -4951,7 +4951,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "array-bytes", "beefy-merkle-tree", @@ -4974,7 +4974,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -4992,7 +4992,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5011,7 +5011,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5028,7 +5028,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5045,7 +5045,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5063,7 +5063,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5087,7 +5087,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5100,7 +5100,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5118,7 +5118,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5139,7 +5139,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5154,7 +5154,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5177,7 +5177,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5193,7 +5193,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5213,7 +5213,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5230,7 +5230,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5247,7 +5247,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5265,7 +5265,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -5280,7 +5280,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5296,7 +5296,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-support", "frame-system", @@ -5313,7 +5313,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5333,7 +5333,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "parity-scale-codec", "sp-api", @@ -5343,7 +5343,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-support", "frame-system", @@ -5360,7 +5360,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5383,7 +5383,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5400,7 +5400,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5415,7 +5415,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5433,7 +5433,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5448,7 +5448,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5466,7 +5466,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5482,7 +5482,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-support", "frame-system", @@ -5503,7 +5503,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5519,7 +5519,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-support", "frame-system", @@ -5533,7 +5533,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5556,7 +5556,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5567,7 +5567,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "log", "sp-arithmetic", @@ -5576,7 +5576,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-support", "frame-system", @@ -5590,7 +5590,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5608,7 +5608,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5627,7 +5627,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-support", "frame-system", @@ -5643,7 +5643,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5658,7 +5658,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5669,7 +5669,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5686,7 +5686,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5702,7 +5702,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -5717,7 +5717,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-benchmarking", "frame-support", @@ -6017,18 +6017,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", @@ -8251,7 +8251,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "env_logger 0.9.0", "jsonrpsee", @@ -8599,7 +8599,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "log", "sp-core", @@ -8610,7 +8610,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "async-trait", "futures", @@ -8637,7 +8637,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "futures", "futures-timer", @@ -8660,7 +8660,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8676,7 +8676,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8693,7 +8693,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8704,7 +8704,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "array-bytes", "chrono", @@ -8744,7 +8744,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "fnv", "futures", @@ -8772,7 +8772,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "hash-db", "kvdb", @@ -8797,7 +8797,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "async-trait", "futures", @@ -8821,7 +8821,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "async-trait", "fork-tree", @@ -8863,7 +8863,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "futures", "jsonrpsee", @@ -8885,7 +8885,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8898,7 +8898,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "async-trait", "futures", @@ -8922,7 +8922,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "lazy_static", "lru 0.7.8", @@ -8949,7 +8949,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "environmental", "parity-scale-codec", @@ -8965,7 +8965,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "log", "parity-scale-codec", @@ -8980,7 +8980,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "cfg-if 1.0.0", "libc", @@ -9000,7 +9000,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "ahash", "array-bytes", @@ -9041,7 +9041,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "finality-grandpa", "futures", @@ -9062,7 +9062,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "ansi_term", "futures", @@ -9079,7 +9079,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "array-bytes", "async-trait", @@ -9094,7 +9094,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "array-bytes", "async-trait", @@ -9141,7 +9141,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "cid", "futures", @@ -9161,7 +9161,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "async-trait", "bitflags", @@ -9187,7 +9187,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "ahash", "futures", @@ -9205,7 +9205,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "array-bytes", "futures", @@ -9226,7 +9226,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "array-bytes", "fork-tree", @@ -9254,7 +9254,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "array-bytes", "futures", @@ -9273,7 +9273,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "array-bytes", "bytes", @@ -9303,7 +9303,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "futures", "libp2p", @@ -9316,7 +9316,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9325,7 +9325,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "futures", "hash-db", @@ -9355,7 +9355,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "futures", "jsonrpsee", @@ -9378,7 +9378,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "futures", "jsonrpsee", @@ -9391,7 +9391,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "async-trait", "directories", @@ -9461,7 +9461,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "log", "parity-scale-codec", @@ -9475,7 +9475,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -9494,7 +9494,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "futures", "libc", @@ -9513,7 +9513,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "chrono", "futures", @@ -9531,7 +9531,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "ansi_term", "atty", @@ -9562,7 +9562,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9573,7 +9573,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "futures", "futures-timer", @@ -9599,7 +9599,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "futures", "log", @@ -9612,7 +9612,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "futures", "futures-timer", @@ -10098,7 +10098,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "hash-db", "log", @@ -10116,7 +10116,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "blake2", "proc-macro-crate", @@ -10128,7 +10128,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "parity-scale-codec", "scale-info", @@ -10141,7 +10141,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "integer-sqrt", "num-traits", @@ -10156,7 +10156,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "parity-scale-codec", "scale-info", @@ -10169,7 +10169,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "async-trait", "parity-scale-codec", @@ -10181,7 +10181,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "parity-scale-codec", "sp-api", @@ -10193,7 +10193,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "futures", "log", @@ -10211,7 +10211,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "async-trait", "futures", @@ -10230,7 +10230,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "async-trait", "merlin", @@ -10253,7 +10253,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "parity-scale-codec", "scale-info", @@ -10267,7 +10267,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "parity-scale-codec", "scale-info", @@ -10280,7 +10280,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "array-bytes", "base58", @@ -10326,7 +10326,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "blake2", "byteorder", @@ -10340,7 +10340,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "proc-macro2", "quote", @@ -10351,7 +10351,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -10360,7 +10360,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "proc-macro2", "quote", @@ -10370,7 +10370,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "environmental", "parity-scale-codec", @@ -10381,7 +10381,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "finality-grandpa", "log", @@ -10399,7 +10399,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10413,7 +10413,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "bytes", "futures", @@ -10439,7 +10439,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "lazy_static", "sp-core", @@ -10450,7 +10450,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "async-trait", "futures", @@ -10467,7 +10467,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "thiserror", "zstd", @@ -10476,7 +10476,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "log", "parity-scale-codec", @@ -10492,7 +10492,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "parity-scale-codec", "scale-info", @@ -10506,7 +10506,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "sp-api", "sp-core", @@ -10516,7 +10516,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "backtrace", "lazy_static", @@ -10526,7 +10526,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "rustc-hash", "serde", @@ -10536,7 +10536,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "either", "hash256-std-hasher", @@ -10559,7 +10559,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -10577,7 +10577,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "Inflector", "proc-macro-crate", @@ -10589,7 +10589,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "log", "parity-scale-codec", @@ -10603,7 +10603,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "parity-scale-codec", "scale-info", @@ -10617,7 +10617,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "parity-scale-codec", "scale-info", @@ -10628,7 +10628,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "hash-db", "log", @@ -10650,12 +10650,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10668,7 +10668,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "log", "sp-core", @@ -10681,7 +10681,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "async-trait", "futures-timer", @@ -10697,7 +10697,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "parity-scale-codec", "sp-std", @@ -10709,7 +10709,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "sp-api", "sp-runtime", @@ -10718,7 +10718,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "async-trait", "log", @@ -10734,7 +10734,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "ahash", "hash-db", @@ -10757,7 +10757,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10774,7 +10774,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10785,7 +10785,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "impl-trait-for-tuples", "log", @@ -10798,7 +10798,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -11013,7 +11013,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "platforms", ] @@ -11021,7 +11021,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -11042,7 +11042,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "futures-util", "hyper", @@ -11055,7 +11055,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "jsonrpsee", "log", @@ -11076,7 +11076,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "array-bytes", "async-trait", @@ -11102,7 +11102,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "futures", "substrate-test-utils-derive", @@ -11112,7 +11112,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11123,7 +11123,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "ansi_term", "build-helper", @@ -11836,7 +11836,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#a84def97102166643bc3c807ae69892551c47536" +source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" dependencies = [ "clap", "frame-try-runtime", From 0717246a002c5090d1da5e5dc9175653431d72b5 Mon Sep 17 00:00:00 2001 From: Leszek Wiesner Date: Mon, 10 Oct 2022 00:23:54 +0200 Subject: [PATCH 34/49] Companion for 12109 (#5929) * Update following `pallet-vesting` configurable `WithdrawReasons` * Update lib.rs * Update lib.rs * Update lib.rs * update lockfile for {"substrate"} * fix warning Co-authored-by: Shawn Tabrizi Co-authored-by: parity-processbot <> --- Cargo.lock | 357 ++++++++++++++++---------------- runtime/common/src/claims.rs | 5 +- runtime/common/src/purchase.rs | 9 +- runtime/kusama/src/lib.rs | 5 +- runtime/polkadot/src/lib.rs | 5 +- runtime/rococo/src/lib.rs | 5 +- runtime/test-runtime/src/lib.rs | 5 +- runtime/westend/src/lib.rs | 5 +- 8 files changed, 210 insertions(+), 186 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a7f74b124d7a..33b4d44fefb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -435,7 +435,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "async-trait", @@ -472,7 +472,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -492,7 +492,7 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "beefy-primitives", "sp-api", @@ -502,13 +502,14 @@ dependencies = [ [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", "sp-application-crypto", "sp-core", + "sp-io", "sp-mmr-primitives", "sp-runtime", "sp-std", @@ -2000,7 +2001,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", ] @@ -2018,7 +2019,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -2041,7 +2042,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "Inflector", "array-bytes", @@ -2092,7 +2093,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2103,7 +2104,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2119,7 +2120,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -2148,7 +2149,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "bitflags", "frame-metadata", @@ -2180,7 +2181,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "Inflector", "cfg-expr", @@ -2194,7 +2195,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2206,7 +2207,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "proc-macro2", "quote", @@ -2216,7 +2217,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2239,7 +2240,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -2250,7 +2251,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "log", @@ -2268,7 +2269,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -2283,7 +2284,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "sp-api", @@ -2292,7 +2293,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "parity-scale-codec", @@ -2463,7 +2464,7 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "chrono", "frame-election-provider-support", @@ -4812,7 +4813,7 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -4826,7 +4827,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -4842,7 +4843,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -4857,7 +4858,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -4881,7 +4882,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4901,7 +4902,7 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4920,7 +4921,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -4935,7 +4936,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "beefy-primitives", "frame-support", @@ -4951,7 +4952,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "beefy-merkle-tree", @@ -4974,7 +4975,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -4992,7 +4993,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5011,7 +5012,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5028,7 +5029,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5045,7 +5046,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5063,7 +5064,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5087,7 +5088,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5100,7 +5101,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5118,7 +5119,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5139,7 +5140,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5154,7 +5155,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5177,7 +5178,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5193,7 +5194,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5213,7 +5214,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5230,7 +5231,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5247,7 +5248,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5265,7 +5266,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -5280,7 +5281,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5296,7 +5297,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -5313,7 +5314,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5333,7 +5334,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "sp-api", @@ -5343,7 +5344,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -5360,7 +5361,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5383,7 +5384,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5400,7 +5401,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5415,7 +5416,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5433,7 +5434,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5448,7 +5449,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5466,7 +5467,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5482,7 +5483,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -5503,7 +5504,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5519,7 +5520,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -5533,7 +5534,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5556,7 +5557,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5567,7 +5568,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "log", "sp-arithmetic", @@ -5576,7 +5577,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -5590,7 +5591,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5608,7 +5609,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5627,7 +5628,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-support", "frame-system", @@ -5643,7 +5644,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5658,7 +5659,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5669,7 +5670,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5686,7 +5687,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5702,7 +5703,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -5717,7 +5718,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8251,7 +8252,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "env_logger 0.9.0", "jsonrpsee", @@ -8599,7 +8600,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "log", "sp-core", @@ -8610,7 +8611,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "futures", @@ -8637,7 +8638,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "futures-timer", @@ -8660,7 +8661,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8676,7 +8677,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8693,7 +8694,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8704,7 +8705,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "chrono", @@ -8744,7 +8745,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "fnv", "futures", @@ -8772,7 +8773,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "hash-db", "kvdb", @@ -8797,7 +8798,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "futures", @@ -8821,7 +8822,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "fork-tree", @@ -8863,7 +8864,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "jsonrpsee", @@ -8885,7 +8886,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8898,7 +8899,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "futures", @@ -8922,7 +8923,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "lazy_static", "lru 0.7.8", @@ -8949,7 +8950,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "environmental", "parity-scale-codec", @@ -8965,7 +8966,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "log", "parity-scale-codec", @@ -8980,7 +8981,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "cfg-if 1.0.0", "libc", @@ -9000,7 +9001,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "ahash", "array-bytes", @@ -9041,7 +9042,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "finality-grandpa", "futures", @@ -9062,7 +9063,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "ansi_term", "futures", @@ -9079,7 +9080,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "async-trait", @@ -9094,7 +9095,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "async-trait", @@ -9141,7 +9142,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "cid", "futures", @@ -9161,7 +9162,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "bitflags", @@ -9187,7 +9188,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "ahash", "futures", @@ -9205,7 +9206,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "futures", @@ -9226,7 +9227,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "fork-tree", @@ -9254,7 +9255,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "futures", @@ -9273,7 +9274,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "bytes", @@ -9303,7 +9304,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "libp2p", @@ -9316,7 +9317,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9325,7 +9326,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "hash-db", @@ -9355,7 +9356,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "jsonrpsee", @@ -9378,7 +9379,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "jsonrpsee", @@ -9391,7 +9392,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "directories", @@ -9461,7 +9462,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "log", "parity-scale-codec", @@ -9475,7 +9476,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -9494,7 +9495,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "libc", @@ -9513,7 +9514,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "chrono", "futures", @@ -9531,7 +9532,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "ansi_term", "atty", @@ -9562,7 +9563,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9573,7 +9574,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "futures-timer", @@ -9599,7 +9600,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "log", @@ -9612,7 +9613,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "futures-timer", @@ -10098,7 +10099,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "hash-db", "log", @@ -10116,7 +10117,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "blake2", "proc-macro-crate", @@ -10128,7 +10129,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10141,7 +10142,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "integer-sqrt", "num-traits", @@ -10156,7 +10157,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10169,7 +10170,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "parity-scale-codec", @@ -10181,7 +10182,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "sp-api", @@ -10193,7 +10194,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "log", @@ -10211,7 +10212,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "futures", @@ -10230,7 +10231,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "merlin", @@ -10253,7 +10254,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10267,7 +10268,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10280,7 +10281,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "base58", @@ -10326,7 +10327,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "blake2", "byteorder", @@ -10340,7 +10341,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "proc-macro2", "quote", @@ -10351,7 +10352,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -10360,7 +10361,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "proc-macro2", "quote", @@ -10370,7 +10371,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "environmental", "parity-scale-codec", @@ -10381,7 +10382,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "finality-grandpa", "log", @@ -10399,7 +10400,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10413,7 +10414,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "bytes", "futures", @@ -10439,7 +10440,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "lazy_static", "sp-core", @@ -10450,7 +10451,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "futures", @@ -10467,7 +10468,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "thiserror", "zstd", @@ -10476,7 +10477,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "log", "parity-scale-codec", @@ -10492,7 +10493,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10506,7 +10507,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "sp-api", "sp-core", @@ -10516,7 +10517,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "backtrace", "lazy_static", @@ -10526,7 +10527,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "rustc-hash", "serde", @@ -10536,7 +10537,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "either", "hash256-std-hasher", @@ -10559,7 +10560,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -10577,7 +10578,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "Inflector", "proc-macro-crate", @@ -10589,7 +10590,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "log", "parity-scale-codec", @@ -10603,7 +10604,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10617,7 +10618,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "scale-info", @@ -10628,7 +10629,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "hash-db", "log", @@ -10650,12 +10651,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10668,7 +10669,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "log", "sp-core", @@ -10681,7 +10682,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "futures-timer", @@ -10697,7 +10698,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "sp-std", @@ -10709,7 +10710,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "sp-api", "sp-runtime", @@ -10718,7 +10719,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "async-trait", "log", @@ -10734,7 +10735,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "ahash", "hash-db", @@ -10757,7 +10758,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10774,7 +10775,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10785,7 +10786,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "impl-trait-for-tuples", "log", @@ -10798,7 +10799,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -11013,7 +11014,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "platforms", ] @@ -11021,7 +11022,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -11042,7 +11043,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures-util", "hyper", @@ -11055,7 +11056,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "jsonrpsee", "log", @@ -11076,7 +11077,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "array-bytes", "async-trait", @@ -11102,7 +11103,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "futures", "substrate-test-utils-derive", @@ -11112,7 +11113,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11123,7 +11124,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "ansi_term", "build-helper", @@ -11836,7 +11837,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#4a5a9dea00c9b4e4d34ff56368451aa4dac09d77" +source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" dependencies = [ "clap", "frame-try-runtime", diff --git a/runtime/common/src/claims.rs b/runtime/common/src/claims.rs index cded9b289a4f..bb0663ec34f7 100644 --- a/runtime/common/src/claims.rs +++ b/runtime/common/src/claims.rs @@ -717,7 +717,7 @@ mod tests { assert_err, assert_noop, assert_ok, dispatch::{DispatchError::BadOrigin, GetDispatchInfo, Pays}, ord_parameter_types, parameter_types, - traits::{ExistenceRequirement, GenesisBuild}, + traits::{ExistenceRequirement, GenesisBuild, WithdrawReasons}, }; use pallet_balances; use sp_runtime::{ @@ -790,6 +790,8 @@ mod tests { parameter_types! { pub const MinVestedTransfer: u64 = 1; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Test { @@ -798,6 +800,7 @@ mod tests { type BlockNumberToBalance = Identity; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = (); + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } diff --git a/runtime/common/src/purchase.rs b/runtime/common/src/purchase.rs index 8c0fcebd5c12..52ad22bec2fb 100644 --- a/runtime/common/src/purchase.rs +++ b/runtime/common/src/purchase.rs @@ -474,8 +474,10 @@ mod tests { // or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use crate::purchase; use frame_support::{ - assert_noop, assert_ok, dispatch::DispatchError::BadOrigin, ord_parameter_types, - parameter_types, traits::Currency, + assert_noop, assert_ok, + dispatch::DispatchError::BadOrigin, + ord_parameter_types, parameter_types, + traits::{Currency, WithdrawReasons}, }; use pallet_balances::Error as BalancesError; use sp_runtime::{ @@ -550,6 +552,8 @@ mod tests { parameter_types! { pub const MinVestedTransfer: u64 = 1; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Test { @@ -558,6 +562,7 @@ mod tests { type BlockNumberToBalance = Identity; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = (); + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index a4a3a05e1173..58a824ae1cc2 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -52,7 +52,7 @@ use frame_support::{ construct_runtime, parameter_types, traits::{ ConstU32, Contains, EitherOf, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, - LockIdentifier, PrivilegeCmp, + LockIdentifier, PrivilegeCmp, WithdrawReasons, }, weights::ConstantMultiplier, PalletId, RuntimeDebug, @@ -931,6 +931,8 @@ impl pallet_society::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = 100 * CENTS; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -939,6 +941,7 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index 054fb421babd..8f6f2e4db47d 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -42,7 +42,7 @@ use frame_support::{ construct_runtime, parameter_types, traits::{ ConstU32, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, - PrivilegeCmp, + PrivilegeCmp, WithdrawReasons, }, weights::ConstantMultiplier, PalletId, RuntimeDebug, @@ -992,6 +992,8 @@ impl claims::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = 1 * DOLLARS; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -1000,6 +1002,7 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index a13bc5932db2..ac247248b9ea 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -55,7 +55,7 @@ use frame_support::{ construct_runtime, parameter_types, traits::{ Contains, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, - PrivilegeCmp, + PrivilegeCmp, WithdrawReasons, }, weights::ConstantMultiplier, PalletId, RuntimeDebug, @@ -857,6 +857,8 @@ impl pallet_society::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = 100 * CENTS; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -865,6 +867,7 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } diff --git a/runtime/test-runtime/src/lib.rs b/runtime/test-runtime/src/lib.rs index 2eade55e3877..a43e13eb015e 100644 --- a/runtime/test-runtime/src/lib.rs +++ b/runtime/test-runtime/src/lib.rs @@ -38,7 +38,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId; use frame_election_provider_support::{onchain, SequentialPhragmen}; use frame_support::{ construct_runtime, parameter_types, - traits::{Everything, KeyOwnerProofSystem}, + traits::{Everything, KeyOwnerProofSystem, WithdrawReasons}, }; use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; use pallet_session::historical as session_historical; @@ -455,6 +455,8 @@ impl claims::Config for Runtime { parameter_types! { pub storage MinVestedTransfer: Balance = 100 * DOLLARS; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -463,6 +465,7 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = (); + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 61a909b4806d..454e367e2c15 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -25,7 +25,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId; use frame_election_provider_support::{onchain, SequentialPhragmen}; use frame_support::{ construct_runtime, parameter_types, - traits::{ConstU32, InstanceFilter, KeyOwnerProofSystem}, + traits::{ConstU32, InstanceFilter, KeyOwnerProofSystem, WithdrawReasons}, weights::ConstantMultiplier, PalletId, }; @@ -712,6 +712,8 @@ impl pallet_recovery::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = 100 * CENTS; + pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = + WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -720,6 +722,7 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; + type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } From 1e96dfdc429bbb02b396e7edd5feb1a243d818f7 Mon Sep 17 00:00:00 2001 From: girazoki Date: Mon, 10 Oct 2022 06:39:30 +0200 Subject: [PATCH 35/49] Add event to asset claim (#6029) --- xcm/pallet-xcm/src/lib.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xcm/pallet-xcm/src/lib.rs b/xcm/pallet-xcm/src/lib.rs index c29b374dd078..78dc5087d960 100644 --- a/xcm/pallet-xcm/src/lib.rs +++ b/xcm/pallet-xcm/src/lib.rs @@ -218,6 +218,10 @@ pub mod pallet { /// /// \[ location, query ID \] NotifyTargetMigrationFail(VersionedMultiLocation, QueryId), + /// Some assets have been claimed from an asset trap + /// + /// \[ hash, origin, assets \] + AssetsClaimed(H256, MultiLocation, VersionedMultiAssets), } #[pallet::origin] @@ -1312,12 +1316,13 @@ pub mod pallet { (0, Here) => (), _ => return false, }; - let hash = BlakeTwo256::hash_of(&(origin, versioned)); + let hash = BlakeTwo256::hash_of(&(origin, versioned.clone())); match AssetTraps::::get(hash) { 0 => return false, 1 => AssetTraps::::remove(hash), n => AssetTraps::::insert(hash, n - 1), } + Self::deposit_event(Event::AssetsClaimed(hash, origin.clone(), versioned)); return true } } From 857e6352be56608e90cbe09621da6c0b4652b213 Mon Sep 17 00:00:00 2001 From: Chris Sosnin <48099298+slumber@users.noreply.github.com> Date: Mon, 10 Oct 2022 10:06:44 +0400 Subject: [PATCH 36/49] Fix flaky test (#6131) * Split test + decrease test timeout * fmt * spellcheck --- .../src/validator_side/mod.rs | 4 ++ .../src/validator_side/tests.rs | 50 +++++++++++-------- node/subsystem-test-helpers/src/lib.rs | 29 +++++++++++ 3 files changed, 63 insertions(+), 20 deletions(-) diff --git a/node/network/collator-protocol/src/validator_side/mod.rs b/node/network/collator-protocol/src/validator_side/mod.rs index b74c1d5b5a4f..b2b3dc4824b5 100644 --- a/node/network/collator-protocol/src/validator_side/mod.rs +++ b/node/network/collator-protocol/src/validator_side/mod.rs @@ -85,12 +85,16 @@ const BENEFIT_NOTIFY_GOOD: Rep = /// to finish on time. /// /// There is debug logging output, so we can adjust this value based on production results. +#[cfg(not(test))] const MAX_UNSHARED_DOWNLOAD_TIME: Duration = Duration::from_millis(400); // How often to check all peers with activity. #[cfg(not(test))] const ACTIVITY_POLL: Duration = Duration::from_secs(1); +#[cfg(test)] +const MAX_UNSHARED_DOWNLOAD_TIME: Duration = Duration::from_millis(100); + #[cfg(test)] const ACTIVITY_POLL: Duration = Duration::from_millis(10); diff --git a/node/network/collator-protocol/src/validator_side/tests.rs b/node/network/collator-protocol/src/validator_side/tests.rs index 15740e5d5efa..ae8644cea521 100644 --- a/node/network/collator-protocol/src/validator_side/tests.rs +++ b/node/network/collator-protocol/src/validator_side/tests.rs @@ -20,7 +20,7 @@ use futures::{executor, future, Future}; use sp_core::{crypto::Pair, Encode}; use sp_keyring::Sr25519Keyring; use sp_keystore::{testing::KeyStore as TestKeyStore, SyncCryptoStore}; -use std::{iter, sync::Arc, time::Duration}; +use std::{iter, sync::Arc, task::Poll, time::Duration}; use polkadot_node_network_protocol::{ our_view, @@ -493,17 +493,11 @@ fn collator_authentication_verification_works() { }); } -// A test scenario that takes the following steps -// - Two collators connect, declare themselves and advertise a collation relevant to -// our view. -// - Collation protocol should request one PoV. -// - Collation protocol should disconnect both collators after having received the collation. -// - The same collators plus an additional collator connect again and send `PoV`s for a different relay parent. -// - Collation protocol will request one PoV, but we will cancel it. -// - Collation protocol should request the second PoV which does not succeed in time. -// - Collation protocol should request third PoV. +/// Tests that a validator fetches only one collation at any moment of time +/// per relay parent and ignores other advertisements once a candidate gets +/// seconded. #[test] -fn fetch_collations_works() { +fn fetch_one_collation_at_a_time() { let test_state = TestState::default(); test_harness(|test_harness| async move { @@ -575,22 +569,38 @@ fn fetch_collations_works() { ) .await; - overseer_send( - &mut virtual_overseer, - CollatorProtocolMessage::NetworkBridgeUpdate(NetworkBridgeEvent::PeerDisconnected( - peer_b.clone(), - )), - ) - .await; + // Ensure the subsystem is polled. + test_helpers::Yield::new().await; + + // Second collation is not requested since there's already seconded one. + assert_matches!(futures::poll!(virtual_overseer.recv().boxed()), Poll::Pending); + + virtual_overseer + }) +} + +/// Tests that a validator starts fetching next queued collations on [`MAX_UNSHARED_DOWNLOAD_TIME`] +/// timeout and in case of an error. +#[test] +fn fetches_next_collation() { + let test_state = TestState::default(); + + test_harness(|test_harness| async move { + let TestHarness { mut virtual_overseer } = test_harness; + + let second = Hash::random(); overseer_send( &mut virtual_overseer, - CollatorProtocolMessage::NetworkBridgeUpdate(NetworkBridgeEvent::PeerDisconnected( - peer_c.clone(), + CollatorProtocolMessage::NetworkBridgeUpdate(NetworkBridgeEvent::OurViewChange( + our_view![test_state.relay_parent, second], )), ) .await; + respond_to_core_info_queries(&mut virtual_overseer, &test_state).await; + respond_to_core_info_queries(&mut virtual_overseer, &test_state).await; + let peer_b = PeerId::random(); let peer_c = PeerId::random(); let peer_d = PeerId::random(); diff --git a/node/subsystem-test-helpers/src/lib.rs b/node/subsystem-test-helpers/src/lib.rs index e2e61c2006d8..79f833b7558c 100644 --- a/node/subsystem-test-helpers/src/lib.rs +++ b/node/subsystem-test-helpers/src/lib.rs @@ -30,6 +30,7 @@ use sp_core::testing::TaskExecutor; use std::{ convert::Infallible, + future::Future, pin::Pin, sync::Arc, task::{Context, Poll, Waker}, @@ -391,6 +392,34 @@ macro_rules! arbitrary_order { }; } +/// Future that yields the execution once and resolves +/// immediately after. +/// +/// Useful when one wants to poll the background task to completion +/// before sending messages to it in order to avoid races. +pub struct Yield(bool); + +impl Yield { + /// Returns new `Yield` future. + pub fn new() -> Self { + Self(false) + } +} + +impl Future for Yield { + type Output = (); + + fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + if !self.0 { + self.0 = true; + cx.waker().wake_by_ref(); + Poll::Pending + } else { + Poll::Ready(()) + } + } +} + #[cfg(test)] mod tests { use super::*; From 96185c307823f33165e7a087e18d913c42aeb36a Mon Sep 17 00:00:00 2001 From: Andronik Date: Mon, 10 Oct 2022 11:41:04 +0200 Subject: [PATCH 37/49] ci/guide: install mdbook-graphviz (#6119) * ci/guide: install mdbook-graphviz * install graphviz in build-implementers-guide * Update scripts/ci/gitlab/pipeline/build.yml Co-authored-by: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> --- scripts/ci/gitlab/pipeline/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/ci/gitlab/pipeline/build.yml b/scripts/ci/gitlab/pipeline/build.yml index dcc05427f0b3..791b01c2b632 100644 --- a/scripts/ci/gitlab/pipeline/build.yml +++ b/scripts/ci/gitlab/pipeline/build.yml @@ -169,7 +169,8 @@ build-implementers-guide: - .test-refs - .collect-artifacts-short script: - - cargo install mdbook mdbook-mermaid mdbook-linkcheck + - apt-get -y update; apt-get install -y graphviz + - cargo install mdbook mdbook-mermaid mdbook-linkcheck mdbook-graphviz - mdbook build ./roadmap/implementers-guide - mkdir -p artifacts - mv roadmap/implementers-guide/book artifacts/ From 612302ccaa541696259f9ab63524d9d6edf440e6 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Mon, 10 Oct 2022 12:01:29 +0100 Subject: [PATCH 38/49] Revert "Squashed commit of the following:" This reverts commit 5001fa5d1dcd366029d156f81c40b99ca29d8f77. --- Cargo.lock | 496 ++++++++--------- Cargo.toml | 9 +- cli/Cargo.toml | 6 +- core-primitives/Cargo.toml | 2 +- node/core/approval-voting/Cargo.toml | 6 +- node/core/approval-voting/src/import.rs | 32 -- node/core/approval-voting/src/lib.rs | 7 +- node/core/approval-voting/src/tests.rs | 31 -- node/core/av-store/Cargo.toml | 4 +- node/core/av-store/src/lib.rs | 28 +- node/core/chain-selection/Cargo.toml | 4 +- .../core/chain-selection/src/db_backend/v1.rs | 26 +- node/core/dispute-coordinator/Cargo.toml | 6 +- .../dispute-coordinator/src/scraping/mod.rs | 10 +- node/core/dispute-coordinator/src/tests.rs | 41 +- node/core/runtime-api/Cargo.toml | 2 +- node/malus/Cargo.toml | 2 +- node/metrics/src/tests.rs | 15 +- .../availability-distribution/Cargo.toml | 2 +- .../src/requester/session_cache.rs | 4 +- node/network/availability-recovery/Cargo.toml | 2 +- node/network/availability-recovery/src/lib.rs | 6 +- node/network/collator-protocol/Cargo.toml | 1 - .../src/collator_side/metrics.rs | 123 ----- .../src/collator_side/mod.rs | 254 ++++----- .../src/collator_side/tests.rs | 116 +--- .../src/collator_side/validators_buffer.rs | 317 ----------- node/network/collator-protocol/src/lib.rs | 27 +- .../src/validator_side/mod.rs | 33 +- .../src/validator_side/tests.rs | 50 +- node/network/dispute-distribution/Cargo.toml | 4 +- node/network/dispute-distribution/src/lib.rs | 41 +- .../dispute-distribution/src/metrics.rs | 7 +- .../src/receiver/batches/batch.rs | 209 ------- .../src/receiver/batches/mod.rs | 170 ------ .../src/receiver/batches/waiting_queue.rs | 204 ------- .../src/receiver/error.rs | 25 +- .../dispute-distribution/src/receiver/mod.rs | 511 +++++++----------- .../src/receiver/peer_queues.rs | 141 ----- .../dispute-distribution/src/sender/mod.rs | 110 +--- .../src/sender/send_task.rs | 30 +- .../dispute-distribution/src/tests/mock.rs | 28 +- .../dispute-distribution/src/tests/mod.rs | 453 ++++------------ .../protocol/src/request_response/mod.rs | 8 +- node/overseer/Cargo.toml | 4 +- node/overseer/src/lib.rs | 6 +- node/service/Cargo.toml | 6 +- node/service/src/lib.rs | 4 +- node/service/src/parachains_db/upgrade.rs | 2 +- node/subsystem-test-helpers/src/lib.rs | 29 - node/subsystem-util/Cargo.toml | 8 +- node/subsystem-util/src/database.rs | 79 +-- .../src/rolling_session_window.rs | 339 +----------- node/subsystem-util/src/runtime/mod.rs | 11 +- node/test/performance-test/Cargo.toml | 3 - parachain/Cargo.toml | 2 +- primitives/Cargo.toml | 2 +- .../src/node/disputes/dispute-distribution.md | 309 ++++------- runtime/common/src/claims.rs | 5 +- runtime/common/src/lib.rs | 12 +- runtime/common/src/purchase.rs | 9 +- runtime/kusama/src/governance/fellowship.rs | 1 - runtime/kusama/src/governance/mod.rs | 1 - runtime/kusama/src/governance/old.rs | 6 +- runtime/kusama/src/lib.rs | 19 +- .../kusama/src/weights/pallet_democracy.rs | 185 ++++--- runtime/kusama/src/weights/pallet_preimage.rs | 67 +-- .../kusama/src/weights/pallet_scheduler.rs | 161 ++++-- runtime/parachains/src/configuration.rs | 3 +- .../parachains/src/configuration/migration.rs | 322 +---------- runtime/polkadot/src/lib.rs | 25 +- .../polkadot/src/weights/pallet_democracy.rs | 185 ++++--- .../polkadot/src/weights/pallet_preimage.rs | 63 +-- .../polkadot/src/weights/pallet_scheduler.rs | 160 ++++-- runtime/rococo/src/lib.rs | 31 +- .../rococo/src/weights/pallet_democracy.rs | 183 ++++--- runtime/rococo/src/weights/pallet_preimage.rs | 63 +-- .../rococo/src/weights/pallet_scheduler.rs | 158 ++++-- runtime/test-runtime/src/lib.rs | 5 +- runtime/westend/src/lib.rs | 15 +- .../westend/src/weights/pallet_preimage.rs | 63 +-- .../westend/src/weights/pallet_scheduler.rs | 160 ++++-- scripts/ci/gitlab/lingua.dic | 2 - scripts/ci/gitlab/pipeline/build.yml | 3 +- xcm/pallet-xcm/src/lib.rs | 17 +- xcm/pallet-xcm/src/tests.rs | 8 +- xcm/xcm-executor/integration-tests/src/lib.rs | 7 +- 87 files changed, 2059 insertions(+), 4287 deletions(-) delete mode 100644 node/network/collator-protocol/src/collator_side/metrics.rs delete mode 100644 node/network/collator-protocol/src/collator_side/validators_buffer.rs delete mode 100644 node/network/dispute-distribution/src/receiver/batches/batch.rs delete mode 100644 node/network/dispute-distribution/src/receiver/batches/mod.rs delete mode 100644 node/network/dispute-distribution/src/receiver/batches/waiting_queue.rs delete mode 100644 node/network/dispute-distribution/src/receiver/peer_queues.rs diff --git a/Cargo.lock b/Cargo.lock index 33b4d44fefb7..1f4ec51a3fd9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -435,7 +435,7 @@ dependencies = [ [[package]] name = "beefy-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "async-trait", @@ -472,7 +472,7 @@ dependencies = [ [[package]] name = "beefy-gadget-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "beefy-gadget", "beefy-primitives", @@ -492,25 +492,22 @@ dependencies = [ [[package]] name = "beefy-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "beefy-primitives", "sp-api", - "sp-runtime", ] [[package]] name = "beefy-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", "sp-application-crypto", "sp-core", - "sp-io", - "sp-mmr-primitives", "sp-runtime", "sp-std", ] @@ -532,9 +529,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.60.1" +version = "0.59.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" +checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" dependencies = [ "bitflags", "cexpr", @@ -557,9 +554,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitvec" -version = "1.0.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +checksum = "1489fcb93a5bb47da0462ca93ad252ad6af2145cce58d10d46a83931ba9f016b" dependencies = [ "funty", "radium", @@ -917,7 +914,7 @@ checksum = "fa66045b9cb23c2e9c1520732030608b02ee07e5cfaa5a521ec15ded7fa24c90" dependencies = [ "glob", "libc", - "libloading", + "libloading 0.7.2", ] [[package]] @@ -1948,9 +1945,9 @@ dependencies = [ [[package]] name = "fixed-hash" -version = "0.8.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" dependencies = [ "byteorder", "rand 0.8.5", @@ -2001,7 +1998,7 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", ] @@ -2019,7 +2016,7 @@ dependencies = [ [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -2042,7 +2039,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "Inflector", "array-bytes", @@ -2093,7 +2090,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2104,7 +2101,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -2120,7 +2117,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -2149,7 +2146,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "bitflags", "frame-metadata", @@ -2181,7 +2178,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "Inflector", "cfg-expr", @@ -2195,7 +2192,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -2207,7 +2204,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "proc-macro2", "quote", @@ -2217,7 +2214,7 @@ dependencies = [ [[package]] name = "frame-support-test" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-support-test-pallet", @@ -2240,7 +2237,7 @@ dependencies = [ [[package]] name = "frame-support-test-pallet" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -2251,7 +2248,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "log", @@ -2269,7 +2266,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -2284,7 +2281,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "sp-api", @@ -2293,7 +2290,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "parity-scale-codec", @@ -2308,6 +2305,18 @@ version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ebd3504ad6116843b8375ad70df74e7bfe83cac77a1f3fe73200c844d43bfe0" +[[package]] +name = "fs-swap" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d47dad3685eceed8488986cad3d5027165ea5edb164331770e2059555f10a5" +dependencies = [ + "lazy_static", + "libc", + "libloading 0.5.2", + "winapi", +] + [[package]] name = "fs2" version = "0.4.3" @@ -2464,7 +2473,7 @@ dependencies = [ [[package]] name = "generate-bags" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "chrono", "frame-election-provider-support", @@ -2900,9 +2909,9 @@ dependencies = [ [[package]] name = "impl-serde" -version = "0.4.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" dependencies = [ "serde", ] @@ -3317,9 +3326,9 @@ dependencies = [ [[package]] name = "kvdb" -version = "0.12.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585089ceadba0197ffe9af6740ab350b325e3c1f5fccfbc3522e0250c750409b" +checksum = "a301d8ecb7989d4a6e2c57a49baca77d353bdbf879909debe3f375fe25d61f86" dependencies = [ "parity-util-mem", "smallvec", @@ -3327,9 +3336,9 @@ dependencies = [ [[package]] name = "kvdb-memorydb" -version = "0.12.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40d109c87bfb7759edd2a49b2649c1afe25af785d930ad6a38479b4dc70dd873" +checksum = "ece7e668abd21387aeb6628130a6f4c802787f014fa46bc83221448322250357" dependencies = [ "kvdb", "parity-util-mem", @@ -3338,13 +3347,15 @@ dependencies = [ [[package]] name = "kvdb-rocksdb" -version = "0.16.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c076cc2cdbac89b9910c853a36c957d3862a779f31c2661174222cefb49ee597" +checksum = "ca7fbdfd71cd663dceb0faf3367a99f8cf724514933e9867cec4995b6027cbc1" dependencies = [ + "fs-swap", "kvdb", "log", "num_cpus", + "owning_ref", "parity-util-mem", "parking_lot 0.12.1", "regex", @@ -3354,9 +3365,9 @@ dependencies = [ [[package]] name = "kvdb-shared-tests" -version = "0.10.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de82a1adb7ade192c0090dd56d059a626191c0638c795eb68aff4b0bd2c1f9be" +checksum = "7a9001edd3459aa1503ea84215cf4618a6e2e020f51682494cc6f5ab1150e68e" dependencies = [ "kvdb", ] @@ -3391,6 +3402,16 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libloading" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" +dependencies = [ + "cc", + "winapi", +] + [[package]] name = "libloading" version = "0.7.2" @@ -3924,9 +3945,9 @@ dependencies = [ [[package]] name = "librocksdb-sys" -version = "0.8.0+7.4.4" +version = "0.6.1+6.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611804e4666a25136fcc5f8cf425ab4d26c7f74ea245ffe92ea23b85b6420b5d" +checksum = "81bc587013734dadb7cf23468e531aa120788b87243648be42e2d3a072186291" dependencies = [ "bindgen", "bzip2-sys", @@ -4203,9 +4224,9 @@ dependencies = [ [[package]] name = "memory-db" -version = "0.30.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac11bb793c28fa095b7554466f53b3a60a2cd002afdac01bcf135cbd73a269" +checksum = "6566c70c1016f525ced45d7b7f97730a2bafb037c788211d0c186ef5b2189f0a" dependencies = [ "hash-db", "hashbrown", @@ -4813,7 +4834,7 @@ checksum = "20448fd678ec04e6ea15bbe0476874af65e98a01515d667aa49f1434dc44ebf4" [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -4827,7 +4848,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -4843,7 +4864,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -4858,7 +4879,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -4882,7 +4903,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -4902,7 +4923,7 @@ dependencies = [ [[package]] name = "pallet-bags-list-remote-tests" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-election-provider-support", "frame-support", @@ -4921,7 +4942,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -4936,7 +4957,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "beefy-primitives", "frame-support", @@ -4952,7 +4973,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "beefy-merkle-tree", @@ -4975,7 +4996,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -4993,7 +5014,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5012,7 +5033,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5029,7 +5050,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#dbb72f3fd98253b72c0090375b738b9d00995090" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5046,16 +5067,14 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log", "parity-scale-codec", "scale-info", "serde", - "sp-core", "sp-io", "sp-runtime", "sp-std", @@ -5064,7 +5083,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5088,7 +5107,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5101,7 +5120,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5119,7 +5138,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5140,7 +5159,7 @@ dependencies = [ [[package]] name = "pallet-gilt" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5155,7 +5174,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5178,7 +5197,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "enumflags2", "frame-benchmarking", @@ -5194,7 +5213,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5214,7 +5233,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5231,7 +5250,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5248,7 +5267,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "ckb-merkle-mountain-range", "frame-benchmarking", @@ -5266,7 +5285,7 @@ dependencies = [ [[package]] name = "pallet-mmr-rpc" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -5281,12 +5300,11 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log", "parity-scale-codec", "scale-info", "sp-io", @@ -5297,7 +5315,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -5314,7 +5332,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5334,7 +5352,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "sp-api", @@ -5344,7 +5362,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -5361,7 +5379,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5384,12 +5402,11 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "log", "parity-scale-codec", "scale-info", "sp-core", @@ -5401,7 +5418,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5416,7 +5433,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#dbb72f3fd98253b72c0090375b738b9d00995090" dependencies = [ "frame-benchmarking", "frame-support", @@ -5434,7 +5451,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5449,7 +5466,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#dbb72f3fd98253b72c0090375b738b9d00995090" dependencies = [ "assert_matches", "frame-benchmarking", @@ -5467,7 +5484,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5483,7 +5500,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -5504,7 +5521,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5520,7 +5537,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -5534,7 +5551,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -5557,7 +5574,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -5568,7 +5585,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "log", "sp-arithmetic", @@ -5577,7 +5594,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -5591,7 +5608,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5609,7 +5626,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5628,7 +5645,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-support", "frame-system", @@ -5644,7 +5661,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -5659,7 +5676,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -5670,7 +5687,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5687,7 +5704,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5703,7 +5720,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-benchmarking", "frame-support", @@ -5718,7 +5735,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#dbb72f3fd98253b72c0090375b738b9d00995090" dependencies = [ "frame-benchmarking", "frame-support", @@ -5831,9 +5848,9 @@ checksum = "aa9777aa91b8ad9dd5aaa04a9b6bcb02c7f1deb952fca5a66034d5e63afc5c6f" [[package]] name = "parity-util-mem" -version = "0.12.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d32c34f4f5ca7f9196001c0aba5a1f9a5a12382c8944b8b0f90233282d1e8f8" +checksum = "c32561d248d352148124f036cac253a644685a21dc9fea383eb4907d7bd35a8f" dependencies = [ "cfg-if 1.0.0", "hashbrown", @@ -6018,18 +6035,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.12" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" dependencies = [ "proc-macro2", "quote", @@ -6149,7 +6166,7 @@ dependencies = [ "fatality", "futures", "futures-timer", - "lru 0.8.0", + "lru 0.7.8", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6179,7 +6196,7 @@ dependencies = [ "futures", "futures-timer", "log", - "lru 0.8.0", + "lru 0.7.8", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6272,7 +6289,6 @@ version = "0.9.29" dependencies = [ "always-assert", "assert_matches", - "bitvec", "env_logger 0.9.0", "fatality", "futures", @@ -6317,9 +6333,8 @@ dependencies = [ "fatality", "futures", "futures-timer", - "indexmap", "lazy_static", - "lru 0.8.0", + "lru 0.7.8", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -6439,7 +6454,7 @@ dependencies = [ "futures-timer", "kvdb", "kvdb-memorydb", - "lru 0.8.0", + "lru 0.7.8", "merlin", "parity-scale-codec", "parking_lot 0.12.1", @@ -6608,7 +6623,7 @@ dependencies = [ "futures-timer", "kvdb", "kvdb-memorydb", - "lru 0.8.0", + "lru 0.7.8", "parity-scale-codec", "polkadot-node-primitives", "polkadot-node-subsystem", @@ -6895,7 +6910,7 @@ dependencies = [ "kvdb-shared-tests", "lazy_static", "log", - "lru 0.8.0", + "lru 0.7.8", "parity-db", "parity-scale-codec", "parity-util-mem", @@ -6929,7 +6944,7 @@ dependencies = [ "femme", "futures", "futures-timer", - "lru 0.8.0", + "lru 0.7.8", "orchestra", "parity-util-mem", "parking_lot 0.12.1", @@ -7286,7 +7301,7 @@ dependencies = [ "kvdb", "kvdb-rocksdb", "log", - "lru 0.8.0", + "lru 0.7.8", "pallet-babe", "pallet-im-online", "pallet-staking", @@ -7710,9 +7725,9 @@ dependencies = [ [[package]] name = "primitive-types" -version = "0.12.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cfd65aea0c5fa0bfcc7c9e7ca828c921ef778f43d325325ec84bda371bfa75a" +checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" dependencies = [ "fixed-hash", "impl-codec", @@ -8252,7 +8267,7 @@ dependencies = [ [[package]] name = "remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "env_logger 0.9.0", "jsonrpsee", @@ -8350,9 +8365,9 @@ dependencies = [ [[package]] name = "rocksdb" -version = "0.19.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9562ea1d70c0cc63a34a22d977753b50cca91cc6b6527750463bd5dd8697bc" +checksum = "620f4129485ff1a7128d184bc687470c21c7951b64779ebc9cfdad3dcd920290" dependencies = [ "libc", "librocksdb-sys", @@ -8600,7 +8615,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "log", "sp-core", @@ -8611,7 +8626,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "futures", @@ -8620,8 +8635,8 @@ dependencies = [ "libp2p", "log", "parity-scale-codec", - "prost 0.11.0", - "prost-build 0.11.1", + "prost 0.10.3", + "prost-build 0.10.4", "rand 0.7.3", "sc-client-api", "sc-network-common", @@ -8638,7 +8653,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "futures-timer", @@ -8661,7 +8676,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -8677,7 +8692,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "impl-trait-for-tuples", "memmap2 0.5.0", @@ -8694,7 +8709,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -8705,7 +8720,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "chrono", @@ -8745,7 +8760,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "fnv", "futures", @@ -8773,7 +8788,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "hash-db", "kvdb", @@ -8798,7 +8813,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "futures", @@ -8822,7 +8837,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "fork-tree", @@ -8864,7 +8879,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "jsonrpsee", @@ -8886,7 +8901,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "fork-tree", "parity-scale-codec", @@ -8899,7 +8914,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "futures", @@ -8923,7 +8938,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "lazy_static", "lru 0.7.8", @@ -8950,7 +8965,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "environmental", "parity-scale-codec", @@ -8966,7 +8981,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmi" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "log", "parity-scale-codec", @@ -8981,7 +8996,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "cfg-if 1.0.0", "libc", @@ -9001,7 +9016,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "ahash", "array-bytes", @@ -9042,7 +9057,7 @@ dependencies = [ [[package]] name = "sc-finality-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "finality-grandpa", "futures", @@ -9063,7 +9078,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "ansi_term", "futures", @@ -9080,7 +9095,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "async-trait", @@ -9095,7 +9110,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "async-trait", @@ -9117,7 +9132,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "pin-project", - "prost 0.11.0", + "prost 0.10.3", "rand 0.7.3", "sc-block-builder", "sc-client-api", @@ -9142,7 +9157,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "cid", "futures", @@ -9162,7 +9177,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "bitflags", @@ -9172,7 +9187,7 @@ dependencies = [ "libp2p", "linked_hash_set", "parity-scale-codec", - "prost-build 0.11.1", + "prost-build 0.10.4", "sc-consensus", "sc-peerset", "serde", @@ -9188,7 +9203,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "ahash", "futures", @@ -9206,15 +9221,15 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "futures", "libp2p", "log", "parity-scale-codec", - "prost 0.11.0", - "prost-build 0.11.1", + "prost 0.10.3", + "prost-build 0.10.4", "sc-client-api", "sc-network-common", "sc-peerset", @@ -9227,7 +9242,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "fork-tree", @@ -9236,8 +9251,8 @@ dependencies = [ "log", "lru 0.7.8", "parity-scale-codec", - "prost 0.11.0", - "prost-build 0.11.1", + "prost 0.10.3", + "prost-build 0.10.4", "sc-client-api", "sc-consensus", "sc-network-common", @@ -9255,7 +9270,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "futures", @@ -9274,7 +9289,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "bytes", @@ -9304,7 +9319,7 @@ dependencies = [ [[package]] name = "sc-peerset" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "libp2p", @@ -9317,7 +9332,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -9326,7 +9341,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "hash-db", @@ -9356,7 +9371,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "jsonrpsee", @@ -9379,7 +9394,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "jsonrpsee", @@ -9392,7 +9407,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "directories", @@ -9462,7 +9477,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "log", "parity-scale-codec", @@ -9476,7 +9491,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -9495,7 +9510,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "libc", @@ -9514,7 +9529,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "chrono", "futures", @@ -9532,7 +9547,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "ansi_term", "atty", @@ -9563,7 +9578,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -9574,7 +9589,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "futures-timer", @@ -9600,7 +9615,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "log", @@ -9613,7 +9628,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "futures-timer", @@ -10099,7 +10114,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "hash-db", "log", @@ -10117,7 +10132,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "blake2", "proc-macro-crate", @@ -10129,7 +10144,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "scale-info", @@ -10142,7 +10157,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "integer-sqrt", "num-traits", @@ -10157,7 +10172,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "scale-info", @@ -10170,7 +10185,7 @@ dependencies = [ [[package]] name = "sp-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "parity-scale-codec", @@ -10182,7 +10197,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "sp-api", @@ -10194,7 +10209,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "log", @@ -10212,7 +10227,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "futures", @@ -10231,7 +10246,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "merlin", @@ -10254,7 +10269,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "scale-info", @@ -10268,7 +10283,7 @@ dependencies = [ [[package]] name = "sp-consensus-vrf" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "scale-info", @@ -10281,7 +10296,7 @@ dependencies = [ [[package]] name = "sp-core" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "base58", @@ -10327,7 +10342,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "blake2", "byteorder", @@ -10341,7 +10356,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "proc-macro2", "quote", @@ -10352,7 +10367,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -10361,7 +10376,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "proc-macro2", "quote", @@ -10371,7 +10386,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "environmental", "parity-scale-codec", @@ -10382,7 +10397,7 @@ dependencies = [ [[package]] name = "sp-finality-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "finality-grandpa", "log", @@ -10400,7 +10415,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -10414,7 +10429,7 @@ dependencies = [ [[package]] name = "sp-io" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "bytes", "futures", @@ -10440,7 +10455,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "lazy_static", "sp-core", @@ -10451,7 +10466,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "futures", @@ -10468,7 +10483,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "thiserror", "zstd", @@ -10477,11 +10492,10 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "log", "parity-scale-codec", - "scale-info", "serde", "sp-api", "sp-core", @@ -10493,7 +10507,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "scale-info", @@ -10507,7 +10521,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "sp-api", "sp-core", @@ -10517,7 +10531,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "backtrace", "lazy_static", @@ -10527,7 +10541,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "rustc-hash", "serde", @@ -10537,7 +10551,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "either", "hash256-std-hasher", @@ -10560,7 +10574,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -10578,7 +10592,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "Inflector", "proc-macro-crate", @@ -10590,7 +10604,7 @@ dependencies = [ [[package]] name = "sp-sandbox" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "log", "parity-scale-codec", @@ -10604,7 +10618,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "scale-info", @@ -10618,7 +10632,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "scale-info", @@ -10629,7 +10643,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.12.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "hash-db", "log", @@ -10651,12 +10665,12 @@ dependencies = [ [[package]] name = "sp-std" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" [[package]] name = "sp-storage" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10669,7 +10683,7 @@ dependencies = [ [[package]] name = "sp-tasks" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "log", "sp-core", @@ -10682,7 +10696,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "futures-timer", @@ -10698,7 +10712,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "sp-std", @@ -10710,7 +10724,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "sp-api", "sp-runtime", @@ -10719,7 +10733,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "async-trait", "log", @@ -10735,7 +10749,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "ahash", "hash-db", @@ -10758,7 +10772,7 @@ dependencies = [ [[package]] name = "sp-version" version = "5.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "impl-serde", "parity-scale-codec", @@ -10775,7 +10789,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -10786,7 +10800,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "impl-trait-for-tuples", "log", @@ -10799,7 +10813,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "4.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -11014,7 +11028,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "platforms", ] @@ -11022,7 +11036,7 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -11043,7 +11057,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures-util", "hyper", @@ -11056,7 +11070,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "jsonrpsee", "log", @@ -11077,7 +11091,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "array-bytes", "async-trait", @@ -11103,7 +11117,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "futures", "substrate-test-utils-derive", @@ -11113,7 +11127,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11124,7 +11138,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "ansi_term", "build-helper", @@ -11434,9 +11448,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-ctl" -version = "0.5.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37706572f4b151dff7a0146e040804e9c26fe3a3118591112f05cf12a4216c1" +checksum = "eb833c46ecbf8b6daeccb347cefcabf9c1beb5c9b0f853e1cec45632d9963e69" dependencies = [ "libc", "paste", @@ -11445,9 +11459,9 @@ dependencies = [ [[package]] name = "tikv-jemalloc-sys" -version = "0.5.2+5.3.0-patched" +version = "0.4.2+5.2.1-patched.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec45c14da997d0925c7835883e4d5c181f196fa142f8c19d7643d1e9af2592c3" +checksum = "5844e429d797c62945a566f8da4e24c7fe3fbd5d6617fd8bf7a0b7dc1ee0f22e" dependencies = [ "cc", "fs_extra", @@ -11456,9 +11470,9 @@ dependencies = [ [[package]] name = "tikv-jemallocator" -version = "0.5.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20612db8a13a6c06d57ec83953694185a367e16945f66565e8028d2c0bd76979" +checksum = "3c14a5a604eb8715bc5785018a37d00739b180bcf609916ddf4393d33d49ccdf" dependencies = [ "libc", "tikv-jemalloc-sys", @@ -11837,7 +11851,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#73c4f94ce0cb41e35bd7fbc7095590b98a351dbb" +source = "git+https://github.com/paritytech/substrate?branch=master#25795506052363e8b5795eb3526e61ef2a27d89a" dependencies = [ "clap", "frame-try-runtime", diff --git a/Cargo.toml b/Cargo.toml index 0ed0892593d9..ee886dafdc8a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ readme = "README.md" [dependencies] polkadot-cli = { path = "cli", features = [ "kusama-native", "westend-native", "rococo-native" ] } color-eyre = { version = "0.6.1", default-features = false } -parity-util-mem = { version = "0.12.0", default-features = false, features = ["jemalloc-global"] } +parity-util-mem = { version = "0.11.0", default-features = false, features = ["jemalloc-global"] } [dev-dependencies] assert_cmd = "2.0.4" @@ -125,9 +125,9 @@ maintenance = { status = "actively-developed" } # # This list is ordered alphabetically. [profile.dev.package] +blake2b_simd = { opt-level = 3 } blake2 = { opt-level = 3 } blake2-rfc = { opt-level = 3 } -blake2b_simd = { opt-level = 3 } chacha20poly1305 = { opt-level = 3 } cranelift-codegen = { opt-level = 3 } cranelift-wasm = { opt-level = 3 } @@ -138,8 +138,8 @@ curve25519-dalek = { opt-level = 3 } ed25519-dalek = { opt-level = 3 } flate2 = { opt-level = 3 } futures-channel = { opt-level = 3 } -hash-db = { opt-level = 3 } hashbrown = { opt-level = 3 } +hash-db = { opt-level = 3 } hmac = { opt-level = 3 } httparse = { opt-level = 3 } integer-sqrt = { opt-level = 3 } @@ -151,8 +151,8 @@ libz-sys = { opt-level = 3 } mio = { opt-level = 3 } nalgebra = { opt-level = 3 } num-bigint = { opt-level = 3 } -parking_lot = { opt-level = 3 } parking_lot_core = { opt-level = 3 } +parking_lot = { opt-level = 3 } percent-encoding = { opt-level = 3 } primitive-types = { opt-level = 3 } reed-solomon-novelpoly = { opt-level = 3 } @@ -162,7 +162,6 @@ sha2 = { opt-level = 3 } sha3 = { opt-level = 3 } smallvec = { opt-level = 3 } snow = { opt-level = 3 } -substrate-bip39 = {opt-level = 3} twox-hash = { opt-level = 3 } uint = { opt-level = 3 } wasmi = { opt-level = 3 } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 1be1b63c0cfb..1e770cd8715b 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -56,11 +56,7 @@ cli = [ "polkadot-client", "polkadot-node-core-pvf", ] -runtime-benchmarks = [ - "service/runtime-benchmarks", - "polkadot-node-metrics/runtime-benchmarks", - "polkadot-performance-test?/runtime-benchmarks" -] +runtime-benchmarks = ["service/runtime-benchmarks", "polkadot-node-metrics/runtime-benchmarks"] trie-memory-tracker = ["sp-trie/memory-tracker"] full-node = ["service/full-node"] try-runtime = ["service/try-runtime"] diff --git a/core-primitives/Cargo.toml b/core-primitives/Cargo.toml index a10b80b0c30f..9bbe8f516afb 100644 --- a/core-primitives/Cargo.toml +++ b/core-primitives/Cargo.toml @@ -10,7 +10,7 @@ sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", d sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } parity-scale-codec = { version = "3.1.5", default-features = false, features = [ "derive" ] } -parity-util-mem = { version = "0.12.0", default-features = false, optional = true } +parity-util-mem = { version = "0.11.0", default-features = false, optional = true } [features] default = [ "std" ] diff --git a/node/core/approval-voting/Cargo.toml b/node/core/approval-voting/Cargo.toml index 25fb51eb712b..f2572cac8232 100644 --- a/node/core/approval-voting/Cargo.toml +++ b/node/core/approval-voting/Cargo.toml @@ -10,10 +10,10 @@ futures-timer = "3.0.2" parity-scale-codec = { version = "3.1.5", default-features = false, features = ["bit-vec", "derive"] } gum = { package = "tracing-gum", path = "../../gum" } bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } -lru = "0.8" +lru = "0.7" merlin = "2.0" schnorrkel = "0.9.1" -kvdb = "0.12.0" +kvdb = "0.11.0" derive_more = "0.99.17" thiserror = "1.0.31" @@ -40,5 +40,5 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } assert_matches = "1.4.0" -kvdb-memorydb = "0.12.0" +kvdb-memorydb = "0.11.0" test-helpers = { package = "polkadot-primitives-test-helpers", path = "../../../primitives/test-helpers" } diff --git a/node/core/approval-voting/src/import.rs b/node/core/approval-voting/src/import.rs index 5413c271e0d6..d43bf40546ae 100644 --- a/node/core/approval-voting/src/import.rs +++ b/node/core/approval-voting/src/import.rs @@ -1296,38 +1296,6 @@ pub(crate) mod tests { } ); - // Caching of sesssions needs sessoion of first unfinalied block. - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( - s_tx, - )) => { - let _ = s_tx.send(Ok(header.number)); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( - block_number, - s_tx, - )) => { - assert_eq!(block_number, header.number); - let _ = s_tx.send(Ok(Some(header.hash()))); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionIndexForChild(s_tx), - )) => { - assert_eq!(h, header.hash()); - let _ = s_tx.send(Ok(session)); - } - ); - // determine_new_blocks exits early as the parent_hash is in the DB assert_matches!( diff --git a/node/core/approval-voting/src/lib.rs b/node/core/approval-voting/src/lib.rs index 467d8be612e9..ac025f366ab7 100644 --- a/node/core/approval-voting/src/lib.rs +++ b/node/core/approval-voting/src/lib.rs @@ -70,7 +70,6 @@ use std::{ collections::{ btree_map::Entry as BTMEntry, hash_map::Entry as HMEntry, BTreeMap, HashMap, HashSet, }, - num::NonZeroUsize, sync::Arc, time::Duration, }; @@ -105,11 +104,7 @@ const APPROVAL_CHECKING_TIMEOUT: Duration = Duration::from_secs(120); /// Value rather arbitrarily: Should not be hit in practice, it exists to more easily diagnose dead /// lock issues for example. const WAIT_FOR_SIGS_TIMEOUT: Duration = Duration::from_millis(500); -const APPROVAL_CACHE_SIZE: NonZeroUsize = match NonZeroUsize::new(1024) { - Some(cap) => cap, - None => panic!("Approval cache size must be non-zero."), -}; - +const APPROVAL_CACHE_SIZE: usize = 1024; const TICK_TOO_FAR_IN_FUTURE: Tick = 20; // 10 seconds. const APPROVAL_DELAY: Tick = 2; const LOG_TARGET: &str = "parachain::approval-voting"; diff --git a/node/core/approval-voting/src/tests.rs b/node/core/approval-voting/src/tests.rs index bdb7a8c929b3..66d1402ed6dc 100644 --- a/node/core/approval-voting/src/tests.rs +++ b/node/core/approval-voting/src/tests.rs @@ -807,37 +807,6 @@ async fn import_block( } ); - assert_matches!( - overseer_recv(overseer).await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( - s_tx, - )) => { - let _ = s_tx.send(Ok(number)); - } - ); - - assert_matches!( - overseer_recv(overseer).await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( - block_number, - s_tx, - )) => { - assert_eq!(block_number, number); - let _ = s_tx.send(Ok(Some(hashes[number as usize].0))); - } - ); - - assert_matches!( - overseer_recv(overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionIndexForChild(s_tx), - )) => { - assert_eq!(h, hashes[number as usize].0); - let _ = s_tx.send(Ok(number.into())); - } - ); - if !fork { assert_matches!( overseer_recv(overseer).await, diff --git a/node/core/av-store/Cargo.toml b/node/core/av-store/Cargo.toml index 4cec2cb637b9..9cea9f1bdc24 100644 --- a/node/core/av-store/Cargo.toml +++ b/node/core/av-store/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] futures = "0.3.21" futures-timer = "3.0.2" -kvdb = "0.12.0" +kvdb = "0.11.0" thiserror = "1.0.31" gum = { package = "tracing-gum", path = "../../gum" } bitvec = "1.0.0" @@ -24,7 +24,7 @@ polkadot-node-primitives = { path = "../../primitives" } log = "0.4.17" env_logger = "0.9.0" assert_matches = "1.4.0" -kvdb-memorydb = "0.12.0" +kvdb-memorydb = "0.11.0" sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } diff --git a/node/core/av-store/src/lib.rs b/node/core/av-store/src/lib.rs index 4fbbf3740ab0..cd1685e32ea8 100644 --- a/node/core/av-store/src/lib.rs +++ b/node/core/av-store/src/lib.rs @@ -792,9 +792,8 @@ fn note_block_included( macro_rules! peek_num { ($iter:ident) => { match $iter.peek() { - Some(Ok((k, _))) => Ok(decode_unfinalized_key(&k[..]).ok().map(|(b, _, _)| b)), - Some(Err(_)) => Err($iter.next().expect("peek returned Some(Err); qed").unwrap_err()), - None => Ok(None), + Some((k, _)) => decode_unfinalized_key(&k[..]).ok().map(|(b, _, _)| b), + None => None, } }; } @@ -820,10 +819,10 @@ async fn process_block_finalized( let mut iter = subsystem .db .iter_with_prefix(subsystem.config.col_meta, &start_prefix) - .take_while(|r| r.as_ref().map_or(true, |(k, _v)| &k[..] < &end_prefix[..])) + .take_while(|(k, _)| &k[..] < &end_prefix[..]) .peekable(); - match peek_num!(iter)? { + match peek_num!(iter) { None => break, // end of iterator. Some(n) => n, } @@ -868,10 +867,10 @@ async fn process_block_finalized( let iter = subsystem .db .iter_with_prefix(subsystem.config.col_meta, &start_prefix) - .take_while(|r| r.as_ref().map_or(true, |(k, _v)| &k[..] < &end_prefix[..])) + .take_while(|(k, _)| &k[..] < &end_prefix[..]) .peekable(); - let batch = load_all_at_finalized_height(iter, batch_num, batch_finalized_hash)?; + let batch = load_all_at_finalized_height(iter, batch_num, batch_finalized_hash); // Now that we've iterated over the entire batch at this finalized height, // update the meta. @@ -891,22 +890,22 @@ async fn process_block_finalized( // loads all candidates at the finalized height and maps them to `true` if finalized // and `false` if unfinalized. fn load_all_at_finalized_height( - mut iter: std::iter::Peekable>>, + mut iter: std::iter::Peekable, Box<[u8]>)>>, block_number: BlockNumber, finalized_hash: Hash, -) -> io::Result> { +) -> impl IntoIterator { // maps candidate hashes to true if finalized, false otherwise. let mut candidates = HashMap::new(); // Load all candidates that were included at this height. loop { - match peek_num!(iter)? { + match peek_num!(iter) { None => break, // end of iterator. Some(n) if n != block_number => break, // end of batch. _ => {}, } - let (k, _v) = iter.next().expect("`peek` used to check non-empty; qed")?; + let (k, _v) = iter.next().expect("`peek` used to check non-empty; qed"); let (_, block_hash, candidate_hash) = decode_unfinalized_key(&k[..]).expect("`peek_num` checks validity of key; qed"); @@ -917,7 +916,7 @@ fn load_all_at_finalized_height( } } - Ok(candidates) + candidates } fn update_blocks_at_finalized_height( @@ -1215,10 +1214,9 @@ fn prune_all(db: &Arc, config: &Config, clock: &dyn Clock) -> Resu let mut tx = DBTransaction::new(); let iter = db .iter_with_prefix(config.col_meta, &range_start[..]) - .take_while(|r| r.as_ref().map_or(true, |(k, _v)| &k[..] < &range_end[..])); + .take_while(|(k, _)| &k[..] < &range_end[..]); - for r in iter { - let (k, _v) = r?; + for (k, _v) in iter { tx.delete(config.col_meta, &k[..]); let (_, candidate_hash) = match decode_pruning_key(&k[..]) { diff --git a/node/core/chain-selection/Cargo.toml b/node/core/chain-selection/Cargo.toml index df6a5c24f10e..8d9875b6f389 100644 --- a/node/core/chain-selection/Cargo.toml +++ b/node/core/chain-selection/Cargo.toml @@ -13,7 +13,7 @@ polkadot-primitives = { path = "../../../primitives" } polkadot-node-primitives = { path = "../../primitives" } polkadot-node-subsystem = { path = "../../subsystem" } polkadot-node-subsystem-util = { path = "../../subsystem-util" } -kvdb = "0.12.0" +kvdb = "0.11.0" thiserror = "1.0.31" parity-scale-codec = "3.1.5" @@ -22,4 +22,4 @@ polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } parking_lot = "0.12.0" assert_matches = "1" -kvdb-memorydb = "0.12.0" +kvdb-memorydb = "0.11.0" diff --git a/node/core/chain-selection/src/db_backend/v1.rs b/node/core/chain-selection/src/db_backend/v1.rs index a037d27baaea..db117ff945df 100644 --- a/node/core/chain-selection/src/db_backend/v1.rs +++ b/node/core/chain-selection/src/db_backend/v1.rs @@ -235,21 +235,16 @@ impl Backend for DbBackend { self.inner.iter_with_prefix(self.config.col_data, &STAGNANT_AT_PREFIX[..]); let val = stagnant_at_iter - .filter_map(|r| match r { - Ok((k, v)) => - match (decode_stagnant_at_key(&mut &k[..]), >::decode(&mut &v[..]).ok()) - { - (Some(at), Some(stagnant_at)) => Some(Ok((at, stagnant_at))), - _ => None, - }, - Err(e) => Some(Err(e)), + .filter_map(|(k, v)| { + match (decode_stagnant_at_key(&mut &k[..]), >::decode(&mut &v[..]).ok()) { + (Some(at), Some(stagnant_at)) => Some((at, stagnant_at)), + _ => None, + } }) .enumerate() - .take_while(|(idx, r)| { - r.as_ref().map_or(true, |(at, _)| *at <= up_to.into() && *idx < max_elements) - }) + .take_while(|(idx, (at, _))| *at <= up_to.into() && *idx < max_elements) .map(|(_, v)| v) - .collect::, _>>()?; + .collect::>(); Ok(val) } @@ -259,13 +254,10 @@ impl Backend for DbBackend { self.inner.iter_with_prefix(self.config.col_data, &BLOCK_HEIGHT_PREFIX[..]); let val = blocks_at_height_iter - .filter_map(|r| match r { - Ok((k, _)) => decode_block_height_key(&k[..]).map(Ok), - Err(e) => Some(Err(e)), - }) + .filter_map(|(k, _)| decode_block_height_key(&k[..])) .next(); - val.transpose().map_err(Error::from) + Ok(val) } fn load_blocks_by_number(&self, number: BlockNumber) -> Result, Error> { diff --git a/node/core/dispute-coordinator/Cargo.toml b/node/core/dispute-coordinator/Cargo.toml index fd89b599f63c..bc22b40c8529 100644 --- a/node/core/dispute-coordinator/Cargo.toml +++ b/node/core/dispute-coordinator/Cargo.toml @@ -8,9 +8,9 @@ edition = "2021" futures = "0.3.21" gum = { package = "tracing-gum", path = "../../gum" } parity-scale-codec = "3.1.5" -kvdb = "0.12.0" +kvdb = "0.11.0" thiserror = "1.0.31" -lru = "0.8.0" +lru = "0.7.7" fatality = "0.0.6" polkadot-primitives = { path = "../../../primitives" } @@ -22,7 +22,7 @@ sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "maste [dev-dependencies] -kvdb-memorydb = "0.12.0" +kvdb-memorydb = "0.11.0" polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" } sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/core/dispute-coordinator/src/scraping/mod.rs b/node/core/dispute-coordinator/src/scraping/mod.rs index 7d5d33e1ff4b..b45dbfa95197 100644 --- a/node/core/dispute-coordinator/src/scraping/mod.rs +++ b/node/core/dispute-coordinator/src/scraping/mod.rs @@ -14,10 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::{ - collections::{BTreeMap, HashSet}, - num::NonZeroUsize, -}; +use std::collections::{BTreeMap, HashSet}; use futures::channel::oneshot; use lru::LruCache; @@ -47,10 +44,7 @@ mod tests; /// `last_observed_blocks` LRU. This means, this value should the very least be as large as the /// number of expected forks for keeping chain scraping efficient. Making the LRU much larger than /// that has very limited use. -const LRU_OBSERVED_BLOCKS_CAPACITY: NonZeroUsize = match NonZeroUsize::new(20) { - Some(cap) => cap, - None => panic!("Observed blocks cache size must be non-zero"), -}; +const LRU_OBSERVED_BLOCKS_CAPACITY: usize = 20; /// Chain scraper /// diff --git a/node/core/dispute-coordinator/src/tests.rs b/node/core/dispute-coordinator/src/tests.rs index aaef00999259..ff85319599ce 100644 --- a/node/core/dispute-coordinator/src/tests.rs +++ b/node/core/dispute-coordinator/src/tests.rs @@ -239,15 +239,13 @@ impl TestState { ))) .await; - self.handle_sync_queries(virtual_overseer, block_hash, block_number, session) - .await; + self.handle_sync_queries(virtual_overseer, block_hash, session).await; } async fn handle_sync_queries( &mut self, virtual_overseer: &mut VirtualOverseer, block_hash: Hash, - block_number: BlockNumber, session: SessionIndex, ) { // Order of messages is not fixed (different on initializing): @@ -280,45 +278,11 @@ impl TestState { finished_steps.got_session_information = true; assert_eq!(h, block_hash); let _ = tx.send(Ok(session)); - - // Queries for fetching earliest unfinalized block session. See `RollingSessionWindow`. - assert_matches!( - overseer_recv(virtual_overseer).await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( - s_tx, - )) => { - let _ = s_tx.send(Ok(block_number)); - } - ); - - assert_matches!( - overseer_recv(virtual_overseer).await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( - number, - s_tx, - )) => { - assert_eq!(block_number, number); - let _ = s_tx.send(Ok(Some(block_hash))); - } - ); - - assert_matches!( - overseer_recv(virtual_overseer).await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionIndexForChild(s_tx), - )) => { - assert_eq!(h, block_hash); - let _ = s_tx.send(Ok(session)); - } - ); - // No queries, if subsystem knows about this session already. if self.known_session == Some(session) { continue } self.known_session = Some(session); - loop { // answer session info queries until the current session is reached. assert_matches!( @@ -397,8 +361,7 @@ impl TestState { ))) .await; - self.handle_sync_queries(virtual_overseer, *leaf, n as BlockNumber, session) - .await; + self.handle_sync_queries(virtual_overseer, *leaf, session).await; } } diff --git a/node/core/runtime-api/Cargo.toml b/node/core/runtime-api/Cargo.toml index b7a9895e0c67..9ef6af06c5c2 100644 --- a/node/core/runtime-api/Cargo.toml +++ b/node/core/runtime-api/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" futures = "0.3.21" gum = { package = "tracing-gum", path = "../../gum" } memory-lru = "0.1.1" -parity-util-mem = { version = "0.12.0", default-features = false } +parity-util-mem = { version = "0.11.0", default-features = false } sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/node/malus/Cargo.toml b/node/malus/Cargo.toml index 9548857a03ed..b68adef1a1df 100644 --- a/node/malus/Cargo.toml +++ b/node/malus/Cargo.toml @@ -23,7 +23,7 @@ polkadot-node-core-backing = { path = "../core/backing" } polkadot-node-primitives = { path = "../primitives" } polkadot-primitives = { path = "../../primitives" } polkadot-node-core-pvf = { path = "../core/pvf" } -parity-util-mem = { version = "0.12.0", default-features = false, features = ["jemalloc-global"] } +parity-util-mem = { version = "0.11.0", default-features = false, features = ["jemalloc-global"] } color-eyre = { version = "0.6.1", default-features = false } assert_matches = "1.5" async-trait = "0.1.57" diff --git a/node/metrics/src/tests.rs b/node/metrics/src/tests.rs index 932cc7b68be7..56e07d96280d 100644 --- a/node/metrics/src/tests.rs +++ b/node/metrics/src/tests.rs @@ -92,11 +92,16 @@ async fn scrape_prometheus_metrics(metrics_uri: &str) -> HashMap { .expect("Scraper failed to parse Prometheus metrics") .samples .into_iter() - .filter_map(|prometheus_parse::Sample { metric, value, .. }| match value { - prometheus_parse::Value::Counter(value) => Some((metric, value as u64)), - prometheus_parse::Value::Gauge(value) => Some((metric, value as u64)), - prometheus_parse::Value::Untyped(value) => Some((metric, value as u64)), - _ => None, + .map(|sample| { + ( + sample.metric.to_owned(), + match sample.value { + prometheus_parse::Value::Counter(value) => value as u64, + prometheus_parse::Value::Gauge(value) => value as u64, + prometheus_parse::Value::Untyped(value) => value as u64, + _ => unreachable!("unexpected metric type"), + }, + ) }) .collect() } diff --git a/node/network/availability-distribution/Cargo.toml b/node/network/availability-distribution/Cargo.toml index 3e8626c18898..43d56a1ace24 100644 --- a/node/network/availability-distribution/Cargo.toml +++ b/node/network/availability-distribution/Cargo.toml @@ -19,7 +19,7 @@ sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "maste thiserror = "1.0.31" rand = "0.8.5" derive_more = "0.99.17" -lru = "0.8.0" +lru = "0.7.7" fatality = "0.0.6" [dev-dependencies] diff --git a/node/network/availability-distribution/src/requester/session_cache.rs b/node/network/availability-distribution/src/requester/session_cache.rs index cf01e448b70b..6d41d9301233 100644 --- a/node/network/availability-distribution/src/requester/session_cache.rs +++ b/node/network/availability-distribution/src/requester/session_cache.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::{collections::HashSet, num::NonZeroUsize}; +use std::collections::HashSet; use lru::LruCache; use rand::{seq::SliceRandom, thread_rng}; @@ -85,7 +85,7 @@ impl SessionCache { pub fn new() -> Self { SessionCache { // We need to cache the current and the last session the most: - session_info_cache: LruCache::new(NonZeroUsize::new(2).unwrap()), + session_info_cache: LruCache::new(2), } } diff --git a/node/network/availability-recovery/Cargo.toml b/node/network/availability-recovery/Cargo.toml index 86f6237740fa..fce9755a05a3 100644 --- a/node/network/availability-recovery/Cargo.toml +++ b/node/network/availability-recovery/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] futures = "0.3.21" -lru = "0.8.0" +lru = "0.7.7" rand = "0.8.5" fatality = "0.0.6" thiserror = "1.0.31" diff --git a/node/network/availability-recovery/src/lib.rs b/node/network/availability-recovery/src/lib.rs index f2f92cc54490..62401e3ad615 100644 --- a/node/network/availability-recovery/src/lib.rs +++ b/node/network/availability-recovery/src/lib.rs @@ -20,7 +20,6 @@ use std::{ collections::{HashMap, VecDeque}, - num::NonZeroUsize, pin::Pin, time::Duration, }; @@ -78,10 +77,7 @@ const LOG_TARGET: &str = "parachain::availability-recovery"; const N_PARALLEL: usize = 50; // Size of the LRU cache where we keep recovered data. -const LRU_SIZE: NonZeroUsize = match NonZeroUsize::new(16) { - Some(cap) => cap, - None => panic!("Availability-recovery cache size must be non-zero."), -}; +const LRU_SIZE: usize = 16; const COST_INVALID_REQUEST: Rep = Rep::CostMajor("Peer sent unparsable request"); diff --git a/node/network/collator-protocol/Cargo.toml b/node/network/collator-protocol/Cargo.toml index e089719106b5..df9e75c9e951 100644 --- a/node/network/collator-protocol/Cargo.toml +++ b/node/network/collator-protocol/Cargo.toml @@ -6,7 +6,6 @@ edition = "2021" [dependencies] always-assert = "0.1.2" -bitvec = { version = "1.0.1", default-features = false, features = ["alloc"] } futures = "0.3.21" futures-timer = "3" gum = { package = "tracing-gum", path = "../../gum" } diff --git a/node/network/collator-protocol/src/collator_side/metrics.rs b/node/network/collator-protocol/src/collator_side/metrics.rs deleted file mode 100644 index 85e00406b9ba..000000000000 --- a/node/network/collator-protocol/src/collator_side/metrics.rs +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright 2017-2022 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 . - -use polkadot_node_subsystem_util::metrics::{self, prometheus}; - -#[derive(Clone, Default)] -pub struct Metrics(Option); - -impl Metrics { - pub fn on_advertisment_made(&self) { - if let Some(metrics) = &self.0 { - metrics.advertisements_made.inc(); - } - } - - pub fn on_collation_sent_requested(&self) { - if let Some(metrics) = &self.0 { - metrics.collations_send_requested.inc(); - } - } - - pub fn on_collation_sent(&self) { - if let Some(metrics) = &self.0 { - metrics.collations_sent.inc(); - } - } - - /// Provide a timer for `process_msg` which observes on drop. - pub fn time_process_msg(&self) -> Option { - self.0.as_ref().map(|metrics| metrics.process_msg.start_timer()) - } - - /// Provide a timer for `distribute_collation` which observes on drop. - pub fn time_collation_distribution( - &self, - label: &'static str, - ) -> Option { - self.0.as_ref().map(|metrics| { - metrics.collation_distribution_time.with_label_values(&[label]).start_timer() - }) - } -} - -#[derive(Clone)] -struct MetricsInner { - advertisements_made: prometheus::Counter, - collations_sent: prometheus::Counter, - collations_send_requested: prometheus::Counter, - process_msg: prometheus::Histogram, - collation_distribution_time: prometheus::HistogramVec, -} - -impl metrics::Metrics for Metrics { - fn try_register( - registry: &prometheus::Registry, - ) -> std::result::Result { - let metrics = MetricsInner { - advertisements_made: prometheus::register( - prometheus::Counter::new( - "polkadot_parachain_collation_advertisements_made_total", - "A number of collation advertisements sent to validators.", - )?, - registry, - )?, - collations_send_requested: prometheus::register( - prometheus::Counter::new( - "polkadot_parachain_collations_sent_requested_total", - "A number of collations requested to be sent to validators.", - )?, - registry, - )?, - collations_sent: prometheus::register( - prometheus::Counter::new( - "polkadot_parachain_collations_sent_total", - "A number of collations sent to validators.", - )?, - registry, - )?, - process_msg: prometheus::register( - prometheus::Histogram::with_opts( - prometheus::HistogramOpts::new( - "polkadot_parachain_collator_protocol_collator_process_msg", - "Time spent within `collator_protocol_collator::process_msg`", - ) - .buckets(vec![ - 0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.35, 0.5, 0.75, - 1.0, - ]), - )?, - registry, - )?, - collation_distribution_time: prometheus::register( - prometheus::HistogramVec::new( - prometheus::HistogramOpts::new( - "polkadot_parachain_collator_protocol_collator_distribution_time", - "Time spent within `collator_protocol_collator::distribute_collation`", - ) - .buckets(vec![ - 0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.35, 0.5, 0.75, - 1.0, - ]), - &["state"], - )?, - registry, - )?, - }; - - Ok(Metrics(Some(metrics))) - } -} diff --git a/node/network/collator-protocol/src/collator_side/mod.rs b/node/network/collator-protocol/src/collator_side/mod.rs index 4f2eea2ca747..c1a20a2a670b 100644 --- a/node/network/collator-protocol/src/collator_side/mod.rs +++ b/node/network/collator-protocol/src/collator_side/mod.rs @@ -17,7 +17,7 @@ use std::{ collections::{HashMap, HashSet, VecDeque}, pin::Pin, - time::{Duration, Instant}, + time::Duration, }; use futures::{ @@ -44,25 +44,19 @@ use polkadot_node_subsystem::{ overseer, FromOrchestra, OverseerSignal, PerLeafSpan, }; use polkadot_node_subsystem_util::{ + metrics::{self, prometheus}, runtime::{get_availability_cores, get_group_rotation_info, RuntimeInfo}, TimeoutExt, }; use polkadot_primitives::v2::{ AuthorityDiscoveryId, CandidateHash, CandidateReceipt, CollatorPair, CoreIndex, CoreState, - GroupIndex, Hash, Id as ParaId, SessionIndex, + Hash, Id as ParaId, }; use super::LOG_TARGET; use crate::error::{log_error, Error, FatalError, Result}; use fatality::Split; -mod metrics; -mod validators_buffer; - -use validators_buffer::{ValidatorGroupsBuffer, VALIDATORS_BUFFER_CAPACITY}; - -pub use metrics::Metrics; - #[cfg(test)] mod tests; @@ -79,16 +73,111 @@ const COST_APPARENT_FLOOD: Rep = /// For considerations on this value, see: https://github.com/paritytech/polkadot/issues/4386 const MAX_UNSHARED_UPLOAD_TIME: Duration = Duration::from_millis(150); -/// Ensure that collator issues a connection request at least once every this many seconds. -/// Usually it's done when advertising new collation. However, if the core stays occupied or -/// it's not our turn to produce a candidate, it's important to disconnect from previous -/// peers. -/// -/// Validators are obtained from [`ValidatorGroupsBuffer::validators_to_connect`]. -const RECONNECT_TIMEOUT: Duration = Duration::from_secs(12); +#[derive(Clone, Default)] +pub struct Metrics(Option); + +impl Metrics { + fn on_advertisment_made(&self) { + if let Some(metrics) = &self.0 { + metrics.advertisements_made.inc(); + } + } + + fn on_collation_sent_requested(&self) { + if let Some(metrics) = &self.0 { + metrics.collations_send_requested.inc(); + } + } + + fn on_collation_sent(&self) { + if let Some(metrics) = &self.0 { + metrics.collations_sent.inc(); + } + } + + /// Provide a timer for `process_msg` which observes on drop. + fn time_process_msg(&self) -> Option { + self.0.as_ref().map(|metrics| metrics.process_msg.start_timer()) + } -/// How often to check for reconnect timeout. -const RECONNECT_POLL: Duration = Duration::from_secs(1); + /// Provide a timer for `distribute_collation` which observes on drop. + fn time_collation_distribution( + &self, + label: &'static str, + ) -> Option { + self.0.as_ref().map(|metrics| { + metrics.collation_distribution_time.with_label_values(&[label]).start_timer() + }) + } +} + +#[derive(Clone)] +struct MetricsInner { + advertisements_made: prometheus::Counter, + collations_sent: prometheus::Counter, + collations_send_requested: prometheus::Counter, + process_msg: prometheus::Histogram, + collation_distribution_time: prometheus::HistogramVec, +} + +impl metrics::Metrics for Metrics { + fn try_register( + registry: &prometheus::Registry, + ) -> std::result::Result { + let metrics = MetricsInner { + advertisements_made: prometheus::register( + prometheus::Counter::new( + "polkadot_parachain_collation_advertisements_made_total", + "A number of collation advertisements sent to validators.", + )?, + registry, + )?, + collations_send_requested: prometheus::register( + prometheus::Counter::new( + "polkadot_parachain_collations_sent_requested_total", + "A number of collations requested to be sent to validators.", + )?, + registry, + )?, + collations_sent: prometheus::register( + prometheus::Counter::new( + "polkadot_parachain_collations_sent_total", + "A number of collations sent to validators.", + )?, + registry, + )?, + process_msg: prometheus::register( + prometheus::Histogram::with_opts( + prometheus::HistogramOpts::new( + "polkadot_parachain_collator_protocol_collator_process_msg", + "Time spent within `collator_protocol_collator::process_msg`", + ) + .buckets(vec![ + 0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.35, 0.5, 0.75, + 1.0, + ]), + )?, + registry, + )?, + collation_distribution_time: prometheus::register( + prometheus::HistogramVec::new( + prometheus::HistogramOpts::new( + "polkadot_parachain_collator_protocol_collator_distribution_time", + "Time spent within `collator_protocol_collator::distribute_collation`", + ) + .buckets(vec![ + 0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.15, 0.25, 0.35, 0.5, 0.75, + 1.0, + ]), + &["state"], + )?, + registry, + )?, + }; + + Ok(Metrics(Some(metrics))) + } +} /// Info about validators we are currently connected to. /// @@ -180,14 +269,8 @@ struct WaitingCollationFetches { waiting_peers: HashSet, } -struct CollationSendResult { - relay_parent: Hash, - peer_id: PeerId, - timed_out: bool, -} - type ActiveCollationFetches = - FuturesUnordered + Send + 'static>>>; + FuturesUnordered + Send + 'static>>>; struct State { /// Our network peer id. @@ -225,13 +308,6 @@ struct State { /// by `PeerConnected` events. peer_ids: HashMap>, - /// Tracks which validators we want to stay connected to. - validator_groups_buf: ValidatorGroupsBuffer, - - /// Timestamp of the last connection request to a non-empty list of validators, - /// `None` otherwise. - last_connected_at: Option, - /// Metrics. metrics: Metrics, @@ -263,8 +339,6 @@ impl State { collation_result_senders: Default::default(), our_validators_groups: Default::default(), peer_ids: Default::default(), - validator_groups_buf: ValidatorGroupsBuffer::with_capacity(VALIDATORS_BUFFER_CAPACITY), - last_connected_at: None, waiting_collation_fetches: Default::default(), active_collation_fetches: Default::default(), } @@ -299,7 +373,6 @@ async fn distribute_collation( result_sender: Option>, ) -> Result<()> { let relay_parent = receipt.descriptor.relay_parent; - let candidate_hash = receipt.hash(); // This collation is not in the active-leaves set. if !state.view.contains(&relay_parent) { @@ -339,10 +412,10 @@ async fn distribute_collation( }; // Determine the group on that core. - let GroupValidators { validators, session_index, group_index } = + let current_validators = determine_our_validators(ctx, runtime, our_core, num_cores, relay_parent).await?; - if validators.is_empty() { + if current_validators.validators.is_empty() { gum::warn!( target: LOG_TARGET, core = ?our_core, @@ -352,36 +425,24 @@ async fn distribute_collation( return Ok(()) } - // It's important to insert new collation bits **before** - // issuing a connection request. - // - // If a validator managed to fetch all the relevant collations - // but still assigned to our core, we keep the connection alive. - state.validator_groups_buf.note_collation_advertised( - relay_parent, - session_index, - group_index, - &validators, - ); - gum::debug!( target: LOG_TARGET, para_id = %id, relay_parent = %relay_parent, - ?candidate_hash, + candidate_hash = ?receipt.hash(), pov_hash = ?pov.hash(), core = ?our_core, - current_validators = ?validators, + ?current_validators, "Accepted collation, connecting to validators." ); - // Update a set of connected validators if necessary. - state.last_connected_at = connect_to_validators(ctx, &state.validator_groups_buf).await; + // Issue a discovery request for the validators of the current group: + connect_to_validators(ctx, current_validators.validators.into_iter().collect()).await; state.our_validators_groups.insert(relay_parent, ValidatorGroup::new()); if let Some(result_sender) = result_sender { - state.collation_result_senders.insert(candidate_hash, result_sender); + state.collation_result_senders.insert(receipt.hash(), result_sender); } state @@ -422,9 +483,6 @@ async fn determine_core( struct GroupValidators { /// The validators of above group (their discovery keys). validators: Vec, - - session_index: SessionIndex, - group_index: GroupIndex, } /// Figure out current group of validators assigned to the para being collated on. @@ -458,11 +516,7 @@ async fn determine_our_validators( let current_validators = current_validators.iter().map(|i| validators[i.0 as usize].clone()).collect(); - let current_validators = GroupValidators { - validators: current_validators, - session_index, - group_index: current_group_index, - }; + let current_validators = GroupValidators { validators: current_validators }; Ok(current_validators) } @@ -487,19 +541,13 @@ async fn declare(ctx: &mut Context, state: &mut State, peer: PeerId) { } } -/// Updates a set of connected validators based on their advertisement-bits -/// in a validators buffer. -/// -/// Returns current timestamp if the connection request was non-empty, `None` -/// otherwise. +/// Issue a connection request to a set of validators and +/// revoke the previous connection request. #[overseer::contextbounds(CollatorProtocol, prefix = self::overseer)] async fn connect_to_validators( ctx: &mut Context, - validator_groups_buf: &ValidatorGroupsBuffer, -) -> Option { - let validator_ids = validator_groups_buf.validators_to_connect(); - let is_disconnect = validator_ids.is_empty(); - + validator_ids: Vec, +) { // ignore address resolution failure // will reissue a new request on new collation let (failed, _) = oneshot::channel(); @@ -509,8 +557,6 @@ async fn connect_to_validators( failed, }) .await; - - (!is_disconnect).then_some(Instant::now()) } /// Advertise collation to the given `peer`. @@ -669,9 +715,15 @@ async fn send_collation( state.active_collation_fetches.push( async move { let r = rx.timeout(MAX_UNSHARED_UPLOAD_TIME).await; - let timed_out = r.is_none(); - - CollationSendResult { relay_parent, peer_id, timed_out } + if r.is_none() { + gum::debug!( + target: LOG_TARGET, + ?relay_parent, + ?peer_id, + "Sending collation to validator timed out, carrying on with next validator." + ); + } + (relay_parent, peer_id) } .boxed(), ); @@ -934,7 +986,6 @@ async fn handle_our_view_change(state: &mut State, view: OurView) -> Result<()> state.our_validators_groups.remove(removed); state.span_per_relay_parent.remove(removed); state.waiting_collation_fetches.remove(removed); - state.validator_groups_buf.remove_relay_parent(removed); } state.view = view; @@ -956,9 +1007,6 @@ pub(crate) async fn run( let mut state = State::new(local_peer_id, collator_pair, metrics); let mut runtime = RuntimeInfo::new(None); - let reconnect_stream = super::tick_stream(RECONNECT_POLL); - pin_mut!(reconnect_stream); - loop { let recv_req = req_receiver.recv(|| vec![COST_INVALID_REQUEST]).fuse(); pin_mut!(recv_req); @@ -974,25 +1022,7 @@ pub(crate) async fn run( FromOrchestra::Signal(BlockFinalized(..)) => {} FromOrchestra::Signal(Conclude) => return Ok(()), }, - CollationSendResult { - relay_parent, - peer_id, - timed_out, - } = state.active_collation_fetches.select_next_some() => { - if timed_out { - gum::debug!( - target: LOG_TARGET, - ?relay_parent, - ?peer_id, - "Sending collation to validator timed out, carrying on with next validator", - ); - } else { - for authority_id in state.peer_ids.get(&peer_id).into_iter().flatten() { - // Timeout not hit, this peer is no longer interested in this relay parent. - state.validator_groups_buf.reset_validator_interest(relay_parent, authority_id); - } - } - + (relay_parent, peer_id) = state.active_collation_fetches.select_next_some() => { let next = if let Some(waiting) = state.waiting_collation_fetches.get_mut(&relay_parent) { waiting.waiting_peers.remove(&peer_id); if let Some(next) = waiting.waiting.pop_front() { @@ -1012,29 +1042,7 @@ pub(crate) async fn run( send_collation(&mut state, next, receipt, pov).await; } - }, - _ = reconnect_stream.next() => { - let now = Instant::now(); - if state - .last_connected_at - .map_or(false, |timestamp| now - timestamp > RECONNECT_TIMEOUT) - { - // Remove all advertisements from the buffer if the timeout was hit. - // Usually, it shouldn't be necessary as leaves get deactivated, rather - // serves as a safeguard against finality lags. - state.validator_groups_buf.clear_advertisements(); - // Returns `None` if connection request is empty. - state.last_connected_at = - connect_to_validators(&mut ctx, &state.validator_groups_buf).await; - - gum::debug!( - target: LOG_TARGET, - timeout = ?RECONNECT_TIMEOUT, - "Timeout hit, sent a connection request. Disconnected from all validators = {}", - state.last_connected_at.is_none(), - ); - } - }, + } in_req = recv_req => { match in_req { Ok(req) => { diff --git a/node/network/collator-protocol/src/collator_side/tests.rs b/node/network/collator-protocol/src/collator_side/tests.rs index c20a2d6c97a5..2d2f2cf043de 100644 --- a/node/network/collator-protocol/src/collator_side/tests.rs +++ b/node/network/collator-protocol/src/collator_side/tests.rs @@ -56,7 +56,7 @@ struct TestState { group_rotation_info: GroupRotationInfo, validator_peer_id: Vec, relay_parent: Hash, - availability_cores: Vec, + availability_core: CoreState, local_peer_id: PeerId, collator_pair: CollatorPair, session_index: SessionIndex, @@ -88,15 +88,14 @@ impl Default for TestState { let validator_peer_id = std::iter::repeat_with(|| PeerId::random()).take(discovery_keys.len()).collect(); - let validator_groups = vec![vec![2, 0, 4], vec![1, 3]] + let validator_groups = vec![vec![2, 0, 4], vec![3, 2, 4]] .into_iter() .map(|g| g.into_iter().map(ValidatorIndex).collect()) .collect(); let group_rotation_info = GroupRotationInfo { session_start_block: 0, group_rotation_frequency: 100, now: 1 }; - let availability_cores = - vec![CoreState::Scheduled(ScheduledCore { para_id, collator: None }), CoreState::Free]; + let availability_core = CoreState::Scheduled(ScheduledCore { para_id, collator: None }); let relay_parent = Hash::random(); @@ -123,7 +122,7 @@ impl Default for TestState { group_rotation_info, validator_peer_id, relay_parent, - availability_cores, + availability_core, local_peer_id, collator_pair, session_index: 1, @@ -133,9 +132,7 @@ impl Default for TestState { impl TestState { fn current_group_validator_indices(&self) -> &[ValidatorIndex] { - let core_num = self.availability_cores.len(); - let GroupIndex(group_idx) = self.group_rotation_info.group_for_core(CoreIndex(0), core_num); - &self.session_info.validator_groups[group_idx as usize] + &self.session_info.validator_groups[0] } fn current_session_index(&self) -> SessionIndex { @@ -336,7 +333,7 @@ async fn distribute_collation( RuntimeApiRequest::AvailabilityCores(tx) )) => { assert_eq!(relay_parent, test_state.relay_parent); - tx.send(Ok(test_state.availability_cores.clone())).unwrap(); + tx.send(Ok(vec![test_state.availability_core.clone()])).unwrap(); } ); @@ -990,104 +987,3 @@ where test_harness }); } - -#[test] -fn connect_to_buffered_groups() { - let mut test_state = TestState::default(); - let local_peer_id = test_state.local_peer_id.clone(); - let collator_pair = test_state.collator_pair.clone(); - - test_harness(local_peer_id, collator_pair, |test_harness| async move { - let mut virtual_overseer = test_harness.virtual_overseer; - let mut req_cfg = test_harness.req_cfg; - - setup_system(&mut virtual_overseer, &test_state).await; - - let group_a = test_state.current_group_validator_authority_ids(); - let peers_a = test_state.current_group_validator_peer_ids(); - assert!(group_a.len() > 1); - - distribute_collation(&mut virtual_overseer, &test_state, false).await; - - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::NetworkBridgeTx( - NetworkBridgeTxMessage::ConnectToValidators { validator_ids, .. } - ) => { - assert_eq!(group_a, validator_ids); - } - ); - - let head_a = test_state.relay_parent; - - for (val, peer) in group_a.iter().zip(&peers_a) { - connect_peer(&mut virtual_overseer, peer.clone(), Some(val.clone())).await; - } - - for peer_id in &peers_a { - expect_declare_msg(&mut virtual_overseer, &test_state, peer_id).await; - } - - // Update views. - for peed_id in &peers_a { - send_peer_view_change(&mut virtual_overseer, peed_id, vec![head_a]).await; - expect_advertise_collation_msg(&mut virtual_overseer, peed_id, head_a).await; - } - - let peer = peers_a[0]; - // Peer from the group fetches the collation. - let (pending_response, rx) = oneshot::channel(); - req_cfg - .inbound_queue - .as_mut() - .unwrap() - .send(RawIncomingRequest { - peer, - payload: CollationFetchingRequest { - relay_parent: head_a, - para_id: test_state.para_id, - } - .encode(), - pending_response, - }) - .await - .unwrap(); - assert_matches!( - rx.await, - Ok(full_response) => { - let CollationFetchingResponse::Collation(..): CollationFetchingResponse = - CollationFetchingResponse::decode( - &mut full_response.result.expect("We should have a proper answer").as_ref(), - ) - .expect("Decoding should work"); - } - ); - - test_state.advance_to_new_round(&mut virtual_overseer, true).await; - test_state.group_rotation_info = test_state.group_rotation_info.bump_rotation(); - - let head_b = test_state.relay_parent; - let group_b = test_state.current_group_validator_authority_ids(); - assert_ne!(head_a, head_b); - assert_ne!(group_a, group_b); - - distribute_collation(&mut virtual_overseer, &test_state, false).await; - - // Should be connected to both groups except for the validator that fetched advertised - // collation. - assert_matches!( - overseer_recv(&mut virtual_overseer).await, - AllMessages::NetworkBridgeTx( - NetworkBridgeTxMessage::ConnectToValidators { validator_ids, .. } - ) => { - assert!(!validator_ids.contains(&group_a[0])); - - for validator in group_a[1..].iter().chain(&group_b) { - assert!(validator_ids.contains(validator)); - } - } - ); - - TestHarness { virtual_overseer, req_cfg } - }); -} diff --git a/node/network/collator-protocol/src/collator_side/validators_buffer.rs b/node/network/collator-protocol/src/collator_side/validators_buffer.rs deleted file mode 100644 index 5bb31c72d6c5..000000000000 --- a/node/network/collator-protocol/src/collator_side/validators_buffer.rs +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright 2017-2022 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 . - -//! Validator groups buffer for connection managements. -//! -//! Solves 2 problems: -//! 1. A collator may want to stay connected to multiple groups on rotation boundaries. -//! 2. It's important to disconnect from validator when there're no collations to be fetched. -//! -//! We keep a simple FIFO buffer of N validator groups and a bitvec for each advertisement, -//! 1 indicating we want to be connected to i-th validator in a buffer, 0 otherwise. -//! -//! The bit is set to 1 for the whole **group** whenever it's inserted into the buffer. Given a relay -//! parent, one can reset a bit back to 0 for particular **validator**. For example, if a collation -//! was fetched or some timeout has been hit. -//! -//! The bitwise OR over known advertisements gives us validators indices for connection request. - -use std::{ - collections::{HashMap, VecDeque}, - num::NonZeroUsize, - ops::Range, -}; - -use bitvec::{bitvec, vec::BitVec}; - -use polkadot_primitives::v2::{AuthorityDiscoveryId, GroupIndex, Hash, SessionIndex}; - -/// The ring buffer stores at most this many unique validator groups. -/// -/// This value should be chosen in way that all groups assigned to our para -/// in the view can fit into the buffer. -pub const VALIDATORS_BUFFER_CAPACITY: NonZeroUsize = match NonZeroUsize::new(3) { - Some(cap) => cap, - None => panic!("buffer capacity must be non-zero"), -}; - -/// Unique identifier of a validators group. -#[derive(Debug)] -struct ValidatorsGroupInfo { - /// Number of validators in the group. - len: usize, - session_index: SessionIndex, - group_index: GroupIndex, -} - -/// Ring buffer of validator groups. -/// -/// Tracks which peers we want to be connected to with respect to advertised collations. -#[derive(Debug)] -pub struct ValidatorGroupsBuffer { - /// Validator groups identifiers we **had** advertisements for. - group_infos: VecDeque, - /// Continuous buffer of validators discovery keys. - validators: VecDeque, - /// Mapping from relay-parent to bit-vectors with bits for all `validators`. - /// Invariants kept: All bit-vectors are guaranteed to have the same size. - should_be_connected: HashMap, - /// Buffer capacity, limits the number of **groups** tracked. - cap: NonZeroUsize, -} - -impl ValidatorGroupsBuffer { - /// Creates a new buffer with a non-zero capacity. - pub fn with_capacity(cap: NonZeroUsize) -> Self { - Self { - group_infos: VecDeque::new(), - validators: VecDeque::new(), - should_be_connected: HashMap::new(), - cap, - } - } - - /// Returns discovery ids of validators we have at least one advertised-but-not-fetched - /// collation for. - pub fn validators_to_connect(&self) -> Vec { - let validators_num = self.validators.len(); - let bits = self - .should_be_connected - .values() - .fold(bitvec![0; validators_num], |acc, next| acc | next); - - self.validators - .iter() - .enumerate() - .filter_map(|(idx, authority_id)| bits[idx].then_some(authority_id.clone())) - .collect() - } - - /// Note a new advertisement, marking that we want to be connected to validators - /// from this group. - /// - /// If max capacity is reached and the group is new, drops validators from the back - /// of the buffer. - pub fn note_collation_advertised( - &mut self, - relay_parent: Hash, - session_index: SessionIndex, - group_index: GroupIndex, - validators: &[AuthorityDiscoveryId], - ) { - if validators.is_empty() { - return - } - - match self.group_infos.iter().enumerate().find(|(_, group)| { - group.session_index == session_index && group.group_index == group_index - }) { - Some((idx, group)) => { - let group_start_idx = self.group_lengths_iter().take(idx).sum(); - self.set_bits(relay_parent, group_start_idx..(group_start_idx + group.len)); - }, - None => self.push(relay_parent, session_index, group_index, validators), - } - } - - /// Note that a validator is no longer interested in a given relay parent. - pub fn reset_validator_interest( - &mut self, - relay_parent: Hash, - authority_id: &AuthorityDiscoveryId, - ) { - let bits = match self.should_be_connected.get_mut(&relay_parent) { - Some(bits) => bits, - None => return, - }; - - for (idx, auth_id) in self.validators.iter().enumerate() { - if auth_id == authority_id { - bits.set(idx, false); - } - } - } - - /// Remove relay parent from the buffer. - /// - /// The buffer will no longer track which validators are interested in a corresponding - /// advertisement. - pub fn remove_relay_parent(&mut self, relay_parent: &Hash) { - self.should_be_connected.remove(relay_parent); - } - - /// Removes all advertisements from the buffer. - pub fn clear_advertisements(&mut self) { - self.should_be_connected.clear(); - } - - /// Pushes a new group to the buffer along with advertisement, setting all validators - /// bits to 1. - /// - /// If the buffer is full, drops group from the tail. - fn push( - &mut self, - relay_parent: Hash, - session_index: SessionIndex, - group_index: GroupIndex, - validators: &[AuthorityDiscoveryId], - ) { - let new_group_info = - ValidatorsGroupInfo { len: validators.len(), session_index, group_index }; - - let buf = &mut self.group_infos; - let cap = self.cap.get(); - - if buf.len() >= cap { - let pruned_group = buf.pop_front().expect("buf is not empty; qed"); - self.validators.drain(..pruned_group.len); - - self.should_be_connected.values_mut().for_each(|bits| { - bits.as_mut_bitslice().shift_left(pruned_group.len); - }); - } - - self.validators.extend(validators.iter().cloned()); - buf.push_back(new_group_info); - let buf_len = buf.len(); - let group_start_idx = self.group_lengths_iter().take(buf_len - 1).sum(); - - let new_len = self.validators.len(); - self.should_be_connected - .values_mut() - .for_each(|bits| bits.resize(new_len, false)); - self.set_bits(relay_parent, group_start_idx..(group_start_idx + validators.len())); - } - - /// Sets advertisement bits to 1 in a given range (usually corresponding to some group). - /// If the relay parent is unknown, inserts 0-initialized bitvec first. - /// - /// The range must be ensured to be within bounds. - fn set_bits(&mut self, relay_parent: Hash, range: Range) { - let bits = self - .should_be_connected - .entry(relay_parent) - .or_insert_with(|| bitvec![0; self.validators.len()]); - - bits[range].fill(true); - } - - /// Returns iterator over numbers of validators in groups. - /// - /// Useful for getting an index of the first validator in i-th group. - fn group_lengths_iter(&self) -> impl Iterator + '_ { - self.group_infos.iter().map(|group| group.len) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use sp_keyring::Sr25519Keyring; - - #[test] - fn one_capacity_buffer() { - let cap = NonZeroUsize::new(1).unwrap(); - let mut buf = ValidatorGroupsBuffer::with_capacity(cap); - - let hash_a = Hash::repeat_byte(0x1); - let hash_b = Hash::repeat_byte(0x2); - - let validators: Vec<_> = [ - Sr25519Keyring::Alice, - Sr25519Keyring::Bob, - Sr25519Keyring::Charlie, - Sr25519Keyring::Dave, - Sr25519Keyring::Ferdie, - ] - .into_iter() - .map(|key| AuthorityDiscoveryId::from(key.public())) - .collect(); - - assert!(buf.validators_to_connect().is_empty()); - - buf.note_collation_advertised(hash_a, 0, GroupIndex(0), &validators[..2]); - assert_eq!(buf.validators_to_connect(), validators[..2].to_vec()); - - buf.reset_validator_interest(hash_a, &validators[1]); - assert_eq!(buf.validators_to_connect(), vec![validators[0].clone()]); - - buf.note_collation_advertised(hash_b, 0, GroupIndex(1), &validators[2..]); - assert_eq!(buf.validators_to_connect(), validators[2..].to_vec()); - - for validator in &validators[2..] { - buf.reset_validator_interest(hash_b, validator); - } - assert!(buf.validators_to_connect().is_empty()); - } - - #[test] - fn buffer_works() { - let cap = NonZeroUsize::new(3).unwrap(); - let mut buf = ValidatorGroupsBuffer::with_capacity(cap); - - let hashes: Vec<_> = (0..5).map(Hash::repeat_byte).collect(); - - let validators: Vec<_> = [ - Sr25519Keyring::Alice, - Sr25519Keyring::Bob, - Sr25519Keyring::Charlie, - Sr25519Keyring::Dave, - Sr25519Keyring::Ferdie, - ] - .into_iter() - .map(|key| AuthorityDiscoveryId::from(key.public())) - .collect(); - - buf.note_collation_advertised(hashes[0], 0, GroupIndex(0), &validators[..2]); - buf.note_collation_advertised(hashes[1], 0, GroupIndex(0), &validators[..2]); - buf.note_collation_advertised(hashes[2], 0, GroupIndex(1), &validators[2..4]); - buf.note_collation_advertised(hashes[2], 0, GroupIndex(1), &validators[2..4]); - - assert_eq!(buf.validators_to_connect(), validators[..4].to_vec()); - - for validator in &validators[2..4] { - buf.reset_validator_interest(hashes[2], validator); - } - - buf.reset_validator_interest(hashes[1], &validators[0]); - assert_eq!(buf.validators_to_connect(), validators[..2].to_vec()); - - buf.reset_validator_interest(hashes[0], &validators[0]); - assert_eq!(buf.validators_to_connect(), vec![validators[1].clone()]); - - buf.note_collation_advertised(hashes[3], 0, GroupIndex(1), &validators[2..4]); - buf.note_collation_advertised( - hashes[4], - 0, - GroupIndex(2), - std::slice::from_ref(&validators[4]), - ); - - buf.reset_validator_interest(hashes[3], &validators[2]); - buf.note_collation_advertised( - hashes[4], - 0, - GroupIndex(3), - std::slice::from_ref(&validators[0]), - ); - - assert_eq!( - buf.validators_to_connect(), - vec![validators[3].clone(), validators[4].clone(), validators[0].clone()] - ); - } -} diff --git a/node/network/collator-protocol/src/lib.rs b/node/network/collator-protocol/src/lib.rs index b71acc127c88..66659e4b5bee 100644 --- a/node/network/collator-protocol/src/lib.rs +++ b/node/network/collator-protocol/src/lib.rs @@ -21,12 +21,9 @@ #![deny(unused_crate_dependencies)] #![recursion_limit = "256"] -use std::time::{Duration, Instant}; +use std::time::Duration; -use futures::{ - stream::{FusedStream, StreamExt}, - FutureExt, TryFutureExt, -}; +use futures::{FutureExt, TryFutureExt}; use sp_keystore::SyncCryptoStorePtr; @@ -137,23 +134,3 @@ async fn modify_reputation( sender.send_message(NetworkBridgeTxMessage::ReportPeer(peer, rep)).await; } - -/// Wait until tick and return the timestamp for the following one. -async fn wait_until_next_tick(last_poll: Instant, period: Duration) -> Instant { - let now = Instant::now(); - let next_poll = last_poll + period; - - if next_poll > now { - futures_timer::Delay::new(next_poll - now).await - } - - Instant::now() -} - -/// Returns an infinite stream that yields with an interval of `period`. -fn tick_stream(period: Duration) -> impl FusedStream { - futures::stream::unfold(Instant::now(), move |next_check| async move { - Some(((), wait_until_next_tick(next_check, period).await)) - }) - .fuse() -} diff --git a/node/network/collator-protocol/src/validator_side/mod.rs b/node/network/collator-protocol/src/validator_side/mod.rs index b2b3dc4824b5..47795aac0ce2 100644 --- a/node/network/collator-protocol/src/validator_side/mod.rs +++ b/node/network/collator-protocol/src/validator_side/mod.rs @@ -19,7 +19,7 @@ use futures::{ channel::oneshot, future::{BoxFuture, Fuse, FusedFuture}, select, - stream::FuturesUnordered, + stream::{FusedStream, FuturesUnordered}, FutureExt, StreamExt, }; use futures_timer::Delay; @@ -57,7 +57,7 @@ use polkadot_primitives::v2::{CandidateReceipt, CollatorId, Hash, Id as ParaId}; use crate::error::Result; -use super::{modify_reputation, tick_stream, LOG_TARGET}; +use super::{modify_reputation, LOG_TARGET}; #[cfg(test)] mod tests; @@ -85,23 +85,19 @@ const BENEFIT_NOTIFY_GOOD: Rep = /// to finish on time. /// /// There is debug logging output, so we can adjust this value based on production results. -#[cfg(not(test))] const MAX_UNSHARED_DOWNLOAD_TIME: Duration = Duration::from_millis(400); // How often to check all peers with activity. #[cfg(not(test))] const ACTIVITY_POLL: Duration = Duration::from_secs(1); -#[cfg(test)] -const MAX_UNSHARED_DOWNLOAD_TIME: Duration = Duration::from_millis(100); - #[cfg(test)] const ACTIVITY_POLL: Duration = Duration::from_millis(10); // How often to poll collation responses. // This is a hack that should be removed in a refactoring. // See https://github.com/paritytech/polkadot/issues/4182 -const CHECK_COLLATIONS_POLL: Duration = Duration::from_millis(50); +const CHECK_COLLATIONS_POLL: Duration = Duration::from_millis(5); #[derive(Clone, Default)] pub struct Metrics(Option); @@ -1171,6 +1167,25 @@ async fn process_msg( } } +// wait until next inactivity check. returns the instant for the following check. +async fn wait_until_next_check(last_poll: Instant) -> Instant { + let now = Instant::now(); + let next_poll = last_poll + ACTIVITY_POLL; + + if next_poll > now { + Delay::new(next_poll - now).await + } + + Instant::now() +} + +fn infinite_stream(every: Duration) -> impl FusedStream { + futures::stream::unfold(Instant::now() + every, |next_check| async move { + Some(((), wait_until_next_check(next_check).await)) + }) + .fuse() +} + /// The main run loop. #[overseer::contextbounds(CollatorProtocol, prefix = self::overseer)] pub(crate) async fn run( @@ -1181,10 +1196,10 @@ pub(crate) async fn run( ) -> std::result::Result<(), crate::error::FatalError> { let mut state = State { metrics, ..Default::default() }; - let next_inactivity_stream = tick_stream(ACTIVITY_POLL); + let next_inactivity_stream = infinite_stream(ACTIVITY_POLL); futures::pin_mut!(next_inactivity_stream); - let check_collations_stream = tick_stream(CHECK_COLLATIONS_POLL); + let check_collations_stream = infinite_stream(CHECK_COLLATIONS_POLL); futures::pin_mut!(check_collations_stream); loop { diff --git a/node/network/collator-protocol/src/validator_side/tests.rs b/node/network/collator-protocol/src/validator_side/tests.rs index ae8644cea521..15740e5d5efa 100644 --- a/node/network/collator-protocol/src/validator_side/tests.rs +++ b/node/network/collator-protocol/src/validator_side/tests.rs @@ -20,7 +20,7 @@ use futures::{executor, future, Future}; use sp_core::{crypto::Pair, Encode}; use sp_keyring::Sr25519Keyring; use sp_keystore::{testing::KeyStore as TestKeyStore, SyncCryptoStore}; -use std::{iter, sync::Arc, task::Poll, time::Duration}; +use std::{iter, sync::Arc, time::Duration}; use polkadot_node_network_protocol::{ our_view, @@ -493,11 +493,17 @@ fn collator_authentication_verification_works() { }); } -/// Tests that a validator fetches only one collation at any moment of time -/// per relay parent and ignores other advertisements once a candidate gets -/// seconded. +// A test scenario that takes the following steps +// - Two collators connect, declare themselves and advertise a collation relevant to +// our view. +// - Collation protocol should request one PoV. +// - Collation protocol should disconnect both collators after having received the collation. +// - The same collators plus an additional collator connect again and send `PoV`s for a different relay parent. +// - Collation protocol will request one PoV, but we will cancel it. +// - Collation protocol should request the second PoV which does not succeed in time. +// - Collation protocol should request third PoV. #[test] -fn fetch_one_collation_at_a_time() { +fn fetch_collations_works() { let test_state = TestState::default(); test_harness(|test_harness| async move { @@ -569,37 +575,21 @@ fn fetch_one_collation_at_a_time() { ) .await; - // Ensure the subsystem is polled. - test_helpers::Yield::new().await; - - // Second collation is not requested since there's already seconded one. - assert_matches!(futures::poll!(virtual_overseer.recv().boxed()), Poll::Pending); - - virtual_overseer - }) -} - -/// Tests that a validator starts fetching next queued collations on [`MAX_UNSHARED_DOWNLOAD_TIME`] -/// timeout and in case of an error. -#[test] -fn fetches_next_collation() { - let test_state = TestState::default(); - - test_harness(|test_harness| async move { - let TestHarness { mut virtual_overseer } = test_harness; - - let second = Hash::random(); - overseer_send( &mut virtual_overseer, - CollatorProtocolMessage::NetworkBridgeUpdate(NetworkBridgeEvent::OurViewChange( - our_view![test_state.relay_parent, second], + CollatorProtocolMessage::NetworkBridgeUpdate(NetworkBridgeEvent::PeerDisconnected( + peer_b.clone(), )), ) .await; - respond_to_core_info_queries(&mut virtual_overseer, &test_state).await; - respond_to_core_info_queries(&mut virtual_overseer, &test_state).await; + overseer_send( + &mut virtual_overseer, + CollatorProtocolMessage::NetworkBridgeUpdate(NetworkBridgeEvent::PeerDisconnected( + peer_c.clone(), + )), + ) + .await; let peer_b = PeerId::random(); let peer_c = PeerId::random(); diff --git a/node/network/dispute-distribution/Cargo.toml b/node/network/dispute-distribution/Cargo.toml index a731175f0521..f50f24bf42c8 100644 --- a/node/network/dispute-distribution/Cargo.toml +++ b/node/network/dispute-distribution/Cargo.toml @@ -6,7 +6,6 @@ edition = "2021" [dependencies] futures = "0.3.21" -futures-timer = "3.0.2" gum = { package = "tracing-gum", path = "../../gum" } derive_more = "0.99.17" parity-scale-codec = { version = "3.1.5", features = ["std"] } @@ -21,8 +20,7 @@ sp-application-crypto = { git = "https://github.com/paritytech/substrate", branc sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } thiserror = "1.0.31" fatality = "0.0.6" -lru = "0.8.0" -indexmap = "1.9.1" +lru = "0.7.7" [dev-dependencies] async-trait = "0.1.57" diff --git a/node/network/dispute-distribution/src/lib.rs b/node/network/dispute-distribution/src/lib.rs index f109d5e6a40e..aefd66e0ae79 100644 --- a/node/network/dispute-distribution/src/lib.rs +++ b/node/network/dispute-distribution/src/lib.rs @@ -24,8 +24,6 @@ //! The sender is responsible for getting our vote out, see [`sender`]. The receiver handles //! incoming [`DisputeRequest`]s and offers spam protection, see [`receiver`]. -use std::{num::NonZeroUsize, time::Duration}; - use futures::{channel::mpsc, FutureExt, StreamExt, TryFutureExt}; use polkadot_node_network_protocol::authority_discovery::AuthorityDiscovery; @@ -66,19 +64,16 @@ use self::sender::{DisputeSender, TaskFinish}; /// via a dedicated channel and forwarding them to the dispute coordinator via /// `DisputeCoordinatorMessage::ImportStatements`. Being the interface to the network and untrusted /// nodes, the reality is not that simple of course. Before importing statements the receiver will -/// batch up imports as well as possible for efficient imports while maintaining timely dispute -/// resolution and handling of spamming validators: +/// make sure as good as it can to filter out malicious/unwanted/spammy requests. For this it does +/// the following: /// /// - Drop all messages from non validator nodes, for this it requires the [`AuthorityDiscovery`] /// service. -/// - Drop messages from a node, if it sends at a too high rate. -/// - Filter out duplicate messages (over some period of time). +/// - Drop messages from a node, if we are already importing a message from that node (flood). +/// - Drop messages from nodes, that provided us messages where the statement import failed. /// - Drop any obviously invalid votes (invalid signatures for example). /// - Ban peers whose votes were deemed invalid. /// -/// In general dispute-distribution works on limiting the work the dispute-coordinator will have to -/// do, while at the same time making it aware of new disputes as fast as possible. -/// /// For successfully imported votes, we will confirm the receipt of the message back to the sender. /// This way a received confirmation guarantees, that the vote has been stored to disk by the /// receiver. @@ -98,20 +93,6 @@ pub use metrics::Metrics; const LOG_TARGET: &'static str = "parachain::dispute-distribution"; -/// Rate limit on the `receiver` side. -/// -/// If messages from one peer come in at a higher rate than every `RECEIVE_RATE_LIMIT` on average, we -/// start dropping messages from that peer to enforce that limit. -pub const RECEIVE_RATE_LIMIT: Duration = Duration::from_millis(100); - -/// Rate limit on the `sender` side. -/// -/// In order to not hit the `RECEIVE_RATE_LIMIT` on the receiving side, we limit out sending rate as -/// well. -/// -/// We add 50ms extra, just to have some save margin to the `RECEIVE_RATE_LIMIT`. -pub const SEND_RATE_LIMIT: Duration = RECEIVE_RATE_LIMIT.saturating_add(Duration::from_millis(50)); - /// The dispute distribution subsystem. pub struct DisputeDistributionSubsystem { /// Easy and efficient runtime access for this subsystem. @@ -164,8 +145,7 @@ where ) -> Self { let runtime = RuntimeInfo::new_with_config(runtime::Config { keystore: Some(keystore), - session_cache_lru_size: NonZeroUsize::new(DISPUTE_WINDOW.get() as usize) - .expect("Dispute window can not be 0; qed"), + session_cache_lru_size: DISPUTE_WINDOW.get() as usize, }); let (tx, sender_rx) = mpsc::channel(1); let disputes_sender = DisputeSender::new(tx, metrics.clone()); @@ -192,12 +172,6 @@ where ctx.spawn("disputes-receiver", receiver.run().boxed()) .map_err(FatalError::SpawnTask)?; - // Process messages for sending side. - // - // Note: We want the sender to be rate limited and we are currently taking advantage of the - // fact that the root task of this subsystem is only concerned with sending: Functions of - // `DisputeSender` might back pressure if the rate limit is hit, which will slow down this - // loop. If this fact ever changes, we will likely need another task. loop { let message = MuxedMessage::receive(&mut ctx, &mut self.sender_rx).await; match message { @@ -273,10 +247,9 @@ impl MuxedMessage { // ends. let from_overseer = ctx.recv().fuse(); futures::pin_mut!(from_overseer, from_sender); - // We select biased to make sure we finish up loose ends, before starting new work. - futures::select_biased!( - msg = from_sender.next() => MuxedMessage::Sender(msg), + futures::select!( msg = from_overseer => MuxedMessage::Subsystem(msg.map_err(FatalError::SubsystemReceive)), + msg = from_sender.next() => MuxedMessage::Sender(msg), ) } } diff --git a/node/network/dispute-distribution/src/metrics.rs b/node/network/dispute-distribution/src/metrics.rs index aa2feeaad3a0..3f717bd105c3 100644 --- a/node/network/dispute-distribution/src/metrics.rs +++ b/node/network/dispute-distribution/src/metrics.rs @@ -72,12 +72,9 @@ impl Metrics { } /// Statements have been imported. - pub fn on_imported(&self, label: &'static str, num_requests: usize) { + pub fn on_imported(&self, label: &'static str) { if let Some(metrics) = &self.0 { - metrics - .imported_requests - .with_label_values(&[label]) - .inc_by(num_requests as u64) + metrics.imported_requests.with_label_values(&[label]).inc() } } diff --git a/node/network/dispute-distribution/src/receiver/batches/batch.rs b/node/network/dispute-distribution/src/receiver/batches/batch.rs deleted file mode 100644 index eebed25ed790..000000000000 --- a/node/network/dispute-distribution/src/receiver/batches/batch.rs +++ /dev/null @@ -1,209 +0,0 @@ -// Copyright 2022 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 . - -use std::{collections::HashMap, time::Instant}; - -use gum::CandidateHash; -use polkadot_node_network_protocol::{ - request_response::{incoming::OutgoingResponseSender, v1::DisputeRequest}, - PeerId, -}; -use polkadot_node_primitives::SignedDisputeStatement; -use polkadot_primitives::v2::{CandidateReceipt, ValidatorIndex}; - -use crate::receiver::{BATCH_COLLECTING_INTERVAL, MIN_KEEP_BATCH_ALIVE_VOTES}; - -use super::MAX_BATCH_LIFETIME; - -/// A batch of votes to be imported into the `dispute-coordinator`. -/// -/// Vote imports are way more efficient when performed in batches, hence we batch together incoming -/// votes until the rate of incoming votes falls below a threshold, then we import into the dispute -/// coordinator. -/// -/// A `Batch` keeps track of the votes to be imported and the current incoming rate, on rate update -/// it will "flush" in case the incoming rate dropped too low, preparing the import. -pub struct Batch { - /// The actual candidate this batch is concerned with. - candidate_receipt: CandidateReceipt, - - /// Cache of `CandidateHash` (candidate_receipt.hash()). - candidate_hash: CandidateHash, - - /// All valid votes received in this batch so far. - /// - /// We differentiate between valid and invalid votes, so we can detect (and drop) duplicates, - /// while still allowing validators to equivocate. - /// - /// Detecting and rejecting duplicates is crucial in order to effectively enforce - /// `MIN_KEEP_BATCH_ALIVE_VOTES` per `BATCH_COLLECTING_INTERVAL`. If we would count duplicates - /// here, the mechanism would be broken. - valid_votes: HashMap, - - /// All invalid votes received in this batch so far. - invalid_votes: HashMap, - - /// How many votes have been batched since the last tick/creation. - votes_batched_since_last_tick: u32, - - /// Expiry time for the batch. - /// - /// By this time the latest this batch will get flushed. - best_before: Instant, - - /// Requesters waiting for a response. - requesters: Vec<(PeerId, OutgoingResponseSender)>, -} - -/// Result of checking a batch every `BATCH_COLLECTING_INTERVAL`. -pub(super) enum TickResult { - /// Batch is still alive, please call `tick` again at the given `Instant`. - Alive(Batch, Instant), - /// Batch is done, ready for import! - Done(PreparedImport), -} - -/// Ready for import. -pub struct PreparedImport { - pub candidate_receipt: CandidateReceipt, - pub statements: Vec<(SignedDisputeStatement, ValidatorIndex)>, - /// Information about original requesters. - pub requesters: Vec<(PeerId, OutgoingResponseSender)>, -} - -impl From for PreparedImport { - fn from(batch: Batch) -> Self { - let Batch { - candidate_receipt, - valid_votes, - invalid_votes, - requesters: pending_responses, - .. - } = batch; - - let statements = valid_votes - .into_iter() - .chain(invalid_votes.into_iter()) - .map(|(index, statement)| (statement, index)) - .collect(); - - Self { candidate_receipt, statements, requesters: pending_responses } - } -} - -impl Batch { - /// Create a new empty batch based on the given `CandidateReceipt`. - /// - /// To create a `Batch` use Batches::find_batch`. - /// - /// Arguments: - /// - /// * `candidate_receipt` - The candidate this batch is meant to track votes for. - /// * `now` - current time stamp for calculating the first tick. - /// - /// Returns: A batch and the first `Instant` you are supposed to call `tick`. - pub(super) fn new(candidate_receipt: CandidateReceipt, now: Instant) -> (Self, Instant) { - let s = Self { - candidate_hash: candidate_receipt.hash(), - candidate_receipt, - valid_votes: HashMap::new(), - invalid_votes: HashMap::new(), - votes_batched_since_last_tick: 0, - best_before: Instant::now() + MAX_BATCH_LIFETIME, - requesters: Vec::new(), - }; - let next_tick = s.calculate_next_tick(now); - (s, next_tick) - } - - /// Receipt of the candidate this batch is batching votes for. - pub fn candidate_receipt(&self) -> &CandidateReceipt { - &self.candidate_receipt - } - - /// Add votes from a validator into the batch. - /// - /// The statements are supposed to be the valid and invalid statements received in a - /// `DisputeRequest`. - /// - /// The given `pending_response` is the corresponding response sender for responding to `peer`. - /// If at least one of the votes is new as far as this batch is concerned we record the - /// pending_response, for later use. In case both votes are known already, we return the - /// response sender as an `Err` value. - pub fn add_votes( - &mut self, - valid_vote: (SignedDisputeStatement, ValidatorIndex), - invalid_vote: (SignedDisputeStatement, ValidatorIndex), - peer: PeerId, - pending_response: OutgoingResponseSender, - ) -> Result<(), OutgoingResponseSender> { - debug_assert!(valid_vote.0.candidate_hash() == invalid_vote.0.candidate_hash()); - debug_assert!(valid_vote.0.candidate_hash() == &self.candidate_hash); - - let mut duplicate = true; - - if self.valid_votes.insert(valid_vote.1, valid_vote.0).is_none() { - self.votes_batched_since_last_tick += 1; - duplicate = false; - } - if self.invalid_votes.insert(invalid_vote.1, invalid_vote.0).is_none() { - self.votes_batched_since_last_tick += 1; - duplicate = false; - } - - if duplicate { - Err(pending_response) - } else { - self.requesters.push((peer, pending_response)); - Ok(()) - } - } - - /// Check batch for liveness. - /// - /// This function is supposed to be called at instants given at construction and as returned as - /// part of `TickResult`. - pub(super) fn tick(mut self, now: Instant) -> TickResult { - if self.votes_batched_since_last_tick >= MIN_KEEP_BATCH_ALIVE_VOTES && - now < self.best_before - { - // Still good: - let next_tick = self.calculate_next_tick(now); - // Reset counter: - self.votes_batched_since_last_tick = 0; - TickResult::Alive(self, next_tick) - } else { - TickResult::Done(PreparedImport::from(self)) - } - } - - /// Calculate when the next tick should happen. - /// - /// This will usually return `now + BATCH_COLLECTING_INTERVAL`, except if the lifetime of this batch - /// would exceed `MAX_BATCH_LIFETIME`. - /// - /// # Arguments - /// - /// * `now` - The current time. - fn calculate_next_tick(&self, now: Instant) -> Instant { - let next_tick = now + BATCH_COLLECTING_INTERVAL; - if next_tick < self.best_before { - next_tick - } else { - self.best_before - } - } -} diff --git a/node/network/dispute-distribution/src/receiver/batches/mod.rs b/node/network/dispute-distribution/src/receiver/batches/mod.rs deleted file mode 100644 index b343b55e0b04..000000000000 --- a/node/network/dispute-distribution/src/receiver/batches/mod.rs +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2022 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 . - -use std::{ - collections::{hash_map, HashMap}, - time::{Duration, Instant}, -}; - -use futures::future::pending; - -use polkadot_node_network_protocol::request_response::DISPUTE_REQUEST_TIMEOUT; -use polkadot_primitives::v2::{CandidateHash, CandidateReceipt}; - -use crate::{ - receiver::batches::{batch::TickResult, waiting_queue::PendingWake}, - LOG_TARGET, -}; - -pub use self::batch::{Batch, PreparedImport}; -use self::waiting_queue::WaitingQueue; - -use super::{ - error::{JfyiError, JfyiResult}, - BATCH_COLLECTING_INTERVAL, -}; - -/// A single batch (per candidate) as managed by `Batches`. -mod batch; - -/// Queue events in time and wait for them to become ready. -mod waiting_queue; - -/// Safe-guard in case votes trickle in real slow. -/// -/// If the batch life time exceeded the time the sender is willing to wait for a confirmation, we -/// would trigger pointless re-sends. -const MAX_BATCH_LIFETIME: Duration = DISPUTE_REQUEST_TIMEOUT.saturating_sub(Duration::from_secs(2)); - -/// Limit the number of batches that can be alive at any given time. -/// -/// Reasoning for this number, see guide. -pub const MAX_BATCHES: usize = 1000; - -/// Manage batches. -/// -/// - Batches can be found via `find_batch()` in order to add votes to them/check they exist. -/// - Batches can be checked for being ready for flushing in order to import contained votes. -pub struct Batches { - /// The batches we manage. - /// - /// Kept invariants: - /// For each entry in `batches`, there exists an entry in `waiting_queue` as well - we wait on - /// all batches! - batches: HashMap, - /// Waiting queue for waiting for batches to become ready for `tick`. - /// - /// Kept invariants by `Batches`: - /// For each entry in the `waiting_queue` there exists a corresponding entry in `batches`. - waiting_queue: WaitingQueue, -} - -/// A found batch is either really found or got created so it can be found. -pub enum FoundBatch<'a> { - /// Batch just got created. - Created(&'a mut Batch), - /// Batch already existed. - Found(&'a mut Batch), -} - -impl Batches { - /// Create new empty `Batches`. - pub fn new() -> Self { - debug_assert!( - MAX_BATCH_LIFETIME > BATCH_COLLECTING_INTERVAL, - "Unexpectedly low `MAX_BATCH_LIFETIME`, please check parameters." - ); - Self { batches: HashMap::new(), waiting_queue: WaitingQueue::new() } - } - - /// Find a particular batch. - /// - /// That is either find it, or we create it as reflected by the result `FoundBatch`. - pub fn find_batch( - &mut self, - candidate_hash: CandidateHash, - candidate_receipt: CandidateReceipt, - ) -> JfyiResult { - if self.batches.len() >= MAX_BATCHES { - return Err(JfyiError::MaxBatchLimitReached) - } - debug_assert!(candidate_hash == candidate_receipt.hash()); - let result = match self.batches.entry(candidate_hash) { - hash_map::Entry::Vacant(vacant) => { - let now = Instant::now(); - let (created, ready_at) = Batch::new(candidate_receipt, now); - let pending_wake = PendingWake { payload: candidate_hash, ready_at }; - self.waiting_queue.push(pending_wake); - FoundBatch::Created(vacant.insert(created)) - }, - hash_map::Entry::Occupied(occupied) => FoundBatch::Found(occupied.into_mut()), - }; - Ok(result) - } - - /// Wait for the next `tick` to check for ready batches. - /// - /// This function blocks (returns `Poll::Pending`) until at least one batch can be - /// checked for readiness meaning that `BATCH_COLLECTING_INTERVAL` has passed since the last - /// check for that batch or it reached end of life. - /// - /// If this `Batches` instance is empty (does not actually contain any batches), then this - /// function will always return `Poll::Pending`. - /// - /// Returns: A `Vec` of all `PreparedImport`s from batches that became ready. - pub async fn check_batches(&mut self) -> Vec { - let now = Instant::now(); - - let mut imports = Vec::new(); - - // Wait for at least one batch to become ready: - self.waiting_queue.wait_ready(now).await; - - // Process all ready entries: - while let Some(wake) = self.waiting_queue.pop_ready(now) { - let batch = self.batches.remove(&wake.payload); - debug_assert!( - batch.is_some(), - "Entries referenced in `waiting_queue` are supposed to exist!" - ); - let batch = match batch { - None => return pending().await, - Some(batch) => batch, - }; - match batch.tick(now) { - TickResult::Done(import) => { - gum::trace!( - target: LOG_TARGET, - candidate_hash = ?wake.payload, - "Batch became ready." - ); - imports.push(import); - }, - TickResult::Alive(old_batch, next_tick) => { - gum::trace!( - target: LOG_TARGET, - candidate_hash = ?wake.payload, - "Batch found to be still alive on check." - ); - let pending_wake = PendingWake { payload: wake.payload, ready_at: next_tick }; - self.waiting_queue.push(pending_wake); - self.batches.insert(wake.payload, old_batch); - }, - } - } - imports - } -} diff --git a/node/network/dispute-distribution/src/receiver/batches/waiting_queue.rs b/node/network/dispute-distribution/src/receiver/batches/waiting_queue.rs deleted file mode 100644 index 995dc74d358f..000000000000 --- a/node/network/dispute-distribution/src/receiver/batches/waiting_queue.rs +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright 2022 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 . - -use std::{cmp::Ordering, collections::BinaryHeap, time::Instant}; - -use futures::future::pending; -use futures_timer::Delay; - -/// Wait asynchronously for given `Instant`s one after the other. -/// -/// `PendingWake`s can be inserted and `WaitingQueue` makes `wait_ready()` to always wait for the -/// next `Instant` in the queue. -pub struct WaitingQueue { - /// All pending wakes we are supposed to wait on in order. - pending_wakes: BinaryHeap>, - /// Wait for next `PendingWake`. - timer: Option, -} - -/// Represents some event waiting to be processed at `ready_at`. -/// -/// This is an event in `WaitingQueue`. It provides an `Ord` instance, that sorts descending with -/// regard to `Instant` (so we get a `min-heap` with the earliest `Instant` at the top). -#[derive(Eq, PartialEq)] -pub struct PendingWake { - pub payload: Payload, - pub ready_at: Instant, -} - -impl WaitingQueue { - /// Get a new empty `WaitingQueue`. - /// - /// If you call `pop` on this queue immediately, it will always return `Poll::Pending`. - pub fn new() -> Self { - Self { pending_wakes: BinaryHeap::new(), timer: None } - } - - /// Push a `PendingWake`. - /// - /// The next call to `wait_ready` will make sure to wake soon enough to process that new event in a - /// timely manner. - pub fn push(&mut self, wake: PendingWake) { - self.pending_wakes.push(wake); - // Reset timer as it is potentially obsolete now: - self.timer = None; - } - - /// Pop the next ready item. - /// - /// This function does not wait, if nothing is ready right now as determined by the passed - /// `now` time stamp, this function simply returns `None`. - pub fn pop_ready(&mut self, now: Instant) -> Option> { - let is_ready = self.pending_wakes.peek().map_or(false, |p| p.ready_at <= now); - if is_ready { - Some(self.pending_wakes.pop().expect("We just peeked. qed.")) - } else { - None - } - } - - /// Don't pop, just wait until something is ready. - /// - /// Once this function returns `Poll::Ready(())` `pop_ready()` will return `Some`, if passed - /// the same `Instant`. - /// - /// Whether ready or not is determined based on the passed time stamp `now` which should be the - /// current time as returned by `Instant::now()` - /// - /// This function waits asynchronously for an item to become ready. If there is no more item, - /// this call will wait forever (return Poll::Pending without scheduling a wake). - pub async fn wait_ready(&mut self, now: Instant) { - if let Some(timer) = &mut self.timer { - // Previous timer was not done yet. - timer.await - } - - let next_waiting = self.pending_wakes.peek(); - let is_ready = next_waiting.map_or(false, |p| p.ready_at <= now); - if is_ready { - return - } - - self.timer = next_waiting.map(|p| Delay::new(p.ready_at.duration_since(now))); - match &mut self.timer { - None => return pending().await, - Some(timer) => timer.await, - } - } -} - -impl PartialOrd> for PendingWake { - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) - } -} - -impl Ord for PendingWake { - fn cmp(&self, other: &Self) -> Ordering { - // Reverse order for min-heap: - match other.ready_at.cmp(&self.ready_at) { - Ordering::Equal => other.payload.cmp(&self.payload), - o => o, - } - } -} -#[cfg(test)] -mod tests { - use std::{ - task::Poll, - time::{Duration, Instant}, - }; - - use assert_matches::assert_matches; - use futures::{future::poll_fn, pin_mut, Future}; - - use crate::LOG_TARGET; - - use super::{PendingWake, WaitingQueue}; - - #[test] - fn wait_ready_waits_for_earliest_event_always() { - sp_tracing::try_init_simple(); - let mut queue = WaitingQueue::new(); - let now = Instant::now(); - let start = now; - queue.push(PendingWake { payload: 1u32, ready_at: now + Duration::from_millis(3) }); - // Push another one in order: - queue.push(PendingWake { payload: 2u32, ready_at: now + Duration::from_millis(5) }); - // Push one out of order: - queue.push(PendingWake { payload: 0u32, ready_at: now + Duration::from_millis(1) }); - // Push another one at same timestamp (should become ready at the same time) - queue.push(PendingWake { payload: 10u32, ready_at: now + Duration::from_millis(1) }); - - futures::executor::block_on(async move { - // No time passed yet - nothing should be ready. - assert!(queue.pop_ready(now).is_none(), "No time has passed, nothing should be ready"); - - // Receive them in order at expected times: - queue.wait_ready(now).await; - gum::trace!(target: LOG_TARGET, "After first wait."); - - let now = start + Duration::from_millis(1); - assert!(Instant::now() - start >= Duration::from_millis(1)); - assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(0u32)); - // One more should be ready: - assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(10u32)); - assert!(queue.pop_ready(now).is_none(), "No more entry expected to be ready."); - - queue.wait_ready(now).await; - gum::trace!(target: LOG_TARGET, "After second wait."); - let now = start + Duration::from_millis(3); - assert!(Instant::now() - start >= Duration::from_millis(3)); - assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(1u32)); - assert!(queue.pop_ready(now).is_none(), "No more entry expected to be ready."); - - // Push in between wait: - poll_fn(|cx| { - let fut = queue.wait_ready(now); - pin_mut!(fut); - assert_matches!(fut.poll(cx), Poll::Pending); - Poll::Ready(()) - }) - .await; - queue.push(PendingWake { payload: 3u32, ready_at: start + Duration::from_millis(4) }); - - queue.wait_ready(now).await; - // Newly pushed element should have become ready: - gum::trace!(target: LOG_TARGET, "After third wait."); - let now = start + Duration::from_millis(4); - assert!(Instant::now() - start >= Duration::from_millis(4)); - assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(3u32)); - assert!(queue.pop_ready(now).is_none(), "No more entry expected to be ready."); - - queue.wait_ready(now).await; - gum::trace!(target: LOG_TARGET, "After fourth wait."); - let now = start + Duration::from_millis(5); - assert!(Instant::now() - start >= Duration::from_millis(5)); - assert_eq!(queue.pop_ready(now).map(|p| p.payload), Some(2u32)); - assert!(queue.pop_ready(now).is_none(), "No more entry expected to be ready."); - - // queue empty - should wait forever now: - poll_fn(|cx| { - let fut = queue.wait_ready(now); - pin_mut!(fut); - assert_matches!(fut.poll(cx), Poll::Pending); - Poll::Ready(()) - }) - .await; - }); - } -} diff --git a/node/network/dispute-distribution/src/receiver/error.rs b/node/network/dispute-distribution/src/receiver/error.rs index 4477335440d0..ce578cc8e0f9 100644 --- a/node/network/dispute-distribution/src/receiver/error.rs +++ b/node/network/dispute-distribution/src/receiver/error.rs @@ -19,10 +19,8 @@ use fatality::Nested; -use gum::CandidateHash; use polkadot_node_network_protocol::{request_response::incoming, PeerId}; use polkadot_node_subsystem_util::runtime; -use polkadot_primitives::v2::AuthorityDiscoveryId; use crate::LOG_TARGET; @@ -37,8 +35,8 @@ pub enum Error { #[error("Retrieving next incoming request failed.")] IncomingRequest(#[from] incoming::Error), - #[error("Sending back response to peers {0:#?} failed.")] - SendResponses(Vec), + #[error("Sending back response to peer {0} failed.")] + SendResponse(PeerId), #[error("Changing peer's ({0}) reputation failed.")] SetPeerReputation(PeerId), @@ -46,29 +44,16 @@ pub enum Error { #[error("Dispute request with invalid signatures, from peer {0}.")] InvalidSignature(PeerId), - #[error("Received votes from peer {0} have been completely redundant.")] - RedundantMessage(PeerId), - - #[error("Import of dispute got canceled for candidate {0} - import failed for some reason.")] - ImportCanceled(CandidateHash), + #[error("Import of dispute got canceled for peer {0} - import failed for some reason.")] + ImportCanceled(PeerId), #[error("Peer {0} attempted to participate in dispute and is not a validator.")] NotAValidator(PeerId), - - #[error("Force flush for batch that could not be found attempted, candidate hash: {0}")] - ForceFlushBatchDoesNotExist(CandidateHash), - - // Should never happen in practice: - #[error("We needed to drop messages, because we reached limit on concurrent batches.")] - MaxBatchLimitReached, - - #[error("Authority {0} sent messages at a too high rate.")] - AuthorityFlooding(AuthorityDiscoveryId), } pub type Result = std::result::Result; -pub type JfyiResult = std::result::Result; +pub type JfyiErrorResult = std::result::Result; /// Utility for eating top level errors and log them. /// diff --git a/node/network/dispute-distribution/src/receiver/mod.rs b/node/network/dispute-distribution/src/receiver/mod.rs index 158c66e20655..9193947e78d1 100644 --- a/node/network/dispute-distribution/src/receiver/mod.rs +++ b/node/network/dispute-distribution/src/receiver/mod.rs @@ -15,21 +15,20 @@ // along with Polkadot. If not, see . use std::{ - num::NonZeroUsize, + collections::HashSet, pin::Pin, task::{Context, Poll}, - time::Duration, }; use futures::{ channel::oneshot, - future::poll_fn, + future::{poll_fn, BoxFuture}, pin_mut, - stream::{FuturesUnordered, StreamExt}, - Future, + stream::{FusedStream, FuturesUnordered, StreamExt}, + Future, FutureExt, Stream, }; +use lru::LruCache; -use gum::CandidateHash; use polkadot_node_network_protocol::{ authority_discovery::AuthorityDiscovery, request_response::{ @@ -52,47 +51,20 @@ use crate::{ }; mod error; - -/// Rate limiting queues for incoming requests by peers. -mod peer_queues; - -/// Batch imports together. -mod batches; - -use self::{ - batches::{Batches, FoundBatch, PreparedImport}, - error::{log_error, JfyiError, JfyiResult, Result}, - peer_queues::PeerQueues, -}; +use self::error::{log_error, JfyiError, JfyiErrorResult, Result}; const COST_INVALID_REQUEST: Rep = Rep::CostMajor("Received message could not be decoded."); const COST_INVALID_SIGNATURE: Rep = Rep::Malicious("Signatures were invalid."); -const COST_INVALID_IMPORT: Rep = - Rep::Malicious("Import was deemed invalid by dispute-coordinator."); +const COST_INVALID_CANDIDATE: Rep = Rep::Malicious("Reported candidate was not available."); const COST_NOT_A_VALIDATOR: Rep = Rep::CostMajor("Reporting peer was not a validator."); -/// Mildly punish peers exceeding their rate limit. -/// -/// For honest peers this should rarely happen, but if it happens we would not want to disconnect -/// too quickly. Minor cost should suffice for disconnecting any real flooder. -const COST_APPARENT_FLOOD: Rep = Rep::CostMinor("Peer exceeded the rate limit."); - -/// How many votes must have arrived in the last `BATCH_COLLECTING_INTERVAL` -/// -/// in order for a batch to stay alive and not get flushed/imported to the dispute-coordinator. -/// -/// This ensures a timely import of batches. -#[cfg(not(test))] -pub const MIN_KEEP_BATCH_ALIVE_VOTES: u32 = 10; -#[cfg(test)] -pub const MIN_KEEP_BATCH_ALIVE_VOTES: u32 = 2; -/// Time we allow to pass for new votes to trickle in. -/// -/// See `MIN_KEEP_BATCH_ALIVE_VOTES` above. -/// Should be greater or equal to `RECEIVE_RATE_LIMIT` (there is no point in checking any faster). -pub const BATCH_COLLECTING_INTERVAL: Duration = Duration::from_millis(500); +/// How many statement imports we want to issue in parallel: +pub const MAX_PARALLEL_IMPORTS: usize = 10; /// State for handling incoming `DisputeRequest` messages. +/// +/// This is supposed to run as its own task in order to easily impose back pressure on the incoming +/// request channel and at the same time to drop flood messages as fast as possible. pub struct DisputesReceiver { /// Access to session information. runtime: RuntimeInfo, @@ -103,17 +75,18 @@ pub struct DisputesReceiver { /// Channel to retrieve incoming requests from. receiver: IncomingRequestReceiver, - /// Rate limiting queue for each peer (only authorities). - peer_queues: PeerQueues, - - /// Currently active batches of imports per candidate. - batches: Batches, - /// Authority discovery service: authority_discovery: AD, - /// Imports currently being processed by the `dispute-coordinator`. - pending_imports: FuturesUnordered, + /// Imports currently being processed. + pending_imports: PendingImports, + + /// We keep record of the last banned peers. + /// + /// This is needed because once we ban a peer, we will very likely still have pending requests + /// in the incoming channel - we should not waste time recovering availability for those, as we + /// already know the peer is malicious. + banned_peers: LruCache, /// Log received requests. metrics: Metrics, @@ -127,24 +100,36 @@ enum MuxedMessage { /// /// - We need to make sure responses are actually sent (therefore we need to await futures /// promptly). - /// - We need to punish peers whose import got rejected. - ConfirmedImport(ImportResult), + /// - We need to update `banned_peers` accordingly to the result. + ConfirmedImport(JfyiErrorResult<(PeerId, ImportStatementsResult)>), /// A new request has arrived and should be handled. NewRequest(IncomingRequest), +} - /// Rate limit timer hit - is is time to process one row of messages. - /// - /// This is the result of calling `self.peer_queues.pop_reqs()`. - WakePeerQueuesPopReqs(Vec>), - - /// It is time to check batches. - /// - /// Every `BATCH_COLLECTING_INTERVAL` we check whether less than `MIN_KEEP_BATCH_ALIVE_VOTES` - /// new votes arrived, if so the batch is ready for import. - /// - /// This is the result of calling `self.batches.check_batches()`. - WakeCheckBatches(Vec), +impl MuxedMessage { + async fn receive( + pending_imports: &mut PendingImports, + pending_requests: &mut IncomingRequestReceiver, + ) -> Result { + poll_fn(|ctx| { + let next_req = pending_requests.recv(|| vec![COST_INVALID_REQUEST]); + pin_mut!(next_req); + if let Poll::Ready(r) = next_req.poll(ctx) { + return match r { + Err(e) => Poll::Ready(Err(incoming::Error::from(e).into())), + Ok(v) => Poll::Ready(Ok(Self::NewRequest(v))), + } + } + // In case of Ready(None) return `Pending` below - we want to wait for the next request + // in that case. + if let Poll::Ready(Some(v)) = pending_imports.poll_next_unpin(ctx) { + return Poll::Ready(Ok(Self::ConfirmedImport(v))) + } + Poll::Pending + }) + .await + } } impl DisputesReceiver @@ -161,17 +146,17 @@ where ) -> Self { let runtime = RuntimeInfo::new_with_config(runtime::Config { keystore: None, - session_cache_lru_size: NonZeroUsize::new(DISPUTE_WINDOW.get() as usize) - .expect("Dispute window can not be 0; qed"), + session_cache_lru_size: DISPUTE_WINDOW.get() as usize, }); Self { runtime, sender, receiver, - peer_queues: PeerQueues::new(), - batches: Batches::new(), authority_discovery, - pending_imports: FuturesUnordered::new(), + pending_imports: PendingImports::new(), + // Size of MAX_PARALLEL_IMPORTS ensures we are going to immediately get rid of any + // malicious requests still pending in the incoming queue. + banned_peers: LruCache::new(MAX_PARALLEL_IMPORTS), metrics, } } @@ -195,132 +180,60 @@ where } } - /// Actual work happening here in three phases: - /// - /// 1. Receive and queue incoming messages until the rate limit timer hits. - /// 2. Do import/batching for the head of all queues. - /// 3. Check and flush any ready batches. + /// Actual work happening here. async fn run_inner(&mut self) -> Result<()> { - let msg = self.receive_message().await?; + let msg = MuxedMessage::receive(&mut self.pending_imports, &mut self.receiver).await?; - match msg { - MuxedMessage::NewRequest(req) => { - // Phase 1: - self.metrics.on_received_request(); - self.dispatch_to_queues(req).await?; + let incoming = match msg { + // We need to clean up futures, to make sure responses are sent: + MuxedMessage::ConfirmedImport(m_bad) => { + self.ban_bad_peer(m_bad)?; + return Ok(()) }, - MuxedMessage::WakePeerQueuesPopReqs(reqs) => { - // Phase 2: - for req in reqs { - // No early return - we cannot cancel imports of one peer, because the import of - // another failed: - match log_error(self.start_import_or_batch(req).await) { - Ok(()) => {}, - Err(fatal) => return Err(fatal.into()), - } - } - }, - MuxedMessage::WakeCheckBatches(ready_imports) => { - // Phase 3: - self.import_ready_batches(ready_imports).await; - }, - MuxedMessage::ConfirmedImport(import_result) => { - self.update_imported_requests_metrics(&import_result); - // Confirm imports to requesters/punish them on invalid imports: - send_responses_to_requesters(import_result).await?; - }, - } - - Ok(()) - } - - /// Receive one `MuxedMessage`. - /// - /// - /// Dispatching events to messages as they happen. - async fn receive_message(&mut self) -> Result { - poll_fn(|ctx| { - // In case of Ready(None), we want to wait for pending requests: - if let Poll::Ready(Some(v)) = self.pending_imports.poll_next_unpin(ctx) { - return Poll::Ready(Ok(MuxedMessage::ConfirmedImport(v?))) - } - - let rate_limited = self.peer_queues.pop_reqs(); - pin_mut!(rate_limited); - // We poll rate_limit before batches, so we don't unnecessarily delay importing to - // batches. - if let Poll::Ready(reqs) = rate_limited.poll(ctx) { - return Poll::Ready(Ok(MuxedMessage::WakePeerQueuesPopReqs(reqs))) - } + MuxedMessage::NewRequest(req) => req, + }; - let ready_batches = self.batches.check_batches(); - pin_mut!(ready_batches); - if let Poll::Ready(ready_batches) = ready_batches.poll(ctx) { - return Poll::Ready(Ok(MuxedMessage::WakeCheckBatches(ready_batches))) - } + self.metrics.on_received_request(); - let next_req = self.receiver.recv(|| vec![COST_INVALID_REQUEST]); - pin_mut!(next_req); - if let Poll::Ready(r) = next_req.poll(ctx) { - return match r { - Err(e) => Poll::Ready(Err(incoming::Error::from(e).into())), - Ok(v) => Poll::Ready(Ok(MuxedMessage::NewRequest(v))), - } - } - Poll::Pending - }) - .await - } + let peer = incoming.peer; - /// Process incoming requests. - /// - /// - Check sender is authority - /// - Dispatch message to corresponding queue in `peer_queues`. - /// - If queue is full, drop message and change reputation of sender. - async fn dispatch_to_queues(&mut self, req: IncomingRequest) -> JfyiResult<()> { - let peer = req.peer; - // Only accept messages from validators, in case there are multiple `AuthorityId`s, we - // just take the first one. On session boundaries this might allow validators to double - // their rate limit for a short period of time, which seems acceptable. - let authority_id = match self - .authority_discovery - .get_authority_ids_by_peer_id(peer) - .await - .and_then(|s| s.into_iter().next()) - { - None => { - req.send_outgoing_response(OutgoingResponse { + // Only accept messages from validators: + if self.authority_discovery.get_authority_ids_by_peer_id(peer).await.is_none() { + incoming + .send_outgoing_response(OutgoingResponse { result: Err(()), reputation_changes: vec![COST_NOT_A_VALIDATOR], sent_feedback: None, }) - .map_err(|_| JfyiError::SendResponses(vec![peer]))?; - return Err(JfyiError::NotAValidator(peer).into()) - }, - Some(auth_id) => auth_id, - }; + .map_err(|_| JfyiError::SendResponse(peer))?; - // Queue request: - if let Err((authority_id, req)) = self.peer_queues.push_req(authority_id, req) { - req.send_outgoing_response(OutgoingResponse { - result: Err(()), - reputation_changes: vec![COST_APPARENT_FLOOD], - sent_feedback: None, - }) - .map_err(|_| JfyiError::SendResponses(vec![peer]))?; - return Err(JfyiError::AuthorityFlooding(authority_id)) + return Err(JfyiError::NotAValidator(peer).into()) } - Ok(()) + + // Immediately drop requests from peers that already have requests in flight or have + // been banned recently (flood protection): + if self.pending_imports.peer_is_pending(&peer) || self.banned_peers.contains(&peer) { + gum::trace!( + target: LOG_TARGET, + ?peer, + "Dropping message from peer (banned/pending import)" + ); + return Ok(()) + } + + // Wait for a free slot: + if self.pending_imports.len() >= MAX_PARALLEL_IMPORTS as usize { + // Wait for one to finish: + let r = self.pending_imports.next().await; + self.ban_bad_peer(r.expect("pending_imports.len() is greater 0. qed."))?; + } + + // All good - initiate import. + self.start_import(incoming).await } - /// Start importing votes for the given request or batch. - /// - /// Signature check and in case we already have an existing batch we import to that batch, - /// otherwise import to `dispute-coordinator` directly and open a batch. - async fn start_import_or_batch( - &mut self, - incoming: IncomingRequest, - ) -> Result<()> { + /// Start importing votes for the given request. + async fn start_import(&mut self, incoming: IncomingRequest) -> Result<()> { let IncomingRequest { peer, payload, pending_response } = incoming; let info = self @@ -350,172 +263,128 @@ where Ok(votes) => votes, }; - let candidate_hash = *valid_vote.0.candidate_hash(); - - match self.batches.find_batch(candidate_hash, candidate_receipt)? { - FoundBatch::Created(batch) => { - // There was no entry yet - start import immediately: - gum::trace!( - target: LOG_TARGET, - ?candidate_hash, - ?peer, - "No batch yet - triggering immediate import" - ); - let import = PreparedImport { - candidate_receipt: batch.candidate_receipt().clone(), - statements: vec![valid_vote, invalid_vote], - requesters: vec![(peer, pending_response)], - }; - self.start_import(import).await; - }, - FoundBatch::Found(batch) => { - gum::trace!(target: LOG_TARGET, ?candidate_hash, "Batch exists - batching request"); - let batch_result = - batch.add_votes(valid_vote, invalid_vote, peer, pending_response); - - if let Err(pending_response) = batch_result { - // We don't expect honest peers to send redundant votes within a single batch, - // as the timeout for retry is much higher. Still we don't want to punish the - // node as it might not be the node's fault. Some other (malicious) node could have been - // faster sending the same votes in order to harm the reputation of that honest - // node. Given that we already have a rate limit, if a validator chooses to - // waste available rate with redundant votes - so be it. The actual dispute - // resolution is unaffected. - gum::debug!( - target: LOG_TARGET, - ?peer, - "Peer sent completely redundant votes within a single batch - that looks fishy!", - ); - pending_response - .send_outgoing_response(OutgoingResponse { - // While we have seen duplicate votes, we cannot confirm as we don't - // know yet whether the batch is going to be confirmed, so we assume - // the worst. We don't want to push the pending response to the batch - // either as that would be unbounded, only limited by the rate limit. - result: Err(()), - reputation_changes: Vec::new(), - sent_feedback: None, - }) - .map_err(|_| JfyiError::SendResponses(vec![peer]))?; - return Err(From::from(JfyiError::RedundantMessage(peer))) - } - }, - } + let (pending_confirmation, confirmation_rx) = oneshot::channel(); + self.sender + .send_message(DisputeCoordinatorMessage::ImportStatements { + candidate_receipt, + session: valid_vote.0.session_index(), + statements: vec![valid_vote, invalid_vote], + pending_confirmation: Some(pending_confirmation), + }) + .await; + self.pending_imports.push(peer, confirmation_rx, pending_response); Ok(()) } - /// Trigger import into the dispute-coordinator of ready batches (`PreparedImport`s). - async fn import_ready_batches(&mut self, ready_imports: Vec) { - for import in ready_imports { - self.start_import(import).await; + /// Await an import and ban any misbehaving peers. + /// + /// In addition we report import metrics. + fn ban_bad_peer( + &mut self, + result: JfyiErrorResult<(PeerId, ImportStatementsResult)>, + ) -> JfyiErrorResult<()> { + match result? { + (_, ImportStatementsResult::ValidImport) => { + self.metrics.on_imported(SUCCEEDED); + }, + (bad_peer, ImportStatementsResult::InvalidImport) => { + self.metrics.on_imported(FAILED); + self.banned_peers.put(bad_peer, ()); + }, } + Ok(()) } +} - /// Start import and add response receiver to `pending_imports`. - async fn start_import(&mut self, import: PreparedImport) { - let PreparedImport { candidate_receipt, statements, requesters } = import; - let (session_index, candidate_hash) = match statements.iter().next() { - None => { - gum::debug!( - target: LOG_TARGET, - candidate_hash = ?candidate_receipt.hash(), - "Not importing empty batch" - ); - return - }, - Some(vote) => (vote.0.session_index(), vote.0.candidate_hash().clone()), - }; +/// Manage pending imports in a way that preserves invariants. +struct PendingImports { + /// Futures in flight. + futures: + FuturesUnordered)>>, + /// Peers whose requests are currently in flight. + peers: HashSet, +} - let (pending_confirmation, confirmation_rx) = oneshot::channel(); - self.sender - .send_message(DisputeCoordinatorMessage::ImportStatements { - candidate_receipt, - session: session_index, - statements, - pending_confirmation: Some(pending_confirmation), - }) - .await; +impl PendingImports { + pub fn new() -> Self { + Self { futures: FuturesUnordered::new(), peers: HashSet::new() } + } - let pending = - PendingImport { candidate_hash, requesters, pending_response: confirmation_rx }; + pub fn push( + &mut self, + peer: PeerId, + handled: oneshot::Receiver, + pending_response: OutgoingResponseSender, + ) { + self.peers.insert(peer); + self.futures.push( + async move { + let r = respond_to_request(peer, handled, pending_response).await; + (peer, r) + } + .boxed(), + ) + } - self.pending_imports.push(pending); + /// Returns the number of contained futures. + pub fn len(&self) -> usize { + self.futures.len() } - fn update_imported_requests_metrics(&self, result: &ImportResult) { - let label = match result.result { - ImportStatementsResult::ValidImport => SUCCEEDED, - ImportStatementsResult::InvalidImport => FAILED, - }; - self.metrics.on_imported(label, result.requesters.len()); + /// Check whether a peer has a pending import. + pub fn peer_is_pending(&self, peer: &PeerId) -> bool { + self.peers.contains(peer) } } -async fn send_responses_to_requesters(import_result: ImportResult) -> JfyiResult<()> { - let ImportResult { requesters, result } = import_result; +impl Stream for PendingImports { + type Item = JfyiErrorResult<(PeerId, ImportStatementsResult)>; + fn poll_next(mut self: Pin<&mut Self>, ctx: &mut Context<'_>) -> Poll> { + match Pin::new(&mut self.futures).poll_next(ctx) { + Poll::Pending => Poll::Pending, + Poll::Ready(None) => Poll::Ready(None), + Poll::Ready(Some((peer, result))) => { + self.peers.remove(&peer); + Poll::Ready(Some(result.map(|r| (peer, r)))) + }, + } + } +} +impl FusedStream for PendingImports { + fn is_terminated(&self) -> bool { + self.futures.is_terminated() + } +} - let mk_response = match result { - ImportStatementsResult::ValidImport => || OutgoingResponse { +// Future for `PendingImports` +// +// - Wait for import +// - Punish peer +// - Deliver result +async fn respond_to_request( + peer: PeerId, + handled: oneshot::Receiver, + pending_response: OutgoingResponseSender, +) -> JfyiErrorResult { + let result = handled.await.map_err(|_| JfyiError::ImportCanceled(peer))?; + + let response = match result { + ImportStatementsResult::ValidImport => OutgoingResponse { result: Ok(DisputeResponse::Confirmed), reputation_changes: Vec::new(), sent_feedback: None, }, - ImportStatementsResult::InvalidImport => || OutgoingResponse { + ImportStatementsResult::InvalidImport => OutgoingResponse { result: Err(()), - reputation_changes: vec![COST_INVALID_IMPORT], + reputation_changes: vec![COST_INVALID_CANDIDATE], sent_feedback: None, }, }; - let mut sending_failed_for = Vec::new(); - for (peer, pending_response) in requesters { - if let Err(()) = pending_response.send_outgoing_response(mk_response()) { - sending_failed_for.push(peer); - } - } - - if !sending_failed_for.is_empty() { - Err(JfyiError::SendResponses(sending_failed_for)) - } else { - Ok(()) - } -} + pending_response + .send_outgoing_response(response) + .map_err(|_| JfyiError::SendResponse(peer))?; -/// A future that resolves into an `ImportResult` when ready. -/// -/// This future is used on `dispute-coordinator` import messages for the oneshot response receiver -/// to: -/// - Keep track of concerned `CandidateHash` for reporting errors. -/// - Keep track of requesting peers so we can confirm the import/punish them on invalid imports. -struct PendingImport { - candidate_hash: CandidateHash, - requesters: Vec<(PeerId, OutgoingResponseSender)>, - pending_response: oneshot::Receiver, -} - -/// A `PendingImport` becomes an `ImportResult` once done. -struct ImportResult { - /// Requesters of that import. - requesters: Vec<(PeerId, OutgoingResponseSender)>, - /// Actual result of the import. - result: ImportStatementsResult, -} - -impl PendingImport { - async fn wait_for_result(&mut self) -> JfyiResult { - let result = (&mut self.pending_response) - .await - .map_err(|_| JfyiError::ImportCanceled(self.candidate_hash))?; - Ok(ImportResult { requesters: std::mem::take(&mut self.requesters), result }) - } -} - -impl Future for PendingImport { - type Output = JfyiResult; - fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - let fut = self.wait_for_result(); - pin_mut!(fut); - fut.poll(cx) - } + Ok(result) } diff --git a/node/network/dispute-distribution/src/receiver/peer_queues.rs b/node/network/dispute-distribution/src/receiver/peer_queues.rs deleted file mode 100644 index 138b59c3f867..000000000000 --- a/node/network/dispute-distribution/src/receiver/peer_queues.rs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright 2022 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 . - -use std::collections::{hash_map::Entry, HashMap, VecDeque}; - -use futures::future::pending; -use futures_timer::Delay; -use polkadot_node_network_protocol::request_response::{v1::DisputeRequest, IncomingRequest}; -use polkadot_primitives::v2::AuthorityDiscoveryId; - -use crate::RECEIVE_RATE_LIMIT; - -/// How many messages we are willing to queue per peer (validator). -/// -/// The larger this value is, the larger bursts are allowed to be without us dropping messages. On -/// the flip side this gets allocated per validator, so for a size of 10 this will result -/// in `10_000 * size_of(IncomingRequest)` in the worst case. -/// -/// `PEER_QUEUE_CAPACITY` must not be 0 for obvious reasons. -#[cfg(not(test))] -pub const PEER_QUEUE_CAPACITY: usize = 10; -#[cfg(test)] -pub const PEER_QUEUE_CAPACITY: usize = 2; - -/// Queues for messages from authority peers for rate limiting. -/// -/// Invariants ensured: -/// -/// 1. No queue will ever have more than `PEER_QUEUE_CAPACITY` elements. -/// 2. There are no empty queues. Whenever a queue gets empty, it is removed. This way checking -/// whether there are any messages queued is cheap. -/// 3. As long as not empty, `pop_reqs` will, if called in sequence, not return `Ready` more often -/// than once for every `RECEIVE_RATE_LIMIT`, but it will always return Ready eventually. -/// 4. If empty `pop_reqs` will never return `Ready`, but will always be `Pending`. -pub struct PeerQueues { - /// Actual queues. - queues: HashMap>>, - - /// Delay timer for establishing the rate limit. - rate_limit_timer: Option, -} - -impl PeerQueues { - /// New empty `PeerQueues`. - pub fn new() -> Self { - Self { queues: HashMap::new(), rate_limit_timer: None } - } - - /// Push an incoming request for a given authority. - /// - /// Returns: `Ok(())` if succeeded, `Err((args))` if capacity is reached. - pub fn push_req( - &mut self, - peer: AuthorityDiscoveryId, - req: IncomingRequest, - ) -> Result<(), (AuthorityDiscoveryId, IncomingRequest)> { - let queue = match self.queues.entry(peer) { - Entry::Vacant(vacant) => vacant.insert(VecDeque::new()), - Entry::Occupied(occupied) => { - if occupied.get().len() >= PEER_QUEUE_CAPACITY { - return Err((occupied.key().clone(), req)) - } - occupied.into_mut() - }, - }; - queue.push_back(req); - - // We have at least one element to process - rate limit `timer` needs to exist now: - self.ensure_timer(); - Ok(()) - } - - /// Pop all heads and return them for processing. - /// - /// This gets one message from each peer that has sent at least one. - /// - /// This function is rate limited, if called in sequence it will not return more often than - /// every `RECEIVE_RATE_LIMIT`. - /// - /// NOTE: If empty this function will not return `Ready` at all, but will always be `Pending`. - pub async fn pop_reqs(&mut self) -> Vec> { - self.wait_for_timer().await; - - let mut heads = Vec::with_capacity(self.queues.len()); - let old_queues = std::mem::replace(&mut self.queues, HashMap::new()); - for (k, mut queue) in old_queues.into_iter() { - let front = queue.pop_front(); - debug_assert!(front.is_some(), "Invariant that queues are never empty is broken."); - - if let Some(front) = front { - heads.push(front); - } - if !queue.is_empty() { - self.queues.insert(k, queue); - } - } - - if !self.is_empty() { - // Still not empty - we should get woken at some point. - self.ensure_timer(); - } - - heads - } - - /// Whether or not all queues are empty. - pub fn is_empty(&self) -> bool { - self.queues.is_empty() - } - - /// Ensure there is an active `timer`. - /// - /// Checks whether one exists and if not creates one. - fn ensure_timer(&mut self) -> &mut Delay { - self.rate_limit_timer.get_or_insert(Delay::new(RECEIVE_RATE_LIMIT)) - } - - /// Wait for `timer` if it exists, or be `Pending` forever. - /// - /// Afterwards it gets set back to `None`. - async fn wait_for_timer(&mut self) { - match self.rate_limit_timer.as_mut() { - None => pending().await, - Some(timer) => timer.await, - } - self.rate_limit_timer = None; - } -} diff --git a/node/network/dispute-distribution/src/sender/mod.rs b/node/network/dispute-distribution/src/sender/mod.rs index 09b902173ede..5312528b413e 100644 --- a/node/network/dispute-distribution/src/sender/mod.rs +++ b/node/network/dispute-distribution/src/sender/mod.rs @@ -14,21 +14,10 @@ // You should have received a copy of the GNU General Public License // along with Polkadot. If not, see . -use std::{ - collections::{HashMap, HashSet}, - pin::Pin, - task::Poll, - time::Duration, -}; - -use futures::{ - channel::{mpsc, oneshot}, - future::poll_fn, - Future, -}; - -use futures_timer::Delay; -use indexmap::{map::Entry, IndexMap}; +use std::collections::{hash_map::Entry, HashMap, HashSet}; + +use futures::channel::{mpsc, oneshot}; + use polkadot_node_network_protocol::request_response::v1::DisputeRequest; use polkadot_node_primitives::{CandidateVotes, DisputeMessage, SignedDisputeStatement}; use polkadot_node_subsystem::{messages::DisputeCoordinatorMessage, overseer, ActiveLeavesUpdate}; @@ -39,27 +28,22 @@ use polkadot_primitives::v2::{CandidateHash, DisputeStatement, Hash, SessionInde /// /// It is going to spawn real tasks as it sees fit for getting the votes of the particular dispute /// out. -/// -/// As we assume disputes have a priority, we start sending for disputes in the order -/// `start_sender` got called. mod send_task; use send_task::SendTask; pub use send_task::TaskFinish; -/// Error and [`Result`] type for sender. +/// Error and [`Result`] type for sender mod error; pub use error::{Error, FatalError, JfyiError, Result}; use self::error::JfyiErrorResult; -use crate::{Metrics, LOG_TARGET, SEND_RATE_LIMIT}; +use crate::{Metrics, LOG_TARGET}; /// The `DisputeSender` keeps track of all ongoing disputes we need to send statements out. /// /// For each dispute a `SendTask` is responsible for sending to the concerned validators for that /// particular dispute. The `DisputeSender` keeps track of those tasks, informs them about new /// sessions/validator sets and cleans them up when they become obsolete. -/// -/// The unit of work for the `DisputeSender` is a dispute, represented by `SendTask`s. pub struct DisputeSender { /// All heads we currently consider active. active_heads: Vec, @@ -70,16 +54,11 @@ pub struct DisputeSender { active_sessions: HashMap, /// All ongoing dispute sendings this subsystem is aware of. - /// - /// Using an `IndexMap` so items can be iterated in the order of insertion. - disputes: IndexMap, + disputes: HashMap, /// Sender to be cloned for `SendTask`s. tx: mpsc::Sender, - /// Future for delaying too frequent creation of dispute sending tasks. - rate_limit: RateLimit, - /// Metrics for reporting stats about sent requests. metrics: Metrics, } @@ -91,25 +70,19 @@ impl DisputeSender { Self { active_heads: Vec::new(), active_sessions: HashMap::new(), - disputes: IndexMap::new(), + disputes: HashMap::new(), tx, - rate_limit: RateLimit::new(), metrics, } } /// Create a `SendTask` for a particular new dispute. - /// - /// This function is rate-limited by `SEND_RATE_LIMIT`. It will block if called too frequently - /// in order to maintain the limit. pub async fn start_sender( &mut self, ctx: &mut Context, runtime: &mut RuntimeInfo, msg: DisputeMessage, ) -> Result<()> { - self.rate_limit.limit().await; - let req: DisputeRequest = msg.into(); let candidate_hash = req.0.candidate_receipt.hash(); match self.disputes.entry(candidate_hash) { @@ -139,8 +112,6 @@ impl DisputeSender { /// - Get new authorities to send messages to. /// - Get rid of obsolete tasks and disputes. /// - Get dispute sending started in case we missed one for some reason (e.g. on node startup) - /// - /// This function ensures the `SEND_RATE_LIMIT`, therefore it might block. pub async fn update_leaves( &mut self, ctx: &mut Context, @@ -163,38 +134,21 @@ impl DisputeSender { let active_disputes: HashSet<_> = active_disputes.into_iter().map(|(_, c)| c).collect(); - // Cleanup obsolete senders (retain keeps order of remaining elements): + // Cleanup obsolete senders: self.disputes .retain(|candidate_hash, _| active_disputes.contains(candidate_hash)); - // Iterates in order of insertion: - let mut should_rate_limit = true; for dispute in self.disputes.values_mut() { if have_new_sessions || dispute.has_failed_sends() { - if should_rate_limit { - self.rate_limit.limit().await; - } - let sends_happened = dispute + dispute .refresh_sends(ctx, runtime, &self.active_sessions, &self.metrics) .await?; - // Only rate limit if we actually sent something out _and_ it was not just because - // of errors on previous sends. - // - // Reasoning: It would not be acceptable to slow down the whole subsystem, just - // because of a few bad peers having problems. It is actually better to risk - // running into their rate limit in that case and accept a minor reputation change. - should_rate_limit = sends_happened && have_new_sessions; } } - // This should only be non-empty on startup, but if not - we got you covered. - // - // Initial order will not be maintained in that case, but that should be fine as disputes - // recovered at startup will be relatively "old" anyway and we assume that no more than a - // third of the validators will go offline at any point in time anyway. + // This should only be non-empty on startup, but if not - we got you covered: for dispute in unknown_disputes { - self.rate_limit.limit().await; - self.start_send_for_dispute(ctx, runtime, dispute).await?; + self.start_send_for_dispute(ctx, runtime, dispute).await? } Ok(()) } @@ -363,46 +317,6 @@ impl DisputeSender { } } -/// Rate limiting logic. -/// -/// Suitable for the sending side. -struct RateLimit { - limit: Delay, -} - -impl RateLimit { - /// Create new `RateLimit` that is immediately ready. - fn new() -> Self { - // Start with an empty duration, as there has not been any previous call. - Self { limit: Delay::new(Duration::new(0, 0)) } - } - - /// Initialized with actual `SEND_RATE_LIMIT` duration. - fn new_limit() -> Self { - Self { limit: Delay::new(SEND_RATE_LIMIT) } - } - - /// Wait until ready and prepare for next call. - async fn limit(&mut self) { - // Wait for rate limit and add some logging: - poll_fn(|cx| { - let old_limit = Pin::new(&mut self.limit); - match old_limit.poll(cx) { - Poll::Pending => { - gum::debug!( - target: LOG_TARGET, - "Sending rate limit hit, slowing down requests" - ); - Poll::Pending - }, - Poll::Ready(()) => Poll::Ready(()), - } - }) - .await; - *self = Self::new_limit(); - } -} - /// Retrieve the currently active sessions. /// /// List is all indices of all active sessions together with the head that was used for the query. diff --git a/node/network/dispute-distribution/src/sender/send_task.rs b/node/network/dispute-distribution/src/sender/send_task.rs index 89b5c099bde9..a2b8cdcf7441 100644 --- a/node/network/dispute-distribution/src/sender/send_task.rs +++ b/node/network/dispute-distribution/src/sender/send_task.rs @@ -42,15 +42,13 @@ use crate::{ /// Delivery status for a particular dispute. /// /// Keeps track of all the validators that have to be reached for a dispute. -/// -/// The unit of work for a `SendTask` is an authority/validator. pub struct SendTask { - /// The request we are supposed to get out to all `parachain` validators of the dispute's session + /// The request we are supposed to get out to all parachain validators of the dispute's session /// and to all current authorities. request: DisputeRequest, /// The set of authorities we need to send our messages to. This set will change at session - /// boundaries. It will always be at least the `parachain` validators of the session where the + /// boundaries. It will always be at least the parachain validators of the session where the /// dispute happened and the authorities of the current sessions as determined by active heads. deliveries: HashMap, @@ -102,10 +100,6 @@ impl TaskResult { #[overseer::contextbounds(DisputeDistribution, prefix = self::overseer)] impl SendTask { /// Initiates sending a dispute message to peers. - /// - /// Creation of new `SendTask`s is subject to rate limiting. As each `SendTask` will trigger - /// sending a message to each validator, hence for employing a per-peer rate limit, we need to - /// limit the construction of new `SendTask`s. pub async fn new( ctx: &mut Context, runtime: &mut RuntimeInfo, @@ -124,22 +118,15 @@ impl SendTask { /// /// This function is called at construction and should also be called whenever a session change /// happens and on a regular basis to ensure we are retrying failed attempts. - /// - /// This might resend to validators and is thus subject to any rate limiting we might want. - /// Calls to this function for different instances should be rate limited according to - /// `SEND_RATE_LIMIT`. - /// - /// Returns: `True` if this call resulted in new requests. pub async fn refresh_sends( &mut self, ctx: &mut Context, runtime: &mut RuntimeInfo, active_sessions: &HashMap, metrics: &Metrics, - ) -> Result { + ) -> Result<()> { let new_authorities = self.get_relevant_validators(ctx, runtime, active_sessions).await?; - // Note this will also contain all authorities for which sending failed previously: let add_authorities = new_authorities .iter() .filter(|a| !self.deliveries.contains_key(a)) @@ -154,14 +141,12 @@ impl SendTask { send_requests(ctx, self.tx.clone(), add_authorities, self.request.clone(), metrics) .await?; - let was_empty = new_statuses.is_empty(); - self.has_failed_sends = false; self.deliveries.extend(new_statuses.into_iter()); - Ok(!was_empty) + Ok(()) } - /// Whether any sends have failed since the last refresh. + /// Whether any sends have failed since the last refreshed. pub fn has_failed_sends(&self) -> bool { self.has_failed_sends } @@ -208,8 +193,9 @@ impl SendTask { /// Determine all validators that should receive the given dispute requests. /// - /// This is all `parachain` validators of the session the candidate occurred and all authorities + /// This is all parachain validators of the session the candidate occurred and all authorities /// of all currently active sessions, determined by currently active heads. + async fn get_relevant_validators( &self, ctx: &mut Context, @@ -307,7 +293,7 @@ async fn wait_response_task( gum::debug!( target: LOG_TARGET, %err, - "Failed to notify subsystem about dispute sending result." + "Failed to notify susystem about dispute sending result." ); } } diff --git a/node/network/dispute-distribution/src/tests/mock.rs b/node/network/dispute-distribution/src/tests/mock.rs index aa2a4485d480..08428d5852cc 100644 --- a/node/network/dispute-distribution/src/tests/mock.rs +++ b/node/network/dispute-distribution/src/tests/mock.rs @@ -20,7 +20,6 @@ use std::{ collections::{HashMap, HashSet}, sync::Arc, - time::Instant, }; use async_trait::async_trait; @@ -39,8 +38,6 @@ use polkadot_primitives::v2::{ }; use polkadot_primitives_test_helpers::dummy_candidate_descriptor; -use crate::LOG_TARGET; - pub const MOCK_SESSION_INDEX: SessionIndex = 1; pub const MOCK_NEXT_SESSION_INDEX: SessionIndex = 2; pub const MOCK_VALIDATORS: [Sr25519Keyring; 6] = [ @@ -57,8 +54,6 @@ pub const MOCK_AUTHORITIES_NEXT_SESSION: [Sr25519Keyring; 2] = pub const FERDIE_INDEX: ValidatorIndex = ValidatorIndex(0); pub const ALICE_INDEX: ValidatorIndex = ValidatorIndex(1); -pub const BOB_INDEX: ValidatorIndex = ValidatorIndex(2); -pub const CHARLIE_INDEX: ValidatorIndex = ValidatorIndex(3); lazy_static! { @@ -153,22 +148,12 @@ pub async fn make_dispute_message( invalid_validator: ValidatorIndex, ) -> DisputeMessage { let candidate_hash = candidate.hash(); - let before_request = Instant::now(); let valid_vote = make_explicit_signed(MOCK_VALIDATORS[valid_validator.0 as usize], candidate_hash, true) .await; - gum::trace!( - "Passed time for valid vote: {:#?}", - Instant::now().saturating_duration_since(before_request) - ); - let before_request = Instant::now(); let invalid_vote = make_explicit_signed(MOCK_VALIDATORS[invalid_validator.0 as usize], candidate_hash, false) .await; - gum::trace!( - "Passed time for invald vote: {:#?}", - Instant::now().saturating_duration_since(before_request) - ); DisputeMessage::from_signed_statements( valid_vote, valid_validator, @@ -221,15 +206,10 @@ impl AuthorityDiscovery for MockAuthorityDiscovery { ) -> Option> { for (a, p) in self.peer_ids.iter() { if p == &peer_id { - let result = - HashSet::from([MOCK_VALIDATORS_DISCOVERY_KEYS.get(&a).unwrap().clone()]); - gum::trace!( - target: LOG_TARGET, - %peer_id, - ?result, - "Returning authority ids for peer id" - ); - return Some(result) + return Some(HashSet::from([MOCK_VALIDATORS_DISCOVERY_KEYS + .get(&a) + .unwrap() + .clone()])) } } diff --git a/node/network/dispute-distribution/src/tests/mod.rs b/node/network/dispute-distribution/src/tests/mod.rs index 56cdd467fd62..8ef8286ea197 100644 --- a/node/network/dispute-distribution/src/tests/mod.rs +++ b/node/network/dispute-distribution/src/tests/mod.rs @@ -17,17 +17,12 @@ //! Subsystem unit tests -use std::{ - collections::HashSet, - sync::Arc, - task::Poll, - time::{Duration, Instant}, -}; +use std::{collections::HashSet, sync::Arc, task::Poll, time::Duration}; use assert_matches::assert_matches; use futures::{ channel::{mpsc, oneshot}, - future::{poll_fn, ready}, + future::poll_fn, pin_mut, Future, SinkExt, }; use futures_timer::Delay; @@ -57,7 +52,7 @@ use polkadot_node_subsystem_test_helpers::{ mock::make_ferdie_keystore, subsystem_test_harness, TestSubsystemContextHandle, }; use polkadot_primitives::v2::{ - AuthorityDiscoveryId, CandidateHash, CandidateReceipt, Hash, SessionIndex, SessionInfo, + AuthorityDiscoveryId, CandidateHash, Hash, SessionIndex, SessionInfo, }; use self::mock::{ @@ -65,11 +60,7 @@ use self::mock::{ MOCK_AUTHORITY_DISCOVERY, MOCK_NEXT_SESSION_INDEX, MOCK_NEXT_SESSION_INFO, MOCK_SESSION_INDEX, MOCK_SESSION_INFO, }; -use crate::{ - receiver::BATCH_COLLECTING_INTERVAL, - tests::mock::{BOB_INDEX, CHARLIE_INDEX}, - DisputeDistributionSubsystem, Metrics, LOG_TARGET, SEND_RATE_LIMIT, -}; +use crate::{DisputeDistributionSubsystem, Metrics, LOG_TARGET}; /// Useful mock providers. pub mod mock; @@ -81,108 +72,49 @@ fn send_dispute_sends_dispute() { let relay_parent = Hash::random(); let candidate = make_candidate_receipt(relay_parent); - send_dispute(&mut handle, candidate, true).await; - conclude(&mut handle).await; - }; - test_harness(test); -} - -#[test] -fn send_honors_rate_limit() { - sp_tracing::try_init_simple(); - let test = |mut handle: TestSubsystemContextHandle, _req_cfg| async move { - let _ = handle_subsystem_startup(&mut handle, None).await; - - let relay_parent = Hash::random(); - let candidate = make_candidate_receipt(relay_parent); - let before_request = Instant::now(); - send_dispute(&mut handle, candidate, true).await; - // First send should not be rate limited: - gum::trace!("Passed time: {:#?}", Instant::now().saturating_duration_since(before_request)); - // This test would likely be flaky on CI: - //assert!(Instant::now().saturating_duration_since(before_request) < SEND_RATE_LIMIT); - - let relay_parent = Hash::random(); - let candidate = make_candidate_receipt(relay_parent); - send_dispute(&mut handle, candidate, false).await; - // Second send should be rate limited: - gum::trace!( - "Passed time for send_dispute: {:#?}", - Instant::now().saturating_duration_since(before_request) - ); - assert!(Instant::now() - before_request >= SEND_RATE_LIMIT); - conclude(&mut handle).await; - }; - test_harness(test); -} - -/// Helper for sending a new dispute to dispute-distribution sender and handling resulting messages. -async fn send_dispute( - handle: &mut TestSubsystemContextHandle, - candidate: CandidateReceipt, - needs_session_info: bool, -) { - let before_request = Instant::now(); - let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; - gum::trace!( - "Passed time for making message: {:#?}", - Instant::now().saturating_duration_since(before_request) - ); - let before_request = Instant::now(); - handle - .send(FromOrchestra::Communication { - msg: DisputeDistributionMessage::SendDispute(message.clone()), - }) - .await; - gum::trace!( - "Passed time for sending message: {:#?}", - Instant::now().saturating_duration_since(before_request) - ); - if needs_session_info { + let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; + handle + .send(FromOrchestra::Communication { + msg: DisputeDistributionMessage::SendDispute(message.clone()), + }) + .await; // Requests needed session info: assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi( - RuntimeApiMessage::Request( - hash, - RuntimeApiRequest::SessionInfo(session_index, tx) + handle.recv().await, + AllMessages::RuntimeApi( + RuntimeApiMessage::Request( + hash, + RuntimeApiRequest::SessionInfo(session_index, tx) ) ) => { - assert_eq!(session_index, MOCK_SESSION_INDEX); - assert_eq!( - hash, - message.candidate_receipt().descriptor.relay_parent + assert_eq!(session_index, MOCK_SESSION_INDEX); + assert_eq!( + hash, + message.candidate_receipt().descriptor.relay_parent ); - tx.send(Ok(Some(MOCK_SESSION_INFO.clone()))).expect("Receiver should stay alive."); - } + tx.send(Ok(Some(MOCK_SESSION_INFO.clone()))).expect("Receiver should stay alive."); + } ); - } - let expected_receivers = { - let info = &MOCK_SESSION_INFO; - info.discovery_keys - .clone() - .into_iter() - .filter(|a| a != &Sr25519Keyring::Ferdie.public().into()) - .collect() - // All validators are also authorities in the first session, so we are - // done here. + let expected_receivers = { + let info = &MOCK_SESSION_INFO; + info.discovery_keys + .clone() + .into_iter() + .filter(|a| a != &Sr25519Keyring::Ferdie.public().into()) + .collect() + // All validators are also authorities in the first session, so we are + // done here. + }; + check_sent_requests(&mut handle, expected_receivers, true).await; + + conclude(&mut handle).await; }; - check_sent_requests(handle, expected_receivers, true).await; + test_harness(test); } -// Things to test: -// x Request triggers import -// x Subsequent imports get batched -// x Batch gets flushed. -// x Batch gets renewed. -// x Non authority requests get dropped. -// x Sending rate limit is honored. -// x Receiving rate limit is honored. -// x Duplicate requests on batch are dropped - #[test] -fn received_non_authorities_are_dropped() { +fn received_request_triggers_import() { let test = |mut handle: TestSubsystemContextHandle, mut req_cfg: RequestResponseConfig| async move { let req_tx = req_cfg.inbound_queue.as_mut().unwrap(); @@ -208,271 +140,110 @@ fn received_non_authorities_are_dropped() { assert_eq!(reputation_changes.len(), 1); } ); - conclude(&mut handle).await; - }; - test_harness(test); -} - -#[test] -fn received_request_triggers_import() { - let test = |mut handle: TestSubsystemContextHandle, - mut req_cfg: RequestResponseConfig| async move { - let req_tx = req_cfg.inbound_queue.as_mut().unwrap(); - let _ = handle_subsystem_startup(&mut handle, None).await; - - let relay_parent = Hash::random(); - let candidate = make_candidate_receipt(relay_parent); - let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; - - nested_network_dispute_request( - &mut handle, - req_tx, - MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Alice), - message.clone().into(), - ImportStatementsResult::ValidImport, - true, - move |_handle, _req_tx, _message| ready(()), - ) - .await; - - gum::trace!(target: LOG_TARGET, "Concluding."); - conclude(&mut handle).await; - }; - test_harness(test); -} - -#[test] -fn batching_works() { - let test = |mut handle: TestSubsystemContextHandle, - mut req_cfg: RequestResponseConfig| async move { - let req_tx = req_cfg.inbound_queue.as_mut().unwrap(); - let _ = handle_subsystem_startup(&mut handle, None).await; - let relay_parent = Hash::random(); - let candidate = make_candidate_receipt(relay_parent); - let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; - - // Initial request should get forwarded immediately: + // Nested valid and invalid import. + // + // Nested requests from same peer should get dropped. For the invalid request even + // subsequent requests should get dropped. nested_network_dispute_request( &mut handle, req_tx, MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Alice), message.clone().into(), - ImportStatementsResult::ValidImport, + ImportStatementsResult::InvalidImport, true, - move |_handle, _req_tx, _message| ready(()), + move |handle, req_tx, message| { + nested_network_dispute_request( + handle, + req_tx, + MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob), + message.clone().into(), + ImportStatementsResult::ValidImport, + false, + move |_, req_tx, message| async move { + // Another request from Alice should get dropped (request already in + // flight): + { + let rx_response = send_network_dispute_request( + req_tx, + MOCK_AUTHORITY_DISCOVERY + .get_peer_id_by_authority(Sr25519Keyring::Alice), + message.clone(), + ) + .await; + + assert_matches!( + rx_response.await, + Err(err) => { + gum::trace!( + target: LOG_TARGET, + ?err, + "Request got dropped - other request already in flight" + ); + } + ); + } + // Another request from Bob should get dropped (request already in + // flight): + { + let rx_response = send_network_dispute_request( + req_tx, + MOCK_AUTHORITY_DISCOVERY + .get_peer_id_by_authority(Sr25519Keyring::Bob), + message.clone(), + ) + .await; + + assert_matches!( + rx_response.await, + Err(err) => { + gum::trace!( + target: LOG_TARGET, + ?err, + "Request got dropped - other request already in flight" + ); + } + ); + } + }, + ) + }, ) .await; - let mut rx_responses = Vec::new(); - - let message = make_dispute_message(candidate.clone(), BOB_INDEX, FERDIE_INDEX).await; - let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob); - rx_responses.push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); - - let message = make_dispute_message(candidate.clone(), CHARLIE_INDEX, FERDIE_INDEX).await; - let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Charlie); - rx_responses.push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); - gum::trace!("Imported 3 votes into batch"); - - Delay::new(BATCH_COLLECTING_INTERVAL).await; - gum::trace!("Batch should still be alive"); - // Batch should still be alive (2 new votes): - // Let's import two more votes, but fully duplicates - should not extend batch live. - gum::trace!("Importing duplicate votes"); - let mut rx_responses_duplicate = Vec::new(); - let message = make_dispute_message(candidate.clone(), BOB_INDEX, FERDIE_INDEX).await; - let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob); - rx_responses_duplicate - .push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); - - let message = make_dispute_message(candidate.clone(), CHARLIE_INDEX, FERDIE_INDEX).await; - let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Charlie); - rx_responses_duplicate - .push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); - - for rx_response in rx_responses_duplicate { - assert_matches!( - rx_response.await, - Ok(resp) => { - let sc_network::config::OutgoingResponse { - result, - reputation_changes, - sent_feedback: _, - } = resp; - gum::trace!( - target: LOG_TARGET, - ?reputation_changes, - "Received reputation changes." - ); - // We don't punish on that. - assert_eq!(reputation_changes.len(), 0); - - assert_matches!(result, Err(())); - } - ); - } - - Delay::new(BATCH_COLLECTING_INTERVAL).await; - gum::trace!("Batch should be ready now (only duplicates have been added)"); - - let pending_confirmation = assert_matches!( - handle.recv().await, - AllMessages::DisputeCoordinator( - DisputeCoordinatorMessage::ImportStatements { - candidate_receipt: _, - session, - statements, - pending_confirmation: Some(pending_confirmation), - } - ) => { - assert_eq!(session, MOCK_SESSION_INDEX); - assert_eq!(statements.len(), 3); - pending_confirmation - } - ); - pending_confirmation.send(ImportStatementsResult::ValidImport).unwrap(); + // Subsequent sends from Alice should fail (peer is banned): + { + let rx_response = send_network_dispute_request( + req_tx, + MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Alice), + message.clone().into(), + ) + .await; - for rx_response in rx_responses { assert_matches!( rx_response.await, - Ok(resp) => { - let sc_network::config::OutgoingResponse { - result, - reputation_changes: _, - sent_feedback, - } = resp; - - let result = result.unwrap(); - let decoded = - ::decode(&mut result.as_slice()).unwrap(); - - assert!(decoded == DisputeResponse::Confirmed); - if let Some(sent_feedback) = sent_feedback { - sent_feedback.send(()).unwrap(); - } + Err(err) => { gum::trace!( target: LOG_TARGET, - "Valid import happened." + ?err, + "Request got dropped - peer is banned." ); - } ); } - gum::trace!(target: LOG_TARGET, "Concluding."); - conclude(&mut handle).await; - }; - test_harness(test); -} - -#[test] -fn receive_rate_limit_is_enforced() { - let test = |mut handle: TestSubsystemContextHandle, - mut req_cfg: RequestResponseConfig| async move { - let req_tx = req_cfg.inbound_queue.as_mut().unwrap(); - let _ = handle_subsystem_startup(&mut handle, None).await; - - let relay_parent = Hash::random(); - let candidate = make_candidate_receipt(relay_parent); - let message = make_dispute_message(candidate.clone(), ALICE_INDEX, FERDIE_INDEX).await; - - // Initial request should get forwarded immediately: + // But should work fine for Bob: nested_network_dispute_request( &mut handle, req_tx, - MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Alice), + MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob), message.clone().into(), ImportStatementsResult::ValidImport, - true, - move |_handle, _req_tx, _message| ready(()), + false, + |_, _, _| async {}, ) .await; - let mut rx_responses = Vec::new(); - - let peer = MOCK_AUTHORITY_DISCOVERY.get_peer_id_by_authority(Sr25519Keyring::Bob); - - let message = make_dispute_message(candidate.clone(), BOB_INDEX, FERDIE_INDEX).await; - rx_responses.push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); - - let message = make_dispute_message(candidate.clone(), CHARLIE_INDEX, FERDIE_INDEX).await; - rx_responses.push(send_network_dispute_request(req_tx, peer, message.clone().into()).await); - - gum::trace!("Import one too much:"); - - let message = make_dispute_message(candidate.clone(), CHARLIE_INDEX, ALICE_INDEX).await; - let rx_response_flood = - send_network_dispute_request(req_tx, peer, message.clone().into()).await; - - assert_matches!( - rx_response_flood.await, - Ok(resp) => { - let sc_network::config::OutgoingResponse { - result: _, - reputation_changes, - sent_feedback: _, - } = resp; - gum::trace!( - target: LOG_TARGET, - ?reputation_changes, - "Received reputation changes." - ); - // Received punishment for flood: - assert_eq!(reputation_changes.len(), 1); - } - ); - gum::trace!("Need to wait 2 patch intervals:"); - Delay::new(BATCH_COLLECTING_INTERVAL).await; - Delay::new(BATCH_COLLECTING_INTERVAL).await; - - gum::trace!("Batch should be ready now"); - - let pending_confirmation = assert_matches!( - handle.recv().await, - AllMessages::DisputeCoordinator( - DisputeCoordinatorMessage::ImportStatements { - candidate_receipt: _, - session, - statements, - pending_confirmation: Some(pending_confirmation), - } - ) => { - assert_eq!(session, MOCK_SESSION_INDEX); - // Only 3 as fourth was flood: - assert_eq!(statements.len(), 3); - pending_confirmation - } - ); - pending_confirmation.send(ImportStatementsResult::ValidImport).unwrap(); - - for rx_response in rx_responses { - assert_matches!( - rx_response.await, - Ok(resp) => { - let sc_network::config::OutgoingResponse { - result, - reputation_changes: _, - sent_feedback, - } = resp; - - let result = result.unwrap(); - let decoded = - ::decode(&mut result.as_slice()).unwrap(); - - assert!(decoded == DisputeResponse::Confirmed); - if let Some(sent_feedback) = sent_feedback { - sent_feedback.send(()).unwrap(); - } - gum::trace!( - target: LOG_TARGET, - "Valid import happened." - ); - - } - ); - } - gum::trace!(target: LOG_TARGET, "Concluding."); conclude(&mut handle).await; }; diff --git a/node/network/protocol/src/request_response/mod.rs b/node/network/protocol/src/request_response/mod.rs index d24537e219c7..5f4740279ef6 100644 --- a/node/network/protocol/src/request_response/mod.rs +++ b/node/network/protocol/src/request_response/mod.rs @@ -121,10 +121,6 @@ const POV_RESPONSE_SIZE: u64 = MAX_POV_SIZE as u64 + 10_000; /// This is `MAX_CODE_SIZE` plus some additional space for protocol overhead. const STATEMENT_RESPONSE_SIZE: u64 = MAX_CODE_SIZE as u64 + 10_000; -/// We can have relative large timeouts here, there is no value of hitting a -/// timeout as we want to get statements through to each node in any case. -pub const DISPUTE_REQUEST_TIMEOUT: Duration = Duration::from_secs(12); - impl Protocol { /// Get a configuration for a given Request response protocol. /// @@ -198,7 +194,9 @@ impl Protocol { /// Responses are just confirmation, in essence not even a bit. So 100 seems /// plenty. max_response_size: 100, - request_timeout: DISPUTE_REQUEST_TIMEOUT, + /// We can have relative large timeouts here, there is no value of hitting a + /// timeout as we want to get statements through to each node in any case. + request_timeout: Duration::from_secs(12), inbound_queue: Some(tx), }, }; diff --git a/node/overseer/Cargo.toml b/node/overseer/Cargo.toml index 8ee3fc6fb3cd..0db382e4e783 100644 --- a/node/overseer/Cargo.toml +++ b/node/overseer/Cargo.toml @@ -17,8 +17,8 @@ polkadot-node-metrics = { path = "../metrics" } polkadot-primitives = { path = "../../primitives" } orchestra = "0.0.2" gum = { package = "tracing-gum", path = "../gum" } -lru = "0.8" -parity-util-mem = { version = "0.12.0", default-features = false } +lru = "0.7" +parity-util-mem = { version = "0.11.0", default-features = false } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } async-trait = "0.1.57" diff --git a/node/overseer/src/lib.rs b/node/overseer/src/lib.rs index 70dbe92b2432..1ce6a6fdb658 100644 --- a/node/overseer/src/lib.rs +++ b/node/overseer/src/lib.rs @@ -62,7 +62,6 @@ use std::{ collections::{hash_map, HashMap}, fmt::{self, Debug}, - num::NonZeroUsize, pin::Pin, sync::Arc, time::Duration, @@ -113,10 +112,7 @@ pub use orchestra::{ /// Store 2 days worth of blocks, not accounting for forks, /// in the LRU cache. Assumes a 6-second block time. -pub const KNOWN_LEAVES_CACHE_SIZE: NonZeroUsize = match NonZeroUsize::new(2 * 24 * 3600 / 6) { - Some(cap) => cap, - None => panic!("Known leaves cache size must be non-zero"), -}; +pub const KNOWN_LEAVES_CACHE_SIZE: usize = 2 * 24 * 3600 / 6; #[cfg(test)] mod tests; diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 63a5f189a32a..a9c9484b6eba 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -69,11 +69,11 @@ gum = { package = "tracing-gum", path = "../gum/" } serde = { version = "1.0.137", features = ["derive"] } serde_json = "1.0.81" thiserror = "1.0.31" -kvdb = "0.12.0" -kvdb-rocksdb = { version = "0.16.0", optional = true } +kvdb = "0.11.0" +kvdb-rocksdb = { version = "0.15.2", optional = true } parity-db = { version = "0.3.16", optional = true } async-trait = "0.1.57" -lru = "0.8" +lru = "0.7" # Polkadot polkadot-node-core-parachains-inherent = { path = "../core/parachains-inherent" } diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index 3619d05c7592..6425ee7a7536 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -1192,11 +1192,9 @@ where justifications_protocol_name, _phantom: core::marker::PhantomData::, }; - let payload_provider = beefy_primitives::mmr::MmrRootProvider::new(client.clone()); let beefy_params = beefy_gadget::BeefyParams { client: client.clone(), backend: backend.clone(), - payload_provider, runtime: client.clone(), key_store: keystore_opt.clone(), network_params, @@ -1206,7 +1204,7 @@ where on_demand_justifications_handler: beefy_on_demand_justifications_handler, }; - let gadget = beefy_gadget::start_beefy_gadget::<_, _, _, _, _, _>(beefy_params); + let gadget = beefy_gadget::start_beefy_gadget::<_, _, _, _, _>(beefy_params); // Wococo's purpose is to be a testbed for BEEFY, so if it fails we'll // bring the node down with it to make sure it is noticed. diff --git a/node/service/src/parachains_db/upgrade.rs b/node/service/src/parachains_db/upgrade.rs index 73321ae04c09..ad995f41ed82 100644 --- a/node/service/src/parachains_db/upgrade.rs +++ b/node/service/src/parachains_db/upgrade.rs @@ -121,7 +121,7 @@ fn rocksdb_migrate_from_version_0_to_1(path: &Path) -> Result<(), Error> { .to_str() .ok_or_else(|| super::other_io_error("Invalid database path".into()))?; let db_cfg = DatabaseConfig::with_columns(super::columns::v0::NUM_COLUMNS); - let mut db = Database::open(&db_cfg, db_path)?; + let db = Database::open(&db_cfg, db_path)?; db.add_column()?; db.add_column()?; diff --git a/node/subsystem-test-helpers/src/lib.rs b/node/subsystem-test-helpers/src/lib.rs index 79f833b7558c..e2e61c2006d8 100644 --- a/node/subsystem-test-helpers/src/lib.rs +++ b/node/subsystem-test-helpers/src/lib.rs @@ -30,7 +30,6 @@ use sp_core::testing::TaskExecutor; use std::{ convert::Infallible, - future::Future, pin::Pin, sync::Arc, task::{Context, Poll, Waker}, @@ -392,34 +391,6 @@ macro_rules! arbitrary_order { }; } -/// Future that yields the execution once and resolves -/// immediately after. -/// -/// Useful when one wants to poll the background task to completion -/// before sending messages to it in order to avoid races. -pub struct Yield(bool); - -impl Yield { - /// Returns new `Yield` future. - pub fn new() -> Self { - Self(false) - } -} - -impl Future for Yield { - type Output = (); - - fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - if !self.0 { - self.0 = true; - cx.waker().wake_by_ref(); - Poll::Pending - } else { - Poll::Ready(()) - } - } -} - #[cfg(test)] mod tests { use super::*; diff --git a/node/subsystem-util/Cargo.toml b/node/subsystem-util/Cargo.toml index 26eca7aa8f1f..a3985a898849 100644 --- a/node/subsystem-util/Cargo.toml +++ b/node/subsystem-util/Cargo.toml @@ -17,7 +17,7 @@ thiserror = "1.0.31" fatality = "0.0.6" gum = { package = "tracing-gum", path = "../gum" } derive_more = "0.99.17" -lru = "0.8.0" +lru = "0.7.7" polkadot-node-subsystem = {path = "../subsystem" } polkadot-node-jaeger = { path = "../jaeger" } @@ -32,8 +32,8 @@ 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" } -kvdb = "0.12.0" -parity-util-mem = { version = "0.12.0", default-features = false } +kvdb = "0.11.0" +parity-util-mem = { version = "0.11", default-features = false } parity-db = { version = "0.3.13" } [dev-dependencies] @@ -44,5 +44,5 @@ log = "0.4.17" polkadot-node-subsystem-test-helpers = { path = "../subsystem-test-helpers" } lazy_static = "1.4.0" polkadot-primitives-test-helpers = { path = "../../primitives/test-helpers" } -kvdb-shared-tests = "0.10.0" +kvdb-shared-tests = "0.9.0" tempfile = "3.1.0" diff --git a/node/subsystem-util/src/database.rs b/node/subsystem-util/src/database.rs index 6f338b5d6440..a6b31043302f 100644 --- a/node/subsystem-util/src/database.rs +++ b/node/subsystem-util/src/database.rs @@ -16,7 +16,7 @@ //! Database trait for polkadot db. -pub use kvdb::{DBKeyValue, DBTransaction, DBValue, KeyValueDB}; +pub use kvdb::{DBTransaction, DBValue, KeyValueDB}; /// Database trait with ordered key capacity. pub trait Database: KeyValueDB { @@ -27,7 +27,7 @@ pub trait Database: KeyValueDB { /// Implementation for database supporting `KeyValueDB` already. pub mod kvdb_impl { - use super::{DBKeyValue, DBTransaction, DBValue, Database, KeyValueDB}; + use super::{DBTransaction, DBValue, Database, KeyValueDB}; use kvdb::{DBOp, IoStats, IoStatsKind}; use parity_util_mem::{MallocSizeOf, MallocSizeOfOps}; use std::{collections::BTreeSet, io::Result}; @@ -86,7 +86,7 @@ pub mod kvdb_impl { self.db.get(col, key) } - fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Result> { + fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Option> { self.ensure_is_indexed(col); self.db.get_by_prefix(col, prefix) } @@ -96,7 +96,7 @@ pub mod kvdb_impl { self.db.write(transaction) } - fn iter<'a>(&'a self, col: u32) -> Box> + 'a> { + fn iter<'a>(&'a self, col: u32) -> Box, Box<[u8]>)> + 'a> { self.ensure_is_indexed(col); self.db.iter(col) } @@ -105,11 +105,15 @@ pub mod kvdb_impl { &'a self, col: u32, prefix: &'a [u8], - ) -> Box> + 'a> { + ) -> Box, Box<[u8]>)> + 'a> { self.ensure_is_indexed(col); self.db.iter_with_prefix(col, prefix) } + fn restore(&self, _new_db: &str) -> Result<()> { + unimplemented!("restore is unsupported") + } + fn io_stats(&self, kind: IoStatsKind) -> IoStats { self.db.io_stats(kind) } @@ -118,7 +122,7 @@ pub mod kvdb_impl { self.db.has_key(col, key) } - fn has_prefix(&self, col: u32, prefix: &[u8]) -> Result { + fn has_prefix(&self, col: u32, prefix: &[u8]) -> bool { self.ensure_is_indexed(col); self.db.has_prefix(col, prefix) } @@ -134,8 +138,8 @@ pub mod kvdb_impl { /// Utilities for using parity-db database. pub mod paritydb_impl { - use super::{DBKeyValue, DBTransaction, DBValue, Database, KeyValueDB}; - use kvdb::DBOp; + use super::{DBTransaction, DBValue, Database, KeyValueDB}; + use kvdb::{DBOp, IoStats, IoStatsKind}; use parity_db::Db; use parking_lot::Mutex; use std::{collections::BTreeSet, io::Result, sync::Arc}; @@ -175,20 +179,18 @@ pub mod paritydb_impl { map_err(self.db.get(col as u8, key)) } - fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Result> { - self.iter_with_prefix(col, prefix) - .next() - .transpose() - .map(|mb| mb.map(|(_, v)| v)) + fn get_by_prefix(&self, col: u32, prefix: &[u8]) -> Option> { + self.iter_with_prefix(col, prefix).next().map(|(_, v)| v) } - fn iter<'a>(&'a self, col: u32) -> Box> + 'a> { - let mut iter = match self.db.iter(col as u8) { - Ok(iter) => iter, - Err(e) => return Box::new(std::iter::once(map_err(Err(e)))), - }; + fn iter<'a>(&'a self, col: u32) -> Box, Box<[u8]>)> + 'a> { + let mut iter = handle_err(self.db.iter(col as u8)); Box::new(std::iter::from_fn(move || { - iter.next().transpose().map(|r| map_err(r.map(|(k, v)| (k.into(), v)))) + if let Some((key, value)) = handle_err(iter.next()) { + Some((key.into_boxed_slice(), value.into_boxed_slice())) + } else { + None + } })) } @@ -196,26 +198,39 @@ pub mod paritydb_impl { &'a self, col: u32, prefix: &'a [u8], - ) -> Box> + 'a> { + ) -> Box, Box<[u8]>)> + 'a> { if prefix.len() == 0 { return self.iter(col) } - let mut iter = match self.db.iter(col as u8) { - Ok(iter) => iter, - Err(e) => return Box::new(std::iter::once(map_err(Err(e)))), - }; - if let Err(e) = iter.seek(prefix) { - return Box::new(std::iter::once(map_err(Err(e)))) - } + let mut iter = handle_err(self.db.iter(col as u8)); + handle_err(iter.seek(prefix)); Box::new(std::iter::from_fn(move || { - iter.next().transpose().and_then(|r| { - map_err(r.map(|(k, v)| k.starts_with(prefix).then(|| (k.into(), v)))) - .transpose() - }) + if let Some((key, value)) = handle_err(iter.next()) { + key.starts_with(prefix) + .then(|| (key.into_boxed_slice(), value.into_boxed_slice())) + } else { + None + } })) } - fn write(&self, transaction: DBTransaction) -> Result<()> { + fn restore(&self, _new_db: &str) -> Result<()> { + unimplemented!("restore is unsupported") + } + + fn io_stats(&self, _kind: IoStatsKind) -> IoStats { + unimplemented!("io_stats not supported by parity_db"); + } + + fn has_key(&self, col: u32, key: &[u8]) -> Result { + map_err(self.db.get_size(col as u8, key).map(|r| r.is_some())) + } + + fn has_prefix(&self, col: u32, prefix: &[u8]) -> bool { + self.get_by_prefix(col, prefix).is_some() + } + + fn write(&self, transaction: DBTransaction) -> std::io::Result<()> { let mut ops = transaction.ops.into_iter(); // TODO using a key iterator or native delete here would be faster. let mut current_prefix_iter: Option<(parity_db::BTreeIterator, u8, Vec)> = None; diff --git a/node/subsystem-util/src/rolling_session_window.rs b/node/subsystem-util/src/rolling_session_window.rs index 0ff2dc6deb13..dd9282b50fe5 100644 --- a/node/subsystem-util/src/rolling_session_window.rs +++ b/node/subsystem-util/src/rolling_session_window.rs @@ -20,17 +20,15 @@ //! care about the state of particular blocks. pub use polkadot_node_primitives::{new_session_window_size, SessionWindowSize}; -use polkadot_primitives::v2::{BlockNumber, Hash, SessionIndex, SessionInfo}; +use polkadot_primitives::v2::{Hash, SessionIndex, SessionInfo}; use futures::channel::oneshot; use polkadot_node_subsystem::{ - errors::{ChainApiError, RuntimeApiError}, - messages::{ChainApiMessage, RuntimeApiMessage, RuntimeApiRequest}, + errors::RuntimeApiError, + messages::{RuntimeApiMessage, RuntimeApiRequest}, overseer, }; -const LOG_TARGET: &str = "parachain::rolling-session-window"; - /// Sessions unavailable in state to cache. #[derive(Debug, Clone, thiserror::Error)] pub enum SessionsUnavailableReason { @@ -40,18 +38,9 @@ pub enum SessionsUnavailableReason { /// The runtime API itself returned an error. #[error(transparent)] RuntimeApi(#[from] RuntimeApiError), - /// The chain API itself returned an error. - #[error(transparent)] - ChainApi(#[from] ChainApiError), /// Missing session info from runtime API for given `SessionIndex`. #[error("Missing session index {0:?}")] Missing(SessionIndex), - /// Missing last finalized block number. - #[error("Missing last finalized block number")] - MissingLastFinalizedBlock, - /// Missing last finalized block hash. - #[error("Missing last finalized block hash")] - MissingLastFinalizedBlockHash(BlockNumber), } /// Information about the sessions being fetched. @@ -109,18 +98,11 @@ impl RollingSessionWindow { block_hash: Hash, ) -> Result where - Sender: overseer::SubsystemSender - + overseer::SubsystemSender, + Sender: overseer::SubsystemSender, { let session_index = get_session_index_for_child(&mut sender, block_hash).await?; - let earliest_non_finalized_block_session = - Self::earliest_non_finalized_block_session(&mut sender).await?; - // This will increase the session window to cover the full unfinalized chain. - let window_start = std::cmp::min( - session_index.saturating_sub(window_size.get() - 1), - earliest_non_finalized_block_session, - ); + let window_start = session_index.saturating_sub(window_size.get() - 1); match load_all_sessions(&mut sender, block_hash, window_start, session_index).await { Err(kind) => Err(SessionsUnavailable { @@ -164,87 +146,6 @@ impl RollingSessionWindow { self.earliest_session + (self.session_info.len() as SessionIndex).saturating_sub(1) } - async fn earliest_non_finalized_block_session( - sender: &mut Sender, - ) -> Result - where - Sender: overseer::SubsystemSender - + overseer::SubsystemSender, - { - let last_finalized_height = { - let (tx, rx) = oneshot::channel(); - sender.send_message(ChainApiMessage::FinalizedBlockNumber(tx)).await; - match rx.await { - Ok(Ok(number)) => number, - Ok(Err(e)) => - return Err(SessionsUnavailable { - kind: SessionsUnavailableReason::ChainApi(e), - info: None, - }), - Err(err) => { - gum::warn!( - target: LOG_TARGET, - ?err, - "Failed fetching last finalized block number" - ); - return Err(SessionsUnavailable { - kind: SessionsUnavailableReason::MissingLastFinalizedBlock, - info: None, - }) - }, - } - }; - - let (tx, rx) = oneshot::channel(); - // We want to get the session index for the child of the last finalized block. - sender - .send_message(ChainApiMessage::FinalizedBlockHash(last_finalized_height, tx)) - .await; - let last_finalized_hash_parent = match rx.await { - Ok(Ok(maybe_hash)) => maybe_hash, - Ok(Err(e)) => - return Err(SessionsUnavailable { - kind: SessionsUnavailableReason::ChainApi(e), - info: None, - }), - Err(err) => { - gum::warn!(target: LOG_TARGET, ?err, "Failed fetching last finalized block hash"); - return Err(SessionsUnavailable { - kind: SessionsUnavailableReason::MissingLastFinalizedBlockHash( - last_finalized_height, - ), - info: None, - }) - }, - }; - - // Get the session in which the last finalized block was authored. - if let Some(last_finalized_hash_parent) = last_finalized_hash_parent { - let session = - match get_session_index_for_child(sender, last_finalized_hash_parent).await { - Ok(session_index) => session_index, - Err(err) => { - gum::warn!( - target: LOG_TARGET, - ?err, - ?last_finalized_hash_parent, - "Failed fetching session index" - ); - return Err(err) - }, - }; - - Ok(session) - } else { - return Err(SessionsUnavailable { - kind: SessionsUnavailableReason::MissingLastFinalizedBlockHash( - last_finalized_height, - ), - info: None, - }) - } - } - /// When inspecting a new import notification, updates the session info cache to match /// the session of the imported block's child. /// @@ -252,18 +153,12 @@ impl RollingSessionWindow { /// not change often and import notifications are expected to be typically increasing in session number. /// /// some backwards drift in session index is acceptable. - pub async fn cache_session_info_for_head( + pub async fn cache_session_info_for_head( &mut self, - sender: &mut Sender, + sender: &mut impl overseer::SubsystemSender, block_hash: Hash, - ) -> Result - where - Sender: overseer::SubsystemSender - + overseer::SubsystemSender, - { + ) -> Result { let session_index = get_session_index_for_child(sender, block_hash).await?; - let earliest_non_finalized_block_session = - Self::earliest_non_finalized_block_session(sender).await?; let old_window_start = self.earliest_session; @@ -276,12 +171,7 @@ impl RollingSessionWindow { let old_window_end = latest; - // Ensure we keep sessions up to last finalized block by adjusting the window start. - // This will increase the session window to cover the full unfinalized chain. - let window_start = std::cmp::min( - session_index.saturating_sub(self.window_size.get() - 1), - earliest_non_finalized_block_session, - ); + let window_start = session_index.saturating_sub(self.window_size.get() - 1); // keep some of the old window, if applicable. let overlap_start = window_start.saturating_sub(old_window_start); @@ -429,14 +319,6 @@ mod tests { parent_hash: Default::default(), }; - let finalized_header = Header { - digest: Default::default(), - extrinsics_root: Default::default(), - number: 0, - state_root: Default::default(), - parent_hash: Default::default(), - }; - let pool = TaskExecutor::new(); let (mut ctx, mut handle) = make_subsystem_context::(pool.clone()); @@ -476,37 +358,6 @@ mod tests { } ); - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( - s_tx, - )) => { - let _ = s_tx.send(Ok(finalized_header.number)); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( - block_number, - s_tx, - )) => { - assert_eq!(block_number, finalized_header.number); - let _ = s_tx.send(Ok(Some(finalized_header.hash()))); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionIndexForChild(s_tx), - )) => { - assert_eq!(h, finalized_header.hash()); - let _ = s_tx.send(Ok(session)); - } - ); - for i in expect_requests_from..=session { assert_matches!( handle.recv().await, @@ -634,108 +485,6 @@ mod tests { cache_session_info_test(0, 3, Some(window), 2); } - #[test] - fn any_session_stretch_for_unfinalized_chain() { - // Session index of the tip of our fake test chain. - let session: SessionIndex = 100; - let genesis_session: SessionIndex = 0; - - let header = Header { - digest: Default::default(), - extrinsics_root: Default::default(), - number: 5, - state_root: Default::default(), - parent_hash: Default::default(), - }; - - let finalized_header = Header { - digest: Default::default(), - extrinsics_root: Default::default(), - number: 0, - state_root: Default::default(), - parent_hash: Default::default(), - }; - - let pool = TaskExecutor::new(); - let (mut ctx, mut handle) = make_subsystem_context::<(), _>(pool.clone()); - - let hash = header.hash(); - - let test_fut = { - let sender = ctx.sender().clone(); - Box::pin(async move { - let res = RollingSessionWindow::new(sender, TEST_WINDOW_SIZE, hash).await; - assert!(res.is_err()); - }) - }; - - let aux_fut = Box::pin(async move { - assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionIndexForChild(s_tx), - )) => { - assert_eq!(h, hash); - let _ = s_tx.send(Ok(session)); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( - s_tx, - )) => { - let _ = s_tx.send(Ok(finalized_header.number)); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( - block_number, - s_tx, - )) => { - assert_eq!(block_number, finalized_header.number); - let _ = s_tx.send(Ok(Some(finalized_header.hash()))); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionIndexForChild(s_tx), - )) => { - assert_eq!(h, finalized_header.hash()); - let _ = s_tx.send(Ok(0)); - } - ); - - // Unfinalized chain starts at geneisis block, so session 0 is how far we stretch. - for i in genesis_session..=session { - assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionInfo(j, s_tx), - )) => { - assert_eq!(h, hash); - assert_eq!(i, j); - - let _ = s_tx.send(Ok(if i == session { - None - } else { - Some(dummy_session_info(i)) - })); - } - ); - } - }); - - futures::executor::block_on(futures::future::join(test_fut, aux_fut)); - } - #[test] fn any_session_unavailable_for_caching_means_no_change() { let session: SessionIndex = 6; @@ -749,14 +498,6 @@ mod tests { parent_hash: Default::default(), }; - let finalized_header = Header { - digest: Default::default(), - extrinsics_root: Default::default(), - number: 0, - state_root: Default::default(), - parent_hash: Default::default(), - }; - let pool = TaskExecutor::new(); let (mut ctx, mut handle) = make_subsystem_context::<(), _>(pool.clone()); @@ -782,37 +523,6 @@ mod tests { } ); - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( - s_tx, - )) => { - let _ = s_tx.send(Ok(finalized_header.number)); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( - block_number, - s_tx, - )) => { - assert_eq!(block_number, finalized_header.number); - let _ = s_tx.send(Ok(Some(finalized_header.hash()))); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionIndexForChild(s_tx), - )) => { - assert_eq!(h, finalized_header.hash()); - let _ = s_tx.send(Ok(session)); - } - ); - for i in start_session..=session { assert_matches!( handle.recv().await, @@ -876,37 +586,6 @@ mod tests { } ); - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber( - s_tx, - )) => { - let _ = s_tx.send(Ok(header.number)); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::ChainApi(ChainApiMessage::FinalizedBlockHash( - block_number, - s_tx, - )) => { - assert_eq!(block_number, header.number); - let _ = s_tx.send(Ok(Some(header.hash()))); - } - ); - - assert_matches!( - handle.recv().await, - AllMessages::RuntimeApi(RuntimeApiMessage::Request( - h, - RuntimeApiRequest::SessionIndexForChild(s_tx), - )) => { - assert_eq!(h, header.hash()); - let _ = s_tx.send(Ok(session)); - } - ); - assert_matches!( handle.recv().await, AllMessages::RuntimeApi(RuntimeApiMessage::Request( diff --git a/node/subsystem-util/src/runtime/mod.rs b/node/subsystem-util/src/runtime/mod.rs index 7fcae2c57b09..fc660a9dc6df 100644 --- a/node/subsystem-util/src/runtime/mod.rs +++ b/node/subsystem-util/src/runtime/mod.rs @@ -16,7 +16,7 @@ //! Convenient interface to runtime information. -use std::num::NonZeroUsize; +use std::cmp::max; use lru::LruCache; @@ -52,7 +52,7 @@ pub struct Config { pub keystore: Option, /// How many sessions should we keep in the cache? - pub session_cache_lru_size: NonZeroUsize, + pub session_cache_lru_size: usize, } /// Caching of session info. @@ -95,7 +95,7 @@ impl Default for Config { Self { keystore: None, // Usually we need to cache the current and the last session. - session_cache_lru_size: NonZeroUsize::new(2).expect("2 is larger than 0; qed"), + session_cache_lru_size: 2, } } } @@ -109,10 +109,7 @@ impl RuntimeInfo { /// Create with more elaborate configuration options. pub fn new_with_config(cfg: Config) -> Self { Self { - session_index_cache: LruCache::new( - cfg.session_cache_lru_size - .max(NonZeroUsize::new(10).expect("10 is larger than 0; qed")), - ), + session_index_cache: LruCache::new(max(10, cfg.session_cache_lru_size)), session_info_cache: LruCache::new(cfg.session_cache_lru_size), keystore: cfg.keystore, } diff --git a/node/test/performance-test/Cargo.toml b/node/test/performance-test/Cargo.toml index 583b80e3c2f4..783f5194a0f5 100644 --- a/node/test/performance-test/Cargo.toml +++ b/node/test/performance-test/Cargo.toml @@ -19,6 +19,3 @@ kusama-runtime = { path = "../../../runtime/kusama" } [[bin]] name = "gen-ref-constants" path = "src/gen_ref_constants.rs" - -[features] -runtime-benchmarks = ["kusama-runtime/runtime-benchmarks"] diff --git a/parachain/Cargo.toml b/parachain/Cargo.toml index c07ec98d7cb9..42ffbfab1fa6 100644 --- a/parachain/Cargo.toml +++ b/parachain/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" # this crate for WASM. This is critical to avoid forcing all parachain WASM into implementing # various unnecessary Substrate-specific endpoints. parity-scale-codec = { version = "3.1.5", default-features = false, features = [ "derive" ] } -parity-util-mem = { version = "0.12.0", default-features = false, optional = true } +parity-util-mem = { version = "0.11.0", default-features = false, optional = true } scale-info = { version = "2.1.2", default-features = false, features = ["derive"] } sp-std = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 67fc2d31cee8..d018cfdf9e54 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -27,7 +27,7 @@ trie = { package = "sp-trie", git = "https://github.com/paritytech/substrate", b bitvec = { version = "1.0.0", default-features = false, features = ["alloc"] } frame-system = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } hex-literal = "0.3.4" -parity-util-mem = { version = "0.12.0", default-features = false, optional = true } +parity-util-mem = { version = "0.11.0", default-features = false, optional = true } [features] default = ["std"] diff --git a/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md b/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md index 6b8e5ec03cf4..b63ea2bdcbf0 100644 --- a/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md +++ b/roadmap/implementers-guide/src/node/disputes/dispute-distribution.md @@ -15,13 +15,6 @@ This design should result in a protocol that is: ## Protocol -Distributing disputes needs to be a reliable protocol. We would like to make as -sure as possible that our vote got properly delivered to all concerned -validators. For this to work, this subsystem won't be gossip based, but instead -will use a request/response protocol for application level confirmations. The -request will be the payload (the actual votes/statements), the response will -be the confirmation. See [below][#wire-format]. - ### Input [`DisputeDistributionMessage`][DisputeDistributionMessage] @@ -114,7 +107,16 @@ struct VotesResponse { } ``` -## Starting a Dispute +## Functionality + +Distributing disputes needs to be a reliable protocol. We would like to make as +sure as possible that our vote got properly delivered to all concerned +validators. For this to work, this subsystem won't be gossip based, but instead +will use a request/response protocol for application level confirmations. The +request will be the payload (the actual votes/statements), the response will +be the confirmation. See [above][#wire-format]. + +### Starting a Dispute A dispute is initiated once a node sends the first `DisputeRequest` wire message, which must contain an "invalid" vote and a "valid" vote. @@ -130,7 +132,7 @@ conflicting votes available, hence we have a valid dispute. Nodes will still need to check whether the disputing votes are somewhat current and not some stale ones. -## Participating in a Dispute +### Participating in a Dispute Upon receiving a `DisputeRequest` message, a dispute distribution will trigger the import of the received votes via the dispute coordinator @@ -142,13 +144,13 @@ except that if the local node deemed the candidate valid, the `SendDispute` message will contain a valid vote signed by our node and will contain the initially received `Invalid` vote. -Note, that we rely on `dispute-coordinator` to check validity of a dispute for spam -protection (see below). +Note, that we rely on the coordinator to check availability for spam protection +(see below). -## Sending of messages +### Sending of messages Starting and participating in a dispute are pretty similar from the perspective -of dispute distribution. Once we receive a `SendDispute` message, we try to make +of dispute distribution. Once we receive a `SendDispute` message we try to make sure to get the data out. We keep track of all the parachain validators that should see the message, which are all the parachain validators of the session where the dispute happened as they will want to participate in the dispute. In @@ -157,185 +159,114 @@ session (which might be the same or not and may change during the dispute). Those authorities will not participate in the dispute, but need to see the statements so they can include them in blocks. -### Reliability - -We only consider a message transmitted, once we received a confirmation message. -If not, we will keep retrying getting that message out as long as the dispute is -deemed alive. To determine whether a dispute is still alive we will ask the -`dispute-coordinator` for a list of all still active disputes via a +We keep track of connected parachain validators and authorities and will issue +warnings in the logs if connected nodes are less than two thirds of the +corresponding sets. We also only consider a message transmitted, once we +received a confirmation message. If not, we will keep retrying getting that +message out as long as the dispute is deemed alive. To determine whether a +dispute is still alive we will issue a `DisputeCoordinatorMessage::ActiveDisputes` message before each retry run. Once a dispute is no longer live, we will clean up the state accordingly. -### Order - -We assume `SendDispute` messages are coming in an order of importance, hence -`dispute-distribution` will make sure to send out network messages in the same -order, even on retry. - -### Rate Limit - -For spam protection (see below), we employ an artificial rate limiting on sending -out messages in order to not hit the rate limit at the receiving side, which -would result in our messages getting dropped and our reputation getting reduced. - -## Reception - -As we shall see the receiving side is mostly about handling spam and ensuring -the dispute-coordinator learns about disputes as fast as possible. - -Goals for the receiving side: - -1. Get new disputes to the dispute-coordinator as fast as possible, so - prioritization can happen properly. -2. Batch votes per disputes as much as possible for good import performance. -3. Prevent malicious nodes exhausting node resources by sending lots of messages. -4. Prevent malicious nodes from sending so many messages/(fake) disputes, - preventing us from concluding good ones. -5. Limit ability of malicious nodes of delaying the vote import due to batching - logic. - -Goal 1 and 2 seem to be conflicting, but an easy compromise is possible: When -learning about a new dispute, we will import the vote immediately, making the -dispute coordinator aware and also getting immediate feedback on the validity. -Then if valid we can batch further incoming votes, with less time constraints as -the dispute-coordinator already knows about the dispute. - -Goal 3 and 4 are obviously very related and both can easily be solved via rate -limiting as we shall see below. Rate limits should already be implemented at the -substrate level, but [are not](https://github.com/paritytech/substrate/issues/7750) -at the time of writing. But even if they were, the enforced substrate limits would -likely not be configurable and thus would still be to high for our needs as we can -rely on the following observations: - -1. Each honest validator will only send one message (apart from duplicates on - timeout) per candidate/dispute. -2. An honest validator needs to fully recover availability and validate the - candidate for casting a vote. - -With these two observations, we can conclude that honest validators will usually -not send messages at a high rate. We can therefore enforce conservative rate -limits and thus minimize harm spamming malicious nodes can have. - -Before we dive into how rate limiting solves all spam issues elegantly, let's -discuss that honest behaviour further: - -What about session changes? Here we might have to inform a new validator set of -lots of already existing disputes at once. - -With observation 1) and a rate limit that is per peer, we are still good: - -Let's assume a rate limit of one message per 200ms per sender. This means 5 -messages from each validator per second. 5 messages means 5 disputes! -Conclusively, we will be able to conclude 5 disputes per second - no matter what -malicious actors are doing. This is assuming dispute messages are sent ordered, -but even if not perfectly ordered: On average it will be 5 disputes per second. - -This is good enough! All those disputes are valid ones and will result in -slashing and disabling of validators. Let's assume all of them conclude `valid`, -and we disable validators only after 100 raised concluding valid disputes, we -would still start disabling misbehaving validators in only 20 seconds. - -One could also think that in addition participation is expected to take longer, -which means on average we can import/conclude disputes faster than they are -generated - regardless of dispute spam. Unfortunately this is not necessarily -true: There might be parachains with very light load where recovery and -validation can be accomplished very quickly - maybe faster than we can import -those disputes. - -This is probably an argument for not imposing a too low rate limit, although the -issue is more general: Even without any rate limit, if an attacker generates -disputes at a very high rate, nodes will be having trouble keeping participation -up, hence the problem should be mitigated at a [more fundamental -layer](https://github.com/paritytech/polkadot/issues/5898). - -For nodes that have been offline for a while, the same argument as for session -changes holds, but matters even less: We assume 2/3 of nodes to be online, so -even if the worst case 1/3 offline happens and they could not import votes fast -enough (as argued above, they in fact can) it would not matter for consensus. - -### Rate Limiting - -As suggested previously, rate limiting allows to mitigate all threats that come -from malicious actors trying to overwhelm the system in order to get away without -a slash, when it comes to dispute-distribution. In this section we will explain -how in greater detail. - -The idea is to open a queue with limited size for each peer. We will process -incoming messages as fast as we can by doing the following: - -1. Check that the sending peer is actually a valid authority - otherwise drop - message and decrease reputation/disconnect. -2. Put message on the peer's queue, if queue is full - drop it. - -Every `RATE_LIMIT` seconds (or rather milliseconds), we pause processing -incoming requests to go a full circle and process one message from each queue. -Processing means `Batching` as explained in the next section. - -### Batching - -To achieve goal 2 we will batch incoming votes/messages together before passing -them on as a single batch to the `dispute-coordinator`. To adhere to goal 1 as -well, we will do the following: - -1. For an incoming message, we check whether we have an existing batch for that - candidate, if not we import directly to the dispute-coordinator, as we have - to assume this is concerning a new dispute. -2. We open a batch and start collecting incoming messages for that candidate, - instead of immediately forwarding. -4. We keep collecting votes in the batch until we receive less than - `MIN_KEEP_BATCH_ALIVE_VOTES` unique votes in the last `BATCH_COLLECTING_INTERVAL`. This is - important to accommodate for goal 5 and also 3. -5. We send the whole batch to the dispute-coordinator. - -This together with rate limiting explained above ensures we will be able to -process valid disputes: We can limit the number of simultaneous existing batches -to some high value, but can be rather certain that this limit will never be -reached - hence we won't drop valid disputes: - -Let's assume `MIN_KEEP_BATCH_ALIVE_VOTES` is 10, `BATCH_COLLECTING_INTERVAL` -is `500ms` and above `RATE_LIMIT` is `100ms`. 1/3 of validators are malicious, -so for 1000 this means around 330 malicious actors worst case. - -All those actors can send a message every `100ms`, that is 10 per second. This -means at the begining of an attack they can open up around 3300 batches. Each -containing two votes. So memory usage is still negligible. In reality it is even -less, as we also demand 10 new votes to trickle in per batch in order to keep it -alive, every `500ms`. Hence for the first second, each batch requires 20 votes -each. Each message is 2 votes, so this means 10 messages per batch. Hence to -keep those batches alive 10 attackers are needed for each batch. This reduces -the number of opened batches by a factor of 10: So we only have 330 batches in 1 -second - each containing 20 votes. - -The next second: In order to further grow memory usage, attackers have to -maintain 10 messages per batch and second. Number of batches equals the number -of attackers, each has 10 messages per second, all are needed to maintain the -batches in memory. Therefore we have a hard cap of around 330 (number of -malicious nodes) open batches. Each can be filled with number of malicious -actor's votes. So 330 batches with each 330 votes: Let's assume approximately 100 -bytes per signature/vote. This results in a worst case memory usage of 330 * 330 -* 100 ~= 10 MiB. - -For 10_000 validators, we are already in the Gigabyte range, which means that -with a validator set that large we might want to be more strict with the rate limit or -require a larger rate of incoming votes per batch to keep them alive. - -For a thousand validators a limit on batches of around 1000 should never be -reached in practice. Hence due to rate limiting we have a very good chance to -not ever having to drop a potential valid dispute due to some resource limit. - -Further safe guards are possible: The dispute-coordinator actually -confirms/denies imports. So once we receive a denial by the dispute-coordinator -for the initial imported votes, we can opt into flushing the batch immediately -and importing the votes. This swaps memory usage for more CPU usage, but if that -import is deemed invalid again we can immediately decrease the reputation of the -sending peers, so this should be a net win. For the time being we punt on this -for simplicity. - -Instead of filling batches to maximize memory usage, attackers could also try to -overwhelm the dispute coordinator by only sending votes for new candidates all -the time. This attack vector is mitigated also by above rate limit and -decreasing the peer's reputation on denial of the invalid imports by the -coordinator. +### Reception & Spam Considerations + +Because we are not forwarding foreign statements, spam is less of an issue in +comparison to gossip based systems. Rate limiting should be implemented at the +substrate level, see +[#7750](https://github.com/paritytech/substrate/issues/7750). Still we should +make sure that it is not possible via spamming to prevent a dispute concluding +or worse from getting noticed. + +Considered attack vectors: + +1. Invalid disputes (candidate does not exist) could make us + run out of resources. E.g. if we recorded every statement, we could run out + of disk space eventually. +2. An attacker can just flood us with notifications on any notification + protocol, assuming flood protection is not effective enough, our unbounded + buffers can fill up and we will run out of memory eventually. +3. An attacker could participate in a valid dispute, but send its votes multiple + times. +4. Attackers could spam us at a high rate with invalid disputes. Our incoming + queue of requests could get monopolized by those malicious requests and we + won't be able to import any valid disputes and we could run out of resources, + if we tried to process them all in parallel. + +For tackling 1, we make sure to not occupy resources before we don't know a +candidate is available. So we will not record statements to disk until we +recovered availability for the candidate or know by some other means that the +dispute is legit. + +For 2, we will pick up on any dispute on restart, so assuming that any realistic +memory filling attack will take some time, we should be able to participate in a +dispute under such attacks. + +Importing/discarding redundant votes should be pretty quick, so measures with +regards to 4 should suffice to prevent 3, from doing any real harm. + +For 4, full monopolization of the incoming queue should not be possible assuming +substrate handles incoming requests in a somewhat fair way. Still we want some +defense mechanisms, at the very least we need to make sure to not exhaust +resources. + +The dispute coordinator will notify us on import about unavailable candidates or +otherwise invalid imports and we can disconnect from such peers/decrease their +reputation drastically. This alone should get us quite far with regards to queue +monopolization, as availability recovery is expected to fail relatively quickly +for unavailable data. + +Still if those spam messages come at a very high rate, we might still run out of +resources if we immediately call `DisputeCoordinatorMessage::ImportStatements` +on each one of them. Secondly with our assumption of 1/3 dishonest validators, +getting rid of all of them will take some time, depending on reputation timeouts +some of them might even be able to reconnect eventually. + +To mitigate those issues we will process dispute messages with a maximum +parallelism `N`. We initiate import processes for up to `N` candidates in +parallel. Once we reached `N` parallel requests we will start back pressuring on +the incoming requests. This saves us from resource exhaustion. + +To reduce impact of malicious nodes further, we can keep track from which nodes the +currently importing statements came from and will drop requests from nodes that +already have imports in flight. + +Honest nodes are not expected to send dispute statements at a high rate, but +even if they did: + +- we will import at least the first one and if it is valid it will trigger a + dispute, preventing finality. +- Chances are good that the first sent candidate from a peer is indeed the + oldest one (if they differ in age at all). +- for the dropped request any honest node will retry sending. +- there will be other nodes notifying us about that dispute as well. +- honest votes have a speed advantage on average. Apart from the very first + dispute statement for a candidate, which might cause the availability recovery + process, imports of honest votes will be super fast, while for spam imports + they will always take some time as we have to wait for availability to fail. + +So this general rate limit, that we drop requests from same peers if they come +faster than we can import the statements should not cause any problems for +honest nodes and is in their favor. + +Size of `N`: The larger `N` the better we can handle distributed flood attacks +(see previous paragraph), but we also get potentially more availability recovery +processes happening at the same time, which slows down the individual processes. +And we rather want to have one finish quickly than lots slowly at the same time. +On the other hand, valid disputes are expected to be rare, so if we ever exhaust +`N` it is very likely that this is caused by spam and spam recoveries don't cost +too much bandwidth due to empty responses. + +Considering that an attacker would need to attack many nodes in parallel to have +any effect, an `N` of 10 seems to be a good compromise. For honest requests, most +of those imports will likely concern the same candidate, and for dishonest ones +we get to disconnect from up to ten colluding adversaries at a time. + +For the size of the channel for incoming requests: Due to dropping of repeated +requests from same nodes we can make the channel relatively large without fear +of lots of spam requests sitting there wasting our time, even after we already +blocked a peer. For valid disputes, incoming requests can become bursty. On the +other hand we will also be very quick in processing them. A channel size of 100 +requests seems plenty and should be able to handle bursts adequately. ### Node Startup diff --git a/runtime/common/src/claims.rs b/runtime/common/src/claims.rs index bb0663ec34f7..cded9b289a4f 100644 --- a/runtime/common/src/claims.rs +++ b/runtime/common/src/claims.rs @@ -717,7 +717,7 @@ mod tests { assert_err, assert_noop, assert_ok, dispatch::{DispatchError::BadOrigin, GetDispatchInfo, Pays}, ord_parameter_types, parameter_types, - traits::{ExistenceRequirement, GenesisBuild, WithdrawReasons}, + traits::{ExistenceRequirement, GenesisBuild}, }; use pallet_balances; use sp_runtime::{ @@ -790,8 +790,6 @@ mod tests { parameter_types! { pub const MinVestedTransfer: u64 = 1; - pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = - WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Test { @@ -800,7 +798,6 @@ mod tests { type BlockNumberToBalance = Identity; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = (); - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index ac5fc69a28e4..936feedde1c3 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -52,7 +52,6 @@ pub use pallet_balances::Call as BalancesCall; pub use pallet_staking::StakerStatus; pub use pallet_timestamp::Call as TimestampCall; use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment}; -pub use sp_runtime::traits::Bounded; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; @@ -88,8 +87,6 @@ parameter_types! { /// that combined with `AdjustmentVariable`, we can recover from the minimum. /// See `multiplier_can_grow_from_zero`. pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 10u128); - /// The maximum amount of the multiplier. - pub MaximumMultiplier: Multiplier = Bounded::max_value(); /// Maximum length of block. Up to 5MB. pub BlockLength: limits::BlockLength = limits::BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO); @@ -97,13 +94,8 @@ parameter_types! { /// Parameterized slow adjusting fee updated based on /// https://research.web3.foundation/en/latest/polkadot/overview/2-token-economics.html#-2.-slow-adjusting-mechanism -pub type SlowAdjustingFeeUpdate = TargetedFeeAdjustment< - R, - TargetBlockFullness, - AdjustmentVariable, - MinimumMultiplier, - MaximumMultiplier, ->; +pub type SlowAdjustingFeeUpdate = + TargetedFeeAdjustment; /// Implements the weight types for a runtime. /// It expects the passed runtime constants to contain a `weights` module. diff --git a/runtime/common/src/purchase.rs b/runtime/common/src/purchase.rs index 52ad22bec2fb..8c0fcebd5c12 100644 --- a/runtime/common/src/purchase.rs +++ b/runtime/common/src/purchase.rs @@ -474,10 +474,8 @@ mod tests { // or public keys. `u64` is used as the `AccountId` and no `Signature`s are required. use crate::purchase; use frame_support::{ - assert_noop, assert_ok, - dispatch::DispatchError::BadOrigin, - ord_parameter_types, parameter_types, - traits::{Currency, WithdrawReasons}, + assert_noop, assert_ok, dispatch::DispatchError::BadOrigin, ord_parameter_types, + parameter_types, traits::Currency, }; use pallet_balances::Error as BalancesError; use sp_runtime::{ @@ -552,8 +550,6 @@ mod tests { parameter_types! { pub const MinVestedTransfer: u64 = 1; - pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = - WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Test { @@ -562,7 +558,6 @@ mod tests { type BlockNumberToBalance = Identity; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = (); - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } diff --git a/runtime/kusama/src/governance/fellowship.rs b/runtime/kusama/src/governance/fellowship.rs index 52ab8d0bebc8..66e2f6ee6d58 100644 --- a/runtime/kusama/src/governance/fellowship.rs +++ b/runtime/kusama/src/governance/fellowship.rs @@ -314,7 +314,6 @@ impl pallet_referenda::Config for Runtime { type UndecidingTimeout = UndecidingTimeout; type AlarmInterval = AlarmInterval; type Tracks = TracksInfo; - type Preimages = Preimage; } pub type FellowshipCollectiveInstance = pallet_ranked_collective::Instance1; diff --git a/runtime/kusama/src/governance/mod.rs b/runtime/kusama/src/governance/mod.rs index 87cbfd7eea2f..4dbf375f67f0 100644 --- a/runtime/kusama/src/governance/mod.rs +++ b/runtime/kusama/src/governance/mod.rs @@ -91,5 +91,4 @@ impl pallet_referenda::Config for Runtime { type UndecidingTimeout = UndecidingTimeout; type AlarmInterval = AlarmInterval; type Tracks = TracksInfo; - type Preimages = Preimage; } diff --git a/runtime/kusama/src/governance/old.rs b/runtime/kusama/src/governance/old.rs index 9365c903198a..c16ca5eddd7a 100644 --- a/runtime/kusama/src/governance/old.rs +++ b/runtime/kusama/src/governance/old.rs @@ -32,6 +32,7 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { + type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; @@ -73,15 +74,14 @@ impl pallet_democracy::Config for Runtime { // only do it once and it lasts only for the cooloff period. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; + type PreimageByteDeposit = PreimageByteDeposit; + type OperationalPreimageOrigin = pallet_collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; type WeightInfo = weights::pallet_democracy::WeightInfo; type MaxProposals = MaxProposals; - type Preimages = Preimage; - type MaxDeposits = ConstU32<100>; - type MaxBlacklisted = ConstU32<100>; } parameter_types! { diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index 58a824ae1cc2..48762d5e67ec 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -52,7 +52,7 @@ use frame_support::{ construct_runtime, parameter_types, traits::{ ConstU32, Contains, EitherOf, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, - LockIdentifier, PrivilegeCmp, WithdrawReasons, + LockIdentifier, PrivilegeCmp, }, weights::ConstantMultiplier, PalletId, RuntimeDebug, @@ -225,10 +225,12 @@ impl pallet_scheduler::Config for Runtime { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = OriginPrivilegeCmp; - type Preimages = Preimage; + type PreimageProvider = Preimage; + type NoPreimagePostponement = NoPreimagePostponement; } parameter_types! { + pub const PreimageMaxSize: u32 = 4096 * 1024; pub const PreimageBaseDeposit: Balance = deposit(2, 64); pub const PreimageByteDeposit: Balance = deposit(0, 1); } @@ -237,7 +239,8 @@ impl pallet_preimage::Config for Runtime { type WeightInfo = weights::pallet_preimage::WeightInfo; type RuntimeEvent = RuntimeEvent; type Currency = Balances; - type ManagerOrigin = EnsureRoot; + type ManagerOrigin = EnsureRoot; // This might be too strong a requirenent? + type MaxSize = PreimageMaxSize; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } @@ -931,8 +934,6 @@ impl pallet_society::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = 100 * CENTS; - pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = - WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -941,7 +942,6 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } @@ -1471,13 +1471,6 @@ pub type Executive = frame_executive::Executive< StakingMigrationV11OldPallet, >, pallet_staking::migrations::v12::MigrateToV12, - // "Bound uses of call" - pallet_preimage::migration::v1::Migration, - pallet_scheduler::migration::v3::MigrateToV4, - pallet_democracy::migrations::v1::Migration, - pallet_multisig::migrations::v1::MigrateToV1, - // "Properly migrate weights to v2" - parachains_configuration::migration::v3::MigrateToV3, ), >; /// The payload being signed in the transactions. diff --git a/runtime/kusama/src/weights/pallet_democracy.rs b/runtime/kusama/src/weights/pallet_democracy.rs index b9b4127c597e..76862dca3974 100644 --- a/runtime/kusama/src/weights/pallet_democracy.rs +++ b/runtime/kusama/src/weights/pallet_democracy.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_democracy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 // Executed Command: @@ -32,13 +32,13 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/kusama/src/weights +// --output=./runtime/kusama/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight}}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_democracy`. @@ -49,103 +49,134 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(42_340_000 as u64) + Weight::from_ref_time(39_849_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy DepositOf (r:1 w:1) - fn second() -> Weight { - Weight::from_ref_time(38_557_000 as u64) + /// The range of component `s` is `[0, 100]`. + fn second(s: u32, ) -> Weight { + Weight::from_ref_time(31_560_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(81_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_new() -> Weight { - Weight::from_ref_time(48_480_000 as u64) + /// The range of component `r` is `[1, 99]`. + fn vote_new(r: u32, ) -> Weight { + Weight::from_ref_time(43_461_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(91_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_existing() -> Weight { - Weight::from_ref_time(48_553_000 as u64) + /// The range of component `r` is `[1, 99]`. + fn vote_existing(r: u32, ) -> Weight { + Weight::from_ref_time(43_754_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(88_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(20_602_000 as u64) + Weight::from_ref_time(21_199_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) - // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:1 w:1) // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Blacklist (r:0 w:1) - fn blacklist() -> Weight { - Weight::from_ref_time(75_265_000 as u64) + // Storage: Democracy DepositOf (r:1 w:1) + // Storage: System Account (r:1 w:1) + /// The range of component `p` is `[1, 100]`. + fn blacklist(p: u32, ) -> Weight { + Weight::from_ref_time(55_593_000 as u64) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(161_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) - fn external_propose() -> Weight { - Weight::from_ref_time(15_498_000 as u64) + /// The range of component `v` is `[1, 100]`. + fn external_propose(v: u32, ) -> Weight { + Weight::from_ref_time(14_747_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(13_000 as u64).saturating_mul(v as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(4_503_000 as u64) + Weight::from_ref_time(4_471_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(4_486_000 as u64) + Weight::from_ref_time(4_230_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(19_676_000 as u64) + Weight::from_ref_time(20_311_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) - fn veto_external() -> Weight { - Weight::from_ref_time(25_443_000 as u64) + /// The range of component `v` is `[0, 100]`. + fn veto_external(v: u32, ) -> Weight { + Weight::from_ref_time(22_052_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(26_000 as u64).saturating_mul(v as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:1 w:1) - fn cancel_proposal() -> Weight { - Weight::from_ref_time(63_468_000 as u64) + /// The range of component `p` is `[1, 100]`. + fn cancel_proposal(p: u32, ) -> Weight { + Weight::from_ref_time(46_926_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(130_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(13_030_000 as u64) + Weight::from_ref_time(13_121_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } + // Storage: Scheduler Lookup (r:1 w:1) + // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `r` is `[1, 99]`. + fn cancel_queued(r: u32, ) -> Weight { + Weight::from_ref_time(27_805_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(1_112_000 as u64).saturating_mul(r as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:2 w:0) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:0) + /// The range of component `r` is `[1, 99]`. fn on_initialize_base(r: u32, ) -> Weight { - Weight::from_ref_time(5_941_000 as u64) - // Standard Error: 2_263 - .saturating_add(Weight::from_ref_time(2_136_731 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(9_815_000 as u64) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(1_996_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) @@ -155,36 +186,36 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy LastTabledWasExternal (r:1 w:0) // Storage: Democracy NextExternal (r:1 w:0) // Storage: Democracy PublicProps (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:2 w:0) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:0) + /// The range of component `r` is `[1, 99]`. fn on_initialize_base_with_launch_period(r: u32, ) -> Weight { - Weight::from_ref_time(8_085_000 as u64) - // Standard Error: 2_202 - .saturating_add(Weight::from_ref_time(2_143_624 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(12_343_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(2_001_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:3 w:3) + // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - // Storage: Democracy ReferendumInfoOf (r:2 w:2) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn delegate(r: u32, ) -> Weight { - Weight::from_ref_time(40_416_000 as u64) - // Standard Error: 4_125 - .saturating_add(Weight::from_ref_time(3_038_258 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(47_307_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(2_899_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(4 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(4 as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) } // Storage: Democracy VotingOf (r:2 w:2) - // Storage: Democracy ReferendumInfoOf (r:2 w:2) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:1) + /// The range of component `r` is `[1, 99]`. fn undelegate(r: u32, ) -> Weight { - Weight::from_ref_time(24_459_000 as u64) - // Standard Error: 2_860 - .saturating_add(Weight::from_ref_time(2_984_453 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(27_872_000 as u64) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(2_861_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) @@ -192,48 +223,76 @@ impl pallet_democracy::WeightInfo for WeightInfo { } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(5_200_000 as u64) + Weight::from_ref_time(5_014_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } + // Storage: Democracy Preimages (r:1 w:1) + /// The range of component `b` is `[0, 16384]`. + fn note_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(29_213_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Democracy Preimages (r:1 w:1) + /// The range of component `b` is `[0, 16384]`. + fn note_imminent_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(21_778_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Democracy Preimages (r:1 w:1) + // Storage: System Account (r:1 w:1) + /// The range of component `b` is `[0, 16384]`. + fn reap_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(36_642_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn unlock_remove(r: u32, ) -> Weight { - Weight::from_ref_time(24_289_000 as u64) - // Standard Error: 2_579 - .saturating_add(Weight::from_ref_time(125_300 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(31_776_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(37_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn unlock_set(r: u32, ) -> Weight { - Weight::from_ref_time(28_331_000 as u64) - // Standard Error: 755 - .saturating_add(Weight::from_ref_time(90_997 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(31_414_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(77_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 100]`. + /// The range of component `r` is `[1, 99]`. fn remove_vote(r: u32, ) -> Weight { - Weight::from_ref_time(15_350_000 as u64) - // Standard Error: 1_015 - .saturating_add(Weight::from_ref_time(104_402 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(18_428_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(84_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 100]`. + /// The range of component `r` is `[1, 99]`. fn remove_other_vote(r: u32, ) -> Weight { - Weight::from_ref_time(15_433_000 as u64) - // Standard Error: 980 - .saturating_add(Weight::from_ref_time(104_660 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(18_684_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(77_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/kusama/src/weights/pallet_preimage.rs b/runtime/kusama/src/weights/pallet_preimage.rs index 2fc3687f4581..782deda50e27 100644 --- a/runtime/kusama/src/weights/pallet_preimage.rs +++ b/runtime/kusama/src/weights/pallet_preimage.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 // Executed Command: @@ -32,102 +32,103 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/kusama/src/weights +// --output=./runtime/kusama/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight}}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_preimage`. pub struct WeightInfo(PhantomData); impl pallet_preimage::WeightInfo for WeightInfo { + // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(27_993_000 as u64) - // Standard Error: 5 - .saturating_add(Weight::from_ref_time(2_208 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + Weight::from_ref_time(0 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:0) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(19_503_000 as u64) - // Standard Error: 5 - .saturating_add(Weight::from_ref_time(2_264 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + Weight::from_ref_time(0 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:0) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(17_878_000 as u64) - // Standard Error: 2 - .saturating_add(Weight::from_ref_time(2_130 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + Weight::from_ref_time(0 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(40_091_000 as u64) + Weight::from_ref_time(37_471_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(27_459_000 as u64) + Weight::from_ref_time(26_305_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(27_176_000 as u64) + Weight::from_ref_time(35_418_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(14_096_000 as u64) + Weight::from_ref_time(23_113_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(17_365_000 as u64) + Weight::from_ref_time(17_429_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(8_013_000 as u64) + Weight::from_ref_time(8_153_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(27_185_000 as u64) + Weight::from_ref_time(25_132_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(7_955_000 as u64) + Weight::from_ref_time(17_918_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(7_819_000 as u64) + Weight::from_ref_time(8_173_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/kusama/src/weights/pallet_scheduler.rs b/runtime/kusama/src/weights/pallet_scheduler.rs index c6df2801dd69..f291bcd2c490 100644 --- a/runtime/kusama/src/weights/pallet_scheduler.rs +++ b/runtime/kusama/src/weights/pallet_scheduler.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024 // Executed Command: @@ -32,66 +32,145 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/kusama/src/weights +// --output=./runtime/kusama/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight}}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler IncompleteSince (r:1 w:1) - fn service_agendas_base() -> Weight { - Weight::from_ref_time(4_558_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(11_217_000 as u64) + // Standard Error: 43_000 + .saturating_add(Weight::from_ref_time(19_456_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. - fn service_agenda_base(s: u32, ) -> Weight { - Weight::from_ref_time(3_715_000 as u64) - // Standard Error: 2_737 - .saturating_add(Weight::from_ref_time(624_353 as u64).saturating_mul(s as u64)) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(15_840_000 as u64) + // Standard Error: 23_000 + .saturating_add(Weight::from_ref_time(15_699_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - fn service_task_base() -> Weight { - Weight::from_ref_time(9_345_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(10_761_000 as u64) + // Standard Error: 28_000 + .saturating_add(Weight::from_ref_time(17_063_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } + // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[128, 4194304]`. - fn service_task_fetched(s: u32, ) -> Weight { - Weight::from_ref_time(20_078_000 as u64) - // Standard Error: 5 - .saturating_add(Weight::from_ref_time(1_153 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(12_801_000 as u64) + // Standard Error: 27_000 + .saturating_add(Weight::from_ref_time(14_878_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) + } + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:0) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named_aborted(s: u32, ) -> Weight { + Weight::from_ref_time(10_462_000 as u64) + // Standard Error: 8_000 + .saturating_add(Weight::from_ref_time(5_706_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:0) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_aborted(s: u32, ) -> Weight { + Weight::from_ref_time(9_952_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(3_762_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } + // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - fn service_task_named() -> Weight { - Weight::from_ref_time(10_744_000 as u64) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_named(s: u32, ) -> Weight { + Weight::from_ref_time(14_502_000 as u64) + // Standard Error: 14_000 + .saturating_add(Weight::from_ref_time(10_550_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } - fn service_task_periodic() -> Weight { - Weight::from_ref_time(9_556_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic(s: u32, ) -> Weight { + Weight::from_ref_time(14_956_000 as u64) + // Standard Error: 12_000 + .saturating_add(Weight::from_ref_time(8_343_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - fn execute_dispatch_signed() -> Weight { - Weight::from_ref_time(4_130_000 as u64) + // Storage: Scheduler Agenda (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named(s: u32, ) -> Weight { + Weight::from_ref_time(13_862_000 as u64) + // Standard Error: 10_000 + .saturating_add(Weight::from_ref_time(7_398_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - fn execute_dispatch_unsigned() -> Weight { - Weight::from_ref_time(4_058_000 as u64) + // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize(s: u32, ) -> Weight { + Weight::from_ref_time(14_529_000 as u64) + // Standard Error: 10_000 + .saturating_add(Weight::from_ref_time(6_467_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 49]`. + /// The range of component `s` is `[0, 50]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(16_721_000 as u64) - // Standard Error: 3_319 - .saturating_add(Weight::from_ref_time(657_802 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_944_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(69_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -99,19 +178,19 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Lookup (r:0 w:1) /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(19_496_000 as u64) - // Standard Error: 1_368 - .saturating_add(Weight::from_ref_time(572_226 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(20_087_000 as u64) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(1_214_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 49]`. + /// The range of component `s` is `[0, 50]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(19_831_000 as u64) - // Standard Error: 3_559 - .saturating_add(Weight::from_ref_time(689_493 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(23_553_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(118_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -119,9 +198,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Agenda (r:1 w:1) /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(20_788_000 as u64) - // Standard Error: 1_758 - .saturating_add(Weight::from_ref_time(605_808 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(22_403_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(1_255_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/parachains/src/configuration.rs b/runtime/parachains/src/configuration.rs index 2ebaff1b8282..bc97e84e95b5 100644 --- a/runtime/parachains/src/configuration.rs +++ b/runtime/parachains/src/configuration.rs @@ -285,8 +285,7 @@ impl> Default for HostConfiguration /// v1-v2: -/// v2-v3: -pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(3); - -pub mod v3 { - use super::*; - use frame_support::traits::OnRuntimeUpgrade; - use primitives::v2::{Balance, SessionIndex}; - - // Copied over from configuration.rs @ de9e147695b9f1be8bd44e07861a31e483c8343a and removed - // all the comments, and changed the Weight struct to OldWeight - #[derive(parity_scale_codec::Encode, parity_scale_codec::Decode, Debug)] - pub struct OldHostConfiguration { - pub max_code_size: u32, - pub max_head_data_size: u32, - pub max_upward_queue_count: u32, - pub max_upward_queue_size: u32, - pub max_upward_message_size: u32, - pub max_upward_message_num_per_candidate: u32, - pub hrmp_max_message_num_per_candidate: u32, - pub validation_upgrade_cooldown: BlockNumber, - pub validation_upgrade_delay: BlockNumber, - pub max_pov_size: u32, - pub max_downward_message_size: u32, - pub ump_service_total_weight: OldWeight, - pub hrmp_max_parachain_outbound_channels: u32, - pub hrmp_max_parathread_outbound_channels: u32, - pub hrmp_sender_deposit: Balance, - pub hrmp_recipient_deposit: Balance, - pub hrmp_channel_max_capacity: u32, - pub hrmp_channel_max_total_size: u32, - pub hrmp_max_parachain_inbound_channels: u32, - pub hrmp_max_parathread_inbound_channels: u32, - pub hrmp_channel_max_message_size: u32, - pub code_retention_period: BlockNumber, - pub parathread_cores: u32, - pub parathread_retries: u32, - pub group_rotation_frequency: BlockNumber, - pub chain_availability_period: BlockNumber, - pub thread_availability_period: BlockNumber, - pub scheduling_lookahead: u32, - pub max_validators_per_core: Option, - pub max_validators: Option, - pub dispute_period: SessionIndex, - pub dispute_post_conclusion_acceptance_period: BlockNumber, - pub dispute_max_spam_slots: u32, - pub dispute_conclusion_by_time_out_period: BlockNumber, - pub no_show_slots: u32, - pub n_delay_tranches: u32, - pub zeroth_delay_tranche_width: u32, - pub needed_approvals: u32, - pub relay_vrf_modulo_samples: u32, - pub ump_max_individual_weight: OldWeight, - pub pvf_checking_enabled: bool, - pub pvf_voting_ttl: SessionIndex, - pub minimum_validation_upgrade_delay: BlockNumber, - } - - impl> Default for OldHostConfiguration { - fn default() -> Self { - Self { - group_rotation_frequency: 1u32.into(), - chain_availability_period: 1u32.into(), - thread_availability_period: 1u32.into(), - no_show_slots: 1u32.into(), - validation_upgrade_cooldown: Default::default(), - validation_upgrade_delay: Default::default(), - code_retention_period: Default::default(), - max_code_size: Default::default(), - max_pov_size: Default::default(), - max_head_data_size: Default::default(), - parathread_cores: Default::default(), - parathread_retries: Default::default(), - scheduling_lookahead: Default::default(), - max_validators_per_core: Default::default(), - max_validators: None, - dispute_period: 6, - dispute_post_conclusion_acceptance_period: 100.into(), - dispute_max_spam_slots: 2, - dispute_conclusion_by_time_out_period: 200.into(), - n_delay_tranches: Default::default(), - zeroth_delay_tranche_width: Default::default(), - needed_approvals: Default::default(), - relay_vrf_modulo_samples: Default::default(), - max_upward_queue_count: Default::default(), - max_upward_queue_size: Default::default(), - max_downward_message_size: Default::default(), - ump_service_total_weight: OldWeight(Default::default()), - max_upward_message_size: Default::default(), - max_upward_message_num_per_candidate: Default::default(), - hrmp_sender_deposit: Default::default(), - hrmp_recipient_deposit: Default::default(), - hrmp_channel_max_capacity: Default::default(), - hrmp_channel_max_total_size: Default::default(), - hrmp_max_parachain_inbound_channels: Default::default(), - hrmp_max_parathread_inbound_channels: Default::default(), - hrmp_channel_max_message_size: Default::default(), - hrmp_max_parachain_outbound_channels: Default::default(), - hrmp_max_parathread_outbound_channels: Default::default(), - hrmp_max_message_num_per_candidate: Default::default(), - ump_max_individual_weight: OldWeight( - frame_support::weights::constants::WEIGHT_PER_MILLIS.ref_time() * 20, - ), - pvf_checking_enabled: false, - pvf_voting_ttl: 2u32.into(), - minimum_validation_upgrade_delay: 2.into(), - } - } - } - - pub struct MigrateToV3(sp_std::marker::PhantomData); - impl OnRuntimeUpgrade for MigrateToV3 { - fn on_runtime_upgrade() -> Weight { - if StorageVersion::get::>() == 2 { - let weight_consumed = migrate_to_v3::(); - - log::info!(target: configuration::LOG_TARGET, "MigrateToV3 executed successfully"); - STORAGE_VERSION.put::>(); - - weight_consumed - } else { - log::warn!(target: configuration::LOG_TARGET, "MigrateToV3 should be removed."); - T::DbWeight::get().reads(1) - } - } - } -} - -fn migrate_to_v3() -> Weight { - // Unusual formatting is justified: - // - make it easier to verify that fields assign what they supposed to assign. - // - this code is transient and will be removed after all migrations are done. - // - this code is important enough to optimize for legibility sacrificing consistency. - #[rustfmt::skip] - let translate = - |pre: v3::OldHostConfiguration>| -> -configuration::HostConfiguration> - { - super::HostConfiguration { -max_code_size : pre.max_code_size, -max_head_data_size : pre.max_head_data_size, -max_upward_queue_count : pre.max_upward_queue_count, -max_upward_queue_size : pre.max_upward_queue_size, -max_upward_message_size : pre.max_upward_message_size, -max_upward_message_num_per_candidate : pre.max_upward_message_num_per_candidate, -hrmp_max_message_num_per_candidate : pre.hrmp_max_message_num_per_candidate, -validation_upgrade_cooldown : pre.validation_upgrade_cooldown, -validation_upgrade_delay : pre.validation_upgrade_delay, -max_pov_size : pre.max_pov_size, -max_downward_message_size : pre.max_downward_message_size, -hrmp_max_parachain_outbound_channels : pre.hrmp_max_parachain_outbound_channels, -hrmp_max_parathread_outbound_channels : pre.hrmp_max_parathread_outbound_channels, -hrmp_sender_deposit : pre.hrmp_sender_deposit, -hrmp_recipient_deposit : pre.hrmp_recipient_deposit, -hrmp_channel_max_capacity : pre.hrmp_channel_max_capacity, -hrmp_channel_max_total_size : pre.hrmp_channel_max_total_size, -hrmp_max_parachain_inbound_channels : pre.hrmp_max_parachain_inbound_channels, -hrmp_max_parathread_inbound_channels : pre.hrmp_max_parathread_inbound_channels, -hrmp_channel_max_message_size : pre.hrmp_channel_max_message_size, -code_retention_period : pre.code_retention_period, -parathread_cores : pre.parathread_cores, -parathread_retries : pre.parathread_retries, -group_rotation_frequency : pre.group_rotation_frequency, -chain_availability_period : pre.chain_availability_period, -thread_availability_period : pre.thread_availability_period, -scheduling_lookahead : pre.scheduling_lookahead, -max_validators_per_core : pre.max_validators_per_core, -max_validators : pre.max_validators, -dispute_period : pre.dispute_period, -dispute_post_conclusion_acceptance_period: pre.dispute_post_conclusion_acceptance_period, -dispute_max_spam_slots : pre.dispute_max_spam_slots, -dispute_conclusion_by_time_out_period : pre.dispute_conclusion_by_time_out_period, -no_show_slots : pre.no_show_slots, -n_delay_tranches : pre.n_delay_tranches, -zeroth_delay_tranche_width : pre.zeroth_delay_tranche_width, -needed_approvals : pre.needed_approvals, -relay_vrf_modulo_samples : pre.relay_vrf_modulo_samples, -pvf_checking_enabled : pre.pvf_checking_enabled, -pvf_voting_ttl : pre.pvf_voting_ttl, -minimum_validation_upgrade_delay : pre.minimum_validation_upgrade_delay, - -ump_service_total_weight: Weight::from_ref_time(pre.ump_service_total_weight.0).set_proof_size(MAX_POV_SIZE as u64), -ump_max_individual_weight: Weight::from_ref_time(pre.ump_max_individual_weight.0).set_proof_size(MAX_POV_SIZE as u64), - } - }; - - if let Err(_) = as Store>::ActiveConfig::translate(|pre| pre.map(translate)) { - // `Err` is returned when the pre-migration type cannot be deserialized. This - // cannot happen if the migration runs correctly, i.e. against the expected version. - // - // This happening almost surely will lead to a panic somewhere else. Corruption seems - // to be unlikely to be caused by this. So we just log. Maybe it'll work out still? - log::error!( - target: configuration::LOG_TARGET, - "unexpected error when performing translation of the configuration type during storage upgrade to v2." - ); - } - - T::DbWeight::get().reads_writes(1, 1) -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::mock::{new_test_ext, Test}; - - #[test] - fn v2_deserialized_from_actual_data() { - // Fetched at Kusama 14,703,780 (0x3b2c305d01bd4adf1973d32a2d55ca1260a55eea8dfb3168e317c57f2841fdf1) - // - // This exceeds the maximal line width length, but that's fine, since this is not code and - // doesn't need to be read and also leaving it as one line allows to easily copy it. - let raw_config = hex_literal::hex!["0000a000005000000a00000000c8000000c800000a0000000a000000100e0000580200000000500000c8000000e87648170000001e00000000000000005039278c0400000000000000000000005039278c0400000000000000000000e8030000009001001e00000000000000009001008070000000000000000000000a0000000a0000000a00000001000000010500000001c8000000060000005802000002000000580200000200000059000000000000001e0000002800000000c817a804000000000200000014000000"]; - - let v2 = - v3::OldHostConfiguration::::decode(&mut &raw_config[..]) - .unwrap(); - - // We check only a sample of the values here. If we missed any fields or messed up data types - // that would skew all the fields coming after. - assert_eq!(v2.max_code_size, 10_485_760); - assert_eq!(v2.validation_upgrade_cooldown, 3600); - assert_eq!(v2.max_pov_size, 5_242_880); - assert_eq!(v2.hrmp_channel_max_message_size, 102_400); - assert_eq!(v2.dispute_max_spam_slots, 2); - assert_eq!(v2.n_delay_tranches, 89); - assert_eq!(v2.ump_max_individual_weight, OldWeight(20_000_000_000)); - assert_eq!(v2.minimum_validation_upgrade_delay, 20); - } - - #[test] - fn test_migrate_to_v3() { - // Host configuration has lots of fields. However, in this migration we add only a couple of - // fields. The most important part to check are a couple of the last fields. We also pick - // extra fields to check arbitrarily, e.g. depending on their position (i.e. the middle) and - // also their type. - // - // We specify only the picked fields and the rest should be provided by the `Default` - // implementation. That implementation is copied over between the two types and should work - // fine. - let v2 = v3::OldHostConfiguration:: { - ump_max_individual_weight: OldWeight(0x71616e6f6e0au64), - needed_approvals: 69, - thread_availability_period: 55, - hrmp_recipient_deposit: 1337, - max_pov_size: 1111, - chain_availability_period: 33, - minimum_validation_upgrade_delay: 20, - ..Default::default() - }; - - new_test_ext(Default::default()).execute_with(|| { - // Implant the v2 version in the state. - frame_support::storage::unhashed::put_raw( - &configuration::ActiveConfig::::hashed_key(), - &v2.encode(), - ); - - migrate_to_v3::(); - - let v3 = configuration::ActiveConfig::::get(); - - #[rustfmt::skip] - { - assert_eq!(v2.max_code_size , v3.max_code_size); - assert_eq!(v2.max_head_data_size , v3.max_head_data_size); - assert_eq!(v2.max_upward_queue_count , v3.max_upward_queue_count); - assert_eq!(v2.max_upward_queue_size , v3.max_upward_queue_size); - assert_eq!(v2.max_upward_message_size , v3.max_upward_message_size); - assert_eq!(v2.max_upward_message_num_per_candidate , v3.max_upward_message_num_per_candidate); - assert_eq!(v2.hrmp_max_message_num_per_candidate , v3.hrmp_max_message_num_per_candidate); - assert_eq!(v2.validation_upgrade_cooldown , v3.validation_upgrade_cooldown); - assert_eq!(v2.validation_upgrade_delay , v3.validation_upgrade_delay); - assert_eq!(v2.max_pov_size , v3.max_pov_size); - assert_eq!(v2.max_downward_message_size , v3.max_downward_message_size); - assert_eq!(v2.hrmp_max_parachain_outbound_channels , v3.hrmp_max_parachain_outbound_channels); - assert_eq!(v2.hrmp_max_parathread_outbound_channels , v3.hrmp_max_parathread_outbound_channels); - assert_eq!(v2.hrmp_sender_deposit , v3.hrmp_sender_deposit); - assert_eq!(v2.hrmp_recipient_deposit , v3.hrmp_recipient_deposit); - assert_eq!(v2.hrmp_channel_max_capacity , v3.hrmp_channel_max_capacity); - assert_eq!(v2.hrmp_channel_max_total_size , v3.hrmp_channel_max_total_size); - assert_eq!(v2.hrmp_max_parachain_inbound_channels , v3.hrmp_max_parachain_inbound_channels); - assert_eq!(v2.hrmp_max_parathread_inbound_channels , v3.hrmp_max_parathread_inbound_channels); - assert_eq!(v2.hrmp_channel_max_message_size , v3.hrmp_channel_max_message_size); - assert_eq!(v2.code_retention_period , v3.code_retention_period); - assert_eq!(v2.parathread_cores , v3.parathread_cores); - assert_eq!(v2.parathread_retries , v3.parathread_retries); - assert_eq!(v2.group_rotation_frequency , v3.group_rotation_frequency); - assert_eq!(v2.chain_availability_period , v3.chain_availability_period); - assert_eq!(v2.thread_availability_period , v3.thread_availability_period); - assert_eq!(v2.scheduling_lookahead , v3.scheduling_lookahead); - assert_eq!(v2.max_validators_per_core , v3.max_validators_per_core); - assert_eq!(v2.max_validators , v3.max_validators); - assert_eq!(v2.dispute_period , v3.dispute_period); - assert_eq!(v2.dispute_post_conclusion_acceptance_period, v3.dispute_post_conclusion_acceptance_period); - assert_eq!(v2.dispute_max_spam_slots , v3.dispute_max_spam_slots); - assert_eq!(v2.dispute_conclusion_by_time_out_period , v3.dispute_conclusion_by_time_out_period); - assert_eq!(v2.no_show_slots , v3.no_show_slots); - assert_eq!(v2.n_delay_tranches , v3.n_delay_tranches); - assert_eq!(v2.zeroth_delay_tranche_width , v3.zeroth_delay_tranche_width); - assert_eq!(v2.needed_approvals , v3.needed_approvals); - assert_eq!(v2.relay_vrf_modulo_samples , v3.relay_vrf_modulo_samples); - assert_eq!(v2.pvf_checking_enabled , v3.pvf_checking_enabled); - assert_eq!(v2.pvf_voting_ttl , v3.pvf_voting_ttl); - assert_eq!(v2.minimum_validation_upgrade_delay , v3.minimum_validation_upgrade_delay); - - assert_eq!(v2.ump_service_total_weight, OldWeight(v3.ump_service_total_weight.ref_time())); - assert_eq!(v2.ump_max_individual_weight, OldWeight(v3.ump_max_individual_weight.ref_time())); - assert_eq!(v3.ump_service_total_weight.proof_size(), MAX_POV_SIZE as u64); - assert_eq!(v3.ump_max_individual_weight.proof_size(), MAX_POV_SIZE as u64); - }; // ; makes this a statement. `rustfmt::skip` cannot be put on an expression. - }); - } -} +pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(2); diff --git a/runtime/polkadot/src/lib.rs b/runtime/polkadot/src/lib.rs index 8f6f2e4db47d..96a557712a76 100644 --- a/runtime/polkadot/src/lib.rs +++ b/runtime/polkadot/src/lib.rs @@ -40,10 +40,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId; use frame_election_provider_support::{generate_solution_type, onchain, SequentialPhragmen}; use frame_support::{ construct_runtime, parameter_types, - traits::{ - ConstU32, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, - PrivilegeCmp, WithdrawReasons, - }, + traits::{EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, PrivilegeCmp}, weights::ConstantMultiplier, PalletId, RuntimeDebug, }; @@ -218,7 +215,8 @@ impl pallet_scheduler::Config for Runtime { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = OriginPrivilegeCmp; - type Preimages = Preimage; + type PreimageProvider = Preimage; + type NoPreimagePostponement = NoPreimagePostponement; } parameter_types! { @@ -232,6 +230,7 @@ impl pallet_preimage::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; + type MaxSize = PreimageMaxSize; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } @@ -616,6 +615,7 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { + type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; @@ -667,15 +667,14 @@ impl pallet_democracy::Config for Runtime { // only do it once and it lasts only for the cooloff period. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; + type PreimageByteDeposit = PreimageByteDeposit; + type OperationalPreimageOrigin = pallet_collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; type WeightInfo = weights::pallet_democracy::WeightInfo; type MaxProposals = MaxProposals; - type Preimages = Preimage; - type MaxDeposits = ConstU32<100>; - type MaxBlacklisted = ConstU32<100>; } parameter_types! { @@ -992,8 +991,6 @@ impl claims::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = 1 * DOLLARS; - pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = - WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -1002,7 +999,6 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } @@ -1564,13 +1560,6 @@ pub type Executive = frame_executive::Executive< StakingMigrationV11OldPallet, >, pallet_staking::migrations::v12::MigrateToV12, - // "Bound uses of call" - pallet_preimage::migration::v1::Migration, - pallet_scheduler::migration::v3::MigrateToV4, - pallet_democracy::migrations::v1::Migration, - pallet_multisig::migrations::v1::MigrateToV1, - // "Properly migrate weights to v2" - parachains_configuration::migration::v3::MigrateToV3, ), >; diff --git a/runtime/polkadot/src/weights/pallet_democracy.rs b/runtime/polkadot/src/weights/pallet_democracy.rs index 136797abcf03..1e94d2b5deb0 100644 --- a/runtime/polkadot/src/weights/pallet_democracy.rs +++ b/runtime/polkadot/src/weights/pallet_democracy.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_democracy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024 // Executed Command: @@ -32,13 +32,13 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/polkadot/src/weights +// --output=./runtime/polkadot/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight}}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_democracy`. @@ -49,103 +49,134 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(42_048_000 as u64) + Weight::from_ref_time(40_082_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy DepositOf (r:1 w:1) - fn second() -> Weight { - Weight::from_ref_time(38_631_000 as u64) + /// The range of component `s` is `[0, 100]`. + fn second(s: u32, ) -> Weight { + Weight::from_ref_time(31_920_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(82_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_new() -> Weight { - Weight::from_ref_time(48_571_000 as u64) + /// The range of component `r` is `[1, 99]`. + fn vote_new(r: u32, ) -> Weight { + Weight::from_ref_time(43_490_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(82_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_existing() -> Weight { - Weight::from_ref_time(48_556_000 as u64) + /// The range of component `r` is `[1, 99]`. + fn vote_existing(r: u32, ) -> Weight { + Weight::from_ref_time(42_957_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(88_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(20_104_000 as u64) + Weight::from_ref_time(20_818_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) - // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:1 w:1) // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Blacklist (r:0 w:1) - fn blacklist() -> Weight { - Weight::from_ref_time(75_289_000 as u64) + // Storage: Democracy DepositOf (r:1 w:1) + // Storage: System Account (r:1 w:1) + /// The range of component `p` is `[1, 100]`. + fn blacklist(p: u32, ) -> Weight { + Weight::from_ref_time(55_285_000 as u64) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(159_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) - fn external_propose() -> Weight { - Weight::from_ref_time(15_734_000 as u64) + /// The range of component `v` is `[1, 100]`. + fn external_propose(v: u32, ) -> Weight { + Weight::from_ref_time(14_271_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(13_000 as u64).saturating_mul(v as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(4_507_000 as u64) + Weight::from_ref_time(4_129_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(4_603_000 as u64) + Weight::from_ref_time(4_215_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(19_816_000 as u64) + Weight::from_ref_time(20_440_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) - fn veto_external() -> Weight { - Weight::from_ref_time(25_722_000 as u64) + /// The range of component `v` is `[0, 100]`. + fn veto_external(v: u32, ) -> Weight { + Weight::from_ref_time(21_988_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(19_000 as u64).saturating_mul(v as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:1 w:1) - fn cancel_proposal() -> Weight { - Weight::from_ref_time(63_768_000 as u64) + /// The range of component `p` is `[1, 100]`. + fn cancel_proposal(p: u32, ) -> Weight { + Weight::from_ref_time(46_176_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(134_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(13_183_000 as u64) + Weight::from_ref_time(12_940_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } + // Storage: Scheduler Lookup (r:1 w:1) + // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `r` is `[1, 99]`. + fn cancel_queued(r: u32, ) -> Weight { + Weight::from_ref_time(27_421_000 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(808_000 as u64).saturating_mul(r as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:2 w:0) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:0) + /// The range of component `r` is `[1, 99]`. fn on_initialize_base(r: u32, ) -> Weight { - Weight::from_ref_time(5_999_000 as u64) - // Standard Error: 2_072 - .saturating_add(Weight::from_ref_time(2_080_681 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(9_602_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(2_017_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) @@ -155,36 +186,36 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy LastTabledWasExternal (r:1 w:0) // Storage: Democracy NextExternal (r:1 w:0) // Storage: Democracy PublicProps (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:2 w:0) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:0) + /// The range of component `r` is `[1, 99]`. fn on_initialize_base_with_launch_period(r: u32, ) -> Weight { - Weight::from_ref_time(8_114_000 as u64) - // Standard Error: 2_286 - .saturating_add(Weight::from_ref_time(2_087_574 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(12_548_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(2_010_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:3 w:3) + // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - // Storage: Democracy ReferendumInfoOf (r:2 w:2) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn delegate(r: u32, ) -> Weight { - Weight::from_ref_time(40_509_000 as u64) - // Standard Error: 3_676 - .saturating_add(Weight::from_ref_time(2_999_395 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(46_940_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(2_877_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(4 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(4 as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) } // Storage: Democracy VotingOf (r:2 w:2) - // Storage: Democracy ReferendumInfoOf (r:2 w:2) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:1) + /// The range of component `r` is `[1, 99]`. fn undelegate(r: u32, ) -> Weight { - Weight::from_ref_time(24_592_000 as u64) - // Standard Error: 2_506 - .saturating_add(Weight::from_ref_time(2_932_469 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(27_418_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(2_872_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) @@ -192,48 +223,76 @@ impl pallet_democracy::WeightInfo for WeightInfo { } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(5_070_000 as u64) + Weight::from_ref_time(4_996_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } + // Storage: Democracy Preimages (r:1 w:1) + /// The range of component `b` is `[0, 16384]`. + fn note_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(28_635_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Democracy Preimages (r:1 w:1) + /// The range of component `b` is `[0, 16384]`. + fn note_imminent_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(21_474_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Democracy Preimages (r:1 w:1) + // Storage: System Account (r:1 w:1) + /// The range of component `b` is `[0, 16384]`. + fn reap_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(36_399_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn unlock_remove(r: u32, ) -> Weight { - Weight::from_ref_time(23_860_000 as u64) - // Standard Error: 2_624 - .saturating_add(Weight::from_ref_time(129_209 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(32_139_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(30_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn unlock_set(r: u32, ) -> Weight { - Weight::from_ref_time(28_512_000 as u64) - // Standard Error: 619 - .saturating_add(Weight::from_ref_time(84_477 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(31_338_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(70_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 100]`. + /// The range of component `r` is `[1, 99]`. fn remove_vote(r: u32, ) -> Weight { - Weight::from_ref_time(15_612_000 as u64) - // Standard Error: 841 - .saturating_add(Weight::from_ref_time(98_567 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(18_298_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(78_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 100]`. + /// The range of component `r` is `[1, 99]`. fn remove_other_vote(r: u32, ) -> Weight { - Weight::from_ref_time(15_282_000 as u64) - // Standard Error: 1_040 - .saturating_add(Weight::from_ref_time(104_928 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(18_456_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(75_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/polkadot/src/weights/pallet_preimage.rs b/runtime/polkadot/src/weights/pallet_preimage.rs index bd316e310277..15606f560519 100644 --- a/runtime/polkadot/src/weights/pallet_preimage.rs +++ b/runtime/polkadot/src/weights/pallet_preimage.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024 // Executed Command: @@ -32,102 +32,103 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/polkadot/src/weights +// --output=./runtime/polkadot/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight}}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_preimage`. pub struct WeightInfo(PhantomData); impl pallet_preimage::WeightInfo for WeightInfo { + // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(28_326_000 as u64) + Weight::from_ref_time(0 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_116 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:0) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(20_011_000 as u64) + Weight::from_ref_time(0 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_114 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:0) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(18_805_000 as u64) - // Standard Error: 1 - .saturating_add(Weight::from_ref_time(2_116 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + Weight::from_ref_time(0 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(39_007_000 as u64) + Weight::from_ref_time(40_028_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(27_523_000 as u64) + Weight::from_ref_time(27_637_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(26_477_000 as u64) + Weight::from_ref_time(37_505_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(13_236_000 as u64) + Weight::from_ref_time(26_628_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(17_975_000 as u64) + Weight::from_ref_time(17_156_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(8_295_000 as u64) + Weight::from_ref_time(8_109_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(26_186_000 as u64) + Weight::from_ref_time(27_209_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(8_176_000 as u64) + Weight::from_ref_time(17_931_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(8_005_000 as u64) + Weight::from_ref_time(7_951_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/polkadot/src/weights/pallet_scheduler.rs b/runtime/polkadot/src/weights/pallet_scheduler.rs index 9446fdc5efec..6103794df8a5 100644 --- a/runtime/polkadot/src/weights/pallet_scheduler.rs +++ b/runtime/polkadot/src/weights/pallet_scheduler.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm6`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024 // Executed Command: @@ -32,69 +32,145 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/polkadot/src/weights +// --output=./runtime/polkadot/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight}}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler IncompleteSince (r:1 w:1) - fn service_agendas_base() -> Weight { - Weight::from_ref_time(4_522_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(15_177_000 as u64) + // Standard Error: 21_000 + .saturating_add(Weight::from_ref_time(18_354_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. - fn service_agenda_base(s: u32, ) -> Weight { - Weight::from_ref_time(3_859_000 as u64) - // Standard Error: 2_692 - .saturating_add(Weight::from_ref_time(618_992 as u64).saturating_mul(s as u64)) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(12_632_000 as u64) + // Standard Error: 23_000 + .saturating_add(Weight::from_ref_time(14_845_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - fn service_task_base() -> Weight { - Weight::from_ref_time(12_288_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(13_757_000 as u64) + // Standard Error: 20_000 + .saturating_add(Weight::from_ref_time(15_871_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } + // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[128, 4194304]`. - fn service_task_fetched(s: u32, ) -> Weight { - Weight::from_ref_time(23_105_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_126 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(15_338_000 as u64) + // Standard Error: 16_000 + .saturating_add(Weight::from_ref_time(13_610_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) + } + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:0) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named_aborted(s: u32, ) -> Weight { + Weight::from_ref_time(10_335_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(5_073_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) + } + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:0) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_aborted(s: u32, ) -> Weight { + Weight::from_ref_time(10_095_000 as u64) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(3_021_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) } + // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - fn service_task_named() -> Weight { - Weight::from_ref_time(13_382_000 as u64) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_named(s: u32, ) -> Weight { + Weight::from_ref_time(15_328_000 as u64) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(9_601_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:1 w:1) - fn service_task_periodic() -> Weight { - Weight::from_ref_time(19_246_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic(s: u32, ) -> Weight { + Weight::from_ref_time(18_306_000 as u64) + // Standard Error: 11_000 + .saturating_add(Weight::from_ref_time(7_155_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - fn execute_dispatch_signed() -> Weight { - Weight::from_ref_time(3_714_000 as u64) + // Storage: Scheduler Agenda (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named(s: u32, ) -> Weight { + Weight::from_ref_time(16_079_000 as u64) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(6_321_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - fn execute_dispatch_unsigned() -> Weight { - Weight::from_ref_time(3_667_000 as u64) + // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize(s: u32, ) -> Weight { + Weight::from_ref_time(16_074_000 as u64) + // Standard Error: 8_000 + .saturating_add(Weight::from_ref_time(5_352_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 49]`. + /// The range of component `s` is `[0, 50]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(16_556_000 as u64) - // Standard Error: 3_431 - .saturating_add(Weight::from_ref_time(659_506 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_480_000 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(76_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -102,19 +178,19 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Lookup (r:0 w:1) /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(18_922_000 as u64) - // Standard Error: 1_665 - .saturating_add(Weight::from_ref_time(586_420 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_669_000 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(892_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 49]`. + /// The range of component `s` is `[0, 50]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(19_633_000 as u64) - // Standard Error: 3_740 - .saturating_add(Weight::from_ref_time(692_772 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(24_633_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(81_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -122,9 +198,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Agenda (r:1 w:1) /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(20_220_000 as u64) - // Standard Error: 2_111 - .saturating_add(Weight::from_ref_time(622_452 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(22_707_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(922_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/rococo/src/lib.rs b/runtime/rococo/src/lib.rs index ac247248b9ea..94677cc07290 100644 --- a/runtime/rococo/src/lib.rs +++ b/runtime/rococo/src/lib.rs @@ -55,7 +55,7 @@ use frame_support::{ construct_runtime, parameter_types, traits::{ Contains, EitherOfDiverse, InstanceFilter, KeyOwnerProofSystem, LockIdentifier, - PrivilegeCmp, WithdrawReasons, + PrivilegeCmp, }, weights::ConstantMultiplier, PalletId, RuntimeDebug, @@ -70,8 +70,8 @@ use sp_mmr_primitives as mmr; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{ - AccountIdLookup, BlakeTwo256, Block as BlockT, ConstU32, ConvertInto, - Extrinsic as ExtrinsicT, Keccak256, OpaqueKeys, SaturatedConversion, Verify, + AccountIdLookup, BlakeTwo256, Block as BlockT, ConvertInto, Extrinsic as ExtrinsicT, + Keccak256, OpaqueKeys, SaturatedConversion, Verify, }, transaction_validity::{TransactionPriority, TransactionSource, TransactionValidity}, ApplyExtrinsicResult, KeyTypeId, Perbill, Percent, Permill, @@ -216,10 +216,12 @@ impl pallet_scheduler::Config for Runtime { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = OriginPrivilegeCmp; - type Preimages = Preimage; + type PreimageProvider = Preimage; + type NoPreimagePostponement = NoPreimagePostponement; } parameter_types! { + pub const PreimageMaxSize: u32 = 4096 * 1024; pub const PreimageBaseDeposit: Balance = deposit(2, 64); pub const PreimageByteDeposit: Balance = deposit(0, 1); } @@ -229,6 +231,7 @@ impl pallet_preimage::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; + type MaxSize = PreimageMaxSize; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } @@ -396,6 +399,7 @@ parameter_types! { } impl pallet_democracy::Config for Runtime { + type Proposal = RuntimeCall; type RuntimeEvent = RuntimeEvent; type Currency = Balances; type EnactmentPeriod = EnactmentPeriod; @@ -437,15 +441,14 @@ impl pallet_democracy::Config for Runtime { // only do it once and it lasts only for the cooloff period. type VetoOrigin = pallet_collective::EnsureMember; type CooloffPeriod = CooloffPeriod; + type PreimageByteDeposit = PreimageByteDeposit; + type OperationalPreimageOrigin = pallet_collective::EnsureMember; type Slash = Treasury; type Scheduler = Scheduler; type PalletsOrigin = OriginCaller; type MaxVotes = MaxVotes; type WeightInfo = weights::pallet_democracy::WeightInfo; type MaxProposals = MaxProposals; - type Preimages = Preimage; - type MaxDeposits = ConstU32<100>; - type MaxBlacklisted = ConstU32<100>; } parameter_types! { @@ -857,8 +860,6 @@ impl pallet_society::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = 100 * CENTS; - pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = - WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -867,7 +868,6 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } @@ -1257,7 +1257,7 @@ impl BeefyDataProvider for ParasProvider { .filter_map(|id| Paras::para_head(&id).map(|head| (id.into(), head.0))) .collect(); para_heads.sort(); - beefy_merkle_tree::merkle_root::<::Hashing, _>( + beefy_merkle_tree::merkle_root::, _, _>( para_heads.into_iter().map(|pair| pair.encode()), ) .into() @@ -1453,15 +1453,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - ( - // "Bound uses of call" - pallet_preimage::migration::v1::Migration, - pallet_scheduler::migration::v3::MigrateToV4, - pallet_democracy::migrations::v1::Migration, - pallet_multisig::migrations::v1::MigrateToV1, - // "Properly migrate weights to v2" - parachains_configuration::migration::v3::MigrateToV3, - ), >; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; diff --git a/runtime/rococo/src/weights/pallet_democracy.rs b/runtime/rococo/src/weights/pallet_democracy.rs index 453385b594e7..317b0d4bb0a1 100644 --- a/runtime/rococo/src/weights/pallet_democracy.rs +++ b/runtime/rococo/src/weights/pallet_democracy.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_democracy` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-08-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 // Executed Command: @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/rococo/src/weights +// --output=./runtime/rococo/src/weights/pallet_democracy.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -49,103 +49,134 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy Blacklist (r:1 w:0) // Storage: Democracy DepositOf (r:0 w:1) fn propose() -> Weight { - Weight::from_ref_time(41_783_000 as u64) + Weight::from_ref_time(37_453_000 as u64) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy DepositOf (r:1 w:1) - fn second() -> Weight { - Weight::from_ref_time(38_362_000 as u64) + /// The range of component `s` is `[0, 100]`. + fn second(s: u32, ) -> Weight { + Weight::from_ref_time(27_807_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(69_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_new() -> Weight { - Weight::from_ref_time(48_307_000 as u64) + /// The range of component `r` is `[1, 99]`. + fn vote_new(r: u32, ) -> Weight { + Weight::from_ref_time(35_336_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(120_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - fn vote_existing() -> Weight { - Weight::from_ref_time(48_500_000 as u64) + /// The range of component `r` is `[1, 99]`. + fn vote_existing(r: u32, ) -> Weight { + Weight::from_ref_time(35_107_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(123_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Cancellations (r:1 w:1) fn emergency_cancel() -> Weight { - Weight::from_ref_time(20_294_000 as u64) + Weight::from_ref_time(17_752_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) - // Storage: Democracy DepositOf (r:1 w:1) - // Storage: System Account (r:1 w:1) // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy Blacklist (r:0 w:1) - fn blacklist() -> Weight { - Weight::from_ref_time(75_191_000 as u64) + // Storage: Democracy DepositOf (r:1 w:1) + // Storage: System Account (r:1 w:1) + /// The range of component `p` is `[1, 100]`. + fn blacklist(p: u32, ) -> Weight { + Weight::from_ref_time(52_116_000 as u64) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(194_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().writes(6 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:0) - fn external_propose() -> Weight { - Weight::from_ref_time(16_369_000 as u64) + /// The range of component `v` is `[1, 100]`. + fn external_propose(v: u32, ) -> Weight { + Weight::from_ref_time(10_194_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(10_000 as u64).saturating_mul(v as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_majority() -> Weight { - Weight::from_ref_time(4_767_000 as u64) + Weight::from_ref_time(3_700_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:0 w:1) fn external_propose_default() -> Weight { - Weight::from_ref_time(4_866_000 as u64) + Weight::from_ref_time(3_713_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:1) // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn fast_track() -> Weight { - Weight::from_ref_time(19_986_000 as u64) + Weight::from_ref_time(17_441_000 as u64) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy NextExternal (r:1 w:1) // Storage: Democracy Blacklist (r:1 w:1) - fn veto_external() -> Weight { - Weight::from_ref_time(25_291_000 as u64) + /// The range of component `v` is `[0, 100]`. + fn veto_external(v: u32, ) -> Weight { + Weight::from_ref_time(18_536_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(42_000 as u64).saturating_mul(v as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy PublicProps (r:1 w:1) // Storage: Democracy DepositOf (r:1 w:1) // Storage: System Account (r:1 w:1) - fn cancel_proposal() -> Weight { - Weight::from_ref_time(63_703_000 as u64) + /// The range of component `p` is `[1, 100]`. + fn cancel_proposal(p: u32, ) -> Weight { + Weight::from_ref_time(42_174_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(164_000 as u64).saturating_mul(p as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:0 w:1) fn cancel_referendum() -> Weight { - Weight::from_ref_time(13_235_000 as u64) + Weight::from_ref_time(11_892_000 as u64) .saturating_add(T::DbWeight::get().writes(1 as u64)) } + // Storage: Scheduler Lookup (r:1 w:1) + // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `r` is `[1, 99]`. + fn cancel_queued(r: u32, ) -> Weight { + Weight::from_ref_time(23_252_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(2_242_000 as u64).saturating_mul(r as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + } // Storage: Democracy LowestUnbaked (r:1 w:1) // Storage: Democracy ReferendumCount (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:2 w:0) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:0) + /// The range of component `r` is `[1, 99]`. fn on_initialize_base(r: u32, ) -> Weight { - Weight::from_ref_time(5_980_000 as u64) - // Standard Error: 2_131 - .saturating_add(Weight::from_ref_time(2_104_197 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(1_457_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(2_956_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) @@ -155,36 +186,36 @@ impl pallet_democracy::WeightInfo for WeightInfo { // Storage: Democracy LastTabledWasExternal (r:1 w:0) // Storage: Democracy NextExternal (r:1 w:0) // Storage: Democracy PublicProps (r:1 w:0) - // Storage: Democracy ReferendumInfoOf (r:2 w:0) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:0) + /// The range of component `r` is `[1, 99]`. fn on_initialize_base_with_launch_period(r: u32, ) -> Weight { - Weight::from_ref_time(8_351_000 as u64) - // Standard Error: 2_308 - .saturating_add(Weight::from_ref_time(2_117_411 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(6_240_000 as u64) + // Standard Error: 3_000 + .saturating_add(Weight::from_ref_time(2_963_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(5 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:3 w:3) + // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) - // Storage: Democracy ReferendumInfoOf (r:2 w:2) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn delegate(r: u32, ) -> Weight { - Weight::from_ref_time(40_303_000 as u64) - // Standard Error: 3_789 - .saturating_add(Weight::from_ref_time(3_031_594 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(34_480_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(3_908_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(4 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(4 as u64)) .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(r as u64))) } // Storage: Democracy VotingOf (r:2 w:2) - // Storage: Democracy ReferendumInfoOf (r:2 w:2) - /// The range of component `r` is `[0, 99]`. + // Storage: Democracy ReferendumInfoOf (r:1 w:1) + /// The range of component `r` is `[1, 99]`. fn undelegate(r: u32, ) -> Weight { - Weight::from_ref_time(24_342_000 as u64) - // Standard Error: 2_624 - .saturating_add(Weight::from_ref_time(2_962_125 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(17_446_000 as u64) + // Standard Error: 6_000 + .saturating_add(Weight::from_ref_time(3_917_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(r as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) @@ -192,48 +223,76 @@ impl pallet_democracy::WeightInfo for WeightInfo { } // Storage: Democracy PublicProps (r:0 w:1) fn clear_public_proposals() -> Weight { - Weight::from_ref_time(5_811_000 as u64) + Weight::from_ref_time(3_727_000 as u64) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Democracy Preimages (r:1 w:1) + /// The range of component `b` is `[0, 16384]`. + fn note_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(25_720_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Democracy Preimages (r:1 w:1) + /// The range of component `b` is `[0, 16384]`. + fn note_imminent_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(17_884_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + } + // Storage: Democracy Preimages (r:1 w:1) + // Storage: System Account (r:1 w:0) + /// The range of component `b` is `[0, 16384]`. + fn reap_preimage(b: u32, ) -> Weight { + Weight::from_ref_time(24_695_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(1_000 as u64).saturating_mul(b as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn unlock_remove(r: u32, ) -> Weight { - Weight::from_ref_time(22_894_000 as u64) - // Standard Error: 2_967 - .saturating_add(Weight::from_ref_time(142_001 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(22_207_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(36_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy VotingOf (r:1 w:1) // Storage: Balances Locks (r:1 w:1) // Storage: System Account (r:1 w:1) - /// The range of component `r` is `[0, 99]`. + /// The range of component `r` is `[1, 99]`. fn unlock_set(r: u32, ) -> Weight { - Weight::from_ref_time(28_227_000 as u64) - // Standard Error: 673 - .saturating_add(Weight::from_ref_time(87_748 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(21_561_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(110_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(3 as u64)) .saturating_add(T::DbWeight::get().writes(3 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 100]`. + /// The range of component `r` is `[1, 99]`. fn remove_vote(r: u32, ) -> Weight { - Weight::from_ref_time(15_578_000 as u64) - // Standard Error: 1_035 - .saturating_add(Weight::from_ref_time(105_378 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(13_204_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(105_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Democracy ReferendumInfoOf (r:1 w:1) // Storage: Democracy VotingOf (r:1 w:1) - /// The range of component `r` is `[1, 100]`. + /// The range of component `r` is `[1, 99]`. fn remove_other_vote(r: u32, ) -> Weight { - Weight::from_ref_time(15_542_000 as u64) - // Standard Error: 1_104 - .saturating_add(Weight::from_ref_time(109_552 as u64).saturating_mul(r as u64)) + Weight::from_ref_time(12_994_000 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(106_000 as u64).saturating_mul(r as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/rococo/src/weights/pallet_preimage.rs b/runtime/rococo/src/weights/pallet_preimage.rs index 1755de2b34e6..5268e8054a13 100644 --- a/runtime/rococo/src/weights/pallet_preimage.rs +++ b/runtime/rococo/src/weights/pallet_preimage.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-08-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 // Executed Command: @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/rococo/src/weights +// --output=./runtime/rococo/src/weights/pallet_preimage.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -44,90 +44,91 @@ use sp_std::marker::PhantomData; /// Weight functions for `pallet_preimage`. pub struct WeightInfo(PhantomData); impl pallet_preimage::WeightInfo for WeightInfo { + // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(29_017_000 as u64) + Weight::from_ref_time(0 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_113 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:0) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(19_793_000 as u64) - // Standard Error: 1 - .saturating_add(Weight::from_ref_time(2_115 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + Weight::from_ref_time(0 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:0) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(18_854_000 as u64) - // Standard Error: 1 - .saturating_add(Weight::from_ref_time(2_115 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + Weight::from_ref_time(0 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(3_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(38_886_000 as u64) + Weight::from_ref_time(35_236_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(27_017_000 as u64) + Weight::from_ref_time(23_396_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(25_041_000 as u64) + Weight::from_ref_time(33_944_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(13_933_000 as u64) + Weight::from_ref_time(22_151_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(17_760_000 as u64) + Weight::from_ref_time(16_617_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(8_816_000 as u64) + Weight::from_ref_time(6_552_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(25_068_000 as u64) + Weight::from_ref_time(23_787_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(8_917_000 as u64) + Weight::from_ref_time(16_327_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(8_915_000 as u64) + Weight::from_ref_time(6_289_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/rococo/src/weights/pallet_scheduler.rs b/runtime/rococo/src/weights/pallet_scheduler.rs index ae9dc6426622..06a77fcee9cb 100644 --- a/runtime/rococo/src/weights/pallet_scheduler.rs +++ b/runtime/rococo/src/weights/pallet_scheduler.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-08-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm4`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("rococo-dev"), DB CACHE: 1024 // Executed Command: @@ -32,7 +32,7 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/rococo/src/weights +// --output=./runtime/rococo/src/weights/pallet_scheduler.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -44,57 +44,133 @@ use sp_std::marker::PhantomData; /// Weight functions for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler IncompleteSince (r:1 w:1) - fn service_agendas_base() -> Weight { - Weight::from_ref_time(4_700_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(1_256_000 as u64) + // Standard Error: 42_000 + .saturating_add(Weight::from_ref_time(26_925_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. - fn service_agenda_base(s: u32, ) -> Weight { - Weight::from_ref_time(3_868_000 as u64) - // Standard Error: 2_747 - .saturating_add(Weight::from_ref_time(629_992 as u64).saturating_mul(s as u64)) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(921_000 as u64) + // Standard Error: 35_000 + .saturating_add(Weight::from_ref_time(21_922_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - fn service_task_base() -> Weight { - Weight::from_ref_time(12_316_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(0 as u64) + // Standard Error: 62_000 + .saturating_add(Weight::from_ref_time(24_926_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } + // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[128, 4194304]`. - fn service_task_fetched(s: u32, ) -> Weight { - Weight::from_ref_time(24_103_000 as u64) - // Standard Error: 5 - .saturating_add(Weight::from_ref_time(1_154 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(10_674_000 as u64) + // Standard Error: 31_000 + .saturating_add(Weight::from_ref_time(20_631_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) + } + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:0) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named_aborted(s: u32, ) -> Weight { + Weight::from_ref_time(2_607_000 as u64) + // Standard Error: 20_000 + .saturating_add(Weight::from_ref_time(10_009_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) + } + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:0) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_aborted(s: u32, ) -> Weight { + Weight::from_ref_time(3_381_000 as u64) + // Standard Error: 17_000 + .saturating_add(Weight::from_ref_time(7_945_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) } + // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - fn service_task_named() -> Weight { - Weight::from_ref_time(13_408_000 as u64) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_named(s: u32, ) -> Weight { + Weight::from_ref_time(6_676_000 as u64) + // Standard Error: 25_000 + .saturating_add(Weight::from_ref_time(16_966_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:1 w:1) - fn service_task_periodic() -> Weight { - Weight::from_ref_time(19_302_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic(s: u32, ) -> Weight { + Weight::from_ref_time(8_899_000 as u64) + // Standard Error: 24_000 + .saturating_add(Weight::from_ref_time(14_630_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - fn execute_dispatch_signed() -> Weight { - Weight::from_ref_time(3_885_000 as u64) + // Storage: Scheduler Agenda (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named(s: u32, ) -> Weight { + Weight::from_ref_time(8_583_000 as u64) + // Standard Error: 19_000 + .saturating_add(Weight::from_ref_time(12_228_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - fn execute_dispatch_unsigned() -> Weight { - Weight::from_ref_time(4_037_000 as u64) + // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize(s: u32, ) -> Weight { + Weight::from_ref_time(8_544_000 as u64) + // Standard Error: 19_000 + .saturating_add(Weight::from_ref_time(11_364_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 49]`. + /// The range of component `s` is `[0, 50]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(16_768_000 as u64) - // Standard Error: 3_650 - .saturating_add(Weight::from_ref_time(667_428 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_060_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(46_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -102,19 +178,19 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Lookup (r:0 w:1) /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(19_239_000 as u64) - // Standard Error: 1_456 - .saturating_add(Weight::from_ref_time(578_125 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(17_694_000 as u64) + // Standard Error: 7_000 + .saturating_add(Weight::from_ref_time(2_368_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 49]`. + /// The range of component `s` is `[0, 50]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(19_065_000 as u64) - // Standard Error: 4_027 - .saturating_add(Weight::from_ref_time(719_766 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(22_258_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(60_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -122,9 +198,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Agenda (r:1 w:1) /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(20_039_000 as u64) - // Standard Error: 2_179 - .saturating_add(Weight::from_ref_time(627_335 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(18_882_000 as u64) + // Standard Error: 7_000 + .saturating_add(Weight::from_ref_time(2_379_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/runtime/test-runtime/src/lib.rs b/runtime/test-runtime/src/lib.rs index a43e13eb015e..2eade55e3877 100644 --- a/runtime/test-runtime/src/lib.rs +++ b/runtime/test-runtime/src/lib.rs @@ -38,7 +38,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId; use frame_election_provider_support::{onchain, SequentialPhragmen}; use frame_support::{ construct_runtime, parameter_types, - traits::{Everything, KeyOwnerProofSystem, WithdrawReasons}, + traits::{Everything, KeyOwnerProofSystem}, }; use pallet_grandpa::{fg_primitives, AuthorityId as GrandpaId}; use pallet_session::historical as session_historical; @@ -455,8 +455,6 @@ impl claims::Config for Runtime { parameter_types! { pub storage MinVestedTransfer: Balance = 100 * DOLLARS; - pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = - WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -465,7 +463,6 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = (); - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } diff --git a/runtime/westend/src/lib.rs b/runtime/westend/src/lib.rs index 454e367e2c15..6aef1be3a267 100644 --- a/runtime/westend/src/lib.rs +++ b/runtime/westend/src/lib.rs @@ -25,7 +25,7 @@ use beefy_primitives::crypto::AuthorityId as BeefyId; use frame_election_provider_support::{onchain, SequentialPhragmen}; use frame_support::{ construct_runtime, parameter_types, - traits::{ConstU32, InstanceFilter, KeyOwnerProofSystem, WithdrawReasons}, + traits::{ConstU32, InstanceFilter, KeyOwnerProofSystem}, weights::ConstantMultiplier, PalletId, }; @@ -181,7 +181,8 @@ impl pallet_scheduler::Config for Runtime { type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = weights::pallet_scheduler::WeightInfo; type OriginPrivilegeCmp = frame_support::traits::EqualPrivilegeOnly; - type Preimages = Preimage; + type PreimageProvider = Preimage; + type NoPreimagePostponement = NoPreimagePostponement; } parameter_types! { @@ -195,6 +196,7 @@ impl pallet_preimage::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type ManagerOrigin = EnsureRoot; + type MaxSize = PreimageMaxSize; type BaseDeposit = PreimageBaseDeposit; type ByteDeposit = PreimageByteDeposit; } @@ -712,8 +714,6 @@ impl pallet_recovery::Config for Runtime { parameter_types! { pub const MinVestedTransfer: Balance = 100 * CENTS; - pub UnvestedFundsAllowedWithdrawReasons: WithdrawReasons = - WithdrawReasons::except(WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE); } impl pallet_vesting::Config for Runtime { @@ -722,7 +722,6 @@ impl pallet_vesting::Config for Runtime { type BlockNumberToBalance = ConvertInto; type MinVestedTransfer = MinVestedTransfer; type WeightInfo = weights::pallet_vesting::WeightInfo; - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; const MAX_VESTING_SCHEDULES: u32 = 28; } @@ -1216,12 +1215,6 @@ pub type Executive = frame_executive::Executive< StakingMigrationV11OldPallet, >, pallet_staking::migrations::v12::MigrateToV12, - // "Bound uses of call" - pallet_preimage::migration::v1::Migration, - pallet_scheduler::migration::v3::MigrateToV4, - pallet_multisig::migrations::v1::MigrateToV1, - // "Properly migrate weights to v2" - parachains_configuration::migration::v3::MigrateToV3, ), >; /// The payload being signed in transactions. diff --git a/runtime/westend/src/weights/pallet_preimage.rs b/runtime/westend/src/weights/pallet_preimage.rs index 97f066d7d40b..afd51148cdde 100644 --- a/runtime/westend/src/weights/pallet_preimage.rs +++ b/runtime/westend/src/weights/pallet_preimage.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_preimage` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024 // Executed Command: @@ -32,102 +32,103 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/westend/src/weights +// --output=./runtime/westend/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight}}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_preimage`. pub struct WeightInfo(PhantomData); impl pallet_preimage::WeightInfo for WeightInfo { + // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) /// The range of component `s` is `[0, 4194304]`. fn note_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(28_888_000 as u64) + Weight::from_ref_time(0 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_116 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:0) /// The range of component `s` is `[0, 4194304]`. fn note_requested_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(20_640_000 as u64) + Weight::from_ref_time(0 as u64) // Standard Error: 0 - .saturating_add(Weight::from_ref_time(2_115 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } - // Storage: Preimage StatusFor (r:1 w:1) - // Storage: Preimage PreimageFor (r:0 w:1) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:0) /// The range of component `s` is `[0, 4194304]`. fn note_no_deposit_preimage(s: u32, ) -> Weight { - Weight::from_ref_time(19_203_000 as u64) - // Standard Error: 1 - .saturating_add(Weight::from_ref_time(2_115 as u64).saturating_mul(s as u64)) - .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(2 as u64)) + Weight::from_ref_time(0 as u64) + // Standard Error: 0 + .saturating_add(Weight::from_ref_time(2_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_preimage() -> Weight { - Weight::from_ref_time(41_563_000 as u64) + Weight::from_ref_time(40_836_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unnote_no_deposit_preimage() -> Weight { - Weight::from_ref_time(28_606_000 as u64) + Weight::from_ref_time(28_774_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_preimage() -> Weight { - Weight::from_ref_time(27_447_000 as u64) + Weight::from_ref_time(37_963_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_no_deposit_preimage() -> Weight { - Weight::from_ref_time(14_862_000 as u64) + Weight::from_ref_time(25_754_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_unnoted_preimage() -> Weight { - Weight::from_ref_time(18_337_000 as u64) + Weight::from_ref_time(17_769_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn request_requested_preimage() -> Weight { - Weight::from_ref_time(9_074_000 as u64) + Weight::from_ref_time(9_214_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_preimage() -> Weight { - Weight::from_ref_time(28_192_000 as u64) + Weight::from_ref_time(26_179_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Preimage PreimageFor (r:0 w:1) fn unrequest_unnoted_preimage() -> Weight { - Weight::from_ref_time(9_012_000 as u64) + Weight::from_ref_time(18_809_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) - .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Preimage StatusFor (r:1 w:1) fn unrequest_multi_referenced_preimage() -> Weight { - Weight::from_ref_time(8_961_000 as u64) + Weight::from_ref_time(8_759_000 as u64) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } diff --git a/runtime/westend/src/weights/pallet_scheduler.rs b/runtime/westend/src/weights/pallet_scheduler.rs index f325f2311093..edbd3187d1c9 100644 --- a/runtime/westend/src/weights/pallet_scheduler.rs +++ b/runtime/westend/src/weights/pallet_scheduler.rs @@ -16,8 +16,8 @@ //! Autogenerated weights for `pallet_scheduler` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2022-10-03, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bm2`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! HOSTNAME: `bm5`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024 // Executed Command: @@ -32,69 +32,145 @@ // --execution=wasm // --wasm-execution=compiled // --header=./file_header.txt -// --output=./runtime/westend/src/weights +// --output=./runtime/westend/src/weights/ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] -use frame_support::{traits::Get, weights::Weight}; +use frame_support::{traits::Get, weights::{Weight}}; use sp_std::marker::PhantomData; /// Weight functions for `pallet_scheduler`. pub struct WeightInfo(PhantomData); impl pallet_scheduler::WeightInfo for WeightInfo { - // Storage: Scheduler IncompleteSince (r:1 w:1) - fn service_agendas_base() -> Weight { - Weight::from_ref_time(4_399_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(16_183_000 as u64) + // Standard Error: 27_000 + .saturating_add(Weight::from_ref_time(18_374_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((4 as u64).saturating_mul(s as u64))) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 50]`. - fn service_agenda_base(s: u32, ) -> Weight { - Weight::from_ref_time(3_771_000 as u64) - // Standard Error: 2_641 - .saturating_add(Weight::from_ref_time(610_848 as u64).saturating_mul(s as u64)) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(15_223_000 as u64) + // Standard Error: 28_000 + .saturating_add(Weight::from_ref_time(15_096_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } - fn service_task_base() -> Weight { - Weight::from_ref_time(12_651_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:1) + // Storage: Preimage StatusFor (r:1 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(13_305_000 as u64) + // Standard Error: 28_000 + .saturating_add(Weight::from_ref_time(16_211_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(s as u64))) } + // Storage: Scheduler Agenda (r:1 w:1) // Storage: Preimage PreimageFor (r:1 w:1) // Storage: Preimage StatusFor (r:1 w:1) - /// The range of component `s` is `[128, 4194304]`. - fn service_task_fetched(s: u32, ) -> Weight { - Weight::from_ref_time(24_280_000 as u64) - // Standard Error: 0 - .saturating_add(Weight::from_ref_time(1_126 as u64).saturating_mul(s as u64)) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_resolved(s: u32, ) -> Weight { + Weight::from_ref_time(15_574_000 as u64) + // Standard Error: 22_000 + .saturating_add(Weight::from_ref_time(13_923_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((2 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) + } + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:0) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named_aborted(s: u32, ) -> Weight { + Weight::from_ref_time(11_205_000 as u64) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(5_044_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) + .saturating_add(T::DbWeight::get().writes(2 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) + } + // Storage: Scheduler Agenda (r:2 w:2) + // Storage: Preimage PreimageFor (r:1 w:0) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_aborted(s: u32, ) -> Weight { + Weight::from_ref_time(10_287_000 as u64) + // Standard Error: 5_000 + .saturating_add(Weight::from_ref_time(3_072_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(2 as u64)) } + // Storage: Scheduler Agenda (r:2 w:2) // Storage: Scheduler Lookup (r:0 w:1) - fn service_task_named() -> Weight { - Weight::from_ref_time(13_929_000 as u64) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic_named(s: u32, ) -> Weight { + Weight::from_ref_time(14_489_000 as u64) + // Standard Error: 16_000 + .saturating_add(Weight::from_ref_time(9_468_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64))) } - // Storage: Scheduler Agenda (r:1 w:1) - fn service_task_periodic() -> Weight { - Weight::from_ref_time(19_285_000 as u64) + // Storage: Scheduler Agenda (r:2 w:2) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_periodic(s: u32, ) -> Weight { + Weight::from_ref_time(16_768_000 as u64) + // Standard Error: 10_000 + .saturating_add(Weight::from_ref_time(7_121_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64))) .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - fn execute_dispatch_signed() -> Weight { - Weight::from_ref_time(4_026_000 as u64) + // Storage: Scheduler Agenda (r:1 w:1) + // Storage: Scheduler Lookup (r:0 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize_named(s: u32, ) -> Weight { + Weight::from_ref_time(17_047_000 as u64) + // Standard Error: 9_000 + .saturating_add(Weight::from_ref_time(6_192_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) + .saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64))) } - fn execute_dispatch_unsigned() -> Weight { - Weight::from_ref_time(4_078_000 as u64) + // Storage: Scheduler Agenda (r:1 w:1) + /// The range of component `s` is `[1, 50]`. + fn on_initialize(s: u32, ) -> Weight { + Weight::from_ref_time(17_163_000 as u64) + // Standard Error: 10_000 + .saturating_add(Weight::from_ref_time(5_300_000 as u64).saturating_mul(s as u64)) + .saturating_add(T::DbWeight::get().reads(1 as u64)) + .saturating_add(T::DbWeight::get().writes(1 as u64)) } // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 49]`. + /// The range of component `s` is `[0, 50]`. fn schedule(s: u32, ) -> Weight { - Weight::from_ref_time(17_176_000 as u64) - // Standard Error: 3_203 - .saturating_add(Weight::from_ref_time(645_757 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(19_757_000 as u64) + // Standard Error: 1_000 + .saturating_add(Weight::from_ref_time(75_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(1 as u64)) } @@ -102,19 +178,19 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Lookup (r:0 w:1) /// The range of component `s` is `[1, 50]`. fn cancel(s: u32, ) -> Weight { - Weight::from_ref_time(19_408_000 as u64) - // Standard Error: 1_645 - .saturating_add(Weight::from_ref_time(575_558 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(20_399_000 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(880_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(1 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } // Storage: Scheduler Lookup (r:1 w:1) // Storage: Scheduler Agenda (r:1 w:1) - /// The range of component `s` is `[0, 49]`. + /// The range of component `s` is `[0, 50]`. fn schedule_named(s: u32, ) -> Weight { - Weight::from_ref_time(20_173_000 as u64) - // Standard Error: 3_998 - .saturating_add(Weight::from_ref_time(684_714 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(23_671_000 as u64) + // Standard Error: 2_000 + .saturating_add(Weight::from_ref_time(121_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } @@ -122,9 +198,9 @@ impl pallet_scheduler::WeightInfo for WeightInfo { // Storage: Scheduler Agenda (r:1 w:1) /// The range of component `s` is `[1, 50]`. fn cancel_named(s: u32, ) -> Weight { - Weight::from_ref_time(20_330_000 as u64) - // Standard Error: 2_310 - .saturating_add(Weight::from_ref_time(621_196 as u64).saturating_mul(s as u64)) + Weight::from_ref_time(23_233_000 as u64) + // Standard Error: 4_000 + .saturating_add(Weight::from_ref_time(924_000 as u64).saturating_mul(s as u64)) .saturating_add(T::DbWeight::get().reads(2 as u64)) .saturating_add(T::DbWeight::get().writes(2 as u64)) } diff --git a/scripts/ci/gitlab/lingua.dic b/scripts/ci/gitlab/lingua.dic index 3add6a276cf0..ea2da595908e 100644 --- a/scripts/ci/gitlab/lingua.dic +++ b/scripts/ci/gitlab/lingua.dic @@ -138,7 +138,6 @@ KYC/M lib libp2p lifecycle/MS -liveness lookahead/MS lookup/MS LRU @@ -223,7 +222,6 @@ redhat/M register/CD relayer repo/MS -requesters reservable responder/SM retriability diff --git a/scripts/ci/gitlab/pipeline/build.yml b/scripts/ci/gitlab/pipeline/build.yml index 791b01c2b632..dcc05427f0b3 100644 --- a/scripts/ci/gitlab/pipeline/build.yml +++ b/scripts/ci/gitlab/pipeline/build.yml @@ -169,8 +169,7 @@ build-implementers-guide: - .test-refs - .collect-artifacts-short script: - - apt-get -y update; apt-get install -y graphviz - - cargo install mdbook mdbook-mermaid mdbook-linkcheck mdbook-graphviz + - cargo install mdbook mdbook-mermaid mdbook-linkcheck - mdbook build ./roadmap/implementers-guide - mkdir -p artifacts - mv roadmap/implementers-guide/book artifacts/ diff --git a/xcm/pallet-xcm/src/lib.rs b/xcm/pallet-xcm/src/lib.rs index 78dc5087d960..f5e5d0f8c004 100644 --- a/xcm/pallet-xcm/src/lib.rs +++ b/xcm/pallet-xcm/src/lib.rs @@ -31,7 +31,7 @@ use sp_runtime::{ RuntimeDebug, }; use sp_std::{boxed::Box, marker::PhantomData, prelude::*, result::Result, vec}; -use xcm::{latest::Weight as XcmWeight, prelude::*}; +use xcm::prelude::*; use xcm_executor::traits::ConvertOrigin; use frame_support::PalletId; @@ -218,10 +218,6 @@ pub mod pallet { /// /// \[ location, query ID \] NotifyTargetMigrationFail(VersionedMultiLocation, QueryId), - /// Some assets have been claimed from an asset trap - /// - /// \[ hash, origin, assets \] - AssetsClaimed(H256, MultiLocation, VersionedMultiAssets), } #[pallet::origin] @@ -574,11 +570,11 @@ pub mod pallet { /// /// NOTE: A successful return to this does *not* imply that the `msg` was executed successfully /// to completion; only that *some* of it was executed. - #[pallet::weight(Weight::from_ref_time(max_weight.saturating_add(100_000_000u64)))] + #[pallet::weight(max_weight.saturating_add(Weight::from_ref_time(100_000_000u64)))] pub fn execute( origin: OriginFor, message: Box::RuntimeCall>>, - max_weight: XcmWeight, + max_weight: Weight, ) -> DispatchResultWithPostInfo { let origin_location = T::ExecuteXcmOrigin::ensure_origin(origin)?; let message = (*message).try_into().map_err(|()| Error::::BadVersion)?; @@ -588,8 +584,8 @@ pub mod pallet { let outcome = T::XcmExecutor::execute_xcm_in_credit( origin_location, message, - max_weight, - max_weight, + max_weight.ref_time(), + max_weight.ref_time(), ); let result = Ok(Some(outcome.weight_used().saturating_add(100_000_000)).into()); Self::deposit_event(Event::Attempted(outcome)); @@ -1316,13 +1312,12 @@ pub mod pallet { (0, Here) => (), _ => return false, }; - let hash = BlakeTwo256::hash_of(&(origin, versioned.clone())); + let hash = BlakeTwo256::hash_of(&(origin, versioned)); match AssetTraps::::get(hash) { 0 => return false, 1 => AssetTraps::::remove(hash), n => AssetTraps::::insert(hash, n - 1), } - Self::deposit_event(Event::AssetsClaimed(hash, origin.clone(), versioned)); return true } } diff --git a/xcm/pallet-xcm/src/tests.rs b/xcm/pallet-xcm/src/tests.rs index b619efefbe9b..ddac7518e510 100644 --- a/xcm/pallet-xcm/src/tests.rs +++ b/xcm/pallet-xcm/src/tests.rs @@ -517,7 +517,7 @@ fn execute_withdraw_to_deposit_works() { buy_execution((Here, SEND_AMOUNT)), DepositAsset { assets: All.into(), max_assets: 1, beneficiary: dest }, ]))), - weight + Weight::from_ref_time(weight) )); assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE - SEND_AMOUNT); assert_eq!(Balances::total_balance(&BOB), SEND_AMOUNT); @@ -549,7 +549,7 @@ fn trapped_assets_can_be_claimed() { // This would succeed, but we never get to it. DepositAsset { assets: All.into(), max_assets: 1, beneficiary: dest.clone() }, ]))), - weight + Weight::from_ref_time(weight) )); let source: MultiLocation = Junction::AccountId32 { network: NetworkId::Any, id: ALICE.into() }.into(); @@ -579,7 +579,7 @@ fn trapped_assets_can_be_claimed() { buy_execution((Here, SEND_AMOUNT)), DepositAsset { assets: All.into(), max_assets: 1, beneficiary: dest.clone() }, ]))), - weight + Weight::from_ref_time(weight) )); assert_eq!(Balances::total_balance(&ALICE), INITIAL_BALANCE - SEND_AMOUNT); @@ -594,7 +594,7 @@ fn trapped_assets_can_be_claimed() { buy_execution((Here, SEND_AMOUNT)), DepositAsset { assets: All.into(), max_assets: 1, beneficiary: dest }, ]))), - weight + Weight::from_ref_time(weight) )); assert_eq!( last_event(), diff --git a/xcm/xcm-executor/integration-tests/src/lib.rs b/xcm/xcm-executor/integration-tests/src/lib.rs index 272ceadfea01..6d263fe46245 100644 --- a/xcm/xcm-executor/integration-tests/src/lib.rs +++ b/xcm/xcm-executor/integration-tests/src/lib.rs @@ -17,6 +17,7 @@ #![cfg_attr(not(feature = "std"), no_std)] #![cfg(test)] +use frame_support::weights::Weight; use polkadot_test_client::{ BlockBuilderExt, ClientBlockImportExt, DefaultTestClientBuilderExt, ExecutionStrategy, InitPolkadotBlockBuilder, TestClientBuilder, TestClientBuilderExt, @@ -46,7 +47,7 @@ fn basic_buy_fees_message_executes() { &client, polkadot_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute { message: Box::new(VersionedXcm::from(msg)), - max_weight: 1_000_000_000, + max_weight: Weight::from_ref_time(1_000_000_000), }), sp_keyring::Sr25519Keyring::Alice, 0, @@ -128,7 +129,7 @@ fn query_response_fires() { &client, polkadot_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute { message: msg, - max_weight: 1_000_000_000, + max_weight: Weight::from_ref_time(1_000_000_000), }), sp_keyring::Sr25519Keyring::Alice, 1, @@ -216,7 +217,7 @@ fn query_response_elicits_handler() { &client, polkadot_test_runtime::RuntimeCall::Xcm(pallet_xcm::Call::execute { message: Box::new(VersionedXcm::from(msg)), - max_weight: 1_000_000_000, + max_weight: Weight::from_ref_time(1_000_000_000), }), sp_keyring::Sr25519Keyring::Alice, 1, From cf3f4535073ee196344d13780689e354e38da56d Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Mon, 10 Oct 2022 13:54:32 +0100 Subject: [PATCH 39/49] * Remove unused imports --- node/malus/src/variants/suggest_garbage_candidate.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/node/malus/src/variants/suggest_garbage_candidate.rs b/node/malus/src/variants/suggest_garbage_candidate.rs index 767b7494f6fe..e7d610d6a397 100644 --- a/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/node/malus/src/variants/suggest_garbage_candidate.rs @@ -33,7 +33,7 @@ use polkadot_cli::{ }; use polkadot_node_core_candidate_validation::find_validation_data; use polkadot_node_primitives::{AvailableData, BlockData, PoV}; -use polkadot_primitives::v2::{CandidateDescriptor, CandidateHash}; +use polkadot_primitives::v2::CandidateDescriptor; use polkadot_node_subsystem_util::request_validators; use sp_core::traits::SpawnNamed; @@ -53,14 +53,13 @@ use crate::{ // Import extra types relevant to the particular // subsystem. use polkadot_node_subsystem::{ - messages::{CandidateBackingMessage, CollatorProtocolMessage}, + messages::{CandidateBackingMessage}, SpawnGlue, }; use polkadot_primitives::v2::CandidateReceipt; use std::{ - collections::HashMap, - sync::{Arc, Mutex}, + sync::Arc, }; /// Replace outgoing approval messages with disputes. From f1440e7ab1200d370088a20d729334557ca0fc42 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Mon, 10 Oct 2022 14:57:26 +0100 Subject: [PATCH 40/49] * cargo +nightly fmt --all --- node/malus/src/variants/suggest_garbage_candidate.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/node/malus/src/variants/suggest_garbage_candidate.rs b/node/malus/src/variants/suggest_garbage_candidate.rs index e7d610d6a397..27ce2f3136bc 100644 --- a/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/node/malus/src/variants/suggest_garbage_candidate.rs @@ -52,15 +52,10 @@ use crate::{ // Import extra types relevant to the particular // subsystem. -use polkadot_node_subsystem::{ - messages::{CandidateBackingMessage}, - SpawnGlue, -}; +use polkadot_node_subsystem::{messages::CandidateBackingMessage, SpawnGlue}; use polkadot_primitives::v2::CandidateReceipt; -use std::{ - sync::Arc, -}; +use std::sync::Arc; /// Replace outgoing approval messages with disputes. #[derive(Clone)] From 6f54587c17c643d620e749ea6c5b51d1288d276e Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Tue, 11 Oct 2022 17:15:12 +0100 Subject: [PATCH 41/49] Make tweaks based on PR comments --- node/malus/src/variants/common.rs | 58 ++++++++----------- .../src/variants/suggest_garbage_candidate.rs | 29 +++++----- 2 files changed, 37 insertions(+), 50 deletions(-) diff --git a/node/malus/src/variants/common.rs b/node/malus/src/variants/common.rs index ad3a50118c52..036173d700a9 100644 --- a/node/malus/src/variants/common.rs +++ b/node/malus/src/variants/common.rs @@ -215,7 +215,7 @@ where msg: FromOrchestra, ) -> Option> { match msg { - // Behaviour related to the approval subsystem + // Message sent by the approval voting subsystem FromOrchestra::Communication { msg: CandidateValidationMessage::ValidateFromExhaustive( @@ -243,14 +243,15 @@ where ), }) } - // Create the fake response with probability `p` if the `PoV` is malicious. + // Create the fake response with probability `p` if the `PoV` is malicious, + // where 'p' defaults to 100% for suggest-garbage-candidate variant. let behave_maliciously = self.distribution.sample(&mut rand::thread_rng()); match behave_maliciously { true => { gum::info!( target: MALUS, - "😈 Malicious behaviour is sampled as: {:?}. Now outputting malicious ValidationResult::Valid message.", - &behave_maliciously, + ?behave_maliciously, + "😈 Creating malicious ValidationResult::Valid message with fake candidate commitments.", ); create_validation_response( @@ -264,8 +265,8 @@ where // Behave normally with probability `(1-p)` for a malicious `PoV`. gum::info!( target: MALUS, - "😈 Malicious behaviour is sampled as: {:?}. Faking normal behaviour and outputting CandidateValidationMessage::ValidateFromExhaustive.", - &behave_maliciously, + ?behave_maliciously, + "😈 Passing CandidateValidationMessage::ValidateFromExhaustive to the candidate validation subsystem.", ); Some(FromOrchestra::Communication { @@ -287,21 +288,17 @@ where let behave_maliciously = self.distribution.sample(&mut rand::thread_rng()); match behave_maliciously { true => { - gum::info!( - target: MALUS, - "😈 Malicious behaviour is sampled as: {:?}. Now setting ValidationResult::Invalid.", - &behave_maliciously, - ); - let validation_result = ValidationResult::Invalid(InvalidCandidate::InvalidOutputs); - - gum::debug!( + + gum::info!( target: MALUS, + ?behave_maliciously, para_id = ?candidate_receipt.descriptor.para_id, - "ValidateFromExhaustive result: {:?}", - &validation_result + "😈 Maliciously sending invalid validation result: {:?}.", + &validation_result, ); + // We're not even checking the candidate, this makes us appear faster than honest validators. sender.send(Ok(validation_result)).unwrap(); None @@ -310,8 +307,8 @@ where // Behave normally with probability `(1-p)` gum::info!( target: MALUS, - "😈 Malicious behaviour is sampled as: {:?}. Faking normal behaviour and outputting CandidateValidationMessage::ValidateFromExhaustive message.", - &behave_maliciously, + ?behave_maliciously, + "😈 Behaving normally and passing CandidateValidationMessage::ValidateFromExhaustive message.", ); Some(FromOrchestra::Communication { @@ -365,14 +362,14 @@ where }) } // If the `PoV` is malicious, back the candidate with some probability `p`, - // which defaults to 100% for suggest-garbage-candidate variant. + // where 'p' defaults to 100% for suggest-garbage-candidate variant. let behave_maliciously = self.distribution.sample(&mut rand::thread_rng()); match behave_maliciously { true => { gum::info!( target: MALUS, - "😈 Malicious behaviour is sampled as: {:?}. Backing candidate with malicious PoV.", - &behave_maliciously, + ?behave_maliciously, + "😈 Backing candidate with malicious PoV.", ); self.send_validation_response( @@ -395,27 +392,19 @@ where }, FakeCandidateValidation::BackingInvalid | FakeCandidateValidation::BackingAndApprovalInvalid => { - // We back a garbage candidate with some probability `p`, - // which defaults to 100% for suggest-garbage-candidate variant. + // Maliciously set the validation result to invalid for a valid candidate with probability `p` let behave_maliciously = self.distribution.sample(&mut rand::thread_rng()); match behave_maliciously { true => { - gum::info!( - target: MALUS, - "😈 Malicious behaviour is sampled as: {:?}. Setting ValidationResult::Invalid for valid candidate.", - &behave_maliciously, - ); - let validation_result = ValidationResult::Invalid( self.fake_validation_error.clone().into(), ); - gum::debug!( + gum::info!( target: MALUS, para_id = ?candidate_receipt.descriptor.para_id, - "ValidateFromChainState result: {:?}", - &validation_result + "😈 Maliciously sending invalid validation result: {:?}.", + &validation_result, ); - // We're not even checking the candidate, this makes us appear faster than honest validators. response_sender.send(Ok(validation_result)).unwrap(); None @@ -424,8 +413,7 @@ where false => { gum::info!( target: MALUS, - "😈 Malicious behaviour is sampled as: {:?}. Faking normal behaviour and outputting CandidateValidationMessage::ValidateFromChainState message.", - &behave_maliciously, + "😈 'Decided' to not act maliciously.", ); Some(FromOrchestra::Communication { diff --git a/node/malus/src/variants/suggest_garbage_candidate.rs b/node/malus/src/variants/suggest_garbage_candidate.rs index 27ce2f3136bc..d57d678fbf1a 100644 --- a/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/node/malus/src/variants/suggest_garbage_candidate.rs @@ -83,7 +83,7 @@ where } => { gum::info!( target: MALUS, - "😈 Started Malus node with '--percentage' set to: {:?}", + "😈 Started Malus node with a chance of {:?}% to behave maliciously for a given candidate.", &self.percentage, ); @@ -94,22 +94,22 @@ where "Received request to second candidate", ); - // Need to draw value from Bernoulli distribution with given probability of success defined by the Clap parameter. - // Note that clap parameter must be f64 since this is expected by the Bernoulli::new() function, hence it must be converted. + // Need to draw value from Bernoulli distribution with given probability of success defined by the clap parameter. + // Note that clap parameter must be f64 since this is expected by the Bernoulli::new() function. + // It must be converted from u8, due to the lack of support for the .range() call on u64 in the clap crate. let distribution = Bernoulli::new(self.percentage / 100.0) .expect("Invalid probability! Percentage must be in range [0..=100]."); - // Draw a random value from the distribution, where T: bool, and probability of drawing a 'true' value is = to percentage parameter, - // using thread_rng as the source of randomness. + // Draw a random boolean from the Bernoulli distribution with probability of true equal to `p`. + // We use `rand::thread_rng` as the source of randomness. let generate_malicious_candidate = distribution.sample(&mut rand::thread_rng()); - gum::debug!( - target: MALUS, - "😈 Sampled value from Bernoulli distribution is: {:?}", - &generate_malicious_candidate, - ); - if generate_malicious_candidate == true { + gum::debug!( + target: MALUS, + "😈 Suggesting malicious candidate.", + ); + let pov = PoV { block_data: BlockData(MALICIOUS_POV.into()) }; let (sender, receiver) = std::sync::mpsc::channel(); @@ -221,9 +221,8 @@ where gum::info!( target: MALUS, candidate_hash = ?candidate.hash(), - ?malicious_candidate_hash, "😈 Intercepted CandidateBackingMessage::Second and created malicious candidate with hash: {:?}", - &candidate_hash + &malicious_candidate_hash ); Some(message) } else { @@ -277,11 +276,11 @@ impl OverseerGen for SuggestGarbageCandidateWrapper { spawner: SpawnGlue(args.spawner.clone()), percentage: f64::from(self.opts.percentage), }; - let validation_probability = 100.0; + let fake_valid_probability = 100.0; let validation_filter = ReplaceValidationResult::new( FakeCandidateValidation::BackingAndApprovalValid, FakeCandidateValidationError::InvalidOutputs, - validation_probability, + fake_valid_probability, SpawnGlue(args.spawner.clone()), ); From 9842ee9a11c52479645ba43fc2723a606432e0e8 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Tue, 11 Oct 2022 17:32:41 +0100 Subject: [PATCH 42/49] unit test related to gum formatting --- node/malus/src/variants/common.rs | 2 +- node/malus/src/variants/suggest_garbage_candidate.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/node/malus/src/variants/common.rs b/node/malus/src/variants/common.rs index 036173d700a9..c710c4418533 100644 --- a/node/malus/src/variants/common.rs +++ b/node/malus/src/variants/common.rs @@ -308,7 +308,7 @@ where gum::info!( target: MALUS, ?behave_maliciously, - "😈 Behaving normally and passing CandidateValidationMessage::ValidateFromExhaustive message.", + "😈 Passing CandidateValidationMessage::ValidateFromExhaustive to the candidate validation subsystem.", ); Some(FromOrchestra::Communication { diff --git a/node/malus/src/variants/suggest_garbage_candidate.rs b/node/malus/src/variants/suggest_garbage_candidate.rs index d57d678fbf1a..435354e954dc 100644 --- a/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/node/malus/src/variants/suggest_garbage_candidate.rs @@ -83,7 +83,7 @@ where } => { gum::info!( target: MALUS, - "😈 Started Malus node with a chance of {:?}% to behave maliciously for a given candidate.", + "😈 Started Malus node with a {:?} % chance to behave maliciously for a given candidate.", &self.percentage, ); From 56347c6f084673a8e791ed3d4626e4ca594163d1 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Tue, 11 Oct 2022 17:33:12 +0100 Subject: [PATCH 43/49] cargo +nightly fmt --all --- node/malus/src/variants/common.rs | 7 ++----- node/malus/src/variants/suggest_garbage_candidate.rs | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/node/malus/src/variants/common.rs b/node/malus/src/variants/common.rs index c710c4418533..996d9465d31a 100644 --- a/node/malus/src/variants/common.rs +++ b/node/malus/src/variants/common.rs @@ -290,7 +290,7 @@ where true => { let validation_result = ValidationResult::Invalid(InvalidCandidate::InvalidOutputs); - + gum::info!( target: MALUS, ?behave_maliciously, @@ -411,10 +411,7 @@ where }, // With some probability `(1-p)` we behave normally false => { - gum::info!( - target: MALUS, - "😈 'Decided' to not act maliciously.", - ); + gum::info!(target: MALUS, "😈 'Decided' to not act maliciously.",); Some(FromOrchestra::Communication { msg: CandidateValidationMessage::ValidateFromChainState( diff --git a/node/malus/src/variants/suggest_garbage_candidate.rs b/node/malus/src/variants/suggest_garbage_candidate.rs index 435354e954dc..d127cb2b5f06 100644 --- a/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/node/malus/src/variants/suggest_garbage_candidate.rs @@ -95,7 +95,7 @@ where ); // Need to draw value from Bernoulli distribution with given probability of success defined by the clap parameter. - // Note that clap parameter must be f64 since this is expected by the Bernoulli::new() function. + // Note that clap parameter must be f64 since this is expected by the Bernoulli::new() function. // It must be converted from u8, due to the lack of support for the .range() call on u64 in the clap crate. let distribution = Bernoulli::new(self.percentage / 100.0) .expect("Invalid probability! Percentage must be in range [0..=100]."); @@ -105,10 +105,7 @@ where let generate_malicious_candidate = distribution.sample(&mut rand::thread_rng()); if generate_malicious_candidate == true { - gum::debug!( - target: MALUS, - "😈 Suggesting malicious candidate.", - ); + gum::debug!(target: MALUS, "😈 Suggesting malicious candidate.",); let pov = PoV { block_data: BlockData(MALICIOUS_POV.into()) }; From 72591a9fe57e6c9d6ab8318ee9bce5d9293a175b Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Wed, 12 Oct 2022 10:18:24 +0100 Subject: [PATCH 44/49] Resolve merge conflicts --- node/malus/src/malus.rs | 51 ++++++++++++++----- .../src/variants/back_garbage_candidate.rs | 22 +++----- .../src/variants/dispute_valid_candidates.rs | 21 ++++---- node/malus/src/variants/mod.rs | 6 +-- .../src/variants/suggest_garbage_candidate.rs | 22 +++----- 5 files changed, 67 insertions(+), 55 deletions(-) diff --git a/node/malus/src/malus.rs b/node/malus/src/malus.rs index 0d3b9da5b69b..ef32ddc04402 100644 --- a/node/malus/src/malus.rs +++ b/node/malus/src/malus.rs @@ -62,21 +62,46 @@ impl MalusCli { fn launch(self) -> eyre::Result<()> { let finality_delay = self.finality_delay; match self.variant { - NemesisVariant::BackGarbageCandidate(opts) => polkadot_cli::run_node( - run_cmd(opts.clone().cmd), - BackGarbageCandidateWrapper::new(opts), + NemesisVariant::BackGarbageCandidate(opts) => { + let BackGarbageCandidateOptions { + percentage, + cli + } = opts; + + polkadot_cli::run_node( + cli, + BackGarbageCandidates { + percentage, + }, finality_delay, - )?, - NemesisVariant::SuggestGarbageCandidate(opts) => polkadot_cli::run_node( - run_cmd(opts.clone().cmd), - SuggestGarbageCandidateWrapper::new(opts), - finality_delay, - )?, - NemesisVariant::DisputeAncestor(opts) => polkadot_cli::run_node( - run_cmd(opts.clone().cmd), - DisputeValidCandidateWrapper::new(opts), + )? + }, + NemesisVariant::SuggestGarbageCandidate(opts) => { + let SuggestGarbageCandidateOptions { + percentage, + cli + } = opts; + + polkadot_cli::run_node( + cli, + SuggestGarbageCandidates { percentage }, finality_delay, - )?, + )? + }, + NemesisVariant::DisputeAncestor(opts) => { + let DisputeAncestorOptions { + fake_validation, + fake_validation_error, + percentage, + cli + } = opts; + + polkadot_cli::run_node( + cli, + DisputeValidCandidates { fake_validation, fake_validation_error, percentage }, + finality_delay, + )? + }, NemesisVariant::PvfPrepareWorker(cmd) => { #[cfg(target_os = "android")] { diff --git a/node/malus/src/variants/back_garbage_candidate.rs b/node/malus/src/variants/back_garbage_candidate.rs index 04d20d008288..b17b8bca5887 100644 --- a/node/malus/src/variants/back_garbage_candidate.rs +++ b/node/malus/src/variants/back_garbage_candidate.rs @@ -25,7 +25,7 @@ use polkadot_cli::{ OverseerConnector, OverseerGen, OverseerGenArgs, OverseerHandle, ParachainHost, ProvideRuntimeApi, }, - RunCmd, + Cli, }; use polkadot_node_subsystem::SpawnGlue; use sp_core::traits::SpawnNamed; @@ -37,7 +37,7 @@ use crate::{ use std::sync::Arc; -#[derive(Clone, Debug, clap::Parser)] +#[derive(Debug, clap::Parser)] #[clap(rename_all = "kebab-case")] #[allow(missing_docs)] pub struct BackGarbageCandidateOptions { @@ -47,23 +47,17 @@ pub struct BackGarbageCandidateOptions { pub percentage: u8, #[clap(flatten)] - pub cmd: RunCmd, + pub cli: Cli, } /// Generates an overseer that replaces the candidate validation subsystem with our malicious /// variant. -pub(crate) struct BackGarbageCandidateWrapper { - /// Options from CLI - opts: BackGarbageCandidateOptions, -} - -impl BackGarbageCandidateWrapper { - pub fn new(opts: BackGarbageCandidateOptions) -> Self { - Self { opts } - } +pub(crate) struct BackGarbageCandidates { + /// The probability of behaving maliciously. + pub percentage: u8, } -impl OverseerGen for BackGarbageCandidateWrapper { +impl OverseerGen for BackGarbageCandidates { fn generate<'a, Spawner, RuntimeClient>( &self, connector: OverseerConnector, @@ -78,7 +72,7 @@ impl OverseerGen for BackGarbageCandidateWrapper { let validation_filter = ReplaceValidationResult::new( FakeCandidateValidation::BackingAndApprovalValid, FakeCandidateValidationError::InvalidOutputs, - f64::from(self.opts.percentage), + f64::from(self.percentage), SpawnGlue(spawner), ); diff --git a/node/malus/src/variants/dispute_valid_candidates.rs b/node/malus/src/variants/dispute_valid_candidates.rs index 8d0c54cbd862..b85ee2cff4ec 100644 --- a/node/malus/src/variants/dispute_valid_candidates.rs +++ b/node/malus/src/variants/dispute_valid_candidates.rs @@ -64,18 +64,17 @@ pub struct DisputeAncestorOptions { pub cli: Cli, } -pub(crate) struct DisputeValidCandidateWrapper { +pub(crate) struct DisputeValidCandidates { /// Fake validation config (applies to disputes as well). - opts: DisputeAncestorOptions, + pub fake_validation: FakeCandidateValidation, + /// Fake validation error config. + pub fake_validation_error: FakeCandidateValidationError, + /// The probability of behaving maliciously. + pub percentage: u8, } -impl DisputeValidCandidateWrapper { - pub fn new(opts: DisputeAncestorOptions) -> Self { - Self { opts } - } -} -impl OverseerGen for DisputeValidCandidateWrapper { +impl OverseerGen for DisputeValidCandidates { fn generate<'a, Spawner, RuntimeClient>( &self, connector: OverseerConnector, @@ -88,9 +87,9 @@ impl OverseerGen for DisputeValidCandidateWrapper { { let spawner = args.spawner.clone(); let validation_filter = ReplaceValidationResult::new( - self.opts.fake_validation, - self.opts.fake_validation_error, - f64::from(self.opts.percentage), + self.fake_validation, + self.fake_validation_error, + f64::from(self.percentage), SpawnGlue(spawner.clone()), ); diff --git a/node/malus/src/variants/mod.rs b/node/malus/src/variants/mod.rs index 036ffc534a20..50e0454f2310 100644 --- a/node/malus/src/variants/mod.rs +++ b/node/malus/src/variants/mod.rs @@ -22,8 +22,8 @@ mod dispute_valid_candidates; mod suggest_garbage_candidate; pub(crate) use self::{ - back_garbage_candidate::{BackGarbageCandidateOptions, BackGarbageCandidateWrapper}, - dispute_valid_candidates::{DisputeAncestorOptions, DisputeValidCandidateWrapper}, - suggest_garbage_candidate::{SuggestGarbageCandidateOptions, SuggestGarbageCandidateWrapper}, + back_garbage_candidate::{BackGarbageCandidates, BackGarbageCandidateOptions}, + dispute_valid_candidates::{DisputeValidCandidates, DisputeAncestorOptions}, + suggest_garbage_candidate::{SuggestGarbageCandidates, SuggestGarbageCandidateOptions}, }; pub(crate) use common::*; diff --git a/node/malus/src/variants/suggest_garbage_candidate.rs b/node/malus/src/variants/suggest_garbage_candidate.rs index d127cb2b5f06..31e20955d771 100644 --- a/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/node/malus/src/variants/suggest_garbage_candidate.rs @@ -29,7 +29,7 @@ use polkadot_cli::{ OverseerConnector, OverseerGen, OverseerGenArgs, OverseerHandle, ParachainHost, ProvideRuntimeApi, }, - RunCmd, + Cli, }; use polkadot_node_core_candidate_validation::find_validation_data; use polkadot_node_primitives::{AvailableData, BlockData, PoV}; @@ -232,7 +232,7 @@ where } } -#[derive(Clone, Debug, clap::Parser)] +#[derive(Debug, clap::Parser)] #[clap(rename_all = "kebab-case")] #[allow(missing_docs)] pub struct SuggestGarbageCandidateOptions { @@ -243,22 +243,16 @@ pub struct SuggestGarbageCandidateOptions { pub percentage: u8, #[clap(flatten)] - pub cmd: RunCmd, + pub cli: Cli, } /// Garbage candidate implementation wrapper which implements `OverseerGen` glue. -pub(crate) struct SuggestGarbageCandidateWrapper { - /// Options from CLI. - opts: SuggestGarbageCandidateOptions, -} - -impl SuggestGarbageCandidateWrapper { - pub fn new(opts: SuggestGarbageCandidateOptions) -> Self { - Self { opts } - } +pub(crate) struct SuggestGarbageCandidates { + /// The probability of behaving maliciously. + pub percentage: u8, } -impl OverseerGen for SuggestGarbageCandidateWrapper { +impl OverseerGen for SuggestGarbageCandidates { fn generate<'a, Spawner, RuntimeClient>( &self, connector: OverseerConnector, @@ -271,7 +265,7 @@ impl OverseerGen for SuggestGarbageCandidateWrapper { { let note_candidate = NoteCandidate { spawner: SpawnGlue(args.spawner.clone()), - percentage: f64::from(self.opts.percentage), + percentage: f64::from(self.percentage), }; let fake_valid_probability = 100.0; let validation_filter = ReplaceValidationResult::new( From 23d94986e4fb86f7d11142a8bc66b09f060a254c Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Wed, 12 Oct 2022 10:29:31 +0100 Subject: [PATCH 45/49] cargo +nightly fmt --all --- node/malus/src/malus.rs | 32 ++++++------------- .../src/variants/dispute_valid_candidates.rs | 1 - node/malus/src/variants/mod.rs | 6 ++-- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/node/malus/src/malus.rs b/node/malus/src/malus.rs index ef32ddc04402..6e9fc703b0d9 100644 --- a/node/malus/src/malus.rs +++ b/node/malus/src/malus.rs @@ -62,38 +62,26 @@ impl MalusCli { fn launch(self) -> eyre::Result<()> { let finality_delay = self.finality_delay; match self.variant { - NemesisVariant::BackGarbageCandidate(opts) => { - let BackGarbageCandidateOptions { - percentage, - cli - } = opts; + NemesisVariant::BackGarbageCandidate(opts) => { + let BackGarbageCandidateOptions { percentage, cli } = opts; - polkadot_cli::run_node( - cli, - BackGarbageCandidates { - percentage, - }, - finality_delay, - )? + polkadot_cli::run_node(cli, BackGarbageCandidates { percentage }, finality_delay)? }, NemesisVariant::SuggestGarbageCandidate(opts) => { - let SuggestGarbageCandidateOptions { - percentage, - cli - } = opts; - + let SuggestGarbageCandidateOptions { percentage, cli } = opts; + polkadot_cli::run_node( - cli, - SuggestGarbageCandidates { percentage }, - finality_delay, + cli, + SuggestGarbageCandidates { percentage }, + finality_delay, )? }, NemesisVariant::DisputeAncestor(opts) => { - let DisputeAncestorOptions { + let DisputeAncestorOptions { fake_validation, fake_validation_error, percentage, - cli + cli, } = opts; polkadot_cli::run_node( diff --git a/node/malus/src/variants/dispute_valid_candidates.rs b/node/malus/src/variants/dispute_valid_candidates.rs index b85ee2cff4ec..c8e6afe643c5 100644 --- a/node/malus/src/variants/dispute_valid_candidates.rs +++ b/node/malus/src/variants/dispute_valid_candidates.rs @@ -73,7 +73,6 @@ pub(crate) struct DisputeValidCandidates { pub percentage: u8, } - impl OverseerGen for DisputeValidCandidates { fn generate<'a, Spawner, RuntimeClient>( &self, diff --git a/node/malus/src/variants/mod.rs b/node/malus/src/variants/mod.rs index 50e0454f2310..6f9a9359e025 100644 --- a/node/malus/src/variants/mod.rs +++ b/node/malus/src/variants/mod.rs @@ -22,8 +22,8 @@ mod dispute_valid_candidates; mod suggest_garbage_candidate; pub(crate) use self::{ - back_garbage_candidate::{BackGarbageCandidates, BackGarbageCandidateOptions}, - dispute_valid_candidates::{DisputeValidCandidates, DisputeAncestorOptions}, - suggest_garbage_candidate::{SuggestGarbageCandidates, SuggestGarbageCandidateOptions}, + back_garbage_candidate::{BackGarbageCandidateOptions, BackGarbageCandidates}, + dispute_valid_candidates::{DisputeAncestorOptions, DisputeValidCandidates}, + suggest_garbage_candidate::{SuggestGarbageCandidateOptions, SuggestGarbageCandidates}, }; pub(crate) use common::*; From be1f5a929c77bcee025194d6bcacb767d864705d Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Wed, 12 Oct 2022 10:51:56 +0100 Subject: [PATCH 46/49] Fix tests so they use cli rather than cmd --- node/malus/src/malus.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/node/malus/src/malus.rs b/node/malus/src/malus.rs index 6e9fc703b0d9..a3d6fd004b44 100644 --- a/node/malus/src/malus.rs +++ b/node/malus/src/malus.rs @@ -159,7 +159,7 @@ mod tests { variant: NemesisVariant::SuggestGarbageCandidate(run), .. } => { - assert!(run.cmd.base.bob); + assert!(run.cli.run.base.bob); }); } @@ -177,7 +177,7 @@ mod tests { variant: NemesisVariant::DisputeAncestor(run), .. } => { - assert!(run.cmd.base.bob); + assert!(run.cli.run.base.bob); }); } @@ -195,7 +195,7 @@ mod tests { variant: NemesisVariant::BackGarbageCandidate(run), .. } => { - assert!(run.cmd.base.bob); + assert!(run.cli.run.base.bob); }); } @@ -214,7 +214,7 @@ mod tests { variant: NemesisVariant::DisputeAncestor(run), .. } => { - assert!(run.cmd.base.bob); + assert!(run.cli.run.base.bob); }); } } From cdc68c4da55b9894029bd1be3748e3dca151840f Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:38:45 +0100 Subject: [PATCH 47/49] CI unused import check fix --- node/malus/src/malus.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/node/malus/src/malus.rs b/node/malus/src/malus.rs index a3d6fd004b44..13e232198ea6 100644 --- a/node/malus/src/malus.rs +++ b/node/malus/src/malus.rs @@ -18,7 +18,6 @@ use clap::Parser; use color_eyre::eyre; -use polkadot_cli::Cli; pub(crate) mod interceptor; pub(crate) mod shared; From dd96c47c95bf58ba0b51ddee9535393e8a6a28f5 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:39:07 +0100 Subject: [PATCH 48/49] Move info! log to startup --- node/malus/src/variants/suggest_garbage_candidate.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/node/malus/src/variants/suggest_garbage_candidate.rs b/node/malus/src/variants/suggest_garbage_candidate.rs index 31e20955d771..86b0c49e7125 100644 --- a/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/node/malus/src/variants/suggest_garbage_candidate.rs @@ -81,12 +81,6 @@ where FromOrchestra::Communication { msg: CandidateBackingMessage::Second(relay_parent, ref candidate, ref _pov), } => { - gum::info!( - target: MALUS, - "😈 Started Malus node with a {:?} % chance to behave maliciously for a given candidate.", - &self.percentage, - ); - gum::debug!( target: MALUS, candidate_hash = ?candidate.hash(), @@ -263,6 +257,12 @@ impl OverseerGen for SuggestGarbageCandidates { RuntimeClient::Api: ParachainHost + BabeApi + AuthorityDiscoveryApi, Spawner: 'static + SpawnNamed + Clone + Unpin, { + gum::info!( + target: MALUS, + "😈 Started Malus node with a {:?} percent chance of behaving maliciously for a given candidate.", + &self.percentage, + ); + let note_candidate = NoteCandidate { spawner: SpawnGlue(args.spawner.clone()), percentage: f64::from(self.percentage), From 5c20d8c09d2380bf1d5d4a3c263842802e957647 Mon Sep 17 00:00:00 2001 From: Mattia Bradascio <28816406+bredamatt@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:49:03 +0100 Subject: [PATCH 49/49] make info log more comprehensible --- node/malus/src/variants/common.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/node/malus/src/variants/common.rs b/node/malus/src/variants/common.rs index 996d9465d31a..845dac0b6fea 100644 --- a/node/malus/src/variants/common.rs +++ b/node/malus/src/variants/common.rs @@ -305,11 +305,7 @@ where }, false => { // Behave normally with probability `(1-p)` - gum::info!( - target: MALUS, - ?behave_maliciously, - "😈 Passing CandidateValidationMessage::ValidateFromExhaustive to the candidate validation subsystem.", - ); + gum::info!(target: MALUS, "😈 'Decided' to not act maliciously.",); Some(FromOrchestra::Communication { msg: CandidateValidationMessage::ValidateFromExhaustive(