Repository navigation
feat: run the validator with doppelganger protection by default - #31
Merged
Merged
Conversation
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>
|
🎉 This PR is included in version 2.4.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-doppelgangermakes 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-1already 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:
Two limits, documented rather than glossed
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:Enabled feature flag enable-doppelganger--enable-doppelganger=true--enable-doppelganger=falseSo the toggle genuinely turns the feature off rather than merely being tolerated. Compose renders
=trueby default and=falsewhen the variable is set.Observed on
contango-validator-1running 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