osmosis
osmosis copied to clipboard
x/incentives: investigate `checkFinishDistribution`
Background
As of now checkFinishDistribution assumes that filled Epoch has not been incremented when this method has been called, thus checks that the specific gauge has finished by checking that number of epochs paid over is greater than filled epochs + 1. This calculation can be potentiall wrong, as we might have called this function having done operations for fiiled_epochs+1, which could be resulting not paying out the last epoch of rewards.
Further investigation and fixes are needed to confirm that this is not the case, OR if this is the case fixes are applied so that the last epoch of rewards are payed out.
Acceptance Criteria
- [ ] check if we are calling
checkFinishDistributionhaving incremented filled_epochs +1.- if this is the case, confirm that we are currently not paying out the last epoch
- introduce a fix for this bug
Hi sir @mattverse, I am handling this issue but confusing about your comment.
As now, I see that checkFinishDistributioncalled then filled epoch is increased (like the comment in this func) and then checking number of epochs paid over is small than or equal to filled epochs + 1 (difference from your comment).
Can you plz check this and make more explicit? Thanks
https://github.com/osmosis-labs/osmosis/blob/fcade39a82e8db7fbd984117407cde934a39761d/x/incentives/keeper/distribute.go#L375-L384