go-ethereum/eth/filters
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
..
api.go eth/filters: change error code for invalid parameter errors (#33320) 2025-12-04 11:02:42 +01:00
api_test.go eth/filters, cmd: add config of eth_getLogs address limit (#32327) 2025-09-19 00:53:40 +02:00
filter.go eth/filters: change error code for invalid parameter errors (#33320) 2025-12-04 11:02:42 +01:00
filter_system.go eth/filters: further optimize tx hash map in #32965 (#33108) 2025-11-13 14:48:26 +08:00
filter_system_test.go core/state, core/tracing: new state update hook (#33490) 2026-01-08 11:07:19 +08:00
filter_test.go core/state, core/tracing: new state update hook (#33490) 2026-01-08 11:07:19 +08:00