Skip to content

Commit

Permalink
handle context deadline exceeded error and remove duplicate logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Intizar-T committed Aug 26, 2024
1 parent 11c1350 commit b5fd995
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion node/pkg/chain/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions node/pkg/reporter/reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
}
}()
Expand Down

0 comments on commit b5fd995

Please sign in to comment.