-
Notifications
You must be signed in to change notification settings - Fork 1.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
Validate Keystores Validator Client RPC Endpoint #9799
Conversation
@@ -26,14 +26,15 @@ service Wallet { | |||
get: "/v2/validator/wallet" | |||
}; | |||
} | |||
rpc GenerateMnemonic(google.protobuf.Empty) returns (GenerateMnemonicResponse) { |
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 is unused and no plans to ever bring it back
Mnemonic: mnemonic, | ||
}, nil | ||
// Needs to unmarshal the keystores from the requests. | ||
if req.Keystores == nil || len(req.Keystores) < 1 { |
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.
In such cases I always wonder if we should be even more restrictive and:
- check if at least one value in the array is not empty (or has whitespace only)
- in the loop that follows, skip empty/whitespace values
This might be too defensive though.
As part of the web UI onboarding, it is important to validate if a user's password can decrypt the keystores they provided during the wizard steps. Otherwise, we complete the entire onboarding process only for a user to be met with an "Incorrect keystore password" error that could have been avoided.