Skip to content

Commit c611730

Browse files
apollo_deployments: more cleanups of old deployment code (#10719)
1 parent 429a650 commit c611730

File tree

5 files changed

+5
-76
lines changed

5 files changed

+5
-76
lines changed

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/apollo_deployments/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ license.workspace = true
99
workspace = true
1010

1111
[dependencies]
12-
alloy.workspace = true
1312
apollo_config.workspace = true
1413
apollo_http_server_config.workspace = true
1514
apollo_infra.workspace = true
@@ -22,7 +21,6 @@ phf = { workspace = true, features = ["macros"] }
2221
serde.workspace = true
2322
serde_json.workspace = true
2423
serde_with.workspace = true
25-
starknet_api.workspace = true
2624
strum.workspace = true
2725
strum_macros.workspace = true
2826
url.workspace = true

crates/apollo_deployments/src/addresses.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
// {printf("\t\"%s\",\n", $NF)}'
99
// ```
1010

11-
pub(crate) const PEER_IDS: [&str; 40] = [
11+
#[allow(dead_code)]
12+
const PEER_IDS: [&str; 40] = [
1213
"12D3KooWK99VoVxNE7XzyBwXEzW7xhK7Gpv85r9F3V3fyKSUKPH5",
1314
"12D3KooWCPzcTZ4ymgyveYaFfZ4bfWsBEh2KxuxM3Rmy7MunqHwe",
1415
"12D3KooWT3eoCYeMPrSNnF1eQHimWFDiqPkna7FUD6XKBw8oPiMp",

crates/apollo_deployments/src/deployment_definitions.rs

Lines changed: 2 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
use std::fmt::{Display, Formatter, Result};
2-
use std::fs::read_to_string;
32
use std::path::PathBuf;
43

5-
use alloy::primitives::Address as EthereumContractAddress;
64
use apollo_http_server_config::config::HTTP_SERVER_PORT;
7-
use apollo_infra_utils::template::Template;
85
use apollo_monitoring_endpoint_config::config::MONITORING_ENDPOINT_DEFAULT_PORT;
96
use serde::{Deserialize, Serialize};
10-
use serde_json::from_str;
11-
use starknet_api::block::BlockNumber;
12-
use starknet_api::core::ContractAddress;
137
use strum::{EnumDiscriminants, EnumIter, IntoEnumIterator};
14-
use strum_macros::{Display, EnumString};
15-
use url::Url;
8+
use strum_macros::Display;
169

17-
use crate::addresses::PEER_IDS;
18-
use crate::deployment::{Deployment, P2PCommunicationType};
10+
use crate::deployment::Deployment;
1911
use crate::deployment_definitions::testing::system_test_deployments;
2012
#[cfg(test)]
2113
#[path = "deployment_definitions_test.rs"]
@@ -46,55 +38,6 @@ pub(crate) const DEPLOYMENT_CONFIG_DIR_NAME: &str = "deployments/";
4638

4739
const BASE_APP_CONFIGS_DIR_PATH: &str = "crates/apollo_deployments/resources/app_configs";
4840

49-
pub(crate) type NodeAndValidatorId = (usize, String);
50-
51-
#[derive(Debug, Deserialize)]
52-
pub struct DeploymentInputs {
53-
pub node_and_validator_ids: Vec<NodeAndValidatorId>,
54-
pub num_validators: usize,
55-
pub http_server_ingress_alternative_name: String,
56-
pub ingress_domain: String,
57-
pub secret_name_format: Template,
58-
pub node_namespace_format: Template,
59-
pub starknet_contract_address: EthereumContractAddress,
60-
pub chain_id_string: String,
61-
pub eth_fee_token_address: ContractAddress,
62-
pub starknet_gateway_url: Url,
63-
pub strk_fee_token_address: ContractAddress,
64-
pub l1_startup_height_override: Option<BlockNumber>,
65-
pub state_sync_type: StateSyncType,
66-
pub p2p_communication_type: P2PCommunicationType,
67-
pub deployment_environment: Environment,
68-
pub requires_k8s_service_config_params: bool,
69-
pub audited_libfuncs_only: bool,
70-
pub http_server_port: u16,
71-
pub monitoring_endpoint_config_port: u16,
72-
pub state_sync_config_rpc_config_port: u16,
73-
pub mempool_p2p_config_network_config_port: u16,
74-
pub consensus_manager_config_network_config_port: u16,
75-
}
76-
77-
impl DeploymentInputs {
78-
pub fn load_from_file(path: PathBuf) -> DeploymentInputs {
79-
// Read the file into a string
80-
let data = read_to_string(path).expect("Failed to read deployment input JSON file");
81-
82-
// Parse JSON into the DeploymentInputs struct
83-
let deployment_inputs: Self =
84-
from_str(&data).expect("Should be able to parse deployment input JSON");
85-
86-
for (node_id, _) in &deployment_inputs.node_and_validator_ids {
87-
assert!(
88-
*node_id < PEER_IDS.len(),
89-
"Node node_id {node_id} exceeds the number of nodes {}",
90-
PEER_IDS.len()
91-
);
92-
}
93-
94-
deployment_inputs
95-
}
96-
}
97-
9841
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9942
#[serde(untagged)]
10043
pub enum Environment {
@@ -110,16 +53,6 @@ impl Display for Environment {
11053
}
11154
}
11255

113-
#[derive(EnumString, Clone, Display, PartialEq, Debug, Serialize, Deserialize)]
114-
#[strum(serialize_all = "snake_case")]
115-
pub enum CloudK8sEnvironment {
116-
Mainnet,
117-
SepoliaIntegration,
118-
SepoliaTestnet,
119-
#[strum(serialize = "upgrade_test")]
120-
UpgradeTest,
121-
}
122-
12356
impl Environment {
12457
pub fn env_dir_path(&self) -> PathBuf {
12558
let env_str = match self {

crates/apollo_deployments/src/deployment_definitions_test.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
use std::collections::{BTreeMap, BTreeSet};
1+
use std::collections::{BTreeMap, BTreeSet, HashSet};
22
use std::env;
33
use std::fs::File;
44

5-
use alloy::primitives::map::HashSet;
65
use apollo_infra_utils::dumping::{serialize_to_file, serialize_to_file_test};
76
use apollo_infra_utils::path::resolve_project_relative_path;
87
use apollo_node_config::config_utils::private_parameters;

0 commit comments

Comments
 (0)