forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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 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.