forked from facebookresearch/narwhal
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request facebookresearch#22 from facebookresearch/revert-1…
…8-narwhal-hs Revert "HotStuff on Steroids"
- Loading branch information
Showing
41 changed files
with
112 additions
and
2,929 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[workspace] | ||
members = ["primary", "node", "store", "crypto", "worker", "consensus", "network", "config", "hotstuff"] | ||
members = ["primary", "node", "store", "crypto", "worker", "consensus", "network", "config"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,60 @@ | ||
# Narwhal HotStuff | ||
# Narwhal and Tusk | ||
|
||
[![build status](https://img.shields.io/github/workflow/status/facebookresearch/narwhal/Rust/master?style=flat-square&logo=github)](https://github.com/facebookresearch/narwhal/actions) | ||
[![rustc](https://img.shields.io/badge/rustc-1.51+-blue?style=flat-square&logo=rust)](https://www.rust-lang.org) | ||
[![license](https://img.shields.io/badge/license-Apache-blue.svg?style=flat-square)](LICENSE) | ||
|
||
The code in this branch is a prototype of Narwhal HotStuff (Hotstuff-over-Narwhal). It supplements the paper [Narwhal and Tusk: A DAG-based Mempool and Efficient BFT Consensus](https://arxiv.org/pdf/2105.11827.pdf) enabling reproducible results. There are no plans to maintain this branch. The [master branch](https://github.com/asonnino/narwhal) contains the most recent and polished version of this codebase. | ||
This repo provides an implementation of [Narwhal and Tusk](https://arxiv.org/pdf/2105.11827.pdf). 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](https://doc.dalek.rs/ed25519_dalek)), networking ([tokio](https://docs.rs/tokio)), and storage ([rocksdb](https://docs.rs/rocksdb)). | ||
|
||
## Quick Start | ||
The core protocols are written in Rust, but all benchmarking scripts are written in Python and run with [Fabric](http://www.fabfile.org/). | ||
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/facebookresearch/narwhal.git | ||
$ cd narwhal/benchmark | ||
$ pip install -r requirements.txt | ||
``` | ||
You also need to install Clang (required by rocksdb) and [tmux](https://linuxize.com/post/getting-started-with-tmux/#installing-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: | ||
Faults: 0 node(s) | ||
Committee size: 4 node(s) | ||
Worker(s) per node: 1 worker(s) | ||
Collocate primary and workers: True | ||
Input rate: 50,000 tx/s | ||
Transaction size: 512 B | ||
Execution time: 19 s | ||
Header size: 1,000 B | ||
Max header delay: 100 ms | ||
GC depth: 50 round(s) | ||
Sync retry delay: 10,000 ms | ||
Sync retry nodes: 3 node(s) | ||
batch size: 500,000 B | ||
Max batch delay: 100 ms | ||
+ RESULTS: | ||
Consensus TPS: 46,478 tx/s | ||
Consensus BPS: 23,796,531 B/s | ||
Consensus latency: 464 ms | ||
End-to-end TPS: 46,149 tx/s | ||
End-to-end BPS: 23,628,541 B/s | ||
End-to-end latency: 557 ms | ||
----------------------------------------- | ||
``` | ||
|
||
## Next Steps | ||
The next step is to read the paper [Narwhal and Tusk: A DAG-based Mempool and Efficient BFT Consensus](https://arxiv.org/pdf/2105.11827.pdf). It is then recommended to have a look at the README files of the [worker](https://github.com/facebookresearch/narwhal/tree/master/worker) and [primary](https://github.com/facebookresearch/narwhal/tree/master/primary) crates. An additional resource to better understand the Tusk consensus protocol is the paper [All You Need is DAG](https://arxiv.org/abs/2102.08325) as it describes a similar protocol. | ||
|
||
The README file of the [benchmark folder](https://github.com/facebookresearch/narwhal/tree/master/benchmark) explains how to benchmark the codebase and read benchmarks' results. It also provides a step-by-step tutorial to run benchmarks on [Amazon Web Services (AWS)](https://aws.amazon.com) accross multiple data centers (WAN). | ||
|
||
## License | ||
This software is licensed as [Apache 2.0](LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.