From b5fd995a2e5991428212fe27d054cab5424bedf3 Mon Sep 17 00:00:00 2001 From: Intizar Date: Mon, 26 Aug 2024 17:14:48 +0900 Subject: [PATCH] handle context deadline exceeded error and remove duplicate logs --- node/pkg/chain/helper/helper.go | 2 +- node/pkg/reporter/reporter.go | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/node/pkg/chain/helper/helper.go b/node/pkg/chain/helper/helper.go index b3dc80110..77c73a43d 100644 --- a/node/pkg/chain/helper/helper.go +++ b/node/pkg/chain/helper/helper.go @@ -273,7 +273,7 @@ func (t *ChainHelper) SubmitDelegatedFallbackDirect(ctx context.Context, contrac if err != nil { if utils.ShouldRetryWithSwitchedJsonRPC(err) { clientIndex = (clientIndex + 1) % len(t.clients) - } else if errors.Is(err, errorSentinel.ErrChainTransactionFail) || utils.IsNonceError(err) { + } else if errors.Is(err, errorSentinel.ErrChainTransactionFail) || utils.IsNonceError(err) || err == context.DeadlineExceeded { nonce, err = noncemanager.GetAndIncrementNonce(t.wallet) if err != nil { return err diff --git a/node/pkg/reporter/reporter.go b/node/pkg/reporter/reporter.go index b6db17039..09f5ec76a 100644 --- a/node/pkg/reporter/reporter.go +++ b/node/pkg/reporter/reporter.go @@ -87,7 +87,6 @@ func (r *Reporter) regularReporterJob(ctx context.Context) error { err = r.report(ctx, pairsMap) if err != nil { - log.Error().Str("Player", "Reporter").Err(err).Msg("Reporter") return err } return nil @@ -102,7 +101,6 @@ func (r *Reporter) deviationJob(ctx context.Context) error { err := r.report(ctx, deviatingAggregates) if err != nil { - log.Error().Str("Player", "Reporter").Err(err).Msg("DeviationReport") return err } return nil @@ -139,7 +137,6 @@ func (r *Reporter) report(ctx context.Context, pairs map[string]SubmissionData) defer wg.Done() err := r.KaiaHelper.SubmitDelegatedFallbackDirect(ctx, r.contractAddress, SUBMIT_WITH_PROOFS, batchFeedHashes, batchValues, batchTimestamps, batchProofs) if err != nil { - log.Error().Str("Player", "Reporter").Err(err).Msg("splitReport") errorsChan <- err } }()