Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PBFT consensus #112

Merged
merged 18 commits into from
Sep 6, 2023
Merged

PBFT consensus #112

merged 18 commits into from
Sep 6, 2023

Conversation

Maelkum
Copy link
Contributor

@Maelkum Maelkum commented Sep 6, 2023

This PR adds support for PBFT consensus to b7s node.

* Message types are implicit

* Some semblence of a pBFT cluster

* Add execution, sending response to orign, and handle messages on the "b7s" protocol

* Ensure execution is done only once

* Add check that incoming messages are in the correct view

* Add state locking

* Broadcast is concurrent and network operations are limited in duration

* Add state locking for general Blockless protocol too
* WIP: View change initialization (sending)

* Processing view change messages (starting view change if condition met)

* Adding a new-view message with valid preprepares

* Handling new view message

* Small tweaks and comment updates

* Determine which messages are allowed in which stage at a single place

* Minor tweaks to request and preprepare handling

* Ensure requests are executed in order (sequence number accounting) + minor tweaks (accounting commits)

* View change/New view logging tweaks

* Splitting commit function into two

* Use 'AfterFunc' for view change instead of timer

* Fix stopping a timer thats not running + broadcast error handling

* Fix commit quorum condition

* Fix log message for not sending a commit

* Fix log message if the request has already been executed

* Logging tweaks - decrease log levels and remove redundant log messages

* Code for byzantine replica plus few small improvements/fixes

* Fix new view preprepare set (starting from 1) + fix JSON handling of new-view/view-change

* Add serialization/deserialization code for message types

* Tidy up marshallers/unmarshallers

* Checking if request is commit-able after a preprepare

* Cache past executions + cleanup old state after transition to a new view

* New primary resubmits request that it received but havent been executed yet

* Delayed view change messages AFTER we successfully transitioned to a new view are no-op

* Several fixes related to view changes

- new primary records the generated preprepares
- sequence number check corrected
- checking for prepared requests corrected

* Introducing PBFT as a consensus option for execution requests (#104)

* Plucking out raft from the "node" package

* FormCluster message specifies the type of consensus expected

* Fix bootstrap check on new Raft cluster

* Minor tweaks, raft returns a multierror on shutdown errors

* Add support for PBFT consensus to node execution

* PBFT replica no longer listens on the Blockless general protocol (only PBFT specific protocol)

* Rename Raft handler => replica

* File rename and const rename

* Tweak how we treat execution requests on the worker node

* Refactor roll call/cluster formation

* Remove mentions of a "quorum" in node code since its imprecise

* PBFT uses a cluster-specific protocol for messaging
- signature marshalling
- timestamp fixed - set by the head node
@Maelkum Maelkum requested a review from dmikey September 6, 2023 11:08
@Maelkum Maelkum self-assigned this Sep 6, 2023
@dmikey dmikey merged commit c03db43 into main Sep 6, 2023
@dmikey dmikey deleted the pbft-consensus branch September 11, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants