go-ethereum/core/tracing
Ng Wei Han 01b39c96bf
core/state, core/tracing: new state update hook (#33490)
### Description
Add a new `OnStateUpdate` hook which gets invoked after state is
committed.

### Rationale
For our particular use case, we need to obtain the state size metrics at
every single block when fuly syncing from genesis. With the current
state sizer, whenever the node is stopped, the background process must
be freshly initialized. During this re-initialization, it can skip some
blocks while the node continues executing blocks, causing gaps in the
recorded metrics.

Using this state update hook allows us to customize our own data
persistence logic, and we would never skip blocks upon node restart.

---------

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
2026-01-08 11:07:19 +08:00
..
CHANGELOG.md core/tracing: update changelog (#32535) 2025-09-03 09:45:58 +02:00
gen_balance_change_reason_stringer.go core/tracing: stringer for gas and nonce change reasons (#31234) 2025-02-28 12:53:56 +01:00
gen_code_change_reason_stringer.go core/tracing: add code change reason (#32525) 2025-09-02 12:44:47 +02:00
gen_gas_change_reason_stringer.go core/tracing: stringer for gas and nonce change reasons (#31234) 2025-02-28 12:53:56 +01:00
gen_nonce_change_reason_stringer.go core/tracing: stringer for gas and nonce change reasons (#31234) 2025-02-28 12:53:56 +01:00
hooks.go core/state, core/tracing: new state update hook (#33490) 2026-01-08 11:07:19 +08:00
journal.go core/tracing: add code change reason (#32525) 2025-09-02 12:44:47 +02:00
journal_test.go core/tracing: remove unnecessary 'copy' field skip in TestAllHooksCalled (#32622) 2025-09-16 19:58:37 +08:00