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

Commit

Permalink
companion for staking/election: prolonged era and emergency mode for …
Browse files Browse the repository at this point in the history
…governance submission. (#3201)

* companion

* update Substrate

Co-authored-by: parity-processbot <>
  • Loading branch information
gui1117 authored and shawntabrizi committed Jun 17, 2021
1 parent 2816e33 commit 49e72cd
Show file tree
Hide file tree
Showing 8 changed files with 976 additions and 616 deletions.
1,569 changes: 953 additions & 616 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions runtime/kusama/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "m
pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-xcm = { path = "../../xcm/pallet-xcm", default-features = false }
frame-election-provider-support = { git = "https://github.com/paritytech/substrate", branch = "master", 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 }
Expand Down Expand Up @@ -173,6 +174,7 @@ std = [
"xcm/std",
"xcm-executor/std",
"xcm-builder/std",
"frame-election-provider-support/std",
]
runtime-benchmarks = [
"runtime-common/runtime-benchmarks",
Expand Down Expand Up @@ -209,6 +211,7 @@ runtime-benchmarks = [
"frame-system-benchmarking",
"hex-literal",
"xcm-builder/runtime-benchmarks",
"frame-election-provider-support/runtime-benchmarks",
]
try-runtime = [
"frame-executive/try-runtime",
Expand Down
4 changes: 4 additions & 0 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,10 @@ impl pallet_staking::Config for Runtime {
type UnixTime = Timestamp;
type CurrencyToVote = CurrencyToVote;
type ElectionProvider = ElectionProviderMultiPhase;
type GenesisElectionProvider =
frame_election_provider_support::onchain::OnChainSequentialPhragmen<
pallet_election_provider_multi_phase::OnChainConfig<Self>
>;
type RewardRemainder = Treasury;
type Event = Event;
type Slash = Treasury;
Expand Down
3 changes: 3 additions & 0 deletions runtime/polkadot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ pallet-tips = { git = "https://github.com/paritytech/substrate", branch = "maste
pallet-treasury = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-vesting = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-utility = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-election-provider-support = { git = "https://github.com/paritytech/substrate", branch = "master", 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 }
Expand Down Expand Up @@ -154,6 +155,7 @@ std = [
"sp-npos-elections/std",
"beefy-primitives/std",
"pallet-mmr-primitives/std",
"frame-election-provider-support/std",
]
runtime-benchmarks = [
"runtime-common/runtime-benchmarks",
Expand Down Expand Up @@ -186,6 +188,7 @@ runtime-benchmarks = [
"pallet-session-benchmarking",
"frame-system-benchmarking",
"hex-literal",
"frame-election-provider-support/runtime-benchmarks",
]
try-runtime = [
"frame-executive/try-runtime",
Expand Down
4 changes: 4 additions & 0 deletions runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,10 @@ impl pallet_staking::Config for Runtime {
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
type NextNewSession = Session;
type ElectionProvider = ElectionProviderMultiPhase;
type GenesisElectionProvider =
frame_election_provider_support::onchain::OnChainSequentialPhragmen<
pallet_election_provider_multi_phase::OnChainConfig<Self>
>;
type WeightInfo = weights::pallet_staking::WeightInfo<Runtime>;
}

Expand Down
2 changes: 2 additions & 0 deletions runtime/test-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ impl pallet_staking::Config for Runtime {
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
type NextNewSession = Session;
type ElectionProvider = frame_election_provider_support::onchain::OnChainSequentialPhragmen<Self>;
type GenesisElectionProvider =
frame_election_provider_support::onchain::OnChainSequentialPhragmen<Self>;
type WeightInfo = ();
}

Expand Down
3 changes: 3 additions & 0 deletions runtime/westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ tx-pool-api = { package = "sp-transaction-pool", git = "https://github.com/parit
block-builder-api = { package = "sp-block-builder", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-npos-elections = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }

frame-election-provider-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-executive = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
frame-system = {git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
Expand Down Expand Up @@ -168,6 +169,7 @@ std = [
"xcm/std",
"xcm-executor/std",
"xcm-builder/std",
"frame-election-provider-support/std",
]
runtime-benchmarks = [
"runtime-common/runtime-benchmarks",
Expand Down Expand Up @@ -200,6 +202,7 @@ runtime-benchmarks = [
"frame-system-benchmarking",
"hex-literal",
"xcm-builder/runtime-benchmarks",
"frame-election-provider-support/runtime-benchmarks",
]
try-runtime = [
"frame-executive/try-runtime",
Expand Down
4 changes: 4 additions & 0 deletions runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,10 @@ impl pallet_staking::Config for Runtime {
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
type NextNewSession = Session;
type ElectionProvider = ElectionProviderMultiPhase;
type GenesisElectionProvider =
frame_election_provider_support::onchain::OnChainSequentialPhragmen<
pallet_election_provider_multi_phase::OnChainConfig<Self>
>;
type WeightInfo = weights::pallet_staking::WeightInfo<Runtime>;
}

Expand Down

0 comments on commit 49e72cd

Please sign in to comment.