diff --git a/packages/taiko-client/internal/metrics/metrics.go b/packages/taiko-client/internal/metrics/metrics.go index 99e13a18480..4ac2d510674 100644 --- a/packages/taiko-client/internal/metrics/metrics.go +++ b/packages/taiko-client/internal/metrics/metrics.go @@ -34,6 +34,7 @@ var ( ProposerEstimatedCostBlob = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_estimated_cost_blob"}) ProposerProposeByCalldata = factory.NewCounter(prometheus.CounterOpts{Name: "proposer_propose_by_calldata"}) ProposerProposeByBlob = factory.NewCounter(prometheus.CounterOpts{Name: "proposer_propose_by_blob"}) + ProposerCostEstimationError = factory.NewGauge(prometheus.GaugeOpts{Name: "proposer_cost_estimation_error"}) // Prover ProverLatestVerifiedIDGauge = factory.NewGauge(prometheus.GaugeOpts{Name: "prover_latestVerified_id"}) diff --git a/packages/taiko-client/proposer/transaction_builder/fallback.go b/packages/taiko-client/proposer/transaction_builder/fallback.go index 903966672fe..3f1c988b460 100644 --- a/packages/taiko-client/proposer/transaction_builder/fallback.go +++ b/packages/taiko-client/proposer/transaction_builder/fallback.go @@ -122,6 +122,7 @@ func (b *TxBuilderWithFallback) BuildOntake( if err = g.Wait(); err != nil { log.Error("Failed to estimate transactions cost, will build a type-3 transaction", "error", err) + metrics.ProposerCostEstimationError.Inc() // If there is an error, just build a blob transaction. return b.blobTransactionBuilder.BuildOntake(ctx, txListBytesArray) }