Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Hotshot to 0.5.55 #1484

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions Cargo.lock

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

20 changes: 10 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ dotenvy = "0.15"
ethers = { version = "2.0", features = ["solc"] }
futures = "0.3"

hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.54" }
hotshot = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" }
# Hotshot imports
hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.54" }
hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "0.1.21" }
hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "0.1.22" }
hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.54" }
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "0.1.24" }
hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.54" }
hotshot-builder-api = { git = "https://github.com/EspressoSystems/HotShot.git", tag = "0.5.55" }
hotshot-builder-core = { git = "https://github.com/EspressoSystems/hotshot-builder-core", tag = "0.1.22" }
hotshot-events-service = { git = "https://github.com/EspressoSystems/hotshot-events-service.git", tag = "0.1.23" }
hotshot-orchestrator = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" }
hotshot-query-service = { git = "https://github.com/EspressoSystems/hotshot-query-service", tag = "0.1.25" }
hotshot-stake-table = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" }
hotshot-state-prover = { version = "0.1.0", path = "hotshot-state-prover" }
hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.54" }
hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.54" }
hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.54" }
hotshot-task = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" }
hotshot-testing = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" }
hotshot-types = { git = "https://github.com/EspressoSystems/hotshot", tag = "0.5.55" }

# Push CDN imports
cdn-broker = { git = "https://github.com/EspressoSystems/Push-CDN", features = [
Expand Down
22 changes: 10 additions & 12 deletions builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ pub mod testing {
// Only pass the pub keys to the hotshot config
let known_nodes_without_stake_pub_keys = known_nodes_without_stake
.iter()
.map(|x| <BLSPubKey as SignatureKey>::get_public_key(&x.stake_table_entry))
.map(|x| <BLSPubKey as SignatureKey>::public_key(&x.stake_table_entry))
.collect::<Vec<_>>();

let master_map = MasterMap::new();
Expand Down Expand Up @@ -261,7 +261,7 @@ pub mod testing {
.iter()
.zip(&state_key_pairs)
.map(|(pub_key, state_key_pair)| PeerConfig::<PubKey> {
stake_table_entry: pub_key.get_stake_table_entry(stake_value),
stake_table_entry: pub_key.stake_table_entry(stake_value),
state_ver_key: state_key_pair.ver_key(),
})
.collect::<Vec<_>>();
Expand Down Expand Up @@ -466,7 +466,7 @@ pub mod testing {
// send the events to the event streaming state
async_spawn({
async move {
let mut hotshot_event_stream = hotshot_context_handle.get_event_stream();
let mut hotshot_event_stream = hotshot_context_handle.event_stream();
loop {
let event = hotshot_event_stream.next().await.unwrap();
tracing::debug!("Before writing in event streamer: {event:?}");
Expand Down Expand Up @@ -494,12 +494,12 @@ pub mod testing {
if let Decide { leaf_chain, .. } = event.event {
if let Some(height) = leaf_chain.iter().find_map(|LeafInfo { leaf, .. }| {
if leaf
.get_block_payload()
.block_payload()
.as_ref()?
.transaction_commitments(leaf.get_block_header().metadata())
.transaction_commitments(leaf.block_header().metadata())
.contains(&commitment)
{
Some(leaf.get_block_header().block_number())
Some(leaf.block_header().block_number())
} else {
None
}
Expand Down Expand Up @@ -664,7 +664,7 @@ mod test {
use hotshot_builder_core::service::GlobalState;
use hotshot_types::event::LeafInfo;
use hotshot_types::traits::block_contents::{
vid_commitment, BlockHeader, BlockPayload, GENESIS_VID_NUM_STORAGE_NODES,
vid_commitment, BlockHeader, BlockPayload, EncodeBytes, GENESIS_VID_NUM_STORAGE_NODES,
};
use hotshot_types::utils::BuilderCommitment;
use sequencer::block::payload::Payload;
Expand Down Expand Up @@ -695,7 +695,7 @@ mod test {
let total_nodes = HotShotTestConfig::total_nodes();

// try to listen on non-voting node handle as it is the last handle
let mut events = handles[total_nodes - 1].0.get_event_stream();
let mut events = handles[total_nodes - 1].0.event_stream();
for (handle, ..) in handles.iter() {
handle.hotshot.start_consensus().await;
}
Expand All @@ -709,9 +709,7 @@ mod test {
let builder_commitment = genesis_payload.builder_commitment(&genesis_ns_table);
let genesis_commitment = {
// TODO we should not need to collect payload bytes just to compute vid_commitment
let payload_bytes = genesis_payload
.encode()
.expect("unable to encode genesis payload");
let payload_bytes = genesis_payload.encode();
vid_commitment(&payload_bytes, GENESIS_VID_NUM_STORAGE_NODES)
};
Header::genesis(
Expand All @@ -733,7 +731,7 @@ mod test {
// Check that each successive header satisfies invariants relative to its parent: all
// the fields which should be monotonic are.
for LeafInfo { leaf, .. } in leaf_chain.iter().rev() {
let header = leaf.get_block_header().clone();
let header = leaf.block_header().clone();
if header.height == 0 {
parent = header;
continue;
Expand Down
5 changes: 2 additions & 3 deletions builder/src/non_permissioned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ use hotshot_types::{
traits::{
block_contents::{vid_commitment, GENESIS_VID_NUM_STORAGE_NODES},
node_implementation::{ConsensusTime, NodeType},
EncodeBytes,
},
utils::BuilderCommitment,
};
Expand Down Expand Up @@ -119,9 +120,7 @@ impl BuilderConfig {
let builder_commitment = genesis_payload.builder_commitment(&genesis_ns_table);

let vid_commitment = {
let payload_bytes = genesis_payload
.encode()
.expect("unable to encode genesis payload");
let payload_bytes = genesis_payload.encode();
vid_commitment(&payload_bytes, GENESIS_VID_NUM_STORAGE_NODES)
};

Expand Down
6 changes: 2 additions & 4 deletions builder/src/permissioned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use hotshot_types::{
event::Event,
light_client::StateKeyPair,
signature_key::{BLSPrivKey, BLSPubKey},
traits::{election::Membership, metrics::Metrics},
traits::{election::Membership, metrics::Metrics, EncodeBytes},
utils::BuilderCommitment,
HotShotConfig, PeerConfig, ValidatorConfig,
};
Expand Down Expand Up @@ -407,9 +407,7 @@ impl<N: network::Type, P: SequencerPersistence, Ver: StaticVersionType + 'static

let vid_commitment = {
// TODO we should not need to collect payload bytes just to compute vid_commitment
let payload_bytes = genesis_payload
.encode()
.expect("unable to encode genesis payload");
let payload_bytes = genesis_payload.encode();
vid_commitment(&payload_bytes, GENESIS_VID_NUM_STORAGE_NODES)
};

Expand Down
4 changes: 2 additions & 2 deletions hotshot-state-prover/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ async fn init_stake_table_from_orchestrator(
.into_iter()
.for_each(|config| {
st.register(
*config.stake_table_entry.get_key(),
config.stake_table_entry.get_stake(),
*config.stake_table_entry.key(),
config.stake_table_entry.stake(),
config.state_ver_key,
)
.expect("Key registration shouldn't fail.");
Expand Down
Loading
Loading