459bb4a647
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> |
||
---|---|---|
.. | ||
catalyst | ||
downloader | ||
ethconfig | ||
fetcher | ||
filters | ||
gasestimator | ||
gasprice | ||
protocols | ||
tracers | ||
api_admin.go | ||
api_backend.go | ||
api_debug_test.go | ||
api_debug.go | ||
api_miner.go | ||
backend.go | ||
bloombits.go | ||
handler_eth_test.go | ||
handler_eth.go | ||
handler_snap.go | ||
handler_test.go | ||
handler.go | ||
peer.go | ||
peerset.go | ||
state_accessor.go | ||
sync_test.go | ||
sync.go |