-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
5ee0986
to
9acac3a
Compare
There was a problem hiding this 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.
9fbdeef
to
972ec88
Compare
51fd919
to
3ac4257
Compare
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.