Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Refactors elections-phragmen pallet (companion for substrate#13453) #6278

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
90a1f90
Renamed pallet elections_phragmen to elections; Adds required new typ…
gpestana Nov 13, 2022
5588c3e
updates runtime pallet elections weights
gpestana Nov 17, 2022
b6baf7d
adds comments explaining why elections pallet param type was renamed …
gpestana Nov 20, 2022
3544937
Merge branch 'master' into gpestana8250_npossolver_companion
gpestana Dec 8, 2022
eefc12b
Merge branch 'master' into gpestana8250_npossolver_companion
gpestana Feb 17, 2023
324d524
merge conflict fixes and brings branch back to master
gpestana Feb 17, 2023
e2bd3ef
Renames PhragmenElection -> Elections
gpestana Feb 20, 2023
3cb93d5
do not rename pallet
gpestana Feb 20, 2023
492277d
Fixes tests weights
gpestana Feb 20, 2023
72c7a15
Merge branch 'master' into gpestana8250_npossolver_companion
gpestana Feb 20, 2023
fbdb213
Merge branch 'master' into gpestana8250_npossolver_companion
gpestana Feb 22, 2023
683f2a1
updates benchmarks
gpestana Feb 22, 2023
69534d8
Merge branch 'master' into gpestana8250_npossolver_companion
gpestana Feb 22, 2023
ee01b5d
fixes runtime benchmarks
gpestana Feb 22, 2023
2aff06b
".git/.scripts/commands/bench/bench.sh" runtime kusama-dev frame_elec…
Feb 22, 2023
8037a5f
".git/.scripts/commands/bench/bench.sh" runtime polkadot-dev frame_el…
Feb 22, 2023
9a5be7c
reverts changes on weights.rs done manually
gpestana Feb 22, 2023
e92db6f
Merge branch 'gpestana8250_npossolver_companion' of github.com:parity…
gpestana Feb 22, 2023
2263446
".git/.scripts/commands/bench/bench.sh" runtime westend-dev frame_ele…
Feb 22, 2023
8ee028e
Merge branch 'master' of https://github.com/paritytech/polkadot into …
Feb 23, 2023
ee8b989
".git/.scripts/commands/bench/bench.sh" runtime polkadot-dev pallet_e…
Feb 23, 2023
ffd2221
Fixes weights.rs and adds comment
gpestana Feb 23, 2023
4642b1d
Merge branch 'gpestana8250_npossolver_companion' of github.com:parity…
gpestana Feb 23, 2023
e4d1e79
Merge remote-tracking branch 'origin/master' into gpestana8250_nposso…
Feb 23, 2023
bc6edc9
Merge branch 'master' into gpestana8250_npossolver_companion
gpestana Feb 23, 2023
ef26039
update lockfile for {"substrate"}
Feb 23, 2023
fe5bd63
Fixes election limits for tests
gpestana Feb 23, 2023
77108f9
Merge branch 'gpestana8250_npossolver_companion' of github.com:parity…
gpestana Feb 23, 2023
9e1e7a1
fix test bounds for election
gpestana Feb 23, 2023
26827bd
Reverts runtime election bounds for testing
gpestana Feb 28, 2023
7d914d5
resets cargo.lock with master
gpestana Feb 28, 2023
f64c6df
Merge branch 'master' into gpestana8250_npossolver_companion
gpestana Feb 28, 2023
973f9cb
Merge branch 'master' into gpestana8250_npossolver_companion
gpestana Mar 20, 2023
2751cbb
Merge branch 'master' into gpestana8250_npossolver_companion
gpestana Mar 21, 2023
aee97dd
fixes weights pallet elections
gpestana Mar 21, 2023
ca3e2d5
".git/.scripts/commands/bench/bench.sh" runtime rococo-dev pallet_ele…
Mar 21, 2023
fd64eec
Merge branch 'master' into gpestana8250_npossolver_companion
gpestana Mar 22, 2023
14a571e
fixes from merge commit
gpestana Mar 22, 2023
086b2b6
Merge branch 'gpestana8250_npossolver_companion' of github.com:parity…
gpestana Mar 22, 2023
a0f0fee
Merge branch 'master' into gpestana8250_npossolver_companion
gpestana Mar 24, 2023
4f100c6
Adds missing NposSolver
gpestana Mar 24, 2023
bd51835
Moves NposSolver import under tests
gpestana Mar 24, 2023
5cd574a
".git/.scripts/commands/bench/bench.sh" runtime polkadot-dev pallet_e…
Mar 24, 2023
31b78a8
Merge branch 'master' into gpestana8250_npossolver_companion
gpestana Mar 31, 2023
6afac5f
Merge branch 'master' into gpestana8250_npossolver_companion
gpestana May 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions node/service/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ fn polkadot_staging_testnet_config_genesis(wasm_binary: &[u8]) -> polkadot::Gene
slash_reward_fraction: Perbill::from_percent(10),
..Default::default()
},
phragmen_election: Default::default(),
elections: Default::default(),
democracy: Default::default(),
council: polkadot::CouncilConfig { members: vec![], phantom: Default::default() },
technical_committee: polkadot::TechnicalCommitteeConfig {
Expand Down Expand Up @@ -745,7 +745,7 @@ fn kusama_staging_testnet_config_genesis(wasm_binary: &[u8]) -> kusama::GenesisC
slash_reward_fraction: Perbill::from_percent(10),
..Default::default()
},
phragmen_election: Default::default(),
elections: Default::default(),
democracy: Default::default(),
council: kusama::CouncilConfig { members: vec![], phantom: Default::default() },
technical_committee: kusama::TechnicalCommitteeConfig {
Expand Down Expand Up @@ -1049,7 +1049,7 @@ fn rococo_staging_testnet_config_genesis(wasm_binary: &[u8]) -> rococo_runtime::
})
.collect::<Vec<_>>(),
},
phragmen_election: Default::default(),
elections: Default::default(),
babe: rococo_runtime::BabeConfig {
authorities: Default::default(),
epoch_config: Some(rococo_runtime::BABE_GENESIS_EPOCH_CONFIG),
Expand Down Expand Up @@ -1357,7 +1357,7 @@ pub fn polkadot_testnet_genesis(
slash_reward_fraction: Perbill::from_percent(10),
..Default::default()
},
phragmen_election: Default::default(),
elections: Default::default(),
democracy: polkadot::DemocracyConfig::default(),
council: polkadot::CouncilConfig { members: vec![], phantom: Default::default() },
technical_committee: polkadot::TechnicalCommitteeConfig {
Expand Down Expand Up @@ -1444,7 +1444,7 @@ pub fn kusama_testnet_genesis(
slash_reward_fraction: Perbill::from_percent(10),
..Default::default()
},
phragmen_election: Default::default(),
elections: Default::default(),
democracy: kusama::DemocracyConfig::default(),
council: kusama::CouncilConfig { members: vec![], phantom: Default::default() },
technical_committee: kusama::TechnicalCommitteeConfig {
Expand Down Expand Up @@ -1609,7 +1609,7 @@ pub fn rococo_testnet_genesis(
},
grandpa: Default::default(),
im_online: Default::default(),
phragmen_election: Default::default(),
elections: Default::default(),
democracy: rococo::DemocracyConfig::default(),
council: rococo::CouncilConfig { members: vec![], phantom: Default::default() },
technical_committee: rococo::TechnicalCommitteeConfig {
Expand Down
8 changes: 4 additions & 4 deletions runtime/kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pallet-nomination-pools-runtime-api = { git = "https://github.com/paritytech/sub
pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-conviction-voting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-elections = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-fast-unstake = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand Down Expand Up @@ -146,7 +146,7 @@ std = [
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-collective/std",
"pallet-conviction-voting/std",
"pallet-elections-phragmen/std",
"pallet-elections/std",
"pallet-election-provider-multi-phase/std",
"pallet-fast-unstake/std",
"pallet-democracy/std",
Expand Down Expand Up @@ -212,7 +212,7 @@ runtime-benchmarks = [
"pallet-collective/runtime-benchmarks",
"pallet-conviction-voting/runtime-benchmarks",
"pallet-democracy/runtime-benchmarks",
"pallet-elections-phragmen/runtime-benchmarks",
"pallet-elections/runtime-benchmarks",
"pallet-election-provider-multi-phase/runtime-benchmarks",
"pallet-election-provider-support-benchmarking/runtime-benchmarks",
"pallet-fast-unstake/runtime-benchmarks",
Expand Down Expand Up @@ -263,7 +263,7 @@ try-runtime = [
"pallet-transaction-payment/try-runtime",
"pallet-collective/try-runtime",
"pallet-conviction-voting/try-runtime",
"pallet-elections-phragmen/try-runtime",
"pallet-elections/try-runtime",
"pallet-election-provider-multi-phase/try-runtime",
"pallet-fast-unstake/try-runtime",
"pallet-democracy/try-runtime",
Expand Down
13 changes: 9 additions & 4 deletions runtime/kusama/src/governance/old.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

use crate::*;
use frame_support::{parameter_types, traits::EitherOfDiverse};
use frame_election_provider_support::{
weights::SubstrateWeight, SequentialPhragmen,
};

parameter_types! {
pub LaunchPeriod: BlockNumber = prod_or_fast!(7 * DAYS, 1, "KSM_LAUNCH_PERIOD");
Expand Down Expand Up @@ -114,13 +117,13 @@ parameter_types! {
pub const DesiredRunnersUp: u32 = 19;
pub const MaxVoters: u32 = 10 * 1000;
pub const MaxCandidates: u32 = 1000;
pub const PhragmenElectionPalletId: LockIdentifier = *b"phrelect";
pub const ElectionsPalletId: LockIdentifier = *b"phrelect";
}

// Make sure that there are no more than `MaxMembers` members elected via Phragmen.
const_assert!(DesiredMembers::get() <= CouncilMaxMembers::get());

impl pallet_elections_phragmen::Config for Runtime {
impl pallet_elections::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = Balances;
type ChangeMembers = Council;
Expand All @@ -136,8 +139,10 @@ impl pallet_elections_phragmen::Config for Runtime {
type TermDuration = TermDuration;
type MaxVoters = MaxVoters;
type MaxCandidates = MaxCandidates;
type PalletId = PhragmenElectionPalletId;
type WeightInfo = weights::pallet_elections_phragmen::WeightInfo<Runtime>;
type PalletId = ElectionsPalletId;
type WeightInfo = weights::pallet_elections::WeightInfo<Runtime>;
type ElectionSolver = SequentialPhragmen<Self::AccountId, Perbill>;
type SolverWeightInfo = SubstrateWeight<Self>;
}

parameter_types! {
Expand Down
10 changes: 5 additions & 5 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ impl pallet_child_bounties::Config for Runtime {
impl pallet_tips::Config for Runtime {
type MaximumReasonLength = MaximumReasonLength;
type DataDepositPerByte = DataDepositPerByte;
type Tippers = PhragmenElection;
type Tippers = Elections;
type TipCountdown = TipCountdown;
type TipFindersFee = TipFindersFee;
type TipReportDepositBase = TipReportDepositBase;
Expand Down Expand Up @@ -999,7 +999,7 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
RuntimeCall::Democracy(..) |
RuntimeCall::Council(..) |
RuntimeCall::TechnicalCommittee(..) |
RuntimeCall::PhragmenElection(..) |
RuntimeCall::Elections(..) |
RuntimeCall::TechnicalMembership(..) |
RuntimeCall::Treasury(..) |
RuntimeCall::Bounties(..) |
Expand Down Expand Up @@ -1039,7 +1039,7 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
c,
RuntimeCall::Democracy(..) |
RuntimeCall::Council(..) | RuntimeCall::TechnicalCommittee(..) |
RuntimeCall::PhragmenElection(..) |
RuntimeCall::Elections(..) |
RuntimeCall::Treasury(..) |
RuntimeCall::Bounties(..) |
RuntimeCall::Tips(..) | RuntimeCall::Utility(..) |
Expand Down Expand Up @@ -1319,7 +1319,7 @@ construct_runtime! {
Democracy: pallet_democracy::{Pallet, Call, Storage, Config<T>, Event<T>} = 13,
Council: pallet_collective::<Instance1>::{Pallet, Call, Storage, Origin<T>, Event<T>, Config<T>} = 14,
TechnicalCommittee: pallet_collective::<Instance2>::{Pallet, Call, Storage, Origin<T>, Event<T>, Config<T>} = 15,
PhragmenElection: pallet_elections_phragmen::{Pallet, Call, Storage, Event<T>, Config<T>} = 16,
Elections: pallet_elections::{Pallet, Call, Storage, Event<T>, Config<T>} = 16,
TechnicalMembership: pallet_membership::<Instance1>::{Pallet, Call, Storage, Event<T>, Config<T>} = 17,
Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 18,

Expand Down Expand Up @@ -1500,7 +1500,7 @@ mod benches {
[pallet_collective, TechnicalCommittee]
[pallet_conviction_voting, ConvictionVoting]
[pallet_democracy, Democracy]
[pallet_elections_phragmen, PhragmenElection]
[pallet_elections, Elections]
[pallet_election_provider_multi_phase, ElectionProviderMultiPhase]
[frame_election_provider_support, ElectionProviderBench::<Runtime>]
[pallet_fast_unstake, FastUnstake]
Expand Down
2 changes: 1 addition & 1 deletion runtime/kusama/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub mod pallet_collective_technical_committee;
pub mod pallet_conviction_voting;
pub mod pallet_democracy;
pub mod pallet_election_provider_multi_phase;
pub mod pallet_elections_phragmen;
pub mod pallet_elections;
pub mod pallet_fast_unstake;
pub mod pallet_gilt;
pub mod pallet_identity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

gpestana marked this conversation as resolved.
Show resolved Hide resolved
// 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_elections_phragmen`
//! Autogenerated weights for `pallet_elections`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-09-08, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
Expand All @@ -27,7 +27,7 @@
// --chain=kusama-dev
// --steps=50
// --repeat=20
// --pallet=pallet_elections_phragmen
// --pallet=pallet_elections
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
Expand All @@ -41,13 +41,13 @@
use frame_support::{traits::Get, weights::{Weight}};
use sp_std::marker::PhantomData;

/// Weight functions for `pallet_elections_phragmen`.
/// Weight functions for `pallet_elections`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_elections_phragmen::WeightInfo for WeightInfo<T> {
// Storage: PhragmenElection Candidates (r:1 w:0)
// Storage: PhragmenElection Members (r:1 w:0)
// Storage: PhragmenElection RunnersUp (r:1 w:0)
// Storage: PhragmenElection Voting (r:1 w:1)
impl<T: frame_system::Config> pallet_elections::WeightInfo for WeightInfo<T> {
// Storage: Elections Candidates (r:1 w:0)
// Storage: Elections Members (r:1 w:0)
// Storage: Elections RunnersUp (r:1 w:0)
// Storage: Elections Voting (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
/// The range of component `v` is `[1, 16]`.
fn vote_equal(v: u32, ) -> Weight {
Expand All @@ -57,10 +57,10 @@ impl<T: frame_system::Config> pallet_elections_phragmen::WeightInfo for WeightIn
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: PhragmenElection Candidates (r:1 w:0)
// Storage: PhragmenElection Members (r:1 w:0)
// Storage: PhragmenElection RunnersUp (r:1 w:0)
// Storage: PhragmenElection Voting (r:1 w:1)
// Storage: Elections Candidates (r:1 w:0)
// Storage: Elections Members (r:1 w:0)
// Storage: Elections RunnersUp (r:1 w:0)
// Storage: Elections Voting (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
/// The range of component `v` is `[2, 16]`.
fn vote_more(v: u32, ) -> Weight {
Expand All @@ -70,10 +70,10 @@ impl<T: frame_system::Config> pallet_elections_phragmen::WeightInfo for WeightIn
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: PhragmenElection Candidates (r:1 w:0)
// Storage: PhragmenElection Members (r:1 w:0)
// Storage: PhragmenElection RunnersUp (r:1 w:0)
// Storage: PhragmenElection Voting (r:1 w:1)
// Storage: Elections Candidates (r:1 w:0)
// Storage: Elections Members (r:1 w:0)
// Storage: Elections RunnersUp (r:1 w:0)
// Storage: Elections Voting (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
/// The range of component `v` is `[2, 16]`.
fn vote_less(v: u32, ) -> Weight {
Expand All @@ -83,16 +83,16 @@ impl<T: frame_system::Config> pallet_elections_phragmen::WeightInfo for WeightIn
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: PhragmenElection Voting (r:1 w:1)
// Storage: Elections Voting (r:1 w:1)
// Storage: Balances Locks (r:1 w:1)
fn remove_voter() -> Weight {
Weight::from_ref_time(39_001_000 as u64)
.saturating_add(T::DbWeight::get().reads(2 as u64))
.saturating_add(T::DbWeight::get().writes(2 as u64))
}
// Storage: PhragmenElection Candidates (r:1 w:1)
// Storage: PhragmenElection Members (r:1 w:0)
// Storage: PhragmenElection RunnersUp (r:1 w:0)
// Storage: Elections Candidates (r:1 w:1)
// Storage: Elections Members (r:1 w:0)
// Storage: Elections RunnersUp (r:1 w:0)
/// The range of component `c` is `[1, 1000]`.
fn submit_candidacy(c: u32, ) -> Weight {
Weight::from_ref_time(26_806_000 as u64)
Expand All @@ -101,7 +101,7 @@ impl<T: frame_system::Config> pallet_elections_phragmen::WeightInfo for WeightIn
.saturating_add(T::DbWeight::get().reads(3 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: PhragmenElection Candidates (r:1 w:1)
// Storage: Elections Candidates (r:1 w:1)
/// The range of component `c` is `[1, 1000]`.
fn renounce_candidacy_candidate(c: u32, ) -> Weight {
Weight::from_ref_time(23_558_000 as u64)
Expand All @@ -110,8 +110,8 @@ impl<T: frame_system::Config> pallet_elections_phragmen::WeightInfo for WeightIn
.saturating_add(T::DbWeight::get().reads(1 as u64))
.saturating_add(T::DbWeight::get().writes(1 as u64))
}
// Storage: PhragmenElection Members (r:1 w:1)
// Storage: PhragmenElection RunnersUp (r:1 w:1)
// Storage: Elections Members (r:1 w:1)
// Storage: Elections RunnersUp (r:1 w:1)
// Storage: Council Prime (r:1 w:1)
// Storage: Council Proposals (r:1 w:0)
// Storage: Council Members (r:0 w:1)
Expand All @@ -120,7 +120,7 @@ impl<T: frame_system::Config> pallet_elections_phragmen::WeightInfo for WeightIn
.saturating_add(T::DbWeight::get().reads(4 as u64))
.saturating_add(T::DbWeight::get().writes(4 as u64))
}
// Storage: PhragmenElection RunnersUp (r:1 w:1)
// Storage: Elections RunnersUp (r:1 w:1)
fn renounce_candidacy_runners_up() -> Weight {
Weight::from_ref_time(34_666_000 as u64)
.saturating_add(T::DbWeight::get().reads(1 as u64))
Expand All @@ -130,9 +130,9 @@ impl<T: frame_system::Config> pallet_elections_phragmen::WeightInfo for WeightIn
fn remove_member_without_replacement() -> Weight {
Weight::from_ref_time(2_000_000_000_000 as u64)
}
// Storage: PhragmenElection Members (r:1 w:1)
// Storage: Elections Members (r:1 w:1)
// Storage: System Account (r:1 w:1)
// Storage: PhragmenElection RunnersUp (r:1 w:1)
// Storage: Elections RunnersUp (r:1 w:1)
// Storage: Council Prime (r:1 w:1)
// Storage: Council Proposals (r:1 w:0)
// Storage: Council Members (r:0 w:1)
Expand All @@ -141,10 +141,10 @@ impl<T: frame_system::Config> pallet_elections_phragmen::WeightInfo for WeightIn
.saturating_add(T::DbWeight::get().reads(5 as u64))
.saturating_add(T::DbWeight::get().writes(5 as u64))
}
// Storage: PhragmenElection Voting (r:5001 w:5000)
// Storage: PhragmenElection Members (r:1 w:0)
// Storage: PhragmenElection RunnersUp (r:1 w:0)
// Storage: PhragmenElection Candidates (r:1 w:0)
// Storage: Elections Voting (r:5001 w:5000)
// Storage: Elections Members (r:1 w:0)
// Storage: Elections RunnersUp (r:1 w:0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like a breaking change is happening with storage keys

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was edited manually, I am working on re-generating all the weights.rs with the ci bot. After that, the comments should be fixed Currently, the weights in this PR are not correct, everything else should be ready.

// Storage: Elections Candidates (r:1 w:0)
// Storage: Balances Locks (r:5000 w:5000)
// Storage: System Account (r:5000 w:5000)
/// The range of component `v` is `[5000, 10000]`.
Expand All @@ -159,19 +159,19 @@ impl<T: frame_system::Config> pallet_elections_phragmen::WeightInfo for WeightIn
.saturating_add(T::DbWeight::get().reads((3 as u64).saturating_mul(v as u64)))
.saturating_add(T::DbWeight::get().writes((3 as u64).saturating_mul(v as u64)))
}
// Storage: PhragmenElection Candidates (r:1 w:1)
// Storage: PhragmenElection Members (r:1 w:1)
// Storage: PhragmenElection RunnersUp (r:1 w:1)
// Storage: PhragmenElection Voting (r:10001 w:0)
// Storage: Elections Candidates (r:1 w:1)
// Storage: Elections Members (r:1 w:1)
// Storage: Elections RunnersUp (r:1 w:1)
// Storage: Elections Voting (r:10001 w:0)
// Storage: Council Proposals (r:1 w:0)
// Storage: PhragmenElection ElectionRounds (r:1 w:1)
// Storage: Elections ElectionRounds (r:1 w:1)
// Storage: Council Members (r:0 w:1)
// Storage: Council Prime (r:0 w:1)
// Storage: System Account (r:3 w:3)
/// The range of component `c` is `[1, 1000]`.
/// The range of component `v` is `[1, 10000]`.
/// The range of component `e` is `[10000, 160000]`.
fn election_phragmen(c: u32, v: u32, e: u32, ) -> Weight {
fn election(c: u32, v: u32, e: u32, ) -> Weight {
Weight::from_ref_time(0 as u64)
// Standard Error: 691_000
.saturating_add(Weight::from_ref_time(57_805_000 as u64).saturating_mul(v as u64))
Expand Down
8 changes: 4 additions & 4 deletions runtime/polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pallet-transaction-payment = { git = "https://github.com/paritytech/substrate",
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-collective = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-democracy = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-elections-phragmen = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-elections = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-election-provider-multi-phase = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-fast-unstake = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand Down Expand Up @@ -137,7 +137,7 @@ std = [
"pallet-transaction-payment/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-collective/std",
"pallet-elections-phragmen/std",
"pallet-elections/std",
"pallet-election-provider-multi-phase/std",
"pallet-democracy/std",
"pallet-fast-unstake/std",
Expand Down Expand Up @@ -193,7 +193,7 @@ runtime-benchmarks = [
"pallet-balances/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
"pallet-democracy/runtime-benchmarks",
"pallet-elections-phragmen/runtime-benchmarks",
"pallet-elections/runtime-benchmarks",
"pallet-election-provider-multi-phase/runtime-benchmarks",
"pallet-election-provider-support-benchmarking/runtime-benchmarks",
"pallet-fast-unstake/runtime-benchmarks",
Expand Down Expand Up @@ -238,7 +238,7 @@ try-runtime = [
"pallet-child-bounties/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-collective/try-runtime",
"pallet-elections-phragmen/try-runtime",
"pallet-elections/try-runtime",
"pallet-election-provider-multi-phase/try-runtime",
"pallet-fast-unstake/try-runtime",
"pallet-democracy/try-runtime",
Expand Down
Loading