Skip to content

Commit

Permalink
Merge branch 'master' into bep-99
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidityGo authored May 5, 2022
2 parents 42ca896 + 9f17c22 commit c67c07d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
48 changes: 48 additions & 0 deletions BEP128.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# BEP-128: Improvement on BNB Smart Chain Staking Reward Distribution

- [BEP-128: Improvement on BNB Smart Chain Staking Reward Distribution](#bep-128-improvement-on-bnb-smart-chain-staking-reward-distribution)
- [1. Summary](#1-summary)
- [2. Abstract](#2-abstract)
- [3. Status](#3-status)
- [4. Motivation](#4-motivation)
- [5. Specification](#5-specification)
- [5.1 Overall Workflow](#51-overall-workflow)
- [5.2 Distribution Batch Size](#52-distribution-batch-size)
- [5.3 User Impact](#53-user-impact)
- [6. License](#6-license)

## 1. Summary
This BEP describes a proposal to improve the BNB Smart Chain staking reward distribution mechanism on BNB Beacon Chain.

## 2. Abstract
Instead of distributing BNB Smart Chain staking rewards in a single block for each day, this proposal suggests distributing staking rewards in many consecutive blocks, to minimize the burden on the specific block.

## 3. Status
This BEP is a draft.

## 4. Motivation
Currently, the staking rewards of BNB Smart Chain are distributed in the first block of a day on BNB Beacon Chain (which is known as breath block). With the increasing number of delegators (more than 50,000 nowadays), it will lead to a heavy load to breath block, and users' transactions/requests could be affected. Meanwhile, it could also be a bottleneck for further evaluation of BNB Beacon Chain. Thus, this proposal provides a solution to fix the issue and benefit the evaluation of BNB Beacon Chain in the long term.

## 5. Specification
### 5.1 Overall Workflow
![overall workflow](./assets/bep-128/reward-distribution.png)

The overall distribution processes work like this:
- In breath block, validators' commission fee will be distributed, all delegators' rewards will be saved to a separate store.
- Delegators' reward will be distributed in batches in the following blocks.

### 5.2 Distribution Batch Size

Distribution batch size controls how many delegators will receive reward in a single block. It should be evaluated and adjusted to make sure:
- The reward distribution must finish within one day, which means the batch size should not be too small.
- It should not be too big to bring heavy load on a single block.

At the same time, this batch size can also be governed.

### 5.3 User Impact

The impact to general delegators is minimal, that their rewards will be delayed a bit after applying this proposal. However, the delay is relatively small and can be ignored compared to the whole staking process. Taking the current delegation volume as an example, about 50,000 rewards are distributed, then in the worst case the delay is 3~4 minutes (500 blocks) if the batch size is 100.

## 6. License
The content is licensed under [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BEPs

BEP stands for Binance Chain Evolution Proposal. Each BEP will be a proposal document providing information to the Binance Chain/DEX community.
BEP stands for BNB Evolution Proposal. Each BEP will be a proposal document providing information to the BNB Chain ecosystem and community.


Here are the list of subjects of BEPs:
Expand All @@ -27,3 +27,4 @@ Here are the list of subjects of BEPs:
* [BEP-93](BEP93.md): Diff Sync Protocol on BSC
* [BEP-95](BEP95.md): Introduce Real-Time Burning Mechanism
* [BEP-127](BEP127.md): Temporary Maintenance Mode for Validators
* [BEP-128](BEP128.md): Improvement on BNB Smart Chain Staking Reward Distribution
Binary file added assets/bep-128/reward-distribution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c67c07d

Please sign in to comment.