Skip to content

Simplify closestJustifiedBalancesStateToCheckpoint #8717

@twoeths

Description

@twoeths

Problem description

The assumption of this function is not correct anymore because we can store a lot of checkpoint states after n-historical-state flag implemented

const {state, stateId, shouldWarn} = this.closestJustifiedBalancesStateToCheckpoint(checkpoint, blockState);

Solution description

switch to async function, use PersistentCheckpointStateCache.getStateOrBytes()
if it returns a Uint8Array, loop through it to extract effective balances of active validators

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions