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
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: