Network of computers. Clients give computers a value. The computers have to come to a consensus on a value.

Algorithm

image.png

There are 3 roles in this algorithm a single node (computer or network) can be all three roles.

Proposer: Sends the PrepareRequest[n] : n→ proposal number (represents number for latest proposal or highest priority?)

after acceptor response, If majority of ResponseToPrepareRequest[Proposal[n,v] or None] agree on a proposal, v = max(received Proposals).v or if there is no consensus v (new proposed value)

Send AcceptRequest[Proposal[n,v]] to all acceptors

Acceptor: (If n≥ max n in (Received PrepareRequest[n]) → The proposal is new or important? → Sends ResponseToPrepareRequest[Proposal[n,v] or None]: Proposal is the datatype that holds the current consensus value

The majority Proposal that was received from all AcceptRequests is the new accepted Value. Decision[Proposal[n,v]] is sent to all Learners

Learner: Learners’s Accept the new value v if there is a majority is reached of Decision requests with that value

Initial algorithm flow (when there is no consensus)

image.png

Assume 3 nodes which have all the three roles (P- proposer, Acceptor - A, Learner -L). Node 1 initiates prepareRequest and has a value it wants to push and there is no consensus value

  1. prepareRequest [1] is sent from Node 1 P to Node1 A, Node2 A, Node3 A
  2. ResponseToPrepareRequest[None] is sent back to Node1 P from all the As.
  3. Node 1 P sends AcceptRequest[new proposed value] to all acceptors
  4. Acceptors send Decision requests to all Leaners
  5. Learners wait for a majority and accept the new proposed value.