Open gbrew opened 12 months ago
I suspect this is an issue in a number of other places as well. I'm guessing the issue is that 'latest' gets resolved to a specific block number or hash before the reorg
I believe this is correct yes, need to check how we can mitigate this
This issue is stale because it has been open for 21 days with no activity.
Same issue here, but with the eth_call
method and block number set to latest
.
docker image and reth version : ghcr.io/paradigmxyz/reth:v1.0.4
request body
{
"method": "eth_call",
"params": [
{
"to": "0x1116898dda4015ed8ddefb84b6e8bc24528af2d8",
"data": "0x66c0bd240000000000000000000000006b175474e89094c44da98b954eedeac495271d0f"
},
"latest"
],
"id": 213095,
"jsonrpc": "2.0"
}
response body:
{
"jsonrpc": "2.0",
"id": 213095,
"error": {
"code": -32001,
"message": "unknown block number"
}
}
Describe the bug
I make frequent debug_traceCall calls to reth, using the CallTracer, and specifying that they be made against the latest block. This usually works as expected, but I have noticed that I get an "unknown block number" RPC error sometimes when there is a reorg, instead of the call succeeding as expected.
I have observed a very similar issue when making eth_feeHistory calls (also specifying 'latest' block, 10 blocks previous, and explicitly specifying percentiles as [50]). These should clearly always succeed, but I get the "unknown block number" error sometimes during reorgs.
It appears that both these RPC methods end up seeing inconsistent state during a reorg. I suspect this is an issue in a number of other places as well. I'm guessing the issue is that 'latest' gets resolved to a specific block number or hash before the reorg, then that is no longer valid post-reorg. Please let me know if there's any other info which would be helpful tracking this down.
I've confirmed a reorg in the reth logs (added below) when I get the error.
Steps to reproduce
I've also tried reproducing this using eth_feeHistory calls as mentioned above. I've seen it happen, but it does seem to be much less frequent.
Here's the function I was running in a loop:
Node logs