-
Notifications
You must be signed in to change notification settings - Fork 21.6k
Open
Labels
Description
Rationale
Collecting state size data for each block requires doing a full sync from genesis. To collect the data for every single block, we can first subscribe to newHeads and call debug_stateSize on the new block. The issue with this approach is that blocks can be executed much faster than the statEvictThreshold in core/state/state_sizer.go, so by the time the debug_stateSize request arrives, the data is already evicted.
The current way that we deal with this problem is to manually adjust the stateEvictThreshold to a higher number. But perhaps a better approach is to let consumers subscribe and allow state size data to be sent by the node instead.
Implementation
- Add a new subscription method in the
ethnamespace.