Skip to content

Commit

Permalink
Merge pull request #672 from EspressoSystems/hotshot/rc-0.5.67
Browse files Browse the repository at this point in the history
[WEEKLY RELEASE] HotShot - rc-0.5.67
  • Loading branch information
shenkeyao authored Jul 30, 2024
2 parents 49636c6 + 8382852 commit 5ec6d4d
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 43 deletions.
42 changes: 21 additions & 21 deletions Cargo.lock

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

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

[package]
name = "hotshot-query-service"
version = "0.1.47"
version = "0.1.49"
authors = ["Espresso Systems <hello@espressosys.com>"]
edition = "2021"
license = "GPL-3.0-or-later"
Expand Down Expand Up @@ -75,9 +75,9 @@ derivative = "2.2"
derive_more = "0.99"
either = "1.12"
futures = "0.3"
hotshot = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.66" }
hotshot-testing = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.66" }
hotshot-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.66" }
hotshot = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.67" }
hotshot-testing = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.67" }
hotshot-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.67" }
itertools = "0.12.1"
jf-merkle-tree = { version = "0.1.0", git = "https://github.com/EspressoSystems/jellyfish", tag = "0.4.5", features = [
"std",
Expand Down Expand Up @@ -119,7 +119,7 @@ tokio-postgres = { version = "0.7", optional = true, default-features = false, f

# Dependencies enabled by feature "testing".
espresso-macros = { git = "https://github.com/EspressoSystems/espresso-macros.git", tag = "0.1.0", optional = true }
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.66", optional = true }
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.67", optional = true }
portpicker = { version = "0.1", optional = true }
rand = { version = "0.8", optional = true }
spin_sleep = { version = "1.2", optional = true }
Expand All @@ -140,7 +140,7 @@ backtrace-on-stack-overflow = { version = "0.3", optional = true }
clap = { version = "4.5", features = ["derive", "env"] }
espresso-macros = { git = "https://github.com/EspressoSystems/espresso-macros.git", tag = "0.1.0" }
generic-array = "0.14"
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "rc-0.5.66" }
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.67" }
portpicker = "0.1"
rand = "0.8"
reqwest = "0.12.3"
Expand Down
27 changes: 19 additions & 8 deletions examples/simple-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ use hotshot_query_service::{
};
use hotshot_testing::block_builder::{SimpleBuilderImplementation, TestBuilderImplementation};
use hotshot_types::{
consensus::ConsensusMetricsValue, light_client::StateKeyPair, signature_key::BLSPubKey,
traits::election::Membership, ExecutionType, HotShotConfig, PeerConfig, ValidatorConfig,
consensus::ConsensusMetricsValue,
light_client::StateKeyPair,
signature_key::BLSPubKey,
traits::{election::Membership, network::Topic},
ExecutionType, HotShotConfig, PeerConfig, ValidatorConfig,
};
use std::{num::NonZeroUsize, time::Duration};
use url::Url;
Expand Down Expand Up @@ -160,16 +163,23 @@ async fn init_consensus(
// Get the number of nodes with stake
let num_nodes_with_stake = NonZeroUsize::new(pub_keys.len()).unwrap();

let membership = MockMembership::create_election(
let da_membership = MockMembership::create_election(
known_nodes_with_stake.clone(),
known_nodes_with_stake.clone(),
Topic::Da,
0,
);
let non_da_membership = MockMembership::create_election(
known_nodes_with_stake.clone(),
known_nodes_with_stake.clone(),
Topic::Global,
0,
);
let memberships = Memberships {
quorum_membership: membership.clone(),
da_membership: membership.clone(),
vid_membership: membership.clone(),
view_sync_membership: membership.clone(),
quorum_membership: non_da_membership.clone(),
da_membership: da_membership.clone(),
vid_membership: non_da_membership.clone(),
view_sync_membership: non_da_membership.clone(),
};

// Pick a random, unused port for the builder server
Expand Down Expand Up @@ -245,8 +255,9 @@ async fn init_consensus(
};

let network = Arc::new(MemoryNetwork::new(
pub_keys[node_id],
&pub_keys[node_id],
&master_map.clone(),
&[Topic::Global, Topic::Da],
None,
));

Expand Down
23 changes: 15 additions & 8 deletions src/testing/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use hotshot_types::{
consensus::ConsensusMetricsValue,
light_client::StateKeyPair,
signature_key::BLSPubKey,
traits::{election::Membership, signature_key::SignatureKey as _},
traits::{election::Membership, network::Topic, signature_key::SignatureKey as _},
ExecutionType, HotShotConfig, PeerConfig, ValidatorConfig,
};
use std::fmt::Display;
Expand Down Expand Up @@ -92,17 +92,23 @@ impl<D: DataSourceLifeCycle + UpdateStatusData> MockNetwork<D> {
})
.collect::<Vec<_>>();

let membership = MockMembership::create_election(
let da_membership = MockMembership::create_election(
known_nodes_with_stake.clone(),
known_nodes_with_stake.clone(),
Topic::Da,
0,
);
let non_da_membership = MockMembership::create_election(
known_nodes_with_stake.clone(),
known_nodes_with_stake.clone(),
Topic::Global,
0,
);

let memberships = Memberships {
quorum_membership: membership.clone(),
da_membership: membership.clone(),
vid_membership: membership.clone(),
view_sync_membership: membership.clone(),
quorum_membership: non_da_membership.clone(),
da_membership: da_membership.clone(),
vid_membership: non_da_membership.clone(),
view_sync_membership: non_da_membership.clone(),
};

// Pick a random, unused port for the builder server
Expand Down Expand Up @@ -181,8 +187,9 @@ impl<D: DataSourceLifeCycle + UpdateStatusData> MockNetwork<D> {
let data_source = D::connect(&storage).await;

let network = Arc::new(MemoryNetwork::new(
pub_keys[node_id],
&pub_keys[node_id],
&master_map.clone(),
&[Topic::Global, Topic::Da],
None,
));

Expand Down

0 comments on commit 5ec6d4d

Please sign in to comment.