Fix bench bot (#2900)

* Fix bench bot

* cargo run --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=pallet_membership --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/

* Fix weights files

* Fix'

* cargo run --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_membership --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/

Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
This commit is contained in:
Kian Paimani
2021-04-21 03:38:19 +02:00
committed by GitHub
parent 9de727bb17
commit 47889d845c
9 changed files with 135 additions and 43 deletions
+19 -17
View File
@@ -142,7 +142,11 @@ const DEV_ONLY_ERROR_PATTERN: &'static str =
"can only use subcommand with --chain [polkadot-dev, kusama-dev, westend-dev], got "; "can only use subcommand with --chain [polkadot-dev, kusama-dev, westend-dev], got ";
fn ensure_dev(spec: &Box<dyn service::ChainSpec>) -> std::result::Result<(), String> { fn ensure_dev(spec: &Box<dyn service::ChainSpec>) -> std::result::Result<(), String> {
if spec.is_dev() { Ok(()) } else { Err(format!("{}{}", DEV_ONLY_ERROR_PATTERN, spec.id())) } if spec.is_dev() {
Ok(())
} else {
Err(format!("{}{}", DEV_ONLY_ERROR_PATTERN, spec.id()))
}
} }
/// Parses polkadot specific CLI arguments and run the service. /// Parses polkadot specific CLI arguments and run the service.
@@ -298,12 +302,7 @@ pub fn run() -> Result<()> {
set_default_ss58_version(chain_spec); set_default_ss58_version(chain_spec);
ensure_dev(chain_spec).map_err(Error::Other)?; ensure_dev(chain_spec).map_err(Error::Other)?;
if chain_spec.is_polkadot() { if chain_spec.is_kusama() {
Ok(runner.sync_run(|config| {
cmd.run::<service::polkadot_runtime::Block, service::PolkadotExecutor>(config)
.map_err(|e| Error::SubstrateCli(e))
})?)
} else if chain_spec.is_kusama() {
Ok(runner.sync_run(|config| { Ok(runner.sync_run(|config| {
cmd.run::<service::kusama_runtime::Block, service::KusamaExecutor>(config) cmd.run::<service::kusama_runtime::Block, service::KusamaExecutor>(config)
.map_err(|e| Error::SubstrateCli(e)) .map_err(|e| Error::SubstrateCli(e))
@@ -314,7 +313,11 @@ pub fn run() -> Result<()> {
.map_err(|e| Error::SubstrateCli(e)) .map_err(|e| Error::SubstrateCli(e))
})?) })?)
} else { } else {
Err(format!("{}{}", DEV_ONLY_ERROR_PATTERN, chain_spec.id()).into()) // else we assume it is polkadot.
Ok(runner.sync_run(|config| {
cmd.run::<service::polkadot_runtime::Block, service::PolkadotExecutor>(config)
.map_err(|e| Error::SubstrateCli(e))
})?)
} }
}, },
Some(Subcommand::Key(cmd)) => Ok(cmd.run(&cli)?), Some(Subcommand::Key(cmd)) => Ok(cmd.run(&cli)?),
@@ -332,14 +335,7 @@ pub fn run() -> Result<()> {
).map_err(|e| Error::SubstrateService(sc_service::Error::Prometheus(e)))?; ).map_err(|e| Error::SubstrateService(sc_service::Error::Prometheus(e)))?;
ensure_dev(chain_spec).map_err(Error::Other)?; ensure_dev(chain_spec).map_err(Error::Other)?;
if chain_spec.is_polkadot() { if chain_spec.is_kusama() {
runner.async_run(|config| {
Ok((cmd.run::<
service::polkadot_runtime::Block,
service::PolkadotExecutor,
>(config).map_err(Error::SubstrateCli), task_manager))
})
} else if chain_spec.is_kusama() {
runner.async_run(|config| { runner.async_run(|config| {
Ok((cmd.run::< Ok((cmd.run::<
service::kusama_runtime::Block, service::kusama_runtime::Block,
@@ -354,7 +350,13 @@ pub fn run() -> Result<()> {
>(config).map_err(Error::SubstrateCli), task_manager)) >(config).map_err(Error::SubstrateCli), task_manager))
}) })
} else { } else {
Err(format!("{}{}", DEV_ONLY_ERROR_PATTERN, chain_spec.id()).into()) // else we assume it is polkadot.
runner.async_run(|config| {
Ok((cmd.run::<
service::polkadot_runtime::Block,
service::PolkadotExecutor,
>(config).map_err(Error::SubstrateCli), task_manager))
})
} }
} }
}?; }?;
-6
View File
@@ -162,9 +162,6 @@ pub trait IdentifyVariant {
/// Returns if this is a configuration for the `Rococo` network. /// Returns if this is a configuration for the `Rococo` network.
fn is_rococo(&self) -> bool; fn is_rococo(&self) -> bool;
/// Returns if this is a configuration for the `Polkadot` network.
fn is_polkadot(&self) -> bool;
/// Returns true if this configuration is for a development network. /// Returns true if this configuration is for a development network.
fn is_dev(&self) -> bool; fn is_dev(&self) -> bool;
} }
@@ -179,9 +176,6 @@ impl IdentifyVariant for Box<dyn ChainSpec> {
fn is_rococo(&self) -> bool { fn is_rococo(&self) -> bool {
self.id().starts_with("rococo") || self.id().starts_with("rco") self.id().starts_with("rococo") || self.id().starts_with("rco")
} }
fn is_polkadot(&self) -> bool {
self.id().starts_with("polkadot") || self.id().starts_with("dot")
}
fn is_dev(&self) -> bool { fn is_dev(&self) -> bool {
self.id().ends_with("dev") self.id().ends_with("dev")
} }
+1 -1
View File
@@ -548,7 +548,7 @@ impl pallet_membership::Config<pallet_membership::Instance1> for Runtime {
type MembershipInitialized = TechnicalCommittee; type MembershipInitialized = TechnicalCommittee;
type MembershipChanged = TechnicalCommittee; type MembershipChanged = TechnicalCommittee;
type MaxMembers = TechnicalMaxMembers; type MaxMembers = TechnicalMaxMembers;
type WeightInfo = (); type WeightInfo = weights::pallet_membership::WeightInfo<Runtime>;
} }
parameter_types! { parameter_types! {
@@ -25,6 +25,7 @@ pub mod pallet_election_provider_multi_phase;
pub mod pallet_identity; pub mod pallet_identity;
pub mod pallet_im_online; pub mod pallet_im_online;
pub mod pallet_indices; pub mod pallet_indices;
pub mod pallet_membership;
pub mod pallet_multisig; pub mod pallet_multisig;
pub mod pallet_proxy; pub mod pallet_proxy;
pub mod pallet_scheduler; pub mod pallet_scheduler;
@@ -16,7 +16,7 @@
//! Autogenerated weights for pallet_membership //! Autogenerated weights for pallet_membership
//! //!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0 //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-04-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` //! DATE: 2021-04-21, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128 //! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128
// Executed Command: // Executed Command:
@@ -44,49 +44,51 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>); pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_membership::WeightInfo for WeightInfo<T> { impl<T: frame_system::Config> pallet_membership::WeightInfo for WeightInfo<T> {
fn add_member(m: u32, ) -> Weight { fn add_member(m: u32, ) -> Weight {
(24_568_000 as Weight) (23_269_000 as Weight)
// Standard Error: 3_000 // Standard Error: 3_000
.saturating_add((242_000 as Weight).saturating_mul(m as Weight)) .saturating_add((250_000 as Weight).saturating_mul(m as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight)) .saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight))
} }
fn remove_member(m: u32, ) -> Weight { fn remove_member(m: u32, ) -> Weight {
(29_822_000 as Weight) (28_329_000 as Weight)
// Standard Error: 0 // Standard Error: 0
.saturating_add((195_000 as Weight).saturating_mul(m as Weight)) .saturating_add((204_000 as Weight).saturating_mul(m as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight))
} }
fn swap_member(m: u32, ) -> Weight { fn swap_member(m: u32, ) -> Weight {
(29_885_000 as Weight) (28_550_000 as Weight)
// Standard Error: 0 // Standard Error: 0
.saturating_add((214_000 as Weight).saturating_mul(m as Weight)) .saturating_add((219_000 as Weight).saturating_mul(m as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight))
} }
fn reset_member(m: u32, ) -> Weight { fn reset_member(m: u32, ) -> Weight {
(30_347_000 as Weight) (29_358_000 as Weight)
// Standard Error: 1_000 // Standard Error: 3_000
.saturating_add((440_000 as Weight).saturating_mul(m as Weight)) .saturating_add((442_000 as Weight).saturating_mul(m as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight)) .saturating_add(T::DbWeight::get().writes(3 as Weight))
} }
fn change_key(m: u32, ) -> Weight { fn change_key(m: u32, ) -> Weight {
(31_762_000 as Weight) (30_386_000 as Weight)
// Standard Error: 0 // Standard Error: 0
.saturating_add((208_000 as Weight).saturating_mul(m as Weight)) .saturating_add((212_000 as Weight).saturating_mul(m as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight)) .saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight)) .saturating_add(T::DbWeight::get().writes(4 as Weight))
} }
fn set_prime(m: u32, ) -> Weight { fn set_prime(m: u32, ) -> Weight {
(7_818_000 as Weight) (7_366_000 as Weight)
// Standard Error: 0 // Standard Error: 0
.saturating_add((114_000 as Weight).saturating_mul(m as Weight)) .saturating_add((115_000 as Weight).saturating_mul(m as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight)) .saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight))
} }
fn clear_prime(_m: u32, ) -> Weight { fn clear_prime(m: u32, ) -> Weight {
(2_946_000 as Weight) (2_778_000 as Weight)
// Standard Error: 0
.saturating_add((1_000 as Weight).saturating_mul(m as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight)) .saturating_add(T::DbWeight::get().writes(2 as Weight))
} }
} }
+1 -1
View File
@@ -595,7 +595,7 @@ impl pallet_membership::Config<pallet_membership::Instance1> for Runtime {
type MembershipInitialized = TechnicalCommittee; type MembershipInitialized = TechnicalCommittee;
type MembershipChanged = TechnicalCommittee; type MembershipChanged = TechnicalCommittee;
type MaxMembers = TechnicalMaxMembers; type MaxMembers = TechnicalMaxMembers;
type WeightInfo = (); type WeightInfo = weights::pallet_membership::WeightInfo<Runtime>;
} }
parameter_types! { parameter_types! {
@@ -24,6 +24,7 @@ pub mod pallet_election_provider_multi_phase;
pub mod pallet_identity; pub mod pallet_identity;
pub mod pallet_im_online; pub mod pallet_im_online;
pub mod pallet_indices; pub mod pallet_indices;
pub mod pallet_membership;
pub mod pallet_multisig; pub mod pallet_multisig;
pub mod pallet_proxy; pub mod pallet_proxy;
pub mod pallet_scheduler; pub mod pallet_scheduler;
@@ -0,0 +1,92 @@
// Copyright 2017-2020 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Polkadot is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
//! Autogenerated weights for pallet_membership
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
//! DATE: 2021-04-19, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 128
// Executed Command:
// target/release/polkadot
// benchmark
// --chain=polkadot-dev
// --steps=50
// --repeat=20
// --pallet=pallet_membership
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --header=./file_header.txt
// --output=./runtime/polkadot/src/weights/
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weight functions for pallet_membership.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_membership::WeightInfo for WeightInfo<T> {
fn add_member(m: u32, ) -> Weight {
(24_063_000 as Weight)
// Standard Error: 3_000
.saturating_add((243_000 as Weight).saturating_mul(m as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn remove_member(m: u32, ) -> Weight {
(29_176_000 as Weight)
// Standard Error: 0
.saturating_add((201_000 as Weight).saturating_mul(m as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn swap_member(m: u32, ) -> Weight {
(29_528_000 as Weight)
// Standard Error: 0
.saturating_add((216_000 as Weight).saturating_mul(m as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn reset_member(m: u32, ) -> Weight {
(29_847_000 as Weight)
// Standard Error: 0
.saturating_add((439_000 as Weight).saturating_mul(m as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
fn change_key(m: u32, ) -> Weight {
(31_408_000 as Weight)
// Standard Error: 0
.saturating_add((209_000 as Weight).saturating_mul(m as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
fn set_prime(m: u32, ) -> Weight {
(7_753_000 as Weight)
// Standard Error: 0
.saturating_add((114_000 as Weight).saturating_mul(m as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
fn clear_prime(_m: u32, ) -> Weight {
(2_878_000 as Weight)
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
}
+2 -2
View File
@@ -60,10 +60,10 @@ pub enum Error {
/// of the message is invalid, which could be due to it containing overly nested structures or an invalid /// of the message is invalid, which could be due to it containing overly nested structures or an invalid
/// nested data segment (e.g. for the call in `Transact`). /// nested data segment (e.g. for the call in `Transact`).
WeightNotComputable, WeightNotComputable,
/// The XCM did noto pass the barrier condition for execution. The barrier condition differs on different /// The XCM did not pass the barrier condition for execution. The barrier condition differs on different
/// chains and in different circumstances, but generally it means that the conditions surrounding the message /// chains and in different circumstances, but generally it means that the conditions surrounding the message
/// were not such that the chain considers the message worth spending time executing. Since most chains /// were not such that the chain considers the message worth spending time executing. Since most chains
/// lift the barrier to execution on apropriate payment, presentation of an NFT voucher, or based on the /// lift the barrier to execution on appropriate payment, presentation of an NFT voucher, or based on the
/// message origin, it means that none of those were the case. /// message origin, it means that none of those were the case.
Barrier, Barrier,
/// Indicates that it is not possible for a location to have an asset be withdrawn or transferred from its /// Indicates that it is not possible for a location to have an asset be withdrawn or transferred from its