Skip to content

Implementation of the HotStuff consensus protocol.

License

Notifications You must be signed in to change notification settings

irenemi2/hotstuff

 
 

Repository files navigation

HotStuff

build status test status rustc license

This repo provides a minimal implementation of the 2-chain variant of the HotStuff consensus protocol. The codebase has been designed to be small, efficient, and easy to benchmark and modify. It has not been designed to run in production but uses real cryptography (dalek), networking (tokio), and storage (rocksdb).

Quick Start

HotStuff is written in Rust, but all benchmarking scripts are written in Python and run with Fabric. To deploy and benchmark a testbed of 4 nodes on your local machine, clone the repo and install the python dependencies:

$ git clone https://github.com/asonnino/hotstuff.git
$ cd hotstuff/benchmark
$ pip install -r requirements.txt

You also need to install tmux, which runs all nodes and clients in the background. Finally, run a local benchmark using fabric:

$ fab local

This command may take a long time the first time you run it (compiling rust code in release mode may be slow) and you can customize a number of benchmark parameters in fabfile.py. When the benchmark terminates, it displays a summary of the execution similarly to the one below.

-----------------------------------------
 SUMMARY:
-----------------------------------------
 + CONFIG:
 Committee size: 4 nodes
 Input rate: 1,000 tx/s
 Transaction size: 512 B
 Execution time: 20 s

 Consensus max payloads size: 500 B
 Consensus min block delay: 0 ms
 Mempool max payloads size: 15,000 B
 Mempool min block delay: 0 ms

 + RESULTS:
 Consensus TPS: 966 tx/s
 Consensus BPS: 494,627 B/s
 Consensus latency: 1 ms

 End-to-end TPS: 966 tx/s
 End-to-end BPS: 494,576 B/s
 End-to-end latency: 4 ms
-----------------------------------------

Next Steps

The wiki documents the codebase, explains its architecture and how to read benchmarks' results, and provides a step-by-step tutorial to run benchmarks on Amazon Web Services accross multiple data centers (WAN).

License

This software is licensed as Apache 2.0.

About

Implementation of the HotStuff consensus protocol.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 72.6%
  • Python 27.4%