Skip to content

fix(host): balance/tx_hash/tx_value/consume_gas are void (cross-language signature parity) - #17

Merged
zarah-s merged 1 commit into
mainfrom
go-sdk/hostfn-sig-parity
Jul 29, 2026
Merged

fix(host): balance/tx_hash/tx_value/consume_gas are void (cross-language signature parity)#17
zarah-s merged 1 commit into
mainfrom
go-sdk/hostfn-sig-parity

Conversation

@zarah-s

@zarah-s zarah-s commented Jul 29, 2026

Copy link
Copy Markdown
Member

The engine registers these four host fns with no result; Rust/AS/C still declared an i32/int32_t return, 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 in check_parity.py as a fast-follow to prevent recurrence. rust/pyde-host builds clean; no caller used the dropped returns.

…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.
@zarah-s
zarah-s merged commit b78ecf9 into main Jul 29, 2026
@zarah-s
zarah-s deleted the go-sdk/hostfn-sig-parity branch July 29, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant