0xPolygonHermez / cdk-erigon

Ethereum implementation on the efficiency frontier
GNU Lesser General Public License v3.0
35 stars 39 forks source link

RPC errors on the zkevm RPC's #1185

Closed rahuldamodar94 closed 1 week ago

rahuldamodar94 commented 1 month ago

We are running an indexer that queries the zkEVM public RPC to fetch some data from the blocks.

These are the calls we make via web3.js library.

getBlock getBlockNumber getTransactionReceipt getGasPrice

Seeing 3 types of errors.

  1. NVALID json ""
  2. Null receipt for some blocks
  3. Failed to connect to RPC
  4. Invalid Json Body.

Frequency - Would be 50-100+ in a week. Does work after retries though.

hexoscott commented 1 month ago

Hi @rahuldamodar94, a few questions:

The invalid JSON parts would indicate an HTML response is coming back, it would be useful to get a dump of the responses if possible

py-zoid commented 1 month ago

Hi @hexoscott ,

We are calling the following endpoints:

  1. eth_getBlockByNumber
  2. eth_getTransactionReceipt
  3. eth_gasPrice

The calls are being made server-side. The RPC returns properly most of the time only occasionally it throws these errors and on subsequent retries we receive correctly again. So, I don't see a point in testing these calls with curl requests from the server. I'll try to see if we can get the response dump because these errors are being thrown by web3.js package on our app when it fails to decode the response.

hexoscott commented 1 month ago

Thank you for the details. So an occasional failure might suggest hitting a rate limit somewhere in the pipeline and getting a 429 with an html body in the response. How frequently are you making these calls? It would be great if it's possible to get a dump of the response.

py-zoid commented 1 month ago

I don't think it's a rate limit error. After a few tests we observed that whenever we were receiving the Invalid JSON RPC response: "" error on our app our direct calls to the rpc are erroring out with Request failed with status code 502. This should narrow down the error scope.

hexoscott commented 1 month ago

Interesting, this is the first report we've had of this. Which endpoint URL are you using?

Sharonbc01 commented 1 month ago

Hi @py-zoid is this issue still valid? Can you share endpoint URL please. Thanks

hexoscott commented 1 week ago

Can this be closed now @py-zoid ? There was a thread opened with Will about this and it looked to be related to cloudflare / load balancing?