Skip to content

Commit

Permalink
feat: add base fee metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Rjected committed Jun 26, 2024
1 parent 4308e1b commit fadc7b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/transaction-pool/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,8 @@ pub struct AllTransactionsMetrics {
pub(crate) all_transactions_by_all_senders: Gauge,
/// Number of blob transactions nonce gaps.
pub(crate) blob_transactions_nonce_gaps: Counter,
/// The current blob base fee
pub(crate) blob_base_fee: Gauge,
/// The current base fee
pub(crate) base_fee: Gauge,
}
4 changes: 4 additions & 0 deletions crates/transaction-pool/src/pool/txpool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -982,9 +982,13 @@ impl<T: PoolTransaction> AllTransactions<T> {
} = block_info;
self.last_seen_block_number = last_seen_block_number;
self.last_seen_block_hash = last_seen_block_hash;

self.pending_fees.base_fee = pending_basefee;
self.metrics.base_fee.set(pending_basefee as f64);

if let Some(pending_blob_fee) = pending_blob_fee {
self.pending_fees.blob_fee = pending_blob_fee;
self.metrics.blob_base_fee.set(pending_blob_fee as f64);
}
}

Expand Down

0 comments on commit fadc7b0

Please sign in to comment.