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

Commit

Permalink
fix(prover): do not retry when the status in receipt is not `types.Re…
Browse files Browse the repository at this point in the history
…ceiptStatusSuccessful` (#675)

Co-authored-by: David <[email protected]>
  • Loading branch information
YoGhurt111 and davidtaikocha authored Apr 1, 2024
1 parent 16fe52a commit 5f91e0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var (
ProverSubmissionErrorCounter = metrics.NewRegisteredCounter("prover/proof/submission/error", nil)
ProverSgxProofGeneratedCounter = metrics.NewRegisteredCounter("prover/proof/sgx/generated", nil)
ProverPseProofGeneratedCounter = metrics.NewRegisteredCounter("prover/proof/pse/generated", nil)
ProverSubmissionRevertedCounter = metrics.NewRegisteredCounter("prover/proof/submission/reverted", nil)

// Transaction sender
TxSenderSentCounter = metrics.NewRegisteredCounter("sender/sent/txs", nil)
Expand Down
5 changes: 3 additions & 2 deletions prover/proof_submitter/transaction/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package transaction

import (
"context"
"fmt"
"math/big"
"strings"

Expand Down Expand Up @@ -61,7 +60,9 @@ func (s *Sender) Send(
}

if receipt.Status != types.ReceiptStatusSuccessful {
return fmt.Errorf("failed to submit proof: %s", receipt.TxHash)
log.Error("Failed to submit proof", "txHash", receipt.TxHash)
metrics.ProverSubmissionRevertedCounter.Inc(1)
return ErrUnretryableSubmission
}

log.Info(
Expand Down

0 comments on commit 5f91e0e

Please sign in to comment.