Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a metric for blob transactions nonce gaps #9106

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/transaction-pool/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
2 changes: 2 additions & 0 deletions crates/transaction-pool/src/pool/txpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) })
}

Expand Down
17 changes: 17 additions & 0 deletions etc/grafana/dashboards/reth-mempool.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading