replace solana-inline-spl with spl-generic-token#5805
replace solana-inline-spl with spl-generic-token#58052501babe merged 8 commits intoanza-xyz:masterfrom
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.
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.
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.
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.
@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.
Looks good to me, thanks for the fix!
Problem
solana-inline-splis used to provide very minimal token parsing functionality for agave crates that cannot depend onspl-tokenandspl-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-splis 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-spland 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-tokenandspl-token-2022entirely, given the enhanced functionality. this pr, however, merely replaces all uses ofsolana-inline-splwithspl-generic-tokenas 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-splin 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