feat: add build targets for building a runtime without custom host function references, suitable for using with Chopsticks#2651
Merged
JoeCap08055 merged 11 commits intomainfrom Jan 5, 2026
Conversation
…nction references, suitable for using with Chopsticks
aramikm
reviewed
Dec 10, 2025
Collaborator
aramikm
left a comment
There was a problem hiding this comment.
You need to bump the version for runtime since you are adding a new runtime
JoeCap08055
commented
Dec 10, 2025
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
JoeCap08055
commented
Dec 26, 2025
Comment on lines
+270
to
+273
| // Block reindex_offchain if we've disabled custom host functions | ||
| #[cfg(feature = "no-custom-host-functions")] | ||
| RuntimeCall::Msa(pallet_msa::Call::reindex_offchain { .. }) => false, | ||
|
|
Collaborator
Author
There was a problem hiding this comment.
Keeping consistent with existing precedent: rather than remove this extrinsic from the pallet (which would cause metadata to be different), if custom host functions are disabled we simply filter the call.
JoeCap08055
commented
Jan 2, 2026
| - name: Set Up Cargo Deny | ||
| run: | | ||
| cargo install --force --locked cargo-deny@0.18.5 | ||
| cargo install --force --locked cargo-deny@0.18.9 |
Collaborator
Author
There was a problem hiding this comment.
Had to bump cargo-deny because the latest advisory DB was not parseable with 0.18.5. Selected the current latest, 0.18.9
JoeCap08055
commented
Jan 2, 2026
| { id = "RUSTSEC-2025-0057", reason = "Remove when https://github.com/paritytech/polkadot-sdk/pull/8714 is merged into a stable release. (Should be in stable2509 tag)"}, | ||
| { id = "RUSTSEC-2025-0118", reason = "Remove when polkadot-sdk updates to a fixed wasmtime."} | ||
| { id = "RUSTSEC-2025-0118", reason = "Remove when polkadot-sdk updates to a fixed wasmtime."}, | ||
| { id = "RUSTSEC-2025-0137", reason = "Transitive dependency polkadot-sdk => alloy-primitives => ruint; Fixed ruint >= 1.17.1. No dependency fixes upstream yet." } |
Collaborator
Author
There was a problem hiding this comment.
Added an exception. No fixes yet in the dependency path; probably not until polkadot-sdk@stable2603 at least.
This file contains hidden or 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
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.
Goal
The goal of this PR is to enable building a WASM runtime that can be used directly with Chopsticks to build blocks.
Chopsticks runs its own node code that does not include Frequency's custom host functions. While it is possible to instruct Chopsticks to ignore unresolved host function references when loading the WASM, there remains the problem that any runtime calls to the unresolved host function(s) will result in a WASM trap/abort.
This PR adds a new Cargo feature flag,
no-host-functions, that causes the WASM runtime to be compiled without any compile-time OR runtime references to custom host functions, thereby enabling such a runtime to be used to produce blocks when running under Chopsticks.Usage
In order to build a WASM runtime suitable for using with Chopsticks, see the README
Checklist