Skip to content

Commit

Permalink
Merge branch 'main' into ss/upgrade-restart-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszrzasik authored Sep 24, 2024
2 parents 8a6c4fe + 66f69e4 commit 8fad89c
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 47 deletions.
47 changes: 23 additions & 24 deletions Cargo.lock

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

7 changes: 2 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "0.5.74" # same as `hotshot`, but workspace subcrate can also release its own version
version = "0.5.75" # same as `hotshot`, but workspace subcrate can also release its own version
authors = ["Espresso Systems <[email protected]>"]
edition = "2021"
rust-version = "1.76.0"
Expand Down Expand Up @@ -57,11 +57,8 @@ espresso-systems-common = { git = "https://github.com/espressosystems/espresso-s
ethereum-types = { version = "0.14", default-features = false, features = [
"serialize",
] }
derive_more = { version = "1.0", features = [ "from" ] }
derive_more = { version = "1.0", features = ["from"] }
futures = { version = "0.3", default-features = false }
# TODO generic-array should not be a direct dependency
# https://github.com/EspressoSystems/HotShot/issues/1850
generic-array = { version = "0.14.7", features = ["serde"] }
jf-crhf = { version = "0.1.0", git = "https://github.com/EspressoSystems/jellyfish", tag = "0.4.5" }
jf-vid = { version = "0.1.0", git = "https://github.com/EspressoSystems/jellyfish", tag = "0.4.5" }
jf-signature = { version = "0.1.0", git = "https://github.com/EspressoSystems/jellyfish", tag = "0.4.5" }
Expand Down
18 changes: 11 additions & 7 deletions crates/orchestrator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub mod client;
pub mod config;

use std::{
collections::HashMap,
collections::{HashMap, HashSet},
fs::OpenOptions,
io::{self, ErrorKind},
time::Duration,
Expand Down Expand Up @@ -90,7 +90,7 @@ struct OrchestratorState<KEY: SignatureKey> {
/// Will be set to true once all nodes post they are ready to start
start: bool,
/// The total nodes that have posted they are ready to start
nodes_connected: u64,
nodes_connected: HashSet<PeerConfig<KEY>>,
/// The results of the benchmarks
bench_results: BenchResults,
/// The number of nodes that have posted their results
Expand Down Expand Up @@ -131,7 +131,7 @@ impl<KEY: SignatureKey + 'static> OrchestratorState<KEY> {
config: network_config,
peer_pub_ready,
pub_posted: HashMap::new(),
nodes_connected: 0,
nodes_connected: HashSet::new(),
start: false,
bench_results: BenchResults::default(),
nodes_post_results: 0,
Expand Down Expand Up @@ -534,12 +534,16 @@ where
});
}

self.nodes_connected += 1;

tracing::error!("Nodes connected: {}", self.nodes_connected);
// `HashSet::insert()` returns whether the node was newly inserted (true) or not
if self.nodes_connected.insert(peer_config.clone()) {
tracing::error!(
"Node {peer_config} connected. Total nodes connected: {}",
self.nodes_connected.len()
);
}

// i.e. nodes_connected >= num_nodes_with_stake * (start_threshold.0 / start_threshold.1)
if self.nodes_connected * self.config.config.start_threshold.1
if self.nodes_connected.len() as u64 * self.config.config.start_threshold.1
>= (self.config.config.num_nodes_with_stake.get() as u64)
* self.config.config.start_threshold.0
{
Expand Down
2 changes: 1 addition & 1 deletion crates/task-impls/src/quorum_proposal/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ impl<TYPES: NodeType, V: Versions> HandleDepOutput for ProposalDependencyHandle<
)
.await
{
error!("Failed to publish proposal; error = {e}");
error!("Failed to publish proposal; error = {e:#}");
}
}
}
6 changes: 3 additions & 3 deletions crates/testing/tests/tests_3/test_marketplace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ cross_tests!(
);

// Test marketplace with both regular builders down but solver + fallback builder up
// Requires 90% nonempty blocks
// Requires 80% nonempty blocks
cross_tests!(
TestName: test_marketplace_builders_down,
Impls: [MemoryImpl],
Expand All @@ -96,7 +96,7 @@ cross_tests!(
changes: HashMap::from([(0, BuilderChange::Down)])
}
],
validate_transactions: nonempty_block_threshold((90,100)),
validate_transactions: nonempty_block_threshold((40,50)),
..TestDescription::default()
}
},
Expand Down Expand Up @@ -128,7 +128,7 @@ cross_tests!(
BuilderDescription {
changes: HashMap::from([(0, BuilderChange::Down)])
},
validate_transactions: nonempty_block_threshold((80,100)),
validate_transactions: nonempty_block_threshold((40,50)),
..TestDescription::default()
}
},
Expand Down
4 changes: 0 additions & 4 deletions crates/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ futures = { workspace = true }
cdn-proto = { workspace = true }
reqwest = { workspace = true }

generic-array = { workspace = true }

# TODO generic-array should not be a direct dependency
# https://github.com/EspressoSystems/HotShot/issues/1850
lazy_static = { workspace = true }
memoize = { workspace = true }
rand = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/types/src/qc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use ark_std::{
vec::Vec,
};
use bitvec::prelude::*;
use digest::generic_array::GenericArray;
use ethereum_types::U256;
use generic_array::GenericArray;
use jf_signature::{AggregateableSignatureSchemes, SignatureError};
use serde::{Deserialize, Serialize};
use typenum::U32;
Expand Down
2 changes: 1 addition & 1 deletion crates/types/src/signature_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use ark_serialize::SerializationError;
use bitvec::{slice::BitSlice, vec::BitVec};
use digest::generic_array::GenericArray;
use ethereum_types::U256;
use generic_array::GenericArray;
use jf_signature::{
bls_over_bn254::{BLSOverBN254CurveSignatureScheme, KeyPair, SignKey, VerKey},
SignatureError, SignatureScheme,
Expand Down
2 changes: 1 addition & 1 deletion crates/types/src/traits/qc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use ark_std::{
vec::Vec,
};
use bitvec::prelude::*;
use generic_array::{ArrayLength, GenericArray};
use digest::generic_array::{ArrayLength, GenericArray};
use jf_signature::{AggregateableSignatureSchemes, SignatureError};
use serde::{Deserialize, Serialize};

Expand Down

0 comments on commit 8fad89c

Please sign in to comment.