-
Notifications
You must be signed in to change notification settings - Fork 565
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clear Miner History when Switching Validators Set
- Loading branch information
Showing
3 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<pre> | ||
BEP: 403 | ||
Title: Clear Miner History when Switching Validators Set | ||
Status: Candidate | ||
Type: Standards | ||
Created: 2024-07-01 | ||
</pre> | ||
|
||
# BEP-403: Clear Miner History when Switching Validators Set | ||
|
||
- [BEP-403: Clear Miner History when Switching Validators Set](#bep-403-clear-miner-history-when-switching-validators-set) | ||
- [1. Summary](#1-summary) | ||
- [2. Motivation](#2-motivation) | ||
- [3. Status](#3-status) | ||
- [4. Specification](#4-specification) | ||
- [5. License](#5-license) | ||
|
||
## 1. Summary | ||
After switching the validator set on the BSC chain, the previous block production record is still used to restrict some validators from producing blocks for the first few blocks after the switch, leading to brief network instability. This BEP aims to resolve this issue. | ||
|
||
## 2. Motivation | ||
The validator set on the BSC chain switches at each epoch. | ||
|
||
Assume the number of validators in an epoch is validatorN. To ensure the consistency of the BSC chain, it is required that the chain must have at least validatorN/2+1 validators to continue advancing the chain. If the chain splits into multiple disjoint sets at any time, only the validators in one set can keep the chain active. Otherwise, there would be at least (validatorN/2+1) \* 2 different validators, and (validatorN/2+1) \* 2 > validatorN, which is impossible. | ||
|
||
To achieve this constraint, a set called MinerHistory is defined, with a length of validatorN/2, recording the validators that produced the last validatorN/2 blocks. New block-producing validators are required to not be in MinerHistory. | ||
|
||
In the current specification, when the validator set switches at each epoch, MinerHistory is not cleared, causing some validators to be unable to produce blocks normally for the first few blocks after the switch. | ||
<div align="center"> | ||
<img src=./assets/BEP-403/3-1.png width=100% /> | ||
</div> | ||
This BEP clarifies that MinerHistory should be cleared when switching the validator set to solve this issue. | ||
|
||
## 3. Status | ||
This BEP is in progress. | ||
|
||
## 4. Specification | ||
Clear MinerHistory when switching the validator set at each epoch. | ||
```Go | ||
MinerHistory map[uint64]Address | ||
|
||
if switching validator set for new epoch { | ||
MinerHistory = Address{} | ||
} | ||
``` | ||
|
||
## 5. License | ||
The content is licensed under [CC0](https://creativecommons.org/publicdomain/zero/1.0/) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters