Skip to content

graph, runtime: Add ethereum.decodeParams host function#6649

Merged
incrypto32 merged 1 commit into
masterfrom
incrypto32/ethereum-decode-params
Jul 15, 2026
Merged

graph, runtime: Add ethereum.decodeParams host function#6649
incrypto32 merged 1 commit into
masterfrom
incrypto32/ethereum-decode-params

Conversation

@incrypto32

@incrypto32 incrypto32 commented Jun 26, 2026

Copy link
Copy Markdown
Member

ethereum.decode decodes input as a single ABI value, which fails on calldata/
event data whose top-level type is a dynamic tuple (e.g. Gnosis execTransaction)
— that data is ABI parameter-encoded, with no leading offset word.

Adds ethereum.decodeParams (uses abi_decode_params), gated behind apiVersion
0.0.10. ethereum.decode is unchanged, so no deployed subgraph is affected.

graph-ts binding: graphprotocol/graph-tooling#2143. Integration test to follow
once graph-ts publishes.

Fixes #5432

ethereum.decode decodes its input as a single ABI value, which fails for
calldata/event data whose top-level type is a tuple with a dynamic field
(e.g. Gnosis Safe execTransaction): such data is encoded as ABI function
parameters and has no leading offset word. Add ethereum.decodeParams,
which decodes via abi_decode_params, and gate it behind api version
0.0.10. ethereum.decode is left unchanged.

Fixes #5432
@incrypto32
incrypto32 force-pushed the incrypto32/ethereum-decode-params branch from 98bd9d7 to c690a8b Compare June 26, 2026 09:16

@lutter lutter left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we needed only one host function, i.e., if we could use ethereum.decode for both, but if not, this is a nice enhancement

@incrypto32

Copy link
Copy Markdown
Member Author

Tried folding it into decode, but they're different ops (abi_decode_params vs abi_decode) and you can't tell the layouts apart from the bytes alone. So it has to be caller intent, else you're guessing. Kept them separate to be safe.

@incrypto32
incrypto32 merged commit 77d0e06 into master Jul 15, 2026
6 checks passed
@incrypto32
incrypto32 deleted the incrypto32/ethereum-decode-params branch July 15, 2026 06:52
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.

ethereum.decode does not decode Gnosis Multisig Transactions

2 participants