Skip to content

Optimise tree-states block processing #4411

@michaelsproul

Description

@michaelsproul

Description

Presently block processing on the tree-states branch is a little bit slower than on unstable. Last I benchmarked it was around 3-4x slower (20ms) than unstable (5ms) for core block processing.

One of the reasons for this is the O(log n) lookups of validators and validator participation bits during attestation processing. I started adding an EpochCache which stores the pre-computed base_rewards for attestation processing, but it isn't fully integrated yet.

We could integrate either by storing it as a cache field on the BeaconState, and/or by storing it separately in a map. I think my current preference is to attach it to the BeaconState behind an Arc (it is immutable after initialization, and we want to share it between states in the same epoch).

Metadata

Metadata

Labels

optimizationSomething to make Lighthouse run more efficiently.tree-statesOngoing state and database overhaul

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions