Skip to content
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

fix: don't claim already claimed rewards #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mkaczanowski
Copy link

This PR fixes the issue where script "ignores" the ledger.claimedRewards and executes transactions for eras that have been already claimed.

for ( let i = 1; i <= numOfPotentialUnclaimedPayouts; i++) {
const idx = lastReward + i;
if (claimedRewards.includes(idx)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @mkaczanowski, thanks for the PR.
Could you elaborate a bit on why this would be necessary ? shouldn't the "validatorInfo.lastReward" be enough, why do you think it is not trustable ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, iirc (I made this PR a while ago) the validatorInfo.lastReward is not sufficient if you run with the deepCheck. It's fairly simple to repro this issue:

  1. set deepcheck to true
  2. start payouts and see that TXes will be created for the eras that have already been paid.

from what I see by quickly skimming through the code the deep check will make the payouts start prior to the validatorInfo.lastReward, thus create TXes that can only be rejected/fail.

This case never really worked even in the original repo:
github.com/w3f/polkadot-payouts

and I remember applying the same fix (among others I haven't published). But I would instead merge everything I have upstream :)

@vchong
Copy link

vchong commented Apr 30, 2024

@ironoa is this done in #50 (for polkadot-js/api#5859)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants