-
Notifications
You must be signed in to change notification settings - Fork 1k
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 registration filter non active keys before submission #12322
Conversation
// map is populated before this function in buildPrepProposerReq | ||
_, ok := v.pubkeyToValidatorIndex[k] | ||
if !ok { | ||
continue | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need a read lock to access this map?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not currently, is this something that should have a read lock and write lock for updating?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
access to this map should be sequential only so read and writes shouldn't overlap in this case I think we won't need the lock but will test.
validator/client/validator.go
Outdated
v.pubkeyToValidatorIndex[k] = i | ||
} | ||
status, err := v.validatorClient.ValidatorStatus(ctx, ðpb.ValidatorStatusRequest{PublicKey: k[:]}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doing this for every validator seems expensive, each request will be a separate roundtrip to the beacon node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated using our internal API which will minimize the requests.
What type of PR is this?
Bug fix
What does this PR do? Why is it needed?
some relays do not accept validators that are not in active status such as validators that are exited.
currently, we send validator registrations as long as the public key has an index but it seems that some relays return 502 if the validator has exited. this pr adds additional filtering for these cases.
currently the user will receive this kind of error
now the non active status validators should be filtered and not included when submitting builder validator registration
the most expensive call added here is
MultipleValidatorStatus
, below is a screenshot of the api called in another place in the code with 1000 validators on prater resulting in 20millisecond return