module_staking

staking module

Introduction

The staking module handles Proof-of-Stake related logic, which plays a very important part in the underlying consensus protocol.

Overview

Cronos POS Chain is based on Tendermint Core's consensus engine, it relies on a set of validators to participate in the proof of stake (POS) consensus protocol, and they are responsible for committing new blocks in the blockchain.

  • unbonding_time: The time duration of unbonding;

  • max_validators: The maximum number of validators;

  • max_entries: The max entries for either unbonding delegation or redelegation;

  • historical_entries: The number of historical entries to persist; and

  • bond_denom: Coin denomination for staking.

Validator

Validators are responsible for signing or proposing block at each consensus round. It is important that the validators maintain excellent availability and network connectivity to perform their tasks. To incentivise the validator nodes to run the network, rewards are distributed to the validators according to their performance and amount of staked token (see distribution and mint). On the other hand, a penalty should be imposed on validators' misbehavior (see slashing).

Delegator

The staking module enables CRO owners to delegate their tokens to active validators and share part of the reward obtained by the validator during the proof of stake protocol(see distribution module). Specifically, It allows token owners to take part in the consensus process without running a validator themselves.

It is important to point out that the delegator and the validator are in the same boat: They share the reward and the risk. In particular, part of their delegated token could be slashed due to validator's misbehaviour (see slashing). Therefore, It is very important to choose a reliable validator to delegate. Kindly refer to this link for detailed specification and state transitions of delegation.

Transactions and Queries

Transactions

tx staking create-validator - Create new validator initialized with a self-delegation

First of all, we can create a validator with the create-validator transaction, for example:

tx staking delegate [validator-addr] [amount] - Delegate liquid tokens to a validator

As discussed in the delegator section, one can delegate their tokens to an active validator by:

tx staking unbond [validator-addr] [amount] - Unbond shares from a validator

Delegator can unbond their staked tokens by

Remark: Note that funds will only be available after the unbonding_time has passed.

tx staking redelegate [src-validator-addr] [dst-validator-addr] [amount] - Redelegate illiquid tokens from one validator to another

We can also move our staked tokens from one validator to another by:

Queries

We will be covering most of the commonly used queries here. Meanwhile, you can use

to check all the supported sub-commands.

query staking delegation [delegator-addr] [validator-addr] - Query a delegation based on address and validator address

With a given delegator address and the validator account that it is associated with, we can check the by:

query staking delegations-to [validator-addr] - Query all delegations made to one validator

We can check all the delegations made to a specific validator:

query staking pool - Query the current staking pool values

We can check the amount of bonded and unbonded amount in the staking pool:

query staking unbonding-delegation [delegator-addr] [validator-addr] - Query an unbonding-delegation record based on delegator and validator address

query staking validator [validator-addr] - Query a specific validator

We can query the details of a specific validator with its validator address (crocncl...) by:

query staking validators - Query all validators

A full list of validators and their details can be found by this query.

query staking params - Query the current staking parameters

Finally, we can query the current staking parameters by

Appendix

staking module: Network Parameters Configuration

the The following tables show overall effects on different configurations of the staking related network parameters:

bond_denom

historical_entries

max_entries

Type

string

uint16

uint16

Higher

N/A

More historical entries to persist

More entries for either unbonding delegation or redelegation

Lower

N/A

Less historical entries to persist

Fewer entries for either unbonding delegation or redelegation

Constraints

N/A

Value has to be positive

Value has to be a positive

Sample configuration

basecro

100 (50%)

7


max_validators

unbonding_time

Type

uint16

string

Higher

More active validators

Longer waiting period for unbonding

Lower

Fewer active validators

Shorter waiting period for unbonding

Constraints

Value has to be less or equal to 1

Positive value in seconds

Sample configuration

100 (maximum 100 active validator)

"2419200s" (28 Days)

Last updated