Use last_valid_block_height in services and client apps (backport #19163) (#19171)

* Use last_valid_block_height in services and client apps (#19163)

* Add deprecated tag to Bank::get_blockhash_last_valid_slot

* Update SendTransactionService to use last_valid_block_height

* Update solana-tokens to use last_valid_block_height

* Remove dangling file

* Update solana program to use last_valid_block_height

* Update Banks crates to use last_valid_block_height

(cherry picked from commit 5970083b4d)

# Conflicts:
#	cli/src/program.rs

* Fix conflict

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
This commit is contained in:
mergify[bot]
2021-08-11 09:07:53 +00:00
committed by GitHub
parent 422044f375
commit c9f763ea6e
14 changed files with 190 additions and 128 deletions

View File

@@ -2534,7 +2534,10 @@ impl Bank {
&self.fee_rate_governor
}
// DEPRECATED
#[deprecated(
since = "1.6.11",
note = "Please use `get_blockhash_last_valid_block_height`"
)]
pub fn get_blockhash_last_valid_slot(&self, blockhash: &Hash) -> Option<Slot> {
let blockhash_queue = self.blockhash_queue.read().unwrap();
// This calculation will need to be updated to consider epoch boundaries if BlockhashQueue

View File

@@ -156,6 +156,7 @@ impl SyncClient for BankClient {
_commitment_config: CommitmentConfig,
) -> Result<(Hash, FeeCalculator, u64)> {
let (blockhash, fee_calculator) = self.bank.last_blockhash_with_fee_calculator();
#[allow(deprecated)]
let last_valid_slot = self
.bank
.get_blockhash_last_valid_slot(&blockhash)