Skip to content

(Inconsistency with spec) Nethermind returns error instead of null for nonexistent transaction index in eth_getTransactionByBlockNumberAndIndex RPC #8648

@Z-Zhijie

Description

@Z-Zhijie

Description

According to the spec, the RPC method eth_getTransactionByBlockNumberAndIndex returns null when a transaction is not found. However, when I query a nonexistent transaction, Nethermind returns {'error': {'code': -32602, 'message': 'Position Index is incorrect'}

Steps to Reproduce
In order to replicate the behavior, please provide a detailed list of steps:

  1. Start a Nethermind mainnet node with docker nethermind/nethermind:1.31.10
  2. Set the ETH_RPC_URL and send the following RPC to query a nonexistent tx:
curl --data '{"method":"eth_getTransactionByBlockNumberAndIndex","params":["0x1577d62", "0xb4"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST ETH_RPC_URL

Actual behavior
The RPC method returns error:

{"jsonrpc":"2.0","error":{"code":-32602,"message":"Position Index is incorrect"},"id":1}

Expected behavior

According to the spec, the RPC method returns null like other clients such as geth and reth

{"jsonrpc":"2.0","id":1,"result":null}

Desktop (please complete the following information):
Please provide the following information regarding your setup:

  • Operating System: Linux
  • Version: 1.31.10
  • Installation Method: Docker
  • Consensus Client: lighthouse:v7.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions