go-ethereum/cmd/evm/internal/t8ntool
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
..
block.go all: refactor so `NewBlock`, `WithBody` take `types.Body` (#29482) 2024-04-30 14:55:08 +02:00
execution.go cmd/evm: refactor handling output-files for `t8n` (#30854) 2025-01-21 15:35:03 +08:00
file_tracer.go cmd/evm: refactor handling output-files for `t8n` (#30854) 2025-01-21 15:35:03 +08:00
flags.go t8ntool: add optional call frames to json logger (#29353) 2024-03-27 16:12:57 +01:00
gen_execresult.go all: implement eip-7702 set code tx (#30078) 2024-12-16 11:29:37 +01:00
gen_header.go cmd/evm: cancun-updates for b11r and t8n -tools (#28195) 2023-10-03 03:26:33 -04:00
gen_stenv.go cmd/evm: cancun-updates for b11r and t8n -tools (#28195) 2023-10-03 03:26:33 -04:00
transaction.go cmd/evm: refactor handling output-files for `t8n` (#30854) 2025-01-21 15:35:03 +08:00
transition.go cmd/evm: refactor handling output-files for `t8n` (#30854) 2025-01-21 15:35:03 +08:00
tx_iterator.go cmd/evm/internal/t8ntool: remove unused parameter (#29930) 2024-06-07 20:04:18 +08:00
utils.go all: fix typos in comments (#29186) 2024-03-07 22:56:19 +01:00