vote-program: deserialize, check initialized, then convert#8524
Merged
buffalojoec merged 7 commits intoanza-xyz:masterfrom Oct 17, 2025
Merged
Conversation
|
The Firedancer team maintains a line-for-line reimplementation of the |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #8524 +/- ##
=========================================
- Coverage 83.1% 83.1% -0.1%
=========================================
Files 849 849
Lines 368587 368644 +57
=========================================
+ Hits 306604 306649 +45
- Misses 61983 61995 +12 🚀 New features to boost your workflow:
|
jstarry
approved these changes
Oct 17, 2025
rustopian
pushed a commit
to rustopian/agave
that referenced
this pull request
Nov 20, 2025
…8524) * vote-program: refactor: move `verify_and_get_vote_state_handler` * vote-program: move voter authorized check out of helper * vote-program: rename helper to `get_vote_state_handler_checked` * vote-program: handler helper: deserialize as `VoteStateVersions` * vote-program: use the helper in all instructions except `InitializeAccount` * wrap new helper callsites to preserve old behavior * take 2 on helper preserve behavior
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
As per the amendment to SIMD-0185 in solana-foundation/solana-improvement-documents#369, when the vote state v4 feature gate is active, the Vote program must adjust the way it handles its "deserialize and convert" workflow.
With the vote state v4 feature disabled, a handful of program instructions call
VoteStateV3::deserialize, which coerces the underlying vote state to v3, before checking its initialization status. These instructions are:Authorize*UpdateValidatorIdentityUpdateCommissionWithdrawOnly when the vote state v4 feature is enabled should the behavior change to "deserialize -> check initialized -> convert", as per solana-foundation/solana-improvement-documents#369.
Summary of Changes
First, refactors the
verify_and_get_vote_state_handlerhelper to deserialize asVoteStateVersionsfirst, then check for initialization, then convert to v3 or v4.Then, configures instructions that did not previously call this helper (
Authorize*,UpdateValidatorIdentity,UpdateCommission,Withdraw) to conditionally call it based on the feature status.