Skip to content

build(deps): bump wasm-instrument from 0.2.0 to 0.4.0#6526

Open
dependabot[bot] wants to merge 1 commit intomasterfrom
dependabot/cargo/wasm-instrument-0.4.0
Open

build(deps): bump wasm-instrument from 0.2.0 to 0.4.0#6526
dependabot[bot] wants to merge 1 commit intomasterfrom
dependabot/cargo/wasm-instrument-0.4.0

Conversation

@dependabot
Copy link
Copy Markdown
Contributor

@dependabot dependabot Bot commented on behalf of github Apr 20, 2026

Bumps wasm-instrument from 0.2.0 to 0.4.0.

Changelog

Sourced from wasm-instrument's changelog.

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

The semantic versioning guarantees cover the interface to the substrate runtime which includes this pallet as a dependency. This module will also add storage migrations whenever changes require it. Stability with regard to offchain tooling is explicitly excluded from this guarantee: For example adding a new field to an in-storage data structure will require changes to frontends to properly display it. However, those changes will still be regarded as a minor version bump.

The interface provided to smart contracts will adhere to semver with one exception: Even major version bumps will be backwards compatible with regard to already deployed contracts. In other words: Upgrading this pallet will not break pre-existing contracts.

[Unreleased]

New

  • Add new gas metering method: mutable global + local gas function #34
  • Account for locals initialization costs #38

[v0.3.0]

Changed

  • Use 64bit arithmetic for per-block gas counter #30
Commits
  • 6a79d1d Charge gas for local variables on the callee side (#38)
  • b517010 Update wasmparser requirement from 0.94 to 0.95 (#37)
  • a4dde28 Add new gas metering method: mutable global + local gas function (#34)
  • 90cb67d Update wasmparser requirement from 0.92 to 0.94 (#36)
  • 4c1d47a Update wasmparser requirement from 0.90 to 0.92 (#33)
  • 840af19 Update criterion requirement from 0.3 to 0.4 (#31)
  • 0229f86 Use u64 for gas counter (#30)
  • c2db4b8 Update wasmparser requirement from 0.89 to 0.90 (#28)
  • 1ade161 Update wasmparser requirement from 0.88 to 0.89 (#27)
  • 25ff883 Update wasmparser requirement from 0.87 to 0.88 (#26)
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file rust Pull requests that update Rust code labels Apr 20, 2026
@lutter lutter force-pushed the dependabot/cargo/wasm-instrument-0.4.0 branch 2 times, most recently from 61cafaa to 86baa99 Compare April 22, 2026 13:48
Bumps [wasm-instrument](https://github.com/paritytech/wasm-instrument)
from 0.2.0 to 0.4.0.

- [Changelog](https://github.com/paritytech/wasm-instrument/blob/master/CHANGELOG.md)
- [Commits](paritytech/wasm-instrument@0.2.0...v0.4.0)

The new version switches the per-block gas counter and the
`memory.grow` charge helper from 32-bit to 64-bit arithmetic. Our call
sites were adjusted accordingly:

- `runtime/wasm/src/mapping.rs`: use the new `host_function::Injector`
  backend API for `gas_metering::inject`.
- `runtime/wasm/src/gas_rules.rs`: implement the new
  `call_per_local_cost()` method, returning 0 so locals initialization
  remains free.
- `runtime/wasm/src/module/instance.rs`: the injected `gas` host
  function now receives an `i64` cost argument instead of `i32`;
  update the Rust handler signature from `u32` to `u64`.

The 64-bit arithmetic in the grow-counter helper also fixes an
overflow that was previously under-charging gas for large
`memory.grow` calls. In 0.2.0 the helper multiplied the page count by
`gas_per_page` (~50.8M in our rules) using `I32Mul`, which wrapped
mod 2^32 for any grow larger than ~84 pages (~5.25 MiB). 0.4.0 extends
the page count to `i64` before the multiplication, so the full cost is
charged.

The two `yaml_parsing_v0_0_*` tests in `runtime/test/src/test.rs`
pin exact `gas_used` totals. The YAML input
`"x".repeat(10_000_001)` causes three large grow events, so each test
reports exactly `3 * 2^32 = 12,884,901,888` more gas than before.
Update the expected values to match the now-correct totals.

Note for downstream: this is a semantic change in gas accounting for
subgraph handlers that grow memory past ~5.25 MiB in a single call.
Such handlers will consume more gas than they did on 0.2.0; this may
warrant a release note or API-version gating, which is out of scope
for this dependency bump.

Signed-off-by: dependabot[bot] <support@github.com>
@lutter lutter force-pushed the dependabot/cargo/wasm-instrument-0.4.0 branch from 86baa99 to d6725e9 Compare April 22, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant