Consensus
Last updated
Last updated
DxChain 3.0 implements DPOS as the consensus mechanism, which has the characteristics of low transaction delay, low handling fee, and strong system performance. It supports up to 210 nodes and up to 99 validator nodes in each epoch.
In order to become a node, a node application is needed first, and at least one validator approves the application.
When the epoch is updated, a certain number of validator nodes are randomly selected from all nodes, and the remaining nodes are candidate nodes. The number is related to the average number of nodes in the last 14 epochs.
Average Number of Nodes | Number of Validators |
---|---|
Validator: nodes have the right to produce a block (accounting right) in this epoch.
Nodes: Including all validator nodes and candidate nodes in this epoch.
Epoch: The time interval in blocks, currently 1 epoch = 14,400 blocks, which is about 1 day. At the end of each epoch, the system will conduct a new election of validator nodes.
The node management, voting, node election, etc. on the DxChain 3.0 chain are all completed by the system contract.
Validators: verify node information management and node election.
Proposals: manage node application information
NodeVotes: user delegated voting contract
SystemRewards: node reward, voting reward management contract
Migrate: 2.0 to 3.0 asset migration contract
The bottom layer of the blockchain calls the system contract:
When the epoch is iteratively updated, based on the Lucky Wheel Algorithm, validators are randomly selected from all nodes according to the sum of "node staking + user voting", the higher the amount is, the higher probability to be selected
The voting reward is updated after the new epoch is iteratively updated.
When a new block is generated, the system writes the block reward and the node that packs the block into the SystemRewards
contract.
When the validator node does not pack the blocks in order, the bottom layer calls SystemRewards.punish
to punish the node.
The validator nodes in each epoch will pack blocks in accordance with the order generated during the election. If the nodes fail to pack blocks in order that the threshold number is exceeded, the block rewards that have been generated in this epoch will be burnt. At the same time, the validation role will be deprived and cannot participate in the node election until recovery.
Please refer to the Parameter Table for the number of thresholds.
Contract | Address |
---|---|
( 0, 60 )
21
[ 60, 90 )
22
[ 90, 120 )
66
>= 120
99
Validators
0x0000000000000000000000000000000000fff001
Proposals
0x0000000000000000000000000000000000fff002
NodeVotes
0x0000000000000000000000000000000000fff003
SystemRewards
0x0000000000000000000000000000000000fff004
Migrate
0x0000000000000000000000000000000000fff005