eth: default Block param to latest on state methods — implementation + conformance tests (builds on #812)#814
Draft
MysticRyuujin wants to merge 1 commit into
Conversation
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 was referenced Jun 2, 2026
Merged
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.
Summary
Builds on #812 by @manusw7 and carries it through to a tested, client-verified state:
src/eth/state.yaml): mark theBlockparameterrequired: falsewithdescription: "default: 'latest'"on the six state-reading methods (eth_getBalance,eth_getStorageAt,eth_getStorageValues,eth_getTransactionCount,eth_getCode,eth_getProof) — identical to @manusw7's proposal in Default Block param to 'latest' on eth_* state methods #812.tools/testgen/generators.go): add a*-default-blockcase to each method that omits theBlockparameter and asserts default-to-latest behavior.tests/**/*.io): generated viamake fillagainst a go-ethereum build that implements the behavior.This addresses the two open items in #812's checklist: a go-ethereum implementation, and hive-enforceable conformance tests for the default-to-latest behavior.
Credit
The proposal, rationale, and spec change originate with @manusw7 in #812. This PR exists to implement and test it across clients — full credit to @manusw7 for the standards work.
Validation
make buildregeneratesopenrpc.jsonwithBlockrequired: falseon all six methods../tools/speccheck -vpasses. Negative-tested: flipping a method back torequired: truemakes speccheck reject the omitted-block fixture (missing required parameter), confirming the spec change is load-bearing.hiverpc-compatagainst a go-ethereum build with the implementation.Cross-client status
eth_getStorageValuesrequired a one-method fix (its block param was non-nullable). (PR linked below.)Related
eth_getStorageValuesfix: JsonRpc: default omitted block to latest for eth_getStorageValues NethermindEth/nethermind#11883CI note (expected red until go-ethereum merges)
The
Testjob'smake fillstep is expected to fail for this PR, and that isstructural — not a defect:
make fillregenerates fixtures by building the geth pinned intools/go.mod.*-default-blockfixtures require a geth that defaults an omitted blockto
latest— i.e. the accompanying go-ethereum PR (internal/ethapi: default block parameter to latest on state methods go-ethereum#35100),which isn't merged yet. Upstream-pinned geth still errors on the omitted block,
so
make fillcan't reproduce the committed fixtures and the "no untracked /changed files" gate fails.
make test(speccheck) andmake lintpass; the fixtures were generated with alocal geth carrying the change and validate against the updated spec.
This resolves once go-ethereum#35100 merges and this PR's
tools/go.modis bumpedto that commit. (A
replaceto a personal fork would make CI green but isn'tmergeable, so it's intentionally not committed.) This is the two-PR ordering
#812 anticipated.