go-ethereum/internal/ethapi
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
..
testdata all: implement EIP-7002 & EIP-7251 (#30571) 2024-10-11 21:36:13 +02:00
addrlock.go all: update license information (#16089) 2018-02-14 13:49:11 +01:00
api.go core/state: move state log mechanism to a separate layer (#30569) 2024-10-23 08:03:36 +02:00
api_test.go core/state: move state log mechanism to a separate layer (#30569) 2024-10-23 08:03:36 +02:00
backend.go core, eth, ethstats: simplify chain head events (#30601) 2024-10-16 10:32:58 +03:00
dbapi.go all: remove concept of public/private API definitions (#25053) 2022-06-21 12:05:43 +03:00
errors.go internal/ethapi: eth_multicall (#27720) 2024-09-06 11:31:00 +02:00
logtracer.go internal/ethapi: eth_multicall (#27720) 2024-09-06 11:31:00 +02:00
simulate.go core/state: move state log mechanism to a separate layer (#30569) 2024-10-23 08:03:36 +02:00
simulate_test.go internal/ethapi: eth_multicall (#27720) 2024-09-06 11:31:00 +02:00
transaction_args.go common: drop BigMin and BigMax, they pollute our dep graph (#30645) 2024-10-21 12:45:33 +03:00
transaction_args_test.go core, eth, ethstats: simplify chain head events (#30601) 2024-10-16 10:32:58 +03:00