mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 08:11:04 +00:00
Monitor transactions rejected from the pool as invalid (#5992)
This commit is contained in:
@@ -296,7 +296,9 @@ impl<PoolApi, Block> TransactionPool for BasicPool<PoolApi, Block>
|
||||
}
|
||||
|
||||
fn remove_invalid(&self, hashes: &[TxHash<Self>]) -> Vec<Arc<Self::InPoolTransaction>> {
|
||||
self.pool.validated_pool().remove_invalid(hashes)
|
||||
let removed = self.pool.validated_pool().remove_invalid(hashes);
|
||||
self.metrics.report(|metrics| metrics.validations_invalid.inc_by(removed.len() as u64));
|
||||
removed
|
||||
}
|
||||
|
||||
fn status(&self) -> PoolStatus {
|
||||
|
||||
@@ -45,6 +45,7 @@ impl MetricsLink {
|
||||
pub struct Metrics {
|
||||
pub validations_scheduled: Counter<U64>,
|
||||
pub validations_finished: Counter<U64>,
|
||||
pub validations_invalid: Counter<U64>,
|
||||
}
|
||||
|
||||
impl Metrics {
|
||||
@@ -64,6 +65,13 @@ impl Metrics {
|
||||
)?,
|
||||
registry,
|
||||
)?,
|
||||
validations_invalid: register(
|
||||
Counter::new(
|
||||
"sub_txpool_validations_invalid",
|
||||
"Total number of transactions that were removed from the pool as invalid",
|
||||
)?,
|
||||
registry,
|
||||
)?,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user