Skip to content
Closed
Show file tree
Hide file tree
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
2,667 changes: 1,220 additions & 1,447 deletions Cargo.lock

Large diffs are not rendered by default.

95 changes: 95 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -677,3 +677,98 @@ crossbeam-epoch = { git = "https://github.com/anza-xyz/crossbeam", rev = "fd279d
# comments and the overrides in sync.
solana-curve25519 = { path = "curves/curve25519" }
solana-zk-sdk = { path = "zk-sdk" }

solana-account = { path = "../sdk/account" }
solana-account-info = { path = "../sdk/account-info" }
solana-address-lookup-table-interface = { path = "../sdk/address-lookup-table-interface" }
solana-atomic-u64 = { path = "../sdk/atomic-u64" }
solana-big-mod-exp = { path = "../sdk/big-mod-exp" }
solana-bincode = { path = "../sdk/bincode" }
solana-blake3-hasher = { path = "../sdk/blake3-hasher" }
solana-bn254 = { path = "../sdk/bn254" }
solana-borsh = { path = "../sdk/borsh" }
solana-client-traits = { path = "../sdk/client-traits" }
solana-clock = { path = "../sdk/clock" }
solana-cluster-type = { path = "../sdk/cluster-type" }
solana-commitment-config = { path = "../sdk/commitment-config" }
solana-compute-budget-interface = { path = "../sdk/compute-budget-interface" }
solana-cpi = { path = "../sdk/cpi" }
solana-define-syscall = { path = "../sdk/define-syscall" }
solana-derivation-path = { path = "../sdk/derivation-path" }
solana-ed25519-program = { path = "../sdk/ed25519-program" }
solana-epoch-info = { path = "../sdk/epoch-info" }
solana-epoch-rewards = { path = "../sdk/epoch-rewards" }
solana-epoch-rewards-hasher = { path = "../sdk/epoch-rewards-hasher" }
solana-epoch-schedule = { path = "../sdk/epoch-schedule" }
solana-example-mocks = { path = "../sdk/example-mocks" }
solana-feature-gate-interface = { path = "../sdk/feature-gate-interface" }
solana-fee-calculator = { path = "../sdk/fee-calculator" }
solana-fee-structure = { path = "../sdk/fee-structure" }
solana-file-download = { path = "../sdk/file-download" }
solana-frozen-abi = { path = "../sdk/frozen-abi" }
solana-frozen-abi-macro = { path = "../sdk/frozen-abi-macro" }
solana-genesis-config = { path = "../sdk/genesis-config" }
solana-hard-forks = { path = "../sdk/hard-forks" }
solana-hash = { path = "../sdk/hash" }
solana-inflation = { path = "../sdk/inflation" }
solana-instruction = { path = "../sdk/instruction" }
solana-instructions-sysvar = { path = "../sdk/instructions-sysvar" }
solana-keccak-hasher = { path = "../sdk/keccak-hasher" }
solana-keypair = { path = "../sdk/keypair" }
solana-last-restart-slot = { path = "../sdk/last-restart-slot" }
solana-loader-v2-interface = { path = "../sdk/loader-v2-interface" }
solana-loader-v3-interface = { path = "../sdk/loader-v3-interface" }
solana-loader-v4-interface = { path = "../sdk/loader-v4-interface" }
solana-logger = { path = "../sdk/logger" }
solana-message = { path = "../sdk/message" }
solana-msg = { path = "../sdk/msg" }
solana-native-token = { path = "../sdk/native-token" }
solana-nonce = { path = "../sdk/nonce" }
solana-nonce-account = { path = "../sdk/nonce-account" }
solana-offchain-message = { path = "../sdk/offchain-message" }
solana-package-metadata = { path = "../sdk/package-metadata" }
solana-package-metadata-macro = { path = "../sdk/package-metadata-macro" }
solana-packet = { path = "../sdk/packet" }
solana-poh-config = { path = "../sdk/poh-config" }
solana-precompile-error = { path = "../sdk/precompile-error" }
solana-presigner = { path = "../sdk/presigner" }
solana-program = { path = "../sdk/program" }
solana-program-entrypoint = { path = "../sdk/program-entrypoint" }
solana-program-error = { path = "../sdk/program-error" }
solana-program-memory = { path = "../sdk/program-memory" }
solana-program-option = { path = "../sdk/program-option" }
solana-program-pack = { path = "../sdk/program-pack" }
solana-pubkey = { path = "../sdk/pubkey" }
solana-quic-definitions = { path = "../sdk/quic-definitions" }
solana-rent = { path = "../sdk/rent" }
solana-rent-collector = { path = "../sdk/rent-collector" }
solana-rent-debits = { path = "../sdk/rent-debits" }
solana-reward-info = { path = "../sdk/reward-info" }
solana-sanitize = { path = "../sdk/sanitize" }
solana-sdk = { path = "../sdk/sdk" }
solana-sdk-ids = { path = "../sdk/sdk-ids" }
solana-sdk-macro = { path = "../sdk/sdk-macro" }
solana-secp256k1-program = { path = "../sdk/secp256k1-program" }
solana-secp256k1-recover = { path = "../sdk/secp256k1-recover" }
solana-secp256r1-program = { path = "../sdk/secp256r1-program" }
solana-seed-derivable = { path = "../sdk/seed-derivable" }
solana-seed-phrase = { path = "../sdk/seed-phrase" }
solana-serde = { path = "../sdk/serde" }
solana-serde-varint = { path = "../sdk/serde-varint" }
solana-serialize-utils = { path = "../sdk/serialize-utils" }
solana-sha256-hasher = { path = "../sdk/sha256-hasher" }
solana-short-vec = { path = "../sdk/short-vec" }
solana-shred-version = { path = "../sdk/shred-version" }
solana-signature = { path = "../sdk/signature" }
solana-signer = { path = "../sdk/signer" }
solana-slot-hashes = { path = "../sdk/slot-hashes" }
solana-slot-history = { path = "../sdk/slot-history" }
solana-stable-layout = { path = "../sdk/stable-layout" }
solana-system-transaction = { path = "../sdk/system-transaction" }
solana-sysvar = { path = "../sdk/sysvar" }
solana-sysvar-id = { path = "../sdk/sysvar-id" }
solana-time-utils = { path = "../sdk/time-utils" }
solana-transaction = { path = "../sdk/transaction" }
solana-transaction-error = { path = "../sdk/transaction-error" }
solana-validator-exit = { path = "../sdk/validator-exit" }
solana-vote-interface = { path = "../sdk/vote-interface" }
2 changes: 1 addition & 1 deletion account-decoder/src/parse_account_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ mod test {

let vote_state = VoteState::default();
let mut vote_account_data: Vec<u8> = vec![0; VoteState::size_of()];
let versioned = VoteStateVersions::new_current(vote_state);
let versioned = VoteStateVersions::new_v3(vote_state);
VoteState::serialize(&versioned, &mut vote_account_data).unwrap();
let parsed = parse_account_data_v3(
&account_pubkey,
Expand Down
2 changes: 1 addition & 1 deletion account-decoder/src/parse_vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ mod test {
fn test_parse_vote() {
let vote_state = VoteState::default();
let mut vote_account_data: Vec<u8> = vec![0; VoteState::size_of()];
let versioned = VoteStateVersions::new_current(vote_state);
let versioned = VoteStateVersions::new_v3(vote_state);
VoteState::serialize(&versioned, &mut vote_account_data).unwrap();
let expected_vote_state = UiVoteState {
node_pubkey: Pubkey::default().to_string(),
Expand Down
10 changes: 5 additions & 5 deletions cli/tests/vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn test_vote_authorize_and_withdraw(compute_unit_price: Option<u64>) {
.get_account(&vote_account_keypair.pubkey())
.unwrap();
let vote_state: VoteStateVersions = vote_account.state().unwrap();
let authorized_withdrawer = vote_state.convert_to_current().authorized_withdrawer;
let authorized_withdrawer = vote_state.convert_to_v3().authorized_withdrawer;
assert_eq!(authorized_withdrawer, config.signers[0].pubkey());
let expected_balance = rpc_client
.get_minimum_balance_for_rent_exemption(VoteState::size_of())
Expand Down Expand Up @@ -118,7 +118,7 @@ fn test_vote_authorize_and_withdraw(compute_unit_price: Option<u64>) {
.get_account(&vote_account_keypair.pubkey())
.unwrap();
let vote_state: VoteStateVersions = vote_account.state().unwrap();
let authorized_withdrawer = vote_state.convert_to_current().authorized_withdrawer;
let authorized_withdrawer = vote_state.convert_to_v3().authorized_withdrawer;
assert_eq!(authorized_withdrawer, first_withdraw_authority.pubkey());

// Authorize vote account withdrawal to another signer with checked instruction
Expand Down Expand Up @@ -165,7 +165,7 @@ fn test_vote_authorize_and_withdraw(compute_unit_price: Option<u64>) {
.get_account(&vote_account_keypair.pubkey())
.unwrap();
let vote_state: VoteStateVersions = vote_account.state().unwrap();
let authorized_withdrawer = vote_state.convert_to_current().authorized_withdrawer;
let authorized_withdrawer = vote_state.convert_to_v3().authorized_withdrawer;
assert_eq!(authorized_withdrawer, withdraw_authority.pubkey());

// Withdraw from vote account
Expand Down Expand Up @@ -292,7 +292,7 @@ fn test_offline_vote_authorize_and_withdraw(compute_unit_price: Option<u64>) {
.get_account(&vote_account_keypair.pubkey())
.unwrap();
let vote_state: VoteStateVersions = vote_account.state().unwrap();
let authorized_withdrawer = vote_state.convert_to_current().authorized_withdrawer;
let authorized_withdrawer = vote_state.convert_to_v3().authorized_withdrawer;
assert_eq!(authorized_withdrawer, offline_keypair.pubkey());
let expected_balance = rpc_client
.get_minimum_balance_for_rent_exemption(VoteState::size_of())
Expand Down Expand Up @@ -369,7 +369,7 @@ fn test_offline_vote_authorize_and_withdraw(compute_unit_price: Option<u64>) {
.get_account(&vote_account_keypair.pubkey())
.unwrap();
let vote_state: VoteStateVersions = vote_account.state().unwrap();
let authorized_withdrawer = vote_state.convert_to_current().authorized_withdrawer;
let authorized_withdrawer = vote_state.convert_to_v3().authorized_withdrawer;
assert_eq!(authorized_withdrawer, withdraw_authority.pubkey());

// Withdraw from vote account offline
Expand Down
8 changes: 4 additions & 4 deletions core/src/commitment_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,27 +462,27 @@ mod tests {
process_slot_vote_unchecked(&mut vote_state1, 3);
process_slot_vote_unchecked(&mut vote_state1, 5);
if !with_node_vote_state {
let versioned = VoteStateVersions::new_current(vote_state1.clone());
let versioned = VoteStateVersions::new_v3(vote_state1.clone());
vote_state::to(&versioned, &mut vote_account1).unwrap();
bank.store_account(&pk1, &vote_account1);
}

let mut vote_state2 = vote_state::from(&vote_account2).unwrap();
process_slot_vote_unchecked(&mut vote_state2, 9);
process_slot_vote_unchecked(&mut vote_state2, 10);
let versioned = VoteStateVersions::new_current(vote_state2);
let versioned = VoteStateVersions::new_v3(vote_state2);
vote_state::to(&versioned, &mut vote_account2).unwrap();
bank.store_account(&pk2, &vote_account2);

let mut vote_state3 = vote_state::from(&vote_account3).unwrap();
vote_state3.root_slot = Some(1);
let versioned = VoteStateVersions::new_current(vote_state3);
let versioned = VoteStateVersions::new_v3(vote_state3);
vote_state::to(&versioned, &mut vote_account3).unwrap();
bank.store_account(&pk3, &vote_account3);

let mut vote_state4 = vote_state::from(&vote_account4).unwrap();
vote_state4.root_slot = Some(2);
let versioned = VoteStateVersions::new_current(vote_state4);
let versioned = VoteStateVersions::new_v3(vote_state4);
vote_state::to(&versioned, &mut vote_account4).unwrap();
bank.store_account(&pk4, &vote_account4);

Expand Down
4 changes: 2 additions & 2 deletions core/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ pub enum TowerVersions {
}

impl TowerVersions {
pub fn new_current(tower: Tower) -> Self {
pub fn new_v3(tower: Tower) -> Self {
Self::Current(tower)
}

Expand Down Expand Up @@ -1822,7 +1822,7 @@ pub mod test {
process_slot_vote_unchecked(&mut vote_state, *slot);
}
VoteState::serialize(
&VoteStateVersions::new_current(vote_state),
&VoteStateVersions::new_v3(vote_state),
account.data_as_mut_slice(),
)
.expect("serialize state");
Expand Down
2 changes: 1 addition & 1 deletion core/src/replay_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5169,7 +5169,7 @@ pub(crate) mod tests {
let mut leader_vote_account = bank.get_account(pubkey).unwrap();
let mut vote_state = vote_state::from(&leader_vote_account).unwrap();
vote_state::process_slot_vote_unchecked(&mut vote_state, vote_slot);
let versioned = VoteStateVersions::new_current(vote_state.clone());
let versioned = VoteStateVersions::new_v3(vote_state.clone());
vote_state::to(&versioned, &mut leader_vote_account).unwrap();
bank.store_account(pubkey, &leader_vote_account);
(*pubkey, TowerVoteState::from(vote_state))
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/blockstore_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4841,7 +4841,7 @@ pub mod tests {
vote_state.root_slot = Some(root);
let mut vote_account =
AccountSharedData::new(1, VoteState::size_of(), &solana_vote_program::id());
let versioned = VoteStateVersions::new_current(vote_state);
let versioned = VoteStateVersions::new_v3(vote_state);
VoteState::serialize(&versioned, vote_account.data_as_mut_slice()).unwrap();
(
solana_pubkey::new_rand(),
Expand Down
2 changes: 1 addition & 1 deletion ledger/src/staking_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ pub(crate) mod tests {
let vote_accounts = stakes.into_iter().map(|(stake, vote_state)| {
let account = AccountSharedData::new_data(
rng.gen(), // lamports
&VoteStateVersions::new_current(vote_state),
&VoteStateVersions::new_v3(vote_state),
&solana_vote_program::id(), // owner
)
.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion program-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ impl ProgramTestContext {
for _ in 0..number_of_credits {
vote_state.increment_credits(epoch, 1);
}
let versioned = VoteStateVersions::new_current(vote_state);
let versioned = VoteStateVersions::new_v3(vote_state);
vote_state::to(&versioned, &mut vote_account).unwrap();
bank.store_account(vote_account_address, &vote_account);
}
Expand Down
2 changes: 1 addition & 1 deletion programs/stake/benches/stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ fn bench_deactivate_delinquent(c: &mut Criterion) {
let reference_vote_address = Pubkey::new_unique();
let reference_vote_account = AccountSharedData::new_data_with_space(
1,
&VoteStateVersions::new_current(vote_state),
&VoteStateVersions::new_v3(vote_state),
VoteState::size_of(),
&solana_sdk_ids::vote::id(),
)
Expand Down
Loading
Loading