Skip to content

Commit

Permalink
Enable Nomination Pool Participation in Governance in Kusama (#540)
Browse files Browse the repository at this point in the history
Relates to #455.

The Polkadot changes were implemented in [this
PR](#490) but were
[reverted](pandres95#8) for Kusama.
Some [patches](paritytech/polkadot-sdk#6592) to
2409 were required before these changes can be applied to Kusama.
  • Loading branch information
Ank4n authored Jan 13, 2025
1 parent c1f8b7f commit 59802a1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- ParaRegistration proxy for Polkadot and Kusama ([polkadot-fellows/runtimes#520](https://github.com/polkadot-fellows/runtimes/pull/520))

- Delegate stake pools in Kusama ([polkadot-fellows/runtimes#540](https://github.com/polkadot-fellows/runtimes/pull/540))

### Changed

- Kusama Treasury: remove funding to the Kappa Sigma Mu Society and disable burn ([polkadot-fellows/runtimes#507](https://github.com/polkadot-fellows/runtimes/pull/507))
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ pallet-nft-fractionalization = { version = "21.0.0", default-features = false }
pallet-nfts = { version = "32.0.0", default-features = false }
pallet-nfts-runtime-api = { version = "24.0.0", default-features = false }
pallet-nis = { version = "38.0.0", default-features = false }
pallet-nomination-pools = { version = "35.0.0", default-features = false }
pallet-nomination-pools = { version = "35.0.2", default-features = false }
pallet-nomination-pools-benchmarking = { version = "36.0.0", default-features = false }
pallet-nomination-pools-runtime-api = { version = "33.0.0", default-features = false }
pallet-nomination-pools-runtime-api = { version = "33.0.2", default-features = false }
pallet-offences = { version = "37.0.0", default-features = false }
pallet-offences-benchmarking = { version = "38.0.0", default-features = false }
pallet-parameters = { version = "0.9.0", default-features = false }
Expand Down
17 changes: 15 additions & 2 deletions relay/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ impl pallet_staking::Config for Runtime {
type HistoryDepth = frame_support::traits::ConstU32<84>;
type MaxControllersInDeprecationBatch = ConstU32<5169>;
type BenchmarkingConfig = polkadot_runtime_common::StakingBenchmarkingConfig;
type EventListeners = NominationPools;
type EventListeners = (NominationPools, DelegatedStaking);
type DisablingStrategy = pallet_staking::UpToLimitDisablingStrategy;
type WeightInfo = weights::pallet_staking::WeightInfo<Runtime>;
}
Expand Down Expand Up @@ -1626,7 +1626,8 @@ impl pallet_nomination_pools::Config for Runtime {
type RewardCounter = FixedU128;
type BalanceToU256 = BalanceToU256;
type U256ToBalance = U256ToBalance;
type StakeAdapter = pallet_nomination_pools::adapter::TransferStake<Self, Staking>;
type StakeAdapter =
pallet_nomination_pools::adapter::DelegateStake<Self, Staking, DelegatedStaking>;
type PostUnbondingPoolsWindow = ConstU32<4>;
type MaxMetadataLen = ConstU32<256>;
// we use the same number of allowed unlocking chunks as with staking.
Expand Down Expand Up @@ -1841,6 +1842,13 @@ impl Get<Perbill> for NominationPoolsMigrationV4OldPallet {
}
}

parameter_types! {
// This is used to limit max pools that migrates in the runtime upgrade. This is set to
// ~existing_pool_count * 2 to also account for any new pools getting created before the
// migration is actually executed.
pub const MaxPoolsToMigrate: u32 = 500;
}

/// All migrations that will run on the next runtime upgrade.
///
/// This contains the combined migrations of the last 10 releases. It allows to skip runtime
Expand All @@ -1859,6 +1867,11 @@ pub mod migrations {
parachains_inclusion::migration::MigrateToV1<Runtime>,
parachains_on_demand::migration::MigrateV0ToV1<Runtime>,
restore_corrupted_ledgers::Migrate<Runtime>,
// Migrate NominationPools to `DelegateStake` adapter. This is an unversioned upgrade.
pallet_nomination_pools::migration::unversioned::DelegationStakeMigration<
Runtime,
MaxPoolsToMigrate,
>,
);

/// Migrations/checks that do not need to be versioned and can run on every update.
Expand Down

0 comments on commit 59802a1

Please sign in to comment.