graphprotocol / graphprotocol/graph-node

[Bug] Reverted calls aren't filtered from the firehose

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

Nobody has claimed this yet.

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

Description

Bug report

This is in reference to issue #3701 and the PR #3762 that was meant to address it when the firehose is used. In that PR the following is written:

In firehose, this means that we must use state_reverted field to correctly skip calls that had no effect on the chain.

That change was implemented, but then it was immediately undone to "align firehose with RPC behavior" (which previous discussions established is incorrect and potentially unfixable).

The result of that PR is that calls where only state_reverted is true are still processed as successful calls because both status_reverted and status_failed are false. This goes against the explanation for that field in the firehose proto spec.

Test case: a call from this transaction is present in the linked subgraph (in the liquidityChanges table) despite both calls to our contract having their state changes reverted (but only the second call has status_failed=true).

Is there a reason for this behavior? Shouldn't this line also have a !call.state_reverted condition?
Or is there a different way to filter out state_reverted=true calls?

Relevant log output

IPFS hash

No response

Subgraph name or link to explorer

https://thegraph.com/explorer/subgraphs/DyHaLYK1keqcv3YD3VczKGYvxQGfGgV6bGTbZLMj5xME

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 in chain/ethereum/src/codec.rs around line 367 and compare the call filtering there with the state_reverted definition in chain/ethereum/proto/ethereum.proto lines 358-379. Review the linked issue #3701 and PR #3762 history to understand the intended firehose behavior. Done means calls with state_reverted=true are no longer processed as successful calls, with coverage for the reported transaction shape.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.