Repository navigation
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).
manusw7
marked this pull request as ready for review
June 1, 2026 12:23
1 of 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>
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.
Author
|
Closed by #814 |
qianhh
pushed a commit
to bane-labs/go-ethereum
that referenced
this pull request
Aug 12, 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>
qianhh
pushed a commit
to bane-labs/go-ethereum
that referenced
this pull request
Aug 19, 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>
qianhh
pushed a commit
to bane-labs/go-ethereum
that referenced
this pull request
Aug 31, 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>
qianhh
pushed a commit
to bane-labs/go-ethereum
that referenced
this pull request
Sep 16, 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>
MegaRedHand
added a commit
to suna4/ethrex
that referenced
this pull request
Oct 27, 2026
…aclass#6780) ## Summary Two related JSON-RPC changes aligning ethrex with **ethereum/execution-apis#812** by **@manusw7** (Block parameter optional, default `latest`): 1. **Default an omitted block parameter to `latest`** on the state methods that previously required it. `eth_getBalance`, `eth_getCode`, `eth_getStorageAt`, `eth_getTransactionCount`, and `eth_getProof` did a strict `params.len() != N` check and returned `-32000 "Expected N params"` when the block was omitted. They now accept the block as optional and default it to `latest` via a new `impl Default for BlockIdentifierOrHash` (latest). 2. **Implement `eth_getStorageValues`** (previously `-32601 method not found`): batches storage-slot reads for multiple accounts at a block, mirroring `eth_getStorageAt`, with the same optional-block default and a 1024-slot cap. Registered in the `eth` dispatch. Slots follow the spec's `bytesMax32` (`0x` and at most 64 hex digits, `0x` alone is slot 0). An invalid slot or an empty request returns `-32602`, and more than 1,024 slots in total returns `-32005`. Every slot is read from the state root of one resolved block, so a block hash reads that block and a block the node does not have is an error. ## Motivation Aligns ethrex with execution-apis#812 (@manusw7) and matches the other clients implementing the same change. Full credit to @manusw7 for the proposal. ## Testing - New parse-layer tests assert each state method resolves an **omitted** block to `latest` (`test_state_methods_default_block_to_latest_when_omitted`). The `eth_getStorageValues` tests cover the slot format, the empty request, the slot cap, and the handler: values, lowercase keys, zeros for an absent account, a lookup by hash, and the error for an unknown block. - Confirmed via the hive `rpc-compat` simulator that the omitted-block request now produces the **same** response as an explicit `"latest"` request for every method (previously the omitted form errored). ### Note on hive rpc-compat value fixtures (out of scope) ethrex does not currently pass the rpc-compat *value* fixtures for these state methods in the hive default chain — but this is **pre-existing and unrelated to this change**: a stock ethrex build returns the same results for an explicit `"latest"` request (e.g. `eth_getBalance(addr, "latest")` returns `0x0` where other clients return the funded balance), and `*-blockhash` requests error with "Could not resolve block number". That points to an ethrex/hive default-chain state-serving issue, which is out of scope here. This PR makes the omitted-block path behave identically to the explicit-`latest` path (the spec change), proven by the unit tests above. ## Related - Source proposal: ethereum/execution-apis#812 (by @manusw7) - execution-apis spec + conformance tests: ethereum/execution-apis#814 - go-ethereum: ethereum/go-ethereum#35100 - Nethermind: NethermindEth/nethermind#11883 - Erigon: erigontech/erigon#21586 - Besu: besu-eth/besu#10587 --------- Co-authored-by: ilitteri <ivanlitteri@hotmail.com> Co-authored-by: Tomás Grüner <47506558+MegaRedHand@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