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

Commit 971f581

Browse files
feat(prover): stop retrying when error is vm.ErrExecutionReverted (#706)
1 parent a97255d commit 971f581

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

prover/proof_submitter/transaction/sender.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ func (s *Sender) Send(
6060
}
6161

6262
if receipt.Status != types.ReceiptStatusSuccessful {
63-
log.Error("Failed to submit proof", "txHash", receipt.TxHash)
63+
log.Error(
64+
"Failed to submit proof",
65+
"blockID", proofWithHeader.BlockID,
66+
"tier", proofWithHeader.Tier,
67+
"txHash", receipt.TxHash,
68+
)
6469
metrics.ProverSubmissionRevertedCounter.Inc(1)
6570
return ErrUnretryableSubmission
6671
}

prover/prover.go

+23-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"fmt"
77
"math/big"
88
"net/http"
9+
"strings"
910
"sync"
1011
"time"
1112

@@ -14,6 +15,7 @@ import (
1415
"github.com/ethereum-optimism/optimism/op-service/txmgr/metrics"
1516
"github.com/ethereum/go-ethereum/accounts/abi/bind"
1617
"github.com/ethereum/go-ethereum/common"
18+
"github.com/ethereum/go-ethereum/core/vm"
1719
"github.com/ethereum/go-ethereum/log"
1820
"github.com/urfave/cli/v2"
1921

@@ -286,12 +288,12 @@ func (p *Prover) eventLoop() {
286288
select {
287289
case <-p.ctx.Done():
288290
return
291+
case req := <-p.proofContestCh:
292+
p.withRetry(func() error { return p.contestProofOp(req) })
289293
case proofWithHeader := <-p.proofGenerationCh:
290294
p.withRetry(func() error { return p.submitProofOp(proofWithHeader) })
291295
case req := <-p.proofSubmissionCh:
292296
p.withRetry(func() error { return p.requestProofOp(req.Event, req.Tier) })
293-
case req := <-p.proofContestCh:
294-
p.withRetry(func() error { return p.contestProofOp(req) })
295297
case <-p.proveNotify:
296298
if err := p.proveOp(); err != nil {
297299
log.Error("Prove new blocks error", "error", err)
@@ -320,7 +322,7 @@ func (p *Prover) Close(ctx context.Context) {
320322
p.wg.Wait()
321323
}
322324

323-
// proveOp iterates through BlockProposed events
325+
// proveOp iterates through BlockProposed events.
324326
func (p *Prover) proveOp() error {
325327
iter, err := eventIterator.NewBlockProposedIterator(p.ctx, &eventIterator.BlockProposedIteratorConfig{
326328
Client: p.rpc.L1,
@@ -347,6 +349,15 @@ func (p *Prover) contestProofOp(req *proofProducer.ContestRequestBody) error {
347349
req.Meta,
348350
req.Tier,
349351
); err != nil {
352+
if strings.Contains(err.Error(), vm.ErrExecutionReverted.Error()) {
353+
log.Error(
354+
"Proof contest submission reverted",
355+
"blockID", req.BlockID,
356+
"minTier", req.Meta.MinTier,
357+
"error", err,
358+
)
359+
return nil
360+
}
350361
log.Error(
351362
"Request new proof contest error",
352363
"blockID", req.BlockID,
@@ -385,6 +396,15 @@ func (p *Prover) submitProofOp(proofWithHeader *proofProducer.ProofWithHeader) e
385396
}
386397

387398
if err := submitter.SubmitProof(p.ctx, proofWithHeader); err != nil {
399+
if strings.Contains(err.Error(), vm.ErrExecutionReverted.Error()) {
400+
log.Error(
401+
"Proof submission reverted",
402+
"blockID", proofWithHeader.BlockID,
403+
"minTier", proofWithHeader.Meta.MinTier,
404+
"error", err,
405+
)
406+
return nil
407+
}
388408
log.Error(
389409
"Submit proof error",
390410
"blockID", proofWithHeader.BlockID,

0 commit comments

Comments
 (0)