-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 bank new_from_field for epoch reward status #34992
Conversation
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.
Lgtm, thanks for fixing. I think we'll want to backport this to v1.18 too.
Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #34992 +/- ##
=======================================
Coverage 81.6% 81.6%
=======================================
Files 830 830
Lines 224897 224897
=======================================
+ Hits 183563 183576 +13
+ Misses 41334 41321 -13 |
* fix bank new_from_field for epoch reward status * fix bank serde test assert for epoch reward status --------- Co-authored-by: HaoranYi <[email protected]> (cherry picked from commit b1f8a89)
…34992) (#35002) Fix bank new_from_field for epoch reward status (#34992) * fix bank new_from_field for epoch reward status * fix bank serde test assert for epoch reward status --------- Co-authored-by: HaoranYi <[email protected]> (cherry picked from commit b1f8a89) Co-authored-by: HaoranYi <[email protected]>
isn't this tens of mb of duplicative data that could be trivially recovered upon snapshot load? |
Yes, if the snapshot is taken during a rewarding period. All rewards are serialized to the snapshot and deserialized into the bank upon loading. |
yes but what this is change is introducing, is totally duplicative of data that's already stored in a snapshot. we can just recover it at snapshot load. it's less than a slot's worth of work |
By recover do you mean recompute them? |
I think we can discuss in solana-foundation/solana-improvement-documents#116 instead, this PR is just for a bugfix. |
this pr should be reverted before we forget and ship it to some public cluster |
I don't understand why we can't ship this PR to public cluster. |
This should definitely not be reverted. It's a bugfix regardless of whether we ship snapshot changes or not. We only include epoch rewards status in the snapshot if the partitioned rewards feature is activated. |
Problem
We have a bug when reconstruct the
reward_status
on the bank from deserialized field.Bank
new_from_field
is not using deserialized epoch reward status from field to reconstruct the bank.This should have been caught by our tests. But unfortunately, there is a typo in the test, which didn't catch the bug.
Summary of Changes
Fixes #