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

sdk: Extract epoch-rewards crate #3338

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

joncinque
Copy link

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!

@joncinque joncinque added the v2.1 Backport to v2.1 branch label Oct 29, 2024
Copy link

mergify bot commented Oct 29, 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.

febo
febo previously approved these changes Oct 29, 2024
@joncinque
Copy link
Author

Sent over solana-epoch-rewards to anza-team -- @yihau, can you accept?

@joncinque joncinque removed the v2.1 Backport to v2.1 branch label Oct 30, 2024
@joncinque
Copy link
Author

@febo can I get another approval here please?

Copy link

@febo febo left a 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.

@@ -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`].
Copy link

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?

Copy link
Author

Choose a reason for hiding this comment

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

Great catch, done!

//!
//! [`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
Copy link

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?

Copy link
Author

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

@joncinque joncinque merged commit ccbe01d into anza-xyz:master Oct 30, 2024
52 checks passed
@joncinque joncinque deleted the extract-epoch-rewards branch October 30, 2024 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants