mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-01-02 13:23:13 +00:00
refactor(configs): name duration defaults
This commit is contained in:
parent
3b5e07bfb3
commit
3587866e55
@ -9,6 +9,8 @@ use nomos_blend_service::{
|
||||
use nomos_libp2p::{Multiaddr, protocol_name::StreamProtocol};
|
||||
use num_bigint::BigUint;
|
||||
|
||||
const EDGE_NODE_CONNECTION_TIMEOUT: Duration = Duration::from_secs(1);
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct GeneralBlendConfig {
|
||||
pub backend_core: Libp2pCoreBlendBackendSettings,
|
||||
@ -49,7 +51,7 @@ pub fn create_blend_configs(ids: &[[u8; 32]], ports: &[u16]) -> Vec<GeneralBlend
|
||||
normalization_constant: 1.03f64
|
||||
.try_into()
|
||||
.expect("Normalization constant cannot be negative."),
|
||||
edge_node_connection_timeout: Duration::from_secs(1),
|
||||
edge_node_connection_timeout: EDGE_NODE_CONNECTION_TIMEOUT,
|
||||
max_edge_node_incoming_connections: 300,
|
||||
max_dial_attempts_per_peer: NonZeroU64::try_from(3)
|
||||
.expect("Max dial attempts per peer cannot be zero."),
|
||||
|
||||
@ -24,6 +24,13 @@ use crate::secret_key_to_peer_id;
|
||||
|
||||
pub static GLOBAL_PARAMS_PATH: LazyLock<String> = LazyLock::new(resolve_global_params_path);
|
||||
|
||||
const DEFAULT_OLD_BLOBS_CHECK_INTERVAL: Duration = Duration::from_secs(5);
|
||||
const DEFAULT_BLOBS_VALIDITY_DURATION: Duration = Duration::from_secs(60);
|
||||
const DEFAULT_FAILURE_TIME_WINDOW: Duration = Duration::from_secs(5);
|
||||
const DEFAULT_BALANCER_INTERVAL: Duration = Duration::from_secs(1);
|
||||
const DEFAULT_SEEN_MESSAGE_TTL: Duration = Duration::from_secs(3600);
|
||||
const DEFAULT_SUBNETS_REFRESH_INTERVAL: Duration = Duration::from_secs(30);
|
||||
|
||||
fn canonicalize_params_path(mut path: PathBuf) -> PathBuf {
|
||||
if path.is_dir() {
|
||||
let candidates = [
|
||||
@ -101,8 +108,8 @@ impl Default for DaParams {
|
||||
dispersal_factor: 1,
|
||||
num_samples: 1,
|
||||
num_subnets: 2,
|
||||
old_blobs_check_interval: Duration::from_secs(5),
|
||||
blobs_validity_duration: Duration::from_secs(60),
|
||||
old_blobs_check_interval: DEFAULT_OLD_BLOBS_CHECK_INTERVAL,
|
||||
blobs_validity_duration: DEFAULT_BLOBS_VALIDITY_DURATION,
|
||||
global_params_path: GLOBAL_PARAMS_PATH.to_string(),
|
||||
policy_settings: DAConnectionPolicySettings {
|
||||
min_dispersal_peers: 1,
|
||||
@ -113,16 +120,16 @@ impl Default for DaParams {
|
||||
malicious_threshold: 0,
|
||||
},
|
||||
monitor_settings: DAConnectionMonitorSettings {
|
||||
failure_time_window: Duration::from_secs(5),
|
||||
failure_time_window: DEFAULT_FAILURE_TIME_WINDOW,
|
||||
..Default::default()
|
||||
},
|
||||
balancer_interval: Duration::from_secs(1),
|
||||
balancer_interval: DEFAULT_BALANCER_INTERVAL,
|
||||
redial_cooldown: Duration::ZERO,
|
||||
replication_settings: ReplicationConfig {
|
||||
seen_message_cache_size: 1000,
|
||||
seen_message_ttl: Duration::from_secs(3600),
|
||||
seen_message_ttl: DEFAULT_SEEN_MESSAGE_TTL,
|
||||
},
|
||||
subnets_refresh_interval: Duration::from_secs(30),
|
||||
subnets_refresh_interval: DEFAULT_SUBNETS_REFRESH_INTERVAL,
|
||||
retry_shares_limit: 1,
|
||||
retry_commitments_limit: 1,
|
||||
}
|
||||
|
||||
@ -15,6 +15,8 @@ use nomos_node::config::{
|
||||
};
|
||||
use nomos_utils::math::NonNegativeF64;
|
||||
|
||||
const DEFAULT_ROUND_DURATION: Duration = Duration::from_secs(1);
|
||||
|
||||
#[must_use]
|
||||
pub fn default_e2e_deployment_settings() -> DeploymentSettings {
|
||||
DeploymentSettings::Custom(CustomDeployment {
|
||||
@ -25,7 +27,7 @@ pub fn default_e2e_deployment_settings() -> DeploymentSettings {
|
||||
num_blend_layers: NonZeroU64::try_from(3)
|
||||
.expect("Number of blend layers cannot be zero."),
|
||||
timing: TimingSettings {
|
||||
round_duration: Duration::from_secs(1),
|
||||
round_duration: DEFAULT_ROUND_DURATION,
|
||||
rounds_per_interval: NonZeroU64::try_from(30u64)
|
||||
.expect("Rounds per interval cannot be zero."),
|
||||
// (21,600 blocks * 30s per block) / 1s per round = 648,000 rounds
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user