Skip to content

Commit

Permalink
PrioGraphScheduler::complete_batch remove TransactionAccountLocks all…
Browse files Browse the repository at this point in the history
…ocation (anza-xyz#1759)
  • Loading branch information
apfitzge authored Jun 20, 2024
1 parent eceaf34 commit 246fc3c
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,18 @@ impl PrioGraphScheduler {
) {
let thread_id = self.in_flight_tracker.complete_batch(batch_id);
for transaction in transactions {
let account_locks = transaction.get_account_locks_unchecked();
self.account_locks.unlock_accounts(
account_locks.writable.into_iter(),
account_locks.readonly.into_iter(),
thread_id,
);
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));
self.account_locks
.unlock_accounts(write_account_locks, read_account_locks, thread_id);
}
}

Expand Down

0 comments on commit 246fc3c

Please sign in to comment.