From f5941ff6e4809f92e89a27b104803ff1c2fc1269 Mon Sep 17 00:00:00 2001 From: Brendon Fish Date: Tue, 29 Oct 2024 14:45:44 -0400 Subject: [PATCH] Remove unused config stuff (#3771) * Remove unused config stuff * remove is_da param in a bunch of places * don't reset lock in bad proposal task * lint * allow one timeout * allow bad proposal leader to fail everytime * fix after merge * correct num fails * final fix * more * reset actions * lint * log at debug * Fix test 3 --- crates/examples/infra/mod.rs | 15 ++------ crates/hotshot/src/lib.rs | 4 +-- crates/hotshot/src/tasks/task_state.rs | 2 -- .../src/traits/networking/combined_network.rs | 3 -- .../src/traits/networking/libp2p_network.rs | 35 +------------------ .../src/traits/networking/memory_network.rs | 1 - .../src/traits/networking/push_cdn_network.rs | 1 - crates/orchestrator/run-config.toml | 4 --- crates/orchestrator/staging-config.toml | 4 --- .../src/quorum_proposal/handlers.rs | 8 ++--- crates/task-impls/src/quorum_proposal/mod.rs | 4 --- .../src/quorum_proposal_recv/mod.rs | 3 -- crates/task/src/task.rs | 2 +- .../src/byzantine/byzantine_behaviour.rs | 6 ++-- crates/testing/src/test_builder.rs | 28 +-------------- crates/testing/tests/tests_2/catchup.rs | 5 --- .../testing/tests/tests_3/byzantine_tests.rs | 4 +-- .../testing/tests/tests_5/combined_network.rs | 10 ------ crates/testing/tests/tests_5/push_cdn.rs | 3 -- crates/testing/tests/tests_5/timeout.rs | 2 -- .../tests/tests_5/unreliable_network.rs | 2 -- crates/types/src/constants.rs | 2 -- crates/types/src/hotshot_config_file.rs | 22 ++---------- crates/types/src/lib.rs | 22 ------------ crates/types/src/network.rs | 12 ++----- crates/types/src/traits/network.rs | 1 - .../types/src/traits/node_implementation.rs | 1 - 27 files changed, 18 insertions(+), 188 deletions(-) diff --git a/crates/examples/infra/mod.rs b/crates/examples/infra/mod.rs index 0c7e8db673..929232e45d 100755 --- a/crates/examples/infra/mod.rs +++ b/crates/examples/infra/mod.rs @@ -12,13 +12,10 @@ use std::{ net::{IpAddr, Ipv4Addr, SocketAddr, SocketAddrV4}, num::NonZeroUsize, sync::Arc, - time::{Duration, Instant}, + time::Instant, }; -use async_compatibility_layer::{ - art::async_sleep, - logging::{setup_backtrace, setup_logging}, -}; +use async_compatibility_layer::logging::{setup_backtrace, setup_logging}; use async_trait::async_trait; use cdn_broker::reexports::crypto::signature::KeyPair; use chrono::Utc; @@ -443,10 +440,7 @@ pub trait RunDa< transaction_size_in_bytes: u64, ) -> BenchResults { let NetworkConfig { - rounds, - node_index, - start_delay_seconds, - .. + rounds, node_index, .. } = self.config(); let mut total_transactions_committed = 0; @@ -456,9 +450,6 @@ pub trait RunDa< let mut total_latency = 0; let mut num_latency = 0; - info!("Sleeping for {start_delay_seconds} seconds before starting hotshot!"); - async_sleep(Duration::from_secs(start_delay_seconds)).await; - info!("Starting HotShot example!"); let start = Instant::now(); diff --git a/crates/hotshot/src/lib.rs b/crates/hotshot/src/lib.rs index 8c91554e4d..08b1ef1548 100644 --- a/crates/hotshot/src/lib.rs +++ b/crates/hotshot/src/lib.rs @@ -506,9 +506,9 @@ impl, V: Versions> SystemContext, V: Versions> CreateTaskState private_key: handle.private_key().clone(), storage: Arc::clone(&handle.storage), timeout: handle.hotshot.config.next_view_timeout, - round_start_delay: handle.hotshot.config.round_start_delay, id: handle.hotshot.id, formed_upgrade_certificate: None, upgrade_lock: handle.hotshot.upgrade_lock.clone(), @@ -292,7 +291,6 @@ impl, V: Versions> CreateTaskState timeout_membership: handle.hotshot.memberships.quorum_membership.clone().into(), timeout_task: async_spawn(async {}), timeout: handle.hotshot.config.next_view_timeout, - round_start_delay: handle.hotshot.config.round_start_delay, output_event_stream: handle.hotshot.external_event_stream.0.clone(), storage: Arc::clone(&handle.storage), proposal_cert: None, diff --git a/crates/hotshot/src/traits/networking/combined_network.rs b/crates/hotshot/src/traits/networking/combined_network.rs index 002f5d543c..584e4e888e 100644 --- a/crates/hotshot/src/traits/networking/combined_network.rs +++ b/crates/hotshot/src/traits/networking/combined_network.rs @@ -261,7 +261,6 @@ impl TestableNetworkingImplementation for CombinedNetwor num_bootstrap: usize, network_id: usize, da_committee_size: usize, - is_da: bool, reliability_config: Option>, secondary_network_delay: Duration, ) -> AsyncGenerator> { @@ -271,7 +270,6 @@ impl TestableNetworkingImplementation for CombinedNetwor num_bootstrap, network_id, da_committee_size, - is_da, None, Duration::default(), ), @@ -280,7 +278,6 @@ impl TestableNetworkingImplementation for CombinedNetwor num_bootstrap, network_id, da_committee_size, - is_da, reliability_config, Duration::default(), ) diff --git a/crates/hotshot/src/traits/networking/libp2p_network.rs b/crates/hotshot/src/traits/networking/libp2p_network.rs index 34e5992f13..de0a76156a 100644 --- a/crates/hotshot/src/traits/networking/libp2p_network.rs +++ b/crates/hotshot/src/traits/networking/libp2p_network.rs @@ -174,8 +174,6 @@ struct Libp2pNetworkInner { #[cfg(feature = "hotshot-testing")] /// reliability_config reliability_config: Option>, - /// if we're a member of the DA committee or not - is_da: bool, /// Killswitch sender kill_switch: channel::Sender<()>, } @@ -207,7 +205,6 @@ impl TestableNetworkingImplementation num_bootstrap: usize, _network_id: usize, da_committee_size: usize, - _is_da: bool, reliability_config: Option>, _secondary_network_delay: Duration, ) -> AsyncGenerator> { @@ -217,16 +214,6 @@ impl TestableNetworkingImplementation ); let bootstrap_addrs: PeerInfoVec = Arc::default(); let node_ids: Arc>> = Arc::default(); - // We assign known_nodes' public key and stake value rather than read from config file since it's a test - let mut da_keys = BTreeSet::new(); - - for i in 0u64..(expected_node_count as u64) { - let privkey = TYPES::SignatureKey::generated_from_seed_indexed([0u8; 32], i).1; - let pubkey = TYPES::SignatureKey::from_private(&privkey); - if i < da_committee_size as u64 { - da_keys.insert(pubkey.clone()); - } - } // NOTE uncomment this for easier debugging // let start_port = 5000; @@ -277,7 +264,6 @@ impl TestableNetworkingImplementation let bootstrap_addrs_ref = Arc::clone(&bootstrap_addrs); let node_ids_ref = Arc::clone(&node_ids); - let da = da_keys.clone(); let reliability_config_dup = reliability_config.clone(); Box::pin(async move { @@ -299,7 +285,6 @@ impl TestableNetworkingImplementation usize::try_from(node_id).unwrap(), #[cfg(feature = "hotshot-testing")] reliability_config_dup, - da.contains(&pubkey), ) .await { @@ -484,12 +469,6 @@ impl Libp2pNetwork { // Calculate all keys so we can keep track of direct message recipients let mut all_keys = BTreeSet::new(); - let mut da_keys = BTreeSet::new(); - - // Make a node DA if it is under the staked committee size - for node in config.config.known_da_nodes { - da_keys.insert(K::public_key(&node.stake_table_entry)); - } // Insert all known nodes into the set of all keys for node in config.config.known_nodes_with_stake { @@ -505,7 +484,6 @@ impl Libp2pNetwork { usize::try_from(config.node_index)?, #[cfg(feature = "hotshot-testing")] None, - da_keys.contains(pub_key), ) .await?) } @@ -547,7 +525,6 @@ impl Libp2pNetwork { bootstrap_addrs: BootstrapAddrs, id: usize, #[cfg(feature = "hotshot-testing")] reliability_config: Option>, - is_da: bool, ) -> Result, NetworkError> { let (mut rx, network_handle) = spawn_network_node::(config.clone(), id) .await @@ -562,10 +539,7 @@ impl Libp2pNetwork { pubkey_pid_map.insert(pk.clone(), network_handle.peer_id()); // Subscribe to the relevant topics - let mut subscribed_topics = HashSet::from_iter(vec![QC_TOPIC.to_string()]); - if is_da { - subscribed_topics.insert("DA".to_string()); - } + let subscribed_topics = HashSet::from_iter(vec![QC_TOPIC.to_string()]); // unbounded channels may not be the best choice (spammed?) // if bounded figure out a way to log dropped msgs @@ -594,7 +568,6 @@ impl Libp2pNetwork { latest_seen_view: Arc::new(AtomicU64::new(0)), #[cfg(feature = "hotshot-testing")] reliability_config, - is_da, kill_switch: kill_tx, }), }; @@ -644,7 +617,6 @@ impl Libp2pNetwork { let handle = Arc::clone(&self.inner.handle); let is_bootstrapped = Arc::clone(&self.inner.is_bootstrapped); let inner = Arc::clone(&self.inner); - let is_da = self.inner.is_da; async_spawn({ let is_ready = Arc::clone(&self.inner.is_ready); @@ -664,11 +636,6 @@ impl Libp2pNetwork { // Subscribe to the QC topic handle.subscribe(QC_TOPIC.to_string()).await.unwrap(); - // Only subscribe to DA events if we are DA - if is_da { - handle.subscribe("DA".to_string()).await.unwrap(); - } - // Map our staking key to our Libp2p Peer ID so we can properly // route direct messages while handle diff --git a/crates/hotshot/src/traits/networking/memory_network.rs b/crates/hotshot/src/traits/networking/memory_network.rs index 54fcdd9d1b..e86c773e71 100644 --- a/crates/hotshot/src/traits/networking/memory_network.rs +++ b/crates/hotshot/src/traits/networking/memory_network.rs @@ -190,7 +190,6 @@ impl TestableNetworkingImplementation _num_bootstrap: usize, _network_id: usize, da_committee_size: usize, - _is_da: bool, reliability_config: Option>, _secondary_network_delay: Duration, ) -> AsyncGenerator> { diff --git a/crates/hotshot/src/traits/networking/push_cdn_network.rs b/crates/hotshot/src/traits/networking/push_cdn_network.rs index dc38f979cf..c0c2f5d957 100644 --- a/crates/hotshot/src/traits/networking/push_cdn_network.rs +++ b/crates/hotshot/src/traits/networking/push_cdn_network.rs @@ -271,7 +271,6 @@ impl TestableNetworkingImplementation _num_bootstrap: usize, _network_id: usize, da_committee_size: usize, - _is_da: bool, _reliability_config: Option>, _secondary_network_delay: Duration, ) -> AsyncGenerator> { diff --git a/crates/orchestrator/run-config.toml b/crates/orchestrator/run-config.toml index d1fecc10c9..04ab883a2e 100644 --- a/crates/orchestrator/run-config.toml +++ b/crates/orchestrator/run-config.toml @@ -4,7 +4,6 @@ transactions_per_round = 10 transaction_size = 1000 node_index = 0 seed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] -start_delay_seconds = 0 cdn_marshal_address = "127.0.0.1:9000" public_keys = [ { stake_table_key = "BLS_VER_KEY~bQszS-QKYvUij2g20VqS8asttGSb95NrTu2PUj0uMh1CBUxNy1FqyPDjZqB29M7ZbjWqj79QkEOWkpga84AmDYUeTuWmy-0P1AdKHD3ehc-dKvei78BDj5USwXPJiDUlCxvYs_9rWYhagaq-5_LXENr78xel17spftNd5MA1Mw5U", state_ver_key = "SCHNORR_VER_KEY~lJqDaVZyM0hWP2Br52IX5FeE-dCAIC-dPX7bL5-qUx-vjbunwe-ENOeZxj6FuOyvDCFzoGeP7yZ0fM995qF-CRE", stake = 1, da = true }, @@ -34,9 +33,6 @@ start_threshold = [8, 10] staked_da_nodes = 10 fixed_leader_for_gpuvid = 1 next_view_timeout = 30000 -timeout_ratio = [11, 10] -round_start_delay = 1 -start_delay = 1 num_bootstrap = 5 epoch_height = 0 diff --git a/crates/orchestrator/staging-config.toml b/crates/orchestrator/staging-config.toml index 417a19f10b..61c5adb696 100644 --- a/crates/orchestrator/staging-config.toml +++ b/crates/orchestrator/staging-config.toml @@ -38,7 +38,6 @@ seed = [ 0 ] transaction_size = 100 -start_delay_seconds = 10 builder = "Simple" [config] @@ -47,9 +46,6 @@ num_nodes_with_stake = 10 staked_da_nodes = 10 fixed_leader_for_gpuvid = 1 next_view_timeout = 15_000 -timeout_ratio = [ 11, 10 ] -round_start_delay = 1 -start_delay = 10_000 num_bootstrap = 5 builder_urls = [ "https://builder.staging.testnet.espresso.network/" ] diff --git a/crates/task-impls/src/quorum_proposal/handlers.rs b/crates/task-impls/src/quorum_proposal/handlers.rs index 4994a228d6..ffad0f5d1e 100644 --- a/crates/task-impls/src/quorum_proposal/handlers.rs +++ b/crates/task-impls/src/quorum_proposal/handlers.rs @@ -7,10 +7,10 @@ //! This module holds the dependency task for the QuorumProposalTask. It is spawned whenever an event that could //! initiate a proposal occurs. -use std::{marker::PhantomData, sync::Arc, time::Duration}; +use std::{marker::PhantomData, sync::Arc}; use async_broadcast::{InactiveReceiver, Sender}; -use async_compatibility_layer::art::{async_sleep, async_spawn}; +use async_compatibility_layer::art::async_spawn; use async_lock::RwLock; use hotshot_task::{ dependency::{Dependency, EventDependency}, @@ -83,9 +83,6 @@ pub struct ProposalDependencyHandle { /// Our Private Key pub private_key: ::PrivateKey, - /// Round start delay from config, in milliseconds. - pub round_start_delay: u64, - /// Shared consensus task state pub consensus: OuterConsensus, @@ -233,7 +230,6 @@ impl ProposalDependencyHandle { proposed_leaf.view_number(), ); - async_sleep(Duration::from_millis(self.round_start_delay)).await; broadcast_event( Arc::new(HotShotEvent::QuorumProposalSend( message.clone(), diff --git a/crates/task-impls/src/quorum_proposal/mod.rs b/crates/task-impls/src/quorum_proposal/mod.rs index 65d905b47b..5d33e16664 100644 --- a/crates/task-impls/src/quorum_proposal/mod.rs +++ b/crates/task-impls/src/quorum_proposal/mod.rs @@ -76,9 +76,6 @@ pub struct QuorumProposalTaskState /// View timeout from config. pub timeout: u64, - /// Round start delay from config, in milliseconds. - pub round_start_delay: u64, - /// This node's storage ref pub storage: Arc>, @@ -326,7 +323,6 @@ impl, V: Versions> quorum_membership: Arc::clone(&self.quorum_membership), public_key: self.public_key.clone(), private_key: self.private_key.clone(), - round_start_delay: self.round_start_delay, instance_state: Arc::clone(&self.instance_state), consensus: OuterConsensus::new(Arc::clone(&self.consensus.inner_consensus)), formed_upgrade_certificate: self.formed_upgrade_certificate.clone(), diff --git a/crates/task-impls/src/quorum_proposal_recv/mod.rs b/crates/task-impls/src/quorum_proposal_recv/mod.rs index c1f10a038e..030dc1295c 100644 --- a/crates/task-impls/src/quorum_proposal_recv/mod.rs +++ b/crates/task-impls/src/quorum_proposal_recv/mod.rs @@ -78,9 +78,6 @@ pub struct QuorumProposalRecvTaskState>, diff --git a/crates/task/src/task.rs b/crates/task/src/task.rs index fc60db3064..6d0e0ca461 100644 --- a/crates/task/src/task.rs +++ b/crates/task/src/task.rs @@ -91,7 +91,7 @@ impl Task { let _ = S::handle_event(&mut self.state, input, &self.sender, &self.receiver) .await - .inspect_err(|e| tracing::info!("{e}")); + .inspect_err(|e| tracing::debug!("{e}")); } Err(RecvError::Closed) => { break self.boxed_state(); diff --git a/crates/testing/src/byzantine/byzantine_behaviour.rs b/crates/testing/src/byzantine/byzantine_behaviour.rs index e92e33cdd4..30233dd269 100644 --- a/crates/testing/src/byzantine/byzantine_behaviour.rs +++ b/crates/testing/src/byzantine/byzantine_behaviour.rs @@ -54,9 +54,7 @@ impl, V: Versions> EventTransforme HotShotEvent::QuorumProposalSend(proposal, signature) => { let mut result = Vec::new(); - for n in 0..self.multiplier { - // reset last actioned view so we actually propose multiple times - consensus.write().await.reset_actions(); + for n in 1..self.multiplier { let mut modified_proposal = proposal.clone(); modified_proposal.data.view_number += n * self.increment; @@ -66,8 +64,8 @@ impl, V: Versions> EventTransforme signature.clone(), )); } - consensus.write().await.reset_actions(); + consensus.write().await.reset_actions(); result } _ => vec![event.clone()], diff --git a/crates/testing/src/test_builder.rs b/crates/testing/src/test_builder.rs index 64d16ede22..15cbb293ed 100644 --- a/crates/testing/src/test_builder.rs +++ b/crates/testing/src/test_builder.rs @@ -20,7 +20,7 @@ use hotshot_example_types::{ use hotshot_types::{ consensus::ConsensusMetricsValue, traits::node_implementation::{NodeType, Versions}, - ExecutionType, HotShotConfig, ValidatorConfig, + HotShotConfig, ValidatorConfig, }; use tide_disco::Url; use vec1::Vec1; @@ -44,12 +44,6 @@ pub type TransactionValidator = Arc) -> Result<()> + Sen pub struct TimingData { /// Base duration for next-view timeout, in milliseconds pub next_view_timeout: u64, - /// The exponential backoff ration for the next-view timeout - pub timeout_ratio: (u64, u64), - /// The delay a leader inserts before starting pre-commit, in milliseconds - pub round_start_delay: u64, - /// Delay after init before starting consensus, in milliseconds - pub start_delay: u64, /// The maximum amount of time a leader can wait to get a block from a builder pub builder_timeout: Duration, /// time to wait until we request data associated with a proposal @@ -287,9 +281,6 @@ impl Default for TimingData { fn default() -> Self { Self { next_view_timeout: 4000, - timeout_ratio: (11, 10), - round_start_delay: 100, - start_delay: 100, builder_timeout: Duration::from_millis(500), data_request_delay: Duration::from_millis(200), secondary_network_delay: Duration::from_millis(1000), @@ -320,9 +311,6 @@ impl, V: Versions> TestDescription }, timing_data: TimingData { next_view_timeout: 2000, - timeout_ratio: (1, 1), - start_delay: 20000, - round_start_delay: 25, ..TimingData::default() }, view_sync_properties: ViewSyncTaskDescription::Threshold(0, num_nodes_with_stake), @@ -349,8 +337,6 @@ impl, V: Versions> TestDescription expected_views_to_fail: HashMap::new(), }, timing_data: TimingData { - start_delay: 120_000, - round_start_delay: 25, ..TimingData::default() }, view_sync_properties: ViewSyncTaskDescription::Threshold(0, num_nodes_with_stake), @@ -500,23 +486,17 @@ where ); // let da_committee_nodes = known_nodes[0..da_committee_size].to_vec(); let config = HotShotConfig { - // TODO this doesn't exist anymore - execution_type: ExecutionType::Incremental, start_threshold: (1, 1), num_nodes_with_stake: NonZeroUsize::new(num_nodes_with_stake).unwrap(), // Currently making this zero for simplicity known_da_nodes, num_bootstrap: num_bootstrap_nodes, known_nodes_with_stake, - known_nodes_without_stake: vec![], my_own_validator_config, da_staked_committee_size, fixed_leader_for_gpuvid: 1, next_view_timeout: 500, view_sync_timeout: Duration::from_millis(250), - timeout_ratio: (11, 10), - round_start_delay: 25, - start_delay: 1, builder_timeout: Duration::from_millis(1000), data_request_delay: Duration::from_millis(200), // Placeholder until we spin up the builder @@ -533,9 +513,6 @@ where }; let TimingData { next_view_timeout, - timeout_ratio, - round_start_delay, - start_delay, builder_timeout, data_request_delay, secondary_network_delay, @@ -545,9 +522,6 @@ where // TODO this should really be using the timing config struct |a: &mut HotShotConfig| { a.next_view_timeout = next_view_timeout; - a.timeout_ratio = timeout_ratio; - a.round_start_delay = round_start_delay; - a.start_delay = start_delay; a.builder_timeout = builder_timeout; a.data_request_delay = data_request_delay; a.view_sync_timeout = view_sync_timeout; diff --git a/crates/testing/tests/tests_2/catchup.rs b/crates/testing/tests/tests_2/catchup.rs index ff0aeb08b6..3d4702a3ec 100644 --- a/crates/testing/tests/tests_2/catchup.rs +++ b/crates/testing/tests/tests_2/catchup.rs @@ -37,9 +37,6 @@ async fn test_catchup() { async_compatibility_layer::logging::setup_backtrace(); let timing_data = TimingData { next_view_timeout: 2000, - // increase the round delay for this test - // TODO: remove this delay increase for test - https://github.com/EspressoSystems/HotShot/issues/3673 - round_start_delay: 200, ..Default::default() }; let mut metadata: TestDescription = @@ -324,7 +321,6 @@ cross_tests!( Metadata: { let timing_data = TimingData { next_view_timeout: 2000, - round_start_delay: 500, ..Default::default() }; let mut metadata = TestDescription::default(); @@ -378,7 +374,6 @@ cross_tests!( Metadata: { let timing_data = TimingData { next_view_timeout: 2000, - round_start_delay: 500, ..Default::default() }; let mut metadata: TestDescription = diff --git a/crates/testing/tests/tests_3/byzantine_tests.rs b/crates/testing/tests/tests_3/byzantine_tests.rs index 00ea1ff4d7..0ab5f68d19 100644 --- a/crates/testing/tests/tests_3/byzantine_tests.rs +++ b/crates/testing/tests/tests_3/byzantine_tests.rs @@ -77,11 +77,11 @@ cross_tests!( }, ), behaviour, + num_nodes_with_stake: 12, ..TestDescription::default() }; - metadata.overall_safety_properties.num_failed_views = 0; - + metadata.overall_safety_properties.num_failed_views = 15; metadata }, ); diff --git a/crates/testing/tests/tests_5/combined_network.rs b/crates/testing/tests/tests_5/combined_network.rs index e4d0fb4625..81222cd088 100644 --- a/crates/testing/tests/tests_5/combined_network.rs +++ b/crates/testing/tests/tests_5/combined_network.rs @@ -29,9 +29,7 @@ async fn test_combined_network() { async_compatibility_layer::logging::setup_backtrace(); let metadata: TestDescription = TestDescription { timing_data: TimingData { - round_start_delay: 25, next_view_timeout: 10_000, - start_delay: 120_000, ..Default::default() }, @@ -64,7 +62,6 @@ async fn test_combined_network_cdn_crash() { async_compatibility_layer::logging::setup_backtrace(); let mut metadata: TestDescription = TestDescription { timing_data: TimingData { - round_start_delay: 25, next_view_timeout: 10_000, ..Default::default() }, @@ -111,9 +108,7 @@ async fn test_combined_network_reup() { async_compatibility_layer::logging::setup_backtrace(); let mut metadata: TestDescription = TestDescription { timing_data: TimingData { - round_start_delay: 25, next_view_timeout: 10_000, - start_delay: 120_000, ..Default::default() }, @@ -164,9 +159,7 @@ async fn test_combined_network_half_dc() { async_compatibility_layer::logging::setup_backtrace(); let mut metadata: TestDescription = TestDescription { timing_data: TimingData { - round_start_delay: 25, next_view_timeout: 10_000, - start_delay: 120_000, ..Default::default() }, @@ -244,10 +237,7 @@ async fn test_stress_combined_network_fuzzy() { start_nodes: 20, timing_data: TimingData { - round_start_delay: 25, next_view_timeout: 10_000, - start_delay: 120_000, - ..Default::default() }, diff --git a/crates/testing/tests/tests_5/push_cdn.rs b/crates/testing/tests/tests_5/push_cdn.rs index 5b2dc0d5b1..97e3dc0cb2 100644 --- a/crates/testing/tests/tests_5/push_cdn.rs +++ b/crates/testing/tests/tests_5/push_cdn.rs @@ -25,10 +25,7 @@ async fn push_cdn_network() { async_compatibility_layer::logging::setup_backtrace(); let metadata: TestDescription = TestDescription { timing_data: TimingData { - round_start_delay: 25, next_view_timeout: 10_000, - start_delay: 120_000, - ..Default::default() }, overall_safety_properties: OverallSafetyPropertiesDescription { diff --git a/crates/testing/tests/tests_5/timeout.rs b/crates/testing/tests/tests_5/timeout.rs index 791e9551bd..9809ea7eb5 100644 --- a/crates/testing/tests/tests_5/timeout.rs +++ b/crates/testing/tests/tests_5/timeout.rs @@ -81,8 +81,6 @@ async fn test_timeout_libp2p() { async_compatibility_layer::logging::setup_backtrace(); let timing_data = TimingData { next_view_timeout: 2000, - start_delay: 2000, - round_start_delay: 1000, ..Default::default() }; diff --git a/crates/testing/tests/tests_5/unreliable_network.rs b/crates/testing/tests/tests_5/unreliable_network.rs index 1525ca55e9..0e4f611a42 100644 --- a/crates/testing/tests/tests_5/unreliable_network.rs +++ b/crates/testing/tests/tests_5/unreliable_network.rs @@ -101,7 +101,6 @@ async fn libp2p_network_async() { }, ), timing_data: TimingData { - timeout_ratio: (1, 1), next_view_timeout: 25000, ..TestDescription::::default_multiple_rounds() .timing_data @@ -150,7 +149,6 @@ async fn test_memory_network_async() { }, ), timing_data: TimingData { - timeout_ratio: (1, 1), next_view_timeout: 1000, ..TestDescription::::default_multiple_rounds() .timing_data diff --git a/crates/types/src/constants.rs b/crates/types/src/constants.rs index 7851ff5219..b4c8a39008 100644 --- a/crates/types/src/constants.rs +++ b/crates/types/src/constants.rs @@ -76,5 +76,3 @@ pub const ORCHESTRATOR_DEFAULT_NUM_ROUNDS: usize = 100; pub const ORCHESTRATOR_DEFAULT_TRANSACTIONS_PER_ROUND: usize = 10; /// default size of transactions pub const ORCHESTRATOR_DEFAULT_TRANSACTION_SIZE: usize = 100; -/// default delay before beginning consensus -pub const ORCHESTRATOR_DEFAULT_START_DELAY_SECONDS: u64 = 60; diff --git a/crates/types/src/hotshot_config_file.rs b/crates/types/src/hotshot_config_file.rs index 08b81af3e4..93f37ca022 100644 --- a/crates/types/src/hotshot_config_file.rs +++ b/crates/types/src/hotshot_config_file.rs @@ -4,14 +4,14 @@ // You should have received a copy of the MIT License // along with the HotShot repository. If not, see . -use std::{num::NonZeroUsize, time::Duration, vec}; +use std::{num::NonZeroUsize, time::Duration}; use surf_disco::Url; use vec1::Vec1; use crate::{ constants::REQUEST_DATA_DELAY, traits::signature_key::SignatureKey, - upgrade_config::UpgradeConfig, ExecutionType, HotShotConfig, PeerConfig, ValidatorConfig, + upgrade_config::UpgradeConfig, HotShotConfig, PeerConfig, ValidatorConfig, }; /// Default builder URL, used as placeholder @@ -37,9 +37,6 @@ pub struct HotShotConfigFile { #[serde(skip)] /// The known DA nodes' public key and stake values pub known_da_nodes: Vec>, - #[serde(skip)] - /// The known non-staking nodes' - pub known_nodes_without_stake: Vec, /// Number of staking DA nodes pub staked_da_nodes: usize, /// Number of fixed leaders for GPU VID @@ -48,12 +45,6 @@ pub struct HotShotConfigFile { pub next_view_timeout: u64, /// Duration for view sync round timeout pub view_sync_timeout: Duration, - /// The exponential backoff ration for the next-view timeout - pub timeout_ratio: (u64, u64), - /// The delay a leader inserts before starting pre-commit, in milliseconds - pub round_start_delay: u64, - /// Delay after init before starting consensus, in milliseconds - pub start_delay: u64, /// Number of network bootstrap nodes pub num_bootstrap: usize, /// The maximum amount of time a leader can wait to get a block from a builder @@ -72,20 +63,15 @@ pub struct HotShotConfigFile { impl From> for HotShotConfig { fn from(val: HotShotConfigFile) -> Self { HotShotConfig { - execution_type: ExecutionType::Continuous, start_threshold: val.start_threshold, num_nodes_with_stake: val.num_nodes_with_stake, known_da_nodes: val.known_da_nodes, known_nodes_with_stake: val.known_nodes_with_stake, - known_nodes_without_stake: val.known_nodes_without_stake, my_own_validator_config: val.my_own_validator_config, da_staked_committee_size: val.staked_da_nodes, fixed_leader_for_gpuvid: val.fixed_leader_for_gpuvid, next_view_timeout: val.next_view_timeout, view_sync_timeout: val.view_sync_timeout, - timeout_ratio: val.timeout_ratio, - round_start_delay: val.round_start_delay, - start_delay: val.start_delay, num_bootstrap: val.num_bootstrap, builder_timeout: val.builder_timeout, data_request_delay: val @@ -136,15 +122,11 @@ impl HotShotConfigFile { start_threshold: (1, 1), my_own_validator_config: ValidatorConfig::default(), known_nodes_with_stake: gen_known_nodes_with_stake, - known_nodes_without_stake: vec![], staked_da_nodes, known_da_nodes, fixed_leader_for_gpuvid: 1, next_view_timeout: 10000, view_sync_timeout: Duration::from_millis(1000), - timeout_ratio: (11, 10), - round_start_delay: 1, - start_delay: 1, num_bootstrap: 5, builder_timeout: Duration::from_secs(10), data_request_delay: Some(Duration::from_millis(REQUEST_DATA_DELAY)), diff --git a/crates/types/src/lib.rs b/crates/types/src/lib.rs index 897fef5c73..44c81e4e68 100644 --- a/crates/types/src/lib.rs +++ b/crates/types/src/lib.rs @@ -63,18 +63,6 @@ where { assert_future::(Box::pin(fut)) } -/// the type of consensus to run. Either: -/// wait for a signal to start a view, -/// or constantly run -/// you almost always want continuous -/// incremental is just for testing -#[derive(Debug, Clone, Copy, serde::Serialize, serde::Deserialize)] -pub enum ExecutionType { - /// constantly increment view as soon as view finishes - Continuous, - /// wait for a signal - Incremental, -} #[derive(serde::Serialize, serde::Deserialize, Clone, Derivative, Display)] #[serde(bound(deserialize = ""))] @@ -178,8 +166,6 @@ impl Default for PeerConfig { #[derive(Clone, custom_debug::Debug, serde::Serialize, serde::Deserialize)] #[serde(bound(deserialize = ""))] pub struct HotShotConfig { - /// Whether to run one view or continuous views - pub execution_type: ExecutionType, /// The proportion of nodes required before the orchestrator issues the ready signal, /// expressed as (numerator, denominator) pub start_threshold: (u64, u64), @@ -190,8 +176,6 @@ pub struct HotShotConfig { pub known_nodes_with_stake: Vec>, /// All public keys known to be DA nodes pub known_da_nodes: Vec>, - /// List of known non-staking nodes' public keys - pub known_nodes_without_stake: Vec, /// My own validator config, including my public key, private key, stake value, serving as private parameter pub my_own_validator_config: ValidatorConfig, /// List of DA committee (staking)nodes for static DA committee @@ -202,12 +186,6 @@ pub struct HotShotConfig { pub next_view_timeout: u64, /// Duration of view sync round timeouts pub view_sync_timeout: Duration, - /// The exponential backoff ration for the next-view timeout - pub timeout_ratio: (u64, u64), - /// The delay a leader inserts before starting pre-commit, in milliseconds - pub round_start_delay: u64, - /// Delay after init before starting consensus, in milliseconds - pub start_delay: u64, /// Number of network bootstrap nodes pub num_bootstrap: usize, /// The maximum amount of time a leader can wait to get a block from a builder diff --git a/crates/types/src/network.rs b/crates/types/src/network.rs index 31312bc13f..0927d59b93 100644 --- a/crates/types/src/network.rs +++ b/crates/types/src/network.rs @@ -14,9 +14,8 @@ use tracing::error; use crate::{ constants::{ - ORCHESTRATOR_DEFAULT_NUM_ROUNDS, ORCHESTRATOR_DEFAULT_START_DELAY_SECONDS, - ORCHESTRATOR_DEFAULT_TRANSACTIONS_PER_ROUND, ORCHESTRATOR_DEFAULT_TRANSACTION_SIZE, - REQUEST_DATA_DELAY, + ORCHESTRATOR_DEFAULT_NUM_ROUNDS, ORCHESTRATOR_DEFAULT_TRANSACTIONS_PER_ROUND, + ORCHESTRATOR_DEFAULT_TRANSACTION_SIZE, REQUEST_DATA_DELAY, }, hotshot_config_file::HotShotConfigFile, light_client::StateVerKey, @@ -137,8 +136,6 @@ pub struct NetworkConfig { pub seed: [u8; 32], /// size of transactions pub transaction_size: usize, - /// delay before beginning consensus - pub start_delay_seconds: u64, /// name of the key type (for debugging) pub key_type_name: String, /// the libp2p config @@ -281,7 +278,6 @@ impl Default for NetworkConfig { manual_start_password: None, libp2p_config: None, config: HotShotConfigFile::hotshot_config_5_nodes_10_da().into(), - start_delay_seconds: 60, key_type_name: std::any::type_name::().to_string(), cdn_marshal_address: None, combined_network_config: None, @@ -337,9 +333,6 @@ pub struct NetworkConfigFile { /// size of transactions #[serde_inline_default(ORCHESTRATOR_DEFAULT_TRANSACTION_SIZE)] pub transaction_size: usize, - /// delay before beginning consensus - #[serde_inline_default(ORCHESTRATOR_DEFAULT_START_DELAY_SECONDS)] - pub start_delay_seconds: u64, /// the hotshot config file #[serde(default = "HotShotConfigFile::hotshot_config_5_nodes_10_da")] pub config: HotShotConfigFile, @@ -385,7 +378,6 @@ impl From> for NetworkConfig { }), config: val.config.into(), key_type_name: std::any::type_name::().to_string(), - start_delay_seconds: val.start_delay_seconds, cdn_marshal_address: val.cdn_marshal_address, combined_network_config: val.combined_network_config, commit_sha: String::new(), diff --git a/crates/types/src/traits/network.rs b/crates/types/src/traits/network.rs index 27fe0ec3c9..07c1edd807 100644 --- a/crates/types/src/traits/network.rs +++ b/crates/types/src/traits/network.rs @@ -303,7 +303,6 @@ where num_bootstrap: usize, network_id: usize, da_committee_size: usize, - is_da: bool, reliability_config: Option>, secondary_network_delay: Duration, ) -> AsyncGenerator>; diff --git a/crates/types/src/traits/node_implementation.rs b/crates/types/src/traits/node_implementation.rs index c84031218c..43035b01b7 100644 --- a/crates/types/src/traits/node_implementation.rs +++ b/crates/types/src/traits/node_implementation.rs @@ -153,7 +153,6 @@ where num_bootstrap, 0, da_committee_size, - false, reliability_config.clone(), secondary_network_delay, )