func (s *Service) ValidatorsByPubKey(ctx context.Context, pubKeys []phase0.BLSPubKey) map[phase0.ValidatorIndex]*phase0.Validator {
	res := make(map[phase0.ValidatorIndex]*phase0.Validator)
	s.validatorsMutex.RLock()
	for _, pubKey := range pubKeys {
		if validator, exists := s.validatorsByPubKey[pubKey]; exists {
			res[s.validatorPubKeyToIndex[pubKey]] = validator
		}
	}
	s.validatorsMutex.RUnlock()
	return res
}
ValidatorsByPubKey fetches the requested validators from local store given their public keys.
package standard
import (
	"context"
	"github.com/attestantio/go-eth2-client/spec/phase0"
)