Update chain start time

- Updated chain start time to be exactly the same for all nodes,
  irrespective of when they are started.
- Changed som edefault configs to correspond to the main repo test settings.
This commit is contained in:
hansieodendaal 2026-02-12 02:54:52 +02:00
parent fd60cc69d8
commit d08f7951ee
No known key found for this signature in database
GPG Key ID: 4B3B15868823687C
3 changed files with 11 additions and 4 deletions

View File

@ -31,7 +31,7 @@ const ROUNDS_PER_SESSION_TRANSITION: u64 = 30;
const EPOCH_TRANSITION_SLOTS: u64 = 2_600;
const SAFETY_BUFFER_INTERVALS: u64 = 100;
const MESSAGE_FREQUENCY_PER_ROUND: f64 = 1.0;
const MAX_RELEASE_DELAY_ROUNDS: u64 = 3;
const MAX_RELEASE_DELAY_ROUNDS: u64 = 1;
const DATA_REPLICATION_FACTOR: u64 = 0;
pub const ACTIVITY_THRESHOLD_SENSITIVITY: u64 = 1;

View File

@ -2,6 +2,7 @@ use std::{
collections::{HashMap, HashSet},
num::NonZeroUsize,
path::PathBuf,
sync::OnceLock,
time::Duration,
};
@ -41,6 +42,12 @@ const IBD_DOWNLOAD_DELAY_SECS: u64 = 10;
const MAX_ORPHAN_CACHE_SIZE: NonZeroUsize = unsafe { NonZeroUsize::new_unchecked(5) };
const API_MAX_CONCURRENT_REQUESTS: usize = 1000;
static CHAIN_START_TIME: OnceLock<OffsetDateTime> = OnceLock::new();
fn get_or_init_chain_start_time() -> OffsetDateTime {
*CHAIN_START_TIME.get_or_init(OffsetDateTime::now_utc)
}
pub(crate) fn cryptarchia_deployment(config: &GeneralConfig) -> CryptarchiaDeploymentSettings {
let mantle_service_params = &config
.consensus_config
@ -81,7 +88,7 @@ pub(crate) fn cryptarchia_deployment(config: &GeneralConfig) -> CryptarchiaDeplo
pub(crate) fn time_deployment(config: &GeneralConfig) -> TimeDeploymentSettings {
TimeDeploymentSettings {
slot_duration: config.time_config.slot_duration,
chain_start_time: OffsetDateTime::now_utc(),
chain_start_time: get_or_init_chain_start_time(),
}
}

View File

@ -36,7 +36,7 @@ pub fn default_e2e_deployment_settings() -> DeploymentSettings {
DeploymentSettings::Custom(CustomDeployment {
blend: BlendDeploymentSettings {
common: BlendCommonSettings {
minimum_network_size: unsafe { NonZeroU64::new_unchecked(30) },
minimum_network_size: unsafe { NonZeroU64::new_unchecked(1) },
num_blend_layers: unsafe { NonZeroU64::new_unchecked(3) },
timing: TimingSettings {
round_duration: DEFAULT_ROUND_DURATION,
@ -58,7 +58,7 @@ pub fn default_e2e_deployment_settings() -> DeploymentSettings {
message_frequency_per_round,
},
delayer: MessageDelayerSettings {
maximum_release_delay_in_rounds: unsafe { NonZeroU64::new_unchecked(3) },
maximum_release_delay_in_rounds: unsafe { NonZeroU64::new_unchecked(1) },
},
},
},