-
Notifications
You must be signed in to change notification settings - Fork 689
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
[Staking] Runtime api if era rewards are pending to be claimed #4301
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
prdoc/pr_4301.prdoc
Outdated
title: New runtime api to check if a validator has pending pages of rewards for an era. | ||
|
||
doc: | ||
- audience: Node Dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- audience: Node Dev | |
- audience: Node Dev | Runtime Dev |
I think it is worth pursuing a new audience type here, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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) } ```
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? |
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) } ```
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`.
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.
…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) } ```
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