Skip to content

Commit

Permalink
Move VoteTransaction to vote crate
Browse files Browse the repository at this point in the history
  • Loading branch information
carllin committed Feb 11, 2025
1 parent 522b46d commit fc171c8
Show file tree
Hide file tree
Showing 33 changed files with 249 additions and 332 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion core/benches/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use {
banking_trace::Channels,
validator::{BlockProductionMethod, TransactionStructure},
},
solana_vote_program::{vote_state::TowerSync, vote_transaction::new_tower_sync_transaction},
solana_vote::vote_transaction::new_tower_sync_transaction,
solana_vote_program::vote_state::TowerSync,
};

extern crate test;
Expand Down
5 changes: 2 additions & 3 deletions core/src/banking_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -888,9 +888,8 @@ mod tests {
transaction::{SanitizedTransaction, Transaction},
},
solana_streamer::socket::SocketAddrSpace,
solana_vote_program::{
vote_state::TowerSync, vote_transaction::new_tower_sync_transaction,
},
solana_vote::vote_transaction::new_tower_sync_transaction,
solana_vote_program::vote_state::TowerSync,
std::{
sync::atomic::{AtomicBool, Ordering},
thread::sleep,
Expand Down
5 changes: 2 additions & 3 deletions core/src/banking_stage/latest_unprocessed_votes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,8 @@ mod tests {
epoch_schedule::MINIMUM_SLOTS_PER_EPOCH, genesis_config::GenesisConfig, hash::Hash,
signature::Signer, system_transaction::transfer,
},
solana_vote_program::{
vote_state::TowerSync, vote_transaction::new_tower_sync_transaction,
},
solana_vote::vote_transaction::new_tower_sync_transaction,
solana_vote_program::vote_state::TowerSync,
std::{sync::Arc, thread::Builder},
};

Expand Down
3 changes: 2 additions & 1 deletion core/src/banking_stage/qos_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,8 @@ mod tests {
signature::{Keypair, Signer},
system_transaction,
},
solana_vote_program::{vote_state::TowerSync, vote_transaction},
solana_vote::vote_transaction,
solana_vote_program::vote_state::TowerSync,
std::sync::Arc,
};

Expand Down
3 changes: 2 additions & 1 deletion core/src/banking_stage/unprocessed_packet_batches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,8 @@ mod tests {
system_instruction, system_transaction,
transaction::Transaction,
},
solana_vote_program::{vote_state::TowerSync, vote_transaction},
solana_vote::vote_transaction,
solana_vote_program::vote_state::TowerSync,
};

fn simple_deserialized_packet() -> DeserializedPacket {
Expand Down
5 changes: 2 additions & 3 deletions core/src/banking_stage/unprocessed_transaction_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1005,9 +1005,8 @@ mod tests {
system_transaction,
transaction::Transaction,
},
solana_vote_program::{
vote_state::TowerSync, vote_transaction::new_tower_sync_transaction,
},
solana_vote::vote_transaction::new_tower_sync_transaction,
solana_vote_program::vote_state::TowerSync,
std::error::Error,
};

Expand Down
6 changes: 2 additions & 4 deletions core/src/cluster_info_vote_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,10 +749,8 @@ mod tests {
pubkey::Pubkey,
signature::{Keypair, Signature, Signer},
},
solana_vote_program::{
vote_state::{TowerSync, Vote, MAX_LOCKOUT_HISTORY},
vote_transaction,
},
solana_vote::vote_transaction,
solana_vote_program::vote_state::{TowerSync, Vote, MAX_LOCKOUT_HISTORY},
std::{
collections::BTreeSet,
iter::repeat_with,
Expand Down
9 changes: 3 additions & 6 deletions core/src/commitment_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,9 @@ mod tests {
},
solana_sdk::{account::Account, pubkey::Pubkey, signature::Signer},
solana_stake_program::stake_state,
solana_vote_program::{
vote_state::{
self, process_slot_vote_unchecked, TowerSync, VoteStateVersions,
MAX_LOCKOUT_HISTORY,
},
vote_transaction,
solana_vote::vote_transaction,
solana_vote_program::vote_state::{
self, process_slot_vote_unchecked, TowerSync, VoteStateVersions, MAX_LOCKOUT_HISTORY,
},
};

Expand Down
4 changes: 2 additions & 2 deletions core/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ use {
signature::Keypair,
slot_history::{Check, SlotHistory},
},
solana_vote::vote_account::VoteAccountsHashMap,
solana_vote::{vote_account::VoteAccountsHashMap, vote_transaction::VoteTransaction},
solana_vote_program::{
vote_error::VoteError,
vote_instruction,
vote_state::{
process_slot_vote_unchecked, BlockTimestamp, Lockout, TowerSync, Vote,
VoteState1_14_11, VoteStateUpdate, VoteTransaction, MAX_LOCKOUT_HISTORY,
VoteState1_14_11, VoteStateUpdate, MAX_LOCKOUT_HISTORY,
},
},
std::{
Expand Down
7 changes: 3 additions & 4 deletions core/src/consensus/tower1_14_11.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
use {
crate::consensus::{BlockhashStatus, SwitchForkDecision},
solana_sdk::{clock::Slot, pubkey::Pubkey},
solana_vote_program::vote_state::{
vote_state_1_14_11::VoteState1_14_11, BlockTimestamp, VoteTransaction,
},
solana_vote::vote_transaction::VoteTransaction,
solana_vote_program::vote_state::{vote_state_1_14_11::VoteState1_14_11, BlockTimestamp},
};

#[cfg_attr(
feature = "frozen-abi",
derive(AbiExample),
frozen_abi(digest = "6Z9SDTJAihx2mVbdcifTvNN96keT4DyJ9BKGazgVUkzD")
frozen_abi(digest = "CV9vH427g44yTRqdcCMB8ZToWbm19enEd87x7Fif9JNf")
)]
#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)]
pub struct Tower1_14_11 {
Expand Down
4 changes: 2 additions & 2 deletions core/src/consensus/tower_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,9 @@ pub mod test {
BlockhashStatus, Tower,
},
solana_sdk::{hash::Hash, signature::Keypair},
solana_vote::vote_transaction::VoteTransaction,
solana_vote_program::vote_state::{
BlockTimestamp, LandedVote, Vote, VoteState, VoteState1_14_11, VoteTransaction,
MAX_LOCKOUT_HISTORY,
BlockTimestamp, LandedVote, Vote, VoteState, VoteState1_14_11, MAX_LOCKOUT_HISTORY,
},
tempfile::TempDir,
};
Expand Down
8 changes: 3 additions & 5 deletions core/src/replay_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ use {
transaction::Transaction,
},
solana_timings::ExecuteTimings,
solana_vote_program::vote_state::VoteTransaction,
solana_vote::vote_transaction::VoteTransaction,
std::{
collections::{HashMap, HashSet},
num::NonZeroUsize,
Expand Down Expand Up @@ -4331,10 +4331,8 @@ pub(crate) mod tests {
solana_streamer::socket::SocketAddrSpace,
solana_tpu_client::tpu_client::{DEFAULT_TPU_CONNECTION_POOL_SIZE, DEFAULT_VOTE_USE_QUIC},
solana_transaction_status::VersionedTransactionWithStatusMeta,
solana_vote_program::{
vote_state::{self, TowerSync, VoteStateVersions},
vote_transaction,
},
solana_vote::vote_transaction,
solana_vote_program::vote_state::{self, TowerSync, VoteStateVersions},
std::{
fs::remove_dir_all,
iter,
Expand Down
6 changes: 2 additions & 4 deletions core/src/vote_simulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ use {
},
},
solana_sdk::{clock::Slot, hash::Hash, pubkey::Pubkey, signature::Signer},
solana_vote_program::{
vote_state::{process_vote_unchecked, Lockout, TowerSync},
vote_transaction,
},
solana_vote::vote_transaction,
solana_vote_program::vote_state::{process_vote_unchecked, Lockout, TowerSync},
std::{
collections::{HashMap, HashSet, VecDeque},
sync::{Arc, RwLock},
Expand Down
1 change: 1 addition & 0 deletions cost-model/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ solana-svm-transaction = { workspace = true }
solana-system-interface = { workspace = true }
solana-transaction = { workspace = true, optional = true }
solana-transaction-error = { workspace = true }
solana-vote = { workspace = true }
solana-vote-program = { workspace = true }

[lib]
Expand Down
3 changes: 2 additions & 1 deletion cost-model/src/transaction_cost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ mod tests {
solana_reserved_account_keys::ReservedAccountKeys,
solana_runtime_transaction::runtime_transaction::RuntimeTransaction,
solana_transaction::{sanitized::MessageHash, versioned::VersionedTransaction},
solana_vote_program::{vote_state::TowerSync, vote_transaction},
solana_vote::vote_transaction,
solana_vote_program::vote_state::TowerSync,
};

#[test]
Expand Down
3 changes: 2 additions & 1 deletion gossip/src/crds_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ mod test {
timing::timestamp,
vote::state::TowerSync,
},
solana_vote_program::{vote_state::Lockout, vote_transaction::new_tower_sync_transaction},
solana_vote::vote_transaction::new_tower_sync_transaction,
solana_vote_program::vote_state::Lockout,
std::str::FromStr,
};

Expand Down
3 changes: 1 addition & 2 deletions ledger/src/blockstore_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2411,11 +2411,10 @@ pub mod tests {
transaction_processing_result::ProcessedTransaction,
transaction_processor::ExecutionRecordingConfig,
},
solana_vote::vote_account::VoteAccount,
solana_vote::{vote_account::VoteAccount, vote_transaction},
solana_vote_program::{
self,
vote_state::{TowerSync, VoteState, VoteStateVersions, MAX_LOCKOUT_HISTORY},
vote_transaction,
},
std::{collections::BTreeSet, slice, sync::RwLock},
test_case::{test_case, test_matrix},
Expand Down
4 changes: 2 additions & 2 deletions local-cluster/src/cluster_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ use {
},
solana_streamer::socket::SocketAddrSpace,
solana_tpu_client::tpu_client::{TpuClient, TpuClientConfig, TpuSenderError},
solana_vote::vote_transaction::VoteTransaction,
solana_vote_program::{vote_state::TowerSync, vote_transaction},
solana_vote::vote_transaction::{self, VoteTransaction},
solana_vote_program::vote_state::TowerSync,
std::{
collections::{HashMap, HashSet, VecDeque},
net::{SocketAddr, TcpListener},
Expand Down
4 changes: 2 additions & 2 deletions local-cluster/tests/local_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ use {
broadcast_duplicates_run::{BroadcastDuplicatesConfig, ClusterPartition},
BroadcastStageType,
},
solana_vote::vote_parser,
solana_vote_program::{vote_state::MAX_LOCKOUT_HISTORY, vote_transaction},
solana_vote::{vote_parser, vote_transaction},
solana_vote_program::vote_state::MAX_LOCKOUT_HISTORY,
std::{
collections::{BTreeSet, HashMap, HashSet},
fs,
Expand Down
2 changes: 2 additions & 0 deletions perf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ solana-system-interface = { workspace = true, optional = true }
solana-system-transaction = { workspace = true, optional = true }
solana-time-utils = { workspace = true }
solana-transaction = { workspace = true, optional = true }
solana-vote = { workspace = true, optional = true }
solana-vote-program = { workspace = true, optional = true }

[target."cfg(target_os = \"linux\")".dependencies]
Expand All @@ -69,6 +70,7 @@ dev-context-only-utils = [
"dep:solana-system-transaction",
"dep:solana-transaction",
"dep:solana-vote-program",
"dep:solana-vote",
]
frozen-abi = [
"dep:solana-frozen-abi",
Expand Down
3 changes: 2 additions & 1 deletion perf/src/test_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ use {
solana_signer::Signer,
solana_system_interface::instruction::SystemInstruction,
solana_transaction::Transaction,
solana_vote_program::{vote_state::TowerSync, vote_transaction},
solana_vote::vote_transaction,
solana_vote_program::vote_state::TowerSync,
};

pub fn test_tx() -> Transaction {
Expand Down
4 changes: 4 additions & 0 deletions programs/sbf/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions programs/vote/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

pub mod vote_processor;
pub mod vote_state;
pub mod vote_transaction;

#[cfg_attr(feature = "metrics", macro_use)]
#[cfg(feature = "metrics")]
extern crate solana_metrics;

#[cfg_attr(feature = "frozen-abi", macro_use)]
#[cfg(feature = "frozen-abi")]
extern crate solana_frozen_abi_macro;

Expand Down
Loading

0 comments on commit fc171c8

Please sign in to comment.