specborn documentation contents ↓

Slashing protection (EIP-3076) #

The database #

The database lives in DIR/validator/slashing-protection/ (singular validator, next to the keystores' validators/). It is used by specborn run --validator-keys for every slashable signature: every attestation and every block (Lead decision D-32, as EIP-3076 defines it). Such a message is checked against the key's history and recorded by a durable commit before its signature is made. Selection proofs, aggregates, sync-committee messages and contributions, PTC votes, RANDAO reveals and Gloas envelopes are not slashable and are not recorded; they pass the signer's other checks (Validators).

Per key it keeps the most recent signed blocks and attestations (at most 16 of each, plus low watermarks below which everything is refused), and it refuses what EIP-3076 says to refuse: a second, different block for a slot; a block at or below the lowest recorded slot; a double vote; a surrounding or surrounded vote; an attestation whose source is below, or whose target is at or below, the lowest recorded one. Repeats of an identical message are allowed. Pruning only ever makes it refuse more. Two local policies refuse more than EIP-3076 asks: an attestation whose source epoch is above its target epoch, and any key that is neither imported nor registered. The node does not start if one of its keys is missing from the database (exit 1).

Getting history in and out #

Stop the node first: the database is locked while it runs, and EIP-3076 asks for the same. All flags are in the CLI reference.

specborn validator slashing-protection import --datadir DIR --file interchange.json
specborn validator slashing-protection register --datadir DIR --pubkey 0xPUBKEY --genesis-validators-root 0xROOT
specborn validator slashing-protection export --datadir DIR --file out.json

To move a key between clients: stop the old client for good, export its history, import it here before the key signs anything, and only then start specborn. The same in the other direction.

Evidence and limits #