Code Monkey home page Code Monkey logo

narwhal's Introduction

Narwhal and Tusk

build status rustc license Narwhal Rust Crates Documentation (main) codecov

This repo provides an implementation of Narwhal and Tusk, a DAG-based mempool and efficient BFT consensus. The codebase has been designed to be small, efficient, and easy to benchmark and modify.

This repo uses fastcrypto as its cryptography library.

Quick Start

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

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

You also need to install Clang (required by RocksDB) and 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. It is then recommended to have a look at the README files of the worker and primary crates. An additional resource to better understand the Tusk consensus protocol is the paper All You Need is DAG as it describes a similar protocol.

The README file of the benchmark folder 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) across multiple data centers (WAN).

License

This software is licensed as Apache 2.0.

narwhal's People

Contributors

huitseeker avatar dependabot[bot] avatar akichidis avatar bmwill avatar asonnino avatar joyqvq avatar arun-koshy avatar punwai avatar allan-bailey avatar velvia avatar mwtian avatar lavindir avatar lxfind avatar clay-mysten avatar aschran avatar mystenmark avatar gdanezis avatar kchalkias avatar aakoshh avatar andll avatar sadhansood avatar brad-mysten avatar

Stargazers

Roman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.