graphprotocol / graphprotocol/graph-node

Subgraph failing on eth_call reverts despite handling reverts in mappings

Open
#5,534 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Rust
Stars
3.2k
Forks
1.1k
Avg merge
4d 1h
Merged PRs (30d)
1

Description

Bug report

This subgraph failed with the error below.

Handler skipped due to execution failure, transaction: 0x99dc…deec, address: 0x5200…2584, signature: Transfer(indexed address,indexed address,indexed uint256), error: transaction 99dcc8e858854ac580ad6a88b5cdefe0ae8d9e9dbef4d07b7f96418c5f17deec: error while executing at wasm backtrace: 0: 0x32b9 - <unknown>!~lib/@graphprotocol/graph-ts/chain/ethereum/ethereum.CallResult<~lib/array/Array<~lib/@graphprotocol/graph-ts/chain/ethereum/ethereum.Value>>#get:value 1: 0x3e17 - <unknown>!src/mapping/handleTransfer: Mapping aborted at ~lib/@graphprotocol/graph-ts/chain/ethereum.ts, line 714, column 7, with message: accessed value of a reverted call, please check the `reverted` field before accessing the `value` field, handler: handleTransfer

Relevant log output

{
    "jsonrpc": "2.0",
    "error": {
        "code": -32015,
        "message": "VM execution error.",
        "data": "revert"
    },
    "id": 2
}
{
    "jsonrpc": "2.0",
    "error": {
        "code": -32015,
        "message": "VM execution error.",
        "data": "Reverted ERC721: invalid token ID"
    },
    "id": 44
}
IPFS hash

No response

Subgraph name or link to explorer

No response

Some information to help us out
  • Tick this box if this bug is caused by a regression found in the latest release.
  • Tick this box if this bug is specific to the hosted service.
  • I have searched the issue tracker to make sure this issue is not a duplicate.
OS information

None

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the reported ethereum.ts line 714 and trace how CallResult handles reverted eth_call results during handleTransfer. Use the supplied JSON-RPC errors and WASM backtrace to reproduce the failure; done means mappings that handle reverts no longer abort by accessing a reverted call value.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
backend, blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.