Skip to content

Commit

Permalink
handle context deadline exceeded in direct tx (#2243)
Browse files Browse the repository at this point in the history
  • Loading branch information
Intizar-T authored Aug 28, 2024
1 parent deae0ca commit 055b603
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions node/pkg/chain/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ 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) || err == context.DeadlineExceeded {
} else if errors.Is(err, errorSentinel.ErrChainTransactionFail) {
return err // if transaction fails, the data will probably be too old to retry
} else if utils.IsNonceError(err) || err == context.DeadlineExceeded {
nonce, err = noncemanager.GetAndIncrementNonce(t.wallet)
if err != nil {
return err
Expand All @@ -297,7 +299,9 @@ 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) {
return err // if transaction fails, the data will probably be too old to retry
} else if utils.IsNonceError(err) || err == context.DeadlineExceeded {
nonce, err = noncemanager.GetAndIncrementNonce(t.wallet)
if err != nil {
return err
Expand Down

0 comments on commit 055b603

Please sign in to comment.