Skip to content

Add new subscription method for state size #33387

@weiihann

Description

@weiihann

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 eth namespace.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions