Skip to content

Commit

Permalink
[FOLD] Add comment and warning. Remove zero quorum
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonianb committed Apr 28, 2017
1 parent e3c0cc7 commit 8bea99d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/ripple/app/misc/ValidatorList.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,12 @@ ValidatorList::onConsensusStart (

if (minimumQuorum_ && (seenValidators.empty() ||
rankedKeys.size() < quorum))
{
quorum = *minimumQuorum_;
JLOG (j_.warn()) <<
"Using unsafe quorum of " << quorum_ <<
" as specified in the command line";
}

// Do not use achievable quorum until lists from all configured
// publishers are available
Expand Down
14 changes: 11 additions & 3 deletions src/ripple/app/misc/impl/ValidatorList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,6 @@ std::size_t
ValidatorList::calculateMinimumQuorum (
std::size_t nListedKeys, bool unlistedLocal)
{
if (nListedKeys == 0)
return 0;

// Only require 51% quorum for small number of validators to facilitate
// bootstrapping a network.
if (nListedKeys <= 5)
Expand All @@ -427,6 +424,17 @@ ValidatorList::calculateMinimumQuorum (
++nListedKeys;

// Guarantee safety with up to 1/3 listed validators being malicious.
// This prioritizes safety (Byzantine fault tolerance) over liveness.
// It takes at least as many malicious nodes to split/fork the network as
// to stall the network.
// At 67%, the overlap of two quorums is 34%
// 67 + 67 - 100 = 34
// So under certain conditions, 34% of validators could vote for two
// different ledgers and split the network.
// Similarly 34% could prevent quorum from being met (by not voting) and
// stall the network.
// If/when the quorum is subsequently raised to/towards 80%, it becomes
// harder to split the network (more safe) and easier to stall it (less live).
return nListedKeys * 2/3 + 1;
}

Expand Down

0 comments on commit 8bea99d

Please sign in to comment.