-
Notifications
You must be signed in to change notification settings - Fork 270
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
v2.0: SIMD-0118: fix total_rewards
for recalculation (backport of #2780)
#2794
Conversation
* Add new feature key * Wrap existing code with new feature * Extend test harness * Make test fail * Populate EpochRewards::total_rewards from PointValue * Remove superfluous struct field * Fixup tests (cherry picked from commit 4470f6d) # Conflicts: # programs/bpf_loader/src/syscalls/mod.rs # sdk/src/feature_set.rs
Cherry-pick of 4470f6d has failed:
To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
The Firedancer team maintains a line-for-line reimplementation of the |
This backport fixes a bug in partitioned epoch rewards that is currently affecting testnet; it is necessary for further rollout of the partitioned epoch rewards feature. |
Problem
A node that reboots from a snapshot that was created during the partitioned epoch reward period may diverge from the cluster. This is because the total rewards value currently stashed in the EpochRewards sysvar and used to populate PointValue in recalculation is the total lamports to actually be distributed:
agave/runtime/src/bank/partitioned_epoch_rewards/calculation.rs
Line 180 in 7e6399a
agave/runtime/src/bank/partitioned_epoch_rewards/calculation.rs
Line 566 in fff6257
In the initial calculation, however, this part of the PointValue is the total lamports available to be split/distributed. In a cluster with a diverse collection of stake accounts (like testnet), the lamports actually distributed is likely to be less than what is available, due to rounding to whole lamports. Different
PointValue::rewards
values may yield different calculated rewards.Summary of Changes
Populate
EpochRewards::total_rewards
from the calculatedPointValue::rewards
This is an automatic backport of pull request #2780 done by [Mergify](https://mergify.com).