-
Notifications
You must be signed in to change notification settings - Fork 261
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
Opt-in Slashing protection + interchange #1643
Merged
Merged
Conversation
This file contains 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
mratsim
changed the title
Slashing protection + interchange initial commit
[WIP] Opt-in Slashing protection + interchange
Sep 14, 2020
arnetheduck
reviewed
Sep 14, 2020
arnetheduck
reviewed
Sep 14, 2020
mratsim
force-pushed
the
slashing-prot
branch
from
September 15, 2020 12:54
e4ed246
to
527bb57
Compare
Not draft anymore. I've added an extra temporary test with/without slashing protection for jenkins
Regarding import/export AFAIK no one actually supports them yet in production code (but does in PR) so no real rush but importing a complete DB is straightforward. Adding that in this PR. |
mratsim
changed the title
[WIP] Opt-in Slashing protection + interchange
Opt-in Slashing protection + interchange
Sep 16, 2020
arnetheduck
reviewed
Sep 16, 2020
mratsim
added a commit
that referenced
this pull request
Sep 16, 2020
* Slashing protection + interchange initial commit * Restrict the when UseSlashingProtection dance in other modules * Integrate slashing tests in other all_tests * Add attestation slashing protection support * Add a message that mention if built with/without slashing protection * no op the initialization proc * test slashing protection in Jenkins (temp) * where to configure NIMFLAGS in Jenkins ... * Jenkins -> ensure Built with slashing protection * Add slashing protection complete import * use Opt.get(otherwise) * Don't use negation in proc name * Turn slashing protection on by default
mratsim
added a commit
that referenced
this pull request
Sep 16, 2020
* Slashing protection + interchange initial commit * Restrict the when UseSlashingProtection dance in other modules * Integrate slashing tests in other all_tests * Add attestation slashing protection support * Add a message that mention if built with/without slashing protection * no op the initialization proc * test slashing protection in Jenkins (temp) * where to configure NIMFLAGS in Jenkins ... * Jenkins -> ensure Built with slashing protection * Add slashing protection complete import * use Opt.get(otherwise) * Don't use negation in proc name * Turn slashing protection on by default
mratsim
added a commit
that referenced
this pull request
Sep 16, 2020
* Slashing protection + interchange initial commit * Restrict the when UseSlashingProtection dance in other modules * Integrate slashing tests in other all_tests * Add attestation slashing protection support * Add a message that mention if built with/without slashing protection * no op the initialization proc * test slashing protection in Jenkins (temp) * where to configure NIMFLAGS in Jenkins ... * Jenkins -> ensure Built with slashing protection * Add slashing protection complete import * use Opt.get(otherwise) * Don't use negation in proc name * Turn slashing protection on by default
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.
This adds slashing protection to the Beacon Node and validator client
State
Overview
The slashing protection is introduced as an experimental feature that can be opt-in with
make NIMFLAGS="-d:UseSlashingProtection=true" beacon_node
ormake NIMFLAGS="-d:UseSlashingProtection=true" validator_client
For now only block proposal are protected, protecting attestation requires to add
registerAttestation
andnotSlashableAttestation
in their proper place in validator_duties.nim and validator_client.nimInterchange
Complete export can be done by calling "toSPDIF" on the slashing protection database, likely to be added to ncli_db.
Design
The slashing protection uses an independent database that is attached to either the Beacon Node or the Validator Client. It's a KV-Store but a classic SQL DB would significantly reduce the potential bug surface as right now I'm using a linked list in the DB field which accounts for a lot of lines of code. Alternatively, better support for range queries for the KV-Store would be nice