Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/apollo_consensus_manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ apollo_consensus_manager_config.workspace = true
apollo_consensus_orchestrator.workspace = true
apollo_infra.workspace = true
apollo_infra_utils.workspace = true
apollo_l1_gas_price.workspace = true
apollo_l1_gas_price_config.workspace = true
apollo_l1_gas_price_types.workspace = true
apollo_metrics.workspace = true
apollo_network.workspace = true
Expand Down
11 changes: 10 additions & 1 deletion crates/apollo_consensus_manager/src/consensus_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use apollo_consensus_orchestrator::sequencer_consensus_context::{
};
use apollo_infra::component_definitions::ComponentStarter;
use apollo_infra_utils::type_name::short_type_name;
use apollo_l1_gas_price::exchange_rate_oracle::ExchangeRateOracleClient;
use apollo_l1_gas_price_types::L1GasPriceProviderClient;
use apollo_network::gossipsub_impl::Topic;
use apollo_network::metrics::{
Expand Down Expand Up @@ -304,7 +305,15 @@ impl ConsensusManager {
outbound_proposal_sender: outbound_internal_sender,
vote_broadcast_client: votes_broadcast_channels.broadcast_topic_client.clone(),
config_manager_client: Some(Arc::clone(&config_manager_client)),
strk_to_usd_oracle: None,
// TODO(SNIP-35): consider threading `ExchangeRateOracleConfig` through
// `ConsensusManagerConfig` so it can be configured per-deployment. For now we
// instantiate the default, whose `url_header_list` points at a placeholder URL;
// **deployments must override `url_header_list` via their config overlay** or the
// oracle will fail every request and `fee_proposal` will freeze at `fee_actual`
// (safe but static).
strk_to_usd_oracle: Some(Arc::new(ExchangeRateOracleClient::new(
apollo_l1_gas_price_config::config::ExchangeRateOracleConfig::default(),
))),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always-failing oracle floods shared ETH_TO_STRK error metrics

Medium Severity

The new ExchangeRateOracleClient with the placeholder api.example.com URL will continuously fail, and each failure increments the global ETH_TO_STRK_ERROR_COUNT metric inside spawn_query. With lag_interval_seconds: 1 generating unique quantized timestamps, a new failing query is spawned on every block proposal (~every 3 seconds), producing ~1200 error increments per hour. The existing get_eth_to_strk_error_count_alert in alert_definitions.rs fires at a threshold of 10 per hour, so this will trigger constant false alerts and obscure genuine ETH/STRK oracle failures.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0bff93b. Configure here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

STRK/USD oracle pollutes shared ETH/STRK global metrics

Medium Severity

The new STRK/USD oracle reuses ExchangeRateOracleClient, which internally registers and updates hardcoded global metrics named ETH_TO_STRK_* (error count, success count, rate gauge, last success timestamp). In the same node process, L1GasPriceProvider::new_with_oracle() also creates an ExchangeRateOracleClient for the actual ETH/STRK oracle. Both instances write to the same global counters and gauges, corrupting observability: error counts are inflated now (placeholder URL always fails), and once a real STRK/USD URL is configured, the eth_to_strk_rate gauge will be overwritten with STRK/USD values.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fbcc234. Configure here.

},
)
}
Expand Down
Loading