Unjailing a jailed validator

How to put a jailed validator out of jail.

Validator nodes can get "jailed" along with a penalty imposed (through its stake getting slashed). Unlike a proof-of-work (PoW) network (such as Ethereum or Bitcoin), proof-of-stake (PoS) networks (such as the dHealth network, built using Cosmos SDK) use stake slashing as a mechanism of enforcing good on-chain behavior from validators.

Jailed due to downtime

When a validator "misses" blocks or doesn't participate in consensus, it can get temporarily jailed. By enforcing this check, PoS networks like ours ensure that validators are actively participating in the operation of the network, ensuring that their nodes remain secure and up-to-date with the latest software releases, etc.

The duration on how this is calculated is defined in the genesis parameters of dHealth network. Jailing occurs based on a sliding time window (called the infraction window) calculated as follows.

  1. The signed_blocks_window (set to 5,000 blocks on mainnet) defines the time window that is used to calculate downtime.
  2. Within this window of 5,000 blocks, at least 50% of the blocks must be signed by a validator. This is defined in the genesis parameter min_signed_per_window (set to 0.5 for mainnet).
  3. Therefore, if a validator misses 2,500 blocks within the last 5000 blocks it meets the criteria for getting jailed.
    1. To convert this block window to a time period, consider the block time of the network, i.e., at what frequency a new block is created. The latest block time can be found on our mainnet explorer or any other explorer configured for cheqd network (such as NodeStake Wallet).
    2. Let's assume the block time was 6 seconds. This equates to 5,000 * 6 = 30,000 seconds = ~8.3 hours. This means if the validator is not participating in consensus for more than ~8.3 hours (in this example), it will get temporarily jailed.
    3. Since the block time of the network is variable on the number of nodes participating, network congestion, etc it's always important to calculate the time period on latest block time figures.

What happens when a validator is temporarily jailed for downtime

Normally, 1% of all of the stake delegated to the node is slashed, i.e., burned and disappears forever. This includes any stake delegated to the node by external parties. (If a validator gets jailed, delegators may decide to switch whom they delegate to.) The percentage of stake to be slashed is defined in the slash_fraction_downtime genesis parameter.

However with the proposal #2, now a jailed validator only faces the jail time of 10 minutes with no stake slashed.

Step 1: Confirming the Node is up to date

Check your node status by running:

dhealthd status
dhealth-testnetd status

Expected response: In the output, look for the text latest_block_height and note the value. Execute the status command above a few times and make sure the value of latest_block_height has increased each time.

The node is fully caught up when the parameter catching_up returns the output false.

Step 2: Unjailing command

If everything is up to date, and the node has fully caught up, you can now unjail your node using this command in the dhealthd CLI:

dhealthd tx slashing unjail --from youraccount
dhealth-testnetd tx slashing unjail --from youraccount