Skip to content

fix(validator): reload Web3Signer keys after same-size file updates - #17350

Open
questfever wants to merge 1 commit into
OffchainLabs:developfrom
questfever:develop
Open

fix(validator): reload Web3Signer keys after same-size file updates#17350
questfever wants to merge 1 commit into
OffchainLabs:developfrom
questfever:develop

Conversation

@questfever

@questfever questfever commented Aug 13, 2026

Copy link
Copy Markdown

What type of PR is this?

Bug fix

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 providedPublicKeys and 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 SubscribeAccountChanges receives 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

  • Added a regression test for an equal-size in-place key-file update.
  • Verified that the test times out before the fix.
  • Verified that the test receives key B after removing the size gate.
  • go test ./validator/keymanager/remote-web3signer

Acknowledgements

  • I have read CONTRIBUTING.md.
  • I have included a uniquely named changelog fragment file.
  • I have added a description with sufficient context for reviewers to understand this PR.
  • I have tested that my changes work as expected and I added a testing plan to the PR description (if applicable).

@CLAassistant

CLAassistant commented Aug 13, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants