-
Notifications
You must be signed in to change notification settings - Fork 20.2k
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
cmd/geth: remove unlock commandline flag #30737
Conversation
Fatalf("Failed to read password file: %v", err) | ||
} else { | ||
if lines := strings.Split(string(text), "\n"); len(lines) > 0 { | ||
passphrase = strings.TrimRight(lines[0], "\r") // Sanitise DOS line endings. |
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'm wondering if it makes sense to log something here, if we cut of additional passwords? I guess we didn't log anything here previously, so it might not be needed
return errors.New("address must be specified in hexadecimal form") | ||
} | ||
account := accounts.Account{Address: common.HexToAddress(addr)} | ||
newPassword := utils.GetPassPhrase("Please give a NEW password. Do not forget this password.", true) |
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 seems to be the only major change here, you turned the prompts around, so it asks for the NEW password before it asks for the OLD one to update. This way it only asks you once for the new one and not multiple times if the old fails.
Seemed a bit counter-intuitive to me at first, but I think I agree that this makes most sense
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 don't follow. Change or order, yes, but what do you mean I changed about the confirmations?
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 way it only asks you once for the new one and not multiple times if the old fails.
So, with the old pw, you still have three retries. And there's a confirmation on the new password, so you do have to enter that twice. So afaict the only change really is that it now asks for the new password before it asks for the old one.
?
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.
LGTM, a few people might complain, but I think we should do it. Another step in the right direction!
accounts/manager.go
Outdated
@@ -63,7 +54,7 @@ type Manager struct { | |||
|
|||
// NewManager creates a generic account manager to sign transaction via various | |||
// supported backends. | |||
func NewManager(config *Config, backends ...Backend) *Manager { | |||
func NewManager(backends ...Backend) *Manager { |
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 hate to be that guy again, but this function has had a stable signature for a long time. So I would prefer not to change it. We can simply ignore the setting.
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.
It's a bit weird that we even added it. In hindsight it would've been better to add a method like SetInsecureUnlockAllowed
on the Manager
.
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.
Can we just make it an any
?
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 guess not, for the same reason. Ugh
This is one further step towards removing account management from `geth`. This PR deprecates the flag `unlock`, and makes the flag moot: unlock via geth is no longer possible.
This is one further step towards removing account management from
geth
. This PR deprecates the flagunlock
, and makes the flag moot: unlock via geth is no longer possible.In order to remove some unneeded code, I also rewrote
accountUpdate
a bit. I have tested it in both happy-path and various failure modes, e..gThis PR also removes the the
This functionality is deprecated and will be removed in the future!
from here:is now: