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

Runtime: Module to migrate builtin programs to Core BPF #35260

Closed

Conversation

buffalojoec
Copy link
Contributor

@buffalojoec buffalojoec commented Feb 20, 2024

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.


Note: Once #35267 lands I can add a commit with feature activation tests.

@buffalojoec buffalojoec changed the title Migrate builtin module Runtime: Module to migrate builtin programs to Core BPF Feb 20, 2024
Copy link

codecov bot commented Feb 20, 2024

Codecov Report

Attention: Patch coverage is 74.93917% with 103 lines in your changes are missing coverage. Please review.

Project coverage is 81.6%. Comparing base (e8c87e8) to head (5221627).
Report is 5 commits behind head on master.

❗ Current head 5221627 differs from pull request most recent head a518972. Consider uploading reports for the commit a518972 to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##           master   #35260     +/-   ##
=========================================
- Coverage    81.8%    81.6%   -0.2%     
=========================================
  Files         834      837      +3     
  Lines      224815   225158    +343     
=========================================
- Hits       183919   183787    -132     
- Misses      40896    41371    +475     

@buffalojoec buffalojoec marked this pull request as ready for review March 1, 2024 16:52
@willhickey
Copy link
Contributor

This repository is no longer in use. Please re-open this pull request in the agave repo: https://github.com/anza-xyz/agave

@willhickey willhickey closed this Mar 3, 2024
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.

2 participants