Skip to content

Commit

Permalink
add delay to handling nonce
Browse files Browse the repository at this point in the history
  • Loading branch information
augustbleeds committed Mar 8, 2024
1 parent ca88f2c commit 879a575
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions relayer/pkg/chainlink/txm/txm.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ func (txm *starktxm) handleNonceErr(ctx context.Context, accountAddress *felt.Fe

txm.lggr.Debugw("Handling Nonce Validation Error By Resubmitting Txs...", "account", accountAddress)

// wait for rpc starknet_estimateFee to catch up with nonce returned by starknet_getNonce
<-time.After(utils.WithJitter(time.Second))

// resync nonce so that new queued txs can be unblocked
client, err := txm.client.Get()
if err != nil {
Expand Down Expand Up @@ -423,6 +426,8 @@ func (txm *starktxm) confirmLoop() {
continue
}

txm.lggr.Errorw("tx rejected reason", rejectedTx.ErrorMessage, "hash", hash, "addr", addr)

if isInvalidNonce(rejectedTx.ErrorMessage) {

utx, err := txm.txStore.GetSingleUnconfirmed(addr, hash)
Expand Down

0 comments on commit 879a575

Please sign in to comment.