From e43eeacb5b7a3d1fc412ffafc39f329f68ff7b40 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 7 Sep 2024 15:41:59 +0800 Subject: [PATCH] feat(taiko-client): add two more new ZK related metrics (#18043) --- packages/taiko-client/internal/metrics/metrics.go | 6 ++++++ .../taiko-client/prover/proof_producer/zkvm_producer.go | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/taiko-client/internal/metrics/metrics.go b/packages/taiko-client/internal/metrics/metrics.go index a95ee32ebf3..1c27e5d9419 100644 --- a/packages/taiko-client/internal/metrics/metrics.go +++ b/packages/taiko-client/internal/metrics/metrics.go @@ -49,6 +49,12 @@ var ( ProverSgxProofGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{ Name: "prover_proof_sgx_generated", }) + ProverR0ProofGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{ + Name: "prover_proof_r0_generated", + }) + ProverSp1ProofGeneratedCounter = factory.NewCounter(prometheus.CounterOpts{ + Name: "prover_proof_sp1_generated", + }) ProverSubmissionRevertedCounter = factory.NewCounter(prometheus.CounterOpts{ Name: "prover_proof_submission_reverted", }) diff --git a/packages/taiko-client/prover/proof_producer/zkvm_producer.go b/packages/taiko-client/prover/proof_producer/zkvm_producer.go index 0b553f19e5a..957928a13fe 100644 --- a/packages/taiko-client/prover/proof_producer/zkvm_producer.go +++ b/packages/taiko-client/prover/proof_producer/zkvm_producer.go @@ -87,7 +87,11 @@ func (s *ZKvmProofProducer) RequestProof( return nil, err } - metrics.ProverSgxProofGeneratedCounter.Add(1) + if s.ZKProofType == ZKProofTypeR0 { + metrics.ProverR0ProofGeneratedCounter.Add(1) + } else if s.ZKProofType == ZKProofTypeSP1 { + metrics.ProverSp1ProofGeneratedCounter.Add(1) + } return &ProofWithHeader{ BlockID: blockID,