chore(workspace): bump wasmer to v7.1#5274
chore(workspace): bump wasmer to v7.1#5274StackOverflowExcept1on wants to merge 7 commits intomasterfrom
Conversation
Changed Files
|
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request upgrades the Wasmer dependency to version 7.1.0 throughout the workspace. This change is primarily preparatory, ensuring the codebase is aligned with the latest version of Wasmer to support potential future adoption of WebAssembly 2.0 features, without introducing any breaking changes. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the wasmer execution engine and its related components from version 6.1.0 to 7.1.0, resulting in extensive dependency updates in Cargo.lock. Feedback highlights a high-severity concern regarding the risks of this major version upgrade for a consensus-critical protocol, specifically pointing out potential breaking API changes, the introduction of experimental dependencies like wasip3, and a lack of benchmarking or regression testing to ensure protocol determinism and safety.
|
Suspicious weights of instructions: |
|
@codex we have detected suspicious weight changes for i32shrs and i32shru instructions: Try to find why. Also, check wasmer changelog and commits since we updated wasmer version |
|
I looked, and it's probably related to these changes, but I'm not sure. We'll need to debug the JIT code generation. https://github.com/wasmerio/wasmer/blob/v7.1.0/lib/compiler-singlepass/src/codegen.rs#L1327-L1336 https://github.com/wasmerio/wasmer/blob/v7.1.0/lib/compiler-singlepass/src/codegen.rs#L617-L628 |
Summary
Wasmer changelog/commit check (requested)
Testing
|
| i32shrs: cost_instr::<T>(W::<T>::instr_i32shrs, 1), | ||
| i64shru: cost_instr::<T>(W::<T>::instr_i64shru, 2), | ||
| i32shru: cost_instr::<T>(W::<T>::instr_i32shru, 2), | ||
| i32shru: cost_instr::<T>(W::<T>::instr_i32shru, 1), |
There was a problem hiding this comment.
** changed from 2 to 1 for and only**
binary_instr_32 (used to benchmark these instructions) calls bit_width.random_repeated(2), pushing two operands onto the stack — identical to how every other binary instruction benchmark works. The analogous instructions all use num_params=2:
i64shrs/i64shru→num_params=2(unchanged)i32shl/i64shl→num_params=2(unchanged)- All other binary i32 ops (
i32add,i32and,i32or, ...) →num_params=2
Using num_params=1 here subtracts only one i64.const-equivalent cost instead of two, resulting in a higher (over-estimated) gas charge for i32.shr_s and i32.shr_u compared to equivalent binary operations. This would systematically charge programs more for these two specific instructions.
Could you add a comment explaining why 1 operand is the correct parameter count here (e.g. if the benchmark setup for 32-bit shifts is intentionally asymmetric)?
SummaryBenchmark weight update across the Vara runtime — instruction, syscall, memory, DB, and instrumentation weights refreshed from new benchmark runs (April 2026), plus a wasmer upgrade from 6.1.0 to 7.1.0. Findings
|
(module
(func $init (export "init")
(i32.shr_s (i32.const 1) (i32.const 9))
(drop)
)
)wasmer 7.1 mov ecx, 9 ; +0 = 40 b9 09 00 00 00
mov r8d, 1 ; +6 = 41 b8 01 00 00 00
sar r8d, cl ; +12 = 41 d3 f8 wasmer 6.1 mov ecx, 9 ; +0 = 40 b9 09 00 00 00
mov esi, 1 ; +6 = 40 be 01 00 00 00
sar esi, cl ; +12 = 40 d3 fe |
https://github.com/wasmerio/wasmer/blob/main/CHANGELOG.md
Notable for us:
No breaking changes, just preparation if we ever want to use/bench WASM v2 features:
Quick research on WASM features, their support complexity, and benefits:
multivalue🟢mutable-globals(already supported)reference-types🔴 (although we can skip many instructions at first)sign-ext(already supported)nontrapping-fptoint(no need to support since we don't support floats)bulk-memory🟡memcpy/memset/memmoveand they are not the most optimal, probably this can also be useful for asynchronous execution