Add transaction tracing support to block test command #9310
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.
PR description
This PR adds transaction tracing support to the
block-testsubcommand in evmtool, enabling detailed debugging of block test execution with opcode-level traces.New Feature:
-t/--traceflagThe block-test command now supports a
-tor--traceflag that outputs detailed transaction execution traces in JSON format compatible with go-ethereum. This enables developers to:Usage
Example Trace Output
Traces are output to stderr in JSON format:
{"pc":7,"op":62,"gas":"0xf3c12b","gasCost":"0x0","memSize":0,"depth":1,"refund":0,"opName":"RETURNDATACOPY","error":"Out of bounds"}Implementation Details
TracerManagerandStandardJsonTracerinfrastructureTesting
Manually tested with fuzzer derived blocktests (about 800 of them)
Both tests include transactions with runtime errors (stack underflow, out of gas, invalid opcodes) that are correctly traced and handled.
Fixed Issue(s)
N/A - This is a new feature enhancement, not fixing a reported issue.
Thanks for sending a pull request! Have you done the following?
doc-change-requiredlabel to this PR if updates are required.Locally, you can run these tests to catch failures early:
./gradlew spotlessApply./gradlew build(evmtool has no specific unit tests for this command)./gradlew acceptanceTest(not required for evmtool changes)./gradlew integrationTest(not required for evmtool changes)./gradlew ethereum:referenceTests:referenceTests(not applicable)Notes