vote-program: handler: add v4 variant#8178
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 #8178 +/- ##
========================================
Coverage 83.0% 83.0%
========================================
Files 827 827
Lines 362695 363056 +361
========================================
+ Hits 301233 301592 +359
- Misses 61462 61464 +2 🚀 New features to boost your workflow:
|
| VoteStateTargetVersion::V4 => { | ||
| let vote_state = | ||
| VoteStateV4::deserialize(vote_account.get_data(), vote_account.get_key())?; | ||
| TargetVoteState::V4(vote_state) | ||
| } |
There was a problem hiding this comment.
This is fine but the way we use deserialize_and_convert in verify_and_get_vote_state_handler is problematic. So let's keep that in mind for later
The implementation of VoteStateV4::deserialize for zeroed account data is not ideal. It will successfully deserialize into an uninitialized v1 and then convert to VoteStateV4::default() which will incorrectly be considered to be "initialized." Ideally we first deserialize VoteStateVersions here and then do the initialization check before converting to v4.
There was a problem hiding this comment.
Okay, covered in follow-up.
Co-authored-by: Justin Starry <justin.m.starry@gmail.com>
Problem
Building on the back of #8120, we need to outfit the
VoteStateHandlerwith support forVoteStateV4. As we do this, we want to make sure each implementation is 100% compatible with SIMD-0185.Summary of Changes
Adds the v4 variant to the
VoteStateHandlerand adds a bunch of unit tests for compatibility with SIMD-0185. Does not update the Vote program to use v4 yet.