diff --git a/cli/tests/stake.rs b/cli/tests/stake.rs index 1196989572ce46..ab08867585b479 100644 --- a/cli/tests/stake.rs +++ b/cli/tests/stake.rs @@ -1468,7 +1468,7 @@ fn test_stake_split() { config.signers = vec![&default_signer]; let minimum_balance = rpc_client - .get_minimum_balance_for_rent_exemption(StakeStateV2::size_of()) + .get_minimum_balance_for_rent_exemption(StakeState::size_of()) .unwrap(); let mut config_offline = CliConfig::recent_for_tests(); @@ -1498,14 +1498,7 @@ fn test_stake_split() { check_balance!(1_000_000_000_000, &rpc_client, &offline_pubkey); // Create stake account, identity is authority -<<<<<<< HEAD - let stake_balance = rpc_client - .get_minimum_balance_for_rent_exemption(StakeState::size_of()) - .unwrap() - + 10_000_000_000; -======= let stake_balance = minimum_balance + 10_000_000_000; ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) let stake_keypair = keypair_from_seed(&[0u8; 32]).unwrap(); let stake_account_pubkey = stake_keypair.pubkey(); config.signers.push(&stake_keypair); diff --git a/programs/stake/src/stake_instruction.rs b/programs/stake/src/stake_instruction.rs index d1b8b3d23b6133..78f956c4a60878 100644 --- a/programs/stake/src/stake_instruction.rs +++ b/programs/stake/src/stake_instruction.rs @@ -561,7 +561,6 @@ mod tests { feature_set } -<<<<<<< HEAD /// The "old old" behavior is both before the stake minimum delegation was raised *and* before /// undelegated stake accounts could have zero lamports beyond rent fn feature_set_old_old_behavior() -> Arc { @@ -570,12 +569,12 @@ mod tests { .unwrap() .deactivate(&feature_set::stake_allow_zero_undelegated_amount::id()); feature_set -======= + } + fn feature_set_without_require_rent_exempt_split_destination() -> Arc { let mut feature_set = FeatureSet::all_enabled(); feature_set.deactivate(&feature_set::require_rent_exempt_split_destination::id()); Arc::new(feature_set) ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) } fn create_default_account() -> AccountSharedData { @@ -695,7 +694,7 @@ mod tests { ) -> u64 { let mut active_stake = 0; for account in stake_accounts { - if let StakeStateV2::Stake(_meta, stake, _stake_flags) = account.state().unwrap() { + if let StakeState::Stake(_meta, stake) = account.state().unwrap() { let stake_status = stake.delegation.stake_activating_and_deactivating( clock.epoch, Some(stake_history), @@ -4140,17 +4139,13 @@ mod tests { fn test_split_minimum_stake_delegation(feature_set: Arc) { let minimum_delegation = crate::get_minimum_delegation(&feature_set); let rent = Rent::default(); -<<<<<<< HEAD let rent_exempt_reserve = rent.minimum_balance(StakeState::size_of()); -======= - let rent_exempt_reserve = rent.minimum_balance(StakeStateV2::size_of()); let stake_history = StakeHistory::default(); let current_epoch = 100; let clock = Clock { epoch: current_epoch, ..Clock::default() }; ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) let source_address = Pubkey::new_unique(); let source_meta = Meta { rent_exempt_reserve, @@ -4158,15 +4153,9 @@ mod tests { }; let dest_address = Pubkey::new_unique(); let dest_account = AccountSharedData::new_data_with_space( -<<<<<<< HEAD - 0, + rent_exempt_reserve, &StakeState::Uninitialized, StakeState::size_of(), -======= - rent_exempt_reserve, - &StakeStateV2::Uninitialized, - StakeStateV2::size_of(), ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) &id(), ) .unwrap(); @@ -4200,45 +4189,10 @@ mod tests { Err(InstructionError::InsufficientFunds), ), ] { -<<<<<<< HEAD - // The source account's starting balance is equal to *both* the source and dest - // accounts' *final* balance - let mut source_starting_balance = source_reserve + dest_reserve; - for (delegation, source_stake_state) in &[ - (0, StakeState::Initialized(source_meta)), - ( - minimum_delegation, - just_stake( - source_meta, - minimum_delegation * 2 + source_starting_balance - rent_exempt_reserve, - ), - ), - ] { - source_starting_balance += delegation * 2; - let source_account = AccountSharedData::new_data_with_space( - source_starting_balance, - source_stake_state, - StakeState::size_of(), - &id(), - ) - .unwrap(); - process_instruction( - Arc::clone(&feature_set), - &serialize(&StakeInstruction::Split(dest_reserve + delegation)).unwrap(), - vec![ - (source_address, source_account), - (dest_address, dest_account.clone()), - (rent::id(), create_account_shared_data_for_test(&rent)), - ], - instruction_accounts.clone(), - expected_result.clone(), - ); - } -======= let source_account = AccountSharedData::new_data_with_space( source_delegation + rent_exempt_reserve, &just_stake(source_meta, source_delegation), - StakeStateV2::size_of(), + StakeState::size_of(), &id(), ) .unwrap(); @@ -4271,7 +4225,6 @@ mod tests { expected_active_stake, get_active_stake_for_tests(&accounts[0..2], &clock, &stake_history) ); ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) } } @@ -4288,17 +4241,13 @@ mod tests { fn test_split_full_amount_minimum_stake_delegation(feature_set: Arc) { let minimum_delegation = crate::get_minimum_delegation(&feature_set); let rent = Rent::default(); -<<<<<<< HEAD let rent_exempt_reserve = rent.minimum_balance(StakeState::size_of()); -======= - let rent_exempt_reserve = rent.minimum_balance(StakeStateV2::size_of()); let stake_history = StakeHistory::default(); let current_epoch = 100; let clock = Clock { epoch: current_epoch, ..Clock::default() }; ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) let source_address = Pubkey::new_unique(); let source_meta = Meta { rent_exempt_reserve, @@ -4485,17 +4434,13 @@ mod tests { ) { let minimum_delegation = crate::get_minimum_delegation(&feature_set); let rent = Rent::default(); -<<<<<<< HEAD let rent_exempt_reserve = rent.minimum_balance(StakeState::size_of()); -======= - let rent_exempt_reserve = rent.minimum_balance(StakeStateV2::size_of()); let stake_history = StakeHistory::default(); let current_epoch = 100; let clock = Clock { epoch: current_epoch, ..Clock::default() }; ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) let source_address = Pubkey::new_unique(); let destination_address = Pubkey::new_unique(); let instruction_accounts = vec![ @@ -4636,17 +4581,12 @@ mod tests { instruction_accounts.clone(), expected_result.clone(), ); -<<<<<<< HEAD - // For the expected OK cases, when the source's StakeState is Stake, then the - // destination's StakeState *must* also end up as Stake as well. Additionally, -======= assert_eq!( expected_active_stake, get_active_stake_for_tests(&accounts[0..2], &clock, &stake_history) ); - // For the expected OK cases, when the source's StakeStateV2 is Stake, then the - // destination's StakeStateV2 *must* also end up as Stake as well. Additionally, ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) + // For the expected OK cases, when the source's StakeState is Stake, then the + // destination's StakeState *must* also end up as Stake as well. Additionally, // check to ensure the destination's delegation amount is correct. If the // destination is already rent exempt, then the destination's stake delegation // *must* equal the split amount. Otherwise, the split amount must first be used to @@ -5125,13 +5065,9 @@ mod tests { #[test_case(feature_set_all_enabled(); "all_enabled")] fn test_split_more_than_staked(feature_set: Arc) { let rent = Rent::default(); -<<<<<<< HEAD let rent_exempt_reserve = rent.minimum_balance(StakeState::size_of()); -======= - let rent_exempt_reserve = rent.minimum_balance(StakeStateV2::size_of()); let stake_history = StakeHistory::default(); let current_epoch = 100; ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) let minimum_delegation = crate::get_minimum_delegation(&feature_set); let stake_lamports = (rent_exempt_reserve + minimum_delegation) * 2; let stake_address = solana_sdk::pubkey::new_rand(); @@ -5150,15 +5086,9 @@ mod tests { .unwrap(); let split_to_address = solana_sdk::pubkey::new_rand(); let split_to_account = AccountSharedData::new_data_with_space( -<<<<<<< HEAD - 0, + rent_exempt_reserve, &StakeState::Uninitialized, StakeState::size_of(), -======= - rent_exempt_reserve, - &StakeStateV2::Uninitialized, - StakeStateV2::size_of(), ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) &id(), ) .unwrap(); @@ -5209,17 +5139,13 @@ mod tests { #[test_case(feature_set_all_enabled(); "all_enabled")] fn test_split_with_rent(feature_set: Arc) { let rent = Rent::default(); -<<<<<<< HEAD let rent_exempt_reserve = rent.minimum_balance(StakeState::size_of()); -======= - let rent_exempt_reserve = rent.minimum_balance(StakeStateV2::size_of()); let stake_history = StakeHistory::default(); let current_epoch = 100; let clock = Clock { epoch: current_epoch, ..Clock::default() }; ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) let minimum_delegation = crate::get_minimum_delegation(&feature_set); let stake_address = solana_sdk::pubkey::new_rand(); let split_to_address = solana_sdk::pubkey::new_rand(); @@ -5345,17 +5271,13 @@ mod tests { #[test_case(feature_set_all_enabled(); "all_enabled")] fn test_split_to_account_with_rent_exempt_reserve(feature_set: Arc) { let rent = Rent::default(); -<<<<<<< HEAD let rent_exempt_reserve = rent.minimum_balance(StakeState::size_of()); -======= - let rent_exempt_reserve = rent.minimum_balance(StakeStateV2::size_of()); let stake_history = StakeHistory::default(); let current_epoch = 100; let clock = Clock { epoch: current_epoch, ..Clock::default() }; ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) let minimum_delegation = crate::get_minimum_delegation(&feature_set); let stake_lamports = (rent_exempt_reserve + minimum_delegation) * 2; let stake_address = solana_sdk::pubkey::new_rand(); @@ -5525,19 +5447,14 @@ mod tests { #[test_case(feature_set_all_enabled(); "all_enabled")] fn test_split_from_larger_sized_account(feature_set: Arc) { let rent = Rent::default(); -<<<<<<< HEAD let source_larger_rent_exempt_reserve = rent.minimum_balance(StakeState::size_of() + 100); let split_rent_exempt_reserve = rent.minimum_balance(StakeState::size_of()); -======= - let source_larger_rent_exempt_reserve = rent.minimum_balance(StakeStateV2::size_of() + 100); - let split_rent_exempt_reserve = rent.minimum_balance(StakeStateV2::size_of()); let stake_history = StakeHistory::default(); let current_epoch = 100; let clock = Clock { epoch: current_epoch, ..Clock::default() }; ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) let minimum_delegation = crate::get_minimum_delegation(&feature_set); let stake_lamports = (source_larger_rent_exempt_reserve + minimum_delegation) * 2; let stake_address = solana_sdk::pubkey::new_rand(); @@ -5701,15 +5618,10 @@ mod tests { #[test_case(feature_set_all_enabled(); "all_enabled")] fn test_split_from_smaller_sized_account(feature_set: Arc) { let rent = Rent::default(); -<<<<<<< HEAD let source_smaller_rent_exempt_reserve = rent.minimum_balance(StakeState::size_of()); let split_rent_exempt_reserve = rent.minimum_balance(StakeState::size_of() + 100); -======= - let source_smaller_rent_exempt_reserve = rent.minimum_balance(StakeStateV2::size_of()); - let split_rent_exempt_reserve = rent.minimum_balance(StakeStateV2::size_of() + 100); let stake_history = StakeHistory::default(); let current_epoch = 100; ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) let stake_lamports = split_rent_exempt_reserve + 1; let stake_address = solana_sdk::pubkey::new_rand(); let meta = Meta { @@ -5800,17 +5712,13 @@ mod tests { #[test_case(feature_set_all_enabled(); "all_enabled")] fn test_split_100_percent_of_source(feature_set: Arc) { let rent = Rent::default(); -<<<<<<< HEAD let rent_exempt_reserve = rent.minimum_balance(StakeState::size_of()); -======= - let rent_exempt_reserve = rent.minimum_balance(StakeStateV2::size_of()); let stake_history = StakeHistory::default(); let current_epoch = 100; let clock = Clock { epoch: current_epoch, ..Clock::default() }; ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) let minimum_delegation = crate::get_minimum_delegation(&feature_set); let stake_lamports = rent_exempt_reserve + minimum_delegation; let stake_address = solana_sdk::pubkey::new_rand(); @@ -5923,17 +5831,13 @@ mod tests { #[test_case(feature_set_all_enabled(); "all_enabled")] fn test_split_100_percent_of_source_to_account_with_lamports(feature_set: Arc) { let rent = Rent::default(); -<<<<<<< HEAD let rent_exempt_reserve = rent.minimum_balance(StakeState::size_of()); -======= - let rent_exempt_reserve = rent.minimum_balance(StakeStateV2::size_of()); let stake_history = StakeHistory::default(); let current_epoch = 100; let clock = Clock { epoch: current_epoch, ..Clock::default() }; ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) let minimum_delegation = crate::get_minimum_delegation(&feature_set); let stake_lamports = rent_exempt_reserve + minimum_delegation; let stake_address = solana_sdk::pubkey::new_rand(); @@ -6046,19 +5950,14 @@ mod tests { #[test_case(feature_set_all_enabled(); "all_enabled")] fn test_split_rent_exemptness(feature_set: Arc) { let rent = Rent::default(); -<<<<<<< HEAD let source_rent_exempt_reserve = rent.minimum_balance(StakeState::size_of() + 100); let split_rent_exempt_reserve = rent.minimum_balance(StakeState::size_of()); -======= - let source_rent_exempt_reserve = rent.minimum_balance(StakeStateV2::size_of() + 100); - let split_rent_exempt_reserve = rent.minimum_balance(StakeStateV2::size_of()); let stake_history = StakeHistory::default(); let current_epoch = 100; let clock = Clock { epoch: current_epoch, ..Clock::default() }; ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) let minimum_delegation = crate::get_minimum_delegation(&feature_set); let stake_lamports = source_rent_exempt_reserve + minimum_delegation; let stake_address = solana_sdk::pubkey::new_rand(); @@ -6225,7 +6124,7 @@ mod tests { expected_result: Result<(), InstructionError>, ) { let rent = Rent::default(); - let rent_exempt_reserve = rent.minimum_balance(StakeStateV2::size_of()); + let rent_exempt_reserve = rent.minimum_balance(StakeState::size_of()); let stake_history = StakeHistory::default(); let current_epoch = 100; let clock = Clock { @@ -6260,13 +6159,13 @@ mod tests { (source_lamports, Ok(())), ] { for (state, expected_result) in &[ - (StakeStateV2::Initialized(meta), Ok(())), + (StakeState::Initialized(meta), Ok(())), (just_stake(meta, delegation_amount), expected_result), ] { let source_account = AccountSharedData::new_data_with_space( source_lamports, &state, - StakeStateV2::size_of(), + StakeState::size_of(), &id(), ) .unwrap(); @@ -6275,8 +6174,8 @@ mod tests { |initial_balance: u64| -> Vec<(Pubkey, AccountSharedData)> { let destination_account = AccountSharedData::new_data_with_space( initial_balance, - &StakeStateV2::Uninitialized, - StakeStateV2::size_of(), + &StakeState::Uninitialized, + StakeState::size_of(), &id(), ) .unwrap(); @@ -6356,12 +6255,12 @@ mod tests { get_active_stake_for_tests(&accounts[0..2], &clock, &stake_history) ); - if let StakeStateV2::Stake(meta, stake, stake_flags) = state { + if let StakeState::Stake(meta, stake) = state { // split entire source account, including rent-exempt reserve if accounts[0].lamports() == 0 { - assert_eq!(Ok(StakeStateV2::Uninitialized), accounts[0].state()); + assert_eq!(Ok(StakeState::Uninitialized), accounts[0].state()); assert_eq!( - Ok(StakeStateV2::Stake( + Ok(StakeState::Stake( *meta, Stake { delegation: Delegation { @@ -6372,13 +6271,12 @@ mod tests { }, ..*stake }, - *stake_flags, )), accounts[1].state() ); } else { assert_eq!( - Ok(StakeStateV2::Stake( + Ok(StakeState::Stake( *meta, Stake { delegation: Delegation { @@ -6387,12 +6285,11 @@ mod tests { }, ..*stake }, - *stake_flags, )), accounts[0].state() ); assert_eq!( - Ok(StakeStateV2::Stake( + Ok(StakeState::Stake( *meta, Stake { delegation: Delegation { @@ -6401,7 +6298,6 @@ mod tests { }, ..*stake }, - *stake_flags, )), accounts[1].state() ); diff --git a/programs/stake/src/stake_state.rs b/programs/stake/src/stake_state.rs index bfdba2e198455b..757d2e60a1e97c 100644 --- a/programs/stake/src/stake_state.rs +++ b/programs/stake/src/stake_state.rs @@ -824,13 +824,9 @@ pub fn split( split_index, lamports, &meta, -<<<<<<< HEAD None, additional_required_lamports, -======= - 0, // additional_required_lamports false, ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) )?; let mut split_meta = meta; split_meta.rent_exempt_reserve = validated_split_info.destination_rent_exempt_reserve; @@ -992,18 +988,8 @@ pub fn redelegate( let vote_state = vote_account.get_state::()?; let (stake_meta, effective_stake) = -<<<<<<< HEAD if let StakeState::Stake(meta, stake) = stake_account.get_state()? { - let stake_history = invoke_context.get_sysvar_cache().get_stake_history()?; - let status = stake.delegation.stake_activating_and_deactivating( - clock.epoch, - Some(&stake_history), - new_warmup_cooldown_rate_epoch(invoke_context), - ); -======= - if let StakeStateV2::Stake(meta, stake, _stake_flags) = stake_account.get_state()? { let status = get_stake_status(invoke_context, &stake, &clock)?; ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) if status.effective == 0 || status.activating != 0 || status.deactivating != 0 { ic_msg!(invoke_context, "stake is not active"); return Err(StakeError::RedelegateTransientOrInactiveStake.into()); @@ -1268,6 +1254,7 @@ struct ValidatedSplitInfo { /// minimum balance requirements, which is the rent exempt reserve plus the minimum stake /// delegation, and that the source account has enough lamports for the request split amount. If /// not, return an error. +#[allow(clippy::too_many_arguments)] fn validate_split_amount( invoke_context: &InvokeContext, transaction_context: &TransactionContext, @@ -1320,8 +1307,19 @@ fn validate_split_amount( // nothing to do here } - let rent = invoke_context.get_sysvar_cache().get_rent()?; - let destination_rent_exempt_reserve = rent.minimum_balance(destination_data_len); + let destination_rent_exempt_reserve = if invoke_context + .feature_set + .is_active(&stake_split_uses_rent_sysvar::ID) + { + let rent = invoke_context.get_sysvar_cache().get_rent()?; + rent.minimum_balance(destination_data_len) + } else { + calculate_split_rent_exempt_reserve( + source_meta.rent_exempt_reserve, + source_data_len as u64, + destination_data_len as u64, + ) + }; // As of feature `require_rent_exempt_split_destination`, if the source is active stake, one of // these criteria must be met: @@ -1341,22 +1339,6 @@ fn validate_split_amount( // This must handle: // 1. The destination account having a different rent exempt reserve due to data size changes // 2. The destination account being prefunded, which would lower the minimum split amount -<<<<<<< HEAD - let destination_rent_exempt_reserve = if invoke_context - .feature_set - .is_active(&stake_split_uses_rent_sysvar::ID) - { - let rent = invoke_context.get_sysvar_cache().get_rent()?; - rent.minimum_balance(destination_data_len) - } else { - calculate_split_rent_exempt_reserve( - source_meta.rent_exempt_reserve, - source_data_len as u64, - destination_data_len as u64, - ) - }; -======= ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) let destination_minimum_balance = destination_rent_exempt_reserve.saturating_add(additional_required_lamports); let destination_balance_deficit = diff --git a/runtime/tests/stake.rs b/runtime/tests/stake.rs index 52fb0b1955ab61..8bafdfa186c291 100644 --- a/runtime/tests/stake.rs +++ b/runtime/tests/stake.rs @@ -426,18 +426,14 @@ fn test_stake_account_lifetime() { let split_stake_keypair = Keypair::new(); let split_stake_pubkey = split_stake_keypair.pubkey(); -<<<<<<< HEAD - let bank_client = BankClient::new_shared(&bank); -======= bank.transfer( stake_rent_exempt_reserve, &mint_keypair, &split_stake_pubkey, ) .unwrap(); - let bank_client = BankClient::new_shared(bank.clone()); + let bank_client = BankClient::new_shared(&bank); ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) // Test split let split_starting_delegation = stake_minimum_delegation + bonus_delegation; let message = Message::new( diff --git a/sdk/src/feature_set.rs b/sdk/src/feature_set.rs index b014b51f6b33cc..5b982432793f26 100644 --- a/sdk/src/feature_set.rs +++ b/sdk/src/feature_set.rs @@ -674,29 +674,10 @@ pub mod revise_turbine_epoch_stakes { solana_sdk::declare_id!("BTWmtJC8U5ZLMbBUUA1k6As62sYjPEjAiNAT55xYGdJU"); } -<<<<<<< HEAD -======= -pub mod enable_poseidon_syscall { - solana_sdk::declare_id!("FL9RsQA6TVUoh5xJQ9d936RHSebA1NLQqe3Zv9sXZRpr"); -} - -pub mod timely_vote_credits { - solana_sdk::declare_id!("2oXpeh141pPZCTCFHBsvCwG2BtaHZZAtrVhwaxSy6brS"); -} - -pub mod remaining_compute_units_syscall_enabled { - solana_sdk::declare_id!("5TuppMutoyzhUSfuYdhgzD47F92GL1g89KpCZQKqedxP"); -} - -pub mod enable_program_runtime_v2_and_loader_v4 { - solana_sdk::declare_id!("8oBxsYqnCvUTGzgEpxPcnVf7MLbWWPYddE33PftFeBBd"); -} - pub mod require_rent_exempt_split_destination { solana_sdk::declare_id!("D2aip4BBr8NPWtU9vLrwrBvbuaQ8w1zV38zFLxx4pfBV"); } ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) lazy_static! { /// Map of feature identifiers to user-visible description pub static ref FEATURE_NAMES: HashMap = [ @@ -860,14 +841,7 @@ lazy_static! { (bpf_account_data_direct_mapping::id(), "use memory regions to map account data into the rbpf vm instead of copying the data"), (reduce_stake_warmup_cooldown::id(), "reduce stake warmup cooldown from 25% to 9%"), (revise_turbine_epoch_stakes::id(), "revise turbine epoch stakes"), -<<<<<<< HEAD -======= - (enable_poseidon_syscall::id(), "Enable Poseidon syscall"), - (timely_vote_credits::id(), "use timeliness of votes in determining credits to award"), - (remaining_compute_units_syscall_enabled::id(), "enable the remaining_compute_units syscall"), - (enable_program_runtime_v2_and_loader_v4::id(), "Enable Program-Runtime-v2 and Loader-v4 #33293"), (require_rent_exempt_split_destination::id(), "Require stake split destination account to be rent exempt"), ->>>>>>> bca41edf20 (Make active stake consistent in split (#33295)) /*************** ADD NEW FEATURES HERE ***************/ ] .iter() diff --git a/tokens/src/commands.rs b/tokens/src/commands.rs index c10ad508d61a1c..ac284393e6cd74 100644 --- a/tokens/src/commands.rs +++ b/tokens/src/commands.rs @@ -31,7 +31,7 @@ use { signature::{unique_signers, Signature, Signer}, stake::{ instruction::{self as stake_instruction, LockupArgs}, - state::{Authorized, Lockup, StakeAuthorize, StakeStateV2}, + state::{Authorized, Lockup, StakeAuthorize, StakeState}, }, system_instruction, transaction::Transaction, @@ -1187,7 +1187,7 @@ pub fn test_process_distribute_stake_with_client(client: &RpcClient, sender_keyp let output_path = output_file.path().to_str().unwrap().to_string(); let rent_exempt_reserve = client - .get_minimum_balance_for_rent_exemption(StakeStateV2::size_of()) + .get_minimum_balance_for_rent_exemption(StakeState::size_of()) .unwrap(); let sender_stake_args = SenderStakeArgs { stake_account_address, diff --git a/tokens/src/stake.rs b/tokens/src/stake.rs index 3f1c35a3b4df36..2647541b6e402f 100644 --- a/tokens/src/stake.rs +++ b/tokens/src/stake.rs @@ -1,13 +1,13 @@ use { crate::{args::StakeArgs, commands::Error}, solana_rpc_client::rpc_client::RpcClient, - solana_sdk::stake::state::StakeStateV2, + solana_sdk::stake::state::StakeState, }; pub fn update_stake_args(client: &RpcClient, args: &mut Option) -> Result<(), Error> { if let Some(stake_args) = args { if let Some(sender_args) = &mut stake_args.sender_stake_args { - let rent = client.get_minimum_balance_for_rent_exemption(StakeStateV2::size_of())?; + let rent = client.get_minimum_balance_for_rent_exemption(StakeState::size_of())?; sender_args.rent_exempt_reserve = Some(rent); } }