Mavryk_raw_protocol_001_PtAtLas.Delegate_slashed_deposits_storageThis module maintains the storage related to slashing of delegates for double signing. In particular, it is responsible for maintaining the Storage.Slashed_deposits, Storage.Contract.Slashed_deposits, and Storage.Current_cycle_denunciations tables.
val already_slashed_for_double_baking :
Raw_context.t ->
Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key_hash.t ->
Level_repr.t ->
bool Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Mavryk_protocol_environment_001_PtAtLas.Lwt.tReturns true if the given delegate has already been slashed for double baking for the given level.
val already_slashed_for_double_attesting :
Raw_context.t ->
Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key_hash.t ->
Level_repr.t ->
bool Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Mavryk_protocol_environment_001_PtAtLas.Lwt.tReturns true if the given delegate has already been slashed for double preattesting or double attesting for the given level.
The reward_and_burn type embeds amounts involved when slashing a delegate for double attesting or double baking.
type punishing_amounts = {staked : reward_and_burn;unstaked : (Cycle_repr.t * reward_and_burn) list;}The punishing_amounts type embeds amounts involved when slashing a delegate for double attesting or double baking.
val punish_double_signing :
Raw_context.t ->
operation_hash:Mavryk_protocol_environment_001_PtAtLas.Operation_hash.t ->
Misbehaviour.t ->
Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key_hash.t ->
Level_repr.t ->
rewarded:Mavryk_protocol_environment_001_PtAtLas.Signature.public_key_hash ->
(Raw_context.t * bool)
Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Mavryk_protocol_environment_001_PtAtLas.Lwt.tRecord in the context that the given delegate has now been slashed for double signing for the given misbehaviour for the given level and return the amounts to burn and to reward. If the delegate has no remaining frozen deposits, this will also forbid it to bake or attest until a new deposit is frozen.
Fails with Unrequired_denunciation if the given delegate has already been slashed for the same misbehaviour for the given level.
val clear_outdated_slashed_deposits :
Raw_context.t ->
new_cycle:Cycle_repr.t ->
Raw_context.t Mavryk_protocol_environment_001_PtAtLas.Lwt.tval apply_and_clear_current_cycle_denunciations :
Raw_context.t ->
(Raw_context.t
* Int_percentage.t
Mavryk_protocol_environment_001_PtAtLas.Signature.Public_key_hash.Map.t
* Receipt_repr.balance_updates)
Mavryk_protocol_environment_001_PtAtLas.Error_monad.tzresult
Mavryk_protocol_environment_001_PtAtLas.Lwt.t