Skip to content

[Bug] Graphnode can no longer parse traces with results missing output field #6489

@Isarafanikov

Description

@Isarafanikov

Bug report

When encountering a trace with callresult having missing output field, graphnode fails to parse it.

In previous graphnode versions, an output field of call trace result was specifically made optional (#[serde(default)])

https://github.com/graphprotocol/rust-web3/blob/585c9db21576fd9aace40607b764ec870a5faebb/src/types/trace_filtering.rs#L158-L165

In v0.42, graphnode switched to the alloy instead, which has the output field as a non-optional, which causes this issue

https://github.com/alloy-rs/alloy/blob/76aa416c661c370e588b9632d34d8e5062ab00f5/crates/rpc-types-trace/src/parity.rs#L444-L450

example trace (sonic chain):

{
  "action": {
    "from": "0xf7cf0d9398d06d5cb7e4d37dc1e18a829bfff934",
    "value": "0x0",
    "gas": "0x0",
    "init": "0x",
    "address": "0xf7cf0d9398d06d5cb7e4d37dc1e18a829bfff934",
    "refund_address": "0x4c3ccc98c01103be72bcfd29e1d2454c98d1a6e3",
    "balance": "0x0"
  },
  "blockHash": "0x6b747793a61c3ce4e5f3355cf80edcb6aa465913ed43f4b0136d93803cf330f3",
  "blockNumber": 66762070,
  "result": {
    "gasUsed": "0x0"
  },
  "subtraces": 0,
  "traceAddress": [
    1,
    1
  ],
  "transactionHash": "0x5b3dc50c4c7bd9b0e80469b21febbc5d1b54b364a01b22b1e9c426e4632e0b8f",
  "transactionPosition": 0,
  "type": "suicide"
}

Relevant log output

Apr 07 09:43:20.816 WARN Trying again after trace_filter RPC call for block range: [66762070..66762070] failed (attempt #10) with result Err(deserialization error: data did not match any variant of untagged enum TraceOutput at line 1 column 178362
[/* ... */,{"action":{"from":"0xf7cf0d9398d06d5cb7e4d37dc1e18a829bfff934","value":"0x0","gas":"0x0","init":"0x","address":"0xf7cf0d9398d06d5cb7e4d37dc1e18a829bfff934","refund_address":"0x4c3ccc98c01103be72bcfd29e1d2454c98d1a6e3","balance":"0x0"},"blockHash":"0x6b747793a61c3ce4e5f3355cf80edcb6aa465913ed43f4b0136d93803cf330f3","blockNumber":66762070,"result":{"gasUsed":"0x0"},"subtraces":0,"traceAddress":[1,1],"transactionHash":"0x5b3dc50c4c7bd9b0e80469b21febbc5d1b54b364a01b22b1e9c426e4632e0b8f","transactionPosition":0,"type":"suicide"}]

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions