Skip to content

Commit d35158c

Browse files
bshastryclaude
andcommitted
Add transaction tracing support to block test command
Implements tracing functionality for the block-test subcommand in evmtool, allowing developers to debug block test execution with detailed transaction traces including opcodes, gas usage, stack, and memory state. New features: - Added -t/--trace-transactions flag to enable tracing during block test execution - Added --trace-memory, --trace-stack, --trace-returndata, --trace-storage options - Added --trace-output option to specify output file (default: stderr) - Integrated with StandardJsonTracer infrastructure - Traces are output in JSON format compatible with go-ethereum Implementation: The processBlockWithTracing() method processes transactions with full tracing while maintaining correct transaction status handling. Transactions are categorized as INVALID, FAILED, or SUCCESSFUL per Ethereum protocol: - INVALID transactions (wrong nonce, insufficient balance) reject the block - FAILED transactions (reverted execution) are included with receipts - SUCCESSFUL transactions are included with receipts This distinction ensures blocks with reverted transactions are correctly accepted, matching behavior of the standard block import path and reference implementations like go-ethereum. Conflict resolution: This commit was rebased onto main which added test summary reporting (#9246). Both features are now merged: - Test summary reporting tracks pass/fail counts across all tests - Transaction tracing provides detailed execution traces when enabled - Both features work independently and complement each other Usage: evmtool block-test -t --trace-stack --trace-memory <test-file.json> evmtool block-test -t --trace-output=trace.jsonl <test-file.json> Tested with Ethereum reference test suite including complex scenarios with failed transactions. Trace output format matches go-ethereum for compatibility with existing tooling. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> Signed-off-by: Bhargava Shastry <[email protected]>
1 parent 72ddaaf commit d35158c

File tree

1 file changed

+387
-65
lines changed

1 file changed

+387
-65
lines changed

0 commit comments

Comments
 (0)