go-ethereum/eth
Sina M 064f37d6f6
eth/tracers: live chain tracing with hooks (#29189)
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: Matthieu Vachon <matthieu.o.vachon@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
Co-authored-by: Martin HS <martin@swende.se>
2024-03-22 18:53:53 +01:00
..
catalyst beacon/blsync: support for deneb fork (#29180) 2024-03-20 19:22:44 +01:00
downloader log: use native log/slog instead of golang/exp (#29302) 2024-03-22 13:17:59 +01:00
ethconfig eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
fetcher consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
filters miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00
gasestimator all: use uint256 in state (#28598) 2024-01-23 14:51:58 +01:00
gasprice miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00
protocols all: use min/max/clear from go1.21 (#29307) 2024-03-21 13:50:13 +01:00
tracers eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
api_admin.go eth: ignore genesis block on importChain (#27956) 2023-08-21 13:32:34 -04:00
api_backend.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
api_debug.go miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00
api_debug_test.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
api_miner.go miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00
backend.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
bloombits.go
handler.go all: fix typos in comments (#29186) 2024-03-07 22:56:19 +01:00
handler_eth.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
handler_eth_test.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
handler_snap.go
handler_test.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
peer.go eth: remove admin.peers[i].eth.head and difficulty (#26804) 2023-03-06 09:27:46 +02:00
peerset.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
state_accessor.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
sync.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00
sync_test.go consensus, cmd, core, eth: remove support for non-merge mode of operation (#29169) 2024-03-05 16:13:28 +02:00