Open
Description
Right now the fetch_validator_index
function is doing a linear search of all validators pubkeys every time one index is needed.
@spec fetch_validator_index(Types.BeaconState.t(), Bls.pubkey()) ::
non_neg_integer() | nil
def fetch_validator_index(state, pubkey) do
Enum.find_index(state.validators, &(&1.pubkey == pubkey))
end
After #1284 every period we need to recalculate the sync_subcommitte_participants
which depends on it, we should measure if this can became a bottleneck or not, and in case it is go with a map instead.
Metadata
Metadata
Assignees
Type
Projects
Status
Backlog