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 RewardsManager #42

Merged
merged 15 commits into from
Mar 5, 2024
Merged

Fix RewardsManager #42

merged 15 commits into from
Mar 5, 2024

Conversation

oliviera9
Copy link

@oliviera9 oliviera9 commented Mar 1, 2024

Two bugs:

  • calling registerRewardsForEpoch() multiple times with the same staker which did not vote in the target epoch would increase unclaimableAmountByEpoch indefinitely
  • a staker which voted in the target epoch may call registerRewardsForEpoch() and claimRewardByEpoch() repeatedly draining all funds.

A new mapping _stakerSeenByEpoch would track user registrations and avoid multiple registrations for the same epoch.

@oliviera9 oliviera9 changed the base branch from feat/v3 to test/dapp-test March 1, 2024 10:02
@Oghma Oghma force-pushed the fix/rewards-manager branch from ed974b8 to 3a0733d Compare March 1, 2024 14:16
Base automatically changed from test/dapp-test to feat/v3 March 1, 2024 14:19
@oliviera9 oliviera9 force-pushed the fix/rewards-manager branch 2 times, most recently from 5b49598 to 24d0736 Compare March 1, 2024 15:27
@Oghma Oghma force-pushed the fix/rewards-manager branch 2 times, most recently from da02c7b to a77cbee Compare March 1, 2024 15:42
@oliviera9 oliviera9 force-pushed the fix/rewards-manager branch from a77cbee to 95092b8 Compare March 1, 2024 17:26
@oliviera9 oliviera9 merged commit 568d5f3 into feat/v3 Mar 5, 2024
1 check passed
@oliviera9 oliviera9 deleted the fix/rewards-manager branch March 5, 2024 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants