Error: processing response error (body="{\"jsonrpc\":\"2.0\",\"id\":46,\"error\":{\"code\":-32005,\"message\":\"eth_getLogs block range too large, range: 100001, max: 100000\"}}", error={"code":-32005}, requestBody="{\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"0x10be5c4\",\"toBlock\":\"latest\",\"address\":\"0xabcd\",\"topics\":[\"0x17647858a59d66933ee49e84163d436059a625fe1d8558dc8772ce11df52727a\",\"0x0000000000000000000000000000000000000000000000000000000000000001\"]}],\"id\":46,\"jsonrpc\":\"2.0\"}", requestMethod="POST", url="https://polygon-mumbai.infura.io/v3/abcd", code=SERVER_ERROR, version=web/5.4.0)
I’m running into this error when calling queryFilter
(using ethers js). From the docs, I don’t get why I get this error. The docs (https://infura.io/docs/ethereum/json-rpc/eth-getLogs) say this:
To prevent queries from consuming too many resources,
eth_getLogs
requests are currently limited by two constraints:
- A max of 10,000 results can be returned by a single query
- Query duration must not exceed 10 seconds
Neither of those constraints should apply. It seems like I’m hitting a third, undocumented constraint about the number of blocks I can query.
Two questions about this:
- Is this expected behavior? (if so, seems like it should be better documented)
- If it is expected behavior… is there some way to query for all events? Or do I need to store them myself somewhere to work around this?