Skip to content

Commit

Permalink
PrioGraphScheduler: try_schedule_transaction remove TransactionAccoun…
Browse files Browse the repository at this point in the history
…tLocks allocation
  • Loading branch information
apfitzge committed Jun 17, 2024
1 parent cad7e83 commit 96866fe
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -550,10 +550,20 @@ fn try_schedule_transaction(
}

// Schedule the transaction if it can be.
let transaction_locks = transaction.get_account_locks_unchecked();
let message = transaction.message();
let account_keys = message.account_keys();
let write_account_locks = account_keys
.iter()
.enumerate()
.filter_map(|(index, key)| message.is_writable(index).then_some(key));
let read_account_locks = account_keys
.iter()
.enumerate()
.filter_map(|(index, key)| (!message.is_writable(index)).then_some(key));

let Some(thread_id) = account_locks.try_lock_accounts(
transaction_locks.writable.into_iter(),
transaction_locks.readonly.into_iter(),
write_account_locks,
read_account_locks,
ThreadSet::any(num_threads),
thread_selector,
) else {
Expand Down

0 comments on commit 96866fe

Please sign in to comment.