Skip to content

Commit c014cd2

Browse files
ShahakShamaclaude
andauthored
apollo_integration_tests,apollo_deployments: prime strk_to_usd_oracle overlays (#14160)
* apollo_l1_gas_price_types,apollo_l1_gas_price: expose get_strk_to_usd_rate Goal: PR 3 of 6 in the stack moving the STRK/USD oracle into L1GasPriceProvider. Surfaces the inherent method added in PR 2 on the client trait so cross-process callers (notably the consensus orchestrator in PR 5) can request a STRK/USD rate without holding their own oracle. Change summary: - New `L1GasPriceRequest::GetStrkToUsdRate(u64)` variant. - New `L1GasPriceResponse::GetStrkToUsdRate(L1GasPriceProviderResult<u128>)` variant. - New `L1GasPriceProviderClient::get_strk_to_usd_rate` trait method, implemented on the blanket impl mirroring `get_rate`. - Server-side dispatch arm in `apollo_l1_gas_price::communication` routes to `L1GasPriceProvider::strk_to_usd_rate`. Decision points: - Did not rename the existing `get_rate` (which dispatches to `GetEthToFriRate`) for symmetry; out of scope per the stack plan and would churn unrelated call sites in consensus orchestrator. The trait now has slightly asymmetric naming: `get_rate` (ETH/FRI) vs `get_strk_to_usd_rate`. Renaming is a separate cleanup if desired. - `MockL1GasPriceProviderClient` is automock-generated and picks up the new method automatically. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * apollo_integration_tests,apollo_deployments: prime strk_to_usd_oracle overlays Goal: PR 4 of 6 in the stack moving the STRK/USD oracle into L1GasPriceProvider. Lands BEFORE the orchestrator behavior flip (PR 5) so that every test and deployment overlay already points the new `strk_to_usd_oracle_config.url_header_list` at a working endpoint. When PR 5 lands, integration runs immediately exercise the new path with realistic data instead of silently freezing fee_proposal at fee_actual. Change summary: - `create_node_config` takes a new `strk_to_usd_oracle_config: ExchangeRateOracleConfig` argument and plumbs it into `L1GasPriceProviderConfig`. - Callers in `flow_test_setup.rs` and `integration_test_manager.rs` reuse the same dummy `spawn_local_eth_to_strk_oracle` URL for both oracles (the handler returns a constant rate, so semantically equivalent). - `SecretsConfigOverride` in `apollo_deployments::test_utils` gains a `strk_to_usd_oracle_config.url_header_list` field so the generated secrets file covers the new private parameter. - Deployment app-config presets (`l1_gas_price_provider_config.json`, `replacer_l1_gas_price_provider_config.json`) gain the same three per-oracle overrides (`lag_interval_seconds=900`, `max_cache_size=100`, `query_timeout_sec=10`) for STRK/USD, mirroring eth_to_strk. Decision points: - One dummy oracle process serving both feeds instead of spawning two. The fake handler is rate-agnostic — same response shape, single port allocation, same join handle. If we ever need rate-specific dummy values, splitting into two processes is a localized change. Action required after merge (cannot run from this sandbox): - `cargo run --bin update_apollo_node_config_schema` to regenerate `config_secrets_schema.json` (it gains a new private parameter from PR 1's earlier addition). - `cargo run --bin deployment_generator` to regenerate `testing_secrets.json` with the new strk_to_usd entry from `SecretsConfigOverride`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b54fd9c commit c014cd2

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

crates/apollo_integration_tests/src/flow_test_setup.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ impl FlowSequencerSetup {
278278
let (eth_to_strk_oracle_url_headers, _join_handle) =
279279
spawn_local_eth_to_strk_oracle(available_ports.get_next_port());
280280
let eth_to_strk_oracle_config = ExchangeRateOracleConfig {
281+
url_header_list: Some(vec![eth_to_strk_oracle_url_headers.clone().into()]),
282+
..Default::default()
283+
};
284+
// Reuse the same dummy oracle endpoint for STRK/USD; the handler returns a constant.
285+
let strk_to_usd_oracle_config = ExchangeRateOracleConfig {
281286
url_header_list: Some(vec![eth_to_strk_oracle_url_headers.into()]),
282287
..Default::default()
283288
};
@@ -309,6 +314,7 @@ impl FlowSequencerSetup {
309314
state_sync_config,
310315
consensus_manager_config,
311316
eth_to_strk_oracle_config,
317+
strk_to_usd_oracle_config,
312318
mempool_p2p_config,
313319
monitoring_endpoint_config,
314320
component_config,

crates/apollo_integration_tests/src/integration_test_manager.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,6 +1367,11 @@ async fn get_sequencer_setup_configs(
13671367
url_header_list: Some(vec![eth_to_strk_oracle_url.clone().into()]),
13681368
..Default::default()
13691369
};
1370+
// Reuse the same dummy oracle endpoint for STRK/USD; the handler returns a constant.
1371+
let strk_to_usd_oracle_config = ExchangeRateOracleConfig {
1372+
url_header_list: Some(vec![eth_to_strk_oracle_url.clone().into()]),
1373+
..Default::default()
1374+
};
13701375

13711376
let validator_id = set_validator_id(&mut consensus_manager_config, node_index);
13721377
let chain_info = chain_info.clone();
@@ -1397,6 +1402,7 @@ async fn get_sequencer_setup_configs(
13971402
state_sync_config.clone(),
13981403
consensus_manager_config.clone(),
13991404
eth_to_strk_oracle_config.clone(),
1405+
strk_to_usd_oracle_config.clone(),
14001406
mempool_p2p_config.clone(),
14011407
monitoring_endpoint_config,
14021408
executable_component_config.clone(),

crates/apollo_integration_tests/src/utils.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ pub fn create_node_config(
267267
mut state_sync_config: StateSyncConfig,
268268
mut consensus_manager_config: ConsensusManagerConfig,
269269
eth_to_strk_oracle_config: ExchangeRateOracleConfig,
270+
strk_to_usd_oracle_config: ExchangeRateOracleConfig,
270271
mempool_p2p_config: MempoolP2pConfig,
271272
monitoring_endpoint_config: MonitoringEndpointConfig,
272273
components: ComponentConfig,
@@ -313,6 +314,7 @@ pub fn create_node_config(
313314
// Use newly minted blocks on Anvil to be used for gas price calculations.
314315
lag_margin_seconds: Duration::from_secs(0),
315316
eth_to_strk_oracle_config,
317+
strk_to_usd_oracle_config,
316318
..Default::default()
317319
};
318320
let http_server_config =

0 commit comments

Comments
 (0)