From 5aa669c2bedfcbaa7de88ed171c19e65432e6783 Mon Sep 17 00:00:00 2001 From: Ankan Date: Sun, 12 Jan 2025 17:48:13 +0100 Subject: [PATCH 1/3] enable delegate stake in kusama --- relay/kusama/src/lib.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index 5252cf8728..dd57c41838 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -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; } @@ -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; + type StakeAdapter = + pallet_nomination_pools::adapter::DelegateStake; type PostUnbondingPoolsWindow = ConstU32<4>; type MaxMetadataLen = ConstU32<256>; // we use the same number of allowed unlocking chunks as with staking. @@ -1841,6 +1842,13 @@ impl Get 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 @@ -1859,6 +1867,11 @@ pub mod migrations { parachains_inclusion::migration::MigrateToV1, parachains_on_demand::migration::MigrateV0ToV1, restore_corrupted_ledgers::Migrate, + // 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. From a55c3c918954ac4584d0d12a6f3416c61ff1bc9a Mon Sep 17 00:00:00 2001 From: Ankan Date: Sun, 12 Jan 2025 21:11:10 +0100 Subject: [PATCH 2/3] bump nomination pool --- CHANGELOG.md | 2 ++ Cargo.toml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ece124d38..d00fca3a64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/Cargo.toml b/Cargo.toml index de88d7c095..29a08e58ad 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 } From 6556c3b4f094e2b6de61864d3dcf3b421ca8c91d Mon Sep 17 00:00:00 2001 From: Ankan Date: Sun, 12 Jan 2025 21:41:45 +0100 Subject: [PATCH 3/3] update cargo lock --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5f7ef41203..484243bbc2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8659,9 +8659,9 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" -version = "35.0.0" +version = "35.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42906923f9f2b65b22f1211136b57c6878296ba6f6228a075c4442cc1fc1659" +checksum = "50d04f050ab02af6cbe058e101abb8706be7f8ea7958e5bf1d4cd8caa6b66c71" dependencies = [ "frame-support", "frame-system", @@ -8699,9 +8699,9 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" -version = "33.0.0" +version = "33.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9e1cb89cc2e6df06ce274a7fc814e5e688aad04c43902a10191fa3d2a56a96" +checksum = "03eea431eba0658ca763a078bd849e0622c37c85eddd011b8e886460b50c0827" dependencies = [ "pallet-nomination-pools", "parity-scale-codec",