pokt-network / pocket-core

Official implementation of the Pocket Network Protocol
http://www.pokt.network
MIT License
208 stars 101 forks source link

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

Closed dzmitryhil closed 1 year ago

dzmitryhil commented 1 year ago

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"
    }
]
Olshansk commented 1 year ago

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

Olshansk commented 1 year ago

@dzmitryhil The backend team is actively looking into this.

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

kutoft commented 1 year ago

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

dzmitryhil commented 1 year ago

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