-
Notifications
You must be signed in to change notification settings - Fork 453
replace solana-inline-spl with spl-generic-token #5805
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
Conversation
pub static ref STATIC_IDS: Vec<Pubkey> = vec![ | ||
associated_token_account::id(), | ||
associated_token_account::program_v1_1_0::id(), | ||
token::id(), | ||
token::native_mint::id(), |
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.
this is a safe change because the only place this static is used is a for
loop for snapshot size reduction, and the old ata program account does not exist on mainnet. we removed this id and the old token program id from spl-generic-token
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.
btw - loop is for snapshot minimization not just reducing snapshot size.
It's a feature in ledger-tool, you can basically trim a full-sized snapshot down into only the accounts you need to replay a specific slot range.
pub use { | ||
solana_account_decoder_client_types::token::{ | ||
real_number_string, real_number_string_trimmed, TokenAccountType, UiAccountState, UiMint, | ||
UiMultisig, UiTokenAccount, UiTokenAmount, | ||
}, | ||
spl_generic_token::{is_known_spl_token_id, spl_token_ids}, | ||
}; |
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 pub use
these to avoid a breaking change because solana-account-decoder
is a crate that (unlike solana-inline-spl
) is very reasonable for downstream projects to include
hahaha... nevermind, maybe. i think the test failures are because of the bug i fixed in cc @apfitzge for status update (we are almost out of the woods now!) |
d8902dd
to
3d0b8a6
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5805 +/- ##
=========================================
- Coverage 83.0% 82.9% -0.1%
=========================================
Files 828 826 -2
Lines 375869 376464 +595
=========================================
+ Hits 312178 312438 +260
- Misses 63691 64026 +335 🚀 New features to boost your workflow:
|
fn update_spl_token_secondary_indexes<G: solana_inline_spl::token::GenericTokenAccount>( | ||
fn update_spl_token_secondary_indexes<G: spl_generic_token::token::GenericTokenAccount>( |
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.
@brooksprumo we talked about this in dms and agreed its fine from a consensus perspective since it only affects rpc but if you could sign off on this
specifically, the new token account parser is more strict and requires token accounts to have been initialized (ie initialized or frozen states). the changed tests show the effect this has. this is a straightforward bugfix, so this is correct to do, and correct to do with no feature gate if the secondary indexes are not used for runtime account loading
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 to me, thanks for the fix!
Problem
solana-inline-spl
is used to provide very minimal token parsing functionality for agave crates that cannot depend onspl-token
andspl-token-2022
. we need to use this functionality in svm, but the svm crate is being removed to its own repo. thus this functionality cannot live in either repoin addition
solana-inline-spl
is outdated compared to the copy-pasted version of the same code inspl-token-2022
. by localizing this functionality in one repo we can reduce duplication and ensure bugfixes happen in one placeSummary of Changes
remove
solana-inline-spl
and replace it withspl-generic-token
. this new crate has substantially improved functionality, for details see solana-program/libraries#70there may be opportunities to refactor some code in agave to eliminate some usage of
spl-token
andspl-token-2022
entirely, given the enhanced functionality. this pr, however, merely replaces all uses ofsolana-inline-spl
withspl-generic-token
as a drop-in replacement, because its purpose is to unblock #5588 which will unblock #4253 and finally enable simd83i take it for granted that removing
solana-inline-spl
in this way merely prevents new releases from ever being made, and anyone using it third party (although they shouldnt do that because its an internal crate) will not be broken until we take agave to 3.0. but worth pinging relengNOTE this should not be merged until https://github.com/solana-program/libraries requires code review to mergedone by jon