diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 1b1491c56..d18db0ecc 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -2,7 +2,7 @@ name: "Push docker image to GCR" on: push: - branches: [main] + branches: [main,more-prover-metrics)] tags: - "v*" diff --git a/metrics/metrics.go b/metrics/metrics.go index f2110c350..7583afa4b 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -45,8 +45,8 @@ var ( ProverSlashedAmount = metrics.NewRegisteredCounter("prover/slashed/amount", nil) ProverReceivedProposedBlockGauge = metrics.NewRegisteredGauge("prover/proposed/received", nil) ProverReceivedProvenBlockGauge = metrics.NewRegisteredGauge("prover/proven/received", nil) + ProverProofRewardGauge = metrics.NewRegisteredGauge("prover/proofReward", nil) ProverAllProofRewardGauge = metrics.NewRegisteredGauge("prover/allProofReward", nil) - ProverNormalProofRewardGauge = metrics.NewRegisteredGauge("prover/normalProofReward", nil) ) // Serve starts the metrics server on the given address, will be closed when the given diff --git a/prover/prover.go b/prover/prover.go index eef60a1d4..5d3647413 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -631,10 +631,15 @@ func (p *Prover) submitProofOp(ctx context.Context, proofWithHeader *proofProduc func (p *Prover) onBlockVerified(ctx context.Context, event *bindings.TaikoL1ClientBlockVerified) error { metrics.ProverLatestVerifiedIDGauge.Update(event.BlockId.Int64()) + var reward int64 if event.ProofReward > math.MaxInt64 { - metrics.ProverAllProofRewardGauge.Update(math.MaxInt64) + reward = math.MaxInt64 } else { - metrics.ProverAllProofRewardGauge.Update(int64(event.ProofReward)) + reward = int64(event.ProofReward) + } + metrics.ProverAllProofRewardGauge.Update(reward) + if event.Prover == p.proverAddress { + metrics.ProverProofRewardGauge.Update(reward) } p.latestVerifiedL1Height = event.Raw.BlockNumber