-
Notifications
You must be signed in to change notification settings - Fork 320
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
Populate EpochRewards with correct data #763
Populate EpochRewards with correct data #763
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #763 +/- ##
=======================================
Coverage 81.9% 81.9%
=======================================
Files 851 851
Lines 231504 231526 +22
=======================================
+ Hits 189731 189781 +50
+ Misses 41773 41745 -28 |
d4fd8a3
to
41b79a1
Compare
Rebased |
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.
One comment for now, will do another pass to look over test coverage later
41b79a1
to
f38764f
Compare
No changes in rebase aside from new last commit |
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.
Took another pass and it looks good! Just the last comment about the parent blockhash, though what you have is also correct
f38764f
to
d62bb56
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.
Sorry for the lateness, still catching up, but this looks good to me!
* Populate EpochRewards::parent_blockhash correctly * Populate EpochRewards::num_partitions correctly * Add new internal struct to be extended * Add CalculateValidatorRewardsResult::total_points * Add PartitionedRewardsCalculation::total_points * Add CalculateRewardsAndDistributeVoteRewardsResult::total_points * Populate EpochRewards::total_points correctly * Nit: reorder fields to match struct definition * Use Self::last_blockhash() to get parent_blockhash
Problem
Bank::begin_partitioned_rewards()
creates the EpochRewards sysvar with 3 default values, even though the data is all available at or after calculation.Summary of Changes
Populate the remainder of EpochRewards with real data. Namely, these fields:
parent_blockhash
,num_partitions
, andtotal_points
.Exposing
total_points
requires an unfortunate amount of helper-struct plumbing, with the currentcalculation
architecture. We could look at refactoring this, perhaps as part of the recalculation work.✅ Rebased
Sadly, because this touches the same dependency lists, this will have some dumb conflicts with #760. I'm happy to merge in either order.