diff --git a/crates/transaction-pool/src/metrics.rs b/crates/transaction-pool/src/metrics.rs index 5be12634e5..1a29e4b75f 100644 --- a/crates/transaction-pool/src/metrics.rs +++ b/crates/transaction-pool/src/metrics.rs @@ -33,6 +33,9 @@ pub struct TxPoolMetrics { /// Number of all transactions of all sub-pools: pending + basefee + queued pub(crate) total_transactions: Gauge, + + /// How often the pool was updated after the canonical state changed + pub(crate) performed_state_updates: Counter, } /// Transaction pool maintenance metrics diff --git a/crates/transaction-pool/src/pool/txpool.rs b/crates/transaction-pool/src/pool/txpool.rs index 9793da32a3..6b1bad8644 100644 --- a/crates/transaction-pool/src/pool/txpool.rs +++ b/crates/transaction-pool/src/pool/txpool.rs @@ -261,6 +261,8 @@ impl TxPool { // update the metrics after the update self.update_size_metrics(); + self.metrics.performed_state_updates.increment(1); + OnNewCanonicalStateOutcome { block_hash, mined: mined_transactions, promoted, discarded } }