Skip to content

eth_getLogs does not work with pending #24237

@quickchase

Description

@quickchase

System information

Geth version: v1.10.15
OS & Version: Linux

This is kind of a duplicate of #5359 however, that was automatically closed and was never addressed.

Expected behaviour

eth_getLogs should work with "pending" blocks - according to all available documentation "pending" is a valid string for both fromBlock and toBlock

Both Nethermind and OpenEthereum support "pending" here in accordance with the docs.

Actual behaviour

"pending" to "pending":

{"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"failed to get block number from hash"}}

That ☝️ is just broken completely

"latest" to "pending":

{"jsonrpc":"2.0","id":1,"result":[]}

That ☝️ always returns an empty array, despite the fact there should be logs (test an OpenEthereum node, it'll return lots of stuff)

Steps to reproduce the behaviour

Take the the following eth_getLogs command and just modify the fromBlock and/or toBlock

curl -H "Content-Type: application/json" -d '{"method":"eth_getLogs","params":[{"fromBlock":"pending","toBlock":"pending","topics":[["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62"],["0x0000000000000000000000000000000000000000000000000000000000000000"]]}],"id":1,"jsonrpc":"2.0"}' localhost:8545

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions