Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Nomination Pool Participation in Governance in Kusama #540

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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<
Copy link
Contributor

Choose a reason for hiding this comment

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

Fine if this is called multiple times?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it ignores pool if already migrated.

Runtime,
MaxPoolsToMigrate,
>,
);

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