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

[BUG] Graph-node is broken on mainnet due to eth_call response incompatibility #1012

Closed
e00dan opened this issue Mar 2, 2023 · 5 comments · Fixed by #1013 or #1014
Closed

[BUG] Graph-node is broken on mainnet due to eth_call response incompatibility #1012

e00dan opened this issue Mar 2, 2023 · 5 comments · Fixed by #1013 or #1014
Assignees
Labels
bug Something isn't working P-High

Comments

@e00dan
Copy link

e00dan commented Mar 2, 2023

Graph node completely stops working on Godwoken Mainnet as soon as it encounters errors in eth_call. Normally it should be handled by try_call and it was working fine until latest update of Godwoken which introduced "extra" field in eth_call response in case of error.

Godwoken:

{
    "jsonrpc": "2.0",
    "id": 1,
    "error": {
        "code": -32000,
        "message": "execution reverted",
        "extra": {
            "exit_code": "0x2",
            "message": "revert",
            "stack": "EVMC"
        }
    }
}

Goerli:

{
    "jsonrpc": "2.0",
    "id": 48,
    "error": {
        "code": -32000,
        "message": "execution reverted"
    }
}

Example request that triggers revert:

curl --location 'https://v1.mainnet.godwoken.io/rpc' \
--header 'Content-Type: application/json' \
--data '{
    "method": "eth_call",
    "params": [
        {
            "gas": "0xb71b00",
            "from": "0x9c023610d438dE45B8D53358DE663233Ce752F77",
            "to": "0x186181e225dc1ad85a4a94164232bd261e351c33",
            "data": "0x38fff2d0"
        },
        "0x3c3b5"
    ],
    "jsonrpc": "2.0",
    "id": 1
}'

Response:

{
    "jsonrpc": "2.0",
    "id": 1,
    "error": {
        "code": -32000,
        "message": "execution reverted",
        "extra": {
            "exit_code": "0x2",
            "message": "revert",
            "stack": "EVMC"
        }
    }
}

Graph errors:

docker-graph-node-1  | Mar 02 15:50:21.239 INFO Done processing trigger, gas_used: 0, data_source: WeightedPoolFactory, handler: handleWeightedPoolCreated, total_ms: 3106, transaction: 0x2112…41ec, address: 0x8a55…5202, signature: PoolCreated(indexed address), sgd: 1, subgraph_id: QmduxKxtMxya25Us5a5ZFYJKKpxnCSkyNDLm9A6EKANzuR, component: SubgraphInstanceManager
docker-graph-node-1  | Mar 02 15:50:21.239 INFO Possible reorg detected, retrying, error: failed to process trigger: block #246709 (0x879b…73f5), transaction 21128e6dd687f6016206390a52204e4bf45f4d4a376622ed15442676243241ec: Ethereum node returned an error when calling function "getPoolId" of contract "WeightedPool": failed to deserialize response: data did not match any variant of untagged enum Output
docker-graph-node-1  | wasm backtrace:
docker-graph-node-1  |     0: 0x1e0c - <unknown>!~lib/@graphprotocol/graph-ts/chain/ethereum/ethereum.SmartContract#tryCall
docker-graph-node-1  |     1: 0x4157 - <unknown>!src/mappings/balancer/helpers/misc/createToken
docker-graph-node-1  |     2: 0x4683 - <unknown>!src/mappings/balancer/helpers/misc/createPoolTokenEntity
docker-graph-node-1  |     3: 0x506b - <unknown>!src/mappings/balancer/WeightedPool/factory/PoolCreated/createWeightedLikePool
docker-graph-node-1  |     4: 0x508f - <unknown>!src/mappings/balancer/WeightedPool/factory/PoolCreated/handleWeightedPoolCreated

I tried using version of graph-node: 0.25, 0.27, 0.29, 0.30. All broken.

@e00dan e00dan added the bug Something isn't working label Mar 2, 2023
@Flouse Flouse transferred this issue from godwokenrises/godwoken-web3 Mar 2, 2023
@Flouse Flouse added the P-High label Mar 2, 2023
@Flouse
Copy link
Collaborator

Flouse commented Mar 2, 2023

related PR

We are discussing how to revert it or if we have a better solution ASAP.

@Flouse
Copy link
Collaborator

Flouse commented Mar 2, 2023

hotfix

@Flouse
Copy link
Collaborator

Flouse commented Mar 2, 2023

The hotfix was applied on Godwoken mainnet_v1.

Example request that triggers revert:

curl --location 'https://v1.mainnet.godwoken.io/rpc' \
--header 'Content-Type: application/json' \
--data '{
    "method": "eth_call",
    "params": [
        {
            "gas": "0xb71b00",
            "from": "0x9c023610d438dE45B8D53358DE663233Ce752F77",
            "to": "0x186181e225dc1ad85a4a94164232bd261e351c33",
            "data": "0x38fff2d0"
        },
        "0x3c3b5"
    ],
    "jsonrpc": "2.0",
    "id": 1
}'

## Result
{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"execution reverted"}}

@e00dan
Copy link
Author

e00dan commented Mar 2, 2023

It is looking good so far. I managed to sync subgraph locally. It seems fixed, but I will test more.

Thank you for very fast response time.

@Flouse
Copy link
Collaborator

Flouse commented Mar 2, 2023

I think we should add graph-node compatibility test into our test workflow.
Thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P-High
Projects
None yet
3 participants