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 (small) or invalid (big). In addition to that, we might want to kick out the validators from the active set.
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 be 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 module that hosts all the FRAME types needed to add this pallet to a runtime.
Structs
- We store most of the information about a lost dispute on chain. This struct is required to identify and verify it.
- Timeslots should uniquely identify offences and are used for the offence deduplication.
- Slashes that are waiting to be applied once we have validator key identification.
- This type implements
SlashingHandler
. - An offence that is filed when a series of validators lost a dispute.
- Actual
HandleReports
implemention.
Enums
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).