Skip to content

Commit

Permalink
[WEEKLY RELEASE] HotShot - rc-0.5.72 (#3601)
Browse files Browse the repository at this point in the history
  • Loading branch information
ss-es authored Aug 26, 2024
1 parent 9e41d8c commit 165cbad
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 35 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "0.5.71" # same as `hotshot`, but workspace subcrate can also release its own version
version = "0.5.72" # 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 @@ -176,4 +176,4 @@ module_name_repetitions = "allow"
rust_2018_idioms = "warn"
# TODO change to deny
missing_docs = "warn"
warnings = "warn"
warnings = "warn"
2 changes: 1 addition & 1 deletion crates/hotshot/src/tasks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
/// Provides trait to create task states from a `SystemContextHandle`
pub mod task_state;
use hotshot_task::task::{NetworkHandle, Task};
use std::{collections::HashSet, sync::Arc, time::Duration};

use async_broadcast::broadcast;
Expand All @@ -19,6 +18,7 @@ use futures::{
future::{BoxFuture, FutureExt},
stream, StreamExt,
};
use hotshot_task::task::{NetworkHandle, Task};
#[cfg(feature = "rewind")]
use hotshot_task_impls::rewind::RewindTaskState;
use hotshot_task_impls::{
Expand Down
9 changes: 6 additions & 3 deletions crates/task-impls/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@

use std::fmt::Display;

use crate::view_sync::ViewSyncPhase;
use async_broadcast::Sender;
use either::Either;
use hotshot_task::task::TaskEvent;
use hotshot_types::traits::signature_key::SignatureKey;
use hotshot_types::{
data::{
DaProposal, Leaf, PackedBundle, QuorumProposal, UpgradeProposal, VidDisperse,
Expand All @@ -26,13 +24,18 @@ use hotshot_types::{
DaVote, QuorumVote, TimeoutVote, UpgradeVote, ViewSyncCommitVote, ViewSyncFinalizeVote,
ViewSyncPreCommitVote,
},
traits::{block_contents::BuilderFee, node_implementation::NodeType, BlockPayload},
traits::{
block_contents::BuilderFee, node_implementation::NodeType, signature_key::SignatureKey,
BlockPayload,
},
utils::{BuilderCommitment, View},
vid::VidCommitment,
vote::HasViewNumber,
};
use vec1::Vec1;

use crate::view_sync::ViewSyncPhase;

impl<TYPES: NodeType> TaskEvent for HotShotEvent<TYPES> {
fn shutdown_event() -> Self {
HotShotEvent::Shutdown
Expand Down
10 changes: 5 additions & 5 deletions crates/task-impls/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use std::{
sync::Arc,
};

use crate::{events::HotShotEvent, request::REQUEST_TIMEOUT};
use anyhow::{bail, ensure, Context, Result};
use async_broadcast::{Receiver, SendError, Sender};
use async_compatibility_layer::art::{async_sleep, async_spawn, async_timeout};
Expand All @@ -20,28 +19,29 @@ use async_std::task::JoinHandle;
use chrono::Utc;
use committable::{Commitment, Committable};
use hotshot_task::dependency::{Dependency, EventDependency};
use hotshot_types::traits::node_implementation::Versions;
use hotshot_types::{
consensus::{ConsensusUpgradableReadLockGuard, OuterConsensus},
data::{Leaf, QuorumProposal, ViewChangeEvidence},
event::{Event, EventType, LeafInfo},
message::Proposal,
message::{Proposal, UpgradeLock},
request_response::ProposalRequestPayload,
simple_certificate::{QuorumCertificate, UpgradeCertificate},
traits::{
block_contents::BlockHeader,
election::Membership,
node_implementation::{ConsensusTime, NodeType},
node_implementation::{ConsensusTime, NodeType, Versions},
signature_key::SignatureKey,
BlockPayload, ValidatedState,
},
utils::{Terminator, View, ViewInner},
vote::{Certificate, HasViewNumber},
};
use hotshot_types::{message::UpgradeLock, request_response::ProposalRequestPayload};
#[cfg(async_executor_impl = "tokio")]
use tokio::task::JoinHandle;
use tracing::{debug, error, info, instrument, warn};

use crate::{events::HotShotEvent, request::REQUEST_TIMEOUT};

/// Trigger a request to the network for a proposal for a view and wait for the response or timeout.
#[instrument(skip_all)]
#[allow(clippy::too_many_arguments)]
Expand Down
6 changes: 3 additions & 3 deletions crates/testing/tests/tests_1/network_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
// You should have received a copy of the MIT License
// along with the HotShot repository. If not, see <https://mit-license.org/>.

use std::{sync::Arc, time::Duration};

use async_broadcast::Sender;
use async_compatibility_layer::art::async_timeout;
use async_lock::RwLock;
use hotshot::traits::implementations::MemoryNetwork;
use hotshot_example_types::node_types::{MemoryImpl, TestTypes, TestVersions};
use hotshot_task::task::TaskState;
use hotshot_task::task::{ConsensusTaskRegistry, Task};
use hotshot_task::task::{ConsensusTaskRegistry, Task, TaskState};
use hotshot_task_impls::{
events::HotShotEvent,
network::{self, NetworkEventTaskState},
Expand All @@ -27,7 +28,6 @@ use hotshot_types::{
node_implementation::{ConsensusTime, NodeType},
},
};
use std::{sync::Arc, time::Duration};

// Test that the event task sends a message, and the message task receives it
// and emits the proper event
Expand Down
12 changes: 7 additions & 5 deletions crates/testing/tests/tests_1/quorum_proposal_recv_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ use hotshot_testing::{
serial,
view_generator::TestViewGenerator,
};
use hotshot_types::request_response::ProposalRequestPayload;
use hotshot_types::traits::consensus_api::ConsensusApi;
use hotshot_types::traits::node_implementation::NodeType;
use hotshot_types::traits::signature_key::SignatureKey;
use hotshot_types::{
data::ViewNumber,
traits::{node_implementation::ConsensusTime, ValidatedState},
request_response::ProposalRequestPayload,
traits::{
consensus_api::ConsensusApi,
node_implementation::{ConsensusTime, NodeType},
signature_key::SignatureKey,
ValidatedState,
},
};

#[cfg(test)]
Expand Down
6 changes: 3 additions & 3 deletions crates/testing/tests/tests_1/test_with_failures_2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
#![allow(unused_imports)]
use std::{
collections::{HashMap, HashSet},
rc::Rc,
time::Duration,
};

use hotshot::tasks::DishonestDa;
use hotshot::tasks::{DishonestDa, DishonestLeader};
use hotshot_example_types::{
node_types::{
Libp2pImpl, MarketplaceTestVersions, MemoryImpl, PushCdnImpl, TestConsecutiveLeaderTypes,
Expand All @@ -24,11 +25,10 @@ use hotshot_testing::{
block_builder::SimpleBuilderImplementation,
completion_task::{CompletionTaskDescription, TimeBasedCompletionTaskDescription},
spinning_task::{ChangeNode, SpinningTaskDescription, UpDown},
test_builder::TestDescription,
test_builder::{Behaviour, TestDescription},
view_sync_task::ViewSyncTaskDescription,
};
use hotshot_types::{data::ViewNumber, traits::node_implementation::ConsensusTime};
use {hotshot::tasks::DishonestLeader, hotshot_testing::test_builder::Behaviour, std::rc::Rc};
// Test that a good leader can succeed in the view directly after view sync
cross_tests!(
TestName: test_with_failures_2,
Expand Down
20 changes: 10 additions & 10 deletions crates/types/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ use vbs::{
BinarySerializer, Serializer,
};

use crate::request_response::ProposalRequestPayload;
use crate::{
data::{DaProposal, Leaf, QuorumProposal, UpgradeProposal, VidDisperseShare},
request_response::ProposalRequestPayload,
simple_certificate::{
DaCertificate, UpgradeCertificate, ViewSyncCommitCertificate2,
ViewSyncFinalizeCertificate2, ViewSyncPreCommitCertificate2,
Expand Down Expand Up @@ -163,15 +163,6 @@ pub enum GeneralConsensusMessage<TYPES: NodeType> {
/// Message with a quorum proposal.
Proposal(Proposal<TYPES, QuorumProposal<TYPES>>),

/// A peer node needs a proposal from the leader.
ProposalRequested(
ProposalRequestPayload<TYPES>,
<TYPES::SignatureKey as SignatureKey>::PureAssembledSignatureType,
),

/// The leader has responded with a valid proposal.
LeaderProposalAvailable(Proposal<TYPES, QuorumProposal<TYPES>>),

/// Message with a quorum vote.
Vote(QuorumVote<TYPES>),

Expand Down Expand Up @@ -201,6 +192,15 @@ pub enum GeneralConsensusMessage<TYPES: NodeType> {

/// Message with an upgrade vote
UpgradeVote(UpgradeVote<TYPES>),

/// A peer node needs a proposal from the leader.
ProposalRequested(
ProposalRequestPayload<TYPES>,
<TYPES::SignatureKey as SignatureKey>::PureAssembledSignatureType,
),

/// The leader has responded with a valid proposal.
LeaderProposalAvailable(Proposal<TYPES, QuorumProposal<TYPES>>),
}

#[derive(Deserialize, Serialize, Clone, Debug, PartialEq, Hash, Eq)]
Expand Down
5 changes: 3 additions & 2 deletions crates/types/src/request_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ use futures::channel::{mpsc::Receiver, oneshot};
use libp2p::request_response::ResponseChannel;
use serde::{Deserialize, Serialize};

use crate::traits::signature_key::SignatureKey;
use crate::traits::{network::NetworkMsg, node_implementation::NodeType};
use crate::traits::{
network::NetworkMsg, node_implementation::NodeType, signature_key::SignatureKey,
};

/// Request for Consenus data
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
Expand Down
2 changes: 1 addition & 1 deletion crates/types/src/simple_certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ use committable::{Commitment, Committable};
use ethereum_types::U256;
use serde::{Deserialize, Serialize};

use crate::message::UpgradeLock;
use crate::{
data::serialize_signature2,
message::UpgradeLock,
simple_vote::{
DaData, QuorumData, TimeoutData, UpgradeProposalData, VersionedVoteData,
ViewSyncCommitData, ViewSyncFinalizeData, ViewSyncPreCommitData, Voteable,
Expand Down

0 comments on commit 165cbad

Please sign in to comment.