Skip to main content

Slashing

The Slasher module is an optional component of the Vault structure that handles the enforcement of slashing penalties. It doesn't perform slashings by itself but processes the requests received from the network middlewares.

Its general flow when the request is received is as follows:

  • Fetch the stake data from the Delegator module and data about previous slashing incidents from the internal storage
  • Aggregate and validate the fetched data
  • Execute the request by:
    • updating the internal storage
    • calling the Delegator module for its update
    • calling the Vault module to burn the collateral

Technical overview

In general, when a network fetches the stakes at some point in time, called the "capture timestamp", it receives the guarantee that the received amounts of collateral will be slashable during one epoch after it. Hence, the Slasher module always checks that the capture timestamp is not older than one epoch when executing the slashing.

info

In case of restaking, the guarantee might not be valid because of other networks' slashing. There is nothing to do about it because it is the nature of the restaking itself.

guarantee of slashing

Like the Delegator module, the Slasher module also has a types mechanic, where different Slasher types may be used for various purposes. Currently, there are two types (position indexes in the list below correspond to the on-chain types):

0. Slasher

This type performs an instant execution of the slashing request when received and validated. It is a simple and easy-to-understand implementation. However, it has too low flexibility compared with the next Slasher type.

instant slashing

1. VetoSlasher

VetoSlasher is a more complex type whose goal is to provide an in-house mechanism to handle a smooth transition for both networks and stakers from the just deployed versions of the networks to the battle-tested ones without additional development risks.

Its flow consists of three stages:

  1. Request of the slashing, which is performed by the network middleware and validated by the VetoSlasher contract
  2. Veto phase, whose duration is set during the vault's deployment, when the resolver (if set by the network) can veto the request
  3. Execution of the slashing, which can be performed only by the network middleware if the veto was not issued

veto slashing