From d600518989647e1f8183485e6274f1a8afc5ed8f Mon Sep 17 00:00:00 2001 From: Tim Moreton Date: Thu, 9 Jan 2020 14:42:03 -0800 Subject: [PATCH 1/2] Explain Q and F --- consensus/istanbul/validator/default.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/consensus/istanbul/validator/default.go b/consensus/istanbul/validator/default.go index 5ba1849313..8d20fed57a 100644 --- a/consensus/istanbul/validator/default.go +++ b/consensus/istanbul/validator/default.go @@ -247,6 +247,27 @@ func (valSet *defaultSet) Copy() istanbul.ValidatorSet { return newValSet } +// We include the optimization described at https://arxiv.org/pdf/1901.07160.pdf as “PM-6” and +// discussed in Lemma 22. For values of N=3F for integer F=1,2,3,.. we can tolerate a quorum +// size one smaller than anticipated by Q = N - F. The intersection of any two sets of Q +// nodes of N=3F must contain an honest validator. +// +// For example, with N=9, F=2, Q=6. Any two sets of Q=6 from N=9 nodes must overlap +// by >9-6=3 nodes. At least 3-F=3-2=1 must be honest. +// +// 1 2 3 4 5 6 7 8 9 +// x x x x x x +// y y y y y y +// F F H +// +// For N=10, F=3, Q=7. Any two sets of Q=7 nodes from N=10 must overlap by >4 nodes. +// At least 4-F=4-3=1 must be honest. +// +// 1 2 3 4 5 6 7 8 9 10 +// x x x x x x x +// y y y y y y y +// F F F H + func (valSet *defaultSet) F() int { return int(math.Ceil(float64(valSet.Size())/3)) - 1 } func (valSet *defaultSet) MinQuorumSize() int { From a34eec3f1e6e2d6e106c6c9b8b8ca5884b991c31 Mon Sep 17 00:00:00 2001 From: Tim Moreton Date: Thu, 9 Jan 2020 14:44:17 -0800 Subject: [PATCH 2/2] Spaces --- consensus/istanbul/validator/default.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/consensus/istanbul/validator/default.go b/consensus/istanbul/validator/default.go index 8d20fed57a..b4bec35057 100644 --- a/consensus/istanbul/validator/default.go +++ b/consensus/istanbul/validator/default.go @@ -257,16 +257,16 @@ func (valSet *defaultSet) Copy() istanbul.ValidatorSet { // // 1 2 3 4 5 6 7 8 9 // x x x x x x -// y y y y y y -// F F H +// y y y y y y +// F F H // // For N=10, F=3, Q=7. Any two sets of Q=7 nodes from N=10 must overlap by >4 nodes. // At least 4-F=4-3=1 must be honest. // // 1 2 3 4 5 6 7 8 9 10 // x x x x x x x -// y y y y y y y -// F F F H +// y y y y y y y +// F F F H func (valSet *defaultSet) F() int { return int(math.Ceil(float64(valSet.Size())/3)) - 1 }