-
Notifications
You must be signed in to change notification settings - Fork 331
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
remove solana-sdk from solana-timings #3731
Conversation
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.
Lines 206 to 213 in 86a7062
/// Convenience macro for `AddAssign` with saturating arithmetic. | |
/// Replace by `std::num::Saturating` once stable | |
#[macro_export] | |
macro_rules! saturating_add_assign { | |
($i:expr, $v:expr) => {{ | |
$i = $i.saturating_add($v) | |
}}; | |
} |
Saturating is stable as of 1.74.0:
https://doc.rust-lang.org/std/num/struct.Saturating.html
So, I think I'd prefer to see us update to use Saturating<T>
in solana-timings
instead of shifting the macro + depending on the new crate
Certainly out of scope for this PR, but replacing all instances of saturating_add_assign!
with Saturating<T>
would be nice too
The Firedancer team maintains a line-for-line reimplementation of the |
@steviez done. I regret doing this because it looked like a small change at first |
After I commented, I started making the change as well and then also realized it went a lot further than just |
b9f4cb8
to
558f5b2
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.
Apologies on the delayed review, but this LGTM! Tedious work but the right move long term.
Looks like we need a review from @anza-xyz/svm too; I'll try to poke someone from there too
Problem
This crate can compile faster without
solana-sdk
Summary of Changes
solana-pubkey
instead ofsolana_sdk::pubkey
saturating_add_assign
crate instead ofsolana_sdk::saturating_add_assign
. I copied this macro fromsolana-sdk
and published it in a standalone crate. I did this because it seems silly to include this in the normal Agave publishing workflow when this crate will probably never change. For that reason I also pinned the version to "=1.0.0".That said, I would make no objection to just copy-pasting the macro into solana-timings and other crates