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

Ungate dependency task modules #3511

Merged
merged 1 commit into from
Jul 29, 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
14 changes: 7 additions & 7 deletions crates/hotshot/src/tasks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,8 @@ use async_compatibility_layer::art::{async_sleep, async_spawn};
use async_lock::RwLock;
use async_trait::async_trait;
use hotshot_task::task::Task;
#[cfg(not(feature = "dependency-tasks"))]
use hotshot_task_impls::consensus::ConsensusTaskState;
#[cfg(feature = "rewind")]
use hotshot_task_impls::rewind::RewindTaskState;
#[cfg(feature = "dependency-tasks")]
use hotshot_task_impls::{
consensus2::Consensus2TaskState, quorum_proposal::QuorumProposalTaskState,
quorum_proposal_recv::QuorumProposalRecvTaskState, quorum_vote::QuorumVoteTaskState,
};
use hotshot_task_impls::{
da::DaTaskState,
events::HotShotEvent,
Expand Down Expand Up @@ -191,10 +184,17 @@ pub async fn add_consensus_tasks<TYPES: NodeType, I: NodeImplementation<TYPES>>(

{
#![cfg(not(feature = "dependency-tasks"))]
use hotshot_task_impls::consensus::ConsensusTaskState;

handle.add_task(ConsensusTaskState::<TYPES, I>::create_from(handle).await);
}
{
#![cfg(feature = "dependency-tasks")]
use hotshot_task_impls::{
consensus2::Consensus2TaskState, quorum_proposal::QuorumProposalTaskState,
quorum_proposal_recv::QuorumProposalRecvTaskState, quorum_vote::QuorumVoteTaskState,
};

handle.add_task(QuorumProposalTaskState::<TYPES, I>::create_from(handle).await);
handle.add_task(QuorumVoteTaskState::<TYPES, I>::create_from(handle).await);
handle.add_task(QuorumProposalRecvTaskState::<TYPES, I>::create_from(handle).await);
Expand Down
6 changes: 4 additions & 2 deletions crates/hotshot/src/traits/election/static_committee.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
use std::{marker::PhantomData, num::NonZeroU64};

use ethereum_types::U256;
use hotshot_types::traits::network::Topic;
// use ark_bls12_381::Parameters as Param381;
use hotshot_types::traits::signature_key::StakeTableEntryType;
use hotshot_types::{
signature_key::BLSPubKey,
traits::{election::Membership, node_implementation::NodeType, signature_key::SignatureKey},
traits::{
election::Membership, network::Topic, node_implementation::NodeType,
signature_key::SignatureKey,
},
PeerConfig,
};
#[cfg(feature = "randomized-leader-election")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
use std::{marker::PhantomData, num::NonZeroU64};

use ethereum_types::U256;
use hotshot_types::traits::network::Topic;
// use ark_bls12_381::Parameters as Param381;
use hotshot_types::traits::signature_key::StakeTableEntryType;
use hotshot_types::{
signature_key::BLSPubKey,
traits::{election::Membership, node_implementation::NodeType, signature_key::SignatureKey},
traits::{
election::Membership, network::Topic, node_implementation::NodeType,
signature_key::SignatureKey,
},
PeerConfig,
};
use tracing::debug;
Expand Down
2 changes: 0 additions & 2 deletions crates/task-impls/src/quorum_proposal/handlers.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
//! This module holds the dependency task for the QuorumProposalTask. It is spawned whenever an event that could
//! initiate a proposal occurs.

#![cfg(feature = "dependency-tasks")]

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

use anyhow::{ensure, Context, Result};
Expand Down
2 changes: 0 additions & 2 deletions crates/task-impls/src/quorum_proposal/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(feature = "dependency-tasks")]

use std::{collections::HashMap, sync::Arc};

use anyhow::Result;
Expand Down
1 change: 0 additions & 1 deletion crates/task-impls/src/quorum_proposal_recv/handlers.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![allow(dead_code)]
#![cfg(feature = "dependency-tasks")]

use std::sync::Arc;

Expand Down
1 change: 0 additions & 1 deletion crates/task-impls/src/quorum_proposal_recv/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![allow(unused_imports)]
#![cfg(feature = "dependency-tasks")]

use std::{collections::BTreeMap, sync::Arc};

Expand Down
2 changes: 0 additions & 2 deletions crates/task-impls/src/quorum_vote/handlers.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(feature = "dependency-tasks")]

use std::sync::Arc;

use anyhow::Result;
Expand Down
2 changes: 0 additions & 2 deletions crates/task-impls/src/quorum_vote/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg(feature = "dependency-tasks")]

use std::{collections::HashMap, sync::Arc};

use anyhow::{bail, ensure, Context, Result};
Expand Down