*: opt in for incomplete validator_keys#4591
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces an opt-in path to operate with an incomplete validator_keys directory (subset of validators / non-sequential keystore file indexes) across multiple CLI signing commands, and refactors keyshare-to-validator matching to support subset matching more efficiently.
Changes:
- Refactor
keystore.KeysharesToValidatorPubkeyto build a pubshare→validator lookup map and explicitly allow subsets of validators. - Add
--allow-incomplete-keystorestodeposit sign,feerecipient sign, andexit signflows via a sharedloadValidatorShareshelper. - Add/extend tests for subset loading/matching and CLI helper behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| eth2util/keystore/keystore.go | Changes keyshare→validator matching algorithm; updates semantics/docs to allow subset matching. |
| eth2util/keystore/keystore_test.go | Adds coverage for subset and duplicate-share matching scenarios. |
| cmd/loadvalidatorkeys.go | New shared helper to load/match keystores, with strict vs allow-incomplete behavior and warning. |
| cmd/loadvalidatorkeys_internal_test.go | Tests strict vs lenient (allowIncomplete) loading behavior, including gapped subsets. |
| cmd/feerecipientsign.go | Adds --allow-incomplete-keystores flag and routes keystore loading via helper. |
| cmd/depositsign.go | Adds --allow-incomplete-keystores flag and routes keystore loading via helper. |
| cmd/exit.go | Adds allow-incomplete-keystores flag plumbing into exit config/flag binding. |
| cmd/exit_sign.go | Uses helper for keystore loading and includes the new flag in command flag set. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4591 +/- ##
==========================================
+ Coverage 57.51% 57.57% +0.06%
==========================================
Files 245 246 +1
Lines 33653 33660 +7
==========================================
+ Hits 19354 19380 +26
+ Misses 11854 11840 -14
+ Partials 2445 2440 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|



Previously I've pushed code to allow not full validator_keys directory #4576 . However, I chickened out on it :).
I'm afraid it might lead to not catching some issues with permissions, directories, etc. That's why this PR is making it optional to allow not full validator keys directory, the default being the previous behaviour.
There is also one addition, it now checks for repeating validators in multiple files, while previously we didn't have this check.
category: feature
ticket: none