Skip to content

Commit

Permalink
prioritization_fee_cache: remove get_account_locks (#2556)
Browse files Browse the repository at this point in the history
  • Loading branch information
apfitzge authored Aug 13, 2024
1 parent e181194 commit 8b22b92
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions runtime/src/prioritization_fee_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use {
crate::{bank::Bank, prioritization_fee::*},
crossbeam_channel::{unbounded, Receiver, Sender},
log::*,
solana_accounts_db::account_locks::validate_account_locks,
solana_measure::measure_us,
solana_runtime_transaction::instructions_processor::process_compute_budget_instructions,
solana_sdk::{
Expand Down Expand Up @@ -205,10 +206,14 @@ impl PrioritizationFeeCache {
let compute_budget_limits = process_compute_budget_instructions(
sanitized_transaction.message().program_instructions_iter(),
);
let account_locks = sanitized_transaction
.get_account_locks(bank.get_transaction_account_lock_limit());

if compute_budget_limits.is_err() || account_locks.is_err() {
let message = sanitized_transaction.message();
let lock_result = validate_account_locks(
message.account_keys(),
bank.get_transaction_account_lock_limit(),
);

if compute_budget_limits.is_err() || lock_result.is_err() {
continue;
}
let compute_budget_limits = compute_budget_limits.unwrap();
Expand All @@ -219,12 +224,13 @@ impl PrioritizationFeeCache {
continue;
}

let writable_accounts = account_locks
.unwrap()
.writable
let writable_accounts = message
.account_keys()
.iter()
.map(|key| **key)
.collect::<Vec<_>>();
.enumerate()
.filter(|(index, _)| message.is_writable(*index))
.map(|(_, key)| *key)
.collect();

self.sender
.send(CacheServiceUpdate::TransactionUpdate {
Expand Down

0 comments on commit 8b22b92

Please sign in to comment.