From 0a09df6fd05649444a7298e20a02879f33b778f2 Mon Sep 17 00:00:00 2001 From: Josh Lind Date: Tue, 1 Oct 2024 14:08:48 -0400 Subject: [PATCH 1/3] [Forge] Small improvements to FullNodeRebootStressTest --- .../src/fullnode_reboot_stress_test.rs | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/testsuite/testcases/src/fullnode_reboot_stress_test.rs b/testsuite/testcases/src/fullnode_reboot_stress_test.rs index 8fdd177b5af9b..46934d2616224 100644 --- a/testsuite/testcases/src/fullnode_reboot_stress_test.rs +++ b/testsuite/testcases/src/fullnode_reboot_stress_test.rs @@ -10,6 +10,12 @@ use rand::{seq::SliceRandom, thread_rng}; use std::{sync::Arc, time::Duration}; use tokio::time::Instant; +// The buffer (in seconds) at the end of the test to allow for graceful shutdown +const END_OF_TEST_BUFFER_SECS: u64 = 60; + +// The wait time (in seconds) between fullnode reboots +const WAIT_TIME_BETWEEN_REBOOTS_SECS: u64 = 10; + pub struct FullNodeRebootStressTest; impl Test for FullNodeRebootStressTest { @@ -30,8 +36,19 @@ impl NetworkLoadTest for FullNodeRebootStressTest { _report: &mut TestReport, duration: Duration, ) -> Result<()> { + // Start the test timer let start = Instant::now(); + // Ensure the total test duration is at least as long as the buffer + let end_of_test_buffer = Duration::from_secs(END_OF_TEST_BUFFER_SECS); + if duration <= end_of_test_buffer { + panic!( + "Total test duration must be at least: {:?}! Given duration: {:?}", + end_of_test_buffer, duration + ); + } + + // Collect all the fullnodes let all_fullnodes = { swarm .read() @@ -41,7 +58,9 @@ impl NetworkLoadTest for FullNodeRebootStressTest { .collect::>() }; - while start.elapsed() < duration { + // Reboot fullnodes until the test duration is reached + let test_reboot_duration = duration - end_of_test_buffer; + while start.elapsed() < test_reboot_duration { { let swarm = swarm.read().await; let fullnode_to_reboot = { @@ -53,7 +72,7 @@ impl NetworkLoadTest for FullNodeRebootStressTest { fullnode_to_reboot.stop().await?; fullnode_to_reboot.start().await?; } - tokio::time::sleep(Duration::from_secs(10)).await; + tokio::time::sleep(Duration::from_secs(WAIT_TIME_BETWEEN_REBOOTS_SECS)).await; } Ok(()) From 02d2394dab832f7ad4ec5f1d0b142cdb89f1041d Mon Sep 17 00:00:00 2001 From: Josh Lind Date: Tue, 1 Oct 2024 14:09:45 -0400 Subject: [PATCH 2/3] [Consensus Observer] Disable CO on VFNs (by default). VFNs are still opt-in. --- config/src/config/consensus_observer_config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/src/config/consensus_observer_config.rs b/config/src/config/consensus_observer_config.rs index 02d8572134950..0ca55c31d50e9 100644 --- a/config/src/config/consensus_observer_config.rs +++ b/config/src/config/consensus_observer_config.rs @@ -9,8 +9,8 @@ use serde::{Deserialize, Serialize}; use serde_yaml::Value; // Useful constants for enabling consensus observer on different node types -const ENABLE_ON_VALIDATORS: bool = true; -const ENABLE_ON_VALIDATOR_FULLNODES: bool = true; +const ENABLE_ON_VALIDATORS: bool = false; +const ENABLE_ON_VALIDATOR_FULLNODES: bool = false; const ENABLE_ON_PUBLIC_FULLNODES: bool = false; #[derive(Clone, Copy, Debug, Deserialize, PartialEq, Serialize)] From 4137739855f1e03badf35cda361c760f7fa6b3f5 Mon Sep 17 00:00:00 2001 From: Josh Lind Date: Tue, 1 Oct 2024 14:11:14 -0400 Subject: [PATCH 3/3] [State Sync] Bump max message size to 10MB. --- config/src/config/state_sync_config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/src/config/state_sync_config.rs b/config/src/config/state_sync_config.rs index 2966a42e2e10f..1004bd48b5479 100644 --- a/config/src/config/state_sync_config.rs +++ b/config/src/config/state_sync_config.rs @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; use serde_yaml::Value; // The maximum message size per state sync message -const MAX_MESSAGE_SIZE: usize = 8 * 1024 * 1024; /* 8 MiB */ +const MAX_MESSAGE_SIZE: usize = 10 * 1024 * 1024; /* 10 MiB */ // The maximum chunk sizes for data client requests and response const MAX_EPOCH_CHUNK_SIZE: u64 = 200;