From 4f8c9e4917feb8208bf32852c209431196b2101e Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Mon, 13 Aug 2018 14:51:01 +0200 Subject: [PATCH] Update transactions.md --- docs/spec/slashing/transactions.md | 42 +++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/docs/spec/slashing/transactions.md b/docs/spec/slashing/transactions.md index cdf495e4d2..33e3bd65e5 100644 --- a/docs/spec/slashing/transactions.md +++ b/docs/spec/slashing/transactions.md @@ -1,19 +1,41 @@ +## Transaction Overview -### TxProveLive +In this section we describe the processing of transactions for the `slashing` module. -If a validator was automatically unbonded due to liveness issues and wishes to -assert it is still online, it can send `TxProveLive`: +### TxUnjail + +If a validator was automatically unbonded due to downtime and wishes to come back online & +possibly rejoin the bonded set, it must send `TxUnjail`: ```golang -type TxProveLive struct { - PubKey crypto.PubKey +type TxUnjail struct { + ValidatorAddr sdk.AccAddress } ``` -All delegators in the temporary unbonding pool which have not -transacted to move will be bonded back to the now-live validator and begin to -once again collect provisions and rewards. +All delegators still delegated to the validator will be rebonded and begin +to again collect provisions and rewards. -``` -TODO: pseudo-code +```golang +handleMsgUnjail(operator sdk.AccAddress) + + validator := getValidator(operator) + if validator == nil + fail with "No validator found" + + if !validator.Jailed + fail with "Validator not jailed, cannot unjail" + + info := getValidatorSigningInfo(operator) + if BlockHeader.Time.Before(info.JailedUntil) + fail with "Validator still jailed, cannot unjail until period has expired" + + // Update the start height so the validator won't be immediately unbonded again + info.StartHeight = BlockHeight + setValidatorSigningInfo(info) + + validator.Jailed = false + setValidator(validator) + + return ```