From fa2de48c8a7eeb36e071aa6df6aea8747b8c856e Mon Sep 17 00:00:00 2001 From: Nimrod Weiss Date: Tue, 23 Jun 2026 13:36:43 +0300 Subject: [PATCH] apollo_deployments,deployment: set storage-reader-server ports as constants The three storage-reader-server ports (batcher 55011, class_manager 55210, state_sync 55014) are fixed infra constants, not per-deployment overrides. Bake them into the app_configs and applicative_config jsonnet instead of templatizing them as $$$_..._$$$ placeholders, and restrict the generic port/url auto-templatizing in replace_pred to components.* keys only. Add state_sync_config...network_config.port to KEYS_TO_BE_REPLACED to preserve its existing overridability. Drop the now-redundant storage-reader port overrides from the common and testing overlay YAMLs. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../jsonnet/lib/applicative_config.libsonnet | 6 +++--- .../resources/app_configs/batcher_config.json | 2 +- .../app_configs/class_manager_config.json | 2 +- .../app_configs/replacer_batcher_config.json | 2 +- .../app_configs/replacer_class_manager_config.json | 2 +- .../app_configs/replacer_state_sync_config.json | 2 +- .../resources/app_configs/state_sync_config.json | 2 +- crates/apollo_deployments/src/service.rs | 14 ++++++++++++-- .../overlays/hybrid/common/services/core.yaml | 3 --- .../hybrid/testing/node-0/services/core.yaml | 3 --- 10 files changed, 21 insertions(+), 17 deletions(-) diff --git a/crates/apollo_deployments/jsonnet/lib/applicative_config.libsonnet b/crates/apollo_deployments/jsonnet/lib/applicative_config.libsonnet index 3afb97df804..ed2f1ad7253 100644 --- a/crates/apollo_deployments/jsonnet/lib/applicative_config.libsonnet +++ b/crates/apollo_deployments/jsonnet/lib/applicative_config.libsonnet @@ -192,7 +192,7 @@ function(overrides) }, storage_reader_server_static_config: { ip: '0.0.0.0', - port: 8091, + port: 55011, }, validation_only: std.get(overrides, 'validation_only', constants.DEFAULT_VALIDATION_ONLY), }, @@ -232,7 +232,7 @@ function(overrides) persistent_root: '/data/class_manager/classes', storage_reader_server_static_config: { ip: '0.0.0.0', - port: 8091, + port: 55210, }, }, }, @@ -633,7 +633,7 @@ function(overrides) }, storage_reader_server_static_config: { ip: '0.0.0.0', - port: 8091, + port: 55014, }, }, }, diff --git a/crates/apollo_deployments/resources/app_configs/batcher_config.json b/crates/apollo_deployments/resources/app_configs/batcher_config.json index dfa36ba7db2..00c4fde72fa 100644 --- a/crates/apollo_deployments/resources/app_configs/batcher_config.json +++ b/crates/apollo_deployments/resources/app_configs/batcher_config.json @@ -58,5 +58,5 @@ "batcher_config.static_config.storage.mmap_file_config.max_size": 1099511627776, "batcher_config.static_config.storage.scope": "StateOnly", "batcher_config.static_config.storage_reader_server_static_config.ip": "0.0.0.0", - "batcher_config.static_config.storage_reader_server_static_config.port": 8091 + "batcher_config.static_config.storage_reader_server_static_config.port": 55011 } diff --git a/crates/apollo_deployments/resources/app_configs/class_manager_config.json b/crates/apollo_deployments/resources/app_configs/class_manager_config.json index aadc1135579..719b6e3d3ba 100644 --- a/crates/apollo_deployments/resources/app_configs/class_manager_config.json +++ b/crates/apollo_deployments/resources/app_configs/class_manager_config.json @@ -14,6 +14,6 @@ "class_manager_config.static_config.class_storage_config.class_hash_storage_config.scope": "StateOnly", "class_manager_config.static_config.class_storage_config.persistent_root": "/data/class_manager/classes", "class_manager_config.static_config.class_storage_config.storage_reader_server_static_config.ip": "0.0.0.0", - "class_manager_config.static_config.class_storage_config.storage_reader_server_static_config.port": 8091, + "class_manager_config.static_config.class_storage_config.storage_reader_server_static_config.port": 55210, "class_manager_config.dynamic_config.storage_reader_server_dynamic_config.enable": false } \ No newline at end of file diff --git a/crates/apollo_deployments/resources/app_configs/replacer_batcher_config.json b/crates/apollo_deployments/resources/app_configs/replacer_batcher_config.json index b507cc71648..6fda4251374 100644 --- a/crates/apollo_deployments/resources/app_configs/replacer_batcher_config.json +++ b/crates/apollo_deployments/resources/app_configs/replacer_batcher_config.json @@ -58,5 +58,5 @@ "batcher_config.static_config.storage.mmap_file_config.max_size": 1099511627776, "batcher_config.static_config.storage.scope": "StateOnly", "batcher_config.static_config.storage_reader_server_static_config.ip": "0.0.0.0", - "batcher_config.static_config.storage_reader_server_static_config.port": "$$$_BATCHER_CONFIG-STATIC_CONFIG-STORAGE_READER_SERVER_STATIC_CONFIG-PORT_$$$" + "batcher_config.static_config.storage_reader_server_static_config.port": 55011 } diff --git a/crates/apollo_deployments/resources/app_configs/replacer_class_manager_config.json b/crates/apollo_deployments/resources/app_configs/replacer_class_manager_config.json index a2846dfb891..9f5646ec5e0 100644 --- a/crates/apollo_deployments/resources/app_configs/replacer_class_manager_config.json +++ b/crates/apollo_deployments/resources/app_configs/replacer_class_manager_config.json @@ -15,5 +15,5 @@ "class_manager_config.static_config.class_storage_config.class_hash_storage_config.scope": "StateOnly", "class_manager_config.static_config.class_storage_config.persistent_root": "/data/class_manager/classes", "class_manager_config.static_config.class_storage_config.storage_reader_server_static_config.ip": "0.0.0.0", - "class_manager_config.static_config.class_storage_config.storage_reader_server_static_config.port": "$$$_CLASS_MANAGER_CONFIG-STATIC_CONFIG-CLASS_STORAGE_CONFIG-STORAGE_READER_SERVER_STATIC_CONFIG-PORT_$$$" + "class_manager_config.static_config.class_storage_config.storage_reader_server_static_config.port": 55210 } diff --git a/crates/apollo_deployments/resources/app_configs/replacer_state_sync_config.json b/crates/apollo_deployments/resources/app_configs/replacer_state_sync_config.json index c2fe511cf4b..88e899e899a 100644 --- a/crates/apollo_deployments/resources/app_configs/replacer_state_sync_config.json +++ b/crates/apollo_deployments/resources/app_configs/replacer_state_sync_config.json @@ -64,5 +64,5 @@ "state_sync_config.static_config.storage_config.mmap_file_config.max_size": 1099511627776, "state_sync_config.static_config.storage_config.scope": "FullArchive", "state_sync_config.static_config.storage_reader_server_static_config.ip": "0.0.0.0", - "state_sync_config.static_config.storage_reader_server_static_config.port": "$$$_STATE_SYNC_CONFIG-STATIC_CONFIG-STORAGE_READER_SERVER_STATIC_CONFIG-PORT_$$$" + "state_sync_config.static_config.storage_reader_server_static_config.port": 55014 } diff --git a/crates/apollo_deployments/resources/app_configs/state_sync_config.json b/crates/apollo_deployments/resources/app_configs/state_sync_config.json index 96187d5feda..59b79ea9836 100644 --- a/crates/apollo_deployments/resources/app_configs/state_sync_config.json +++ b/crates/apollo_deployments/resources/app_configs/state_sync_config.json @@ -64,5 +64,5 @@ "state_sync_config.static_config.storage_config.scope": "FullArchive", "state_sync_config.dynamic_config.storage_reader_server_dynamic_config.enable": false, "state_sync_config.static_config.storage_reader_server_static_config.ip": "0.0.0.0", - "state_sync_config.static_config.storage_reader_server_static_config.port": 8091 + "state_sync_config.static_config.storage_reader_server_static_config.port": 55014 } diff --git a/crates/apollo_deployments/src/service.rs b/crates/apollo_deployments/src/service.rs index 9212b41cd3e..9b70f9c962b 100644 --- a/crates/apollo_deployments/src/service.rs +++ b/crates/apollo_deployments/src/service.rs @@ -100,6 +100,7 @@ pub static KEYS_TO_BE_REPLACED: phf::Set<&'static str> = phf_set! { "state_sync_config.static_config.central_sync_client_config.#is_none", "state_sync_config.static_config.central_sync_client_config.sync_config.store_sierras_and_casms_block_threshold", "state_sync_config.static_config.network_config.#is_none", + "state_sync_config.static_config.network_config.port", "state_sync_config.static_config.p2p_sync_client_config.#is_none", "state_sync_config.static_config.rpc_config.port", "strk_fee_token_address", @@ -361,12 +362,21 @@ fn replace_pred(key: &str, value: &Value) -> bool { return true; } + // Only `components.*` infra fields are auto-templatized: the layout assigns each component's + // remote URL and port per deployment. Ports/URLs OUTSIDE `components.*` are NOT + // auto-templatized — an overridable one must be listed explicitly in `KEYS_TO_BE_REPLACED`; + // the rest (e.g. the fixed storage-reader-server ports) keep their literal app_config + // value. + if !key.starts_with("components.") { + return false; + } + let invalid_port: u64 = DEFAULT_INVALID_PORT.into(); - // Condition 1: ports set by the infra: ".port" suffix and a non-zero integer value + // Component port: ".port" suffix with a non-invalid integer value. let port_cond = key.ends_with(".port") && value.as_u64().is_some_and(|n| n != invalid_port); - // Condition 2: service urls: ".url" suffix and a non-localhost string value + // Component service URL: ".url" suffix with a non-localhost string value. let url_cond = key.ends_with(".url") && value.as_str().is_some_and(|s| s != DEFAULT_URL); port_cond || url_cond diff --git a/deployments/sequencer/configs/overlays/hybrid/common/services/core.yaml b/deployments/sequencer/configs/overlays/hybrid/common/services/core.yaml index 805c8e56c5b..1fb463bc541 100644 --- a/deployments/sequencer/configs/overlays/hybrid/common/services/core.yaml +++ b/deployments/sequencer/configs/overlays/hybrid/common/services/core.yaml @@ -5,9 +5,7 @@ config: batcher_config.dynamic_config.proposer_idle_detection_delay_millis: 2000 batcher_config.static_config.block_builder_config.bouncer_config.block_max_capacity.n_events: 5000 batcher_config.static_config.block_builder_config.bouncer_config.block_max_capacity.receipt_l2_gas: 5800000000 - batcher_config.static_config.storage_reader_server_static_config.port: 55011 class_manager_config.static_config.class_manager_config.max_compiled_contract_class_object_size: 4089446 - class_manager_config.static_config.class_storage_config.storage_reader_server_static_config.port: 55210 consensus_manager_config.consensus_manager_config.dynamic_config.require_virtual_proposer_vote: false consensus_manager_config.consensus_manager_config.dynamic_config.timeouts.proposal.base: 9.1 consensus_manager_config.consensus_manager_config.dynamic_config.timeouts.proposal.max: 9.1 @@ -46,7 +44,6 @@ config: components.state_sync.url: sequencer-core-service state_sync_config.static_config.p2p_sync_client_config.#is_none: true state_sync_config.static_config.rpc_config.port: 8090 - state_sync_config.static_config.storage_reader_server_static_config.port: 55014 service: ports: - name: batcher diff --git a/deployments/sequencer/configs/overlays/hybrid/testing/node-0/services/core.yaml b/deployments/sequencer/configs/overlays/hybrid/testing/node-0/services/core.yaml index 892605fec3f..d95e8b3f6a8 100644 --- a/deployments/sequencer/configs/overlays/hybrid/testing/node-0/services/core.yaml +++ b/deployments/sequencer/configs/overlays/hybrid/testing/node-0/services/core.yaml @@ -19,9 +19,7 @@ config: batcher_config.static_config.first_block_with_partial_block_hash.block_number: 0 batcher_config.static_config.first_block_with_partial_block_hash.block_hash: "0x0" batcher_config.static_config.first_block_with_partial_block_hash.parent_block_hash: "0x0" - batcher_config.static_config.storage_reader_server_static_config.port: 55011 class_manager_config.static_config.class_manager_config.max_compiled_contract_class_object_size: 4089446 - class_manager_config.static_config.class_storage_config.storage_reader_server_static_config.port: 55210 components.batcher.port: 55000 components.batcher.url: sequencer-core-service components.class_manager.port: 55001 @@ -70,7 +68,6 @@ config: state_sync_config.static_config.network_config.port: 55010 state_sync_config.static_config.p2p_sync_client_config.#is_none: false state_sync_config.static_config.rpc_config.port: 8090 - state_sync_config.static_config.storage_reader_server_static_config.port: 55014 service: enabled: true