You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Default provider with Etherscan, Alchemy, Infura and Pocket. Querying a contract's logs over entire blockchain. Etherscan does well because it just returns 1000 so I can just start calling from blockNumber + 1 of latest event. However, Infura:
{
"jsonrpc": "2.0",
"id": 47,
"error": {
"code": -32005,
"data": { "from": "0xBDE5F8", "limit": 10000, "to": "0x102DBCC" },
"message": "query returned more than 10000 results. Try with this block range [0xBDE5F8, 0x102DBCC]."
}
}
After parsing response that was emitted in 'debug' event. And, Alchemy:
{"jsonrpc":"2.0","id":43,"error":{"code":-32602,"message":"Log response size exceeded. You can make eth_getLogs requests with up to a 2K block range and no limit on the response size, or you can request any block range with a cap of 10K logs in the response. Based on your parameters and the response size limit, this block range should work: [0x0, 0xd043b8]"}}
I have tried to just add handling for this on my own in the BaseProvider object but I can't even seem to get a simple console.log() to work. Something to do with typescript compiling or whatever. Also, I think the Pocket provider request failing does not even emit a 'error' nor a 'debug' event and just causes the entire program to hang.
It is a pity that this is not handled because the Infura API would return a whole 10k events if the correct block range was used. They even give you a block range in their response error body. Just some simple parsing would extract the block range and then a retry of the getLogs call with the new range, instead of just emitting a debug event, would bring a phenomenal transformation of how these two providers integrate into this amazing library.
Code Snippet
No response
Contract ABI
No response
Errors
No response
Environment
No response
Environment (Other)
No response
The text was updated successfully, but these errors were encountered:
Ethers Version
^5.6.9
Search Terms
Provider, getLogs, Alchemy, Infura
Describe the Problem
Default provider with Etherscan, Alchemy, Infura and Pocket. Querying a contract's logs over entire blockchain. Etherscan does well because it just returns 1000 so I can just start calling from blockNumber + 1 of latest event. However, Infura:
After parsing response that was emitted in 'debug' event. And, Alchemy:
I have tried to just add handling for this on my own in the BaseProvider object but I can't even seem to get a simple console.log() to work. Something to do with typescript compiling or whatever. Also, I think the Pocket provider request failing does not even emit a 'error' nor a 'debug' event and just causes the entire program to hang.
It is a pity that this is not handled because the Infura API would return a whole 10k events if the correct block range was used. They even give you a block range in their response error body. Just some simple parsing would extract the block range and then a retry of the getLogs call with the new range, instead of just emitting a debug event, would bring a phenomenal transformation of how these two providers integrate into this amazing library.
Code Snippet
No response
Contract ABI
No response
Errors
No response
Environment
No response
Environment (Other)
No response
The text was updated successfully, but these errors were encountered: