Skip to content

chore: make evm staterunner always output stateroot to stderr (ethereum#29290, ethereum#29298) - #111

Merged
hmlee-wm merged 2 commits into
devfrom
chore/backport-evm-staterunner-stateroot-output
Jul 14, 2026
Merged

hmlee-wm merged 2 commits into
devfrom
chore/backport-evm-staterunner-stateroot-output

Conversation

@hmlee-wm

Copy link
Copy Markdown
Collaborator

Summary

Backports upstream changes so that evm statetest always prints the stateRoot to stderr regardless of whether --json is specified.
This lets batch-mode tooling (e.g. goevmlab) obtain the stateRoot without enabling json traces.

Upstream References

PR Description
#29290 cmd/evm: make staterunner always output stateroot to stderr
#29298 cmd/evm: fix flag-mismatch from #29290

Changes

  • cmd/evm/staterunner.go: remove the jsonOut parameter from runStateTest and always write the stateRoot to stderr.
  • cmd/evm/staterunner.go: pass DumpFlag instead of MachineFlag to runStateTest, fixing the flag mismatch introduced by #29290.

Notes

  • Affects only the evm developer CLI. No impact on the node runtime, WBFT consensus, state transition, txpool, RPC, or p2p.
  • The stateRoot computation (IntermediateRoot) is unchanged; only the stderr output condition differs.
  • No hardfork, DB migration, or node compatibility concerns.

Test plan

  • evm statetest <file> prints {"stateRoot": ...} to stderr without --json
  • evm statetest --dump <file> dumps state correctly (verifies #29298 fix)

holiman added 2 commits July 13, 2026 20:23
This changes makes it so that when `evm statetest` executes, regardless of whether `--json` is specified or not, the stateroot is printed on `stderr` as a `jsonl` line. This enables speedier execution of testcases in goevmlab, in cases where full execution op-by-op is not required.

(cherry picked from commit de08f3d62552531f3fb2fc3a64a4bfdb962900eb)
(cherry picked from commit 9a7e6ce6f593d1284512032d5757a85a15e6d636)
@hmlee-wm
hmlee-wm requested review from 0xmhha, colinkim and eomti-wm July 13, 2026 11:48
@hmlee-wm hmlee-wm self-assigned this Jul 13, 2026
@hmlee-wm hmlee-wm added the chore Build, tooling, dependency, or config changes label Jul 13, 2026

@0xmhha 0xmhha left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eomti-wm eomti-wm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hmlee-wm
hmlee-wm merged commit c3466d4 into dev Jul 14, 2026
3 checks passed
@hmlee-wm
hmlee-wm deleted the chore/backport-evm-staterunner-stateroot-output branch July 20, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Build, tooling, dependency, or config changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants