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

Sync state data on unstake #138

Merged
merged 8 commits into from
Jun 26, 2024
Merged

Sync state data on unstake #138

merged 8 commits into from
Jun 26, 2024

Conversation

amarinkovic
Copy link
Member

@amarinkovic amarinkovic commented Jun 20, 2024

A new variable stakingSynced keeps track of the last interval in which the staking data was synced for the staker. On the interval where staking was synced, _getStakingStateWithRewardsBalances uses the stake balance and stake boost directly from storage. On the intervals beyond the synced interval, the balance is accumulated and the boost is calculated incrementally.

@amarinkovic amarinkovic mentioned this pull request Jun 20, 2024
@amarinkovic amarinkovic changed the title Another fix for reward allocation Reward and totals adjustments on unstake Jun 24, 2024
@amarinkovic amarinkovic force-pushed the fix_reward_allocation_again branch from 5ee0986 to 9acac3a Compare June 24, 2024 13:00
@amarinkovic amarinkovic marked this pull request as ready for review June 24, 2024 13:02
@amarinkovic amarinkovic changed the title Reward and totals adjustments on unstake Another fix for reward and totals adjustments on unstake Jun 24, 2024
Copy link
Contributor

@kevin-fruitful kevin-fruitful left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new variable stakingSynced keeps track of the last interval in which the staking data was synced for the staker. On the interval where staking was synced, _getStakingStateWithRewardsBalances uses the stake balance and stake boost directly from storage. On the intervals beyond the synced interval, the balance is accumulated and the boost is calculated incrementally.

@amarinkovic amarinkovic force-pushed the fix_reward_allocation_again branch from 9fbdeef to 972ec88 Compare June 25, 2024 13:26
@amarinkovic amarinkovic force-pushed the fix_reward_allocation_again branch from 51fd919 to 3ac4257 Compare June 26, 2024 08:57
@amarinkovic amarinkovic changed the title Another fix for reward and totals adjustments on unstake Sync state data on unstake Jun 26, 2024
@amarinkovic amarinkovic merged commit dfa44f6 into dev Jun 26, 2024
4 checks passed
@amarinkovic amarinkovic deleted the fix_reward_allocation_again branch June 26, 2024 09:04
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