go-ethereum/cmd/geth
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
..
testdata cmd/geth: remove deprecated vulnerability check command (#33498) 2025-12-30 21:04:38 +01:00
accountcmd.go cmd/geth: remove unlock commandline flag (#30737) 2024-11-15 10:15:15 +01:00
accountcmd_test.go cmd/geth: remove unlock commandline flag (#30737) 2024-11-15 10:15:15 +01:00
attach_test.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
chaincmd.go core/state, core/tracing: new state update hook (#33490) 2026-01-08 11:07:19 +08:00
chaincmd_test.go cmd/geth: era-download logic fix (#32081) 2025-06-24 15:12:11 +08:00
config.go common: introduce IsHexHash and use it (#32998) 2025-11-04 21:09:36 +08:00
consolecmd.go internal/flags: remove Merge, it's identical to slices.Concat (#30706) 2024-10-31 19:26:02 +02:00
consolecmd_test.go cmd/utils: allow --networkid to override other config options (#32999) 2025-11-28 15:24:21 +01:00
dbcmd.go core, cmd: removed tablewriter from the dependencies (#33218) 2025-11-24 21:50:48 +08:00
exportcmd_test.go all: simplify tests using t.TempDir() (#30150) 2024-07-15 15:26:58 +02:00
genesis_test.go all: remove TerminalTotalDifficultyPassed (#30609) 2024-10-23 08:26:18 +02:00
logging_test.go .github: run tests with ci.go (#32590) 2025-09-11 20:15:51 +02:00
logtestcmd_active.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
logtestcmd_inactive.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
main.go cmd/geth: remove deprecated vulnerability check command (#33498) 2025-12-30 21:04:38 +01:00
misccmd.go cmd/geth: remove deprecated vulnerability check command (#33498) 2025-12-30 21:04:38 +01:00
run_test.go cmd, les, tests: remove light client code (#28586) 2023-11-23 16:28:26 +02:00
snapshot.go common: introduce IsHexHash and use it (#32998) 2025-11-04 21:09:36 +08:00