go-ethereum/cmd/evm/testdata/31
Martin HS 2bf4a8ff73
cmd/evm: refactor handling output-files for `t8n` (#30854)
As part of trying to make the inputs and outputs of the evm subcommands
more streamlined and aligned, this PR modifies how `evm t8n` manages
output-files.

Previously, we do a kind of wonky thing where between each transaction,
we invoke a `getTracer` closure. In that closure, we create a new
output-file, a tracer, and then make the tracer stream output to the
file. We also fiddle a bit to ensure that the file becomes properly
closed.

It is a kind of hacky solution we have in place. This PR changes it, so
that from the execution-pipeline point of view, we have just a regular
tracer. No fiddling with re-setting it or closing files.

That particular tracer, however, is a bit special: it takes care of
creating new files per transaction (in the tx-start-hook) and closing
(on tx-end-hook). Also instantiating the right type of underlying
tracer, which can be a json-logger or a custom tracer.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2025-01-21 15:35:03 +08:00
..
README.md cmd/evm: refactor handling output-files for `t8n` (#30854) 2025-01-21 15:35:03 +08:00
alloc.json eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
env.json eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
trace-0-0x88f5fbd1524731a81e49f637aa847543268a5aaf2a6b32a69d2c6d978c45dcfb.json cmd/evm: refactor handling output-files for `t8n` (#30854) 2025-01-21 15:35:03 +08:00
trace-0-0x88f5fbd1524731a81e49f637aa847543268a5aaf2a6b32a69d2c6d978c45dcfb.jsonl eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
trace-1-0x03a7b0a91e61a170d64ea94b8263641ef5a8bbdb10ac69f466083a6789c77fb8.json cmd/evm: refactor handling output-files for `t8n` (#30854) 2025-01-21 15:35:03 +08:00
trace-1-0x03a7b0a91e61a170d64ea94b8263641ef5a8bbdb10ac69f466083a6789c77fb8.jsonl cmd/evm: refactor handling output-files for `t8n` (#30854) 2025-01-21 15:35:03 +08:00
trace-2-0xd96e0ce6418ee3360e11d3c7b6886f5a9a08f7ef183da72c23bb3b2374530128.json cmd/evm: refactor handling output-files for `t8n` (#30854) 2025-01-21 15:35:03 +08:00
trace-2-0xd96e0ce6418ee3360e11d3c7b6886f5a9a08f7ef183da72c23bb3b2374530128.jsonl cmd/evm: refactor handling output-files for `t8n` (#30854) 2025-01-21 15:35:03 +08:00
txs.json cmd/evm: refactor handling output-files for `t8n` (#30854) 2025-01-21 15:35:03 +08:00

README.md

This test does some EVM execution, and can be used to test the tracers and trace-outputs. This test should yield three output-traces, in separate files

For example:

[user@work evm]$ go  run . t8n --input.alloc ./testdata/31/alloc.json --input.txs ./testdata/31/txs.json --input.env ./testdata/31/env.json --state.fork Cancun --output.basedir /tmp --trace
INFO [12-06|09:53:32.123] Created tracing-file                     path=/tmp/trace-0-0x88f5fbd1524731a81e49f637aa847543268a5aaf2a6b32a69d2c6d978c45dcfb.jsonl
INFO [12-06|09:53:32.124] Created tracing-file                     path=/tmp/trace-1-0x03a7b0a91e61a170d64ea94b8263641ef5a8bbdb10ac69f466083a6789c77fb8.jsonl
INFO [12-06|09:53:32.125] Created tracing-file                     path=/tmp/trace-2-0xd96e0ce6418ee3360e11d3c7b6886f5a9a08f7ef183da72c23bb3b2374530128.jsonl