Runtime: Module to migrate builtin programs to Core BPF #35260
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
Now that SIMD 0088
has been merged, the runtime requires a code path for migrating built-in
programs to Core BPF.
Solution
The static
BUILTINS
list, which houses the source-of-truth for all runtimebuilt-in programs, contains a
feature_id
field for activating new built-inprograms.
Building on this architecture, I've included a new field for
core_bpf_migration
configurations, which the runtime can use on epoch rolloverto migrate a built-in to Core BPF and ensure it's handled properly by both the
Bank and the program cache.
The config defines two main fields:
the built-in.
To ensure maximum safety when enabling migrations, I've abstracted all of the
checks and account manipulation required to perform the migration away into the
builtin
module's sub-modulecore_bpf_migration
.To migrate a built-in program to Core BPF, contributors need only add the source
program ID and the feature ID to the built-in's config.
Note: Once #35267 lands I can add a commit with feature activation tests.