Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srghma/b452b50124708badd533dd7fc6c7d813 to your computer and use it in GitHub Desktop.
Save srghma/b452b50124708badd533dd7fc6c7d813 to your computer and use it in GitHub Desktop.
pBFT— Understanding the Consensus Algorithm

download

(1) request: the client sends a request to the master node.

(2) pre-prepared: The master node receives the request from the client and needs to verify whether the signature of the client request message is correct. If correct, a pre-prepare message is broadcast to other replica nodes.

(3) prepared: the replica node receives the pre-prepare message from the master node and carries out verification. If correct, the replica node sends a prepare message to other nodes, including the primary.

(4) committed: the master node and the replica node receive the prepare message and carry out the verification. If the replica node receives a 2f + 1 verified prepare message indicating that most nodes in the network have received the consent message, a commit message is sent to other nodes, including the primary.

(5) reply: the master node and the replica node receive the commit message. If the replica node receives 2f + 1 verified commit messages, it indicates that most nodes in the current network have reached a consensus.

If the master node drops calls or does not broadcast the client request, the client sets a timeout mechanism that broad- casts the request message to all replica nodes. The replica node detects that the master node has committed a crime or is offline and initiates the view rotation protocol.  View change: the node receives 2f + 1 view change messages with the same block number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment