go-ethereum/internal
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
..
blocktest internal/blocktest: add package for shared test code (#27270) 2023-07-11 14:57:02 +02:00
build build: get rid of ci.go -> common direct dependency (#30637) 2024-10-20 14:54:06 +03:00
cmdtest all: make vendored copy of reexec (#28382) 2023-10-28 00:14:43 +02:00
debug internal/debug: remove memsize (#30253) 2024-08-02 06:44:03 +02:00
era internal: run tests in parallel (#30381) 2024-09-16 08:44:47 +02:00
ethapi core/state: move state log mechanism to a separate layer (#30569) 2024-10-23 08:03:36 +02:00
flags build, internal, version: break ci.go/version->common dependency (#30638) 2024-10-20 19:28:39 +03:00
guide internal: run tests in parallel (#30381) 2024-09-16 08:44:47 +02:00
jsre internal/ethapi: remove td field from block (#30386) 2024-10-01 11:36:56 +02:00
reexec all: make vendored copy of reexec (#28382) 2023-10-28 00:14:43 +02:00
shutdowncheck eth, les: update unclean shutdown markers regularly (#24077) 2021-12-17 15:18:51 +01:00
syncx core: improve shutdown synchronization in BlockChain (#22853) 2021-10-07 15:47:50 +02:00
testlog p2p/discover: improved node revalidation (#29572) 2024-05-23 14:26:09 +02:00
testrand triedb/pathdb: improve tests (#29278) 2024-03-19 10:50:08 +08:00
utesting internal: run tests in parallel (#30381) 2024-09-16 08:44:47 +02:00
version build, internal, version: break ci.go/version->common dependency (#30638) 2024-10-20 19:28:39 +03:00
web3ext internal/web3ext: rm unused modules (#30532) 2024-10-01 18:27:25 +02:00