Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explain Q and F #803

Merged
merged 3 commits into from
Jan 13, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions consensus/istanbul/validator/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
nategraf marked this conversation as resolved.
Show resolved Hide resolved
// 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.
nategraf marked this conversation as resolved.
Show resolved Hide resolved
//
// 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 {
Expand Down