Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validator pubkeys/indices for duties calculation #1290

Open
rodrigo-o opened this issue Sep 10, 2024 · 0 comments
Open

Validator pubkeys/indices for duties calculation #1290

rodrigo-o opened this issue Sep 10, 2024 · 0 comments
Labels
perf performance-related PRs or issues sync committees validator

Comments

@rodrigo-o
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf performance-related PRs or issues sync committees validator
Projects
Status: Backlog
Development

No branches or pull requests

1 participant