You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After deploying some version of the staking system, we've uncovered a bug that rewards are calculated incorrectly when staking and unstaking.
The issue relies in the fact that, when the rewardsBalanceOf gets the newRewardIndex, the account.rewardIndex is possibly as big, which results a reward index delta of 0.
That in turn resets the rewards to 0 until some time passes.
We need to revisit that and ensure that we set the account.rewardIndex correctly when stake and unstake is called
The text was updated successfully, but these errors were encountered:
After deploying some version of the staking system, we've uncovered a bug that rewards are calculated incorrectly when staking and unstaking.
The issue relies in the fact that, when the
rewardsBalanceOf
gets thenewRewardIndex
, theaccount.rewardIndex
is possibly as big, which results a reward index delta of0
.That in turn resets the rewards to
0
until some time passes.We need to revisit that and ensure that we set the
account.rewardIndex
correctly whenstake
andunstake
is calledThe text was updated successfully, but these errors were encountered: