Skip to content

cmd: validate addresses consistently across create and edit - #4805

Open
OisinKyne wants to merge 5 commits into
mainfrom
oisin/address-validation
Open

OisinKyne wants to merge 5 commits into
mainfrom
oisin/address-validation

Conversation

@OisinKyne

@OisinKyne OisinKyne commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Applies one address rule across create and edit commands, and makes feerecipient sign and exit sign safer.

  • create cluster without --definition-file skipped validateWithdrawalAddrs and the insecure-keys-on-mainnet check (validateDef only ran on the definition-file path): mainnet + zero withdrawal address + --insecure-keys succeeded. Now validated.
  • alpha edit add-validators and create dkg fee recipients were never validated. Now validated before the ceremony / definition is written.
  • Shared rule: 0x + 40 hex; all lower or all upper case accepted; mixed case must match EIP-55; a zero withdrawal address is an error on mainnet/gnosis in create dkg and create cluster --definition-file (as before), and only a warning on the paths newly validated here (create cluster from flags, add-validators, fee recipients), because it is legitimate when the deposit data is never used: splitting existing keys, or clusters that deposit through their own contracts (EtherFi's mainnet clusters use the zero withdrawal address); a zero fee recipient only warns; addresses stored checksummed (current definition hashing is case-insensitive over address bytes, so hashes are unaffected).
  • feerecipient sign: errors instead of signing gas limit 0; refuses to adopt an in-progress registration with gas limit 0 or a timestamp more than 5 minutes ahead unless --timestamp confirms it. (Feature is being reworked; this only makes it safer.)
  • exit sign with both --validator-public-key and --validator-index: errors if the beacon node maps the index to a different pubkey; warns and continues if the index is unknown.

User-visible: lowercase withdrawal addresses are now accepted where they failed as "invalid checksummed address"; bad-checksum addresses are rejected on more paths, and zero addresses now get a warning on paths that ignored them; error texts changed.

category: bug
ticket: none

create cluster without a definition file skipped withdrawal address
validation and the insecure-keys-on-mainnet check, and add-validators
and create dkg fee recipients were never validated, so a zero or
mistyped address on mainnet produced valid deposits.

All create/edit paths now share one rule: 0x + 40 hex, all lower or
all upper case accepted, mixed case must match EIP-55, zero address
forbidden on mainnet/gnosis, stored checksummed.

feerecipient sign refuses gas limit 0 and adopting an in-progress
registration timestamped more than 5 minutes ahead unless --timestamp
confirms it. exit sign with both --validator-public-key and
--validator-index checks the index belongs to the pubkey when the
beacon node knows it.
@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.59459% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.72%. Comparing base (4e4d996) to head (8d68015).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
cmd/createcluster.go 89.18% 4 Missing ⚠️
cmd/exit_sign.go 88.88% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4805      +/-   ##
==========================================
+ Coverage   67.61%   67.72%   +0.10%     
==========================================
  Files         254      255       +1     
  Lines       33609    33717     +108     
==========================================
+ Hits        22725    22835     +110     
+ Misses      10883    10881       -2     
  Partials        1        1              

☔ 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.

aly-obol
aly-obol previously approved these changes Oct 23, 2026
Zero withdrawal and fee recipient addresses are legitimate when the
generated deposit data is never used, e.g. splitting existing keys of
active validators, or clusters that deposit through their own contracts
(EtherFi's mainnet clusters use the zero withdrawal address).

Keep the existing zero withdrawal address errors in create dkg and
create cluster --definition-file, and only warn on the paths this
branch newly validates: create cluster from flags, add-validators and
fee recipients.
aly-obol
aly-obol previously approved these changes Oct 23, 2026
@sonarqubecloud

Copy link
Copy Markdown

Comment thread cmd/exit_sign.go
Comment on lines +195 to +199
if config.SkipBeaconNodeCheck {
if err := crossCheckValidatorIndex(ctx, eth2Cl, valEth2, valIndex); err != nil {
return nil, err
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

IIRC the initial idea of using validator indices was precisely for the fact not to require operators to have BN available?

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