The Paxos blockchain simulation is a proof of concept made as part of a bachelor thesis. It was made to show the functionality of the Paxos algorithm based on the article The Part-Time Parliament, by Leslie Lamport.
- Dotnet core 2.1.1 or newer.
- Follow the official dotnet core installation guide here.
- Clone this repository.
- Using the command line, move to PaxosBlockchainSimulation/ of the cloned repository, and execute:
dotnet add package Microsoft.EntityFrameworkCore.Sqlite
to install the Microsoft SQL database provider. You can use any other database provider. You can find them here. - Subsequently, run
dotnet add package Microsoft.EntityFrameworkCore.Design
. - Subsequently, run 'dotnet add package System.IO.Ports'.
- Next, add the following to
PaxosBlockchainSimulation.csproj
(with version being the dotnet version installed):
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="2.0.2" />
</ItemGroup>
- Run
dotnet restore
- Execute
dotnet run
from the command line to run the application.
There are some known issues and optional improvements. Some are covered in the addendum. Others are explained here
- On automating three nodes, the application came to a halt about two times around 4500 decrees. It seemed that the applications didn't crash, but instead slowed down an incredible amount (perhaps exponentially?). More details can be viewed on adding timestamps for each decree on reaching agreement.
- Retrying ballot with a higher ballot id. (See Part Time Parliament, Page 13, end of parahraph 2. Code is in: Proposer.ReceiveNewerBallotNumber())
- No proper way of maintaining immutability, aside from SQL triggers (which does not prevent anyone from inserting new data).
- Participation and authorisation of the network. The network information is kept in a text file on each node (this includes endpoints for every node).
- At the moment, only LAN is supported.
- With entity framework/sqlite, receiving a high number of success messages could not be processed, so some are skipped or lost. Using a different database might solve this issue, or the solution lies somewhere else.
- With the multi-decree protocol, the prevVotes[p] group is static, but the quorum is dynamic. Research must be conducted on how consensus can be reached safely after a president has been assigned AND it finished all of its initial tasks.
- Applying a state machine, instead of reaching consensus over just a log of strings.
- Combining multiple messages into one (See end of 3.2.2 in Part-Time Parliament)
- Implementing the Paxos additions covered in the Part-Time Parliament
- Implementing/researching the further Paxos articles written by Leslie Lamport
- Do research on Microsoft's CoCo framework's implementation on Paxos.
- Find a way to implement Byzantine Fault Tolerance