Skip to content

feat: run the validator with doppelganger protection by default - #31

Merged
inf-1oop merged 1 commit into
mainfrom
feat/validator-doppelganger
Sep 16, 2026
Merged

inf-1oop merged 1 commit into
mainfrom
feat/validator-doppelganger

Conversation

@inf-1oop

Copy link
Copy Markdown
Contributor

What this adds

The validator signs immediately on every start today. Nothing checks whether these keys are already attesting somewhere else first — so a key that exists in two places gets both instances signing, and the validator slashed.

--enable-doppelganger makes the client listen for ~2 epochs before signing anything, and exit rather than sign if it sees its own keys on the network.

This is the control that covers a key existing in more than one place: a copy kept by a previous operator, a half-migrated node, a restored backup someone forgot was running. contango-validator-1 already runs it via a local override, added precisely because key custody there is shared. It belongs in the repo, not in one operator's override.

On by default, but not forced

- --enable-doppelganger=${VALIDATOR_DOPPELGANGER:-true}

The trade is asymmetric: a slashing is unrecoverable; ~96 seconds of missed attestations is not. So the default is on.

It is deliberately a value rather than a bare flag, so operators who are certain these keys run nowhere else can opt out without editing compose — which is also how we avoid pushing people toward override files that then silently bypass future fixes:

VALIDATOR_DOPPELGANGER=false

Two limits, documented rather than glossed

  • It is not foolproof. Prysm's own flag text: "This is not a foolproof method to find duplicate instances in the network. Your validator will still be vulnerable if it is being run in unsafe configurations." This is a control, not a guarantee.
  • It errs toward halting. The check can stop a validator that is in fact fine. The README therefore says that a doppelganger exit means find the other instance — not restart with the check disabled.

Verification

A forced-on bare flag was the alternative, so I checked the flag actually accepts a value, against gcr.io/prysmaticlabs/prysm/validator:v7.1.8:

invocation flag rejected Enabled feature flag enable-doppelganger starts
--enable-doppelganger=true no yes yes
--enable-doppelganger=false no no yes

So the toggle genuinely turns the feature off rather than merely being tolerated. Compose renders =true by default and =false when the variable is set.

Observed on contango-validator-1 running this flag: INFO client: Running doppelganger check keyCount=1, then normal duties once the check cleared.

Operator impact

This changes behaviour on the next validator restart. The first start after this lands will miss ~2 epochs of attestations while the check runs. Worth saying in the validator rollout notice so nobody reads the silence as a failed upgrade.

🤖 Generated with Claude Code

The validator has been signing immediately on every start. Nothing checks whether these
keys are already attesting somewhere else first, so a key that exists in two places --
a copy kept by a previous operator, a half-migrated node, a restored backup someone
forgot was running -- gets both instances signing and the validator slashed.

--enable-doppelganger makes the client listen for roughly two epochs before signing and
exit rather than sign if it sees its own keys on the network. contango-validator-1 is
already running this via a local override, added because key custody there is shared;
the control belongs in the repo rather than in one operator's override.

It is on by default because the trade is asymmetric: a slashing is unrecoverable, while
the cost of the check is about 96 seconds of missed attestations per start, at Vana's 8
slots of 6 seconds. It is deliberately not forced. VALIDATOR_DOPPELGANGER=false turns it
off for operators who are certain these keys run nowhere else, which the README and the
compose comment both spell out.

Two limits are documented rather than glossed. Prysm's own flag text says the check
cannot catch every unsafe configuration, so this is a control and not a guarantee. And
it errs toward halting, so it can stop a validator that is in fact fine -- which is why
the README says that a doppelganger exit means find the other instance, not restart with
the check disabled.

Verified against gcr.io/prysmaticlabs/prysm/validator:v7.1.8 that the flag takes a value
rather than only a bare form, since a forced-on flag would have been the alternative:
with =true the client logs "Enabled feature flag enable-doppelganger", with =false it
does not, and neither form is rejected. Compose renders --enable-doppelganger=true by
default and =false when the variable is set.

Note for operators upgrading: this changes behaviour on the next validator restart. The
first start after this lands will miss about two epochs of attestations.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@inf-1oop
inf-1oop merged commit 0f335d4 into main Sep 16, 2026
3 checks passed
@inf-1oop
inf-1oop deleted the feat/validator-doppelganger branch September 16, 2026 02:52
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 2.4.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant