mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-01-02 13:23:13 +00:00
refactor(core): name settle and balancer intervals
This commit is contained in:
parent
3587866e55
commit
6031e7fd98
@ -16,6 +16,8 @@ type WorkloadOutcome = Result<(), DynError>;
|
||||
|
||||
const COOLDOWN_BLOCK_INTERVAL_MULTIPLIER: f64 = 5.0;
|
||||
const MIN_NODE_CONTROL_COOLDOWN: Duration = Duration::from_secs(30);
|
||||
const DEFAULT_BLOCK_FEED_SETTLE_WAIT: Duration = Duration::from_secs(1);
|
||||
const MIN_BLOCK_FEED_SETTLE_WAIT: Duration = Duration::from_secs(2);
|
||||
|
||||
/// Represents a fully prepared environment capable of executing a scenario.
|
||||
pub struct Runner {
|
||||
@ -136,8 +138,8 @@ impl Runner {
|
||||
return;
|
||||
}
|
||||
|
||||
let mut wait = hint.unwrap_or_else(|| Duration::from_secs(1));
|
||||
wait = wait.max(Duration::from_secs(2));
|
||||
let mut wait = hint.unwrap_or(DEFAULT_BLOCK_FEED_SETTLE_WAIT);
|
||||
wait = wait.max(MIN_BLOCK_FEED_SETTLE_WAIT);
|
||||
sleep(wait).await;
|
||||
}
|
||||
|
||||
|
||||
@ -25,6 +25,9 @@ use crate::topology::{
|
||||
utils::{create_kms_configs, resolve_ids, resolve_ports},
|
||||
};
|
||||
|
||||
const DEFAULT_DA_BALANCER_INTERVAL: Duration = Duration::from_secs(1);
|
||||
const VALIDATOR_EXECUTOR_DA_BALANCER_INTERVAL: Duration = Duration::from_secs(5);
|
||||
|
||||
/// High-level topology settings used to generate node configs for a scenario.
|
||||
#[derive(Clone)]
|
||||
pub struct TopologyConfig {
|
||||
@ -82,7 +85,7 @@ impl TopologyConfig {
|
||||
max_replication_failures: 0,
|
||||
malicious_threshold: 0,
|
||||
},
|
||||
balancer_interval: Duration::from_secs(1),
|
||||
balancer_interval: DEFAULT_DA_BALANCER_INTERVAL,
|
||||
..Default::default()
|
||||
},
|
||||
network_params: NetworkParams::default(),
|
||||
@ -112,7 +115,7 @@ impl TopologyConfig {
|
||||
let min_peers = dispersal.saturating_sub(1).max(1);
|
||||
da_params.policy_settings.min_dispersal_peers = min_peers;
|
||||
da_params.policy_settings.min_replication_peers = min_peers;
|
||||
da_params.balancer_interval = Duration::from_secs(1);
|
||||
da_params.balancer_interval = DEFAULT_DA_BALANCER_INTERVAL;
|
||||
}
|
||||
|
||||
Self {
|
||||
@ -148,7 +151,7 @@ impl TopologyConfig {
|
||||
max_replication_failures: 0,
|
||||
malicious_threshold: 0,
|
||||
},
|
||||
balancer_interval: Duration::from_secs(5),
|
||||
balancer_interval: VALIDATOR_EXECUTOR_DA_BALANCER_INTERVAL,
|
||||
..Default::default()
|
||||
},
|
||||
network_params: NetworkParams::default(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user