graphprotocol / graph-node

Graph Node indexes data from blockchains such as Ethereum and serves it over GraphQL
https://thegraph.com
Apache License 2.0
2.92k stars 984 forks source link

[Feature] Display the full JSON-RPC call in the logs that failed #3404

Open schmidsi opened 2 years ago

schmidsi commented 2 years ago

Currently if something goes wrong with a JSON RPC call (eth-calls, decoding, etc) there is just a message like this displayed:

failed to process trigger: block #21041413 (0x0000…b378), transaction a44fa1857fa5448419ff94682de1ffeccaa74eb0d6dc9d0de8fe37c6c2a90746: Decoding function outputs for the call Function { name: "withdraw", inputs: [], outputs: [Param { name: "", kind: Uint(256), internal_type: None }], constant: None, state_mutability: NonPayable } failed, raw output: : Invalid name: please ensure the contract and method you're calling exist! failed to decode empty bytes. if you're using jsonrpc this is likely due to jsonrpc returning 0x in case contract or method don't exist

(From this example subgraph: https://thegraph.com/hosted-service/subgraph/bsamuels453/yearn-fantom-validation?selected=logs, deployment id: QmNhTkng5LLvdCXbK6JSoeU8tSW18wo3tPpm5mMM3Sd4FY)

This alone does not provide enough information to reproduce.

What is the expected behavior?

It would be great to have the exact JSON RPC call written in the logs so we can reproduce and troubleshoot the underlying issue.

schmidsi commented 2 years ago

For context, this is the transaction that failed with the above error: https://ftmscan.com/tx/0xa44fa1857fa5448419ff94682de1ffeccaa74eb0d6dc9d0de8fe37c6c2a90746

0xbe1 commented 2 years ago

logging RPC call details is very helpful since currently there is nothing subgraph devs can do when a smart contract call fails :) I run into an RPC call issue recently that I couldn't figure out why the RPC call fails, see https://discordapp.com/channels/438038660412342282/438070183794573313/983912358038618162

ef3n9r98 commented 1 year ago

Hi @leoyvens, I know some devs who'd be interested in working on this. Is there a budget for fixing this issue, and if so, how much?

I'd put this issue up on OpenQ.

Thanks!