go-ethereum/consensus/misc
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
..
eip1559 common: drop BigMin and BigMax, they pollute our dep graph (#30645) 2024-10-21 12:45:33 +03:00
eip4844 params: update 4844 parameters (#28026) 2023-09-05 04:49:51 -04:00
dao.go core/state: move state log mechanism to a separate layer (#30569) 2024-10-23 08:03:36 +02:00
gaslimit.go consensus/misc: fix min gas limit error message (#28085) 2023-09-11 04:57:22 -04:00