Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subgraph saucerswap-v1 has indexing issues #104

Closed
AlfredoG87 opened this issue Jun 14, 2024 · 1 comment
Closed

Subgraph saucerswap-v1 has indexing issues #104

AlfredoG87 opened this issue Jun 14, 2024 · 1 comment
Assignees
Labels
Bug A error that causes the feature to behave differently than what was expected based on design docs
Milestone

Comments

@AlfredoG87
Copy link
Contributor

AlfredoG87 commented Jun 14, 2024

Description

{
    "data": {
        "indexingStatusesForSubgraphName": [
            {
                "health": "failed",
                "nonFatalErrors": [],
                "fatalError": {
                    "message": "Mapping aborted at ~lib/@graphprotocol/graph-ts/chain/ethereum.ts, line 448, column 6, with message: Call reverted, probably because an `assert` or `require` in the contract failed, consider using `try_getPair` to handle this in the mapping.\twasm backtrace:\t    0: 0x1c43 - <unknown>!~lib/@graphprotocol/graph-ts/chain/ethereum/ethereum.SmartContract#call\t    1: 0x328a - <unknown>!src/types/templates/Pair/Factory/Factory#getPair\t    2: 0x3361 - <unknown>!src/mappings/pricing/findEthPerToken\t    3: 0x3760 - <unknown>!src/mappings/core/handleSync\t in handler `handleSync` at block #43665956 (f85dc43b434a8ca1620441f5923b14358148607f08d48c3547aa25e3fc8e6a61)",
                    "block": {
                        "number": "43665956",
                        "hash": "0xf85dc43b434a8ca1620441f5923b14358148607f08d48c3547aa25e3fc8e6a61"
                    },
                    "handler": null
                },
                "chains": [
                    {
                        "chainHeadBlock": {
                            "number": "65148267"
                        },
                        "latestBlock": {
                            "number": "43665956"
                        }
                    }
                ],
                "synced": false,
                "subgraph": "QmfAMQgq7VmDk3Z7ftwiLiHRUW6SndqxYCkGkZoTrSr27d"
            }
        ]
    }
}

Steps to reproduce

Run the following GraphQL query on the indexing endpoint for mainnet

https://mainnet-thegraph.swirldslabs.com/graphql

{
    indexingStatusesForSubgraphName(subgraphName: "saucerswap/saucerswap-v1") {
        health
        nonFatalErrors {
            message
            block {
                number
                hash
            }
            handler
            deterministic
        }
        fatalError {
            message
            block {
                number
                hash
            }
            handler
        }
        chains {
            chainHeadBlock {
                number
            }
            latestBlock {
                number
            }
        }
        synced
        subgraph
    }
}

Additional context

No response

Hedera network

mainnet

Version

v0.1.1

Operating system

None

@AlfredoG87 AlfredoG87 added the Bug A error that causes the feature to behave differently than what was expected based on design docs label Jun 14, 2024
@AlfredoG87 AlfredoG87 moved this to Tasks In Progress in Smart Contract Sprint Board Jun 14, 2024
@AlfredoG87 AlfredoG87 added this to the 0.2.0 milestone Jun 14, 2024
@acuarica acuarica moved this from Tasks In Progress to Blocked in Smart Contract Sprint Board Jun 20, 2024
@AlfredoG87 AlfredoG87 moved this from Blocked to In Review in Smart Contract Sprint Board Jul 3, 2024
@acuarica
Copy link
Contributor

acuarica commented Jul 4, 2024

After further investigation, we solve this issue by clearing the call cache of The Graph.

Important

This issue happens in our current deployed version v0.29.0. It is fixed in The Graph v0.34.0 https://github.com/graphprotocol/graph-node/blob/master/NEWS.md#v0340. Even if this issue was solved, it is still a good idea to upgrade The Graph #87.

The issue is that a transient faulty eth_call result still gets cached, and subsequent eth_calls with the same arguments will return the original faulty result. See graphprotocol/graph-node#4756 for more info.

These are the steps we took to solve this problem, i.e., clear the cache and re-start the subgraph indexing.

  • Check subgraph deployment status graphman --config config.toml info <deployment>

    $ graphman --config config.toml info Qme11uh1hK7zsxRRdszUJVTKgopuYuBxi2ZEvZbhaPgrHV
    name      | saucerswap/saucerswap-v1
    status    | current
    id        | Qme11uh1hK7zsxRRdszUJVTKgopuYuBxi2ZEvZbhaPgrHV
    shard     | primary
    active    | true
    chain     | mainnet
    node_id   | ---
  • Clear Call cache graphman --config config.toml chain call-cache <chain> remove

    $ graphman --config config.toml chain call-cache mainnet remove
    The call cache has cleared
  • Rewind deployment to given Block since we are not caching blocks, we need to include --force option graphman --config config.toml rewind --force <block-hash> <block-number> <deployment

    $ graphman --config config.toml rewind --force "0x488045e8e8ee45d33ee7209bb8459180c80017f2c8afe5482d4d56eb884f5fc2" "43665916" "Qme11uh1hK7zsxRRdszUJVTKgopuYuBxi2ZEvZbhaPgrHV"
    Pausing deployments
    
    Rewinding deployments
      ... rewound Qme11uh1hK7zsxRRdszUJVTKgopuYuBxi2ZEvZbhaPgrHV[14]
    Resuming deployments
  • Re-assign deployment so an indexer resumes work graphman --config config.toml reassign <deploymentId> index_node

    $ graphman --config config.toml reassign Qme11uh1hK7zsxRRdszUJVTKgopuYuBxi2ZEvZbhaPgrHV index_node
    assigning Qme11uh1hK7zsxRRdszUJVTKgopuYuBxi2ZEvZbhaPgrHV[14] to index_node
  • Verify the subgraph deployment is assigned a node

    $ graphman --config config.toml info Qme11uh1hK7zsxRRdszUJVTKgopuYuBxi2ZEvZbhaPgrHV
    name      | saucerswap/saucerswap-v1
    status    | current
    id        | Qme11uh1hK7zsxRRdszUJVTKgopuYuBxi2ZEvZbhaPgrHV
    shard     | primary
    active    | true
    chain     | mainnet
    node_id   | index_node

@acuarica acuarica closed this as completed Jul 4, 2024
@github-project-automation github-project-automation bot moved this from In Review to Done in Smart Contract Sprint Board Jul 4, 2024
@acuarica acuarica changed the title Subgraph saucerswap-v1 has indexing issues. Subgraph saucerswap-v1 has indexing issues Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A error that causes the feature to behave differently than what was expected based on design docs
Projects
Archived in project
Development

No branches or pull requests

2 participants