Refactor transaction account unlocking#103
Merged
jstarry merged 1 commit intoanza-xyz:masterfrom Mar 7, 2024
Merged
Conversation
7445684 to
e702fa6
Compare
apfitzge
approved these changes
Mar 7, 2024
| fn drop(&mut self) { | ||
| self.bank.unlock_accounts(self) | ||
| if self.needs_unlock() { | ||
| self.set_needs_unlock(false); |
There was a problem hiding this comment.
I realize we had this previously, but I'm struggling to think why this is necessary. We're in middle of dropping this batch, so it won't get dropped and attempt unlock again, right?
Author
There was a problem hiding this comment.
Yup, it's really not necessary to set to false here
codebender828
pushed a commit
to codebender828/agave
that referenced
this pull request
Oct 3, 2024
refactor: unlock accounts
OliverNChalk
pushed a commit
to OliverNChalk/agave
that referenced
this pull request
Nov 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Current transaction account unlocking APIs aren't ideal for implementing partial transaction batch unlocking. Partial unlocking is needed for solana-labs#34825 by implementing a process of
Summary of Changes
Accounts::unlock_accountsandBank::unlock_accountsto operate over a zipped iterator of transactions and lock results so that it's easier to implement a partial unlock of a transaction batch.is_emptycheck insideAccounts::unlock_accountsto avoid taking the accounts lock if it's not neededFixes #