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
I'm observing strange problems while using ethers v6 and trying to listen to events, staring with errors like
@TODO Error: could not coalesce error (error={ "code": -32000, "message": "filter not found" }, payload={ "id": 8, "jsonrpc": "2.0", "method": "eth_getFilterChanges", "params": [ "0x3e8dc08f82f677b144b2e2b1acc9549f" ] }, code=UNKNOWN_ERROR, version=6.13.1)
This is not happening if I switch to a "non-official" chain's RPC provider endpoint (details in the code snippet).
However, if I switch to a "non-official" RPC provider endpoint, I occasionally get an error
Error: could not coalesce error (error={ "code": -32000, "message": "requested to block 47918748 after last accepted block 47918747" }, payload={ "id": 2271, "jsonrpc": "2.0", "method": "eth_getLogs", "params": [ { "address": "0xab4fe2d136efd7f8dfce3259a5e3c5e4c0130c80", "fromBlock": "0x2db2e5f", "toBlock": "0x2db2e9c", "topics": [ "0x2203b46b43cd4c862695ef2523f622840927113ac185c69b4f1141ebf713b791" ] } ] }, code=UNKNOWN_ERROR, version=6.13.1)
after which my script completely crashes.
None of this is happening if I use ethers v5 and an "official" RPC provider endpoint.
I would extremely appreciate if someone (@ricmoo probably would be the best) could clarify me few things here:
why do I always see filter not found error if I use ethers v6 and never in v5?
why don't I see the same error if I use ethers v6 with a "non-official" provider RPC endpoint?
why is requested to block 47918748 after last accepted block 47918747 error happening when I try to get transaction receipt and what is a suggested method to catch such error instead of experiencing crashes? Is a simple try/catch block within my listener enough?
// This happens if I use ethers v6 and an "official" RPC provider endpoint (https://api.avax.network/ext/bc/C/rpc)
@TODO Error: could not coalesce error (error={ "code": -32000, "message": "filter not found" }, payload={ "id": 345, "jsonrpc": "2.0", "method": "eth_getFilterChanges", "params": [ "0x3e8dc08f82f677b144b2e2b1acc9549f" ] }, code=UNKNOWN_ERROR, version=6.13.1)
at makeError (file:///Users/oxxo/Sites/web3/test/node_modules/ethers/lib.esm/utils/errors.js:124:21)
at JsonRpcProvider.getRpcError (file:///Users/oxxo/Sites/web3/test/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js:726:16)
at file:///Users/oxxo/Sites/web3/test/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js:298:45
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'UNKNOWN_ERROR',
error: { code: -32000, message: 'filter not found' },
payload: {
method: 'eth_getFilterChanges',
params: [ '0x3e8dc08f82f677b144b2e2b1acc9549f' ],
id: 345,
jsonrpc: '2.0'
},
shortMessage: 'could not coalesce error'
}
// This sometimes happens if I use a "non-official" RPC provider endpoint (e.g. https://rpc.ankr.com/avalanche)
// This happens with a different contract, but still, I haven't seen this error if I use ethers v5Error: could not coalesce error (error={ "code": -32000, "message": "requested to block 47918748 after last accepted block 47918747" }, payload={ "id": 2271, "jsonrpc": "2.0", "method": "eth_getLogs", "params": [ { "address": "0xab4fe2d136efd7f8dfce3259a5e3c5e4c0130c80", "fromBlock": "0x2db2e5f", "toBlock": "0x2db2e9c", "topics": [ "0x2203b46b43cd4c862695ef2523f622840927113ac185c69b4f1141ebf713b791" ] } ] }, code=UNKNOWN_ERROR, version=6.13.1) at makeError (file:///Users/oxxo/Sites/web3/api.salvor.ninja/node_modules/ethers/lib.esm/utils/errors.js:124:21) at JsonRpcProvider.getRpcError (file:///Users/oxxo/Sites/web3/api.salvor.ninja/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js:726:16) at file:///Users/oxxo/Sites/web3/api.salvor.ninja/node_modules/ethers/lib.esm/providers/provider-jsonrpc.js:298:45 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { code: 'UNKNOWN_ERROR', error: { code: -32000, message: 'requested to block 47918748 after last accepted block 47918747' }, payload: { method: 'eth_getLogs', params: [ { address: '0xab4fe2d136efd7f8dfce3259a5e3c5e4c0130c80', topics: ['0x2203b46b43cd4c862695ef2523f622840927113ac185c69b4f1141ebf713b791' ], fromBlock: '0x2db2e5f', toBlock: '0x2db2e9c' } ], id: 2271, jsonrpc: '2.0' }, shortMessage: 'could not coalesce error'}
Environment
node.js (v12 or newer)
Environment (Other)
No response
The text was updated successfully, but these errors were encountered:
Just to mention that I went through the linked issue myself before I reported mine and even tried to implement a logic where I would catch some of these errors (e.g. provider.on("debug", myDebugCatchingFunction); or provider.on("error", myErrorCatchingFunction);) but for some reason I just couldn't suppress constant printing out the whole error and stack trace so I thought I'm doing something wrong and decided to report here.
Ethers Version
6.13.1
Search Terms
provider, events, eth_getFilterChanges, eth_getLogs
Describe the Problem
I'm observing strange problems while using ethers v6 and trying to listen to events, staring with errors like
This is not happening if I switch to a "non-official" chain's RPC provider endpoint (details in the code snippet).
However, if I switch to a "non-official" RPC provider endpoint, I occasionally get an error
after which my script completely crashes.
None of this is happening if I use ethers v5 and an "official" RPC provider endpoint.
I would extremely appreciate if someone (@ricmoo probably would be the best) could clarify me few things here:
filter not found
error if I use ethers v6 and never in v5?requested to block 47918748 after last accepted block 47918747
error happening when I try to get transaction receipt and what is a suggested method to catch such error instead of experiencing crashes? Is a simpletry/catch
block within my listener enough?Code Snippet
Contract ABI
Errors
Environment
node.js (v12 or newer)
Environment (Other)
No response
The text was updated successfully, but these errors were encountered: