2025-12-01 12:48:39 +01:00
|
|
|
use nomos_da_dispersal::{
|
|
|
|
|
DispersalServiceSettings,
|
|
|
|
|
backend::kzgrs::{DispersalKZGRSBackendSettings, EncoderSettings},
|
|
|
|
|
};
|
|
|
|
|
use nomos_da_network_core::protocols::sampling::SubnetsConfig;
|
|
|
|
|
use nomos_da_network_service::{
|
|
|
|
|
NetworkConfig as DaNetworkConfig,
|
|
|
|
|
api::http::ApiAdapterSettings,
|
|
|
|
|
backends::libp2p::{
|
|
|
|
|
common::DaNetworkBackendSettings, executor::DaNetworkExecutorBackendSettings,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
use nomos_executor::config::Config as ExecutorConfig;
|
2025-12-09 09:43:49 +01:00
|
|
|
use nomos_node::{RocksBackendSettings, config::deployment::DeploymentSettings};
|
2025-12-01 12:48:39 +01:00
|
|
|
use nomos_sdp::SdpSettings;
|
|
|
|
|
|
|
|
|
|
use crate::{
|
2025-12-09 06:30:18 +01:00
|
|
|
nodes::{
|
|
|
|
|
blend::build_blend_service_config,
|
2025-12-09 09:43:49 +01:00
|
|
|
common::{
|
|
|
|
|
cryptarchia_config, cryptarchia_deployment, da_sampling_config, da_verifier_config,
|
|
|
|
|
http_config, mempool_config, mempool_deployment, testing_http_config, time_config,
|
|
|
|
|
time_deployment, tracing_settings, wallet_settings,
|
|
|
|
|
},
|
2025-12-01 12:48:39 +01:00
|
|
|
},
|
2025-12-09 17:45:10 +01:00
|
|
|
timeouts,
|
2025-12-09 09:43:49 +01:00
|
|
|
topology::configs::GeneralConfig,
|
2025-12-01 12:48:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#[must_use]
|
|
|
|
|
pub fn create_executor_config(config: GeneralConfig) -> ExecutorConfig {
|
2025-12-09 06:30:18 +01:00
|
|
|
let network_config = config.network_config.clone();
|
2025-12-06 10:17:06 +01:00
|
|
|
let (blend_user_config, blend_deployment, network_deployment) =
|
|
|
|
|
build_blend_service_config(&config.blend_config);
|
2025-12-09 06:30:18 +01:00
|
|
|
|
2025-12-06 10:17:06 +01:00
|
|
|
let deployment_settings = DeploymentSettings::new_custom(
|
|
|
|
|
blend_deployment,
|
|
|
|
|
network_deployment,
|
2025-12-09 06:30:18 +01:00
|
|
|
cryptarchia_deployment(&config),
|
|
|
|
|
time_deployment(&config),
|
|
|
|
|
mempool_deployment(),
|
2025-12-06 10:17:06 +01:00
|
|
|
);
|
2025-12-09 06:30:18 +01:00
|
|
|
|
2025-12-01 12:48:39 +01:00
|
|
|
ExecutorConfig {
|
2025-12-09 06:30:18 +01:00
|
|
|
network: network_config,
|
2025-12-01 12:48:39 +01:00
|
|
|
blend: blend_user_config,
|
|
|
|
|
deployment: deployment_settings,
|
2025-12-09 06:30:18 +01:00
|
|
|
cryptarchia: cryptarchia_config(&config),
|
2025-12-01 12:48:39 +01:00
|
|
|
da_network: DaNetworkConfig {
|
|
|
|
|
backend: DaNetworkExecutorBackendSettings {
|
|
|
|
|
validator_settings: DaNetworkBackendSettings {
|
2025-12-09 09:43:49 +01:00
|
|
|
node_key: config.da_config.node_key.clone(),
|
|
|
|
|
listening_address: config.da_config.listening_address.clone(),
|
|
|
|
|
policy_settings: config.da_config.policy_settings.clone(),
|
|
|
|
|
monitor_settings: config.da_config.monitor_settings.clone(),
|
2025-12-01 12:48:39 +01:00
|
|
|
balancer_interval: config.da_config.balancer_interval,
|
|
|
|
|
redial_cooldown: config.da_config.redial_cooldown,
|
|
|
|
|
replication_settings: config.da_config.replication_settings,
|
|
|
|
|
subnets_settings: SubnetsConfig {
|
|
|
|
|
num_of_subnets: config.da_config.num_samples as usize,
|
|
|
|
|
shares_retry_limit: config.da_config.retry_shares_limit,
|
|
|
|
|
commitments_retry_limit: config.da_config.retry_commitments_limit,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
num_subnets: config.da_config.num_subnets,
|
|
|
|
|
},
|
|
|
|
|
membership: config.da_config.membership.clone(),
|
|
|
|
|
api_adapter_settings: ApiAdapterSettings {
|
|
|
|
|
api_port: config.api_config.address.port(),
|
|
|
|
|
is_secure: false,
|
|
|
|
|
},
|
|
|
|
|
subnet_refresh_interval: config.da_config.subnets_refresh_interval,
|
|
|
|
|
subnet_threshold: config.da_config.num_samples as usize,
|
|
|
|
|
min_session_members: config.da_config.num_samples as usize,
|
|
|
|
|
},
|
2025-12-09 09:43:49 +01:00
|
|
|
da_verifier: da_verifier_config(&config),
|
|
|
|
|
tracing: tracing_settings(&config),
|
|
|
|
|
http: http_config(&config),
|
|
|
|
|
da_sampling: da_sampling_config(&config),
|
2025-12-01 12:48:39 +01:00
|
|
|
storage: RocksBackendSettings {
|
|
|
|
|
db_path: "./db".into(),
|
|
|
|
|
read_only: false,
|
|
|
|
|
column_family: Some("blocks".into()),
|
|
|
|
|
},
|
|
|
|
|
da_dispersal: DispersalServiceSettings {
|
|
|
|
|
backend: DispersalKZGRSBackendSettings {
|
|
|
|
|
encoder_settings: EncoderSettings {
|
|
|
|
|
num_columns: config.da_config.num_subnets as usize,
|
|
|
|
|
with_cache: false,
|
2025-12-09 09:43:49 +01:00
|
|
|
global_params_path: config.da_config.global_params_path.clone(),
|
2025-12-01 12:48:39 +01:00
|
|
|
},
|
2025-12-09 17:45:10 +01:00
|
|
|
dispersal_timeout: timeouts::dispersal_timeout(),
|
|
|
|
|
retry_cooldown: timeouts::retry_cooldown(),
|
2025-12-01 12:48:39 +01:00
|
|
|
retry_limit: 2,
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-12-09 09:43:49 +01:00
|
|
|
time: time_config(&config),
|
|
|
|
|
mempool: mempool_config(),
|
2025-12-01 12:48:39 +01:00
|
|
|
sdp: SdpSettings { declaration: None },
|
2025-12-09 09:43:49 +01:00
|
|
|
wallet: wallet_settings(&config),
|
2025-12-09 10:18:36 +01:00
|
|
|
key_management: config.kms_config.clone(),
|
2025-12-09 09:43:49 +01:00
|
|
|
testing_http: testing_http_config(&config),
|
2025-12-01 12:48:39 +01:00
|
|
|
}
|
|
|
|
|
}
|