BFChain block forgers are selected based on the trustee's votes and online rate and other parameters in accordance with the underlying consensus rules (see Block Forger Campaign for details).
The number of votes obtained by the trustee is obtained by voting on the trustees who have started to receive votes through the address account that holds the equity of the main chain on the entire network.
All address accounts on the chain that hold the equity of the main chain can vote for trustees in various supported Dapps (such as BFChain APP) or BCF node programs. The more votes the trustee gets, the greater the probability of becoming a forger.
This chapter will introduce the voting rules of BFChain in five parts:
A ballot is a bill used by an address account on the chain to vote for a trustee. The address account can only vote for the trustee if it receives votes.
In order for an on-chain address account to get votes, it needs to ensure:
The consensus formula for the number of votes that an address account can obtain in each round (for the next round of voting) is:
The number of votes that the address account can get in each round = balance balanceWeight + numberOfTransaction numberOfTransactionWeight * Rate
among them:
BFChain will calculate the number of votes each account has in the next round at the end of each round.
Automatic voting means that the bottom layer of BFChain provides a recommendation algorithm, and nodes independently configure algorithm parameter values. When the node turns on automatic voting, the bottom layer will automatically vote for the trustees who meet the conditions according to the algorithm and configuration parameter values.
In BFChainPC.Config.AutoVoteModel, the configuration parameters involved in the underlying recommendation algorithm are listed in detail. The definitions of several configuration parameters are as follows:
Parameter name | Interpretation | Value |
---|---|---|
enable | Whether to enable automatic voting for nodes | true: enable false: disable |
useConfigFee | Whether to use the default configuration of automatic voting on the chain fee | true: Automatic voting on the chain fee uses the value set in the parameter ‘fee’ false: Do not use the value set in the parameter ‘fee’ |
fee | Automatic voting on the chain fee | |
priorRecommendedNumber | Whether to prioritize the number of candidates | true: According to the recommendation algorithm, the number of candidates set in the parameter ‘maxNumberofRecommended’ is selected first false: not used |
maxNumberofRecommended | The maximum number of candidates selected by this node | |
numberofRounds | Selected block range, from which block range the statistics of several parameter values in the following recommended algorithm are calculated (from the most recent 100 rounds) | |
productivityPercent | Online rate percentage | |
forgedBlocksPercent | Proportion of forged blocks | |
applyTxPercent | Percentage of packaged transactions | |
votePercent | Last round of votes | |
newDelegatePercent | Proportion of new trustees | |
minBeSelectProductivity | Minimum online rate of recommended accounts |
For example:
Parameters | Interpretation | Setting Values |
---|---|---|
enable | Whether to enable automatic voting for the node | true |
priorRecommendedNumber | Whether to give priority to guarantee the number of recommenders | Yes |
maxNumberofRecommended | The maximum number of candidates selected by this node | 57 |
productivityPercent | Online rate percentage | 30% |
forgedBlocksPercent | Proportion of forged blocks | 30% |
applyTxPercent | Percentage of packaged transactions | 20% |
votePercent | Last round of votes | 10% |
newDelegatePercent | Percentage of new trustees | 10% |
The settings in the above table indicate that this node needs to select 57 candidate trustees at most through automatic voting. The composition of these 57 candidate trustees is:
The 17 (57*0.3) trustees who have the highest online rate within the selected block range to start receiving votes;
The 17 (57*0.3) trustees who have the largest number of blocks forged within the selected block range are open to receive votes
The 11 (57*0.2) trustees with the largest number of packaged transactions within the selected block range to start receiving votes
The 6 (57*0.1) trustees who received the highest vote rate in the previous round
The 6 newly registered trustees in the selected block range are open to accept voting trustees. The selection rule is: number of votes> number of main stakes> public key
BFChain biological chain forest provides the following interfaces for automatic voting of nodes:
Manual voting means that the node can vote on any trustee who has started to receive voting on the chain, and the number of votes cast is controlled by the node itself, as long as it does not exceed the maximum number of votes currently owned by the node.
BFChain biological chain forest provides the following event interfaces for nodes to vote manually:
After the forger has forged a block, the bottom layer will directly calculate the voting incentives that all address accounts that voted for the forger in the previous round should receive, and the incentive rights will be directly issued to each voting address account.
The total reward of votes obtained for forging the block totalRewardOfVote: {rewardPerBlock + sum(eachtransactionfeeOftheBlock)} * votePercent
eachtransactionfeeFortheBlock
is the on-chain fee of each event packaged into this block; sum(eachtransactionfeeOftheBlock)
is the sum of the on-chain fee of each event packaged into this block.
-votePercent: the percentage of voting incentives, this is a constant, determined by the underlying consensus, the current default is 0.6The voting incentives that each address account that voted for this forger in the previous round should receive = totalRewardOfVote * (The number of votes cast by the address account to the forge in the previous round / the total number of votes the forge obtained in the previous round)
For the consensus incentive mechanism of the BFChain ecosystem, please refer to the chapter Consensus Incentive Mechanism. This section will not describe it in detail.
The following data will be calculated at the end of each round: