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
Adds migration for ParachainStaking AtStake to support auto-compound #1878
Conversation
…nbeam into nish-auto-compound-migrate
|
||
// remove up to 1000 candidates that did not produce any blocks for | ||
// the given round | ||
let _ = <AtStake<T>>::clear_prefix(paid_for_round, 1000, None); |
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.
We could use the value from TopSelected
but maybe we don't want an extra read. Alternatively, a constant for this would be good.
If we make our rounds longer, this problem should mostly go away (except for very poorly performing collators...)
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.
Yeah I struggled to find a constant for this value. But I don't get how increasing the round length would fix this issue, since we only read the points first, then the AtStake
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.
LGTM. I worry about the PoV, but I also trust our testing :)
…ing candidates without blocks from rewarded rounds (moonbeam-foundation#1878) * add migration for AtStake * add validations * add migrations to remove the stale AtStake entries before autoCompound migrations * better logs * fix AtStake not cleaned up for candidates not producing blocks * Allow fork test to start from the expected round index Co-authored-by: Crystalin <alan@purestake.com>
What does it do?
This PR adds the following migrations:
RemovePaidRoundsFromAtStake
- to remove any staleAtStake
entries relating to already paid-out rounds that had candidates that didn't produce any blocks.MigrateAtStakeAutoCompound
- migrates the snapshots for unpaid rounds forAtStake
instead of the on-the-fly-migration viaMigratedAtStake
storage.The fix for stale
AtStake
entries relating to already paid-out rounds that had candidates that didn't produce any blocks, is also included in this PR since it is a pre-requisite to avoid having to runRemovePaidRoundsFromAtStake
over and over again.What important points reviewers should know?
Is there something left for follow-up PRs?
What alternative implementations were considered?
Are there relevant PRs or issues in other repositories (Substrate, Polkadot, Frontier, Cumulus)?
What value does it bring to the blockchain users?