mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
Add a metric for blob transactions nonce gaps (#9106)
This commit is contained in:
@ -104,4 +104,6 @@ pub struct AllTransactionsMetrics {
|
||||
pub(crate) all_transactions_by_id: Gauge,
|
||||
/// Number of all transactions by all senders in the pool
|
||||
pub(crate) all_transactions_by_all_senders: Gauge,
|
||||
/// Number of blob transactions nonce gaps.
|
||||
pub(crate) blob_transactions_nonce_gaps: Counter,
|
||||
}
|
||||
|
||||
@ -1335,11 +1335,13 @@ impl<T: PoolTransaction> AllTransactions<T> {
|
||||
if let Some(ancestor) = ancestor {
|
||||
let Some(ancestor_tx) = self.txs.get(&ancestor) else {
|
||||
// ancestor tx is missing, so we can't insert the new blob
|
||||
self.metrics.blob_transactions_nonce_gaps.increment(1);
|
||||
return Err(InsertErr::BlobTxHasNonceGap { transaction: Arc::new(new_blob_tx) })
|
||||
};
|
||||
if ancestor_tx.state.has_nonce_gap() {
|
||||
// the ancestor transaction already has a nonce gap, so we can't insert the new
|
||||
// blob
|
||||
self.metrics.blob_transactions_nonce_gaps.increment(1);
|
||||
return Err(InsertErr::BlobTxHasNonceGap { transaction: Arc::new(new_blob_tx) })
|
||||
}
|
||||
|
||||
|
||||
@ -1719,6 +1719,23 @@
|
||||
"range": true,
|
||||
"refId": "C",
|
||||
"useBackend": false
|
||||
},
|
||||
{
|
||||
"datasource": {
|
||||
"type": "prometheus",
|
||||
"uid": "${DS_PROMETHEUS}"
|
||||
},
|
||||
"disableTextWrap": false,
|
||||
"editorMode": "builder",
|
||||
"expr": "reth_transaction_pool_blob_transactions_nonce_gaps{instance=~\"$instance\"}",
|
||||
"fullMetaSearch": false,
|
||||
"hide": false,
|
||||
"includeNullMetadata": true,
|
||||
"instant": false,
|
||||
"legendFormat": "Blob transactions nonce gaps",
|
||||
"range": true,
|
||||
"refId": "D",
|
||||
"useBackend": false
|
||||
}
|
||||
],
|
||||
"title": "All Transactions metrics",
|
||||
|
||||
Reference in New Issue
Block a user