go-ethereum/core/state
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
..
pruner all: remove the dependency from trie to triedb (#28824) 2024-02-13 14:49:53 +01:00
snapshot tests: fix goroutine leak related to state snapshot generation (#28974) 2024-02-14 17:02:56 +01:00
access_list.go all: implement EIP-2929 (gas cost increases for state access opcodes) + yolo-v2 (#21509) 2020-10-23 08:26:57 +02:00
database.go all: remove the dependency from trie to triedb (#28824) 2024-02-13 14:49:53 +01:00
dump.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
iterator.go cmd, core, trie: verkle-capable geth init (#28270) 2023-11-14 13:09:40 +01:00
iterator_test.go all: activate pbss as experimental feature (#26274) 2023-08-10 22:21:36 +03:00
journal.go all: use uint256 in state (#28598) 2024-01-23 14:51:58 +01:00
metrics.go core/state, trie/triedb/pathdb: remove storage incomplete flag (#28940) 2024-03-05 14:31:55 +01:00
state_object.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
state_object_test.go build: use golangci-lint (#20295) 2019-11-18 10:49:17 +02:00
state_test.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
statedb.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
statedb_fuzz_test.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
statedb_test.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
sync.go core,eth,internal: fix typo (#29024) 2024-02-20 19:42:48 +08:00
sync_test.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
transient_storage.go all: implement EIP-1153 transient storage (#26003) 2022-11-16 10:18:52 +01:00
trie_prefetcher.go cmd, core, trie: verkle-capable geth init (#28270) 2023-11-14 13:09:40 +01:00
trie_prefetcher_test.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00