diff --git a/crates/apollo_dashboard/resources/dev_grafana.json b/crates/apollo_dashboard/resources/dev_grafana.json index 56aba695872..425fa2390ee 100644 --- a/crates/apollo_dashboard/resources/dev_grafana.json +++ b/crates/apollo_dashboard/resources/dev_grafana.json @@ -1508,6 +1508,47 @@ ], "collapsed": true }, + "SNIP-35": { + "panels": [ + { + "title": "SNIP-35 fee_actual (GFri)", + "description": "Median of recent fee_proposals over the sliding window, in GFri", + "type": "timeseries", + "exprs": [ + "snip35_fee_actual{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"} / 1e9" + ], + "extra_params": {} + }, + { + "title": "SNIP-35 fee_proposal (GFri)", + "description": "fee_proposal this node published in the latest block, in GFri", + "type": "timeseries", + "exprs": [ + "snip35_fee_proposal{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"} / 1e9" + ], + "extra_params": {} + }, + { + "title": "SNIP-35 fee_target (GFri)", + "description": "fee_target computed from the STRK/USD oracle, in GFri", + "type": "timeseries", + "exprs": [ + "snip35_fee_target{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"} / 1e9" + ], + "extra_params": {} + }, + { + "title": "SNIP-35 STRK/USD rate (USD)", + "description": "STRK/USD rate from the oracle, in USD (raw value has 18 decimals)", + "type": "timeseries", + "exprs": [ + "snip35_strk_usd_rate{cluster=~\"$cluster\", namespace=~\"$namespace\", pod=~\"$pod\"} / 1e18" + ], + "extra_params": {} + } + ], + "collapsed": true + }, "Blockifier": { "panels": [ { diff --git a/crates/apollo_dashboard/src/dashboard_definitions.rs b/crates/apollo_dashboard/src/dashboard_definitions.rs index 0c213c6625f..f0ba8fef3cb 100644 --- a/crates/apollo_dashboard/src/dashboard_definitions.rs +++ b/crates/apollo_dashboard/src/dashboard_definitions.rs @@ -29,6 +29,7 @@ use crate::panels::consensus::{ get_panel_consensus_block_number_diff_from_sync, get_panel_consensus_decisions_reached_as_proposer_counter, get_panel_consensus_round, + get_snip35_row, }; use crate::panels::gateway::{get_gateway_row, get_panel_gateway_add_tx_failure_by_reason}; use crate::panels::http_server::{ @@ -100,6 +101,7 @@ pub fn get_apollo_dashboard() -> Dashboard { get_upgrade_row(), get_l1_events_row(), get_l1_gas_price_row(), + get_snip35_row(), get_blockifier_row(), get_compile_to_casm_row(), get_consensus_p2p_row(), diff --git a/crates/apollo_dashboard/src/panels/consensus.rs b/crates/apollo_dashboard/src/panels/consensus.rs index e7ddd7d78ad..202a42f450f 100644 --- a/crates/apollo_dashboard/src/panels/consensus.rs +++ b/crates/apollo_dashboard/src/panels/consensus.rs @@ -56,6 +56,10 @@ use apollo_consensus_orchestrator::metrics::{ LABEL_BUILD_PROPOSAL_FAILURE_REASON, LABEL_CENDE_FAILURE_REASON, LABEL_VALIDATE_PROPOSAL_FAILURE_REASON, + SNIP35_FEE_ACTUAL, + SNIP35_FEE_PROPOSAL, + SNIP35_FEE_TARGET, + SNIP35_STRK_USD_RATE, }; use apollo_metrics::metrics::MetricQueryName; use apollo_network::metrics::{LABEL_NAME_BROADCAST_DROP_REASON, LABEL_NAME_EVENT_TYPE}; @@ -708,6 +712,54 @@ pub(crate) fn get_cende_row() -> Row { ) } +fn get_panel_snip35_fee_actual() -> Panel { + Panel::new( + "SNIP-35 fee_actual (GFri)", + "Median of recent fee_proposals over the sliding window, in GFri", + format!("{} / 1e9", SNIP35_FEE_ACTUAL.get_name_with_filter()), + PanelType::TimeSeries, + ) +} + +fn get_panel_snip35_fee_proposal() -> Panel { + Panel::new( + "SNIP-35 fee_proposal (GFri)", + "fee_proposal this node published in the latest block, in GFri", + format!("{} / 1e9", SNIP35_FEE_PROPOSAL.get_name_with_filter()), + PanelType::TimeSeries, + ) +} + +fn get_panel_snip35_fee_target() -> Panel { + Panel::new( + "SNIP-35 fee_target (GFri)", + "fee_target computed from the STRK/USD oracle, in GFri", + format!("{} / 1e9", SNIP35_FEE_TARGET.get_name_with_filter()), + PanelType::TimeSeries, + ) +} + +fn get_panel_snip35_strk_usd_rate() -> Panel { + Panel::new( + "SNIP-35 STRK/USD rate (USD)", + "STRK/USD rate from the oracle, in USD (raw value has 18 decimals)", + format!("{} / 1e18", SNIP35_STRK_USD_RATE.get_name_with_filter()), + PanelType::TimeSeries, + ) +} + +pub(crate) fn get_snip35_row() -> Row { + Row::new( + "SNIP-35", + vec![ + get_panel_snip35_fee_actual(), + get_panel_snip35_fee_proposal(), + get_panel_snip35_fee_target(), + get_panel_snip35_strk_usd_rate(), + ], + ) +} + pub(crate) fn get_consensus_p2p_row() -> Row { Row::new( "ConsensusP2p",