go-ethereum/core/vm
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
..
runtime eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
testdata crypto/kzg4844: use the new trusted setup file and format (#28383) 2023-10-22 16:05:04 +02:00
analysis_test.go all: use min/max/clear from go1.21 (#29307) 2024-03-21 13:50:13 +01:00
analysis.go core/vm: clarify comment (#27045) 2023-04-04 02:59:40 -04:00
common.go core/vm: use uint256 in EVM implementation (#20787) 2020-06-08 15:24:40 +03:00
contract.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
contracts_fuzz_test.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
contracts_test.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
contracts.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
doc.go core/vm: remove JIT VM codes (#16362) 2018-03-26 13:48:04 +03:00
eips.go all: use uint256 in state (#28598) 2024-01-23 14:51:58 +01:00
errors.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
evm.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
gas_table_test.go all: use uint256 in state (#28598) 2024-01-23 14:51:58 +01:00
gas_table.go core: fix typos (#28255) 2023-10-10 10:22:03 +02:00
gas.go core/vm: use uint256 in EVM implementation (#20787) 2020-06-08 15:24:40 +03:00
instructions_test.go all: use uint256 in state (#28598) 2024-01-23 14:51:58 +01:00
instructions.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
interface.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
interpreter_test.go all: use uint256 in state (#28598) 2024-01-23 14:51:58 +01:00
interpreter.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
jump_table_export.go core: fix typos (#28255) 2023-10-10 10:22:03 +02:00
jump_table_test.go all: fix typos in comments (#28881) 2024-02-05 22:16:32 +01:00
jump_table.go core/vm: fix misleading comment (#28860) 2024-01-23 15:17:42 +01:00
memory_table.go core/vm: implement EIP-5656, mcopy instruction (#26181) 2023-07-11 03:55:34 -04:00
memory_test.go core/vm: implement EIP-5656, mcopy instruction (#26181) 2023-07-11 03:55:34 -04:00
memory.go core/vm: implement EIP-5656, mcopy instruction (#26181) 2023-07-11 03:55:34 -04:00
opcodes.go eth/tracers/js: fix isPush for push0 (#28520) 2023-11-14 13:14:38 +01:00
operations_acl.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
stack_table.go core/vm: 64 bit memory and gas calculations (#19210) 2019-03-12 11:40:05 +02:00
stack.go core/vm: clean up some dead functions (#24851) 2022-05-11 08:03:35 +03:00