Collect the validator's abnormal behavior and implement the corresponding slashing mechanism according to the type of abnormal behavior.
There are three main types:
- The validator node does not participate in the network consensus for a long time.
- Voted multiple times on the same consensus process, and these votes contradict each other
- The validator node disturbs the network consensus by packing illegal transactions into the block.
# Punishment mechanism
Calculate the number of tokens bonded to the validator node based on the voting power owned by the current validator.
Punish validator with a certain percentage of the token and kick it out of the validator set; at the same time prohibit the validator from re-entering the validator set for a period, a process known as the jail validator.
For different types of abnormal behavior, different penalty proportion and jail time are used.
4.1 If the total number of tokens which bonded to current validator is A and the penalty ratio is B, then the maximum number of tokens that can be punished is
4.2 If there is unbonding delegation and redelegation in the unbonding period at the current height, then the tokens which in unbonding period are penalized by the ratio B.
4.3 The total number of tokens penalized for unbonding delegation and redelegation is S. If S is less than
A*B, the validator token punished will be
A*B-S. Otherwise, the validator bonded token will not be penalized.
# Long Downtime
In the fixed time window
SignedBlocksWindow, the ratio of the time of the validator's absence from the block is less than the value of
MinSignedPerWindow, the validator's bonded token will be penalized in the
SlashFractionDowntime ratio, and the validator will be jailed. Until the jail time exceeds
DowntimeJailDuration, the validator can be released by executing
# Double Sign
When executing a block, it receives evidence that a validator has voted for conflicting votes of the same round at the same height. the validator's bonded token will be penalized in the
SlashFractionDoubleSign ratio, and the validator will be jailed. Until the jail time exceeds
DoubleSignJailDuration, the validator can be released by executing
For related operations of the
Slashing module, please refer to cli-slashing