Repository navigation
Metering for Bulk Memory Opcodes + Opcode Version - #79
Merged
Merged
Conversation
andrei-marinica
marked this pull request as draft
July 21, 2025 11:40
laurci
marked this pull request as ready for review
August 20, 2025 07:27
sasurobert
approved these changes
Aug 20, 2025
andrei-marinica
approved these changes
Aug 20, 2025
andrei-marinica
requested changes
Aug 20, 2025
sasurobert
reviewed
Aug 21, 2025
unsafe mode hooks
ZK crypto hooks
Merge master -> rc/after-supernova
Merge master -> rc/after-supernova
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical metering correctness, cache enforcement, import compatibility, and public ABI regressions remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 8
Open (8)
Removing managed crypto hooks breaks the public C/Wasm ABI · New Renaming the opcode cost symbol breaks existing native consumers · New Removing hook table fields breaks the public ABI layout · New Removing pairing imports breaks existing Wasm modules · New Cached modules bypass opcode version configuration checks · New Missing i32-to-i64 conversion breaks backup GlobalSet typing · New Missing i64-to-i32 conversion breaks injected GlobalGet typing · New Removing VM hooks breaks host and contract compatibility · New
andrei-marinica
approved these changes
Sep 28, 2026
Merge branch 'master' into rc/after-supernova
andrei-marinica
marked this pull request as draft
September 29, 2026 18:25
andrei-marinica
marked this pull request as ready for review
October 9, 2026 12:32
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.

Bulk memory opcodes and versioned opcode configuration
Summary
This PR adds support for WebAssembly bulk-memory operations and makes opcode configuration explicitly versioned across the Rust and C APIs.
OpcodeVersionandOpcodeConfig; V1 remains the default legacy opcode set, while V2 enablesmemory.copyandmemory.fill.memory.initanddata.dropremain unsupported.repr(C)mirrors for compilation options and opcode costs, and replacevm_exec_set_opcode_costswith version-awarevm_exec_set_opcode_config.Gas accounting
For both
memory.copyandmemory.fill, the charged gas is:The base cost applies to zero-byte operations as well. The instrumentation preserves the size operand on the WebAssembly stack.
Compatibility
OpcodeVersion::V1by default and cannot instantiate modules that use bulk-memory operations.memory.copyormemory.fillmust configureOpcodeVersion::V2with the corresponding opcode costs.vm_exec_set_opcode_coststovm_exec_set_opcode_config, passing the opcode-version code and the ABI-safe opcode-cost structure.Tests
memory.copymodule is rejected by V1 and accepted by V2.