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

[Polkadot Wiki Migration] Offenses and Slashes #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions infrastructure/validators/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ nav:
- onboarding
- operational-tasks
- offboarding
- offenses-slashes.md
232 changes: 232 additions & 0 deletions infrastructure/validators/offenses-slashes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
---
title: Offenses and Slashes
description: Offenses and Slashes in the Polkadot Ecosystem.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Description too short

---

!!!info
The material provided here is based on the changes introduced by Step 2 of the Disabling feature.
See [this page](https://github.com/orgs/paritytech/projects/119/views/15?pane=issue&itemId=61684472){target=\_blank}
for more information.

!!!info "Disclaimer"
Various parachains or applications living on top of Polkadot might add various economic schemes and
include slashes, but they are unrelated to the slashes described here as they only refer to the
staked tokens via [Nominated Proof-of-Stake](https://wiki.polkadot.network/docs/learn-consensus#nominated-proof-of-stake){target=\_blank}.


Polkadot is a public permissionless network. As such, it has a mechanism to disincentivize offenses and incentivize good behavior. Below, you can

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Papermoon.CustomDictionary] Did you really mean 'permissionless'?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'permissionless'?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Papermoon.CustomDictionary] Did you really mean 'disincentivize'?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'disincentivize'?

find a summary of punishments for specific offenses:

| Offense | [Slash (%)](#slashing) | [On-chain Disabling](#disabling) | Off-chain Disabling | [Reputational Changes](#reputation-changes) |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Papermoon.CustomDictionary] Did you really mean 'Reputational'?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'Reputational'?

| :----------------------------------: | :--------------------: | :------------------------------: | :-----------------: | :-----------------------------------------: |
| Backing Invalid | 100% | Yes | Yes (High Priority) | No |
| ForInvalid Vote | - | No | Yes (Mid Priority) | No |
| AgainstValid Vote | - | No | Yes (Low Priority) | No |
| GRANDPA / BABE / BEEFY Equivocations | 0.01-100% | Yes | No | No |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.Acronyms] Spell out 'BABE', if it's unfamiliar to the audience.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.Acronyms] Spell out 'BEEFY', if it's unfamiliar to the audience.

| Seconded + Valid Equivocation | - | No | No | No |
| Double Seconded Equivocation | - | No | No | Yes |

## Offenses

!!!info Learn more about the parachain protocol
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that this admonition is not rendering as expected

To better understand the terminology used for offenses, it is recommended to get familiar with the
[parachain protocol](https://wiki.polkadot.network/docs/learn-parachains-protocol#parachain-protocol){target=\_blank}.

On Polkadot, there are six main validator
offenses as shown below.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
offenses as shown below.
offenses as shown below:


- **Backing Invalid:** A para-validator is backing an invalid block.
- **ForInvalid Vote:** A validator (secondary checker) votes in favor of an invalid block.
- **AgainstValid Vote:** A validator (secondary checker) is voting against a valid block (and
wasting network resources).
- **Equivocation:** A validator produces two or more of the same block or vote.
- GRANDPA and BEEFY Equivocation: A validator signs two or more votes in the same round on

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.Acronyms] Spell out 'BEEFY', if it's unfamiliar to the audience.

different chains.
- BABE Equivocation: A validator produces two or more blocks on the Relay Chain in the same time

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.Acronyms] Spell out 'BABE', if it's unfamiliar to the audience.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Vale.Terms] Use 'relay chain' instead of 'Relay Chain'.

slot.
- **Double Seconded Equivocation:** Within a backing group of 5 para-validators, at most 5 backed
parablocks are possible. Each parablock requires exactly one seconded and at least two more valid

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'parablocks'?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Papermoon.CustomDictionary] Did you really mean 'parablocks'?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'parablock'?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Papermoon.CustomDictionary] Did you really mean 'parablock'?

votes from the five potential backers. This makes an upper bound on the number of parablocks the

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'parablocks'?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Papermoon.CustomDictionary] Did you really mean 'parablocks'?

system has to deal with while still allowing some choice for relay chain block authors. Backers
must decide which parablock to second, and they cannot second another. If another seconding vote

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'parablock'?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Papermoon.CustomDictionary] Did you really mean 'parablock'?

is found, they will be punished (somewhat lightly as of now, but there is little to gain from
this). All of this is made slightly more complicated with
[asynchronous backing](https://wiki.polkadot.network/docs/learn-async-backing){target=\_blank} as it is no longer one candidate per relay chain
block as backers can back blocks "into the future" optimistically. See
[this page](https://paritytech.github.io/polkadot-sdk/book/node/backing/statement-distribution.html#seconding-limit){target=\_blank}
for more information.
- **Seconded + Valid Equivocation:** This happens when a malicious node first seconds something
(takes absolute responsibility for it), and then only pretends to be someone who just said it is
correct after someone else takes responsibility. That is a straight-up lie (equivocation). A node
could use that tactic to escape responsibility, but once the system notices the two conflicting
votes, the offense is reported.
Comment on lines +38 to +62
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **Backing Invalid:** A para-validator is backing an invalid block.
- **ForInvalid Vote:** A validator (secondary checker) votes in favor of an invalid block.
- **AgainstValid Vote:** A validator (secondary checker) is voting against a valid block (and
wasting network resources).
- **Equivocation:** A validator produces two or more of the same block or vote.
- GRANDPA and BEEFY Equivocation: A validator signs two or more votes in the same round on
different chains.
- BABE Equivocation: A validator produces two or more blocks on the Relay Chain in the same time
slot.
- **Double Seconded Equivocation:** Within a backing group of 5 para-validators, at most 5 backed
parablocks are possible. Each parablock requires exactly one seconded and at least two more valid
votes from the five potential backers. This makes an upper bound on the number of parablocks the
system has to deal with while still allowing some choice for relay chain block authors. Backers
must decide which parablock to second, and they cannot second another. If another seconding vote
is found, they will be punished (somewhat lightly as of now, but there is little to gain from
this). All of this is made slightly more complicated with
[asynchronous backing](https://wiki.polkadot.network/docs/learn-async-backing){target=\_blank} as it is no longer one candidate per relay chain
block as backers can back blocks "into the future" optimistically. See
[this page](https://paritytech.github.io/polkadot-sdk/book/node/backing/statement-distribution.html#seconding-limit){target=\_blank}
for more information.
- **Seconded + Valid Equivocation:** This happens when a malicious node first seconds something
(takes absolute responsibility for it), and then only pretends to be someone who just said it is
correct after someone else takes responsibility. That is a straight-up lie (equivocation). A node
could use that tactic to escape responsibility, but once the system notices the two conflicting
votes, the offense is reported.
- Backing Invalid - a para-validator is backing an invalid block
- ForInvalid Vote - a validator (secondary checker) votes in favor of an invalid block
- AgainstValid Vote - a validator (secondary checker) is voting against a valid block (and
wasting network resources)
- Equivocation - a validator produces two or more of the same block or vote
- GRANDPA and BEEFY Equivocation - a validator signs two or more votes in the same round on different chains
- BABE Equivocation - a validator produces two or more blocks on the Relay Chain in the same time slot
- Double Seconded Equivocation - within a backing group of 5 para-validators, at most 5 backed
parablocks are possible. Each parablock requires exactly one seconded and at least two more valid
votes from the five potential backers. This makes an upper bound on the number of parablocks the
system has to deal with while still allowing some choice for relay chain block authors. Backers
must decide which parablock to second, and they cannot second another. If another seconding vote
is found, they will be punished (somewhat lightly as of now, but there is little to gain from
this). All of this is made slightly more complicated with
[asynchronous backing](https://wiki.polkadot.network/docs/learn-async-backing){target=\_blank} as it is no longer one candidate per relay chain
block as backers can back blocks "into the future" optimistically. See
[this page](https://paritytech.github.io/polkadot-sdk/book/node/backing/statement-distribution.html#seconding-limit){target=\_blank}
for more information
- Seconded + Valid Equivocation - this happens when a malicious node first seconds something
(takes absolute responsibility for it), and then only pretends to be someone who just said it is
correct after someone else takes responsibility. That is a straight-up lie (equivocation). A node
could use that tactic to escape responsibility, but once the system notices the two conflicting
votes, the offense is reported


### Equivocation (Conflicting Statements)

Equivocation occurs when a validator produces statements that conflict with each other.

For instance, as a block author appointed by BABE, only a single block should be authored for the

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.Acronyms] Spell out 'BABE', if it's unfamiliar to the audience.

given slot, and if two or more are authored, they are in conflict with each other. This would be a
BABE Equivocation Offence.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.Acronyms] Spell out 'BABE', if it's unfamiliar to the audience.


In BEEFY & GRANDPA validators are expected to cast a single vote for the block they believe is the

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.Acronyms] Spell out 'BEEFY', if it's unfamiliar to the audience.

best, but if they are found with two or more votes for different blocks, it means they tried to
confuse the network with conflicting statements and when found out this will be a BEEFY/GRANDPA

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.Acronyms] Spell out 'BEEFY', if it's unfamiliar to the audience.

Equivocation Offense.

Equivocations usually occur when duplicate signing keys reside on the validator host. If keys are
never duplicated, the probability of an honest equivocation slash decreases to near 0.

## Punishments

On Polkadot, offenses to the network can be punished depending on their severity. There are three main punishments: slashing, disabling, and reputation changes.

### Slashing

**Slashing** will happen if a validator misbehaves in the network. They and their nominators will
get slashed by losing a percentage of their staked DOT/KSM, from as little as 0.01% up to 100%.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.Acronyms] Spell out 'DOT', if it's unfamiliar to the audience.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.Acronyms] Spell out 'KSM', if it's unfamiliar to the audience.


Any slashed DOT/KSM will be added to the [Treasury](https://wiki.polkadot.network/docs/learn-polkadot-opengov-treasury){target=\_blank}. The rationale for this (rather than burning or distributing them as rewards) is that slashes may be reverted by simply paying out from the Treasury. This would

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.Acronyms] Spell out 'DOT', if it's unfamiliar to the audience.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.Acronyms] Spell out 'KSM', if it's unfamiliar to the audience.

be useful in situations such as faulty slashes. In the case of legitimate slashing, tokens are moved
away from malicious validators to those building the ecosystem through the normal Treasury process.

Slashing only occurs for active validations for a given nominator, and slashes are not mitigated by

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.NotContractions] Use 'aren't' instead of 'are not'.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.NotContractions] Use 'aren't' instead of 'are not' to improve clarity for the reader

having other inactive or waiting nominations. They are also not mitigated by the validator operator
running separate nodes; each node is considered its own entity for slashing purposes.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Google.Semicolons] Use semicolons judiciously.


!!!info "Multiple Active Nominations"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not rendering properly

In rare instances, with very large bonds, a nominator may actively nominate several validators in a
single era. In this case, the slash is proportionate to the amount staked to that specific
validator. Note that you cannot control the percentage of stake allocated to each validator or
choose who your active validator will be (except in the trivial case of nominating a single
validator). Staking allocations are controlled by the [Phragmén algorithm](https://wiki.polkadot.network/docs/learn-phragmen#understanding-phragm%C3%A9n){target=\_blank}.


Once a validator gets slashed, it goes into the state as an "unapplied slash". You can check this

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Google.Quotes] Commas and periods go inside quotation marks.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Papermoon.CustomDictionary] Did you really mean 'unapplied'?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'unapplied'?

via
[Polkadot-JS UI](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc.polkadot.io#/staking/slashes){target=\_blank}.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[Polkadot-JS UI](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc.polkadot.io#/staking/slashes){target=\_blank}.
[Polkadot.js Apps UI](https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frpc.polkadot.io#/staking/slashes){target=\_blank}.

The UI shows it per validator, followed by all the affected nominators and the amounts. While
unapplied, a governance proposal can be made to reverse it during a 27-day grace period, after which

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'unapplied'?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Papermoon.CustomDictionary] Did you really mean 'unapplied'?

the slashes are applied.

A slash may occur under the circumstances below:

1. Equivocations – A slash of 0.01% is applied with as little as a single evocation. The slashed amount increases to 100% incrementally as more validators also equivocate
2. Disputes – This may result from a validator trying to represent the contents of a block falsely. Slashing penalties of 100% may apply
Comment on lines +114 to +115
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Equivocations – A slash of 0.01% is applied with as little as a single evocation. The slashed amount increases to 100% incrementally as more validators also equivocate
2. Disputes – This may result from a validator trying to represent the contents of a block falsely. Slashing penalties of 100% may apply
1. Equivocations – a slash of 0.01% is applied with as little as a single evocation. The slashed amount increases to 100% incrementally as more validators also equivocate
2. Disputes – this may result from a validator trying to represent the contents of a block falsely. Slashing penalties of 100% may apply


#### Slash for Equivocation

The following levels of offense are
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defined is not self explanatory. Put the link in a better word or rephrase the sentence

[defined](https://research.web3.foundation/Polkadot/security/slashing/amounts){target=\_blank}. However, these
particular levels are not implemented or referred to in the code or the system; they are meant as

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.NotContractions] Use 'aren't' instead of 'are not' to improve clarity for the reader

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Google.Semicolons] Use semicolons judiciously.

guidelines for different levels of severity for offenses.

- Level 1: Isolated equivocation slashes a minimal amount of the stake.
- Level 2: Misconducts unlikely to be accidental but do not harm the network's security to any large

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.NotContractions] Use 'don't' instead of 'do not' to improve clarity for the reader

extent. Examples include concurrent equivocation or isolated cases of unjustified voting in
[GRANDPA](https://wiki.polkadot.network/docs/learn-consensus#finality-gadget-grandpa){target=\_blank}. Slashes a moderately small amount of the stake.
- Level 3: misconduct that poses severe security or monetary risk to the system or mass collusion.
Slashes all or most of the stake behind the validator.
Comment on lines +124 to +129
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Level 1: Isolated equivocation slashes a minimal amount of the stake.
- Level 2: Misconducts unlikely to be accidental but do not harm the network's security to any large
extent. Examples include concurrent equivocation or isolated cases of unjustified voting in
[GRANDPA](https://wiki.polkadot.network/docs/learn-consensus#finality-gadget-grandpa){target=\_blank}. Slashes a moderately small amount of the stake.
- Level 3: misconduct that poses severe security or monetary risk to the system or mass collusion.
Slashes all or most of the stake behind the validator.
- Level 1 - isolated equivocation slashes a minimal amount of the stake
- Level 2 - misconducts unlikely to be accidental but do not harm the network's security to any large
extent. Examples include concurrent equivocation or isolated cases of unjustified voting in
[GRANDPA](https://wiki.polkadot.network/docs/learn-consensus#finality-gadget-grandpa){target=\_blank}. Slashes a moderately small amount of the stake
- Level 3 - misconduct that poses severe security or monetary risk to the system or mass collusion.
Slashes all or most of the stake behind the validator


The following are scenarios that build towards slashes under equivocation:

1. Cloning a server, i.e., copying all contents when migrating to new hardware. This action should

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Google.Latin] Use 'that is' instead of 'i.e.'.

be avoided. If an image is desired, it should be taken before keys are generated.
2. High Availability (HA) Systems – Equivocation can occur if there are any concurrent operations,
either when a failed server restarts or if a false positive event results in both servers being
online simultaneously. HA systems are to be treated with extreme caution and are not advised.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.NotContractions] Use 'aren't' instead of 'are not' to improve clarity for the reader

3. The keystore folder is copied when attempting to copy a database from one instance to another.
It is important to note that equivocation slashes occur with a single incident. This can happen
if duplicated keystores are used for only a few seconds. A slash can result in losing nominators
and funds, removal from the Thousand Validator Programme, and reputational damage.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Papermoon.CustomDictionary] Did you really mean 'reputational'?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'reputational'?

Comment on lines +133 to +141
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. Cloning a server, i.e., copying all contents when migrating to new hardware. This action should
be avoided. If an image is desired, it should be taken before keys are generated.
2. High Availability (HA) Systems – Equivocation can occur if there are any concurrent operations,
either when a failed server restarts or if a false positive event results in both servers being
online simultaneously. HA systems are to be treated with extreme caution and are not advised.
3. The keystore folder is copied when attempting to copy a database from one instance to another.
It is important to note that equivocation slashes occur with a single incident. This can happen
if duplicated keystores are used for only a few seconds. A slash can result in losing nominators
and funds, removal from the Thousand Validator Programme, and reputational damage.
1. Cloning a server, i.e., copying all contents when migrating to new hardware. This action should
be avoided. If an image is desired, it should be taken before keys are generated
2. High Availability (HA) Systems – equivocation can occur if there are any concurrent operations,
either when a failed server restarts or if a false positive event results in both servers being
online simultaneously. HA systems are to be treated with extreme caution and are not advised
3. The keystore folder is copied when attempting to copy a database from one instance to another.
It is important to note that equivocation slashes occur with a single incident. This can happen
if duplicated keystores are used for only a few seconds. A slash can result in losing nominators
and funds, removal from the Thousand Validator Programme, and reputational damage


See the next section to understand how slash amounts for equivocations are calculated. If you want
to know more details about slashing, please look at our

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[Google.We] Try to avoid using first-person plural like 'our'.

[research page](https://research.web3.foundation/Polkadot/security/slashing/amounts){target=\_blank}.

#### Slash Calculation for Equivocation

GRANDPA, BABE, and BEEFY equivocation use the same formula for calculating the slashing penalty:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.Acronyms] Spell out 'BEEFY', if it's unfamiliar to the audience.


Let x = offenders, n = total number of validators in the active set

min((3 * x / n )^2, 1)

For example, assume that there are 100 validators in the active set, and one equivocates in a slot
(for our purposes, it does not matter whether it was a BABE or GRANDPA equivocation). This is

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[Google.We] Try to avoid using first-person plural like 'our'.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.NotContractions] Use 'doesn't' instead of 'does not' to improve clarity for the reader

unlikely to be an attack on the network but much more likely to be a misconfiguration of a
validator. The penalty would be min(3 \* 1 / 100)^2, 1) = 0.0009, or a 0.09% slash for that
validator (i.e., the stake held by the validator and its nominators).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Google.Latin] Use 'that is' instead of 'i.e.'.


Now, assume that a group is running several validators, and they all have an issue in the same slot.
The penalty would be min((3 \* 5 / 100)^2, 1) = 0.0225, or a 2.25% slash. If 20 validators
equivocate, this is a much more serious offense, possibly indicating a coordinated attack on the
network. So, the slash will be much greater - min((3 \* 20 / 100)^2, 1) = 0.36, or a 36% slash on
all these validators and their nominators. All slashed validators will also be chilled.

The example above shows the risk of nominating or running many validators in the active set. While

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[Papermoon.WordSwapList] Use 'preceding' instead of 'above'.

rewards grow linearly (two validators will get you approximately twice as many staking rewards as
one) slashing grows exponentially. A single validator equivocating causes a 0.09% slash, and two
validators equivocating does not cause a 0.09 \* 2 = 0.18% slash, but rather a 0.36% slash - 4x as

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.NotContractions] Use 'doesn't' instead of 'does not' to improve clarity for the reader

much as the single validator.

Validators may run their nodes on multiple machines to ensure they can still perform validation work
if one of their nodes goes down. Still, validator operators should be cautious when setting these
up. Equivocation is possible if they do not have good coordination in managing signing machines.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.NotContractions] Use 'don't' instead of 'do not' to improve clarity for the reader


#### Good Practices to Avoid Slashing

The following are advised to node operators to ensure that they obtain pristine binaries or source
code and to ensure the security of their node:

1. Always download either source files or binaries from the official Parity repository
2. Verify the hash of downloaded files
3. Use the W3F secure validator setup or adhere to its principles
4. Ensure essential security items are checked, use a firewall, manage user access, use SSH
certificates
5. Avoid using your server as a general-purpose system. Hosting a validator on your workstation or
one that hosts other services increases the risk of maleficence

Below are some examples of small equivocations that happened in the past.

| Network | Era | Event Type | Details | Action Taken |
| -------- | ---- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Polkadot | 774 | Small Equivocation | [The validator](https://matrix.to/#/!NZrbtteFeqYKCUGQtr:matrix.parity.io/$165562246360408hKCfC:matrix.org?via=matrix.parity.io&via=corepaper.org&via=matrix.org){target=\_blank} migrated servers and cloned the keystore folder. The on-chain event can be viewed [here](https://polkadot.subscan.io/extrinsic/11190109-0?event=11190109-5){target=\_blank}. | The validator did not submit a request for the slash to be canceled. |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.NotContractions] Use 'didn't' instead of 'did not' to improve clarity for the reader

| Kusama | 3329 | Small Equivocation | The validator operated a test machine with cloned keys; the test machine was online at the same time as the primary, which resulted in a slash. Details can be found [here](https://kusama.polkassembly.io/post/1343){target=\_blank}. | The validator requested a slash cancellation, but the council declined. |
| Kusama | 3995 | Small Equivocation | The validator noticed several errors, after which the client crashed, and a slash was applied. The validator recorded all events and opened GitHub issues to allow for technical opinions to be shared. Details can be found [here](https://kusama.polkassembly.io/post/1733){target=\_blank}. | The validator requested to cancel the slash. The council approved the request as they believed the error was not operator-related. |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.NotContractions] Use 'wasn't' instead of 'was not' to improve clarity for the reader


#### Slashing Across Eras

There are three main difficulties to account for with slashing in NPoS:

- A nominator can nominate multiple validators and be slashed via any of them.
- Until slashed, the stake is reused from era to era. Nominating with N coins for E eras in a row
does not mean you have N\*E coins to be slashed - you've only ever had N.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [vale] reported by reviewdog 🐶
[Papermoon.NotContractions] Use 'doesn't' instead of 'does not' to improve clarity for the reader

- Slashable offenses can be found after the fact and out of order.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Papermoon.CustomDictionary] Did you really mean 'Slashable'?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'Slashable'?

Comment on lines +202 to +205
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- A nominator can nominate multiple validators and be slashed via any of them.
- Until slashed, the stake is reused from era to era. Nominating with N coins for E eras in a row
does not mean you have N\*E coins to be slashed - you've only ever had N.
- Slashable offenses can be found after the fact and out of order.
- A nominator can nominate multiple validators and be slashed via any of them
- Until slashed, the stake is reused from era to era. Nominating with N coins for E eras in a row
does not mean you have N\*E coins to be slashed - you've only ever had N
- Slashable offenses can be found after the fact and out of order


To balance this, the system applies only the maximum slash a participant can receive in a given time
period rather than the sum. This ensures protection from overslashing.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Papermoon.CustomDictionary] Did you really mean 'overslashing'?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [vale] reported by reviewdog 🐶
[Vale.Spelling] Did you really mean 'overslashing'?


### Disabling

**Disabling** stops validators from performing specific actions after they have committed an
offense. Disabling is further divided into:

- On-chain disabling lasts for a whole era and stops validators from block authoring, backing, and
initiating a dispute.
- Off-chain disabling lasts for a session, is caused by losing a dispute, and stops validators from
initiating a dispute.
Comment on lines +215 to +218
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- On-chain disabling lasts for a whole era and stops validators from block authoring, backing, and
initiating a dispute.
- Off-chain disabling lasts for a session, is caused by losing a dispute, and stops validators from
initiating a dispute.
- On-chain disabling lasts for a whole era and stops validators from block authoring, backing, and
initiating a dispute
- Off-chain disabling lasts for a session, is caused by losing a dispute, and stops validators from
initiating a dispute


Off-chain disabling is always a lower priority than on-chain disabling. Off-chain disabling
prioritizes disabling first backers and then approval checkers.

### Reputation Changes

Some minor offenses often connected to spamming are only punished by Networking Reputation Changes.
When validators connect to each other, they use a reputation metric for each of their peers. If our

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [vale] reported by reviewdog 🐶
[Google.We] Try to avoid using first-person plural like 'our'.

peers provide valuable data and behave appropriately, the system adds reputation; if they provide us
with faulty or spam data, the system reduces their reputation. A validator can lose enough
reputation so that the peers will temporarily close their channels. This helps in fighting against
DoS (Denial of Service) attacks. The consequences of closing channels may vary. In general,
performing validator tasks under reduced reputation will be harder, resulting in lower validator
rewards.
Loading