Skip to content

Commit

Permalink
Merge pull request #680 from EspressoSystems/hotshot/rc-0.5.71
Browse files Browse the repository at this point in the history
[WEEKLY RELEASE] HotShot - rc-0.5.71
  • Loading branch information
rob-maron committed Aug 20, 2024
2 parents 432444e + 203a8b5 commit 316258f
Show file tree
Hide file tree
Showing 12 changed files with 99 additions and 104 deletions.
54 changes: 34 additions & 20 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
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 = "0.5.70" }
hotshot-testing = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.70" }
hotshot-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.70" }
hotshot = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.71" }
hotshot-testing = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.71" }
hotshot-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.71" }
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 = "0.5.70", optional = true }
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.71", 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 = "0.5.70" }
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.71" }
portpicker = "0.1"
rand = "0.8"
reqwest = "0.12.3"
Expand Down
16 changes: 7 additions & 9 deletions examples/simple-server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use hotshot::{
HotShotInitializer, MarketplaceConfig, Memberships, SystemContext,
};
use hotshot_example_types::{
auction_results_provider_types::TestAuctionResultsProvider, node_types::TestVersions,
state_types::TestInstanceState, storage_types::TestStorage,
auction_results_provider_types::TestAuctionResultsProvider, state_types::TestInstanceState,
storage_types::TestStorage,
};
use hotshot_query_service::{
data_source,
Expand All @@ -36,7 +36,7 @@ use hotshot_query_service::{
status::UpdateStatusData,
testing::{
consensus::DataSourceLifeCycle,
mocks::{MockBase, MockMembership, MockNodeImpl, MockTypes},
mocks::{MockBase, MockMembership, MockNodeImpl, MockTypes, MockVersions},
},
Error,
};
Expand Down Expand Up @@ -143,7 +143,7 @@ async fn main() -> Result<(), Error> {

async fn init_consensus(
data_sources: &[DataSource],
) -> Vec<SystemContextHandle<MockTypes, MockNodeImpl, TestVersions>> {
) -> Vec<SystemContextHandle<MockTypes, MockNodeImpl, MockVersions>> {
let (pub_keys, priv_keys): (Vec<_>, Vec<_>) = (0..data_sources.len())
.map(|i| BLSPubKey::generated_from_seed_indexed([0; 32], i as u64))
.unzip();
Expand Down Expand Up @@ -270,11 +270,9 @@ async fn init_consensus(
config,
memberships,
network,
HotShotInitializer::from_genesis(TestInstanceState {
delay_config: Default::default(),
})
.await
.unwrap(),
HotShotInitializer::from_genesis(TestInstanceState::default())
.await
.unwrap(),
ConsensusMetricsValue::new(&*data_source.populate_metrics()),
storage,
MarketplaceConfig {
Expand Down
4 changes: 1 addition & 3 deletions src/availability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,9 +863,7 @@ mod test {
// mock up some consensus data.
let leaf = Leaf::<MockTypes>::genesis(
&TestValidatedState::default(),
&TestInstanceState {
delay_config: Default::default(),
},
&TestInstanceState::default(),
)
.await;

Expand Down
36 changes: 9 additions & 27 deletions src/data_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,16 +465,12 @@ pub mod persistence_tests {
// Mock up some consensus data.
let mut qc = QuorumCertificate::<MockTypes>::genesis(
&TestValidatedState::default(),
&TestInstanceState {
delay_config: Default::default(),
},
&TestInstanceState::default(),
)
.await;
let mut leaf = Leaf::<MockTypes>::genesis(
&TestValidatedState::default(),
&TestInstanceState {
delay_config: Default::default(),
},
&TestInstanceState::default(),
)
.await;
// Increment the block number, to distinguish this block from the genesis block, which
Expand Down Expand Up @@ -520,16 +516,12 @@ pub mod persistence_tests {
// Mock up some consensus data.
let mut qc = QuorumCertificate::<MockTypes>::genesis(
&TestValidatedState::default(),
&TestInstanceState {
delay_config: Default::default(),
},
&TestInstanceState::default(),
)
.await;
let mut leaf = Leaf::<MockTypes>::genesis(
&TestValidatedState::default(),
&TestInstanceState {
delay_config: Default::default(),
},
&TestInstanceState::default(),
)
.await;
// Increment the block number, to distinguish this block from the genesis block, which
Expand Down Expand Up @@ -614,18 +606,14 @@ pub mod node_tests {
let mut leaves = vec![
LeafQueryData::<MockTypes>::genesis(
&TestValidatedState::default(),
&TestInstanceState {
delay_config: Default::default(),
},
&TestInstanceState::default(),
)
.await,
];
let mut blocks = vec![
BlockQueryData::<MockTypes>::genesis(
&TestValidatedState::default(),
&TestInstanceState {
delay_config: Default::default(),
},
&TestInstanceState::default(),
)
.await,
];
Expand Down Expand Up @@ -764,9 +752,7 @@ pub mod node_tests {
<TestBlockPayload as BlockPayload<TestTypes>>::from_transactions(
[mock_transaction(vec![i as u8 % 2])],
&TestValidatedState::default(),
&TestInstanceState {
delay_config: Default::default(),
},
&TestInstanceState::default(),
)
.await
.unwrap();
Expand All @@ -784,9 +770,7 @@ pub mod node_tests {

let mut leaf = LeafQueryData::<MockTypes>::genesis(
&TestValidatedState::default(),
&TestInstanceState {
delay_config: Default::default(),
},
&TestInstanceState::default(),
)
.await;
*leaf.leaf.block_header_mut() = header.clone();
Expand Down Expand Up @@ -842,9 +826,7 @@ pub mod node_tests {
// Insert test data with VID common and a share.
let leaf = LeafQueryData::<MockTypes>::genesis(
&TestValidatedState::default(),
&TestInstanceState {
delay_config: Default::default(),
},
&TestInstanceState::default(),
)
.await;
let common = VidCommonQueryData::new(leaf.header().clone(), disperse.common);
Expand Down
4 changes: 2 additions & 2 deletions src/data_source/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ use std::path::Path;
/// # };
/// # use hotshot_query_service::fetching::provider::NoFetching;
/// # use hotshot_query_service::testing::mocks::{
/// # MockNodeImpl as AppNodeImpl, MockTypes as AppTypes,
/// # MockNodeImpl as AppNodeImpl, MockTypes as AppTypes, MockVersions as AppVersions
/// # };
/// # use hotshot_example_types::node_types::TestVersions;
/// # use std::path::Path;
Expand All @@ -112,7 +112,7 @@ use std::path::Path;
///
/// async fn init_server<Ver: StaticVersionType + 'static>(
/// storage_path: &Path,
/// hotshot: SystemContextHandle<AppTypes, AppNodeImpl, TestVersions>,
/// hotshot: SystemContextHandle<AppTypes, AppNodeImpl, AppVersions>,
/// ) -> Result<App<Arc<RwLock<AppState>>, Error>, Error> {
/// let mut loader = AtomicStoreLoader::create(storage_path, "my_app") // or `open`
/// .map_err(Error::internal)?;
Expand Down
4 changes: 2 additions & 2 deletions src/data_source/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ use async_trait::async_trait;
/// # use hotshot_query_service::{
/// # data_source::MetricsDataSource,
/// # status::UpdateStatusData,
/// # testing::mocks::{MockNodeImpl as AppNodeImpl, MockTypes as AppTypes},
/// # testing::mocks::{MockNodeImpl as AppNodeImpl, MockTypes as AppTypes, MockVersions as AppVersions},
/// # Error,
/// # };
/// # use hotshot_types::consensus::ConsensusMetricsValue;
/// # use hotshot_example_types::node_types::TestVersions;
/// # async fn doc() -> Result<(), hotshot_query_service::Error> {
/// let data_source = MetricsDataSource::default();
/// let hotshot = SystemContext::<AppTypes, AppNodeImpl, TestVersions>::init(
/// let hotshot = SystemContext::<AppTypes, AppNodeImpl, AppVersions>::init(
/// # panic!(), panic!(), panic!(), panic!(), panic!(), panic!(), panic!(),
/// ConsensusMetricsValue::new(&*data_source.populate_metrics()), panic!(),
/// panic!(),
Expand Down
8 changes: 3 additions & 5 deletions src/data_source/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ impl Config {
/// # };
/// # use hotshot_query_service::fetching::provider::NoFetching;
/// # use hotshot_query_service::testing::mocks::{
/// # MockNodeImpl as AppNodeImpl, MockTypes as AppTypes,
/// # MockNodeImpl as AppNodeImpl, MockTypes as AppTypes, MockVersions as AppVersions
/// # };
/// # use hotshot_example_types::node_types::TestVersions;
/// # use tide_disco::App;
Expand All @@ -273,7 +273,7 @@ impl Config {
///
/// async fn init_server<Ver: StaticVersionType + 'static>(
/// config: Config,
/// hotshot: SystemContextHandle<AppTypes, AppNodeImpl, TestVersions>,
/// hotshot: SystemContextHandle<AppTypes, AppNodeImpl, AppVersions>,
/// ) -> Result<App<Arc<RwLock<AppState>>, Error>, Error> {
/// let mut hotshot_qs = config.connect(NoFetching).await.map_err(Error::internal)?;
/// // Initialize storage for other modules, using `hotshot_qs` to access the database.
Expand Down Expand Up @@ -445,9 +445,7 @@ mod test {
// Insert test data with VID common but no share.
let leaf = LeafQueryData::<MockTypes>::genesis(
&TestValidatedState::default(),
&TestInstanceState {
delay_config: Default::default(),
},
&TestInstanceState::default(),
)
.await;
let common = VidCommonQueryData::new(leaf.header().clone(), disperse.common);
Expand Down
Loading

0 comments on commit 316258f

Please sign in to comment.