created_at2016-04-06 04:00:11.720757
updated_at2020-11-23 14:43:44.058521
descriptionImplementation of Protocol for Asynchronous, Reliable, Secure and Efficient Consensus
MaidSafe-QA (MaidSafe-QA)



PARSEC - Protocol for Asynchronous, Reliable, Secure and Efficient Consensus

Crate Documentation Linux/macOS Windows Issues
Documentation Build Status Build status Stories in Ready
MaidSafe website SAFE Dev Forum SAFE Network Forum


There is a basic example available in the examples folder. This allows you to simulate a network of peers each running the Parsec protocol to reach consensus on a number of random network events. There is also the ability to dump each peer's gossip graph in dot format to a file in your system temp dir. This can be enabled via the feature dump-graphs. So, e.g. to run the example for a network of five peers and ten network events:

cargo run --release --example=basic --features=mock,dump-graphs -- --initial-peers=5 --opaque=10

If you have dot from graphviz available in your path, then SVG graphs will also have been generated from each of these dot files. If not, you can copy the contents of a generated dot file into an online converter (e.g. to view the gossip graph.

Detailed tutorial

If the instructions in the overview are a bit sparse for your taste, please refer to the tutorial for a step-by-step guide.

Implementation status:

Features already implemented

  • Initial implementation of PARSEC
    • Demonstrates working consensus in a static network of peers
  • Integration tests
    • Simple tests show consensus being reached in a network of small size, with all nodes simulated in a single thread
    • Data is randomly generated to allow for soak testing
    • Soak testing has been performed for tens of thousands of run without errors
  • Generation of graphs
    • With the feature: dump-graphs, a dot representation of all network communications is output
    • The graphs are snapshots at the time each consensus decision is taken (one graph per node per consensus decision)
    • The graphs are annotated with details of the PARSEC protocol that explain how consensus was ultimately reached
    • An image (for instance .svg) can be obtained from the dot representation using dot
  • Reproducibility
    • In case of test failure, a seed is output. That seed can be used to reproduce the failing scenario, which helps investigate the potential issue
  • Simple example
    • A simple example was created to allow testing various scenarios
    • The number of peers, number of votes etc. can be configured by command line arguments
  • Initial documentation
    • Early documentation of the API is available here

Upcoming features

  • Foolproof handling of malice
    • Handle forks (one node sends more than one event with the same self_parent)
    • Double voting (one node votes more than once for the same network event)
    • Detection of malicious behaviour, resulting in consensus on excluding the offending peer
  • Performance
    • Benchmark and optimise the code
    • Perform measurements of Transactions Per Second in simulated network
      • Use setup that can be compared with competing consensus protocols
  • Extensive tests
    • Implement extensive tests that simulate adversarial scenarios to prove robustness outside of the "happy path"
  • Extensive documentation
    • Documentation will be made comprehensive
  • Dynamic network membership


Licensed under the General Public License (GPL), version 3 (LICENSE

Linking exception

Parsec is licensed under GPLv3 with linking exception. This means you can link to and use the library from any program, proprietary or open source; paid or gratis. However, if you modify parsec, you must distribute the source to your modified version under the terms of the GPLv3.

See the LICENSE file for more details.


Want to contribute? Great :tada:

There are many ways to give back to the project, whether it be writing new code, fixing bugs, or just reporting errors. All forms of contributions are encouraged!

For instructions on how to contribute, see our Guide to contributing.

Commit count: 0

cargo fmt