Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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));
Comment on lines +363 to +370
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can these useful method be defined on SanitizedMesssage or SanitizedTransaction?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought about it, but I'm generally against adding more stuff into SDK. Could probably define a function in this file.

In my experimental branch I do have this defined as member fn of the generic tx trait.

Copy link
Copy Markdown
Member

@ryoqun ryoqun Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, thanks for explaining. mine isn't strong opinion.

happy to see this pr merged as-is. :)

self.account_locks
.unlock_accounts(write_account_locks, read_account_locks, thread_id);
}
}

Expand Down