-
Notifications
You must be signed in to change notification settings - Fork 197
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
sdk: Extract epoch-rewards crate #3338
Conversation
4764c48
to
20db643
Compare
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. |
Sent over |
20db643
to
68947fa
Compare
@febo can I get another approval here please? |
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.
Looks good - left a couple tiny queries.
sdk/epoch-rewards/src/lib.rs
Outdated
@@ -2,15 +2,27 @@ | |||
//! | |||
//! [sv]: https://docs.solanalabs.com/runtime/sysvars#epochrewards | |||
//! | |||
//! The sysvar ID is declared in [`sysvar::epoch_rewards`]. | |||
//! The sysvar ID is declared in [`solana_program::sysvar::epoch_rewards`]. |
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.
Should this be crate::sysvar
instead?
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.
Great catch, done!
sdk/epoch-rewards/src/lib.rs
Outdated
//! | ||
//! [`sysvar::epoch_rewards`]: crate::sysvar::epoch_rewards | ||
//! [`solana_program::sysvar::epoch_rewards`]: https://docs.rs/solana-program/latest/solana_program/sysvar/epoch_rewards/index.html |
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.
And here solana_epoch_rewards
with the updated docs link?
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.
We can use the local documentation when it's within the same crate thankfully, so I went with that
Problem
Almost all of the sysvars have been properly extracted into separate dependencies, but a few still remain. Epoch rewards is one of those, and thankfully, it's very simple.
Summary of changes
Just like the others, move files around. I went a little bolder with this one and made it no-std by default, since it really only requires std for the frozen-abi macro. Let me know how it looks!