diff --git a/crates/net/network/src/metrics.rs b/crates/net/network/src/metrics.rs index a97b6d809e..de692533ad 100644 --- a/crates/net/network/src/metrics.rs +++ b/crates/net/network/src/metrics.rs @@ -40,6 +40,8 @@ pub struct NetworkMetrics { pub struct TransactionsManagerMetrics { /// Total number of propagated transactions pub(crate) propagated_transactions: Counter, + /// Total number of reported bad transactions + pub(crate) reported_bad_transactions: Counter, } /// Metrics for Disconnection types diff --git a/crates/net/network/src/transactions.rs b/crates/net/network/src/transactions.rs index 0859a59503..4431a8ad5e 100644 --- a/crates/net/network/src/transactions.rs +++ b/crates/net/network/src/transactions.rs @@ -534,6 +534,7 @@ where if err.is_bad_transaction() && !this.network.is_syncing() { trace!(target: "net::tx", ?err, "Bad transaction import"); this.on_bad_import(*err.hash()); + this.metrics.reported_bad_transactions.increment(1); continue } this.on_good_import(*err.hash());