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

unstake is not decrementing expiredMP properly when unstaking after account MP expired #128

Open
3esmit opened this issue Sep 23, 2024 · 0 comments
Assignees
Milestone

Comments

@3esmit
Copy link
Collaborator

3esmit commented Sep 23, 2024

Estimation of MPs are calculated by storing the values of mpPerEpoch and reducing them from StillToExpireMPs when the expiring epoch is reached.

Currently unstake is not updating the estimation storage properly, because it's reducing the MPPerEpoch when the expiring epoch didnt reached, which is correct, but it's always removing the StillToExpireMPs, and for only the Expiring Epoch, ignoring that it can be split into two epochs.

TODOs:

  • Proper verifications when decreasing StillToExpireMPs using recalculated values when epoch of expiration is not reached, so it reduces de StillToExpireMPs from the proper epochs.
  • Ignore decreasing StillToExpireMPs when expiration epoch is less than current epoch (finalize epoch already deleted them)
  • Tests to catch this issue
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

No branches or pull requests

2 participants