From 73cf29a277d0196e387cc8f0b36d2652e4440b8a Mon Sep 17 00:00:00 2001 From: Ankan Date: Mon, 20 May 2024 16:11:07 +0200 Subject: [PATCH 1/5] bump pools and staking --- Cargo.toml | 6 +++--- relay/kusama/src/lib.rs | 4 ++++ relay/polkadot/src/lib.rs | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 37d5374525..931205d088 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -128,7 +128,7 @@ pallet-nft-fractionalization = { version = "11.0.0", default-features = false } pallet-nfts = { version = "23.0.0", default-features = false } pallet-nfts-runtime-api = { version = "15.0.0", default-features = false } pallet-nis = { version = "29.0.0", default-features = false } -pallet-nomination-pools = { version = "26.0.0", default-features = false } +pallet-nomination-pools = { version = "26.0.1", default-features = false } pallet-nomination-pools-benchmarking = { version = "27.0.0", default-features = false } pallet-nomination-pools-runtime-api = { version = "24.0.0", default-features = false } pallet-offences = { version = "28.0.0", default-features = false } @@ -143,10 +143,10 @@ pallet-scheduler = { version = "30.0.0", default-features = false } pallet-session = { version = "29.0.0", default-features = false } pallet-session-benchmarking = { version = "29.0.0", default-features = false } pallet-society = { version = "29.0.0", default-features = false } -pallet-staking = { version = "29.0.2", default-features = false } +pallet-staking = { version = "29.0.3", default-features = false } pallet-staking-reward-curve = { version = "11.0.0" } pallet-staking-reward-fn = { version = "20.0.0", default-features = false } -pallet-staking-runtime-api = { version = "15.0.0", default-features = false } +pallet-staking-runtime-api = { version = "15.0.1", default-features = false } pallet-state-trie-migration = { version = "30.0.0", default-features = false } pallet-sudo = { version = "29.0.0", default-features = false } pallet-timestamp = { version = "28.0.0", default-features = false } diff --git a/relay/kusama/src/lib.rs b/relay/kusama/src/lib.rs index e9e5370ca3..346af2f062 100644 --- a/relay/kusama/src/lib.rs +++ b/relay/kusama/src/lib.rs @@ -2565,6 +2565,10 @@ sp_api::impl_runtime_apis! { fn eras_stakers_page_count(era: sp_staking::EraIndex, account: AccountId) -> sp_staking::Page { Staking::api_eras_stakers_page_count(era, account) } + + fn pending_rewards(era: sp_staking::EraIndex, account: AccountId) -> bool { + Staking::api_pending_rewards(era, account) + } } impl sp_genesis_builder::GenesisBuilder for Runtime { diff --git a/relay/polkadot/src/lib.rs b/relay/polkadot/src/lib.rs index 0a34ccc385..d73ff7c2fb 100644 --- a/relay/polkadot/src/lib.rs +++ b/relay/polkadot/src/lib.rs @@ -2037,6 +2037,10 @@ sp_api::impl_runtime_apis! { fn eras_stakers_page_count(era: sp_staking::EraIndex, account: AccountId) -> sp_staking::Page { Staking::api_eras_stakers_page_count(era, account) } + + fn pending_rewards(era: sp_staking::EraIndex, account: AccountId) -> bool { + Staking::api_pending_rewards(era, account) + } } impl sp_transaction_pool::runtime_api::TaggedTransactionQueue for Runtime { From c3b0b72fe3ac8e954b8a45fe6d8fe77895a42160 Mon Sep 17 00:00:00 2001 From: Ankan Date: Mon, 20 May 2024 19:30:39 +0200 Subject: [PATCH 2/5] add to changelog --- CHANGELOG.md | 2 ++ Cargo.lock | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1547495505..e6dfad24ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Add `pallet-vesting` to Asset Hubs ([polkadot-fellows/runtimes#269](https://github.com/polkadot-fellows/runtimes/pull/269)) - Add Pay Salary Collectives test ([polkadot-fellows/runtimes#260](https://github.com/polkadot-fellows/runtimes/pull/260)) - Add `pallet-xcm::transfer_assets_using_type_and_then()` for complex asset transfers ([polkadot-fellows/runtimes#311](https://github.com/polkadot-fellows/runtimes/pull/311)) +- Add new staking runtime api to check if reward is pending for an era. - Handle extra consumer reference when pool is destroyed ([polkadot-fellows/runtimes#318](https://github.com/polkadot-fellows/runtimes/pull/318)) ### Removed @@ -28,6 +29,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Include patch to release stuck collator bonds ([polkadot-fellows/runtimes#289](https://github.com/polkadot-fellows/runtimes/pull/289)) - Safeguard pallet-balances against consumer ref underflow ([polkadot-fellows/runtimes#309](https://github.com/polkadot-fellows/runtimes/pull/309)) - Polkadot Bridge Hub: Unstuck Snowbridge ([polkadot-fellows/runtimes#313](https://github.com/polkadot-fellows/runtimes/pull/313)) +- Handle extra consumer reference when pool is destroyed. ([polkadot-fellows/runtimes#318](https://github.com/polkadot-fellows/runtimes/pull/318)) ## [1.2.3] 29.04.2024 diff --git a/Cargo.lock b/Cargo.lock index 98cd39b3c7..fecbd67910 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7897,9 +7897,9 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" -version = "26.0.0" +version = "26.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f14519c1c613d2f8c95c27015864c11a37969a23deeba9f6dbaff4276e1b81c" +checksum = "b62091305ec7426e71c3da2b0944c2df5a804109ee4d2e8f4fe34865e049f8ac" dependencies = [ "frame-support", "frame-system", @@ -8182,9 +8182,9 @@ dependencies = [ [[package]] name = "pallet-staking" -version = "29.0.2" +version = "29.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668b7d28c499f0d9f295fad26cf6c342472e21842e3b13bcaaac8536358b2d6c" +checksum = "061b00814eb794a40df4eca7972a7c67b26473cd85cc7c54f5816ae49ad6e11b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8228,9 +8228,9 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" -version = "15.0.0" +version = "15.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237d7b5a10cb6cba727c3e957fb241776302aa3cce589e6759ba53f50129c1a5" +checksum = "e47c73850103db30b61ef170107afe1ef0dab6905c495bd6dfb57b3c1dd81bc7" dependencies = [ "parity-scale-codec", "sp-api", From a03c34e9d58449214259ef202e4229f204fb66f1 Mon Sep 17 00:00:00 2001 From: Ankan Date: Mon, 20 May 2024 21:36:11 +0200 Subject: [PATCH 3/5] fix changelog --- CHANGELOG.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8000791782..e596cf73af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ Changelog for the runtimes governed by the Polkadot Fellowship. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [Unreleased] + +### Added + +- Add new staking runtime api to check if reward is pending for an era. - Handle extra consumer reference when pool is destroyed ([polkadot-fellows/runtimes#318](https://github.com/polkadot-fellows/runtimes/pull/318)) + +### Fixed + +- Handle extra erroneous consumer reference when a nomination pool is destroying. ([polkadot-fellows/runtimes#318](https://github.com/polkadot-fellows/runtimes/pull/318)) + ## [1.2.4] 20.05.2024 ### Changed @@ -17,7 +27,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Add Pay Salary Collectives test ([polkadot-fellows/runtimes#260](https://github.com/polkadot-fellows/runtimes/pull/260)) - Add `pallet-xcm::transfer_assets_using_type_and_then()` for complex asset transfers ([polkadot-fellows/runtimes#311](https://github.com/polkadot-fellows/runtimes/pull/311)) - The Ambassador Program ([polkadot-fellows/runtimes#291](https://github.com/polkadot-fellows/runtimes/pull/291)) -- Add new staking runtime api to check if reward is pending for an era. - Handle extra consumer reference when pool is destroyed ([polkadot-fellows/runtimes#318](https://github.com/polkadot-fellows/runtimes/pull/318)) ### Removed @@ -30,7 +39,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Include patch to release stuck collator bonds ([polkadot-fellows/runtimes#289](https://github.com/polkadot-fellows/runtimes/pull/289)) - Safeguard pallet-balances against consumer ref underflow ([polkadot-fellows/runtimes#309](https://github.com/polkadot-fellows/runtimes/pull/309)) - Polkadot Bridge Hub: Unstuck Snowbridge ([polkadot-fellows/runtimes#313](https://github.com/polkadot-fellows/runtimes/pull/313)) -- Handle extra consumer reference when pool is destroyed. ([polkadot-fellows/runtimes#318](https://github.com/polkadot-fellows/runtimes/pull/318)) ## [1.2.3] 29.04.2024 From 37cf266df39c7a50cdf55877f7eb7aef6b808a59 Mon Sep 17 00:00:00 2001 From: Ankan Date: Mon, 20 May 2024 21:37:11 +0200 Subject: [PATCH 4/5] fmt --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e596cf73af..f43576799d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,11 +8,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added -- Add new staking runtime api to check if reward is pending for an era. - Handle extra consumer reference when pool is destroyed ([polkadot-fellows/runtimes#318](https://github.com/polkadot-fellows/runtimes/pull/318)) +- Add new staking runtime api to check if reward is pending for an era ([polkadot-fellows/runtimes#318](https://github.com/polkadot-fellows/runtimes/pull/318)) ### Fixed -- Handle extra erroneous consumer reference when a nomination pool is destroying. ([polkadot-fellows/runtimes#318](https://github.com/polkadot-fellows/runtimes/pull/318)) +- Handle extra erroneous consumer reference when a nomination pool is destroying ([polkadot-fellows/runtimes#318](https://github.com/polkadot-fellows/runtimes/pull/318)) ## [1.2.4] 20.05.2024 From 7c2cafe8f942a1b63aaf188d43e8d44b66d7a89a Mon Sep 17 00:00:00 2001 From: Ankan Date: Mon, 20 May 2024 21:38:24 +0200 Subject: [PATCH 5/5] minor modification --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f43576799d..e88e80691e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added -- Add new staking runtime api to check if reward is pending for an era ([polkadot-fellows/runtimes#318](https://github.com/polkadot-fellows/runtimes/pull/318)) +- Staking runtime api to check if reward is pending for an era ([polkadot-fellows/runtimes#318](https://github.com/polkadot-fellows/runtimes/pull/318)) ### Fixed