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

Move EpochRewardsHasher to solana-sdk #34934

Merged

Conversation

CriesofCarrots
Copy link
Contributor

Problem

EpochRewardsHasher will be needed by solana-rpc and downstream clients to find rewards for specific addresses. But right now, it's a private solana-runtime module and struct. cc #34773 (comment)

Summary of Changes

Move EpochRewardsHasher to solana-sdk and make pub
fn hash_rewards_into_partitions() remains in runtime because it is not needed outside of the runtime (this is the function that performs the actual partitioned rewards calculation). It also depends on bank::StakeRewards. Open to renaming the containing module, if having both a solana_runtime::epoch_rewards_hasher and a solana_sdk::epoch_rewards_hasher seems bad.

@CriesofCarrots CriesofCarrots added the v1.18 PRs that should be backported to v1.18 label Jan 24, 2024
Copy link
Contributor

mergify bot commented Jan 24, 2024

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.

t-nelson
t-nelson previously approved these changes Jan 24, 2024
Copy link
Contributor

@t-nelson t-nelson left a comment

Choose a reason for hiding this comment

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

:shipit:

runtime/src/epoch_rewards_hasher.rs Show resolved Hide resolved
@CriesofCarrots
Copy link
Contributor Author

Sorry, forgot to run cargo-for-all-lock-files.sh tree! Please re-✅

Copy link

codecov bot commented Jan 24, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (0d92254) 81.6% compared to head (a3f62d4) 81.6%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #34934   +/-   ##
=======================================
  Coverage    81.6%    81.6%           
=======================================
  Files         827      828    +1     
  Lines      224252   224252           
=======================================
+ Hits       183128   183135    +7     
+ Misses      41124    41117    -7     

@CriesofCarrots CriesofCarrots merged commit bbd1fd4 into solana-labs:master Jan 24, 2024
47 checks passed
mergify bot pushed a commit that referenced this pull request Jan 24, 2024
* Move EpochRewardsHasher to solana-sdk

* Cargo.lock

* Apparently we're allowing arithmetic_side_effects in all of runtime

* Move allow stmt to block instead of module

* Also allow in test mod

(cherry picked from commit bbd1fd4)
mergify bot added a commit that referenced this pull request Jan 25, 2024
…4939)

Move EpochRewardsHasher to solana-sdk (#34934)

* Move EpochRewardsHasher to solana-sdk

* Cargo.lock

* Apparently we're allowing arithmetic_side_effects in all of runtime

* Move allow stmt to block instead of module

* Also allow in test mod

(cherry picked from commit bbd1fd4)

Co-authored-by: Tyera <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1.18 PRs that should be backported to v1.18
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants