go-ethereum/eth/tracers
Martin HS 459bb4a647
core/state: move state log mechanism to a separate layer (#30569)
This PR moves the logging/tracing-facilities out of `*state.StateDB`,
in to a wrapping struct which implements `vm.StateDB` instead.

In most places, it is a pretty straight-forward change: 
- First, hoisting the invocations from state objects up to the statedb. 
- Then making the mutation-methods simply return the previous value, so
that the external logging layer could log everything.

Some internal code uses the direct object-accessors to mutate the state,
particularly in testing and in setting up state overrides, which means
that these changes are unobservable for the hooked layer. Thus, configuring
the overrides are not necessarily part of the API we want to publish.

The trickiest part about the layering is that when the selfdestructs are
finally deleted during `Finalise`, there's the possibility that someone
sent some ether to it, which is burnt at that point, and thus needs to
be logged. The hooked layer reaches into the inner layer to figure out
these events.

In package `vm`, the conversion from `state.StateDB + hooks` into a
hooked `vm.StateDB` is performed where needed.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2024-10-23 08:03:36 +02:00
..
internal core/state: move state log mechanism to a separate layer (#30569) 2024-10-23 08:03:36 +02:00
js eth/tracers/js: avoid compiling js bigint when not needed (#30640) 2024-10-20 19:36:51 +03:00
live eth/tracers: various fixes (#30540) 2024-10-17 06:51:47 +02:00
logger core/state: move state log mechanism to a separate layer (#30569) 2024-10-23 08:03:36 +02:00
native eth/tracers: various fixes (#30540) 2024-10-17 06:51:47 +02:00
api_test.go all: remove forkchoicer and reorgNeeded (#29179) 2024-09-04 15:03:06 +02:00
api.go core/state: move state log mechanism to a separate layer (#30569) 2024-10-23 08:03:36 +02:00
dir.go eth/tracers: various fixes (#30540) 2024-10-17 06:51:47 +02:00
live.go eth/tracers: various fixes (#30540) 2024-10-17 06:51:47 +02:00
tracers_test.go eth/tracers: live chain tracing with hooks (#29189) 2024-03-22 18:53:53 +01:00
tracker_test.go eth/traces: add state limit (#25812) 2022-10-06 10:48:04 +02:00
tracker.go eth/traces: add state limit (#25812) 2022-10-06 10:48:04 +02:00