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

Fix bug that processAccount operates on same epoch storage data for every epoch #110

Closed
0x-r4bbit opened this issue Sep 11, 2024 · 0 comments · Fixed by #112
Closed

Fix bug that processAccount operates on same epoch storage data for every epoch #110

0x-r4bbit opened this issue Sep 11, 2024 · 0 comments · Fixed by #112
Assignees
Milestone

Comments

@0x-r4bbit
Copy link
Collaborator

Something we've discovered recently.
There's a bug in the for loop we use in processAccount.
Namely this line:

https://github.com/logos-co/staking/blob/develop/contracts/StakeManager.sol#L444

Because we're doing the storage iEpoch = epochs[userEpoch] assignment inside of for (...) that assignment happens only once. Meaning for every iteration, we're updating the same epoch object.

Instead we need to update the storage pointer with every iteration.
The fix for this issue should include a test that proofs it's working as intended.

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

Successfully merging a pull request may close this issue.

2 participants