Companion for Adding benchmarking for new frame_election_provider_support #11149 (#5241)

* `GenesisElectionOf` after changes to substrate

* Benchmarking for `frame_election_provider_support`

* Introducing `OnChainSeqPhragmen` after changes
to substrate.
Pallet renaming in substrate

* Fixing `test-runtime`

* Use `UnboundedExecution` after change to substrate

* update lockfile for {"substrate"}

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

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

* cargo run --quiet --profile=production  --features=runtime-benchmarks -- benchmark pallet --chain=westend-dev --steps=50 --repeat=20 --pallet=frame_election_provider_support --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/

Co-authored-by: parity-processbot <>
Co-authored-by: Parity Bot <admin@parity.io>
This commit is contained in:
Georges
2022-04-15 16:17:38 +01:00
committed by GitHub
parent e3326d26b3
commit a74c527d32
15 changed files with 435 additions and 211 deletions
+181 -165
View File
File diff suppressed because it is too large Load Diff
+1 -22
View File
@@ -16,12 +16,6 @@
//! Code for elections.
use frame_election_provider_support::{
onchain::{ExecutionConfig, UnboundedExecution},
ElectionDataProvider, SequentialPhragmen,
};
use sp_std::marker::PhantomData;
/// Implements the weight types for the elections module and a specific
/// runtime.
/// This macro should not be called directly; use [`impl_runtime_weights`] instead.
@@ -65,19 +59,4 @@ impl pallet_election_provider_multi_phase::BenchmarkingConfig for BenchmarkConfi
}
/// The accuracy type used for genesis election provider;
pub type OnOnChainAccuracy = sp_runtime::Perbill;
/// Election Configuration parameters
pub struct OnChainSeqPhragmen<T: frame_system::Config, S>(PhantomData<(T, S)>);
impl<
T: frame_system::Config,
S: ElectionDataProvider<AccountId = T::AccountId, BlockNumber = T::BlockNumber>,
> ExecutionConfig for OnChainSeqPhragmen<T, S>
{
type System = T;
type Solver = SequentialPhragmen<T::AccountId, OnOnChainAccuracy>;
type DataProvider = S;
}
/// The election provider of the genesis
pub type GenesisElectionOf<T, S> = UnboundedExecution<OnChainSeqPhragmen<T, S>>;
pub type OnChainAccuracy = sp_runtime::Perbill;
+2
View File
@@ -84,6 +84,7 @@ frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch =
pallet-offences-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
pallet-session-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
pallet-election-provider-support-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
hex-literal = { version = "0.3.4", optional = true }
runtime-common = { package = "polkadot-runtime-common", path = "../common", default-features = false }
@@ -198,6 +199,7 @@ runtime-benchmarks = [
"pallet-democracy/runtime-benchmarks",
"pallet-elections-phragmen/runtime-benchmarks",
"pallet-election-provider-multi-phase/runtime-benchmarks",
"pallet-election-provider-support-benchmarking/runtime-benchmarks",
"pallet-gilt/runtime-benchmarks",
"pallet-grandpa/runtime-benchmarks",
"pallet-identity/runtime-benchmarks",
+17 -6
View File
@@ -30,9 +30,8 @@ use primitives::v2::{
ValidationCodeHash, ValidatorId, ValidatorIndex,
};
use runtime_common::{
auctions, claims, crowdloan, elections::OnChainSeqPhragmen, impl_runtime_weights,
impls::DealWithFees, paras_registrar, prod_or_fast, slots, BlockHashCount, BlockLength,
CurrencyToVote, SlowAdjustingFeeUpdate,
auctions, claims, crowdloan, impl_runtime_weights, impls::DealWithFees, paras_registrar,
prod_or_fast, slots, BlockHashCount, BlockLength, CurrencyToVote, SlowAdjustingFeeUpdate,
};
use sp_std::{cmp::Ordering, collections::btree_map::BTreeMap, prelude::*};
@@ -48,7 +47,7 @@ use runtime_parachains::{
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
use beefy_primitives::crypto::AuthorityId as BeefyId;
use frame_election_provider_support::{
generate_solution_type, onchain::UnboundedExecution, NposSolution, SequentialPhragmen,
generate_solution_type, onchain, NposSolution, SequentialPhragmen,
};
use frame_support::{
construct_runtime, parameter_types,
@@ -430,6 +429,14 @@ generate_solution_type!(
>(24)
);
pub struct OnChainSeqPhragmen;
impl onchain::Config for OnChainSeqPhragmen {
type System = Runtime;
type Solver = SequentialPhragmen<AccountId, runtime_common::elections::OnChainAccuracy>;
type DataProvider = Staking;
type WeightInfo = weights::frame_election_provider_support::WeightInfo<Runtime>;
}
impl pallet_election_provider_multi_phase::Config for Runtime {
type Event = Event;
type Currency = Balances;
@@ -452,7 +459,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type DataProvider = Staking;
type Solution = NposCompactSolution24;
type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>;
type GovernanceFallback = UnboundedExecution<OnChainSeqPhragmen<Self, Staking>>;
type GovernanceFallback = onchain::UnboundedExecution<OnChainSeqPhragmen>;
type Solver = SequentialPhragmen<
AccountId,
pallet_election_provider_multi_phase::SolutionAccuracyOf<Self>,
@@ -566,7 +573,7 @@ impl pallet_staking::Config for Runtime {
type UnixTime = Timestamp;
type CurrencyToVote = CurrencyToVote;
type ElectionProvider = ElectionProviderMultiPhase;
type GenesisElectionProvider = runtime_common::elections::GenesisElectionOf<Self, Staking>;
type GenesisElectionProvider = onchain::UnboundedExecution<OnChainSeqPhragmen>;
type RewardRemainder = Treasury;
type Event = Event;
type Slash = Treasury;
@@ -1582,6 +1589,7 @@ mod benches {
[pallet_democracy, Democracy]
[pallet_elections_phragmen, PhragmenElection]
[pallet_election_provider_multi_phase, ElectionProviderMultiPhase]
[frame_election_provider_support, ElectionProviderBench::<Runtime>]
[pallet_gilt, Gilt]
[pallet_identity, Identity]
[pallet_im_online, ImOnline]
@@ -1954,6 +1962,7 @@ sp_api::impl_runtime_apis! {
use pallet_session_benchmarking::Pallet as SessionBench;
use pallet_offences_benchmarking::Pallet as OffencesBench;
use pallet_election_provider_support_benchmarking::Pallet as ElectionProviderBench;
use frame_system_benchmarking::Pallet as SystemBench;
use frame_benchmarking::baseline::Pallet as Baseline;
@@ -1975,6 +1984,7 @@ sp_api::impl_runtime_apis! {
// To get around that, we separated the benchmarks into its own crate.
use pallet_session_benchmarking::Pallet as SessionBench;
use pallet_offences_benchmarking::Pallet as OffencesBench;
use pallet_election_provider_support_benchmarking::Pallet as ElectionProviderBench;
use frame_system_benchmarking::Pallet as SystemBench;
use frame_benchmarking::baseline::Pallet as Baseline;
use xcm::latest::prelude::*;
@@ -1982,6 +1992,7 @@ sp_api::impl_runtime_apis! {
impl pallet_session_benchmarking::Config for Runtime {}
impl pallet_offences_benchmarking::Config for Runtime {}
impl pallet_election_provider_support_benchmarking::Config for Runtime {}
impl frame_system_benchmarking::Config for Runtime {}
impl frame_benchmarking::baseline::Config for Runtime {}
@@ -0,0 +1,61 @@
// 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 <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `frame_election_provider_support`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-04-15, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("kusama-dev"), DB CACHE: 1024
// Executed Command:
// target/production/polkadot
// benchmark
// pallet
// --chain=kusama-dev
// --steps=50
// --repeat=20
// --pallet=frame_election_provider_support
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --header=./file_header.txt
// --output=./runtime/kusama/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weight functions for `frame_election_provider_support`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> frame_election_provider_support::WeightInfo for WeightInfo<T> {
fn phragmen(v: u32, _t: u32, d: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 51_000
.saturating_add((18_247_000 as Weight).saturating_mul(v as Weight))
// Standard Error: 7_075_000
.saturating_add((2_979_831_000 as Weight).saturating_mul(d as Weight))
}
fn phragmms(v: u32, _t: u32, d: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 49_000
.saturating_add((16_045_000 as Weight).saturating_mul(v as Weight))
// Standard Error: 6_844_000
.saturating_add((2_712_807_000 as Weight).saturating_mul(d as Weight))
}
}
@@ -15,6 +15,7 @@
//! A list of the different weight modules for our runtime.
pub mod frame_election_provider_support;
pub mod frame_system;
pub mod pallet_bags_list;
pub mod pallet_balances;
+2
View File
@@ -77,6 +77,7 @@ pallet-xcm = { path = "../../xcm/pallet-xcm", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
pallet-election-provider-support-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
pallet-offences-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
pallet-session-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
hex-literal = { version = "0.3.4", optional = true }
@@ -187,6 +188,7 @@ runtime-benchmarks = [
"pallet-democracy/runtime-benchmarks",
"pallet-elections-phragmen/runtime-benchmarks",
"pallet-election-provider-multi-phase/runtime-benchmarks",
"pallet-election-provider-support-benchmarking/runtime-benchmarks",
"pallet-grandpa/runtime-benchmarks",
"pallet-identity/runtime-benchmarks",
"pallet-im-online/runtime-benchmarks",
+17 -8
View File
@@ -22,9 +22,8 @@
use pallet_transaction_payment::CurrencyAdapter;
use runtime_common::{
auctions, claims, crowdloan, elections::OnChainSeqPhragmen, impl_runtime_weights,
impls::DealWithFees, paras_registrar, prod_or_fast, slots, BlockHashCount, BlockLength,
CurrencyToVote, SlowAdjustingFeeUpdate,
auctions, claims, crowdloan, impl_runtime_weights, impls::DealWithFees, paras_registrar,
prod_or_fast, slots, BlockHashCount, BlockLength, CurrencyToVote, SlowAdjustingFeeUpdate,
};
use runtime_parachains::{
@@ -38,9 +37,7 @@ use runtime_parachains::{
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
use beefy_primitives::crypto::AuthorityId as BeefyId;
use frame_election_provider_support::{
generate_solution_type, onchain::UnboundedExecution, SequentialPhragmen,
};
use frame_election_provider_support::{generate_solution_type, onchain, SequentialPhragmen};
use frame_support::{
construct_runtime, parameter_types,
traits::{
@@ -473,6 +470,14 @@ generate_solution_type!(
>(16)
);
pub struct OnChainSeqPhragmen;
impl onchain::Config for OnChainSeqPhragmen {
type System = Runtime;
type Solver = SequentialPhragmen<AccountId, runtime_common::elections::OnChainAccuracy>;
type DataProvider = Staking;
type WeightInfo = weights::frame_election_provider_support::WeightInfo<Runtime>;
}
impl pallet_election_provider_multi_phase::Config for Runtime {
type Event = Event;
type Currency = Balances;
@@ -495,7 +500,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type DataProvider = Staking;
type Solution = NposCompactSolution16;
type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>;
type GovernanceFallback = UnboundedExecution<OnChainSeqPhragmen<Self, Staking>>;
type GovernanceFallback = onchain::UnboundedExecution<OnChainSeqPhragmen>;
type Solver = SequentialPhragmen<
AccountId,
pallet_election_provider_multi_phase::SolutionAccuracyOf<Self>,
@@ -577,7 +582,7 @@ impl pallet_staking::Config for Runtime {
type OffendingValidatorsThreshold = OffendingValidatorsThreshold;
type NextNewSession = Session;
type ElectionProvider = ElectionProviderMultiPhase;
type GenesisElectionProvider = runtime_common::elections::GenesisElectionOf<Self, Staking>;
type GenesisElectionProvider = onchain::UnboundedExecution<OnChainSeqPhragmen>;
type VoterList = BagsList;
type MaxUnlockingChunks = frame_support::traits::ConstU32<32>;
type BenchmarkingConfig = runtime_common::StakingBenchmarkingConfig;
@@ -1731,6 +1736,7 @@ mod benches {
[pallet_democracy, Democracy]
[pallet_elections_phragmen, PhragmenElection]
[pallet_election_provider_multi_phase, ElectionProviderMultiPhase]
[frame_election_provider_support, ElectionProviderBench::<Runtime>]
[pallet_identity, Identity]
[pallet_im_online, ImOnline]
[pallet_indices, Indices]
@@ -2099,6 +2105,7 @@ sp_api::impl_runtime_apis! {
use pallet_session_benchmarking::Pallet as SessionBench;
use pallet_offences_benchmarking::Pallet as OffencesBench;
use pallet_election_provider_support_benchmarking::Pallet as ElectionProviderBench;
use frame_system_benchmarking::Pallet as SystemBench;
use frame_benchmarking::baseline::Pallet as Baseline;
@@ -2120,11 +2127,13 @@ sp_api::impl_runtime_apis! {
// To get around that, we separated the benchmarks into its own crate.
use pallet_session_benchmarking::Pallet as SessionBench;
use pallet_offences_benchmarking::Pallet as OffencesBench;
use pallet_election_provider_support_benchmarking::Pallet as ElectionProviderBench;
use frame_system_benchmarking::Pallet as SystemBench;
use frame_benchmarking::baseline::Pallet as Baseline;
impl pallet_session_benchmarking::Config for Runtime {}
impl pallet_offences_benchmarking::Config for Runtime {}
impl pallet_election_provider_support_benchmarking::Config for Runtime {}
impl frame_system_benchmarking::Config for Runtime {}
impl frame_benchmarking::baseline::Config for Runtime {}
@@ -0,0 +1,61 @@
// 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 <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `frame_election_provider_support`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-04-15, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("polkadot-dev"), DB CACHE: 1024
// Executed Command:
// target/production/polkadot
// benchmark
// pallet
// --chain=polkadot-dev
// --steps=50
// --repeat=20
// --pallet=frame_election_provider_support
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --header=./file_header.txt
// --output=./runtime/polkadot/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weight functions for `frame_election_provider_support`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> frame_election_provider_support::WeightInfo for WeightInfo<T> {
fn phragmen(v: u32, _t: u32, d: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 51_000
.saturating_add((18_136_000 as Weight).saturating_mul(v as Weight))
// Standard Error: 7_074_000
.saturating_add((2_953_665_000 as Weight).saturating_mul(d as Weight))
}
fn phragmms(v: u32, _t: u32, d: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 51_000
.saturating_add((15_939_000 as Weight).saturating_mul(v as Weight))
// Standard Error: 7_126_000
.saturating_add((2_704_026_000 as Weight).saturating_mul(d as Weight))
}
}
@@ -15,6 +15,7 @@
//! A list of the different weight modules for our runtime.
pub mod frame_election_provider_support;
pub mod frame_system;
pub mod pallet_bags_list;
pub mod pallet_balances;
+11 -6
View File
@@ -35,6 +35,7 @@ use polkadot_runtime_parachains::{
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
use beefy_primitives::crypto::AuthorityId as BeefyId;
use frame_election_provider_support::{onchain, SequentialPhragmen};
use frame_support::{
construct_runtime, parameter_types,
traits::{Everything, KeyOwnerProofSystem},
@@ -319,6 +320,14 @@ parameter_types! {
pub const MaxAuthorities: u32 = 100_000;
}
pub struct OnChainSeqPhragmen;
impl onchain::Config for OnChainSeqPhragmen {
type System = Runtime;
type Solver = SequentialPhragmen<AccountId, runtime_common::elections::OnChainAccuracy>;
type DataProvider = Staking;
type WeightInfo = ();
}
impl pallet_staking::Config for Runtime {
type MaxNominations = frame_support::pallet_prelude::ConstU32<16>;
type Currency = Balances;
@@ -338,12 +347,8 @@ impl pallet_staking::Config for Runtime {
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
type OffendingValidatorsThreshold = OffendingValidatorsThreshold;
type NextNewSession = Session;
type ElectionProvider = frame_election_provider_support::onchain::UnboundedExecution<
runtime_common::elections::OnChainSeqPhragmen<Self, Staking>,
>;
type GenesisElectionProvider = frame_election_provider_support::onchain::UnboundedExecution<
runtime_common::elections::OnChainSeqPhragmen<Self, Staking>,
>;
type ElectionProvider = onchain::UnboundedExecution<OnChainSeqPhragmen>;
type GenesisElectionProvider = onchain::UnboundedExecution<OnChainSeqPhragmen>;
// Use the nominator map to iter voter AND no-ops for all SortedListProvider hooks. The migration
// to bags-list is a no-op, but the storage version will be updated.
type VoterList = pallet_staking::UseNominatorsAndValidatorsMap<Runtime>;
+2
View File
@@ -77,6 +77,7 @@ pallet-xcm-benchmarks = { path = "../../xcm/pallet-xcm-benchmarks", default-feat
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
frame-try-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
frame-system-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
pallet-election-provider-support-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
pallet-offences-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
pallet-session-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, optional = true }
hex-literal = { version = "0.3.4", optional = true }
@@ -188,6 +189,7 @@ runtime-benchmarks = [
"pallet-democracy/runtime-benchmarks",
"pallet-elections-phragmen/runtime-benchmarks",
"pallet-election-provider-multi-phase/runtime-benchmarks",
"pallet-election-provider-support-benchmarking/runtime-benchmarks",
"pallet-grandpa/runtime-benchmarks",
"pallet-identity/runtime-benchmarks",
"pallet-im-online/runtime-benchmarks",
+16 -4
View File
@@ -22,7 +22,7 @@
use authority_discovery_primitives::AuthorityId as AuthorityDiscoveryId;
use beefy_primitives::crypto::AuthorityId as BeefyId;
use frame_election_provider_support::{onchain::UnboundedExecution, SequentialPhragmen};
use frame_election_provider_support::{onchain, SequentialPhragmen};
use frame_support::{
construct_runtime, parameter_types,
traits::{Contains, InstanceFilter, KeyOwnerProofSystem, OnRuntimeUpgrade},
@@ -43,7 +43,7 @@ use primitives::v2::{
ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex, ValidatorSignature,
};
use runtime_common::{
assigned_slots, auctions, crowdloan, elections::OnChainSeqPhragmen, impl_runtime_weights,
assigned_slots, auctions, crowdloan, elections::OnChainAccuracy, impl_runtime_weights,
impls::ToAuthor, paras_registrar, paras_sudo_wrapper, slots, BlockHashCount, BlockLength,
CurrencyToVote, SlowAdjustingFeeUpdate,
};
@@ -372,6 +372,14 @@ frame_election_provider_support::generate_solution_type!(
>(16)
);
pub struct OnChainSeqPhragmen;
impl onchain::Config for OnChainSeqPhragmen {
type System = Runtime;
type Solver = SequentialPhragmen<AccountId, OnChainAccuracy>;
type DataProvider = Staking;
type WeightInfo = weights::frame_election_provider_support::WeightInfo<Runtime>;
}
impl pallet_election_provider_multi_phase::Config for Runtime {
type Event = Event;
type Currency = Balances;
@@ -394,7 +402,7 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
type DataProvider = Staking;
type Solution = NposCompactSolution16;
type Fallback = pallet_election_provider_multi_phase::NoFallback<Self>;
type GovernanceFallback = UnboundedExecution<OnChainSeqPhragmen<Self, Staking>>;
type GovernanceFallback = onchain::UnboundedExecution<OnChainSeqPhragmen>;
type Solver = SequentialPhragmen<
AccountId,
pallet_election_provider_multi_phase::SolutionAccuracyOf<Self>,
@@ -463,7 +471,7 @@ impl pallet_staking::Config for Runtime {
type OffendingValidatorsThreshold = OffendingValidatorsThreshold;
type NextNewSession = Session;
type ElectionProvider = ElectionProviderMultiPhase;
type GenesisElectionProvider = runtime_common::elections::GenesisElectionOf<Self, Staking>;
type GenesisElectionProvider = onchain::UnboundedExecution<OnChainSeqPhragmen>;
type VoterList = BagsList;
type MaxUnlockingChunks = frame_support::traits::ConstU32<32>;
type BenchmarkingConfig = runtime_common::StakingBenchmarkingConfig;
@@ -1136,6 +1144,7 @@ mod benches {
[pallet_bags_list, BagsList]
[pallet_balances, Balances]
[pallet_election_provider_multi_phase, ElectionProviderMultiPhase]
[frame_election_provider_support, ElectionProviderBench::<Runtime>]
[pallet_identity, Identity]
[pallet_im_online, ImOnline]
[pallet_indices, Indices]
@@ -1504,6 +1513,7 @@ sp_api::impl_runtime_apis! {
use pallet_session_benchmarking::Pallet as SessionBench;
use pallet_offences_benchmarking::Pallet as OffencesBench;
use pallet_election_provider_support_benchmarking::Pallet as ElectionProviderBench;
use frame_system_benchmarking::Pallet as SystemBench;
type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::<Runtime>;
@@ -1527,10 +1537,12 @@ sp_api::impl_runtime_apis! {
// To get around that, we separated the benchmarks into its own crate.
use pallet_session_benchmarking::Pallet as SessionBench;
use pallet_offences_benchmarking::Pallet as OffencesBench;
use pallet_election_provider_support_benchmarking::Pallet as ElectionProviderBench;
use frame_system_benchmarking::Pallet as SystemBench;
impl pallet_session_benchmarking::Config for Runtime {}
impl pallet_offences_benchmarking::Config for Runtime {}
impl pallet_election_provider_support_benchmarking::Config for Runtime {}
impl frame_system_benchmarking::Config for Runtime {}
use xcm::latest::{
@@ -0,0 +1,61 @@
// 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 <http://www.gnu.org/licenses/>.
//! Autogenerated weights for `frame_election_provider_support`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-04-15, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 1024
// Executed Command:
// target/production/polkadot
// benchmark
// pallet
// --chain=westend-dev
// --steps=50
// --repeat=20
// --pallet=frame_election_provider_support
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --header=./file_header.txt
// --output=./runtime/westend/src/weights/
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;
/// Weight functions for `frame_election_provider_support`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> frame_election_provider_support::WeightInfo for WeightInfo<T> {
fn phragmen(v: u32, _t: u32, d: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 49_000
.saturating_add((18_804_000 as Weight).saturating_mul(v as Weight))
// Standard Error: 6_922_000
.saturating_add((3_040_535_000 as Weight).saturating_mul(d as Weight))
}
fn phragmms(v: u32, _t: u32, d: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 66_000
.saturating_add((16_029_000 as Weight).saturating_mul(v as Weight))
// Standard Error: 9_193_000
.saturating_add((2_707_950_000 as Weight).saturating_mul(d as Weight))
}
}
@@ -15,6 +15,7 @@
//! A list of the different weight modules for our runtime.
pub mod frame_election_provider_support;
pub mod frame_system;
pub mod pallet_bags_list;
pub mod pallet_balances;