Skip to content

Commit

Permalink
bump hotshot version (#679)
Browse files Browse the repository at this point in the history
bump hotshot to 0.5.70


---------

Co-authored-by: tbro <tbro@users.noreply.github.com>
  • Loading branch information
tbro and tbro authored Aug 15, 2024
1 parent 8e0ee4e commit 432444e
Show file tree
Hide file tree
Showing 12 changed files with 113 additions and 63 deletions.
22 changes: 11 additions & 11 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.69" }
hotshot-testing = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.69" }
hotshot-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.69" }
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" }
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.69", optional = true }
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.70", 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.69" }
hotshot-example-types = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.70" }
portpicker = "0.1"
rand = "0.8"
reqwest = "0.12.3"
Expand Down
14 changes: 8 additions & 6 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, state_types::TestInstanceState,
storage_types::TestStorage,
auction_results_provider_types::TestAuctionResultsProvider, node_types::TestVersions,
state_types::TestInstanceState, storage_types::TestStorage,
};
use hotshot_query_service::{
data_source,
Expand Down Expand Up @@ -143,7 +143,7 @@ async fn main() -> Result<(), Error> {

async fn init_consensus(
data_sources: &[DataSource],
) -> Vec<SystemContextHandle<MockTypes, MockNodeImpl>> {
) -> Vec<SystemContextHandle<MockTypes, MockNodeImpl, TestVersions>> {
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,9 +270,11 @@ async fn init_consensus(
config,
memberships,
network,
HotShotInitializer::from_genesis(TestInstanceState {})
.await
.unwrap(),
HotShotInitializer::from_genesis(TestInstanceState {
delay_config: Default::default(),
})
.await
.unwrap(),
ConsensusMetricsValue::new(&*data_source.populate_metrics()),
storage,
MarketplaceConfig {
Expand Down
9 changes: 7 additions & 2 deletions src/availability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -861,8 +861,13 @@ mod test {
);

// mock up some consensus data.
let leaf =
Leaf::<MockTypes>::genesis(&TestValidatedState::default(), &TestInstanceState {}).await;
let leaf = Leaf::<MockTypes>::genesis(
&TestValidatedState::default(),
&TestInstanceState {
delay_config: Default::default(),
},
)
.await;

let block = BlockQueryData::new(leaf.block_header().clone(), MockPayload::genesis());

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

let mut leaf = LeafQueryData::<MockTypes>::genesis(
&TestValidatedState::default(),
&TestInstanceState {},
&TestInstanceState {
delay_config: Default::default(),
},
)
.await;
*leaf.leaf.block_header_mut() = header.clone();
Expand Down Expand Up @@ -820,7 +842,9 @@ pub mod node_tests {
// Insert test data with VID common and a share.
let leaf = LeafQueryData::<MockTypes>::genesis(
&TestValidatedState::default(),
&TestInstanceState {},
&TestInstanceState {
delay_config: Default::default(),
},
)
.await;
let common = VidCommonQueryData::new(leaf.header().clone(), disperse.common);
Expand Down
3 changes: 2 additions & 1 deletion src/data_source/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ use std::path::Path;
/// # use hotshot_query_service::testing::mocks::{
/// # MockNodeImpl as AppNodeImpl, MockTypes as AppTypes,
/// # };
/// # use hotshot_example_types::node_types::TestVersions;
/// # use std::path::Path;
/// # use tide_disco::App;
/// # use vbs::version::StaticVersionType;
Expand All @@ -111,7 +112,7 @@ use std::path::Path;
///
/// async fn init_server<Ver: StaticVersionType + 'static>(
/// storage_path: &Path,
/// hotshot: SystemContextHandle<AppTypes, AppNodeImpl>,
/// hotshot: SystemContextHandle<AppTypes, AppNodeImpl, TestVersions>,
/// ) -> Result<App<Arc<RwLock<AppState>>, Error>, Error> {
/// let mut loader = AtomicStoreLoader::create(storage_path, "my_app") // or `open`
/// .map_err(Error::internal)?;
Expand Down
3 changes: 2 additions & 1 deletion src/data_source/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ use async_trait::async_trait;
/// # 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>::init(
/// let hotshot = SystemContext::<AppTypes, AppNodeImpl, TestVersions>::init(
/// # panic!(), panic!(), panic!(), panic!(), panic!(), panic!(), panic!(),
/// ConsensusMetricsValue::new(&*data_source.populate_metrics()), panic!(),
/// panic!(),
Expand Down
7 changes: 5 additions & 2 deletions src/data_source/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ impl Config {
/// # use hotshot_query_service::testing::mocks::{
/// # MockNodeImpl as AppNodeImpl, MockTypes as AppTypes,
/// # };
/// # use hotshot_example_types::node_types::TestVersions;
/// # use tide_disco::App;
/// # use vbs::version::StaticVersionType;
/// struct AppState {
Expand All @@ -272,7 +273,7 @@ impl Config {
///
/// async fn init_server<Ver: StaticVersionType + 'static>(
/// config: Config,
/// hotshot: SystemContextHandle<AppTypes, AppNodeImpl>,
/// hotshot: SystemContextHandle<AppTypes, AppNodeImpl, TestVersions>,
/// ) -> 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 @@ -444,7 +445,9 @@ mod test {
// Insert test data with VID common but no share.
let leaf = LeafQueryData::<MockTypes>::genesis(
&TestValidatedState::default(),
&TestInstanceState {},
&TestInstanceState {
delay_config: Default::default(),
},
)
.await;
let common = VidCommonQueryData::new(leaf.header().clone(), disperse.common);
Expand Down
8 changes: 6 additions & 2 deletions src/data_source/storage/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3341,7 +3341,9 @@ mod test {
let mut storage = SqlStorage::connect(cfg).await.unwrap();
let mut leaf = LeafQueryData::<MockTypes>::genesis(
&TestValidatedState::default(),
&TestInstanceState {},
&TestInstanceState {
delay_config: Default::default(),
},
)
.await;
// insert some mock data
Expand Down Expand Up @@ -3424,7 +3426,9 @@ mod test {
let mut storage = SqlStorage::connect(db.config()).await.unwrap();
let mut leaf = LeafQueryData::<MockTypes>::genesis(
&TestValidatedState::default(),
&TestInstanceState {},
&TestInstanceState {
delay_config: Default::default(),
},
)
.await;
// insert some mock data
Expand Down
Loading

0 comments on commit 432444e

Please sign in to comment.