Feature - Infer account executable
flag from owners
#2034
Closed
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
The
executable
flag was originally meant to mark finalized programs as read-only. However, with the introduction of the upgradeable loader (loader-v3) this mechanism was circumvented. The workaround in the upgradeable loader is to use a proxy account that gets marked as executable (thus read-only) and which in turn points to the actual program-data account (which is not marked as executable and can be written to).Hence, the
executable
flag is useless and gets in the way. It perpetuates the workaround with the proxy account, which in turn complicates transaction account loading, program loading, the program runtime and even CPI for dApp devs. To solve this loader-v4 was designed without the need for a proxy account by ignoring theexecutable
flag. In fact the entire program runtime can ignore theexecutable
flag, instead relying on the owner field and content of program accounts.Summary of Changes
Serializer::infer_is_executable()
as the VM needs to continue to emulate it (in serialization) to stay ABI compatibleexecutable
flag related errors