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

chore(metrics): update metrics to track prover performance #426

Merged
merged 2 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
ProverPseProofGenerationTime = 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.ProverPseProofGenerationTime.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