hashgraph/hedera-the-graph

Indexing Issue due to missing Synthetic Txs on Graph-Node Indexer Cache

AlfredoG87 opened this issue · 0 comments

Description

Sometimes a block requested from the HEDERA-JSON-RPC-RELAY does not include all the synthetic transactions yet, since these transactions are created using logs, is really seldom but it happens from time to time.

eth_getBlockByHash or eth_getBlockByNumber

However TheGraph indexer knows those transactions should exists on that block since it got the txs from using the method eth_getLogs so it proceeds to check for that block, but in some cases that block was gotten corrupted, since the block does not have those transactions included (at least the version on the cache).

see Relay related issue: Indexing issue using The-Graph#1789

Steps to reproduce

Reproducing this issue requires some amount of patience.

deploy the hedera-the-graph using the helm instructions on the charts folder of the repo: https://github.com/hashgraph/hedera-the-graph/tree/main/charts/hedera-the-graph

deploy a sub-graph of a HTS token that contains a lot of transactions, in this case we used the smart contract for SAUCE token 0x00000000000000000000000000000000000b2ad5
using as reference the example sub-graph on the relay repo: https://github.com/hashgraph/hedera-json-rpc-relay/tree/main/tools/subgraph-example

index from at least block: 45000100

see the status of the index using a similar command to this:

{
    indexingStatusesForSubgraphName(subgraphName: "saucer-hts-token") {
        synced
        health
        nonFatalErrors {
            message
            block {
                number
                hash
            }
            handler
            deterministic
        }
        fatalError {
            message
            block {
                number
                hash
            }
            handler
        }
        chains {
            chainHeadBlock {
                number
            }
            latestBlock {
                number
            }
        }
    }
}

an issue similar to this one will appear close to finishing the indexing of the sub-graph:

{
  "data": {
    "indexingStatusesForSubgraphName": [
      {
        "synced": false,
        "health": "failed",
        "nonFatalErrors": [],
        "fatalError": {
          "message": "failed to process trigger: block #51442539 (0xd865…e07b), transaction e829d79fbbefc65401ac348771db84e99d1be6fa5d8729c2cdfd7695968115ce: Found no transaction for event",
          "block": {
            "number": "51442539",
            "hash": "0xd865682ec69042f0cc841b338a676c4e90e5bed418cc7d71f5d906082cbce07b"
          },
          "handler": null
        },
        "chains": [
          {
            "chainHeadBlock": {
              "number": "51454693"
            },
            "latestBlock": {
              "number": "51442391"
            }
          }
        ]
      }
    ]
  }
}

Additional context

No response

Hedera network

mainnet

Version

v0.33.0

Operating system

Other