diff --git a/core/src/banking_stage/committer.rs b/core/src/banking_stage/committer.rs index a80b350b87..4e970d8f8d 100644 --- a/core/src/banking_stage/committer.rs +++ b/core/src/banking_stage/committer.rs @@ -131,7 +131,7 @@ impl Committer { starting_transaction_index, ); self.prioritization_fee_cache - .update(bank.clone(), executed_transactions.into_iter()); + .update(bank, executed_transactions.into_iter()); }); execute_and_commit_timings.find_and_send_votes_us = find_and_send_votes_us; (commit_time_us, commit_transaction_statuses) diff --git a/ledger/src/blockstore_processor.rs b/ledger/src/blockstore_processor.rs index dd7af654d6..6d602edd4f 100644 --- a/ledger/src/blockstore_processor.rs +++ b/ledger/src/blockstore_processor.rs @@ -200,7 +200,7 @@ fn execute_batch( ); } - prioritization_fee_cache.update(bank.clone(), executed_transactions.into_iter()); + prioritization_fee_cache.update(bank, executed_transactions.into_iter()); let first_err = get_first_error(batch, fee_collection_results); first_err.map(|(result, _)| result).unwrap_or(Ok(())) diff --git a/rpc/src/rpc.rs b/rpc/src/rpc.rs index d0605b269d..d77b4a5c57 100644 --- a/rpc/src/rpc.rs +++ b/rpc/src/rpc.rs @@ -5015,7 +5015,7 @@ pub mod tests { .into_iter() .map(|tx| SanitizedTransaction::try_from_legacy_transaction(tx).unwrap()) .collect(); - prioritization_fee_cache.update(bank, transactions.iter()); + prioritization_fee_cache.update(&bank, transactions.iter()); } fn get_prioritization_fee_cache(&self) -> &PrioritizationFeeCache { diff --git a/runtime/benches/prioritization_fee_cache.rs b/runtime/benches/prioritization_fee_cache.rs index e04e783b99..c89d55c275 100644 --- a/runtime/benches/prioritization_fee_cache.rs +++ b/runtime/benches/prioritization_fee_cache.rs @@ -59,7 +59,7 @@ fn bench_process_transactions_single_slot(bencher: &mut Bencher) { .collect(); bencher.iter(|| { - prioritization_fee_cache.update(bank.clone(), transactions.iter()); + prioritization_fee_cache.update(&bank, transactions.iter()); }); } @@ -87,7 +87,7 @@ fn process_transactions_multiple_slots(banks: &[Arc], num_slots: usize, nu let index = thread_rng().gen_range(0, num_slots); - prioritization_fee_cache.update(banks[index].clone(), transactions.iter()); + prioritization_fee_cache.update(&banks[index], transactions.iter()); }) } } diff --git a/runtime/src/prioritization_fee_cache.rs b/runtime/src/prioritization_fee_cache.rs index 7df9c18078..eadafcc2a0 100644 --- a/runtime/src/prioritization_fee_cache.rs +++ b/runtime/src/prioritization_fee_cache.rs @@ -201,7 +201,7 @@ impl PrioritizationFeeCache { /// Update with a list of non-vote transactions' tx_priority_details and tx_account_locks; Only /// transactions have both valid priority_detail and account_locks will be used to update /// fee_cache asynchronously. - pub fn update<'a>(&self, bank: Arc, txs: impl Iterator) { + pub fn update<'a>(&self, bank: &Bank, txs: impl Iterator) { let mut successful_transaction_update_count: u64 = 0; let (_, send_updates_time) = measure!( { @@ -427,7 +427,7 @@ mod tests { bank: Arc, txs: impl Iterator, ) { - prioritization_fee_cache.update(bank.clone(), txs); + prioritization_fee_cache.update(&bank, txs); let block_fee = PrioritizationFeeCache::get_prioritization_fee( prioritization_fee_cache.cache.clone(),