mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-03 03:35:19 +00:00
Fix Examples for Proposer Selection Specs (#9375)
This PR resolves #9346 Co-authored-by: Adi Seredinschi <adizere@gmail.com> Co-authored-by: Adi Seredinschi <a@seredinschi.net>
This commit is contained in:
@@ -136,13 +136,13 @@ Let's assume that after the last run the proposer priorities were as shown in fi
|
||||
The procedure could continue without modifications. However, after a sufficiently large number of modifications in validator set, the priority values would migrate towards maximum or minimum allowed values causing truncations due to overflow detection.
|
||||
For this reason, the selection procedure adds another __new step__ that centers the current priority values such that the priority sum remains close to 0.
|
||||
|
||||
| Priority Run | -3 | -2 | -1 | 0 | 1 | 2 | 4 | Comment |
|
||||
|----------------|----|----|----|---|----|----|---|-----------------------|
|
||||
| last run | p3 | | | | p1 | p2 | | __remove p2__ |
|
||||
| nextrun | | | | | | | | |
|
||||
| __new step__ | | p3 | | | | p1 | | A(i) -= avg, avg = -1 |
|
||||
| | | | | | p3 | p1 | | A(i)+=VP(i) |
|
||||
| | | | p1 | | p3 | | | A(p1)-= P |
|
||||
| Priority Run | -3 | -2 | -1 | 0 | 1 | 2 | 3 | Comment |
|
||||
|----------------|----|----|----|---|----|----|----|-----------------------|
|
||||
| last run | p3 | | | | p1 | p2 | | __remove p2__ |
|
||||
| nextrun | | | | | | | | |
|
||||
| __new step__ | | p3 | | | | p1 | | A(i) -= avg, avg = -1 |
|
||||
| | | | | | p3 | | p1 | A(i)+=VP(i) |
|
||||
| | | | p1 | | p3 | | | A(p1)-= P |
|
||||
|
||||
The modified selection algorithm is:
|
||||
|
||||
@@ -200,7 +200,7 @@ In the next run, p3 will still be ahead in the queue, elected as proposer and mo
|
||||
| Priority Run | -13 | -9 | -5 | -2 | -1 | 0 | 1 | 2 | 5 | 6 | 7 | Alg step |
|
||||
|----------------|-----|----|----|----|----|---|---|----|----|----|----|-----------------------|
|
||||
| last run | | | | p2 | | | | p1 | | | | __add p3__ |
|
||||
| | p3 | | | p2 | | | | p1 | | | | A(p3) = -4 |
|
||||
| | p3 | | | p2 | | | | p1 | | | | A(p3) = -13 |
|
||||
| next run | | p3 | | | | | | p2 | | p1 | | A(i) -= avg, avg = -4 |
|
||||
| | | | | | p3 | | | | p2 | | p1 | A(i)+=VP(i) |
|
||||
| | | | p1 | | p3 | | | | p2 | | | A(p1)-=P |
|
||||
@@ -215,7 +215,7 @@ Validator | p1 | p2 | Comment
|
||||
----------|------|------|------------------
|
||||
VP | 80k | 10 |
|
||||
A | 0 | -90k | __added p2__
|
||||
A | -45k | 45k | __run selection__
|
||||
A | 45k | -45k | __run selection__
|
||||
|
||||
Then execute the following steps:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user