diff --git a/banks-client/src/lib.rs b/banks-client/src/lib.rs index 61105575e2ca2e..aae81192d3a07b 100644 --- a/banks-client/src/lib.rs +++ b/banks-client/src/lib.rs @@ -17,8 +17,7 @@ use { BanksTransactionResultWithSimulation, }, solana_program::{ - clock::Slot, fee_calculator::FeeCalculator, hash::Hash, program_pack::Pack, pubkey::Pubkey, - rent::Rent, sysvar::Sysvar, + clock::Slot, hash::Hash, program_pack::Pack, pubkey::Pubkey, rent::Rent, sysvar::Sysvar, }, solana_sdk::{ account::{from_account, Account}, @@ -69,21 +68,6 @@ impl BanksClient { .map_err(Into::into) } - #[deprecated( - since = "1.9.0", - note = "Please use `get_fee_for_message` or `is_blockhash_valid` instead" - )] - pub fn get_fees_with_commitment_and_context( - &mut self, - ctx: Context, - commitment: CommitmentLevel, - ) -> impl Future> + '_ { - #[allow(deprecated)] - self.inner - .get_fees_with_commitment_and_context(ctx, commitment) - .map_err(Into::into) - } - pub fn get_transaction_status_with_context( &mut self, ctx: Context, @@ -185,20 +169,6 @@ impl BanksClient { self.send_transaction_with_context(context::current(), transaction.into()) } - /// Return the fee parameters associated with a recent, rooted blockhash. The cluster - /// will use the transaction's blockhash to look up these same fee parameters and - /// use them to calculate the transaction fee. - #[deprecated( - since = "1.9.0", - note = "Please use `get_fee_for_message` or `is_blockhash_valid` instead" - )] - pub fn get_fees( - &mut self, - ) -> impl Future> + '_ { - #[allow(deprecated)] - self.get_fees_with_commitment_and_context(context::current(), CommitmentLevel::default()) - } - /// Return the cluster Sysvar pub fn get_sysvar( &mut self, @@ -216,17 +186,6 @@ impl BanksClient { self.get_sysvar::() } - /// Return a recent, rooted blockhash from the server. The cluster will only accept - /// transactions with a blockhash that has not yet expired. Use the `get_fees` - /// method to get both a blockhash and the blockhash's last valid slot. - #[deprecated(since = "1.9.0", note = "Please use `get_latest_blockhash` instead")] - pub fn get_recent_blockhash( - &mut self, - ) -> impl Future> + '_ { - #[allow(deprecated)] - self.get_fees().map(|result| Ok(result?.1)) - } - /// Send a transaction and return after the transaction has been rejected or /// reached the given level of commitment. pub fn process_transaction_with_commitment( diff --git a/banks-interface/src/lib.rs b/banks-interface/src/lib.rs index d1cd7b867b514d..8f005be62f9749 100644 --- a/banks-interface/src/lib.rs +++ b/banks-interface/src/lib.rs @@ -6,7 +6,6 @@ use { account::Account, clock::Slot, commitment_config::CommitmentLevel, - fee_calculator::FeeCalculator, hash::Hash, inner_instruction::InnerInstructions, message::Message, @@ -64,13 +63,6 @@ pub struct BanksTransactionResultWithMetadata { #[tarpc::service] pub trait Banks { async fn send_transaction_with_context(transaction: VersionedTransaction); - #[deprecated( - since = "1.9.0", - note = "Please use `get_fee_for_message_with_commitment_and_context` instead" - )] - async fn get_fees_with_commitment_and_context( - commitment: CommitmentLevel, - ) -> (FeeCalculator, Hash, Slot); async fn get_transaction_status_with_context(signature: Signature) -> Option; async fn get_slot_with_context(commitment: CommitmentLevel) -> Slot; diff --git a/banks-server/src/banks_server.rs b/banks-server/src/banks_server.rs index 92add43452dceb..c08a41c5d91a6b 100644 --- a/banks-server/src/banks_server.rs +++ b/banks-server/src/banks_server.rs @@ -18,7 +18,6 @@ use { clock::Slot, commitment_config::CommitmentLevel, feature_set::FeatureSet, - fee_calculator::FeeCalculator, hash::Hash, message::{Message, SanitizedMessage}, pubkey::Pubkey, @@ -232,24 +231,6 @@ impl Banks for BanksServer { self.transaction_sender.send(info).unwrap(); } - async fn get_fees_with_commitment_and_context( - self, - _: Context, - commitment: CommitmentLevel, - ) -> (FeeCalculator, Hash, u64) { - let bank = self.bank(commitment); - let blockhash = bank.last_blockhash(); - let lamports_per_signature = bank.get_lamports_per_signature(); - let last_valid_block_height = bank - .get_blockhash_last_valid_block_height(&blockhash) - .unwrap(); - ( - FeeCalculator::new(lamports_per_signature), - blockhash, - last_valid_block_height, - ) - } - async fn get_transaction_status_with_context( self, _: Context, diff --git a/program-test/src/lib.rs b/program-test/src/lib.rs index 58492d893aea80..f3c06d6b0fe94b 100644 --- a/program-test/src/lib.rs +++ b/program-test/src/lib.rs @@ -34,7 +34,7 @@ use { clock::{Epoch, Slot}, entrypoint::{deserialize, ProgramResult, SUCCESS}, feature_set::FEATURE_NAMES, - fee_calculator::{FeeCalculator, FeeRateGovernor, DEFAULT_TARGET_LAMPORTS_PER_SIGNATURE}, + fee_calculator::{FeeRateGovernor, DEFAULT_TARGET_LAMPORTS_PER_SIGNATURE}, genesis_config::{ClusterType, GenesisConfig}, hash::Hash, instruction::{Instruction, InstructionError}, @@ -973,47 +973,12 @@ impl ProgramTest { #[async_trait] pub trait ProgramTestBanksClientExt { - /// Get a new blockhash, similar in spirit to RpcClient::get_new_blockhash() - /// - /// This probably should eventually be moved into BanksClient proper in some form - #[deprecated( - since = "1.9.0", - note = "Please use `get_new_latest_blockhash `instead" - )] - async fn get_new_blockhash(&mut self, blockhash: &Hash) -> io::Result<(Hash, FeeCalculator)>; /// Get a new latest blockhash, similar in spirit to RpcClient::get_latest_blockhash() async fn get_new_latest_blockhash(&mut self, blockhash: &Hash) -> io::Result; } #[async_trait] impl ProgramTestBanksClientExt for BanksClient { - async fn get_new_blockhash(&mut self, blockhash: &Hash) -> io::Result<(Hash, FeeCalculator)> { - let mut num_retries = 0; - let start = Instant::now(); - while start.elapsed().as_secs() < 5 { - #[allow(deprecated)] - if let Ok((fee_calculator, new_blockhash, _slot)) = self.get_fees().await { - if new_blockhash != *blockhash { - return Ok((new_blockhash, fee_calculator)); - } - } - debug!("Got same blockhash ({:?}), will retry...", blockhash); - - tokio::time::sleep(Duration::from_millis(200)).await; - num_retries += 1; - } - - Err(io::Error::new( - io::ErrorKind::Other, - format!( - "Unable to get new blockhash after {}ms (retried {} times), stuck at {}", - start.elapsed().as_millis(), - num_retries, - blockhash - ), - )) - } - async fn get_new_latest_blockhash(&mut self, blockhash: &Hash) -> io::Result { let mut num_retries = 0; let start = Instant::now();