thetatoken / theta-eth-rpc-adaptor

An adaptor that translates the Theta RPC APIs to the Ethereum RPC APIs
https://docs.thetatoken.org/
24 stars 11 forks source link

502 Bad Gateway on testnet RPC adaptor #21

Closed rjx18 closed 2 years ago

rjx18 commented 3 years ago

Hello! Just wanted to let you know that I've been getting a 502 Bad Gateway error when calling eth_getLogs over a 1000 block range, on the testnet RPC adaptor (https://eth-rpc-api-testnet.thetatoken.org/rpc).

Oct 20 17:28:34.547 DEBG Requesting logs for blocks [12831437, 12832436], contract 0x0500846477052021d20fc89e0c7c345b7e9ef32b, 6 events, sgd: 1, subgraph_id: QmY1KyakhQgRJCqNtoAc7YPSt69eoPY1ifhSUmzyCLWrGa, component: BlockStream
Oct 20 17:29:04.687 DEBG Trying again after eth_getLogs RPC call failed (attempt #1) with result Err(Transport("Unexpected response status code: 502 Bad Gateway")), sgd: 1, subgraph_id: QmY1KyakhQgRJCqNtoAc7YPSt69eoPY1ifhSUmzyCLWrGa, component: BlockStream

This is on my Graph node indexer that is trying to sync the logs from blocks into my GraphQL database. This worked perfectly fine previously, so I'm wondering what is causing the error here. Querying over blocks with a very small range (30-50 blocks) returns fine, but takes a really long time (14+ seconds). However, not being able to query logs with a range of at most 2000 blocks breaks the graph node indexer, because it tries to query 1, 10, 100, 1000 then 2000 blocks at once when rebuilding the index.

Any ideas? Thank you!

rjx18 commented 3 years ago

I have fixed the error on my end by setting GRAPH_ETHEREUM_MAX_BLOCK_RANGE_SIZE to 100. But it would be good to know what exactly is the maximum block range supported for the RPC endpoints? Thank you!

onching commented 3 years ago

there was a firewall timeout that was set too low. can you try it again at 1000 and 2000? Thanks.

jieyilong commented 3 years ago

Yeah we just changed the timeout config. Please let us know if you still get the 502 error when you run the query with 2000 blocks.

rjx18 commented 3 years ago

Hello! Yes, it seems the error 502 on the testnet RPC endpoint is fixed, but now I get an error 524 when querying 1000 blocks. The error 502 is still there on the mainnet RPC I believe.

jieyilong commented 3 years ago

We'll take a look at the Testnet. We'll update the Mainnet infrastructure once we verify the changes on the Testnet. Thanks!