Skip to content

*: opt in for incomplete validator_keys#4591

Merged
KaloyanTanev merged 3 commits into
mainfrom
kalo/opt-in-incomplete-validator_keys
Jul 8, 2026
Merged

*: opt in for incomplete validator_keys#4591
KaloyanTanev merged 3 commits into
mainfrom
kalo/opt-in-incomplete-validator_keys

Conversation

@KaloyanTanev

@KaloyanTanev KaloyanTanev commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

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

@KaloyanTanev KaloyanTanev marked this pull request as draft July 8, 2026 14:55
@KaloyanTanev KaloyanTanev self-assigned this Jul 8, 2026
@KaloyanTanev KaloyanTanev requested a review from Copilot July 8, 2026 14:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.KeysharesToValidatorPubkey to build a pubshare→validator lookup map and explicitly allow subsets of validators.
  • Add --allow-incomplete-keystores to deposit sign, feerecipient sign, and exit sign flows via a shared loadValidatorShares helper.
  • 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.

Comment thread eth2util/keystore/keystore.go
Comment thread cmd/loadvalidatorkeys.go
Comment thread eth2util/keystore/keystore_test.go Outdated
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.09091% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.57%. Comparing base (611bb0b) to head (ec57169).

Files with missing lines Patch % Lines
cmd/loadvalidatorkeys.go 90.47% 1 Missing and 1 partial ⚠️
eth2util/keystore/keystore.go 90.47% 1 Missing and 1 partial ⚠️
cmd/depositsign.go 66.66% 1 Missing ⚠️
cmd/feerecipientsign.go 66.66% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Comment thread eth2util/keystore/keystore.go
Comment thread cmd/loadvalidatorkeys.go
Comment thread cmd/loadvalidatorkeys.go
@sonarqubecloud

sonarqubecloud Bot commented Jul 8, 2026

Copy link
Copy Markdown

@KaloyanTanev KaloyanTanev requested a review from pinebit July 8, 2026 15:57
@KaloyanTanev KaloyanTanev marked this pull request as ready for review July 8, 2026 15:57
@KaloyanTanev KaloyanTanev merged commit 28fb10e into main Jul 8, 2026
14 of 15 checks passed
@KaloyanTanev KaloyanTanev deleted the kalo/opt-in-incomplete-validator_keys branch July 8, 2026 16:54
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.

3 participants