Skip to content

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

Description

@3esmit

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions