diff --git a/arbnode/batch_poster.go b/arbnode/batch_poster.go index dbe1b7b930..5829abc42c 100644 --- a/arbnode/batch_poster.go +++ b/arbnode/batch_poster.go @@ -557,6 +557,8 @@ func AccessList(opts *AccessListOpts) types.AccessList { return l } +var EspressoVerificationError = errors.New("waiting for espresso verification") + // Adds a block merkle proof to an Espresso justification, providing a proof that a set of transactions // hashes to some light client state root. func (b *BatchPoster) checkEspressoValidation( @@ -587,8 +589,6 @@ func (b *BatchPoster) checkEspressoValidation( return nil } - log.Warn("this message has not been finalized on L1 or validated") - if b.streamer.UseEscapeHatch { skip, err := b.streamer.getSkipVerificationPos() if err != nil { @@ -612,7 +612,7 @@ func (b *BatchPoster) checkEspressoValidation( return nil } - return fmt.Errorf("waiting for espresso finalization, pos: %d", b.building.msgCount) + return EspressoVerificationError } func (b *BatchPoster) submitEspressoTransactionPos(pos arbutil.MessageIndex) error { @@ -1815,12 +1815,14 @@ func (b *BatchPoster) Start(ctxIn context.Context) { storageRaceEphemeralErrorHandler := util.NewEphemeralErrorHandler(5*time.Minute, storage.ErrStorageRace.Error(), time.Minute) normalGasEstimationFailedEphemeralErrorHandler := util.NewEphemeralErrorHandler(5*time.Minute, ErrNormalGasEstimationFailed.Error(), time.Minute) accumulatorNotFoundEphemeralErrorHandler := util.NewEphemeralErrorHandler(5*time.Minute, AccumulatorNotFoundErr.Error(), time.Minute) + espressoEphemeralErrorHandler := util.NewEphemeralErrorHandler(80*time.Minute, EspressoVerificationError.Error(), time.Hour) resetAllEphemeralErrs := func() { commonEphemeralErrorHandler.Reset() exceedMaxMempoolSizeEphemeralErrorHandler.Reset() storageRaceEphemeralErrorHandler.Reset() normalGasEstimationFailedEphemeralErrorHandler.Reset() accumulatorNotFoundEphemeralErrorHandler.Reset() + espressoEphemeralErrorHandler.Reset() } b.CallIteratively(func(ctx context.Context) time.Duration { var err error @@ -1875,6 +1877,7 @@ func (b *BatchPoster) Start(ctxIn context.Context) { // Likely the inbox tracker just isn't caught up. // Let's see if this error disappears naturally. logLevel = commonEphemeralErrorHandler.LogLevel(err, logLevel) + logLevel = espressoEphemeralErrorHandler.LogLevel(err, logLevel) // If the error matches one of these, it's only logged at debug for the first minute, // then at warn for the next 4 minutes, then at error. If the error isn't one of these, // it'll be logged at warn for the first minute, then at error. diff --git a/arbnode/log_cleaner.go b/arbnode/log_cleaner.go new file mode 100644 index 0000000000..9f9fb4e528 --- /dev/null +++ b/arbnode/log_cleaner.go @@ -0,0 +1,18 @@ +package arbnode + +import ( + "time" + + log_helper "github.com/EspressoSystems/espresso-sequencer-go/log-helper" +) + +const FETCH_MERKLE_ROOT = "espresso-fetch-merkle-root" +const ESPRESSO_VERIFICATION = "espresso-verification" + +var logger = log_helper.NewLogger() + +func init() { + // An error log will occur if more than an hour has passed since the first attempt + logger.AddLogAfterDurationStrategy(FETCH_MERKLE_ROOT, "0", time.Hour) + logger.AddLogAfterDurationStrategy(ESPRESSO_VERIFICATION, "0", time.Hour) +} diff --git a/arbnode/transaction_streamer.go b/arbnode/transaction_streamer.go index 00f04eb11d..cc2e300395 100644 --- a/arbnode/transaction_streamer.go +++ b/arbnode/transaction_streamer.go @@ -11,6 +11,7 @@ import ( "fmt" "math/big" "reflect" + "strconv" "sync" "sync/atomic" "testing" @@ -1327,7 +1328,9 @@ func (s *TransactionStreamer) pollSubmittedTransactionForFinality(ctx context.Co // Verify the merkle tree proof snapshot, err := s.lightClientReader.FetchMerkleRoot(height, nil) if err != nil { - log.Warn("could not get the merkle root", "height", height, "err", err) + logger.Attempt(FETCH_MERKLE_ROOT, strconv.FormatUint(height, 10), func() { + log.Warn("could not get the merkle root", "height", height, "err", err) + }) return false }