Skip to content

Commit

Permalink
[DEPENDENCY_REFACTOR] - Move all the dependency code into consensus2 (#…
Browse files Browse the repository at this point in the history
…3397)

* Fix view

* Move files

* Fix after merge

* Fix doc
  • Loading branch information
shenkeyao authored Jun 28, 2024
1 parent 2644ba4 commit 91d8d4e
Show file tree
Hide file tree
Showing 18 changed files with 1,670 additions and 1,686 deletions.
18 changes: 14 additions & 4 deletions crates/hotshot/src/tasks/task_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ use std::{

use async_trait::async_trait;
use chrono::Utc;
#[cfg(not(feature = "dependency-tasks"))]
use hotshot_task_impls::consensus::ConsensusTaskState;
#[cfg(feature = "rewind")]
use hotshot_task_impls::rewind::RewindTaskState;
use hotshot_task_impls::{
builder::BuilderClient, consensus::ConsensusTaskState, consensus2::Consensus2TaskState,
da::DaTaskState, quorum_proposal::QuorumProposalTaskState,
builder::BuilderClient, da::DaTaskState, request::NetworkRequestState,
transactions::TransactionTaskState, upgrade::UpgradeTaskState, vid::VidTaskState,
view_sync::ViewSyncTaskState,
};
#[cfg(feature = "dependency-tasks")]
use hotshot_task_impls::{
consensus2::Consensus2TaskState, quorum_proposal::QuorumProposalTaskState,
quorum_proposal_recv::QuorumProposalRecvTaskState, quorum_vote::QuorumVoteTaskState,
request::NetworkRequestState, transactions::TransactionTaskState, upgrade::UpgradeTaskState,
vid::VidTaskState, view_sync::ViewSyncTaskState,
};
use hotshot_types::traits::{
consensus_api::ConsensusApi,
Expand Down Expand Up @@ -198,6 +203,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>> CreateTaskState<TYPES, I>
}
}

#[cfg(not(feature = "dependency-tasks"))]
#[async_trait]
impl<TYPES: NodeType, I: NodeImplementation<TYPES>> CreateTaskState<TYPES, I>
for ConsensusTaskState<TYPES, I>
Expand Down Expand Up @@ -237,6 +243,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>> CreateTaskState<TYPES, I>
}
}

#[cfg(feature = "dependency-tasks")]
#[async_trait]
impl<TYPES: NodeType, I: NodeImplementation<TYPES>> CreateTaskState<TYPES, I>
for QuorumVoteTaskState<TYPES, I>
Expand All @@ -263,6 +270,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>> CreateTaskState<TYPES, I>
}
}

#[cfg(feature = "dependency-tasks")]
#[async_trait]
impl<TYPES: NodeType, I: NodeImplementation<TYPES>> CreateTaskState<TYPES, I>
for QuorumProposalTaskState<TYPES, I>
Expand Down Expand Up @@ -296,6 +304,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>> CreateTaskState<TYPES, I>
}
}

#[cfg(feature = "dependency-tasks")]
#[async_trait]
impl<TYPES: NodeType, I: NodeImplementation<TYPES>> CreateTaskState<TYPES, I>
for QuorumProposalRecvTaskState<TYPES, I>
Expand Down Expand Up @@ -330,6 +339,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>> CreateTaskState<TYPES, I>
}
}

#[cfg(feature = "dependency-tasks")]
#[async_trait]
impl<TYPES: NodeType, I: NodeImplementation<TYPES>> CreateTaskState<TYPES, I>
for Consensus2TaskState<TYPES, I>
Expand Down
Loading

0 comments on commit 91d8d4e

Please sign in to comment.