Open nordschesasa opened 9 months ago
This range:
"fromBlock": "0x0",
"toBlock": "0x120dc53",
is basically the whole history of ethereum. I understand this is probably a topic that doesn't occur often. Geth right now doesn't optimize for the "sparse logs" scenario as much.
There are some ideas on the backburner for optimizing getLogs https://github.com/ethereum/go-ethereum/issues/25336 but not much progress.
Something coming in the near future tho is the ability to subscribe to historical logs https://github.com/ethereum/go-ethereum/pull/27439 so at least for such queries that take a while it doesn't time-out. It will be a long-running process within geth that will deliver logs via websocket as it's searching the history.
Hi, I've been using Geth as my ETH fullnode, it may get timed out on
eth_getLogs
request through large range of blocks, for example with request:Response from Node:
However if the block range is small, it can response quickly without a problem, I've tried Infura/alchemy with same request and it can response quickly with data:
By using
web3_clientVersion
to query their(infura and alchemy) node's version I can see they are using Geth as well(version 1.13.4 and 1.13.5).I've seen there is a post on Infura, not sure if related to this, https://www.infura.io/blog/post/faster-logs-and-events-e43e2fa13773, I might wonder if this kind of request cannot be handled by Geth itself.
The node it's running with docker compose, with file as below:
The server is hosted on GCP with 4T of SSD persistent disk so disk IO shouldn't be a problem here.