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