go-ethereum/internal/ethapi
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
..
testdata internal/ethapi: handle blobs in API methods (#28786) 2024-01-17 15:06:14 +01:00
addrlock.go all: update license information (#16089) 2018-02-14 13:49:11 +01:00
api_test.go crypto/kz4844: pass blobs by ref (#29050) 2024-03-13 07:51:46 +01:00
api.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
backend.go miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00
dbapi.go all: remove concept of public/private API definitions (#25053) 2022-06-21 12:05:43 +03:00
errors.go core: move tx indexer to its own file (#28857) 2024-01-23 21:00:50 +01:00
transaction_args_test.go miner: refactor the miner, make the pending block on demand (#28623) 2024-03-06 14:45:03 +02:00
transaction_args.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00