{"id":13511333,"url":"https://github.com/MystenLabs/narwhal","last_synced_at":"2025-03-30T20:33:01.792Z","repository":{"id":37076808,"uuid":"423635889","full_name":"MystenLabs/narwhal","owner":"MystenLabs","description":"Narwhal \u0026 Tusk are a high throughput mempool \u0026 consensus, used in the Sui smart contract platform","archived":true,"fork":false,"pushed_at":"2022-10-17T13:49:58.000Z","size":52740,"stargazers_count":156,"open_issues_count":0,"forks_count":67,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-11-01T13:34:34.016Z","etag":null,"topics":["consensus","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MystenLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2021-11-01T22:35:11.000Z","updated_at":"2024-10-09T01:47:14.000Z","dependencies_parsed_at":"2023-01-19T10:45:38.921Z","dependency_job_id":null,"html_url":"https://github.com/MystenLabs/narwhal","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MystenLabs%2Fnarwhal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MystenLabs%2Fnarwhal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MystenLabs%2Fnarwhal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MystenLabs%2Fnarwhal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MystenLabs","download_url":"https://codeload.github.com/MystenLabs/narwhal/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246379366,"owners_count":20767694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["consensus","rust"],"created_at":"2024-08-01T03:00:47.570Z","updated_at":"2025-03-30T20:33:00.174Z","avatar_url":"https://github.com/MystenLabs.png","language":"Rust","funding_links":[],"categories":["General-Purpose Consensus"],"sub_categories":[],"readme":"# Narwhal development now happens at https://github.com/MystenLabs/sui/tree/main/narwhal\n\nFor Narwhal (and Bullshark / Tusk) users: Narwhal (together with Bullshark and Tusk) still exists as an independent project. We will be periodically publishing Narwhal packages to `crates.io`.\n\nFor Narwhal (and Bullshark / Tusk) contributors: to consolidate infrastructure and iterate faster, the latest development of Narwhal will happen in the [Sui repo](https://github.com/MystenLabs/sui/tree/main/narwhal). Please open your PRs and issues over there. Appreciate the contributions!\n\n# Narwhal\n\n[![build status](https://img.shields.io/github/workflow/status/mystenlabs/narwhal/Rust/main?style=flat-square\u0026logo=github)](https://github.com/mystenlabs/narwhal/actions)\n[![rustc](https://img.shields.io/badge/rustc-1.62+-blue?style=flat-square\u0026logo=rust)](https://www.rust-lang.org)\n[![license](https://img.shields.io/badge/license-Apache-blue.svg?style=flat-square)](LICENSE)\n[![Narwhal Rust Crates Documentation (main)](https://img.shields.io/badge/docs-main-0f0)](https://mystenlabs.github.io/narwhal/)\n[![codecov](https://codecov.io/gh/MystenLabs/narwhal/branch/main/graph/badge.svg?token=C4bY6ovBlx)](https://codecov.io/gh/MystenLabs/narwhal)\n\nThis repo provides an implementation of [Narwhal, Tusk](https://arxiv.org/pdf/2105.11827.pdf) and [partially synchronous Bullshark](https://arxiv.org/pdf/2209.05633.pdf), a [DAG](https://en.wikipedia.org/wiki/Directed_acyclic_graph)-based mempool and efficient [BFT](https://en.wikipedia.org/wiki/Byzantine_fault) consensus. The codebase has been designed to be small, efficient, and easy to benchmark and modify.\n\nThis repo uses [fastcrypto](https://github.com/MystenLabs/fastcrypto) as its cryptography library.\n\n## Quick Start\nThe core protocols are written in Rust, but all benchmarking scripts are written in Python and run with [Fabric](http://www.fabfile.org/).\nTo deploy and benchmark a testbed of four nodes on your local machine, clone the repo and install the python dependencies:\n```\n$ git clone https://github.com/mystenlabs/narwhal.git\n$ cd narwhal/benchmark\n$ pip install -r requirements.txt\n```\nYou also need to install [Clang](https://clang.llvm.org/) (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](http://www.fabfile.org/):\n```\n$ fab local\n```\nThis 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](https://github.com/mystenlabs/narwhal/blob/main/benchmark/fabfile.py). When the benchmark terminates, it displays a summary of the execution similarly to the one below.\n```\n-----------------------------------------\n SUMMARY:\n-----------------------------------------\n + CONFIG:\n Faults: 0 node(s)\n Committee size: 4 node(s)\n Worker(s) per node: 1 worker(s)\n Collocate primary and workers: True\n Input rate: 50,000 tx/s\n Transaction size: 512 B\n Execution time: 19 s\n\n Header size: 1,000 B\n Max header delay: 100 ms\n GC depth: 50 round(s)\n Sync retry delay: 10,000 ms\n Sync retry nodes: 3 node(s)\n batch size: 500,000 B\n Max batch delay: 100 ms\n\n + RESULTS:\n Consensus TPS: 46,478 tx/s\n Consensus BPS: 23,796,531 B/s\n Consensus latency: 464 ms\n\n End-to-end TPS: 46,149 tx/s\n End-to-end BPS: 23,628,541 B/s\n End-to-end latency: 557 ms\n-----------------------------------------\n```\n\n## Next Steps\nThe 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/mystenlabs/narwhal/tree/main/worker) and [primary](https://github.com/mystenlabs/narwhal/tree/main/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.\n\nThe README file of the [benchmark folder](https://github.com/mystenlabs/narwhal/tree/main/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) across multiple data centers (WAN).\n\n## License\nThis software is licensed as [Apache 2.0](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMystenLabs%2Fnarwhal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMystenLabs%2Fnarwhal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMystenLabs%2Fnarwhal/lists"}