From b85e13aa0c062af59b7ad4f9c2c0b1f36e938385 Mon Sep 17 00:00:00 2001 From: nashqueue <99758629+nashqueue@users.noreply.github.com> Date: Mon, 21 Nov 2022 12:10:11 +0100 Subject: [PATCH] Fix Examples for Proposer Selection Specs (#9375) This PR resolves #9346 Co-authored-by: Adi Seredinschi Co-authored-by: Adi Seredinschi --- spec/consensus/proposer-selection.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/consensus/proposer-selection.md b/spec/consensus/proposer-selection.md index 3cea3d5cd..32ec162af 100644 --- a/spec/consensus/proposer-selection.md +++ b/spec/consensus/proposer-selection.md @@ -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: