This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Unlimited number of nominators eligible for Rewards payout (rebased)#13497
Closed
Unlimited number of nominators eligible for Rewards payout (rebased)#13497
Conversation
…ard points to claim
14510a0 to
b4abd8a
Compare
Contributor
Author
|
bot rebase |
|
Branch is already up-to-date |
Open
2 tasks
Contributor
Author
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 paritytech/polkadot-sdk#439 and paritytech/polkadot-sdk#473.
polkadot companion: paritytech/polkadot#6765.
Context
Rewards payout is processed today in a single block and limited to
MaxNominatorRewardedPerValidator. This number is currently512on both Kusama and Polkadot.This PR tries to scale the nominators payout to an unlimited count in a multi-block fashion. Exposures are stored in pages, with each page capped to a certain number. Practically, this number would be the same as
MaxNominatorRewardedPerValidatoror lower.The PR also intends to be mostly backward compatible.
Note about the release
This PR introduces a new storage item
MaxExposurePageCountwhich defaults to minimum value of1when not set. This means functionally, the pallet will continue to work exactly as before after this release. To enable paged rewards payout,MaxExposurePageCountcan be increased to a bigger number by OpenGov for each runtime separately.How payouts would look like after this change
Staking exposes two calls, 1) the existing
payout_stakersand 2)payout_stakers_by_page.payout_stakers
This remains backward compatible with no signature change. If for a given era a validator has multiple pages, they can call
payout_stakersmultiple times. The pages are executed in an ascending sequence and the runtime takes care of preventing double claims.payout_stakers_by_page
Very similar to
payout_stakersbut also accepts an extra parampage_index. An account can choose to payout rewards only for an explicitly passedpage.Lets look at an example scenario.
Given an active validator on Kusama had 1100 nominators,
MaxExposurePageCountset to 10 andMaxExposurePageSizeset to 512 for Erae. In order to pay out rewards to all nominators, the caller would need to callpayout_stakers3 times.payout_stakers(origin, stash, e)=> will pay the first 512 nominators.payout_stakers(origin, stash, e)=> will pay the second set of 512 nominators.payout_stakers(origin, stash, e)=> will pay the last set of 76 nominators....
payout_stakers(origin, stash, e) => calling it the 4th time would return an errorInvalidPage.The above calls can also be replaced by
payout_stakers_by_pageand passing a page explicitly.Important to note
Storage Changes
Added
ErasStakersOverviewClaimedRewardsErasStakersPagedDeprecated
The following can be cleaned up after 84 eras. Tracker issue for cleaning up.
ErasStakers.ErasStakersClipped.StakingLedger.claimed_rewards, renamed toStakingLedger.legacy_claimed_rewards.Config Changes
MaxNominatorRewardedPerValidatortoMaxExposurePageSize.MaxExposurePageCountTODO
MaxNominatorRewardedPerValidator->MaxExposurePageSize.Follow up issues