Skip to content

Commit

Permalink
ungate dependency task modules
Browse files Browse the repository at this point in the history
  • Loading branch information
ss-es committed Jul 29, 2024
1 parent 63abe0b commit 62070af
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 21 deletions.
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

0 comments on commit 62070af

Please sign in to comment.