Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions proposals/0185-vote-account-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ title: Vote Account v4
authors: Justin Starry (Anza)
category: Standard
type: Core
status: Review
status: Accepted
created: 2024-10-17
feature: (fill in with feature tracking issues once accepted)
feature: Gx4XFcrVMt4HUvPzTpTSVkdDVgcDSjKhDN1RqRS6KDuZ
---

## Summary
Expand Down Expand Up @@ -144,10 +144,12 @@ pub struct VoteStateV4 {

All vote instructions MUST be updated to support deserializing v4 vote accounts.

Whenever a vote account is initialized OR modified by the vote program in a
transaction AND hasn't been updated to v4 yet, the account state MUST be saved
in the new format with the following default values for the new fields described
above:
All vote instructions besides `InitializeAccount` MUST be updated to deserialize
vote accounts in the following order:

1. Deserialize versioned vote state
1. Check for initialization or return `InstructionError::UninitializedAccount`
2. Convert to v4 with the following default values for the new fields:

```rust
VoteStateV4 {
Expand Down Expand Up @@ -184,13 +186,21 @@ other vote state versions, it's never stored with uninitialized state.

#### `UpdateCommission`

The existing `UpdateCommission` instruction will will continue to only update
the inflation rewards commission in integer percentage values.
The existing `UpdateCommission` instruction will continue to only update the
inflation rewards commission in integer percentage values.

The new commission value MUST be multiplied by `100` before being checked for
commission or increases and before being stored in the new
`inflation_rewards_commission_bps` field.

#### `UpdateValidatorIdentity`
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this after realizing that the validator identity might get unexpectedly out of sync with the block revenue collector after the feature gate for this SIMD is activated because there will not yet be a way for nodes to update the block revenue collector account. This sync behavior should probably be removed in #232, I will make amend that one too.


The existing `UpdateValidatorIdentity` instruction MUST also set the
`block_revenue_collector` field to the new node pubkey value in addition to the
`node_pubkey` field to keep the fields in sync until [SIMD-0232] adds the
ability to set the field explicitly.

When updating vote state v4 accounts, the new `inflation_rewards_commission_bps`
field should be used instead of the old generic `commission` field.
Additionally, the new commission value MUST be multiplied by `100` before being
checked for commission or increases and before being stored in account data.
[SIMD-0232]: https://github.com/solana-foundation/solana-improvement-documents/pull/232

#### `Authorize`, `AuthorizeChecked`, `AuthorizeWithSeed`, `AuthorizeCheckedWithSeed`

Expand Down
Loading