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
importmerges another client's EIP-3076 export (version 5, complete or minimal), all or nothing, after checking that itsgenesis_validators_rootis the database's. Creating a new database by import needs--genesis-validators-root. Use it for any key that has signed before.registergives keys that have never signed on this chain (new validators) an empty history (--pubkey, repeatable, or--pubkeys-filewith one key per line). Registering a key that signed under another client, instead of importing that client's export, gives up the protection against what it signed there.exportwrites the database (all keys, or the keys given with--pubkey) as a complete EIP-3076 file, or a minimal one with--minimal; the file must not exist yet.
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 #
- TESTED: suite
slashprot, 1,642,690 checks, 0 failures (STATUS.md2026-11-21, gate5), including the 38 files of the official interchange tests v5.3.0. Histories exported by Lighthouse, Teku and Prysm on a local devnet were imported, exported again and read back by those clients (docs/pieces/slashprot.md§20, replayed on a later build in §29). - PROVED, for callers of the database's signing function: no two released messages are slashable together; a message is recorded by an acknowledged durable commit before its signature is released; after a crash and reopen the database still refuses everything slashable with a released message; only keys of the initial database or of an imported or registered document are signed for (
Proofs/Validator/Slashing/Db.lean,Proofs/Validator/Slashing/Session.lean;docs/pieces/slashprot.md§27, §36, §49). - That the shipped code calls it: every attestation (
docs/pieces/vduty.md§16.2,Signer.attestation_only_via_protect, PROVED); every Fulu block (docs/pieces/vpropose.md§12,protectedBlockSigner_eq, PROVED); every Gloas block (the proposal makes its one block signature through the signer it is given:docs/pieces/vproposeg.mdR4.4, PROVED for the pure model; that every run of the node's proposer goes through the database's signer, and that an acknowledged commit of the block's record happened before the signature was returned, is PROVED for the Lean definitions with theIOruntime and the store's durability trusted:docs/pieces/vpropnode.md, O-vproposeg-16 closed). A second, different block for a slot was refused in the tests, also across a reopen. - The composition with the storage layer's I/O-failure model is PROVED (
failure_reopen_refuses,docs/pieces/slashprot2.md; shown non-vacuous on a concrete failed commit,docs/pieces/slashfail.md); failures inside the open, a read or a mixed crash-and-failure chain are not stated (OPEN-slashprot-15b/15c). OPEN: memory of an import (OPEN-slashprot-8: the import no longer builds a JSON tree; about 1.1 to 2.5 times the file size on the shapes measured, up to about 7.7 times for a file of very many tiny records;docs/pieces/slashprot3.md). Iterated crashes as one theorem, open in earlier versions of this book (OPEN-slashprot-18), was closed bychain_session_safe(docs/pieces/slashprot.md§56). Durability depends on/usr/bin/syncand the file system, as for the node's own store (Data directory).