Fix - Missing resize at loader-v1 deserialization with direct mapping#6994
Merged
Lichtso merged 1 commit intoanza-xyz:masterfrom Jul 17, 2025
Conversation
Lichtso
commented
Jul 16, 2025
| .ok_or(InstructionError::InvalidArgument)?; | ||
| // The redundant check helps to avoid the expensive data comparison if we can | ||
| match borrowed_account.can_data_be_resized(data.len()) { | ||
| match borrowed_account.can_data_be_resized(pre_len) { |
Author
There was a problem hiding this comment.
This is a non-functional change because data.len() == pre_len. Just for the sake of readability and consistency with the other three places here and in the aligned derserialization.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #6994 +/- ##
=========================================
- Coverage 83.2% 83.2% -0.1%
=========================================
Files 856 856
Lines 376882 376884 +2
=========================================
- Hits 313781 313770 -11
- Misses 63101 63114 +13 🚀 New features to boost your workflow:
|
LucasSte
approved these changes
Jul 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The original direct mapping implementation (solana-labs#28053) forgot to resize accounts at loader-v1 deserialization in the direct mapping enabled branch of the feature gate. Meaning the last CPI callee would be controlling the account size instead.
https://github.com/solana-labs/solana/pull/28053/files#diff-c53636d36ed15b806b0a727e1e5ab040475674798ddf036903133dc1447c45b4R365 is where the
elsebranch should have been.Summary of Changes
Adds the missing resize logic and adjusts
test_cpi_account_data_updates.