Skip to content

vote-interface: rename VoteState to VoteStateV3#221

Merged
buffalojoec merged 2 commits into
anza-xyz:masterfrom
buffalojoec:deprecate-vote-state
Jul 11, 2025
Merged

vote-interface: rename VoteState to VoteStateV3#221
buffalojoec merged 2 commits into
anza-xyz:masterfrom
buffalojoec:deprecate-vote-state

Conversation

@buffalojoec
Copy link
Copy Markdown
Contributor

In preparation for introducing a new vote state (v4), this PR renames vote_state_v3::VoteState to vote_state_v3::VoteStateV3.

Normally, the module path could serve as the differentiator (ie. vote_state_v3::VoteState and vote_state_v3::VoteState), but that's brittle and we re-exported VoteState.

@joncinque I wanted to get your opinion on how best to handle this breaking change, as well as subsequent breaking changes to VoteStateVersions. We could introduce this change here as a minor release, where we mark the previous re-export as deprecated:

#[deprecated(..)]
pub use vote_state_v3::VoteStateV3 as VoteState;
pub use vote_state_v3::VoteStateV3;

However, since we plan to nuke VoteStateVersions, I wonder if the whole thing is ok to do in a major.

See #206

@buffalojoec buffalojoec requested a review from joncinque July 9, 2025 01:55
@buffalojoec buffalojoec mentioned this pull request Jul 9, 2025
Copy link
Copy Markdown
Collaborator

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Having done both in the past:

I think both are fine approaches, but as you point out, the bigger issue is the re-export of VoteState in state/mod.rs.

It would be good to first do the rename + re-export change as you suggested, backport to the v2.x branch, and then remove VoteState in master for the next breaking release.

I don't see how VoteStateVersions fits into the rename here, but it doesn't seem too important for this PR. Is that correct?

@buffalojoec
Copy link
Copy Markdown
Contributor Author

I don't see how VoteStateVersions fits into the rename here, but it doesn't seem too important for this PR. Is that correct?

I was alluding to the fact that everything we do to VoteStateVersions is also going to be a breaking change. So, I was wondering if it wasn't totally insane to just do all of the breakage in one major. There's not really a good deprecation strategy for adding a new variant to VoteStateVersions.

However, since the first change in Agave and likely most annoying breakage for everyone downstream is this rename, I agree with your points above.

@buffalojoec buffalojoec marked this pull request as ready for review July 10, 2025 02:11
Copy link
Copy Markdown
Collaborator

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Ah gotcha, yeah we can certainly remove VoteStateVersions in the next major release!

We should just deprecate it first, similar to what this PR is doing.

@buffalojoec buffalojoec merged commit 72ae3e2 into anza-xyz:master Jul 11, 2025
24 checks passed
@buffalojoec buffalojoec deleted the deprecate-vote-state branch July 11, 2025 03:10
@joncinque joncinque added the backport maintenance/v2.x Automatically creates a backport PR to `maintenance/v2.x` once the PR is closed label Jul 15, 2025
github-actions Bot pushed a commit that referenced this pull request Jul 15, 2025
* vote-interface: rename `VoteState` to `VoteStateV3`

* add deprecatio attr

(cherry picked from commit 72ae3e2)
buffalojoec added a commit that referenced this pull request Jul 15, 2025
…teStateV3` (#227)

vote-interface: rename `VoteState` to `VoteStateV3` (#221)

* vote-interface: rename `VoteState` to `VoteStateV3`

* add deprecatio attr

(cherry picked from commit 72ae3e2)

Co-authored-by: Joe C <jcaulfield135@gmail.com>
febo pushed a commit to febo/solana-sdk that referenced this pull request Sep 21, 2025
* vote-interface: rename `VoteState` to `VoteStateV3`

* add deprecatio attr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport maintenance/v2.x Automatically creates a backport PR to `maintenance/v2.x` once the PR is closed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants