diff --git a/metrics/metrics.go b/metrics/metrics.go index a43c1929f..3a45164d7 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -37,6 +37,13 @@ var ( ProverProofsAssigned = metrics.NewRegisteredCounter("prover/proof/assigned", nil) ProverReceivedProposedBlockGauge = metrics.NewRegisteredGauge("prover/proposed/received", nil) ProverReceivedProvenBlockGauge = metrics.NewRegisteredGauge("prover/proven/received", nil) + ProverProofGenerationTime = metrics.NewRegisteredHistogram( + "prover/proof/pse/generation/time", + nil, + metrics.NewExpDecaySample(128, 0.015), + ) + ProverValidProofSubmissionAcceptedCounter = metrics.NewRegisteredCounter("prover/proof/submission/accepted", nil) + ProverValidProofSubmissionErrorCounter = metrics.NewRegisteredCounter("prover/proof/submission/error", nil) ) // Serve starts the metrics server on the given address, will be closed when the given diff --git a/prover/proof_producer/zkevm_rpcd_producer.go b/prover/proof_producer/zkevm_rpcd_producer.go index b39dc3995..1328cef94 100644 --- a/prover/proof_producer/zkevm_rpcd_producer.go +++ b/prover/proof_producer/zkevm_rpcd_producer.go @@ -17,6 +17,7 @@ import ( "github.com/ethereum/go-ethereum/log" "github.com/taikoxyz/taiko-client/bindings" "github.com/taikoxyz/taiko-client/bindings/encoding" + "github.com/taikoxyz/taiko-client/metrics" ) var ( @@ -206,6 +207,9 @@ func (p *ZkevmRpcdProducer) callProverDaemon(ctx context.Context, opts *ProofReq }, backoff.NewConstantBackOff(proofPollingInterval)); err != nil { return nil, 0, err } + + metrics.ProverProofGenerationTime.Update(int64(time.Since(start).Seconds())) + return proof, degree, nil } diff --git a/prover/proof_submitter/proof_submitter.go b/prover/proof_submitter/proof_submitter.go index c4b62047e..7642bc88d 100644 --- a/prover/proof_submitter/proof_submitter.go +++ b/prover/proof_submitter/proof_submitter.go @@ -200,6 +200,7 @@ func (s *ProofSubmitter) SubmitProof( return nil } + metrics.ProverValidProofSubmissionErrorCounter.Inc(1) return err } diff --git a/prover/proof_submitter/transaction/sender.go b/prover/proof_submitter/transaction/sender.go index 55ee7ddec..5c7224500 100644 --- a/prover/proof_submitter/transaction/sender.go +++ b/prover/proof_submitter/transaction/sender.go @@ -13,6 +13,7 @@ import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/log" "github.com/taikoxyz/taiko-client/bindings/encoding" + "github.com/taikoxyz/taiko-client/metrics" "github.com/taikoxyz/taiko-client/pkg/rpc" proofProducer "github.com/taikoxyz/taiko-client/prover/proof_producer" ) @@ -118,6 +119,8 @@ func (s *Sender) Send( "isContest", len(proofWithHeader.Proof) == 0, ) + metrics.ProverValidProofSubmissionAcceptedCounter.Inc(1) + return nil }, s.backOffPolicy); err != nil { if s.maxRetry != nil {