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 Built-In Programs to BPF #7

Closed
wants to merge 17 commits into from

Conversation

buffalojoec
Copy link
Owner

@buffalojoec buffalojoec commented Feb 8, 2024

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.

yihau and others added 17 commits February 7, 2024 15:17
* ci: add new ci docker image

* ci: use the new docker image

* fix shellcheck

* add readme for the new docker image

* remove old docker images

* remove unused check in docs/build.sh

* use the new image in net.sh
* build(deps): bump js-sys from 0.3.67 to 0.3.68

Bumps [js-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.67 to 0.3.68.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

---
updated-dependencies:
- dependency-name: js-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* [auto-commit] Update all Cargo lock files

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <[email protected]>
* build(deps): bump wasm-bindgen from 0.2.90 to 0.2.91

Bumps [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen) from 0.2.90 to 0.2.91.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](rustwasm/wasm-bindgen@0.2.90...0.2.91)

---
updated-dependencies:
- dependency-name: wasm-bindgen
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* [auto-commit] Update all Cargo lock files

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <[email protected]>
* build(deps): bump bytemuck from 1.14.1 to 1.14.2

Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.14.1 to 1.14.2.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](Lokathor/bytemuck@v1.14.1...v1.14.2)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>

* [auto-commit] Update all Cargo lock files

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: dependabot-buildkite <[email protected]>
* remove activated feature set_exempt_rent_epoch_max

* fix test_rent_eager_collect_rent_in_partition test

* update hash values for test_bank_hash_consistency

* clean up commas
The  commit migrates away from legacy shreds in duplicate shreds tests.
@buffalojoec buffalojoec closed this Feb 8, 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.

5 participants