mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 10:31:03 +00:00
Properly use weights for the new election pallet (#2508)
* Revert some weights * Add features * Update lock file * cargo run --release --features=runtime-benchmarks -- benchmark --chain=kusama-dev --steps=50 --repeat=20 --pallet=pallet_election_provider_multi_phase --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/kusama/src/weights/ * cargo run --release --features=runtime-benchmarks -- benchmark --chain=westend-dev --steps=50 --repeat=20 --pallet=pallet_election_provider_multi_phase --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/westend/src/weights/ * Use read weights * cargo run --release --features=runtime-benchmarks -- benchmark --chain=polkadot-dev --steps=50 --repeat=20 --pallet=pallet_election_provider_multi_phase --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --header=./file_header.txt --output=./runtime/polkadot/src/weights/ * export stuff * Update substrate Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
This commit is contained in:
@@ -321,8 +321,8 @@ impl pallet_election_provider_multi_phase::Config for Runtime {
|
||||
type OnChainAccuracy = Perbill;
|
||||
type CompactSolution = pallet_staking::CompactAssignments;
|
||||
type Fallback = Fallback;
|
||||
type WeightInfo = pallet_election_provider_multi_phase::weights::SubstrateWeight<Runtime>;
|
||||
type BenchmarkingConfig = ();
|
||||
type WeightInfo = weights::pallet_election_provider_multi_phase::WeightInfo<Runtime>;
|
||||
}
|
||||
|
||||
pallet_staking_reward_curve::build! {
|
||||
@@ -1075,6 +1075,7 @@ sp_api::impl_runtime_apis! {
|
||||
let params = (&config, &whitelist);
|
||||
|
||||
add_benchmark!(params, batches, pallet_balances, Balances);
|
||||
add_benchmark!(params, batches, pallet_election_provider_multi_phase, ElectionProviderMultiPhase);
|
||||
add_benchmark!(params, batches, pallet_identity, Identity);
|
||||
add_benchmark!(params, batches, pallet_im_online, ImOnline);
|
||||
add_benchmark!(params, batches, pallet_indices, Indices);
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
pub mod frame_system;
|
||||
pub mod pallet_balances;
|
||||
pub mod pallet_election_provider_multi_phase;
|
||||
pub mod pallet_identity;
|
||||
pub mod pallet_im_online;
|
||||
pub mod pallet_indices;
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
// 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_election_provider_multi_phase
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 3.0.0
|
||||
//! DATE: 2021-02-23, STEPS: [50, ], REPEAT: 20, LOW RANGE: [], HIGH RANGE: []
|
||||
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("westend-dev"), DB CACHE: 128
|
||||
|
||||
// Executed Command:
|
||||
// target/release/polkadot
|
||||
// benchmark
|
||||
// --chain=westend-dev
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --pallet=pallet_election_provider_multi_phase
|
||||
// --extrinsic=*
|
||||
// --execution=wasm
|
||||
// --wasm-execution=compiled
|
||||
// --heap-pages=4096
|
||||
// --header=./file_header.txt
|
||||
// --output=./runtime/westend/src/weights/
|
||||
|
||||
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
|
||||
use frame_support::{traits::Get, weights::Weight};
|
||||
use sp_std::marker::PhantomData;
|
||||
|
||||
/// Weight functions for pallet_election_provider_multi_phase.
|
||||
pub struct WeightInfo<T>(PhantomData<T>);
|
||||
impl<T: frame_system::Config> pallet_election_provider_multi_phase::WeightInfo for WeightInfo<T> {
|
||||
fn on_initialize_nothing() -> Weight {
|
||||
(21_410_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(7 as Weight))
|
||||
}
|
||||
fn on_initialize_open_signed() -> Weight {
|
||||
(72_881_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(7 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
}
|
||||
fn on_initialize_open_unsigned_with_snapshot() -> Weight {
|
||||
(71_493_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(7 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(4 as Weight))
|
||||
}
|
||||
fn on_initialize_open_unsigned_without_snapshot() -> Weight {
|
||||
(18_249_000 as Weight)
|
||||
.saturating_add(T::DbWeight::get().reads(1 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn submit_unsigned(v: u32, t: u32, a: u32, d: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
// Standard Error: 22_000
|
||||
.saturating_add((4_209_000 as Weight).saturating_mul(v as Weight))
|
||||
// Standard Error: 75_000
|
||||
.saturating_add((275_000 as Weight).saturating_mul(t as Weight))
|
||||
// Standard Error: 22_000
|
||||
.saturating_add((14_019_000 as Weight).saturating_mul(a as Weight))
|
||||
// Standard Error: 113_000
|
||||
.saturating_add((4_613_000 as Weight).saturating_mul(d as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(6 as Weight))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as Weight))
|
||||
}
|
||||
fn feasibility_check(v: u32, t: u32, a: u32, d: u32, ) -> Weight {
|
||||
(0 as Weight)
|
||||
// Standard Error: 12_000
|
||||
.saturating_add((4_292_000 as Weight).saturating_mul(v as Weight))
|
||||
// Standard Error: 41_000
|
||||
.saturating_add((707_000 as Weight).saturating_mul(t as Weight))
|
||||
// Standard Error: 12_000
|
||||
.saturating_add((10_456_000 as Weight).saturating_mul(a as Weight))
|
||||
// Standard Error: 62_000
|
||||
.saturating_add((4_432_000 as Weight).saturating_mul(d as Weight))
|
||||
.saturating_add(T::DbWeight::get().reads(3 as Weight))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user