-
Notifications
You must be signed in to change notification settings - Fork 251
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
Runtime: Core BPF Migration: Add checks for executable program account #2483
Conversation
22e1fc8
to
e4fd4dc
Compare
Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis. |
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.
Can the CPI test be a separate PR, please?
The changes to active runtime code look good.
Sure thing. Assuming you don't want the CPI test as part of the backport, or do you? And for backporting in general, is it preferred to make my case for backport here, or in the backport PR itself? |
I'm leaning toward yes backport, since the feature being tested is in that branch. Zero-risk backport, since it doesn't touch live code.
It's slightly easier for the backport reviewers if the argument is on the backport PR, but not a huge deal since we're most likely looking at the original PR as well anyway. |
Sounds good. So I'll split the CPI test out, backport this one, and then later backport that one (once approved). |
e4fd4dc
to
f97765f
Compare
CPI test was removed. I'll open that PR once this one goes in. Thanks! |
looks great! just to confirm, |
Yep!
It's only setting the program account to |
thats strange. i asked because i thought i saw both accounts were marked executable when i was testing something yesterday. but now i used |
Hm, that is strange. The CPI test I added fails if the program account isn't marked executable, but works when it is. In both cases the programdata account is not executable. There's a few places in the codebase where we explicitly mark the programdata account as agave/program-test/src/programs.rs Line 65 in c5e8d16
agave/programs/bpf_loader/src/lib.rs Lines 668 to 699 in c5e8d16
|
i figured it out. both accounts (program and programdata) get marked executable on my local |
…account (backport of #2483) (#2516) Runtime: Core BPF Migration: Add checks for executable program account (#2483) * Runtime: Core BPF: check `executable` on program load * Runtime: Core BPF: set `executable` on migration (cherry picked from commit 33119c5) Co-authored-by: Joe C <joe.caulfield@anza.xyz>
anza-xyz#2483) * Runtime: Core BPF: check `executable` on program load * Runtime: Core BPF: set `executable` on migration
Problem
When the Core BPF migration module was being added to the runtime, the
executable
flag for accounts was being deprecated, so checks for this flag were not added to the mechanisms for migrating and upgrading Core BPF programs. See #309.These changes were reverted, and the Core BPF migration code must be aware of the
executable
flag on accounts.Additionally, even though the program can still be invoked via instruction, the program account must be set as
executable
when performing a migration, to ensure allexecutable
flag checks are successful on the new program.Summary of Changes
Two small changes:
executable
when loading an existing Core BPF program in preparation for an upgrade.executable: true
when performing a migration from builtin to BPF.