Manually applies a deferred slash for a given era.
Normally, slashes are automatically applied shortly after the start of the slash_era.
This function exists as a fallback mechanism in case slashes were not applied due to
unexpected reasons. It allows anyone to manually apply an unapplied slash.
Parameters
slash_era: The staking era in which the slash was originally scheduled.
slash_key: A unique identifier for the slash, represented as a tuple:
stash: The stash account of the validator being slashed.
slash_fraction: The fraction of the stake that was slashed.
page_index: The index of the exposure page being processed.
Behavior
The function is permissionless—anyone can call it.
The slash_eramust be the current era or a past era. If it is in the future, the
call fails with EraNotStarted.
The fee is waived if the slash is successfully applied.
TODO: Future Improvement
Implement an off-chain worker (OCW) task to automatically apply slashes when there
is unused block space, improving efficiency.
Manually applies a deferred slash for a given era.
Normally, slashes are automatically applied shortly after the start of the
slash_era
. This function exists as a fallback mechanism in case slashes were not applied due to unexpected reasons. It allows anyone to manually apply an unapplied slash.Parameters
slash_era
: The staking era in which the slash was originally scheduled.slash_key
: A unique identifier for the slash, represented as a tuple:stash
: The stash account of the validator being slashed.slash_fraction
: The fraction of the stake that was slashed.page_index
: The index of the exposure page being processed.Behavior
slash_era
must be the current era or a past era. If it is in the future, the call fails withEraNotStarted
.TODO: Future Improvement