In this section we describe the processing of messages for the slashing module.
Unjail
If a validator was automatically unbonded due to downtime and wishes to come back online & possibly rejoin the bonded set, it must send MsgUnjail:
// MsgUnjail is an sdk.Msg used for unjailing a jailed validator, thus returning// them into the bonded validator set, so they can begin receiving provisions// and rewards again.messageMsgUnjail {stringvalidator_addr=1;}
Below is a pseudocode of the MsgSrv/Unjail RPC:
unjail(txMsgUnjail)validator=getValidator(tx.ValidatorAddr)ifvalidator==nilfailwith"No validator found"ifgetSelfDelegation(validator)==0failwith"validator must self delegate before unjailing"if!validator.Jailedfailwith"Validator not jailed, cannot unjail"info=GetValidatorSigningInfo(operator)ifinfo.Tombstonedfailwith"Tombstoned validator cannot be unjailed"ifblocktime<info.JailedUntilfailwith"Validator still jailed, cannot unjail until period has expired"validator.Jailed=falsesetValidator(validator)return
If the validator has enough stake to be in the top n = MaximumBondedValidators, it will be automatically rebonded, and all delegators still delegated to the validator will be rebonded and begin to again collect provisions and rewards.