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>
0xjvn
pushed a commit
to 0xjvn/go-ethereum
that referenced
this pull request
Jun 5, 2026
…thereum#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>
MysticRyuujin
added a commit
to MysticRyuujin/execution-apis
that referenced
this pull request
Jun 9, 2026
Mark the Block parameter required:false (default 'latest') on the six state-reading methods: eth_getBalance, eth_getStorageAt, eth_getStorageValues, eth_getTransactionCount, eth_getCode and eth_getProof. Add rpctestgen cases and fixtures that omit the block parameter and assert default-to-latest behavior.
gballet
pushed a commit
to gballet/go-ethereum
that referenced
this pull request
Jun 12, 2026
…thereum#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>
pull Bot
pushed a commit
to Dustin4444/erigon
that referenced
this pull request
Jun 16, 2026
…tech#21586) ## Summary Make the `Block` parameter optional (defaulting to `latest` when omitted) on the six state-reading methods: - `eth_getBalance` - `eth_getCode` - `eth_getStorageAt` - `eth_getTransactionCount` - `eth_getProof` - `eth_getStorageValues` Each took a value-type `rpc.BlockNumberOrHash`, so omitting the block parameter failed with `-32602 missing value for required argument N` — Erigon's `rpc` package (like go-ethereum's) only permits omitting a *trailing* argument when it is a pointer. This changes the six handlers (and the `EthAPI` interface) to `*rpc.BlockNumberOrHash` and defaults `nil` to `latest` via a small `orLatest` helper, reusing the existing `latestNumOrHash` var. `eth_call` already behaves this way. Internal callers of the interface are updated accordingly (`rpc/contracts/direct_backend.go`, `rpc/mcp/*`) along with the affected tests. ## Motivation This aligns Erigon with **ethereum/execution-apis#812** by **@manusw7**, which marks the `Block` parameter `required: false` (default `latest`) on these methods. Full credit for the proposal and rationale to @manusw7. ## Testing - `go vet ./rpc/jsonrpc/` passes (handlers + updated tests compile). - Verified against the `hive` `rpc-compat` simulator with default-block conformance fixtures (block parameter omitted): a locally-built Erigon with this change returns the latest-block values and all six pass (`tests=7 failed=0`). Before the change, all six failed. ## Related - Source proposal: ethereum/execution-apis#812 (by @manusw7) - execution-apis spec + conformance tests: ethereum/execution-apis#814 - go-ethereum implementation: ethereum/go-ethereum#35100 - Nethermind `eth_getStorageValues` fix: NethermindEth/nethermind#11883 - Besu implementation: besu-eth/besu#10587 - ethrex implementation: lambdaclass/ethrex#6780 --------- Co-authored-by: lupin012 <58134934+lupin012@users.noreply.github.com>
AdityaSripal
pushed a commit
to AdityaSripal/go-ethereum
that referenced
this pull request
Jun 21, 2026
…thereum#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>
MysticRyuujin
added a commit
to MysticRyuujin/execution-apis
that referenced
this pull request
Jun 29, 2026
Mark the Block parameter required:false (default 'latest') on the six state-reading methods: eth_getBalance, eth_getStorageAt, eth_getStorageValues, eth_getTransactionCount, eth_getCode and eth_getProof. Add rpctestgen cases and fixtures that omit the block parameter and assert default-to-latest behavior.
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