Skip to content

Commit 209889b

Browse files
apollo_consensus_manager: wire STRK/USD oracle into consensus manager
1 parent c410076 commit 209889b

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

Cargo.lock

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

crates/apollo_consensus_manager/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ apollo_consensus_manager_config.workspace = true
2121
apollo_consensus_orchestrator.workspace = true
2222
apollo_infra.workspace = true
2323
apollo_infra_utils.workspace = true
24+
apollo_l1_gas_price.workspace = true
25+
apollo_l1_gas_price_config.workspace = true
2426
apollo_l1_gas_price_types.workspace = true
2527
apollo_metrics.workspace = true
2628
apollo_network.workspace = true

crates/apollo_consensus_manager/src/consensus_manager.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use apollo_consensus_orchestrator::sequencer_consensus_context::{
2020
};
2121
use apollo_infra::component_definitions::ComponentStarter;
2222
use apollo_infra_utils::type_name::short_type_name;
23+
use apollo_l1_gas_price::price_oracle::PriceOracleClient;
2324
use apollo_l1_gas_price_types::L1GasPriceProviderClient;
2425
use apollo_network::gossipsub_impl::Topic;
2526
use apollo_network::metrics::{
@@ -304,7 +305,15 @@ impl ConsensusManager {
304305
outbound_proposal_sender: outbound_internal_sender,
305306
vote_broadcast_client: votes_broadcast_channels.broadcast_topic_client.clone(),
306307
config_manager_client: Some(Arc::clone(&config_manager_client)),
307-
strk_price_oracle: None,
308+
// TODO(SNIP-35): consider threading `PriceOracleConfig` through
309+
// `ConsensusManagerConfig` so it can be configured per-deployment. For now we
310+
// instantiate the default, whose `url_header_list` points at a placeholder URL;
311+
// **deployments must override `url_header_list` via their config overlay** or the
312+
// oracle will fail every request and `fee_proposal` will freeze at `fee_actual`
313+
// (safe but static).
314+
strk_price_oracle: Some(Arc::new(PriceOracleClient::new(
315+
apollo_l1_gas_price_config::config::PriceOracleConfig::default(),
316+
))),
308317
},
309318
)
310319
}

0 commit comments

Comments
 (0)