github.com/Finschia/finschia-sdk@v0.48.1/x/distribution/spec/03_begin_block.md (about) 1 <!-- 2 order: 3 3 --> 4 5 # Begin Block 6 7 At each `BeginBlock`, all fees received in the previous block are transferred to 8 the distribution `ModuleAccount` account. When a delegator or validator 9 withdraws their rewards, they are taken out of the `ModuleAccount`. During begin 10 block, the different claims on the fees collected are updated as follows: 11 12 - The block proposer of the previous height and its delegators receive between 1% and 5% of fee rewards. 13 - The reserve community tax is charged. 14 - The remainder is distributed proportionally by voting power to all bonded validators 15 16 To incentivize validators to wait and include additional pre-commits in the block, the block proposer reward is calculated from Tendermint pre-commit messages. 17 18 ## The Distribution Scheme 19 20 See [params](07_params.md) for description of parameters. 21 22 Let `fees` be the total fees collected in the previous block, including 23 inflationary rewards to the stake. All fees are collected in a specific module 24 account during the block. During `BeginBlock`, they are sent to the 25 `"distribution"` `ModuleAccount`. No other sending of tokens occurs. Instead, the 26 rewards each account is entitled to are stored, and withdrawals can be triggered 27 through the messages `FundCommunityPool`, `WithdrawValidatorCommission` and 28 `WithdrawDelegatorReward`. 29 30 ### Reward to the Community Pool 31 32 The community pool gets `community_tax * fees`, plus any remaining dust after 33 validators get their rewards that are always rounded down to the nearest 34 integer value. 35 36 ### Reward To the Validators 37 38 The proposer receives a base reward of `fees * baseproposerreward` and a bonus 39 of `fees * bonusproposerreward * P`, where `P = (total power of validators with 40 included precommits / total bonded validator power)`. The more precommits the 41 proposer includes, the larger `P` is. `P` can never be larger than `1.00` (since 42 only bonded validators can supply valid precommits) and is always larger than 43 `2/3`. 44 45 Any remaining fees are distributed among all the bonded validators, including 46 the proposer, in proportion to their consensus power. 47 48 ``` 49 powFrac = validator power / total bonded validator power 50 proposerMul = baseproposerreward + bonusproposerreward * P 51 voteMul = 1 - communitytax - proposerMul 52 ``` 53 54 In total, the proposer receives `fees * (voteMul * powFrac + proposerMul)`. 55 All other validators receive `fees * voteMul * powFrac`. 56 57 ### Rewards to Delegators 58 59 Each validator's rewards are distributed to its delegators. The validator also 60 has a self-delegation that is treated like a regular delegation in 61 distribution calculations. 62 63 The validator sets a commission rate. The commission rate is flexible, but each 64 validator sets a maximum rate and a maximum daily increase. These maximums cannot be exceeded and protect delegators from sudden increases of validator commission rates to prevent validators from taking all of the rewards. 65 66 The outstanding rewards that the operator is entitled to are stored in 67 `ValidatorAccumulatedCommission`, while the rewards the delegators are entitled 68 to are stored in `ValidatorCurrentRewards`. The [F1 fee distribution 69 scheme](01_concepts.md) is used to calculate the rewards per delegator as they 70 withdraw or update their delegation, and is thus not handled in `BeginBlock`. 71 72 ### Example Distribution 73 74 For this example distribution, the underlying consensus engine selects block proposers in 75 proportion to their power relative to the entire bonded power. 76 77 All validators are equally performant at including pre-commits in their proposed 78 blocks. Then hold `(precommits included) / (total bonded validator power)` 79 constant so that the amortized block reward for the validator is `( validator power / total bonded power) * (1 - community tax rate)` of 80 the total rewards. Consequently, the reward for a single delegator is: 81 82 ``` 83 (delegator proportion of the validator power / validator power) * (validator power / total bonded power) 84 * (1 - community tax rate) * (1 - validator commision rate) 85 = (delegator proportion of the validator power / total bonded power) * (1 - 86 community tax rate) * (1 - validator commision rate) 87 ```