paradigmxyz / reth

Modular, contributor-friendly and blazing-fast implementation of the Ethereum protocol, in Rust
https://reth.rs/
Apache License 2.0
3.93k stars 1.17k forks source link

"unknown block number" error from eth_call RPC call against "latest" block #11234

Open toolchainx opened 1 month ago

toolchainx commented 1 month ago

Describe the bug

I make frequent eth_call calls to reth with the block number set to "latest", to get the latest price of some token. every few hours, I encounter the following error:

{
  "jsonrpc": "2.0",
  "id": 213095,
  "error": {
    "code": -32001,
    "message": "unknown block number"
  }
}

The sample request is like this

{
  "method": "eth_call",
  "params": [
    {
      "to": "0x1116898dda4015ed8ddefb84b6e8bc24528af2d8",
      "data": "0x66c0bd240000000000000000000000006b175474e89094c44da98b954eedeac495271d0f"
    },
    "latest"
  ],
  "id": 213095,
  "jsonrpc": "2.0"
}

Steps to reproduce

eth_call the reth node frequently like every two seconds:

{
  "method": "eth_call",
  "params": [
    {
      "to": "0x1116898dda4015ed8ddefb84b6e8bc24528af2d8",
      "data": "0x66c0bd240000000000000000000000006b175474e89094c44da98b954eedeac495271d0f"
    },
    "latest"
  ],
  "id": 213095,
  "jsonrpc": "2.0"
}

Node logs

no error log

Platform(s)

Linux (x86)

What version/commit are you on?

ghcr.io/paradigmxyz/reth:v1.0.4

What database version are you on?

2024-09-26T06:46:04.957670Z  INFO Initialized tracing, debug log directory: /root/.cache/reth/logs/mainnet
Current database version: 2
Local database version: 2

Which chain / network are you on?

Ethereum mainnet

What type of node are you running?

Archive (default)

What prune config do you use, if any?

default config, I think it is no prune.

If you've built Reth from source, provide the full command you used

no, I use the docker image

Code of Conduct

jun0tpyrc commented 1 week ago

hitting the same issues , not always but sometimes