go-ethereum/internal
Daniel Liu ad9003c41e
eth/tracers: live chain tracing with hooks #29189 (#1352)
Here we add a Go API for running tracing plugins within the main block import process.

As an advanced user of geth, you can now create a Go file in eth/tracers/live/, and within
that file register your custom tracer implementation. Then recompile geth and select your tracer
on the command line. Hooks defined in the tracer will run whenever a block is processed.

The hook system is defined in package core/tracing. It uses a struct with callbacks, instead of
requiring an interface, for several reasons:

- We plan to keep this API stable long-term. The core/tracing hook API does not depend on
  on deep geth internals.
- There are a lot of hooks, and tracers will only need some of them. Using a struct allows you
   to implement only the hooks you want to actually use.

All existing tracers in eth/tracers/native have been rewritten to use the new hook system.

This change breaks compatibility with the vm.EVMLogger interface that we used to have.
If you are a user of vm.EVMLogger, please migrate to core/tracing, and sorry for breaking
your stuff. But we just couldn't have both the old and new tracing APIs coexist in the EVM.

---------

Co-authored-by: Sina M <1591639+s1na@users.noreply.github.com>
Co-authored-by: Matthieu Vachon <matthieu.o.vachon@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: Martin HS <martin@swende.se>
2025-09-09 17:30:56 +08:00
..
build all: replace path.Join with filepath.Join #29479 (#1179) 2025-07-01 18:26:02 +08:00
cmdtest all: fix tests on 32-bit and windows + minor rpc fixes #21871 (#1055) 2025-06-03 11:47:11 +08:00
debug node: allow listening on IPv6 address #27635 (#1156) 2025-06-25 18:40:13 +08:00
ethapi eth/tracers: live chain tracing with hooks #29189 (#1352) 2025-09-09 17:30:56 +08:00
flags all: remove ethash pow 27178 (#1378) 2025-08-26 11:54:01 +08:00
guide rpc, internal/guide: speed up tests a bit #26193 (#978) 2025-04-24 19:08:57 +08:00
jsre internal: remove eth_{compile,getWork,submitWork} from console #31856 (#1408) 2025-09-03 15:41:09 +08:00
syncx core: improve shutdown synchronization in BlockChain (#22853) 2024-12-28 10:44:49 +08:00
testlog log: use native log/slog instead of golang/exp (#29302) 2024-11-15 10:02:42 +08:00
testrand accounts/abi: support unpacking solidity errors (#30738) 2025-01-24 16:54:12 +08:00
web3ext internal/ethapi: add block overrides to eth_call #26414 (#1332) 2025-09-09 14:39:59 +08:00