From dd692b02e6947b8a5177dff553b05f7d5d66b670 Mon Sep 17 00:00:00 2001 From: Nicholas Pettas Date: Wed, 17 Apr 2024 11:02:28 -0700 Subject: [PATCH] add gas tip metrics (#23) --- evmcore/tx_pool.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/evmcore/tx_pool.go b/evmcore/tx_pool.go index b8b552f9b..8e5ed3fdf 100644 --- a/evmcore/tx_pool.go +++ b/evmcore/tx_pool.go @@ -118,6 +118,8 @@ var ( underpricedMinAcceptedPriceTxCounter = metrics.GetOrRegisterMeter("txpool/underpriced/minaccepted", nil) underpricedRecommendedTipTxCounter = metrics.GetOrRegisterMeter("txpool/underpriced/recommendedtip", nil) underpricedRecommendedTipAndMinPriceTxCounter = metrics.GetOrRegisterMeter("txpool/underpriced/recommendedtipandminprice", nil) + minPriceGauge = metrics.GetOrRegisterGauge("txpool/minprice", nil) + recommendedTipGauge = metrics.GetOrRegisterGauge("txpool/recommendedtip", nil) pendingGauge = metrics.GetOrRegisterGauge("txpool/pending", nil) queuedGauge = metrics.GetOrRegisterGauge("txpool/queued", nil) @@ -632,6 +634,8 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error { } // Ensure Opera-specific hard bounds if recommendedGasTip, minPrice := pool.chain.EffectiveMinTip(), pool.chain.MinGasPrice(); recommendedGasTip != nil && minPrice != nil { + minPriceGauge.Update(minPrice.Int64()) + recommendedTipGauge.Update(recommendedGasTip.Int64()) if tx.GasTipCapIntCmp(recommendedGasTip) < 0 { underpricedRecommendedTipTxCounter.Mark(1) return ErrUnderpriced