Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate vote transaction #4732

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

carllin
Copy link

@carllin carllin commented Feb 1, 2025

Problem

vote transaction is duplicated, vote crate is unnecessary

Summary of Changes

Delete vote crate, move everything into vote-program

Fixes #

@carllin carllin requested review from ksn6 and AshwinSekar February 1, 2025 02:49
Copy link

mergify bot commented Feb 1, 2025

If this PR represents a change to the public RPC API:

  1. Make sure it includes a complementary update to rpc-client/ (example)
  2. Open a follow-up PR to update the JavaScript client @solana/web3.js (example)

Thank you for keeping the RPC clients in sync with the server API @carllin.

Copy link

mergify bot commented Feb 1, 2025

The Firedancer team maintains a line-for-line reimplementation of the
native programs, and until native programs are moved to BPF, those
implementations must exactly match their Agave counterparts.
If this PR represents a change to a native program implementation (not
tests), please include a reviewer from the Firedancer team. And please
keep refactors to a minimum.

@carllin carllin force-pushed the Cleanup branch 5 times, most recently from daebc96 to 8ee3099 Compare February 1, 2025 05:59
pub enum VoteTransaction {
Vote(Vote),
VoteStateUpdate(VoteStateUpdate),
TowerSync(TowerSync),
Copy link
Author

@carllin carllin Feb 1, 2025

Choose a reason for hiding this comment

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

Other program/vote/VoteTransaction has CompactVoteStateUpdate as third enum

Copy link

Choose a reason for hiding this comment

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

(likely need to include the serde macro as well for TowerSync)

@carllin carllin force-pushed the Cleanup branch 4 times, most recently from cbdf360 to 19938cb Compare February 1, 2025 07:11
Copy link

@AshwinSekar AshwinSekar left a comment

Choose a reason for hiding this comment

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

generally in support of this change, however it might break downstream so I would imagine we need to deprecate VoteTransaction first

vote/Cargo.toml Outdated
@@ -1,58 +0,0 @@
[package]
name = "solana-vote"

Choose a reason for hiding this comment

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

nice ya in support of this change.
This is a public crate though do we have to go through the process of deprecating it for a version and then deleting it in the next? or can we just break it

rpc/src/rpc_pubsub.rs Outdated Show resolved Hide resolved
programs/vote/src/vote_account.rs Outdated Show resolved Hide resolved
programs/vote/src/vote_account.rs Outdated Show resolved Hide resolved
programs/vote/src/vote_account.rs Outdated Show resolved Hide resolved
programs/vote/src/vote_account.rs Outdated Show resolved Hide resolved
programs/vote/src/vote_account.rs Outdated Show resolved Hide resolved
@carllin
Copy link
Author

carllin commented Feb 2, 2025

generally in support of this change, however it might break downstream so I would imagine we need to deprecate VoteTransaction first

Yup need to deprecate him, how does one go about doing that @joncinque @buffalojoec

@joncinque
Copy link

solana-vote shouldn't be included as part of the semver policy, so you should be good to just remove it. https://crates.io/crates/solana-vote/reverse_dependencies shows only solana- dependents

Copy link

mergify bot commented Feb 4, 2025

The Firedancer team maintains a line-for-line reimplementation of the
native programs, and until native programs are moved to BPF, those
implementations must exactly match their Agave counterparts.
If this PR represents a change to a native program implementation (not
tests), please include a reviewer from the Firedancer team. And please
keep refactors to a minimum.

@jstarry
Copy link

jstarry commented Feb 6, 2025

Lol this was fun to look into the history for:

In my mind, solana-vote should still exist to hold code for runtime related vote code. solana-vote-program should be used for clients constructing vote instructions and for clients deserializing onchain vote state. The runtime code doesn't belong there.

If we look at the modules you are moving into solana-vote-program, we have the vote_account module which is used for the stakes cache and the vote_parser module which is used by the runtime (banking stage and replay stage) to identify vote transactions to send to ClusterInfoVoteListener for consensus tracking. I'm also making a vote_state_view module for the stakes cache so that we no longer need to allocate memory to hold vote state info (we should access fields directly from the backing account data vec). All of this is only used by the runtime so it doesn't need to be put in the solana-vote-program crate that downstream users will use.

This PR should remove the duplicated VoteTransaction but leave solana-vote alone please!

@jstarry
Copy link

jstarry commented Feb 6, 2025

Sorry to clarify, I don't actually have any special love for the solana-vote crate, I just don't want runtime code in the solana-vote-program crate. If you kill solana-vote, move that code back into solana-runtime rather than in a client facing solana-vote-program crate or whatever solana-program/vote will be

@jstarry
Copy link

jstarry commented Feb 6, 2025

Oh I also just realized we have solana-vote-interface too which is actually the thing that has the vote instruction and state structs. solana-vote-program should just be the vote processing code then. And then solana-runtime or solana-vote should have the runtime related vote code.

@carllin
Copy link
Author

carllin commented Feb 7, 2025

vote_parser relies on VoteTransaction, so seems like we should pull VoteTransaction out of solana-program into solana-vote?

@jstarry
Copy link

jstarry commented Feb 7, 2025

Yeah it should live in solana-vote

@carllin carllin force-pushed the Cleanup branch 5 times, most recently from d1f97a0 to 60d788a Compare February 7, 2025 17:59
@carllin carllin force-pushed the Cleanup branch 2 times, most recently from 48ed3ee to 2d87baf Compare February 8, 2025 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants