Description
When eth_getBalance is called with only the address (block parameter omitted), Nethermind silently defaults to the latest block and returns a balance (Reth does the same); while Geth, Erigon, and Besu all reject with -32602 "missing value for required argument 1".
Per the execution-apis spec, the block parameter is marked as required.
This behavior is currently codified as intentional by the Nethermind unit test Eth_get_balance_default_block in src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.cs:101.
That test must be deleted in the fix PR.
Steps to Reproduce
{
"jsonrpc": "2.0",
"method": "eth_getBalance",
"params": ["0xcf1dc766fc2c62bef0b67a8de666c8e67acf35f6"],
"id": 1
}
Expected (Geth / Erigon / Reth)
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32602,
"message": "missing value for required argument 1"
}
}
Actual (Nethermind v1.38.0-rc)
{ "jsonrpc": "2.0", "result": "0x46f5e69c5c82ad00", "id": 1 }
Fix Location
JSON-RPC argument-count check at the module-dispatch layer in Nethermind.JsonRpc. The current BlockParameter? blockParameter = null default-to-latest behavior on the handler signature (see Nethermind.JsonRpc/Modules/Eth/IEthRpcModule.cs:95 and EthRpcModule.cs:175-191) needs to become a missing-required-argument rejection at parameter binding.
Notes
Description
When
eth_getBalanceis called with only the address (block parameter omitted), Nethermind silently defaults to thelatestblock and returns a balance (Reth does the same); while Geth, Erigon, and Besu all reject with-32602 "missing value for required argument 1".Per the execution-apis spec, the block parameter is marked as required.
This behavior is currently codified as intentional by the Nethermind unit test
Eth_get_balance_default_blockinsrc/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.cs:101.That test must be deleted in the fix PR.
Steps to Reproduce
{ "jsonrpc": "2.0", "method": "eth_getBalance", "params": ["0xcf1dc766fc2c62bef0b67a8de666c8e67acf35f6"], "id": 1 }Expected (Geth / Erigon / Reth)
{ "jsonrpc": "2.0", "id": 1, "error": { "code": -32602, "message": "missing value for required argument 1" } }Actual (Nethermind v1.38.0-rc)
{ "jsonrpc": "2.0", "result": "0x46f5e69c5c82ad00", "id": 1 }Fix Location
JSON-RPC argument-count check at the module-dispatch layer in
Nethermind.JsonRpc. The currentBlockParameter? blockParameter = nulldefault-to-latest behavior on the handler signature (seeNethermind.JsonRpc/Modules/Eth/IEthRpcModule.cs:95andEthRpcModule.cs:175-191) needs to become a missing-required-argument rejection at parameter binding.Notes
test_34in feat(eth_getBalance): add tests for EIP-1898 scenarios and error handling rpc-tests#6eth_*endpoints whose handler signature usesBlockParameter? = null— review impact across the module.