Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

Commit

Permalink
crypto: remove some lingering ed25519-dalek (#821)
Browse files Browse the repository at this point in the history
  • Loading branch information
joyqvq authored Aug 19, 2022
1 parent 52dd0c4 commit f4cab79
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 83 deletions.
67 changes: 5 additions & 62 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
[![Narwhal Rust Crates Documentation (main)](https://img.shields.io/badge/docs-main-0f0)](https://mystenlabs.github.io/narwhal/)
[![codecov](https://codecov.io/gh/MystenLabs/narwhal/branch/main/graph/badge.svg?token=C4bY6ovBlx)](https://codecov.io/gh/MystenLabs/narwhal)

This repo provides an implementation of [Narwhal and Tusk](https://arxiv.org/pdf/2105.11827.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. We're still working on making the project ready for production, but already uses real cryptography ([ed25519-](https://doc.dalek.rs/ed25519_dalek) & other signing schemes), networking ([tokio](https://docs.rs/tokio)), and storage ([rocksdb](https://docs.rs/rocksdb)).
This repo provides an implementation of [Narwhal and Tusk](https://arxiv.org/pdf/2105.11827.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.

This repo uses [fastcrypto](https://github.com/MystenLabs/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](http://www.fabfile.org/).
Expand Down
2 changes: 1 addition & 1 deletion config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ thiserror = "1.0.32"
tracing = "0.1.36"
arc-swap = { version = "1.5.1", features = ["serde"] }

crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "ded6f91c9c19594a3eaeaa9a487d42a39965569e", package = "fastcrypto" }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a9e58305dc463c40b9d357730203406214909f04", package = "fastcrypto" }

workspace-hack = { version = "0.1", path = "../workspace-hack" }
rand = "0.8.5"
Expand Down
3 changes: 1 addition & 2 deletions consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ tokio = { version = "1.20.1", features = ["sync"] }
tracing = "0.1.36"

config = { path = "../config" }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "ded6f91c9c19594a3eaeaa9a487d42a39965569e", package = "fastcrypto" }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a9e58305dc463c40b9d357730203406214909f04", package = "fastcrypto" }
dag = { path = "../dag" }
prometheus = "0.13.1"
types = { path = "../types" }
Expand All @@ -29,7 +29,6 @@ cfg-if = "1.0.0"
[dev-dependencies]
bincode = "1.3.3"
criterion = "0.3.6"
ed25519-dalek = { version = "1.0.1", features = ["batch", "serde"] }
futures = "0.3.23"
indexmap = { version = "1.9.1", features = ["serde"] }
test_utils = { path = "../test_utils" }
Expand Down
2 changes: 1 addition & 1 deletion dag/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"

[dependencies]
arc-swap = "1.5.1"
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "ded6f91c9c19594a3eaeaa9a487d42a39965569e", package = "fastcrypto" }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a9e58305dc463c40b9d357730203406214909f04", package = "fastcrypto" }
dashmap = "5.3.4"
either = "1.7.0"
itertools = "0.10.3"
Expand Down
2 changes: 1 addition & 1 deletion executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ blake2 = "0.9"
bytes = "1.2.1"
config = { path = "../config" }
consensus = { path = "../consensus" }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "ded6f91c9c19594a3eaeaa9a487d42a39965569e", package = "fastcrypto" }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a9e58305dc463c40b9d357730203406214909f04", package = "fastcrypto" }
futures = "0.3.23"
multiaddr = "0.14.0"
primary = { path = "../primary" }
Expand Down
2 changes: 1 addition & 1 deletion network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ publish = false
async-trait = "0.1.57"
backoff = { version = "0.4.0", features = ["tokio"] }
bytes = "1.2.1"
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "ded6f91c9c19594a3eaeaa9a487d42a39965569e", package = "fastcrypto" }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a9e58305dc463c40b9d357730203406214909f04", package = "fastcrypto" }
futures = "0.3.23"
multiaddr = "0.14.0"
prometheus = "0.13.1"
Expand Down
3 changes: 1 addition & 2 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ axum = "0.5.15"

config = { path = "../config" }
consensus = { path = "../consensus" }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "ded6f91c9c19594a3eaeaa9a487d42a39965569e", package = "fastcrypto" }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a9e58305dc463c40b9d357730203406214909f04", package = "fastcrypto" }
executor = { path = "../executor" }
network = { path = "../network" }
primary = { path = "../primary" }
Expand All @@ -42,7 +42,6 @@ workspace-hack = { version = "0.1", path = "../workspace-hack" }
eyre = "0.6.8"

[dev-dependencies]
ed25519-dalek = "1.0.1"
hex = "0.4.3"
pretty_assertions = "1.2.1"
serde-reflection = "0.3.6"
Expand Down
2 changes: 1 addition & 1 deletion primary/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ tracing = "0.1.36"
tap = "1.0.1"

consensus = { path = "../consensus" }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "ded6f91c9c19594a3eaeaa9a487d42a39965569e", package = "fastcrypto" }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a9e58305dc463c40b9d357730203406214909f04", package = "fastcrypto" }
network = { path = "../network" }
types = { path = "../types" }
mysten-network = { git = "https://github.com/mystenlabs/mysten-infra.git", rev = "8d090689be14078f2ca41c356e7bbc0af21f73ab" }
Expand Down
2 changes: 1 addition & 1 deletion test_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tonic = "0.7.2"
tracing = "0.1.36"

config = { path = "../config" }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "ded6f91c9c19594a3eaeaa9a487d42a39965569e", package = "fastcrypto", features = ["copy_key"] }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a9e58305dc463c40b9d357730203406214909f04", package = "fastcrypto", features = ["copy_key"] }
executor = { path = "../executor" }
node = { path = "../node" }
primary = { path = "../primary" }
Expand Down
2 changes: 1 addition & 1 deletion types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ tokio-util = { version = "0.7.3", features = ["codec"] }
tonic = { version = "0.7.2", features = ["tls"] }

config = { path = "../config" }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "ded6f91c9c19594a3eaeaa9a487d42a39965569e", package = "fastcrypto" }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a9e58305dc463c40b9d357730203406214909f04", package = "fastcrypto" }
dag = { path = "../dag" }
workspace-hack = { version = "0.1", path = "../workspace-hack" }

Expand Down
2 changes: 1 addition & 1 deletion worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tower = "0.4.13"
tracing = "0.1.36"

config = { path = "../config" }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "ded6f91c9c19594a3eaeaa9a487d42a39965569e", package = "fastcrypto" }
crypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a9e58305dc463c40b9d357730203406214909f04", package = "fastcrypto" }
network = { path = "../network" }
primary = { path = "../primary" }
types = { path = "../types" }
Expand Down
12 changes: 4 additions & 8 deletions workspace-hack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ crypto-common = { version = "0.1", default-features = false, features = ["std"]
crypto-mac = { version = "0.8", default-features = false, features = ["std"] }
csv = { version = "1", default-features = false }
csv-core = { version = "0.1" }
curve25519-dalek = { version = "3", default-features = false, features = ["alloc", "std", "u64_backend"] }
curve25519-dalek-ng = { version = "4", features = ["alloc", "serde", "std", "u64_backend"] }
dashmap = { version = "5", default-features = false }
data-encoding = { version = "2", features = ["alloc", "std"] }
Expand All @@ -97,14 +96,12 @@ digest-93f6ce9d446188ac = { package = "digest", version = "0.10", features = ["a
digest-274715c4dabd11b0 = { package = "digest", version = "0.9", default-features = false, features = ["alloc", "std"] }
downcast = { version = "0.11", features = ["std"] }
ecdsa = { version = "0.14", default-features = false, features = ["alloc", "arithmetic", "der", "digest", "hazmat", "pkcs8", "rfc6979", "sign", "std", "verify"] }
ed25519 = { version = "1", default-features = false, features = ["serde", "std"] }
ed25519-consensus = { version = "2", features = ["serde", "std", "thiserror"] }
ed25519-dalek = { version = "1", features = ["batch", "merlin", "rand", "serde", "serde_bytes", "serde_crate", "std", "u64_backend"] }
either = { version = "1", features = ["use_std"] }
elliptic-curve = { version = "0.12", default-features = false, features = ["alloc", "arithmetic", "digest", "ff", "group", "hazmat", "pkcs8", "sec1", "std"] }
env_logger = { version = "0.9", features = ["atty", "humantime", "regex", "termcolor"] }
eyre = { version = "0.6", features = ["auto-install", "track-caller"] }
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "ded6f91c9c19594a3eaeaa9a487d42a39965569e", features = ["copy_key"] }
fastcrypto = { git = "https://github.com/MystenLabs/fastcrypto", rev = "a9e58305dc463c40b9d357730203406214909f04", features = ["copy_key"] }
fastrand = { version = "1", default-features = false }
fdlimit = { version = "0.2", default-features = false }
ff = { version = "0.12", default-features = false }
Expand Down Expand Up @@ -167,8 +164,7 @@ matches = { version = "0.1", default-features = false }
matchit = { version = "0.5" }
memchr = { version = "2", features = ["std"] }
memoffset = { version = "0.6" }
merlin-f595c2ba2a3f28df = { package = "merlin", version = "2", default-features = false }
merlin-7b89eefb6aaa9bf3 = { package = "merlin", version = "3", features = ["std"] }
merlin = { version = "3", features = ["std"] }
mime = { version = "0.3", default-features = false }
miniz_oxide = { version = "0.5", default-features = false }
mio = { version = "0.8", features = ["net", "os-ext", "os-poll"] }
Expand Down Expand Up @@ -251,7 +247,7 @@ serde_urlencoded = { version = "0.7", default-features = false }
serde_with = { version = "2", features = ["alloc", "macros", "std"] }
serde_yaml = { version = "0.8", default-features = false }
sha2-93f6ce9d446188ac = { package = "sha2", version = "0.10", default-features = false }
sha2-274715c4dabd11b0 = { package = "sha2", version = "0.9", default-features = false, features = ["std"] }
sha2-274715c4dabd11b0 = { package = "sha2", version = "0.9", default-features = false }
sha3-93f6ce9d446188ac = { package = "sha3", version = "0.10", features = ["std"] }
sha3-274715c4dabd11b0 = { package = "sha3", version = "0.9", default-features = false }
sharded-slab = { version = "0.1", default-features = false }
Expand All @@ -265,7 +261,7 @@ static_assertions = { version = "1", default-features = false }
strsim-93f6ce9d446188ac = { package = "strsim", version = "0.10", default-features = false }
strsim-c38e5c1d305a1b54 = { package = "strsim", version = "0.8", default-features = false }
structopt = { version = "0.3" }
subtle = { version = "2", default-features = false, features = ["i128", "std"] }
subtle = { version = "2", default-features = false, features = ["i128"] }
subtle-ng = { version = "2", default-features = false, features = ["std"] }
sync_wrapper = { version = "0.1", default-features = false }
tap = { version = "1", default-features = false }
Expand Down

1 comment on commit f4cab79

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bench results

�[92mStarting local benchmark�[0m
Setting up testbed...
About to run ['cargo', 'build', '--quiet', '--release', '--features', 'benchmark']...
Running benchmark (20 sec)...
Parsing logs...

�[1m�[91mERROR�[0m: Failed to run benchmark

Caused by:
0: <class 'benchmark.logs.ParseError'>
1: Primary(s) panicked

PR to merge f4cab79 ->

Please sign in to comment.