fix(validator): reload Web3Signer keys after same-size file updates - #17350
Open
questfever wants to merge 1 commit into
Open
fix(validator): reload Web3Signer keys after same-size file updates#17350questfever wants to merge 1 commit into
questfever wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
What does this PR do? Why is it needed?
The Web3Signer key-file watcher currently uses a change in file size as a proxy for a change in file contents.
Validator public keys have a fixed width. Replacing one key with another while preserving the number of keys and formatting therefore leaves the file size unchanged. Although fsnotify reports the write, Prysm skips re-reading the file and keeps the previous key set in
providedPublicKeys.For example, replacing an equal-length key A with key B does not reload the configured validators until another size-changing update occurs, the watcher is reinitialized, or the validator client is restarted.
This PR removes the file-size gate and re-reads the key file after relevant watcher events. The existing key comparison prevents
providedPublicKeysand account-change subscribers from being updated when the parsed keys have not changed.A regression test performs an in-place overwrite from key A to an equal-length key B, verifies that the file size remains unchanged, and asserts that
SubscribeAccountChangesreceives key B.Which issue(s) does this PR fix?
Related to #17322.
This PR fixes only the same-size key-file reload bug described there and does not close the broader key-source management proposal.
Other notes for review
go test ./validator/keymanager/remote-web3signerAcknowledgements