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

fix(prover): no retry when status in receipt is failed #675

Merged
merged 6 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
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
8 changes: 4 additions & 4 deletions prover/proof_submitter/transaction/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ package transaction

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

"github.com/ethereum-optimism/optimism/op-service/txmgr"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"

"github.com/taikoxyz/taiko-client/internal/metrics"

"github.com/taikoxyz/taiko-client/pkg/rpc"
producer "github.com/taikoxyz/taiko-client/prover/proof_producer"
)
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 All @@ -74,7 +75,6 @@ func (s *Sender) Send(
"tier", proofWithHeader.Tier,
"isContest", len(proofWithHeader.Proof) == 0,
)

metrics.ProverSubmissionAcceptedCounter.Inc(1)

return nil
Expand Down
Loading