From ecc8075f41deb0de9dbda3adc0f0b3c31e1bc3fa Mon Sep 17 00:00:00 2001 From: Sueun Cho Date: Wed, 8 Apr 2026 12:32:55 -0400 Subject: [PATCH] chain/ethereum: Include contract address and block number in ABI decode error messages Add contract address and block number context to ABI decode error messages to help debugging. Fixes graphprotocol/graph-node#3404 --- chain/ethereum/src/data_source.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/chain/ethereum/src/data_source.rs b/chain/ethereum/src/data_source.rs index b2303b6d053..ad1ddfb9419 100644 --- a/chain/ethereum/src/data_source.rs +++ b/chain/ethereum/src/data_source.rs @@ -857,8 +857,10 @@ impl DataSource { .abi_decode_input(&call.input.0[4..]) .with_context(|| { format!( - "Generating function inputs for the call {:?} failed, raw input: {}", + "Generating function inputs for the call {:?} failed, contract: {:#x}, block: {}, raw input: 0x{}", &function_abi, + call.to, + call.block_number, hex::encode(&call.input.0) ) }) { @@ -889,8 +891,11 @@ impl DataSource { .abi_decode_output(&call.output.0) .with_context(|| { format!( - "Decoding function outputs for the call {:?} failed, raw output: {}", + "Decoding function outputs for the call {:?} failed, contract: {:#x}, block: {}, input: 0x{}, raw output: 0x{}", &function_abi, + call.to, + call.block_number, + hex::encode(&call.input.0), hex::encode(&call.output.0) ) })?;