[CORRUPTED] Synthetic Benchmark PR #15923 - [bench] fix(runtime): charge contract-loading gas on Module::deserialize failure - #2
Open
amirzaushnizer wants to merge 3 commits into
Conversation
A Wasm module that breaches the Wasmtime pooling-allocator instance limits (e.g. ~100k globals) compiles and serializes fine but fails at `Module::deserialize`. That failure short-circuits out as `VMRunnerError::LoadingError` before `before_loading_executable` runs, and `function_call.rs` maps it to a zero-gas nop — so the contract-loading work is performed but never charged. The `FixContractLoadingCost`@129 charge point is downstream of the early return and does not cover this path, so the undercharge is protocol-independent. Gate a fix behind the new `FixContractLoadingError` protocol feature - we may want to combine it with some other Protocol upgrades. Carry the deserialize failure as a `FunctionCallError` (mirroring the adjacent memory-export check) so it flows through the loading-fee charge and finalizes as a gas-bearing abort instead of a nop. Pre-feature behaviour is unchanged. The flag lives only on the internal `vm::Config`, not on the public `VMConfigView`. wasmtime-only (the production VM).
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Benchmark PR near#15923
Type: Corrupted (contains bugs)
Original PR Title: [bench] fix(runtime): charge contract-loading gas on Module::deserialize failure
Original PR Description: Reconstructed for skills benchmark from near#15923
Original PR URL: near#15923