*: allow incomplete validator_keys store when parsing - #4576
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4576 +/- ##
==========================================
- Coverage 57.22% 57.21% -0.02%
==========================================
Files 245 245
Lines 33448 33448
==========================================
- Hits 19141 19136 -5
- Misses 11881 11886 +5
Partials 2426 2426 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
A few findings by Fable for your to consider: |
There was a problem hiding this comment.
Pull request overview
This PR fixes CLI flows that rely on partial validator_keys by allowing KeysharesToValidatorPubkey to succeed when only a subset of validator keyshares are present, as long as every provided share belongs to a validator in the cluster lock.
Changes:
- Relaxed
KeysharesToValidatorPubkeyvalidation to allow missing validators’ keyshares (subset operation), while still rejecting foreign/unmatched shares. - Added targeted unit tests covering subset success and foreign-share failure cases.
- Updated function documentation to reflect the new (subset-friendly) behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| eth2util/keystore/keystore.go | Adjusts keyshare-to-validator mapping validation to support subset key stores and improves error reporting. |
| eth2util/keystore/keystore_test.go | Adds tests ensuring subset keyshares work and foreign shares are rejected. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Every provided private key share must belong to a validator in the cluster lock. | ||
| for shareIdx, ok := range matched { | ||
| if !ok { | ||
| return nil, errors.New("public key share from provided private key share not found in provided lock", z.Int("share_index", shareIdx)) | ||
| } |



Previously Charon failed commands requiring the partial keys when only a subset of the keys is available in
validator_keysdirectory:This is actually incorrect as the said key did exist, however, not the full set of keys in the lock were available in the directory. Scenarios in which allowing this is useful:
category: bug
ticket: none