Skip to content

polymesh pr 99 + WASM host-function import diffing#101

Draft
gilescope wants to merge 12 commits into
chevdor:masterfrom
gilescope:giles-polymesh-pr-99
Draft

polymesh pr 99 + WASM host-function import diffing#101
gilescope wants to merge 12 commits into
chevdor:masterfrom
gilescope:giles-polymesh-pr-99

Conversation

@gilescope

@gilescope gilescope commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

This is the combination of polymesh's #99 + WASM host import diffing against latest main.

Neopallium and others added 12 commits December 10, 2024 01:44
…hecking

# Conflicts:
#	libs/substrate-differ/src/differs/reduced/calls/changes_comptible.rs
#	libs/substrate-differ/src/differs/reduced/calls/changes_require_txver_bump.rs
#	libs/substrate-differ/src/differs/reduced/diff_analyzer/compatible.rs
Detect runtime upgrades that add new WASM host imports — old node binaries
that lack the corresponding host implementation will fail to execute the
runtime.

- wasm-testbed: parse the WASM ImportSection via wasmparser and expose
  WasmTestBed::imports() returning (module, name) pairs.
- substrate-differ: new ReducedImport struct, ReducedRuntime carries a
  BTreeMap<String, ReducedImport> populated via with_imports(); the
  Comparable derive yields a ReducedRuntimeChange::Imports variant.
- Diff analyzer: a new (Added) import marks the runtime incompatible
  (the node must support it); removed/changed are compatible and never
  affect tx_version or storage layout.
- Display: print the import list and surface 'New host fn imports: N'
  in the summary alongside the existing compatibility/tx-bump/storage
  migration lines.

Composes with PolymeshAssociation/subwasm#99 — orthogonal layer:
that PR diffs metadata; this one diffs the WASM binary's import section.
@Neopallium

Copy link
Copy Markdown

Nice! I hadn't thought to also check host function imports.

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