Basic Properties of Consensus Protocols
Learn about the consensus problem and its properties in this lesson.
Introduction
Any system model includes a collection of processes and communication by message passing. An important requirement of the model is to reach a consensus even in the presence of faults. We assume that communication is reliable (cf. this definition
Consensus problem
In order to reach consensus, every process begins in the undecided state and proposes a single value , . Then, the processes communicate with each other, exchange values, and engage in a consensus algorithm or consensus protocol. Each process then sets the value of a decision variable , entering the decided state in which it may no longer change.
Properties of a consensus protocol
A consensus protocol has the following properties which determine its applicability and efficiency.
- Safety: A consensus protocol is determined to be safe if all processes produce the same output and the outputs produced by the processes are valid according to the rules of the protocol. This is also referred to as the consistency of the shared state.
- Liveness: A consensus protocol guarantees liveness if all non-faulty processes participating in consensus eventually produce a value.
- Fault tolerance: A consensus protocol provides fault tolerance if it can recover from the failure of a process participating in consensus.
Note: The CAP theorem (cf. this lesson) states that it’s impossible to achieve both safety and liveness in an unreliable system.
As we will see in the following, the FLP impossibility result states that although all three properties are crucial for a consensus protocol, it is impossible to construct deterministic consensus protocols which can ensure safety, liveness, and fault tolerance in an asynchronous system. This means that any distributed consensus system, especially on the Internet, cannot have all three features, thus it must sacrifice one of them. According to Baliga, the following statement holds:
“While fault tolerance is crucial for globally distributed networks to operate, distributed systems tend to choose between safety and liveness depending on their system requirements and assumptions”.
Note that this statement corresponds to our the statement where we determined that the only two reasonable approaches when dealing with unreliable networks are to sacrifice availability or to sacrifice consistency.
The problem of processes being able to reach an agreement on a value has been formalized as the agreement or consensus problem and is often formally defined through properties like the following (
Get hands-on with 1200+ tech skills courses.