Runtime: Core BPF: Add test for CPI post-migration#2531
Conversation
CriesofCarrots
left a comment
There was a problem hiding this comment.
Lgtm. I'd get @2501babe 's sign-off as well, though
|
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. |
|
does this new test fail if you turn off your fix (ie if the builtin is not marked executable)? the check im aware of that would fail this is before control drops to invoke context, though there might be another check inside it not that you shouldnt merge this, i think a lot more testing of transaction loading needs to take place and im brainstorming myself how to do that |
Yep. Directly invoking it works, but via CPI it throws Looks to me like this callsite: agave/program-runtime/src/invoke_context.rs Lines 437 to 439 in ae18213 |
(cherry picked from commit 8f675eb)
Problem
Our test suite for migrating builtin programs to BPF sends a transaction with an instruction for the newly migrated program, to test that it can be loaded and executed successfully. However, this test suite is missing a test for CPI'ing to this program.
Building on the back of #2483, we should have coverage for this case.
Summary of Changes
Add a mocked-out builtin processor designed to CPI to the provided program to the test suite. Then simply send a transaction to this builtin (like we're already doing with the newly migrated program) directing it to CPI to the newly migrated program.