go-ethereum/internal
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
..
blocktest internal/blocktest: add package for shared test code (#27270) 2023-07-11 14:57:02 +02:00
build internal/build, rpc: add missing HTTP response body Close() calls (#29223) 2024-03-12 12:12:37 +01:00
cmdtest all: make vendored copy of reexec (#28382) 2023-10-28 00:14:43 +02:00
debug log: use native log/slog instead of golang/exp (#29302) 2024-03-22 13:17:59 +01:00
era all: use min/max/clear from go1.21 (#29307) 2024-03-21 13:50:13 +01:00
ethapi eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
flags cmd, core, metrics: always report expensive metrics (#29191) 2024-03-11 10:06:57 +02:00
guide rpc, internal/guide: speed up tests a bit (#26193) 2022-11-17 15:30:53 +01:00
jsre internal/jsre: format blob fields from hexdecimal to int (#29166) 2024-03-05 15:37:26 +02:00
reexec all: make vendored copy of reexec (#28382) 2023-10-28 00:14:43 +02:00
shutdowncheck eth, les: update unclean shutdown markers regularly (#24077) 2021-12-17 15:18:51 +01:00
syncx core: improve shutdown synchronization in BlockChain (#22853) 2021-10-07 15:47:50 +02:00
testlog log: use native log/slog instead of golang/exp (#29302) 2024-03-22 13:17:59 +01:00
testrand triedb/pathdb: improve tests (#29278) 2024-03-19 10:50:08 +08:00
utesting cmd/devp2p/internal/ethtest: skip large tx test on github build (#28794) 2024-01-12 15:14:03 +01:00
version README, go.mod, event, internal/version: bump min Go to 1.19 (#26803) 2023-03-03 12:24:09 +02:00
web3ext miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00