svm: AccountLoader
mutability refactor
#4680
Draft
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.
TODO my pr situation is getting messy but this is the first half of a new approach for fixing
filter_executable_program_accounts()
once and for all that handles some code hairball issues much better than previous attempts (#4553 and #4576)first attempt was use a per-tx local program cache, moving its creation after tx loading, using
AccountLoader
as-is. this has issues:replenish_program_cache()
are used inBank
which has no awareness ofAccountLoader
, so we would need to break up things likeload_program_with_pubkey()
in weird ways, eg providing a lambda to get loaderv3 programdata and providing two interfaces (callback and loader) over the core parsing/loader discrimination logicsecond attempt was to keep the per-batch local program cache and use
AccountLoader
for the filter step, leaving replenish for another day. however we cannot do this for the same reason we moved away from batched account loading in the first place, it allows loading arbitrarily large accounts with no early abort to size transaction data size checksthe new idea is:
account_cache
to aRwLock
&mut
from all methodsimpl TransactionProcessingCallback
forAccountLoader
this lets us change
filter_executable_program_accounts()
andreplenish_program_cache()
as we please while preserving bank-friendly type signatures on shared functionsProblem
Summary of Changes
Fixes #