mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 18:41:03 +00:00
* `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:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user