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

Commit

Permalink
feat: check ErrNonceTooLow
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Sep 26, 2023
1 parent b8be214 commit cdd0cc3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion proposer/proposer.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/cenkalti/backoff/v4"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/txpool"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
Expand Down Expand Up @@ -401,7 +402,10 @@ func (p *Proposer) ProposeTxList(
return nil
}
if tx, err = p.sendProposeBlockTx(ctx, meta, txListBytes, nonce, assignment, fee, isReplacement); err != nil {
log.Warn("Failed to send propose block transaction, retrying", "error", encoding.TryParsingCustomError(err))
log.Warn("Failed to send propose block transaction", "error", encoding.TryParsingCustomError(err))
if strings.Contains(err.Error(), core.ErrNonceTooLow.Error()) {
return nil
}
if strings.Contains(err.Error(), txpool.ErrReplaceUnderpriced.Error()) {
isReplacement = true
} else {
Expand Down
5 changes: 5 additions & 0 deletions prover/proof_submitter/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/cenkalti/backoff/v4"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/taikoxyz/taiko-client/bindings"
Expand Down Expand Up @@ -136,6 +137,10 @@ func sendTxWithBackoff(
err = encoding.TryParsingCustomError(err)
if isSubmitProofTxErrorRetryable(err, blockID) {
log.Info("Retry sending TaikoL1.proveBlock transaction", "blockID", blockID, "reason", err)
if strings.Contains(err.Error(), core.ErrNonceTooLow.Error()) {
nonce = nil
}

return err
}

Expand Down

0 comments on commit cdd0cc3

Please sign in to comment.