Skip to content

Commit

Permalink
feat(taiko-client): add two more new ZK related metrics (#18043)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha authored Sep 7, 2024
1 parent 703b062 commit e43eeac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/taiko-client/internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
})
Expand Down
6 changes: 5 additions & 1 deletion packages/taiko-client/prover/proof_producer/zkvm_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e43eeac

Please sign in to comment.