SIMD-0266: Efficient Token program#6630
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6630 +/- ##
=========================================
- Coverage 82.8% 82.8% -0.1%
=========================================
Files 849 849
Lines 379373 379387 +14
=========================================
- Hits 314300 314280 -20
- Misses 65073 65107 +34 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Ship it, but not until after solana-foundation/solana-improvement-documents#266 is accepted and merged.
| if let Err(e) = self.upgrade_core_bpf_program( | ||
| &agave_feature_set::replace_spl_token_with_p_token::SPL_TOKEN_PROGRAM_ID, | ||
| &agave_feature_set::replace_spl_token_with_p_token::PTOKEN_PROGRAM_BUFFER, | ||
| "replace_spl_token_with_p_token", | ||
| ) { |
There was a problem hiding this comment.
I looked into this code, and we're going to have some problems. SPL Token isn't owned by the upgradeable loader, so we're going to fail most of the checks here:
duringupgrade_core_bpf_program.
We might need to create a new target for non-upgradeable programs, so that we update the program account to be a proper loader-v3 account.
Be sure to run an end-to-end test against a solana-test-validator built with this change to make sure that enabling the feature does the right thing.
There was a problem hiding this comment.
Good point! I think we need a new target – I will create a separate PR for it.
There was a problem hiding this comment.
Actually, we said that we would use Loader v4.
There was a problem hiding this comment.
Yeah this is a good call. I forgot this mechanism only supports loader v3. 😅
What you'll actually have to do is refactor the migration module a bit to go from a source-target design to a source-target-result design.
Source(ProgramV2 | ProgramV3 | ProgramV4 | Buffer),
Target(ProgramV2 | ProgramV3 | ProgramV4),
Result(ProgramV2 | ProgramV3 | ProgramV4 | null),It could end up being a bit of a slog. Lmk if you want my help!
|
Closed in favour of #7125 |
Problem
SIMD-0266 proposes to replace the current verion of SPL Token with p-token.
Summary of Changes
Add a feature to
agave-feature-setand its activation onbank.rs, which uses theupgrade_core_bpf_programto replace the SPL Token program data.