Consensus settings

Waves Enterprise blockchain platform supports two types of consensus - PoS and PoA. The consensus settings are located in the blockchain section.

PoS configuration

The PoS consensus will be used by default if you have not specified the consensus type in the consensus.type field of the blockchain section. Here are the mining responsible parameters which are located in the genesis unit of the blockchain section:

  • average-block-delay - an average delay between the blocks creation. The default value is 60 seconds. The value of this parameter is ignored if PoA consensus is selected.

  • initial-base-target - an initial base number for the managing the mining process. The frequency of the block creation depends on the parameter value therefore the higher the value, the more often blocks are created. Also, the value of the miner’s balance affects the use of this parameter in mining - the larger the miner’s balance, the less the value of initial-base-target is used.

  • initial-balance - an initial balance in smallest units. The greater the share of the miner’s balance from the network initial balance, the smaller becomes the value of initial-base-target to determine the node miner of the current round.

We recommend to use the default parameter values specified in the configuration files examples which are represented on the GitHub page.

PoA settings

Please, uncomment or add the consensus unit of the blockchain section for the PoA consensus usage:

consensus {
  type = "poa"
  round-duration = "17s"
  sync-duration = "3s"
  ban-duration-blocks = 100
  warnings-for-ban = 3
  max-bans-percentage = 40
   }

Represented in the consensus unit parameters are used only for the PoA consensus.

  • type - the consensus type. Possible values are pos or poa. If you will specify the pos value, than other parameters will not be considered.

  • round-duration - a round length of the block mining in seconds.

  • sync-duration - a block mining synchronization period in seconds. The total time of the round is the sum of round-duration and sync-duration.

  • ban-duration-blocks - a blocks quantity of the ban period for the mining node.

  • warnings-for-ban - a number of rounds which is used for ban warnings for miner nodes.

  • max-bans-percentage - a percentage of mining nodes from the total number of nodes in the network that can be placed in the ban.

Using the PoA consensus allows to adjust the order of blocks creation by limiting the mining function for certain nodes. The reason is to distribute evenly the network load, if any mining nodes left the network or became inactive. Mining node can get banned for the following reasons:

  • if a node will miss its queue for mining;

  • if a node provides an invalid block;

  • if a node went offline.

Before getting into the blacklist the mining node receives warnings about the ban possibility during the number of rounds that is specified in the warnings-for-ban parameter. The mining node will be back to the mining after the ban-duration-blocks parameter value will end.

Consensus settings in the miner section

When you are configuring consensus settings, please, consider the following settings of the miner section:

  • micro-block-interval - an interval between microblocks. The value is specified in seconds.

  • min-micro-block-age - a minimal age of the microblock. The value is specified in seconds and should not be more than the micro-block-interval parameter value.

  • minimal-block-generation-offset - a minimal time interval between blocks. The value is specified in milliseconds.

The values of the microblock creation parameters should not conflict with the parameters values of the average-block-delay for PoS and round-duration for PoA. The number of microblocks in a block is not limited, but depends on the transactions size in the microblock.