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

Refetch validating keys if no keys are fetched #8000

Merged
merged 10 commits into from
Dec 11, 2020
Merged

Conversation

rkapka
Copy link
Contributor

@rkapka rkapka commented Nov 30, 2020

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

When a validator starts with a remote wallet, the wallet can contain no keys. In such case the validator is stuck indefinitely on WaitForActivation, and adding keys to the wallet does not unblock it.

Which issues(s) does this PR fix?

N/A

Other notes for review

When redistributing keys by scaling up validator replicas, the safest way is to scale up validators first, and then assign keys to them. This will not work without the fix, as the new validator replicas will not fetch their keys.

@rkapka rkapka requested a review from a team as a code owner November 30, 2020 14:33
@rkapka rkapka changed the title Refetch validating keys every 30 seconds Refetch validating keys if no keys are fetched Nov 30, 2020
@rkapka rkapka added this to the v1.1.0 milestone Nov 30, 2020
@rkapka rkapka added the Ready For Review A pull request ready for code review label Nov 30, 2020
break
case <-ctx.Done():
log.Debug("Context closed, exiting fetching validating keys")
return errors.New("context closed, no longer attempting to fetch validating keys")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return errors.New("context closed, no longer attempting to fetch validating keys")
return ctx.Err()

I like ctx.Err() better here. Current error message sounds duplicated with the debug log

@rauljordan rauljordan changed the base branch from master to develop November 30, 2020 21:38
@rkapka rkapka modified the milestones: v1.0.3, v1.1.0 Dec 2, 2020
@prestonvanloon prestonvanloon modified the milestones: v1.0.4, v1.0.5 Dec 6, 2020
terencechain
terencechain previously approved these changes Dec 10, 2020
# Conflicts:
#	validator/client/validator.go
#	validator/client/validator_test.go
@rkapka rkapka merged commit 4ec396c into develop Dec 11, 2020
@delete-merged-branch delete-merged-branch bot deleted the refetch-validating-keys branch December 11, 2020 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants