Skip to content

Commit

Permalink
Make “error posting batch” error just a warning unless it happens con…
Browse files Browse the repository at this point in the history
…tinuously
  • Loading branch information
ganeshvanahalli committed Nov 14, 2023
1 parent fdd098e commit 6635e25
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions arbnode/batch_poster.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"github.com/ethereum/go-ethereum/rpc"

"github.com/offchainlabs/nitro/arbnode/dataposter"
"github.com/offchainlabs/nitro/arbnode/dataposter/storage"
"github.com/offchainlabs/nitro/arbnode/redislock"
"github.com/offchainlabs/nitro/arbos/arbostypes"
"github.com/offchainlabs/nitro/arbstate"
Expand Down Expand Up @@ -1109,22 +1108,21 @@ func (b *BatchPoster) Start(ctxIn context.Context) {
return b.config().PollInterval
}
posted, err := b.maybePostSequencerBatch(ctx)
ephemeralError := errors.Is(err, AccumulatorNotFoundErr) || errors.Is(err, storage.ErrStorageRace)
if !ephemeralError {
if err == nil {
b.firstEphemeralError = time.Time{}
}
if err != nil {
b.building = nil
logLevel := log.Error
if ephemeralError {
// Likely the inbox tracker just isn't caught up.
// Let's see if this error disappears naturally.
if b.firstEphemeralError == (time.Time{}) {
b.firstEphemeralError = time.Now()
logLevel = log.Debug
} else if time.Since(b.firstEphemeralError) < time.Minute {
logLevel = log.Debug
}
// Likely the inbox tracker just isn't caught up.
// Let's see if this error disappears naturally.
if b.firstEphemeralError == (time.Time{}) {
b.firstEphemeralError = time.Now()
logLevel = log.Warn
} else if time.Since(b.firstEphemeralError) < time.Minute {
logLevel = log.Warn
} else if time.Since(b.firstEphemeralError) < time.Minute*5 && strings.Contains(err.Error(), "will exceed max mempool size") {
logLevel = log.Warn
}
logLevel("error posting batch", "err", err)
return b.config().ErrorDelay
Expand Down

0 comments on commit 6635e25

Please sign in to comment.