Unverified Commit 31f4d087 authored by Kian Paimani's avatar Kian Paimani Committed by GitHub
Browse files

Companion for substrate/pull/8596 (#2895)



* Add weight types

* Add missing types

* update Substrate

* Fix build

* Fix bench build

* 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-processbot <>
Co-authored-by: default avatarParity Benchmarking Bot <admin@parity.io>
parent fff63cb5
Pipeline #134975 failed with stages
in 18 minutes and 52 seconds
This diff is collapsed.
......@@ -176,6 +176,7 @@ runtime-benchmarks = [
"pallet-identity/runtime-benchmarks",
"pallet-im-online/runtime-benchmarks",
"pallet-indices/runtime-benchmarks",
"pallet-membership/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
"pallet-scheduler/runtime-benchmarks",
......
......@@ -547,6 +547,8 @@ impl pallet_membership::Config<pallet_membership::Instance1> for Runtime {
type PrimeOrigin = MoreThanHalfCouncil;
type MembershipInitialized = TechnicalCommittee;
type MembershipChanged = TechnicalCommittee;
type MaxMembers = TechnicalMaxMembers;
type WeightInfo = ();
}
parameter_types! {
......@@ -1407,6 +1409,7 @@ sp_api::impl_runtime_apis! {
add_benchmark!(params, batches, pallet_identity, Identity);
add_benchmark!(params, batches, pallet_im_online, ImOnline);
add_benchmark!(params, batches, pallet_indices, Indices);
add_benchmark!(params, batches, pallet_membership, TechnicalMembership);
add_benchmark!(params, batches, pallet_multisig, Multisig);
add_benchmark!(params, batches, pallet_offences, OffencesBench::<Runtime>);
add_benchmark!(params, batches, pallet_proxy, Proxy);
......
// 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-18, STEPS: `[50, ]`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 128
// Executed Command:
// target/release/polkadot
// 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/
#![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_568_000 as Weight)
// Standard Error: 3_000
.saturating_add((242_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_822_000 as Weight)
// Standard Error: 0
.saturating_add((195_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_885_000 as Weight)
// Standard Error: 0
.saturating_add((214_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 {
(30_347_000 as Weight)
// Standard Error: 1_000
.saturating_add((440_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_762_000 as Weight)
// Standard Error: 0
.saturating_add((208_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_818_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_946_000 as Weight)
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
}
......@@ -257,7 +257,7 @@ impl<T: Config> ProvideInherent for Module<T> {
Some(Call::enter(inherent_data))
}
fn is_inherent(call: &Self::Call) -> bool {
matches!(call, Call::enter(..))
}
......
......@@ -244,8 +244,8 @@ pub fn relevant_authority_ids<T: initializer::Config + pallet_authority_discover
// Due to `max_validators`, the `SessionInfo` stores only the validators who are actively
// selected to participate in parachain consensus. We'd like all authorities for the current
// and next sessions to be used in authority-discovery. The two sets likely have large overlap.
let mut authority_ids = <pallet_authority_discovery::Module<T>>::current_authorities();
authority_ids.extend(<pallet_authority_discovery::Module<T>>::next_authorities());
let mut authority_ids = <pallet_authority_discovery::Pallet<T>>::current_authorities();
authority_ids.extend(<pallet_authority_discovery::Pallet<T>>::next_authorities());
// Due to disputes, we'd like to remain connected to authorities of the previous few sessions.
// For this, we don't need anyone other than the validators actively participating in consensus.
......
......@@ -73,7 +73,7 @@ pub trait AuthorityDiscoveryConfig {
impl<T: pallet_authority_discovery::Config> AuthorityDiscoveryConfig for T {
fn authorities() -> Vec<AuthorityDiscoveryId> {
<pallet_authority_discovery::Module<T>>::current_authorities()
<pallet_authority_discovery::Pallet<T>>::current_authorities()
}
}
......
......@@ -171,6 +171,7 @@ runtime-benchmarks = [
"pallet-identity/runtime-benchmarks",
"pallet-im-online/runtime-benchmarks",
"pallet-indices/runtime-benchmarks",
"pallet-membership/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
"pallet-scheduler/runtime-benchmarks",
......
......@@ -594,6 +594,8 @@ impl pallet_membership::Config<pallet_membership::Instance1> for Runtime {
type PrimeOrigin = MoreThanHalfCouncil;
type MembershipInitialized = TechnicalCommittee;
type MembershipChanged = TechnicalCommittee;
type MaxMembers = TechnicalMaxMembers;
type WeightInfo = ();
}
parameter_types! {
......@@ -1400,6 +1402,7 @@ sp_api::impl_runtime_apis! {
add_benchmark!(params, batches, pallet_identity, Identity);
add_benchmark!(params, batches, pallet_im_online, ImOnline);
add_benchmark!(params, batches, pallet_indices, Indices);
add_benchmark!(params, batches, pallet_membership, TechnicalMembership);
add_benchmark!(params, batches, pallet_multisig, Multisig);
add_benchmark!(params, batches, pallet_offences, OffencesBench::<Runtime>);
add_benchmark!(params, batches, pallet_proxy, Proxy);
......
......@@ -883,6 +883,8 @@ impl pallet_membership::Config for Runtime {
type PrimeOrigin = EnsureRoot<AccountId>;
type MembershipInitialized = Collective;
type MembershipChanged = Collective;
type MaxMembers = MaxMembers;
type WeightInfo = ();
}
#[cfg(not(feature = "disable-runtime-api"))]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment