BEP-404: Clear Miner History when Switching Validators Set#404
Merged
zzzckck merged 8 commits intobnb-chain:masterfrom Jul 2, 2024
buddh0:clear_miner_history_switch_epoch_validators
Merged
BEP-404: Clear Miner History when Switching Validators Set#404zzzckck merged 8 commits intobnb-chain:masterfrom buddh0:clear_miner_history_switch_epoch_validators
zzzckck merged 8 commits intobnb-chain:masterfrom
buddh0:clear_miner_history_switch_epoch_validators
Conversation
unclezoro
previously approved these changes
Jul 2, 2024
zzzckck
reviewed
Jul 2, 2024
zzzckck
reviewed
Jul 2, 2024
zzzckck
reviewed
Jul 2, 2024
Collaborator
|
may refer this block as an example: https://bscscan.com/block/40110411 |
zzzckck
approved these changes
Jul 2, 2024
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BEP-404: Clear Miner History when Switching Validators Set
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.
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.
This BEP aims to enhance network stability by clearing MinerHistory when the validator set switches.
3. Status
This BEP is in progress.
4. Specification
In the previous 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.

This BEP clarifies that MinerHistory should be cleared when switching the validator set to solve this issue.
5. Backwards Compatibility
There are no known backward compatibility issues.
6. License
The content is licensed under CC0