fix(host): balance/tx_hash/tx_value/consume_gas are void (cross-language signature parity) - #17
Merged
Merged
Conversation
…parity) The engine registers these host fns with no result (verified against the func_wrap registrations + the otigen-abi validator). The Go bindings were already fixed; Rust/AS/C still declared an i32 result, which makes a contract that calls them fail wasmtime import type-checking at deploy. - rust/pyde-host/src/lib.rs: balance + consume_gas externs → void, and the consume_gas safe wrapper drops its (always-garbage) i32 return. - assemblyscript/assembly/host_fns.ts: balance + consume_gas → void (tx_hash/tx_value were already void). - c/include/pyde/host.h: balance + tx_hash + tx_value + consume_gas → void. The wire-name-only parity CI can't see result-arity drift, which is how this diverged across languages — a signature check in check_parity.py is the follow-up that prevents recurrence. rust/pyde-host builds clean for wasm32-unknown-unknown; no caller used the dropped returns.
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.
The engine registers these four host fns with no result; Rust/AS/C still declared an
i32/int32_treturn, so a contract calling them fails wasmtime import type-checking at deploy. Go was already fixed. This aligns Rust, AssemblyScript, and C to the engine. The wire-name-only parity CI can't catch result-arity drift — recommend a signature check incheck_parity.pyas a fast-follow to prevent recurrence.rust/pyde-hostbuilds clean; no caller used the dropped returns.