chore: make evm staterunner always output stateroot to stderr (ethereum#29290, ethereum#29298) - #111
Merged
Conversation
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)
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
Backports upstream changes so that
evm statetestalways prints the stateRoot to stderr regardless of whether--jsonis specified.This lets batch-mode tooling (e.g. goevmlab) obtain the stateRoot without enabling json traces.
Upstream References
Changes
cmd/evm/staterunner.go: remove thejsonOutparameter fromrunStateTestand always write the stateRoot to stderr.cmd/evm/staterunner.go: passDumpFlaginstead ofMachineFlagtorunStateTest, fixing the flag mismatch introduced by #29290.Notes
evmdeveloper CLI. No impact on the node runtime, WBFT consensus, state transition, txpool, RPC, or p2p.IntermediateRoot) is unchanged; only the stderr output condition differs.Test plan
evm statetest <file>prints{"stateRoot": ...}to stderr without--jsonevm statetest --dump <file>dumps state correctly (verifies #29298 fix)