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

Simd 118: extend EpochRewards sysvar #428

Merged
merged 8 commits into from
Mar 28, 2024

Conversation

CriesofCarrots
Copy link

@CriesofCarrots CriesofCarrots commented Mar 26, 2024

Problem

The new design for partitioned epoch rewards requires more data stored in the EpochRewards sysvar.

Summary of Changes

Update the sysvar: add new fields, specify the alignment, and update clone trait

This PR does not change any rewards calculation or distribution behavior. When enable_partitioned_epoch_reward feature gate is active, the sysvar is still populated during rewards calculation and destroyed at the end of distribution.
It turns out the distribution_complete_block_height field (which I removed) wasn't being used for anything...

@CriesofCarrots CriesofCarrots marked this pull request as ready for review March 26, 2024 23:46
joncinque
joncinque previously approved these changes Mar 27, 2024
Copy link

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Looks great! Just the the nit for the docs code

sdk/program/src/sysvar/epoch_rewards.rs Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.8%. Comparing base (30eecd6) to head (bab13f3).
Report is 19 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master     #428     +/-   ##
=========================================
- Coverage    81.9%    81.8%   -0.1%     
=========================================
  Files         840      841      +1     
  Lines      228107   228284    +177     
=========================================
+ Hits       186851   186940     +89     
- Misses      41256    41344     +88     

@CriesofCarrots CriesofCarrots merged commit ecb4f62 into anza-xyz:master Mar 28, 2024
47 checks passed
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.

3 participants