Expand description
Dispute slashing pallet.
Once a dispute is concluded, we want to slash validators who were on the wrong side of the dispute.
A dispute should always result in an offence. There are 3 possible offence types:
ForInvalidBacked
: A major offence when a validator backed an invalid block. Main source of economic security.ForInvalidApproved
: A medium offence when a validator approved (NOT backed) an invalid block. Protects from lazy validators.AgainstValid
: A minor offence when a validator disputed a valid block. Protects from spam attacks.
Past session slashing edgecase:
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. 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 simillar to the grandpa equivocation
handler. 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§
- benchmarking
- pallet
- The
pallet
module in each FRAME pallet hosts the most important items needed to construct this pallet.
Structs§
- Bench
Config - Slash
Validators ForDisputes - This type implements
SlashingHandler
. - Slashing
Offence - An offence that is filed against the validators that lost a dispute.
- Slashing
Report Handler - Actual
HandleReports
implementation. - Test
Weight Info
Traits§
- Benchmarking
Configuration - The benchmarking configuration.
- Handle
Reports - 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).
- Weight
Info