Default Block param to 'latest' on eth_* state methods#812
Open
manusw7 wants to merge 1 commit into
Open
Conversation
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).
4 tasks
|
good with Erigon 👍 |
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 |
This was referenced Jun 2, 2026
Merged
Merged
Author
hey @MysticRyuujin, you're right. That was the only exception I noticed missing this behaviour. |
s1na
approved these changes
Jun 3, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Marks the
Blockparameterrequired: false(defaultlatest) on the six state-reading methods instate.yaml:eth_getBalance,eth_getStorageAt,eth_getStorageValues,eth_getTransactionCount,eth_getCode,eth_getProof.Why
The spec is internally inconsistent on this.
eth_call,eth_estimateGasandeth_createAccessListalready markBlockrequired: false, andeth_simulateV1documentsdefault: '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.yaml—Block→required: false+description: "default: 'latest'"on all six methods (mirrors theeth_simulateV1idiom).TBD