go-ethereum/core/state
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
..
access_list.go all: implement EIP-2929 (gas cost increases for state access opcodes) (#21509) 2024-04-22 21:14:54 +08:00
database.go core, eth, trie: use TryGetAccount to read what TryUpdateAccount has written #25458 (#1106) 2025-09-03 15:34:11 +08:00
dump.go core/state: do not ignore null addr while iterative dump #27320 (#1223) 2025-08-29 05:25:15 +08:00
iterator.go core/state: move state account to core/types + abstracted write account to trie #23567 (#1072) 2025-08-08 09:13:34 +08:00
iterator_test.go core/state: unexport NodeIterator #27239 (#1222) 2025-08-04 11:53:31 +08:00
journal.go core/state: mark account as dirty when resetObject occurs #27339 (#1224) 2025-08-31 16:04:51 +08:00
metrics.go core, trie: rework trie committer #25320 (#1103) 2025-08-31 15:58:48 +08:00
state_object.go eth/tracers: live chain tracing with hooks #29189 (#1352) 2025-09-09 17:30:56 +08:00
state_object_test.go core/state: optimize some internals during encoding (#20038) 2024-12-28 09:06:30 +08:00
state_reader.go new EVM Upgrade 2021-09-21 16:53:46 +05:30
state_test.go eth/tracers: live chain tracing with hooks #29189 (#1352) 2025-09-09 17:30:56 +08:00
statedb.go eth/tracers: live chain tracing with hooks #29189 (#1352) 2025-09-09 17:30:56 +08:00
statedb_test.go eth/tracers: live chain tracing with hooks #29189 (#1352) 2025-09-09 17:30:56 +08:00
statedb_utils.go record total minted into smart contract (#1026) 2025-06-16 02:31:33 -07:00
sync.go core, trie: port snap sync changes #24898 (#1096) 2025-08-26 15:20:39 +08:00
sync_test.go eth/tracers: live chain tracing with hooks #29189 (#1352) 2025-09-09 17:30:56 +08:00
transient_storage.go all: implement EIP-1153 transient storage (#26003) 2024-11-15 19:39:18 +08:00
trc21_reader.go eth/tracers: live chain tracing with hooks #29189 (#1352) 2025-09-09 17:30:56 +08:00