Skip to content
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

Feature - Infer account executable flag from owners #2034

Closed
wants to merge 5 commits into from

Conversation

Lichtso
Copy link

@Lichtso Lichtso commented Jul 8, 2024

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 the executable flag. In fact the entire program runtime can ignore the executable flag, instead relying on the owner field and content of program accounts.

Summary of Changes

  • Adds Serializer::infer_is_executable() as the VM needs to continue to emulate it (in serialization) to stay ABI compatible
  • Adds the feature
  • Adds the feature gate logic, which disables all executable flag related errors
  • Adds deprecation attributes
  • Adjusts tests

@Lichtso Lichtso marked this pull request as draft July 8, 2024 16:08
@Lichtso Lichtso force-pushed the feature/infer_is_executable branch 17 times, most recently from 9829186 to d03075e Compare July 11, 2024 09:13
@Lichtso Lichtso force-pushed the feature/infer_is_executable branch from d03075e to b158a1e Compare July 11, 2024 12:35
@Lichtso
Copy link
Author

Lichtso commented Jul 18, 2024

Closing in favor of #2182.

@Lichtso Lichtso closed this Jul 18, 2024
@Lichtso Lichtso deleted the feature/infer_is_executable branch July 18, 2024 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant