[Staking] Runtime api if era rewards are pending to be claimed#4301
Merged
Conversation
kianenigma
approved these changes
Apr 26, 2024
kianenigma
left a comment
Contributor
There was a problem hiding this comment.
How can we do even better, you might ask?
ask @TarikGul and @rossbulat to tell you in which places in their codebase they have to re-implement some formula of some sort and expose those as APIs as well.
kianenigma
reviewed
Apr 26, 2024
| title: New runtime api to check if a validator has pending pages of rewards for an era. | ||
|
|
||
| doc: | ||
| - audience: Node Dev |
Contributor
There was a problem hiding this comment.
Suggested change
| - audience: Node Dev | |
| - audience: Node Dev | Runtime Dev |
I think it is worth pursuing a new audience type here, wdyt?
Contributor
Author
There was a problem hiding this comment.
Added Runtime user which is defined in schema as Anyone using the runtime. This can be a token holder or a dev writing a front end for a chain.
3 tasks
Morganamilo
pushed a commit
that referenced
this pull request
May 2, 2024
closes #426. related to #1189. Would help offchain programs to query if there are unclaimed pages of rewards for a given era. The logic could look like below ```js // loop as long as all era pages are claimed. while (api.call.stakingApi.pendingRewards(era, validator_stash)) { api.tx.staking.payout_stakers(validator_stash, era) } ```
Member
|
This is awesome, I'll make sure this is supported in the API when ready. Do we know what runtime this will be apart of? |
Ank4n
added a commit
that referenced
this pull request
May 20, 2024
closes #426. related to #1189. Would help offchain programs to query if there are unclaimed pages of rewards for a given era. The logic could look like below ```js // loop as long as all era pages are claimed. while (api.call.stakingApi.pendingRewards(era, validator_stash)) { api.tx.staking.payout_stakers(validator_stash, era) } ```
Ank4n
added a commit
that referenced
this pull request
May 20, 2024
Backport of #4301 to polkadot-sdk 1.7.0. Expect patch `pallet-staking` from `29.0.2` to `29.0.3` and `pallet-staking-runtime-api` from `15.0.0` to `15.0.01`.
fellowship-merge-bot Bot
pushed a commit
to polkadot-fellows/runtimes
that referenced
this pull request
May 21, 2024
Changes: - Fixes the issue [preventing nomination pools from getting destroyed](paritytech/polkadot-sdk#4440). - Adds a new staking runtime api to Kusama and Polkadot to help with checking if era rewards are pending for a validator. Refer paritytech/polkadot-sdk#4301.
TarekkMA
pushed a commit
to moonbeam-foundation/polkadot-sdk
that referenced
this pull request
Aug 2, 2024
…ytech#4301) closes paritytech#426. related to paritytech#1189. Would help offchain programs to query if there are unclaimed pages of rewards for a given era. The logic could look like below ```js // loop as long as all era pages are claimed. while (api.call.stakingApi.pendingRewards(era, validator_stash)) { api.tx.staking.payout_stakers(validator_stash, era) } ```
This was referenced Aug 21, 2024
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #426.
related to #1189.
Would help offchain programs to query if there are unclaimed pages of rewards for a given era.
The logic could look like below