-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor - Simplify program accounts in transaction loading #29728
Refactor - Simplify program accounts in transaction loading #29728
Conversation
e48aedd
to
57283cd
Compare
57283cd
to
95f3a2e
Compare
Can this PR be backported to 1.14? The function on top of this (to limit loaded data to a fixed size) will be backported, that'd bring it to 1.14, would you think so? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to avoid redundant accounts loading by tracking with account_found_and_dep_index
. Just few questions that I am not sure about.
0c6c32e
to
cc6df59
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks for discussing the decision of removing chained-loader.
cc6df59
to
6e67274
Compare
Pull request has been modified.
* Refactors the "!validated_fee_payer" case from an "else" branch to an early "return". * Moves the early return upward. * Removes empty entries. * Adds account_found_and_dep_index. * cargo fmt. * Replaces call site of load_executable_accounts(). * Adjusts number of total loaded accounts in test_load_accounts_multiple_loaders(). * Removes test_accounts_account_not_found(). * Removes load_executable_accounts(). * Refactor back to built-in loader ownership chain loop. (cherry picked from commit aa2e348) # Conflicts: # runtime/src/accounts.rs
* Refactors the "!validated_fee_payer" case from an "else" branch to an early "return". * Moves the early return upward. * Removes empty entries. * Adds account_found_and_dep_index. * cargo fmt. * Replaces call site of load_executable_accounts(). * Adjusts number of total loaded accounts in test_load_accounts_multiple_loaders(). * Removes test_accounts_account_not_found(). * Removes load_executable_accounts(). * Refactor back to built-in loader ownership chain loop. (cherry picked from commit aa2e348) # Conflicts: # runtime/src/accounts.rs
Problem
Currently we skip the loading of program accounts (of top level instructions) by filling them with an empty entry and later loading them separately in
load_executable_accounts()
. This not only causes redundant loading logic for the upgradeable loaders programdata special case, but also duplication of all program accounts, even multiple times if a program is used more than once.Summary of Changes
load_executable_accounts()
and uses the normal account loading instead.test_accounts_account_not_found()
as theProgramAccountNotFound
case is now covered bytest_program_sbf_invoke_in_same_tx_as_deployment()
(see Adds symmetric tests for all cases of un-/re-/deployment inside the same transaction #29725).test_load_accounts_multiple_loaders()
.