From 8da1eb7e1908a21e12cd0b4dee6d7b2dae6e2094 Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Mon, 2 Sep 2024 11:41:49 -0500 Subject: [PATCH] Fix spurious "failed to re-send transaction" error logs --- arbnode/dataposter/data_poster.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/arbnode/dataposter/data_poster.go b/arbnode/dataposter/data_poster.go index 6a483929b2..cc62bbd9d9 100644 --- a/arbnode/dataposter/data_poster.go +++ b/arbnode/dataposter/data_poster.go @@ -24,6 +24,7 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/consensus/misc/eip4844" + "github.com/ethereum/go-ethereum/core/txpool" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto/kzg4844" "github.com/ethereum/go-ethereum/ethdb" @@ -1087,7 +1088,7 @@ func (p *DataPoster) updateBalance(ctx context.Context) error { return nil } -const maxConsecutiveIntermittentErrors = 10 +const maxConsecutiveIntermittentErrors = 20 func (p *DataPoster) maybeLogError(err error, tx *storage.QueuedTransaction, msg string) { nonce := tx.FullTx.Nonce() @@ -1096,10 +1097,17 @@ func (p *DataPoster) maybeLogError(err error, tx *storage.QueuedTransaction, msg return } logLevel := log.Error - if errors.Is(err, storage.ErrStorageRace) { + isStorageRace := errors.Is(err, storage.ErrStorageRace) + if isStorageRace || strings.Contains(err.Error(), txpool.ErrFutureReplacePending.Error()) { p.errorCount[nonce]++ if p.errorCount[nonce] <= maxConsecutiveIntermittentErrors { - logLevel = log.Debug + if isStorageRace { + logLevel = log.Debug + } else { + logLevel = log.Info + } + } else if isStorageRace { + logLevel = log.Warn } } else { delete(p.errorCount, nonce)