KiChain: How to unjail a jailed validator

Tarek Awwad
Ki Foundation
Published in
3 min readJan 19, 2021

Welcome to the Ki-steps series, a sequence of how-to posts where we explain the detailed steps to perform more or less advanced tasks on the KiChain. In this post, we will quickly discuss the jailing process in the KiChain and explain how to unjail a jailed validator.

In a blockchain, validators are the active actors that ensure the integrity and security of the network and its asset transactions. Their task consists — in a nutshell — in validating the transactions, voting over the next state of the blockchain and committing it when a consensus is reached.

To maintain a high level of security and performance on the network, a validator is supposed to keep signing and committing blocks permanently. However, a validator can fail to commit blocks due to multiple reasons such as a connection loss or a server fail. To protect the network and prevent any performance drop, an inactive validator needs to be eliminated from the validator list. Nonetheless, since missing blocks is not a high security threat (as opposed to double signing blocks for example), the elimination can be temporary. In Cosmos based chains, thus in the KiChain, this process of temporarily eliminating a validator is called "Jailing". Depending on the infrastructure used by the operator (redundant connection, alert systems, …) downtimes are very likely to occur, hence, a higher risk of being jailed might exist.

In the KiChain, a validator is jailed if it fails to validate at least 5% of the last 5000 blocks. When jailed, the validator's total stake (self delegated and delegated by others) is slashed by 0.01%. These configurations can be found in the genesis file under the slashing section, they are defined by min_signed_per_window, signed_block_window, and slash_fraction_downtime respectively.

"slashing": 
{
"params":
{
"downtime_jail_duration": "600000000000",
"max_evidence_age": "120000000000",
"min_signed_per_window": "0.0500000000000000000",
"signed_blocks_window": "5000",
"slash_fraction_double_sign": "0.050000000000000000",
"slash_fraction_downtime": "0.000100000000000000"
},
}

A jailed validator is trapped for 10 minutes as determined by the downtime_jail_duration parameter (6*10^11 nanoseconds). When this jail period elapses, the validator is allowed to rejoin the validation process. However, rejoining is not automatic and needs to be triggered by a manual transaction called and unjail transaction. To broadcast an unjail transaction, an operator can use the ki-tools as follows:

kicli tx slashing unjail \
--from=<operator_key_name> \
--chain-id=kichain-1\
--gas-prices=0.025uxki \
--home=<node-home>/kicli/

Blocks missed over a sliding window of 250 blocks can be viewed on the Ki Explorer at the bottom of the validator page.

Ki Explorer : White blocks indicate missed blocks

Despite the easiness of unjailing, getting jailed can have severe economical impact on the validators as it can lead — beside the slashing — the delegators to abandon them and switch their delegations to other validators in order to secure their funds. Therefore, a validator needs to ensure they are aware of any performance anomaly before their validator is jailed. We encourage validator operators to use an active monitoring solution that periodically probes the blockchain and alerts them in case of missed blocks. The Ki Monitor does this. It is a JavaScript tools that can be used by the validator to monitor (among other) the missed block count and get alerted when some configurable thresholds are crossed. You can read more about the Ki Monitor and its usage in this post.

As mentioned earlier, jailing is always accompanied with a minor slashing factor. In a future post, we will discuss the other cases where a validator can be slashed and we will detail the slashing module and its parameters.

--

--

Tarek Awwad
Ki Foundation

Computer Scientist - PhD - Chief Blockchain Architect @Ki_Foundation - #Blockchain #DistributedSystems #Crowdsourcing #MachineLearning #DataMining