-
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
Web3signer: persistent public keys #13682
Conversation
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
io/file/fileutil_test.go
Outdated
{ | ||
name: "overwrite existing file", | ||
lines: []string{"line1", "line2"}, | ||
filename: "testfile2.txt", | ||
wantErr: false, | ||
}, |
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.
Doesn't this test do exactly the same as the first 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.
need to fix this test
return nil | ||
} | ||
|
||
func (km *Keymanager) areEmptyPublicKeys() bool { |
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.
arePublicKeysEmpty
sounds better in my opinion
return len(km.providedPublicKeys) == 0 | ||
} | ||
|
||
func (km *Keymanager) refreshRemoteKeysFromFileChanges(ctx context.Context) error { |
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.
Most of the logic is low-level logic independent of remote signer keys. If we move it to io/file
, then we will be able to reuse such file watching in other places.
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
Co-authored-by: Radosław Kapka <rkapka@wp.pl>
} | ||
return errors.Wrap(err, "could not watch for file changes") | ||
case <-ctx.Done(): | ||
return nil |
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.
We probably want to log something here
What type of PR is this?
Feature
What does this PR do? Why is it needed?
currently prysm doesn't provide a way to persist api changes for web3signer keys using things like add or remove remote keys.
This pr provides a new flag
--validators-external-signer-key-file=/path/to/keyfile.txt
where you can provide a list of your public keys in hex format on each line to be used with your web3signer. note,hex keys will require a0x
prefix. if this flag is provided all keys provided via thevalidators-external-signer-public-keys
can also be saved if there are calls to the api. updating the file directly will also update the keys used without restart of the validator client( but caution as this part is still experimental)Which issues(s) does this PR fix?
Fixes #9994, #12373
Other notes for review