-
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
Fix validator activation monitoring with inactive keys #8558
Conversation
@@ -129,3 +148,24 @@ func incrementRetries(ctx context.Context) context.Context { | |||
attempts := streamAttempts(ctx) | |||
return context.WithValue(ctx, waitForActivationAttemptsContextKey, attempts+1) | |||
} | |||
|
|||
func handleAccountsChanged(ctx context.Context, v Validator, accountsChangedChan chan<- struct{}) { |
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.
This method seems redundant, its basically creates a channel to relay account changes to the accountsChangedChan
. How about changing the accountsChangedChan
type to a chan<- [][48]byte
and then subscribe account changes to it directly ? You could skip this additional routine and channel being created here.
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.
Excellent feedback! Doing this now.
Doesn't make sense to approve and suggest changes.
typo fixes
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.
looks good
Some feedback from @rkapka in discord is that we could refactor this further to remove the recursive functionality. This feature / refactoring will come in a future PR. Thanks! |
What type of PR is this?
Bug fix
What does this PR do? Why is it needed?
When starting a Prysm validator, the client would monitor the beacon chain for activations of its public keys. If none of the keys are active, it will continue to monitor until one of the keys has been activated. One of the features of the validator is that the key manager is monitoring for new key additions. The bug was that the new key additions were not being included in the activation monitoring routine and would require a restart to pick up the changes.
Tested in pyrmont and saw the keys reloaded.
Which issues(s) does this PR fix?
Fixes #8546
Other notes for review
Relevant doc: https://docs.google.com/document/d/1fLdUi6AHQ5-wYOy6DCzW5JlLlq3VuI275-KoyEZ2Pmw/edit#
This PR solves the following issues:
Some unrelated files are included due to goimports changes.
This PR also properly stops the SubscribeAccountChanges goroutine.