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

Commit

Permalink
Merge branch 'main' into task-group
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtian committed Aug 13, 2022
2 parents 599a6d9 + 68f8956 commit 6ad78c9
Show file tree
Hide file tree
Showing 40 changed files with 293 additions and 153 deletions.
1 change: 1 addition & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ type-complexity-threshold = 10000
too-many-arguments-threshold = 15

disallowed-methods = [
{path = "anyhow", reason = "we prefer to use eyre"},
# we use tracing with the log feature instead of the log crate.
{ path = "log::info", reason = "use tracing::info instead" },
{ path = "log::debug", reason = "use tracing::debug instead" },
Expand Down
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/executor/ @asonnino
/examples/ @arun-koshy
/network/ @bmwill
/config/tests/snapshots/ @huitseeker
/dag/ @huitseeker
10 changes: 6 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ env:
RUST_BACKTRACE: short

jobs:
ignored:
name: Run long-running tests
end-to-end-tests:
name: Run long-running end-to-end tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -39,9 +39,11 @@ jobs:
- uses: bmwill/rust-cache@v1 # Fork of 'Swatinem/rust-cache' which allows caching additional paths
with:
path: ~/.cargo/registry/src/**/librocksdb-sys-*
- name: cargo test
# We run only the integration tests that are ignored under the primary package.
# These are considered the end-to-end "slow" tests for us
- name: cargo nextest
run: |
cargo nextest run --profile ci --run-ignored ignored-only
cargo nextest run -E 'kind(test) + package(primary)' --run-ignored ignored-only
beta:
name: Run test on the beta channel
Expand Down
74 changes: 22 additions & 52 deletions Cargo.lock

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

7 changes: 3 additions & 4 deletions consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ blake2 = "0.9"
bytes = "1.2.1"
match_opt = "0.1.2"
rand = { version = "0.8.5", optional = true }
# deactivation of bzip2 due to https://github.com/rust-rocksdb/rust-rocksdb/issues/609
rocksdb = { version = "0.18.0", features = ["snappy", "lz4", "zstd", "zlib"], default-features = false }
serde = { version = "1.0.142", features = ["derive"] }
store = { git = "https://github.com/mystenlabs/mysten-infra.git", package = "typed-store", rev = "d965a5a795dcdb4d1c7964acf556bc249fdc58aa" }
store = { git = "https://github.com/mystenlabs/mysten-infra.git", package = "typed-store", rev = "f4aa523d3029bd6a23bead5f04c182f2cfa04c5e" }
thiserror = "1.0.32"
tokio = { version = "1.20.1", features = ["sync"] }
tracing = "0.1.36"
Expand All @@ -36,11 +34,12 @@ indexmap = { version = "1.9.1", features = ["serde"] }
test_utils = { path = "../test_utils" }

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

[features]
default = ["rand"]
benchmark = []
pprof = []

[lib]
bench = false
Expand Down
3 changes: 1 addition & 2 deletions consensus/benches/process_certificates.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) 2022, Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
use arc_swap::ArcSwap;
use consensus::{
bullshark::Bullshark,
consensus::{ConsensusProtocol, ConsensusState},
Expand Down Expand Up @@ -36,7 +35,7 @@ pub fn process_certificates(c: &mut Criterion) {
.map(|x| x.digest())
.collect::<BTreeSet<_>>();
let (certificates, _next_parents) = make_optimal_certificates(1..=rounds, &genesis, &keys);
let committee = Arc::new(ArcSwap::from_pointee(mock_committee(&keys)));
let committee = mock_committee(&keys);

let store_path = temp_dir();
let store = make_consensus_store(&store_path);
Expand Down
10 changes: 5 additions & 5 deletions consensus/src/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@ impl ConsensusState {
!authorities.is_empty()
});
}

self.metrics
.consensus_dag_size
.with_label_values(&[])
.set(self.dag.len() as i64);
}
}

Expand Down Expand Up @@ -327,6 +322,11 @@ where
tracing::warn!("Failed to output certificate: {e}");
}
}

self.metrics
.consensus_dag_rounds
.with_label_values(&[])
.set(state.dag.len() as i64);
},

// Check whether the committee changed.
Expand Down
10 changes: 5 additions & 5 deletions consensus/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ use prometheus::{

#[derive(Clone, Debug)]
pub struct ConsensusMetrics {
/// The number of elements in the Dag (for Tusk or Bullshark)
pub consensus_dag_size: IntGaugeVec,
/// The number of rounds for which the Dag holds certificates (for Tusk or Bullshark)
pub consensus_dag_rounds: IntGaugeVec,
/// The last committed round from consensus
pub last_committed_round: IntGaugeVec,
/// The number of elements from the vertices secondary index (external consensus)
Expand All @@ -23,9 +23,9 @@ pub struct ConsensusMetrics {
impl ConsensusMetrics {
pub fn new(registry: &Registry) -> Self {
Self {
consensus_dag_size: register_int_gauge_vec_with_registry!(
"consensus_dag_size",
"The number of elements (certificates) in consensus dag",
consensus_dag_rounds: register_int_gauge_vec_with_registry!(
"consensus_dag_rounds",
"The number of rounds for which the consensus Dag holds certificates",
&[],
registry
).unwrap(),
Expand Down
1 change: 0 additions & 1 deletion crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ edition = "2021"
publish = false

[dependencies]
anyhow = { version = "1.0.59", features = ["backtrace"] }
ark-bls12-377 = { version = "0.3.0", features = ["std"], optional = true }
base64ct = { version = "1.5.1", features = ["alloc"] }
ed25519-consensus = { version = "2.0.1", features = ["serde"] }
Expand Down
4 changes: 2 additions & 2 deletions crypto/src/bls12377/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,10 @@ impl Signer<BLS12377Signature> for BLS12377KeyPair {
}

impl FromStr for BLS12377KeyPair {
type Err = anyhow::Error;
type Err = eyre::Report;

fn from_str(s: &str) -> Result<Self, Self::Err> {
let kp = Self::decode_base64(s).map_err(|e| anyhow::anyhow!("{}", e.to_string()))?;
let kp = Self::decode_base64(s).map_err(|e| eyre::eyre!("{}", e.to_string()))?;
Ok(kp)
}
}
Expand Down
Loading

0 comments on commit 6ad78c9

Please sign in to comment.