Module polkadot_runtime_parachains::disputes::slashing
source · Expand description
Dispute slashing pallet.
Once a dispute is concluded, we want to slash validators who were on the wrong side of the dispute. The slashing amount depends on whether the candidate was valid (none at the moment) or invalid (big). In addition to that, we might want to kick out the validators from the active set. Currently, we limit slashing to the backing group for invalid disputes.
The offences
pallet from Substrate provides us with a way to do both.
Currently, the interface expects us to provide staking information including
nominator exposure in order to submit an offence.
Normally, we’d able to fetch this information from the runtime as soon as
the dispute is concluded. This is also what im-online
pallet does.
However, since a dispute can conclude several sessions after the candidate
was backed (see dispute_period
in HostConfiguration
), we can’t rely on
this information being available in the context of the current block. The
babe
and grandpa
equivocation handlers also have to deal with this
problem.
Our implementation looks like a hybrid of im-online
and grandpa
equivocation handlers. Meaning, we submit an offence
for the concluded
disputes about the current session candidate directly from the runtime. If,
however, the dispute is about a past session, we record unapplied slashes on
chain, without FullIdentification
of the offenders. Later on, a block
producer can submit an unsigned transaction with KeyOwnershipProof
of an
offender and submit it to the runtime to produce an offence.
Re-exports§
pub use pallet::*;
Modules§
- The
pallet
module in each FRAME pallet hosts the most important items needed to construct this pallet.
Structs§
- This type implements
SlashingHandler
. - An offence that is filed when a series of validators lost a dispute.
- Actual
HandleReports
implementation.
Traits§
- The benchmarking configuration.
- A trait that defines methods to report an offence (after the slashing report has been validated) and for submitting a transaction to report a slash (from an offchain context).