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

Migrate builtin module #9

Closed
wants to merge 9 commits into from
Closed

Conversation

buffalojoec
Copy link
Owner

I'm introducing this PR as a draft to hopefully gather some feedback on the
approach and some of the various things this migration path touches.

I've carefully structured the commits to ensure maximum readability, including
saving the Bank modifications required for testing the migrations for last.


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 runtime
built-in programs, contains a feature_id field for activating new built-in
programs.

Building on this architecture, I've included a new field for
core_bpf_migration configurations, which the runtime can use on epoch rollover
to 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:

  • Source BPF Program: The upgradeable BPF program that will be moved in place of
    the built-in.
  • Feature ID: The feature ID whose activation will trigger the migration.

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-module core_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.

@buffalojoec buffalojoec force-pushed the migrate-builtin-module branch from f6af900 to 5221627 Compare February 20, 2024 16:02
buffalojoec pushed a commit that referenced this pull request Mar 5, 2024
ci: removed unused s3 upload in Windows build
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