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: Core BPF Migration: Struct for loading and checking source BPF program accounts #332

Merged
merged 5 commits into from
Mar 26, 2024

Conversation

buffalojoec
Copy link

@buffalojoec buffalojoec commented Mar 20, 2024

This is chunk 4/7 of the broken-up PR #79.

Problem

When the runtime desires to migrate a builtin program to Core BPF, it will do
so by replacing the builtin program's program account with that of a BPF
upgradeable program's program account, which will contain a pointer to its
corresponding program-data account.

Currently, there exists no reliable method in the bank or runtime more broadly
for loading a BPF upgradeable program's accounts and performing various
checks to ensure both program and program-data account are configured as
expected.

Being able to run these checks before fetching the program's accounts is
extremely important for ensuring a smooth migration to Core BPF.

Summary of Changes

Within the builtins submodule, add a module specifically for core_bpf_migration,
and inside of it create a new structure for loading a source BPF upgradeable program's
program and program-data account and running checks.

@buffalojoec buffalojoec force-pushed the core-bpf-upgradeables branch from 6c917ad to 70c605b Compare March 20, 2024 01:53
@codecov-commenter
Copy link

codecov-commenter commented Mar 20, 2024

Codecov Report

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

Project coverage is 81.8%. Comparing base (c867522) to head (6aea930).

Additional details and impacted files
@@            Coverage Diff            @@
##           master     #332     +/-   ##
=========================================
- Coverage    81.9%    81.8%   -0.1%     
=========================================
  Files         840      841      +1     
  Lines      228098   228245    +147     
=========================================
+ Hits       186818   186929    +111     
- Misses      41280    41316     +36     

@buffalojoec buffalojoec force-pushed the core-bpf-upgradeables branch from 70c605b to f82d301 Compare March 21, 2024 02:04
@buffalojoec buffalojoec marked this pull request as ready for review March 21, 2024 02:04
@buffalojoec
Copy link
Author

Note this can go in separate from #318.

@buffalojoec buffalojoec force-pushed the core-bpf-upgradeables branch from f82d301 to baea4fe Compare March 22, 2024 16:53
Copy link

@CriesofCarrots CriesofCarrots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Despite the number of comments, this seems pretty close. Nothing major 😅

@buffalojoec buffalojoec force-pushed the core-bpf-upgradeables branch 4 times, most recently from a830220 to 419262b Compare March 23, 2024 12:59
@buffalojoec buffalojoec force-pushed the core-bpf-upgradeables branch from 28e5e42 to 6aea930 Compare March 26, 2024 03:10
@buffalojoec buffalojoec merged commit 3627038 into anza-xyz:master Mar 26, 2024
37 checks passed
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.

3 participants