Skip to content

eth: default Block param to latest on state methods — implementation + conformance tests (builds on #812)#814

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

eth: default Block param to latest on state methods — implementation + conformance tests (builds on #812)#814
MysticRyuujin wants to merge 1 commit into
ethereum:mainfrom
MysticRyuujin:feat/state-block-default-latest

Conversation

@MysticRyuujin
Copy link
Copy Markdown
Contributor

@MysticRyuujin MysticRyuujin commented Jun 2, 2026

Summary

Builds on #812 by @manusw7 and carries it through to a tested, client-verified state:

  1. Spec (src/eth/state.yaml): mark the Block parameter required: false with description: "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.
  2. Conformance tests (tools/testgen/generators.go): add a *-default-block case to each method that omits the Block parameter and asserts default-to-latest behavior.
  3. Fixtures (tests/**/*.io): generated via make fill against 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 build regenerates openrpc.json with Block required: false on all six methods.
  • ./tools/speccheck -v passes. Negative-tested: flipping a method back to required: true makes speccheck reject the omitted-block fixture (missing required parameter), confirming the spec change is load-bearing.
  • The six fixtures replay green in hive rpc-compat against a go-ethereum build with the implementation.

Cross-client status

  • go-ethereum: implemented; passes all six. (PR linked below.)
  • Nethermind: defaults to latest for five of six already; eth_getStorageValues required a one-method fix (its block param was non-nullable). (PR linked below.)

Related

CI note (expected red until go-ethereum merges)

The Test job's make fill step is expected to fail for this PR, and that is
structural — not a defect:

  • make fill regenerates fixtures by building the geth pinned in tools/go.mod.
  • The new *-default-block fixtures require a geth that defaults an omitted block
    to 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 fill can't reproduce the committed fixtures and the "no untracked /
    changed files" gate fails.
  • make test (speccheck) and make lint pass; the fixtures were generated with a
    local geth carrying the change and validate against the updated spec.

This resolves once go-ethereum#35100 merges and this PR's tools/go.mod is bumped
to that commit. (A replace to a personal fork would make CI green but isn't
mergeable, so it's intentionally not committed.) This is the two-PR ordering
#812 anticipated.

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.
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.

1 participant