Skip to content

Invalid Block Range Params (rpc: get_logs) #3666

@impactdni2

Description

@impactdni2

Describe the bug
We're seeing RPC calls for get_logs fail randomly Happening on both 3.7.1, and 3.7.3.

eTo Reproduce Unfortunately, does not seem to be consistent. Started around 2 days ago (Sept 18th) on all of our servers (no code deploys in the last week). Manually requesting the same blocks/addresses afterward show the RPC call succeeds, so it seems transitory. During the periods where it fails, it fails for all the boxes at the same time.

Expected behavior
RPC returns correctly?

Additional context
Examples from two different RPC servers at the same times:

Sep 20 16:05:14 storage docker[93905]: INFO [09-20|16:05:14.890] created block                            l2Block=381,185,182 l2BlockHash=eb1981..21a64e
Sep 20 16:05:15 storage docker[93905]: WARN [09-20|16:05:15.431] Served eth_getLogs                       reqid=31174            duration="35.604µs"   err="invalid block range params"
Sep 20 16:05:15 storage docker[93905]: WARN [09-20|16:05:15.434] Served eth_getLogs                       reqid=34017            duration="35.291µs"   err="invalid block range params"
Sep 20 16:05:15 storage docker[93905]: INFO [09-20|16:05:15.891] created block                            l2Block=381,185,186 l2BlockHash=c16559..ea8157
Sep 20 16:05:14 storage2 docker[412787]: INFO [09-20|16:05:14.649] created block                            l2Block=381,185,181 l2BlockHash=95c324..d3d67a
Sep 20 16:05:15 storage2 docker[412787]: WARN [09-20|16:05:15.429] Served eth_getLogs                       reqid=19076 duration="40.265µs" err="invalid block range params"
Sep 20 16:05:15 storage2 docker[412787]: INFO [09-20|16:05:15.650] created block                            l2Block=381,185,185 l2BlockHash=82ebdc..451042

The specific request from servers was the following:
curl --request POST --url http://storage:8547 --header 'Content-Type: application/json' --data '{"method": "eth_getLogs","params": [{"fromBlock": "0x16b86c3d","toBlock":"0x16b86ca1","address":"0xD056aB60Ac2929fE6f40B5Ceb494A55e76a394cf","topics": []}],"id": 1,"jsonrpc": "2.0"}'
Which works properly when manually testing (after the failures)

From the timing and request numbers (in the example, toBlock = 381185185), it is possible that the toBlock number hasn't fully been processed yet on the server. The toBlock that we send is received from the same RPC connection, with a subscribe_blocks websocket.

Rough guess is that subscribe_blocks is sending a "we finished this block" message, but when immediately sending a get_logs request for that block, it hasn't finished indexing the logs, and says that block number is an invalid param?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions