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

Register validators with slashing protection as they are created/imported #1584

Closed
michaelsproul opened this issue Sep 4, 2020 · 2 comments
Assignees

Comments

@michaelsproul
Copy link
Member

Description

The validator client should not automatically register validators with the slashing protection database, as this poses a slashing risk if an existing slashing protection database is misplaced.

A validator should only need to be registered with slashing protection once -- when it first comes to exist, either through lighthouse account validator create or lighthouse account validator import.

Version

Lighthouse v0.2.8-967700c
BLS Library: blst

@michaelsproul
Copy link
Member Author

Blocked on #1544

@michaelsproul michaelsproul self-assigned this Sep 23, 2020
@michaelsproul
Copy link
Member Author

I'll take this. I'm going to roll it into #1544 but will extract it if #1544 looks unlikely to merge before we ship v0.3.0

bors bot pushed a commit that referenced this issue Oct 2, 2020
## Issue Addressed

Implements support for importing and exporting the slashing protection DB interchange format described here:

https://hackmd.io/@sproul/Bk0Y0qdGD

Also closes #1584 

## Proposed Changes

* [x] Support for serializing and deserializing the format
* [x] Support for importing and exporting Lighthouse's database
* [x] CLI commands to invoke import and export
* [x] Export to minimal format (required when a minimal format has been previously imported)
* [x] Tests for export to minimal (utilising mixed importing and attestation signing?)
* [x] Tests for import/export of complete format, and import of minimal format
* [x] ~~Prevent attestations with sources less than our max source (Danny's suggestion). Required for the fake attestation that we put in for the minimal format to block attestations from source 0.~~
* [x] Add the concept of a "low watermark" for compatibility with the minimal format

Bonus!

* [x] A fix to a potentially nasty bug involving validators getting re-registered each time the validator client ran! Thankfully, the ordering of keys meant that the validator IDs used for attestations and blocks remained stable -- otherwise we could have had some slashings on our hands! 😱
* [x] Tests to confirm that this bug is indeed vanquished
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant