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
+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;