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

Update slashing protection information. #241

Merged
merged 18 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion docs/Concepts/Slashing-Protection.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ Teku provides command line options to [import] or [export] the slash protection

## Validator slash protection file

The slash protection file records three values that protects the validator from incorrectly
The slash protection file records multiple values that protects the validator from incorrectly
signing blocks or attestations.

!!! example

```bash
---
genesisValidatorsRoot: "0x9436e8a630e3162b7ed4f449b12b8a5a368a4b95bc46b941ae65c11613bfa4c1"
lastSignedBlockSlot: 71090
lastSignedAttestationSourceEpoch: 2290
lastSignedAttestationTargetEpoch: 3247
Expand All @@ -49,6 +50,15 @@ The following rules apply to the file:
* A validator will not sign an attestation unless the attestation source is less than or equal to
`lastSignedAttestationSourceEpoch`, and the attestation target epoch is greater than
`lastSignedAttestationTargetEpoch`.
* `genesisValidatorsRoot` is a hash of the validators active at genesis, and is used to
differentiate between different chains. Teku does not require this field to be present, but if
it is present and differs from the required value, then Teku returns an error.

!!! info

You can obtain the `genesisValidatorsRoot` value by using the
[`/eth/v1/beacon/genesis`](https://consensys.github.io/teku/#operation/getEthV1BeaconGenesis)
API.

These rules guarantee the validator does not sign anything that is slashable.

Expand Down
10 changes: 4 additions & 6 deletions docs/HowTo/Prevent-Slashing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ title: Import or export a slashing protection file
blocks or attestations.

You can import and export the slashing-protection file when migrating validator keys between
validator clients.
validator clients. Teku supports the [validator client interchange format] when importing or
exporting the slashing-protection file.

!!! note

Expand All @@ -23,8 +24,6 @@ When importing the slashing-protection file, Teku imports the file to the
`<data-path>/validators/slashprotection/` directory in the format `<validator-pubkey>.yml`
(with no 0x prefix).

Teku supports files using the [Minimal] or [Complete] interchange format when importing.

!!! example

```
Expand All @@ -43,7 +42,7 @@ In this example, Teku imports the file to the `/home/me/me_node/data/validators/
## Exporting a slashing-protection file

Export the slashing-protection file when migrating a validator to a different Teku, or non-Teku
node. Teku exports the slashing protection file in the [Minimal] format.
node.

!!! example

Expand All @@ -63,6 +62,5 @@ You can now import the slashing-protection file in a Teku, or non-Teku node.
<!--links -->
[Teku implements slashing protection]: ../Concepts/Slashing-Protection.md
[data path directory when starting Teku]: ../Reference/CLI/CLI-Syntax.md#data-path
[Minimal]: https://hackmd.io/@sproul/Bk0Y0qdGD#Format-2-Minimal
[Complete]: https://hackmd.io/@sproul/Bk0Y0qdGD#Format-1-Complete
[validator client interchange format]: https://eips.ethereum.org/EIPS/eip-3076
[Web3Signer]: https://docs.web3signer.consensys.net/en/latest/
9 changes: 4 additions & 5 deletions docs/Reference/CLI/Subcommands/Slashing-Protection.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You can also supply the subcommand options using [environment variables or a con

## `import`

Imports the slashing protection database. Supports the [Minimal] or [Complete] interchange format.
Imports the slashing protection database using the [validator client interchange format].

### config-file

Expand Down Expand Up @@ -83,7 +83,7 @@ Teku imports the file to the `<data-path>/validators/slashprotection/` directory

## `export`

Exports the slashing protection database in [Minimal] format.
Exports the slashing protection database in the [validator client interchange format] format.

### config-file

Expand Down Expand Up @@ -144,10 +144,9 @@ The path to the Teku data directory. The default directory is OS dependent:

The file to export the slashing protection database to.

Exports the database in the [Minimal] format.
Exports the database in the [validator client interchange format] format.

<!-- links -->
[slashing protection data]: ../../../Concepts/Slashing-Protection.md
[Minimal]: https://hackmd.io/@sproul/Bk0Y0qdGD#Format-2-Minimal
[Complete]: https://hackmd.io/@sproul/Bk0Y0qdGD#Format-1-Complete
[validator client interchange format]: https://eips.ethereum.org/EIPS/eip-3076
[environment variables or a configuration file]: ../CLI-Syntax.md#specifying-options