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

remove consensus, extraneous parameter for update_view, repoint deps #3755

Merged
merged 1 commit into from
Oct 11, 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
44 changes: 0 additions & 44 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,50 +59,6 @@ jobs:
timeout-minutes: 60
env:
RUST_BACKTRACE: full
test-dependency-tasks:
strategy:
matrix:
just_variants:
- async-std
- tokio
test_suites:
- test-ci-1
- test-ci-2
- test-ci-3
- test-ci-4
- test-ci-5
- test-ci-rest
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout Repository

- name: Install Rust
uses: mkroening/rust-toolchain-toml@main

- uses: Swatinem/rust-cache@v2
name: Enable Rust Caching
with:
shared-key: "test"
prefix-key: ${{ matrix.just_variants }}
cache-on-failure: "true"
save-if: "false"

- name: Install Just
run: |
wget https://github.com/casey/just/releases/download/1.14.0/just-1.14.0-x86_64-unknown-linux-musl.tar.gz
tar -vxf just-1.14.0-x86_64-unknown-linux-musl.tar.gz just
sudo cp just /usr/bin/just

- uses: taiki-e/install-action@nextest

- name: Unit and integration tests for all crates in workspace
run: |
just ${{ matrix.just_variants }} ${{ matrix.test_suites }} --features dependency-tasks
timeout-minutes: 60
env:
RUST_BACKTRACE: full

test-examples:
strategy:
Expand Down
1 change: 0 additions & 1 deletion crates/hotshot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ rust-version = { workspace = true }
default = ["docs", "doc-images"]
example-upgrade = ["hotshot-task-impls/example-upgrade"]
gpu-vid = ["hotshot-task-impls/gpu-vid"]
dependency-tasks = ["hotshot-task-impls/dependency-tasks"]
rewind = ["hotshot-task-impls/rewind"]

# Features required for binaries
Expand Down
2 changes: 0 additions & 2 deletions crates/hotshot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,6 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions> SystemContext<T
/// Panics if sending genesis fails
#[instrument(skip_all, target = "SystemContext", fields(id = self.id))]
pub async fn start_consensus(&self) {
#[cfg(feature = "dependency-tasks")]
tracing::error!("HotShot is running with the dependency tasks feature enabled!!");

#[cfg(all(feature = "rewind", not(debug_assertions)))]
Expand Down Expand Up @@ -388,7 +387,6 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions> SystemContext<T
.await;
}
});
#[cfg(feature = "dependency-tasks")]
{
if let Some(validated_state) = consensus.validated_state_map().get(&self.start_view) {
#[allow(clippy::panic)]
Expand Down
7 changes: 0 additions & 7 deletions crates/hotshot/src/tasks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,6 @@ 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, V>::create_from(handle).await);
}
{
#![cfg(feature = "dependency-tasks")]
use hotshot_task_impls::{
consensus2::Consensus2TaskState, quorum_proposal::QuorumProposalTaskState,
quorum_proposal_recv::QuorumProposalRecvTaskState, quorum_vote::QuorumVoteTaskState,
Expand Down
46 changes: 5 additions & 41 deletions crates/hotshot/src/tasks/task_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ use async_compatibility_layer::art::async_spawn;
use async_trait::async_trait;
use chrono::Utc;
use hotshot_task_impls::{
builder::BuilderClient, consensus::ConsensusTaskState, consensus2::Consensus2TaskState,
da::DaTaskState, quorum_proposal::QuorumProposalTaskState,
quorum_proposal_recv::QuorumProposalRecvTaskState, quorum_vote::QuorumVoteTaskState,
request::NetworkRequestState, rewind::RewindTaskState, transactions::TransactionTaskState,
upgrade::UpgradeTaskState, vid::VidTaskState, view_sync::ViewSyncTaskState,
builder::BuilderClient, consensus2::Consensus2TaskState, da::DaTaskState,
quorum_proposal::QuorumProposalTaskState, quorum_proposal_recv::QuorumProposalRecvTaskState,
quorum_vote::QuorumVoteTaskState, request::NetworkRequestState, rewind::RewindTaskState,
transactions::TransactionTaskState, upgrade::UpgradeTaskState, vid::VidTaskState,
view_sync::ViewSyncTaskState,
};
use hotshot_types::{
consensus::OuterConsensus,
Expand Down Expand Up @@ -214,42 +214,6 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions> CreateTaskState
}
}

#[async_trait]
impl<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions> CreateTaskState<TYPES, I, V>
for ConsensusTaskState<TYPES, I, V>
{
async fn create_from(handle: &SystemContextHandle<TYPES, I, V>) -> Self {
let consensus = handle.hotshot.consensus();

Self {
consensus: OuterConsensus::new(consensus),
instance_state: handle.hotshot.instance_state(),
timeout: handle.hotshot.config.next_view_timeout,
round_start_delay: handle.hotshot.config.round_start_delay,
cur_view: handle.cur_view().await,
cur_view_time: Utc::now().timestamp(),
payload_commitment_and_metadata: None,
vote_collectors: BTreeMap::default(),
timeout_vote_collectors: BTreeMap::default(),
timeout_task: async_spawn(async {}),
spawned_tasks: BTreeMap::new(),
formed_upgrade_certificate: None,
proposal_cert: None,
output_event_stream: handle.hotshot.external_event_stream.0.clone(),
current_proposal: None,
id: handle.hotshot.id,
public_key: handle.public_key().clone(),
private_key: handle.private_key().clone(),
network: Arc::clone(&handle.hotshot.network),
timeout_membership: handle.hotshot.memberships.quorum_membership.clone().into(),
quorum_membership: handle.hotshot.memberships.quorum_membership.clone().into(),
da_membership: handle.hotshot.memberships.da_membership.clone().into(),
storage: Arc::clone(&handle.storage),
upgrade_lock: handle.hotshot.upgrade_lock.clone(),
}
}
}

#[async_trait]
impl<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions> CreateTaskState<TYPES, I, V>
for QuorumVoteTaskState<TYPES, I, V>
Expand Down
6 changes: 3 additions & 3 deletions crates/orchestrator/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use std::{net::SocketAddr, time::Duration};

use crate::OrchestratorVersion;
use async_compatibility_layer::art::async_sleep;
use clap::Parser;
use futures::{Future, FutureExt};
Expand All @@ -18,10 +17,11 @@ use hotshot_types::{
use libp2p::{Multiaddr, PeerId};
use surf_disco::{error::ClientError, Client};
use tide_disco::Url;
use tracing::info;
use tracing::instrument;
use tracing::{info, instrument};
use vbs::BinarySerializer;

use crate::OrchestratorVersion;

/// Holds the client connection to the orchestrator
pub struct OrchestratorClient {
/// the client
Expand Down
4 changes: 1 addition & 3 deletions crates/orchestrator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use client::{BenchResults, BenchResultsDownloadConfig};
use csv::Writer;
use futures::{stream::FuturesUnordered, FutureExt, StreamExt};
use hotshot_types::{
network::BuilderType,
network::{BuilderType, NetworkConfig, PublicKeysFile},
traits::signature_key::{SignatureKey, StakeTableEntryType},
PeerConfig,
};
Expand All @@ -45,8 +45,6 @@ use vbs::{
BinarySerializer,
};

use hotshot_types::network::{NetworkConfig, PublicKeysFile};

/// Orchestrator is not, strictly speaking, bound to the network; it can have its own versioning.
/// Orchestrator Version (major)
pub const ORCHESTRATOR_MAJOR_VERSION: u16 = 0;
Expand Down
1 change: 0 additions & 1 deletion crates/task-impls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ version = { workspace = true }
[features]
example-upgrade = []
gpu-vid = ["hotshot-types/gpu-vid"]
dependency-tasks = []
rewind = []
test-srs = ["jf-vid/test-srs"]

Expand Down
Loading