pokt-network/pocket-core

ETH RPC pokt gateway returns empty error struct in batch response [BUG REPORT]

dzmitryhil opened this issue · 4 comments

Describe the bug

ETH RPC pokt gateway returns empty error object in batch response, but it shouldn't include the error attribute in the response if this no error. As the result the go-ethereum client doesn't work. This change was introduced about a week ago, before it was correct.

To Reproduce

Execute curl

curl --location 'https://eth-rpc.gateway.pokt.network' \
--header 'Content-Type: application/json' \
--data '[
    {
        "jsonrpc": "2.0",
        "method": "eth_syncing",
        "params": [],
        "id": 1
    },
    {
        "jsonrpc": "2.0",
        "method": "eth_syncing",
        "params": [],
        "id": 2
    }
]'

Result:

[
    {
        "jsonrpc": "2.0",
        "id": 1,
        "result": "false",
        "error": {}
    },
    {
        "jsonrpc": "2.0",
        "id": 2,
        "result": "false",
        "error": {}
    }
]

Expected result:

[
    {
        "jsonrpc": "2.0",
        "id": 1,
        "result": "false"
    },
    {
        "jsonrpc": "2.0",
        "id": 2,
        "result": "false"
    }
]

@kutoft @fredteumer This might be related to some changes in the portal. Any chance you could triage it?

@dzmitryhil The backend team is actively looking into this.

@kutoft could you please provide an update here once it's resolved?

kutoft commented

We have pushed a fix for this into prod. I have run this request myself and am no longer seeing the empty error object. @dzmitryhil can you also confirm on your end?

@Olshansk fyi

Now it returns the correct result. Thank you @kutoft @Olshansk .