Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
19 changes: 14 additions & 5 deletions runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ impl pallet_staking::Config for Runtime {
type NextNewSession = Session;
type MaxNominatorRewardedPerValidator = MaxNominatorRewardedPerValidator;
type OffendingValidatorsThreshold = OffendingValidatorsThreshold;
type VoterList = BagsList;
type VoterList = VoterList;
type MaxUnlockingChunks = frame_support::traits::ConstU32<32>;
type BenchmarkingConfig = runtime_common::StakingBenchmarkingConfig;
type OnStakerSlash = ();
Expand Down Expand Up @@ -1172,7 +1172,7 @@ impl InstanceFilter<Call> for ProxyType {
Call::Crowdloan(..) |
Call::Slots(..) |
Call::Auctions(..) | // Specifically omitting the entire XCM Pallet
Call::BagsList(..)
Call::VoterList(..)
),
ProxyType::Governance => matches!(
c,
Expand Down Expand Up @@ -1479,7 +1479,7 @@ construct_runtime! {
Gilt: pallet_gilt::{Pallet, Call, Storage, Event<T>, Config} = 38,

// Provides a semi-sorted list of nominators for staking.
BagsList: pallet_bags_list::{Pallet, Call, Storage, Event<T>} = 39,
VoterList: pallet_bags_list::{Pallet, Call, Storage, Event<T>} = 39,

// Parachains pallets. Start indices at 50 to leave room.
ParachainsOrigin: parachains_origin::{Pallet, Origin} = 50,
Expand Down Expand Up @@ -1537,11 +1537,20 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
(),
(RenameBagsListToVoterList, pallet_bags_list::migrations::AddScore<Runtime, ()>),
>;
/// The payload being signed in the transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;

/// A migration which renames the pallet `BagsList` to `VoterList`
pub struct RenameBagsListToVoterList;
impl frame_support::traits::OnRuntimeUpgrade for RenameBagsListToVoterList {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
frame_support::storage::migration::move_pallet(b"BagsList", b"VoterList");
frame_support::weights::Weight::MAX
}
}

#[cfg(feature = "runtime-benchmarks")]
#[macro_use]
extern crate frame_benchmarking;
Expand All @@ -1566,7 +1575,7 @@ mod benches {
[runtime_parachains::ump, Ump]
// Substrate
[pallet_balances, Balances]
[pallet_bags_list, BagsList]
[pallet_bags_list, VoterList]
[frame_benchmarking::baseline, Baseline::<Runtime>]
[pallet_bounties, Bounties]
[pallet_child_bounties, ChildBounties]
Expand Down
21 changes: 15 additions & 6 deletions runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl Contains<Call> for BaseFilter {
Call::Registrar(_) |
Call::Auctions(_) |
Call::Crowdloan(_) |
Call::BagsList(_) |
Call::VoterList(_) |
Call::XcmPallet(_) => true,
// All pallets are allowed, but exhaustive match is defensive
// in the case of adding new pallets.
Expand Down Expand Up @@ -587,7 +587,7 @@ impl pallet_staking::Config for Runtime {
type NextNewSession = Session;
type ElectionProvider = ElectionProviderMultiPhase;
type GenesisElectionProvider = onchain::UnboundedExecution<OnChainSeqPhragmen>;
type VoterList = BagsList;
type VoterList = VoterList;
type MaxUnlockingChunks = frame_support::traits::ConstU32<32>;
type BenchmarkingConfig = runtime_common::StakingBenchmarkingConfig;
type OnStakerSlash = ();
Expand Down Expand Up @@ -1156,7 +1156,7 @@ impl InstanceFilter<Call> for ProxyType {
Call::Crowdloan(..) |
Call::Slots(..) |
Call::Auctions(..) | // Specifically omitting the entire XCM Pallet
Call::BagsList(..)
Call::VoterList(..)
),
ProxyType::Governance => matches!(
c,
Expand Down Expand Up @@ -1430,7 +1430,7 @@ construct_runtime! {
ElectionProviderMultiPhase: pallet_election_provider_multi_phase::{Pallet, Call, Storage, Event<T>, ValidateUnsigned} = 36,

// Provides a semi-sorted list of nominators for staking.
BagsList: pallet_bags_list::{Pallet, Call, Storage, Event<T>} = 37,
VoterList: pallet_bags_list::{Pallet, Call, Storage, Event<T>} = 37,

// Parachains pallets. Start indices at 50 to leave room.
ParachainsOrigin: parachains_origin::{Pallet, Origin} = 50,
Expand Down Expand Up @@ -1489,11 +1489,20 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
(),
(RenameBagsListToVoterList, pallet_bags_list::migrations::AddScore<Runtime, ()>),
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;

/// A migration which renames the pallet `BagsList` to `VoterList`
pub struct RenameBagsListToVoterList;
impl frame_support::traits::OnRuntimeUpgrade for RenameBagsListToVoterList {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
frame_support::storage::migration::move_pallet(b"BagsList", b"VoterList");
frame_support::weights::Weight::MAX
}
}

#[cfg(feature = "runtime-benchmarks")]
#[macro_use]
extern crate frame_benchmarking;
Expand All @@ -1516,7 +1525,7 @@ mod benches {
[runtime_parachains::paras_inherent, ParaInherent]
[runtime_parachains::ump, Ump]
// Substrate
[pallet_bags_list, BagsList]
[pallet_bags_list, VoterList]
[pallet_balances, Balances]
[frame_benchmarking::baseline, Baseline::<Runtime>]
[pallet_bounties, Bounties]
Expand Down
19 changes: 14 additions & 5 deletions runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ impl pallet_staking::Config for Runtime {
type NextNewSession = Session;
type ElectionProvider = ElectionProviderMultiPhase;
type GenesisElectionProvider = onchain::UnboundedExecution<OnChainSeqPhragmen>;
type VoterList = BagsList;
type VoterList = VoterList;
type MaxUnlockingChunks = frame_support::traits::ConstU32<32>;
type BenchmarkingConfig = runtime_common::StakingBenchmarkingConfig;
type OnStakerSlash = ();
Expand Down Expand Up @@ -771,7 +771,7 @@ impl InstanceFilter<Call> for ProxyType {
Call::Crowdloan(..) |
Call::Slots(..) |
Call::Auctions(..) | // Specifically omitting the entire XCM Pallet
Call::BagsList(..) |
Call::VoterList(..) |
Call::NominationPools(..)
),
ProxyType::Staking => {
Expand Down Expand Up @@ -1072,7 +1072,7 @@ construct_runtime! {
ElectionProviderMultiPhase: pallet_election_provider_multi_phase::{Pallet, Call, Storage, Event<T>, ValidateUnsigned} = 24,

// Provides a semi-sorted list of nominators for staking.
BagsList: pallet_bags_list::{Pallet, Call, Storage, Event<T>} = 25,
VoterList: pallet_bags_list::{Pallet, Call, Storage, Event<T>} = 25,

// Nomination pools for staking.
NominationPools: pallet_nomination_pools::{Pallet, Call, Storage, Event<T>, Config<T>} = 29,
Expand Down Expand Up @@ -1135,11 +1135,20 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
(),
(RenameBagsListToVoterList, pallet_bags_list::migrations::AddScore<Runtime, ()>),
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;

/// A migration which renames the pallet `BagsList` to `VoterList`
pub struct RenameBagsListToVoterList;
impl frame_support::traits::OnRuntimeUpgrade for RenameBagsListToVoterList {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
frame_support::storage::migration::move_pallet(b"BagsList", b"VoterList");
frame_support::weights::Weight::MAX
}
}

#[cfg(feature = "runtime-benchmarks")]
#[macro_use]
extern crate frame_benchmarking;
Expand All @@ -1162,7 +1171,7 @@ mod benches {
[runtime_parachains::paras_inherent, ParaInherent]
[runtime_parachains::ump, Ump]
// Substrate
[pallet_bags_list, BagsList]
[pallet_bags_list, VoterList]
[pallet_balances, Balances]
[pallet_election_provider_multi_phase, ElectionProviderMultiPhase]
[frame_election_provider_support, ElectionProviderBench::<Runtime>]
Expand Down