Ashna PS


BiniBFT - An Optimized BFT on Fabric

 

Evaluation 2 - Report

Submitted By: Ashna P S

 

 

Collaborative Learning Program

Engagement Details

 

 


Name of Mentee

Ashna P S

Evaluation Period

12-08-2023 to 07-10-2023

Task

Comparative Study of BFT Protocols

Date Submitted

09-11-2023

Mentor

Dr. Anasuya Threse Innocent

Tasks, Objectives, and Results

This Evaluation report consolidates the candidate’s work for Hyperledger CLP - BiniBFT project by BiniWorld Innovations Pvt Ltd during the internship (Weeks 6-12). The report has been categorized into two sections: outline the key task assigned to the candidate and day-to-day activities undertaken by the candidate.

Key Outline of the Task assigned to the candidate (This includes Project name, Problem statement, expected Output and other relevant details) 

Comparing Consensus Protocol in Hyperledger Fabric


 pBFT:

  • The algorithm consists of 2 phases, and each phase consists of 2 sub-phases.
  • Two-phase commit algorithm, coupled with Lamport’s timestamp with a simple majority for a proposal to be accepted.


  • Phase 1 (P1) :-
    • Proposal Sub-phase (P1A)
      • Proposer suggests a value to all acceptor nodes.
      • Proposal message includes a Lamport timestamp (n) larger than any previous timestamp by the proposer.
    • Voting Sub-phase (P1B)
      • Acceptor nodes vote for/against the proposed value.
      • If n+1 nodes out of 2n+1 vote for the proposal, a quorum is achieved, and the proposal is accepted.
      • Acceptors promise not to accept competing proposals with lower Lamport timestamps.
      • Acceptors can suggest values with their voting messages for the proposer's consideration.
  • Phase 2 (P2) :-
    • Commit Propagation (P2A)
      • Proposer informs the quorum of acceptors about preliminary quorum achievement, requesting final confirmation.
      • If acceptors suggested a range of values in P1B, proposer can select one from that range.
    • Commit Acknowledgement (P2B)
      • Acceptors in the quorum verify if the proposer still holds the latest timestamp from Phase-1B.
      • Send Ack messages to the proposer and learner nodes.
      • Unlike 2PC, in Paxos, acceptors might have voted for newer proposals, not just the one promised at P1B, hence the difference in acknowledgments.


BDLS

The BDLS protocol based on the original DLS protocol. Blockchain version of DLS (BDLS).

DLS protocol leverages a star network where participants only exchange messages via round leaders.

  1. Based on the analysis of BFT security requirements for partial synchronous networks, this is a BFT protocol BDLS and proves its security.
  2. Achieves consensus with both reduced round complexity and reduced communication complexity.
  3. BDLS could achieve consensus in 4 steps on a contrary of 7 of steps of other protocols.
  4. Finality Gadget.

Working:

Consider a decentralized system with n participants and a threshold of t participants. The protocol operates in rounds and at heights, where each height corresponds to a set of blocks being considered for consensus.(8 steps)

  1. At the start of each round (r) of a height (h), each participant (Pj) sends a signed message to the leader (Pi) including its maximal acceptable candidate block (B0j) for that round. This message is considered a "round-change" message.
  2. If Pi receives at least 2t+1 round-change messages, including its own, it enters round r. If there are at least 2t+1 round-change messages from 2t+1 participants that include the same candidate block, Pi broadcasts a signed message with the block and a proof of the consensus to all participants. If there is no such block, Pi selects the candidate block with the highest value and broadcasts a signed message with the selected block and a proof of the consensus.
  3. If a participant (Pj) receives a "select" or "lock" message from Pi, it adds the block to its local set of blocks and sends a "commit" message to Pi.
  4. If Pi receives at least 2t+1 "commit" messages, it decides on the block and broadcasts a "decide" message to all participants.
  5. If a participant (Pj) receives a "decide" message or from its neighbor, it decides on the block and moves to the next height. Otherwise, it broadcasts its locked values and moves to the next round.
  6. Height synchronization: At any time during the protocol, if Pj receives a finalized block of height h, it decides for height h and moves to height h+1.
  7. Round synchronization: At any time during the protocol, if Pj receives a message for a round r0 > r, it moves to round r0 and processes the message.
  8. Timeout: Each step includes a timeout counter. If Pj does not receive enough messages to move forward before the timeout expires, it moves to the next step.


Zyzzyva Protocol:

Zyzzyva is a protocol used in distributed systems to ensure consistency and reliability of data stored on multiple nodes.

It is used to implement state machine replication, where a set of nodes (replicas) work together to maintain a consistent view of a shared state

Without 3-phase commit Clients use history and replies to detect inconsistencies

Clients wait until history and speculative reply are stable to complete the request.

Zyzzyva is a state machine replication protocol executed by 3f + 1 replicas and based on three subprotocols: 

  • Agreement: The agreement subprotocol orders requests for execution by the replicas and operates within a sequence of views, where a single replica is designated as the primary and is responsible for leading the agreement subprotocol.
  • View Change: The view change subprotocol coordinates the election of a new primary when the current primary is faulty or the system is running slowly.
  • Checkpoint:  The checkpoint subprotocol limits the state that must be stored by replicas and reduces the cost of performing view changes.