Skip to content

Default Block param to 'latest' on eth_* state methods#812

Open
manusw7 wants to merge 1 commit into
ethereum:mainfrom
manusw7:feat/state-block-default-latest
Open

Default Block param to 'latest' on eth_* state methods#812
manusw7 wants to merge 1 commit into
ethereum:mainfrom
manusw7:feat/state-block-default-latest

Conversation

@manusw7
Copy link
Copy Markdown

@manusw7 manusw7 commented Jun 1, 2026

Marks the Block parameter required: false (default latest) on the six state-reading methods in state.yaml: eth_getBalance, eth_getStorageAt, eth_getStorageValues, eth_getTransactionCount, eth_getCode, eth_getProof.

Proposal for discussion — opening for visibility ahead of an RPC Standards discussion (ref: NethermindEth/nethermind#11764). Not expected to merge until client consensus + go-ethereum implementation.

Why

The spec is internally inconsistent on this. eth_call, eth_estimateGas and eth_createAccessList already mark Block required: false, and eth_simulateV1 documents default: 'latest' — yet the state-reading methods require it.
This PR aligns them under one rule.

Client behaviour is also already split: reth and Nethermind default an omitted block param to latest, while geth, erigon and besu reject it.
Standardising on default-to-latest matches existing behaviour in 2 of 5 clients and removes a client-diversity footgun, rather than leaving it implementation-defined.

Changes

  • src/eth/state.yamlBlockrequired: false + description: "default: 'latest'" on all six methods (mirrors the eth_simulateV1 idiom).

TBD

  • Reach consensus between all EL clients (only Nethermind/Reth rn implement this default-to-latest behaviour)
  • Enforce compliance via hive tests with a test case that explicitly omits the block tag (asserting default-to-latest behaviour)

Mark the Block param required: false (default 'latest') on the six
state-reading methods in state.yaml: eth_getBalance, eth_getStorageAt,
eth_getStorageValues, eth_getTransactionCount, eth_getCode, eth_getProof.

Mirrors the eth_simulateV1 idiom (description "default: 'latest'") since a
bare default: keyword sibling to $ref is ignored by JSON-Schema tooling.

Spec-only. Conformance fixtures (tests/*.io) are generated by rpctestgen
against go-ethereum and cannot be filled until geth implements
default-to-latest; per CONTRIBUTING the behavior must land in go-ethereum
first. Proposal for discussion at RPC Standards (ref NethermindEth/nethermind#11764).
@manusw7 manusw7 marked this pull request as ready for review June 1, 2026 12:23
@taratorio
Copy link
Copy Markdown

good with Erigon 👍

@MysticRyuujin
Copy link
Copy Markdown
Contributor

@manusw7 - I could be wrong but I'm testing making this change in go-ethereum and it APPEARS that Nethermind isn't defaulting to "latest" for eth_getStorageValues

@manusw7
Copy link
Copy Markdown
Author

manusw7 commented Jun 2, 2026

@manusw7 - I could be wrong but I'm testing making this change in go-ethereum and it APPEARS that Nethermind isn't defaulting to "latest" for eth_getStorageValues

hey @MysticRyuujin, you're right. That was the only exception I noticed missing this behaviour.
I've seen the PR, thanks! 🙌

s1na added a commit to ethereum/go-ethereum that referenced this pull request Jun 3, 2026
…35100)

Make the `Block` parameter optional on the six state-reading methods,
defaulting to `latest` when omitted:

- `eth_getBalance`
- `eth_getCode`
- `eth_getStorageAt`
- `eth_getTransactionCount`
- `eth_getProof`
- `eth_getStorageValues`

This implements the behavior proposed in ethereum/execution-apis#812.

---------

Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants