Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement wait-free doppelganger detection #3083

Open
zah opened this issue Nov 10, 2021 · 3 comments
Open

Implement wait-free doppelganger detection #3083

zah opened this issue Nov 10, 2021 · 3 comments

Comments

@zah
Copy link
Contributor

zah commented Nov 10, 2021

Upon start-up, Nimbus can check whether the local slashing protection database suggests that the node was just restarted (by looking for records from the epoch immediately preceding the current one). Under such conditions, it's safer to start attesting immediately. We can call this mode --doppelganger-detection:auto and it will be suitable as a new default.

@tersec
Copy link
Contributor

tersec commented Nov 16, 2021

prysmaticlabs/prysm#7985 (comment) describes one approach to this.

@mratsim
Copy link
Contributor

mratsim commented Feb 16, 2022

For history: Discord Message from 2021-04-13

re: Doppelganger Detection. Looking at the issues in LH:

I think there are 2 scenarios where we can skip waiting:

  1. The validator attached had emitted 2 attestations for the previous 2 epochs and they are in the slashing DB.
    As an initial fast check we can check that the count of attestations in the slashing DB is equal to 2x number of attached validators. (so that we have global handling instead of per-validator wait.)
  2. Genesis.

Otherwise if there is a gap I don't think we can say for sure that there isn't another validator.

Now the lighthouse issue brings up a fun point. If everyone has the detection turn on, and restart at the same time, the chain might stall.

Now that we use sqlite as a DB (and not a kvstore), we can easily do range check for point 1. And point 2, was closed after we launched I-don't-remember-which testnet

@arnetheduck
Copy link
Member

Good thing we have 3s restarts now then :)

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

No branches or pull requests

4 participants