Skip to content

Commit

Permalink
fix(sequencer) fix wrong metric and remove unused metric (#1240)
Browse files Browse the repository at this point in the history
## Summary
decode failure was being recorded instead of the correct execution
failure metric.

decode failure is no longer used anywhere so it was removed

## Changes
- see summary

## Testing
unit tests
  • Loading branch information
noot authored Jul 6, 2024
1 parent fc4e76b commit c90005d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
3 changes: 1 addition & 2 deletions crates/astria-sequencer/src/app/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,8 +545,7 @@ impl App {
included_signed_txs.push((*tx).clone());
}
Err(e) => {
self.metrics
.increment_prepare_proposal_excluded_transactions_decode_failure();
self.metrics.increment_check_tx_removed_failed_execution();
debug!(
transaction_hash = %tx_hash_base64,
error = AsRef::<dyn std::error::Error>::as_ref(&e),
Expand Down
22 changes: 0 additions & 22 deletions crates/astria-sequencer/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use metrics::{
use telemetry::metric_names;

pub(crate) struct Metrics {
prepare_proposal_excluded_transactions_decode_failure: Counter,
prepare_proposal_excluded_transactions_cometbft_space: Counter,
prepare_proposal_excluded_transactions_sequencer_space: Counter,
prepare_proposal_excluded_transactions_failed_execution: Counter,
Expand All @@ -33,15 +32,6 @@ impl Metrics {
#[must_use]
#[allow(clippy::too_many_lines)]
pub(crate) fn new() -> Self {
describe_counter!(
PREPARE_PROPOSAL_EXCLUDED_TRANSACTIONS_DECODE_FAILURE,
Unit::Count,
"The number of transactions that have been excluded from blocks due to failing to \
decode"
);
let prepare_proposal_excluded_transactions_decode_failure =
counter!(PREPARE_PROPOSAL_EXCLUDED_TRANSACTIONS_DECODE_FAILURE);

describe_counter!(
PREPARE_PROPOSAL_EXCLUDED_TRANSACTIONS_COMETBFT_SPACE,
Unit::Count,
Expand Down Expand Up @@ -146,7 +136,6 @@ impl Metrics {
let check_tx_removed_expired = counter!(CHECK_TX_REMOVED_EXPIRED);

Self {
prepare_proposal_excluded_transactions_decode_failure,
prepare_proposal_excluded_transactions_cometbft_space,
prepare_proposal_excluded_transactions_sequencer_space,
prepare_proposal_excluded_transactions_failed_execution,
Expand All @@ -163,11 +152,6 @@ impl Metrics {
}
}

pub(crate) fn increment_prepare_proposal_excluded_transactions_decode_failure(&self) {
self.prepare_proposal_excluded_transactions_decode_failure
.increment(1);
}

pub(crate) fn increment_prepare_proposal_excluded_transactions_cometbft_space(&self) {
self.prepare_proposal_excluded_transactions_cometbft_space
.increment(1);
Expand Down Expand Up @@ -229,7 +213,6 @@ impl Metrics {
}

metric_names!(pub const METRICS_NAMES:
PREPARE_PROPOSAL_EXCLUDED_TRANSACTIONS_DECODE_FAILURE,
PREPARE_PROPOSAL_EXCLUDED_TRANSACTIONS_COMETBFT_SPACE,
PREPARE_PROPOSAL_EXCLUDED_TRANSACTIONS_SEQUENCER_SPACE,
PREPARE_PROPOSAL_EXCLUDED_TRANSACTIONS_FAILED_EXECUTION,
Expand All @@ -256,7 +239,6 @@ mod tests {
CHECK_TX_REMOVED_TOO_LARGE,
PREPARE_PROPOSAL_EXCLUDED_TRANSACTIONS,
PREPARE_PROPOSAL_EXCLUDED_TRANSACTIONS_COMETBFT_SPACE,
PREPARE_PROPOSAL_EXCLUDED_TRANSACTIONS_DECODE_FAILURE,
PREPARE_PROPOSAL_EXCLUDED_TRANSACTIONS_FAILED_EXECUTION,
PREPARE_PROPOSAL_EXCLUDED_TRANSACTIONS_SEQUENCER_SPACE,
PROCESS_PROPOSAL_SKIPPED_PROPOSAL,
Expand All @@ -274,10 +256,6 @@ mod tests {

#[test]
fn metrics_are_as_expected() {
assert_const(
PREPARE_PROPOSAL_EXCLUDED_TRANSACTIONS_DECODE_FAILURE,
"prepare_proposal_excluded_transactions_decode_failure",
);
assert_const(
PREPARE_PROPOSAL_EXCLUDED_TRANSACTIONS_COMETBFT_SPACE,
"prepare_proposal_excluded_transactions_cometbft_space",
Expand Down

0 comments on commit c90005d

Please sign in to comment.