Skip to content

Commit

Permalink
change the length of block history to check
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanBSC committed Jun 11, 2024
1 parent 9d225bd commit 6cd2582
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions BEPs/BEP-341.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ Each epoch predefines a set of validators, with a total of validatorN validators
#### 4.2.2 Validator Set Switch
Each epoch will choose a new validator set, assuming an epoch contains epochSlots slots. The validator set switch occurs only when the block height reaches Bswitch to prevent epoch block forging. The calculation of Bswitch is as follows:
<div align="center">
<img src=./assets/bep-341/4.2.2.png width=48% />
<img src=./assets/bep-341/4.2.2.png width=56% />
</div>

#### 4.2.3 Block Avoidance
To prevent fewer than 1/2 of the nodes from controlling the entire network, block producers are required to produce fewer than n blocks within the previous validatorN/2\*n historical blocks.
To prevent fewer than 1/2 of the nodes from controlling the entire network, block producers are required to produce fewer than n blocks within the previous ((validatorN/2+1)\*n-1) historical blocks.

#### 4.2.4 Governable Number of Consecutive Blocks
When n=1, it is equivalent to disabling the feature of consecutive block production, while significant optimization is observed when n belongs to the range [3,5]. Currently, the range for the value of n is set to [1,9] but except 2.
Expand All @@ -107,7 +107,7 @@ This BEP relies on BSC's Fast Finality feature. If Fast Finality fails, it may r
## 7. Liveness Analysis
The liveness of the chain remains unchanged, meaning it is required to ensure that at least (validatorN/2+1) validators are active. The proof is as follows:

Given that (validatorN/2+1) validators are active, and at a certain moment none of them are allowed to produce blocks, then each validator must have produced at least n blocks within the past validatorN/2\*n blocks. Thus, collectively, within the past validatorN/2\*n blocks, there must have been at least (validatorN/2+1)\*n blocks produced, which is impossible. Therefore, at any given moment, at least one node from the set of (validatorN/2+1) must be allowed to produce blocks.
If (validatorN/2+1) validators are active and none are allowed to produce blocks at a certain moment, each validator must have produced at least n blocks in the past ((validatorN/2+1)\*n-1) blocks. Thus, collectively, at least (validatorN/2+1)\*n blocks must have been produced, which is impossible. Therefore, at any moment, at least one of the (validatorN/2+1) validators must be allowed to produce blocks.

## 8. License
The content is licensed under [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
Binary file modified BEPs/assets/bep-341/4.2.2.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 6cd2582

Please sign in to comment.