-
Notifications
You must be signed in to change notification settings - Fork 1k
Consensus
Stands for Practical Byzantine Fault Tolerance, based on Castro & Liskov's work.
We offer three modes: classic
(one request per block), batch
(multiple requests per block), and sieve
(execute-verify on top of PBFT, makes a best effort to filter out non-deterministic transactions by having participants reach consensus on the result - details).
Use batch
(see "How to use" section below) as it is the main area of development focus and provides higher throughput than classic
.
Further development on sieve
is frozen, and may not be necessary if the new architecture goes through, as the suggested MVCC+postimage scheme filters out non-determinism.
Referred to as noops
in our code, this effectively disables consensus. It is the default mode while the code is in pre-release version. It is used for debugging the rest of the Fabric stack.
- In
peer/core.yaml
set thepeer.validator.consensus.plugin
key to eithernoops
(default) orpbft
.noops
will be used if an incorrect value is given. - If you chose
pbft
in Step 1, inconsensus/obcpbft/config.yaml
set thegeneral.mode
key to eitherclassic
,batch
, orsieve
. As suggested above,batch
is the recommended mode. The rest of the settings inconfig.yaml
allow you to fine-tune the performance the consensus mechanism.
When using the pbft
module, make sure the validators are named sequentially using the vpX
naming scheme, where X
is an integer that starts from 0
and goes to N-1
. For example, with 4 validating peers, you would set the peer.id
keys on your validators to vp0
, vp1
, vp2
, and vp3
. [For those wondering why we do this: every validator in PBFT needs to maintain the same sorted list of validators, so that in a view change from v
to v+1
, all validators point towards the same new primary. Until whitelisting is implemented (see "Roadmap" section below), the vpX
naming scheme is the most effective --although admittedly flaky and arbirtray-- way of doing this on the fly.]
(Listed in order of expected delivery.)
- Validator whitelisting. Every validator should maintain a whitelist of enrollment certificates. If a connecting validator's certificate does not belong to that list, it cannot join the network. This will remove the need for the arbitrary
vpX
naming scheme (see "Naming the validators" section). - Dynamically change the validator set. As things stand now, you cannot expand the validator set size beyond the original value
N
that you set inconsensus/obcpbft/config.yaml
when bootstrapping the network. Likewise, you cannot shrink the validator set size either.
- Modifications to the PBFT protocol (e.g. periodic view-changes)
- The
custodian
mechanism to prevent censorship from primary - Add more Roadmap items and link to Github issues for discussion
- etc.