remove VoteState::deserialize() from sbf builds #30515
Merged
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 existing
VoteState::deserialize
implementation overruns the sbf stack and is unusable in a program context. unfortunately, all programs that importsolana_program
receive a stack size violation warning due to this, regardless of whether they attempt to use the functioncompiling spl-token 3.5.0 against solana-program 1.15.3:
Summary of Changes
gate the function implementation behind
#[cfg(not(target_os = "solana"))]
. this breaks no downstream consumers (because the function is not usable as-is) and fixes the warning for everyonewe can handroll a parser for this struct that works in a program context if/when one is required, i just wanted to get this in now that 1.16 exists and 1.15 needs to be stabilized
Fixes #30188