Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
chore(metrics): update metrics to track prover performance
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Oct 16, 2023
1 parent 05d088f commit d5eb8ed
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions prover/proof_producer/zkevm_rpcd_producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions prover/proof_submitter/proof_submitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ func (s *ProofSubmitter) SubmitProof(
return nil
}

metrics.ProverValidProofSubmissionErrorCounter.Inc(1)
return err
}

Expand Down
3 changes: 3 additions & 0 deletions prover/proof_submitter/transaction/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit d5eb8ed

Please sign in to comment.