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

Commit 5f4b7d3

Browse files
authored
Add narwhal- prefix to narwhal package names (#1025)
Closes #757 This makes filtering by narwhal package names easier. Also if we place Narwhal packages along with other packages, we would like to have non-ambiguous package and matching directory names. Adding narwhal- instead of narwhal_ prefix to match the style in Sui.
1 parent 5407c7d commit 5f4b7d3

File tree

26 files changed

+498
-484
lines changed

26 files changed

+498
-484
lines changed

Cargo.lock

Lines changed: 401 additions & 401 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "config"
2+
name = "narwhal-config"
33
version = "0.1.0"
44
license = "Apache-2.0"
55
authors = ["Mysten Labs <build@mystenlabs.com>"]
@@ -16,7 +16,7 @@ tracing = "0.1.36"
1616
arc-swap = { version = "1.5.1", features = ["serde"] }
1717

1818
fastcrypto = "0.1.2"
19-
crypto = { path = "../crypto" }
19+
crypto = { path = "../crypto", package = "narwhal-crypto" }
2020
workspace-hack = { version = "0.1", path = "../workspace-hack" }
2121
rand = "0.8.5"
2222

@@ -26,4 +26,4 @@ rand = "0.8.5"
2626
tempfile = "3.3.0"
2727
tracing-test = "0.2.3"
2828

29-
test_utils = { path = "../test_utils" }
29+
test_utils = { path = "../test_utils", package = "narwhal-test-utils" }

config/tests/config_tests.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use config::{ConsensusAPIGrpcParameters, Import, Parameters, PrometheusMetricsPa
2222
use crypto::PublicKey;
2323
use insta::assert_json_snapshot;
2424
use multiaddr::Multiaddr;
25+
use narwhal_config as config;
2526
use rand::{rngs::StdRng, seq::SliceRandom, SeedableRng};
2627
use std::{
2728
collections::{BTreeMap, HashMap},

consensus/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "consensus"
2+
name = "narwhal-consensus"
33
version = "0.1.0"
44
license = "Apache-2.0"
55
authors = ["Mysten Labs <build@mystenlabs.com>"]
@@ -19,13 +19,13 @@ thiserror = "1.0.35"
1919
tokio = { version = "1.20.1", features = ["sync"] }
2020
tracing = "0.1.36"
2121

22-
config = { path = "../config" }
22+
config = { path = "../config", package = "narwhal-config" }
2323
fastcrypto = "0.1.2"
24-
crypto = { path = "../crypto" }
25-
storage = { path = "../storage" }
26-
dag = { path = "../dag" }
24+
crypto = { path = "../crypto", package = "narwhal-crypto" }
25+
storage = { path = "../storage", package = "narwhal-storage" }
26+
dag = { path = "../dag", package = "narwhal-dag" }
2727
prometheus = "0.13.2"
28-
types = { path = "../types" }
28+
types = { path = "../types", package = "narwhal-types" }
2929
workspace-hack = { version = "0.1", path = "../workspace-hack" }
3030
cfg-if = "1.0.0"
3131

@@ -34,7 +34,7 @@ bincode = "1.3.3"
3434
criterion = "0.3.6"
3535
futures = "0.3.24"
3636
indexmap = { version = "1.9.1", features = ["serde"] }
37-
test_utils = { path = "../test_utils" }
37+
test_utils = { path = "../test_utils", package = "narwhal-test-utils" }
3838

3939
[target.'cfg(unix)'.dev-dependencies]
4040
pprof = { version = "0.10.1", features = ["criterion", "flamegraph"]}

consensus/benches/process_certificates.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Copyright (c) 2022, Mysten Labs, Inc.
22
// SPDX-License-Identifier: Apache-2.0
3+
34
use consensus::{
45
bullshark::Bullshark,
56
consensus::{ConsensusProtocol, ConsensusState},
@@ -9,6 +10,7 @@ use criterion::{
910
criterion_group, criterion_main, BenchmarkId, Criterion, SamplingMode, Throughput,
1011
};
1112
use fastcrypto::Hash;
13+
use narwhal_consensus as consensus;
1214
use pprof::criterion::{Output, PProfProfiler};
1315
use prometheus::Registry;
1416
use std::{collections::BTreeSet, sync::Arc};

crypto/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "crypto"
2+
name = "narwhal-crypto"
33
version = "0.1.0"
44
license = "Apache-2.0"
55
authors = ["Mysten Labs <build@mystenlabs.com>"]

dag/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "dag"
2+
name = "narwhal-dag"
33
version = "0.1.0"
44
license = "Apache-2.0"
55
authors = ["Mysten Labs <build@mystenlabs.com>"]

dag/src/bft.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::collections::{BTreeSet, VecDeque};
2020
/// # Example
2121
///
2222
/// ```
23-
/// use dag::bft::Bft;
23+
/// use narwhal_dag::bft::Bft;
2424
///
2525
/// #[derive(PartialEq, Eq, Hash)]
2626
/// struct Node(&'static str, &'static [Node]);

dag/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl<T> NodeRef<T> {
6969
/// # Example
7070
///
7171
/// ```
72-
/// use dag::{ Node, NodeRef };
72+
/// use narwhal_dag::{ Node, NodeRef };
7373
///
7474
/// let node = Node::new_leaf(1, false);
7575
/// // Note the 2 derefs: one for the newtype, one for the Arc
@@ -111,7 +111,7 @@ impl<T> Node<T> {
111111
/// # Example
112112
///
113113
/// ```
114-
/// use dag::{ Node, NodeRef };
114+
/// use narwhal_dag::{ Node, NodeRef };
115115
///
116116
/// let node = Node::new_leaf(1, false);
117117
/// ```
@@ -140,7 +140,7 @@ impl<T> Node<T> {
140140
/// # Example
141141
///
142142
/// ```
143-
/// use dag::Node;
143+
/// use narwhal_dag::Node;
144144
///
145145
/// let node = Node::new_leaf(1, false);
146146
/// assert_eq!(*node.value(), 1);
@@ -154,7 +154,7 @@ impl<T> Node<T> {
154154
/// # Examples
155155
///
156156
/// ```
157-
/// use dag::Node;
157+
/// use narwhal_dag::Node;
158158
///
159159
/// let node = Node::new_leaf(1, false);
160160
/// assert_eq!(node.is_leaf(), true);
@@ -168,7 +168,7 @@ impl<T> Node<T> {
168168
/// # Examples
169169
///
170170
/// ```
171-
/// use dag::Node;
171+
/// use narwhal_dag::Node;
172172
///
173173
/// let node = Node::new_leaf(1, true);
174174
/// assert_eq!(node.is_compressible(), true);
@@ -185,7 +185,7 @@ impl<T> Node<T> {
185185
/// # Examples
186186
///
187187
/// ```
188-
/// use dag::Node;
188+
/// use narwhal_dag::Node;
189189
///
190190
/// let node = Node::new_leaf(1, false);
191191
/// assert_eq!(node.make_compressible(), true);

examples/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "demo"
2+
name = "narwhal-examples"
33
version = "0.1.0"
44
license = "Apache-2.0"
55
authors = ["Mysten Labs <build@mystenlabs.com>"]

0 commit comments

Comments
 (0)