diff --git a/protocol/statetracker/tx_sender.go b/protocol/statetracker/tx_sender.go index 8712c1927d..4049efafc5 100644 --- a/protocol/statetracker/tx_sender.go +++ b/protocol/statetracker/tx_sender.go @@ -215,9 +215,14 @@ func (ts *TxSender) waitForTxCommit(resultData common.TxResultData) (common.TxRe txResultChan := make(chan *coretypes.ResultTx) guid := utils.GenerateUniqueIdentifier() // check consumer session manager + timeOutReached := false go func() { for { - ctx, cancel := context.WithTimeout(utils.WithUniqueIdentifier(context.Background(), guid), 3*time.Second) + if timeOutReached { + utils.LavaFormatWarning("Timeout waiting for transaction", nil, utils.LogAttr("hash", resultData.Txhash)) + return + } + ctx, cancel := context.WithTimeout(utils.WithUniqueIdentifier(context.Background(), guid), 5*time.Second) result, err := clientCtx.Client.Tx(ctx, resultData.Txhash, false) cancel() if err == nil { @@ -242,6 +247,7 @@ func (ts *TxSender) waitForTxCommit(resultData common.TxResultData) (common.TxRe utils.LavaFormatDebug("Tx Hash found on blockchain", utils.LogAttr("Txhash", hex.EncodeToString(resultData.Txhash)), utils.LogAttr("Code", resultData.Code)) break case <-time.After(5 * time.Minute): + timeOutReached = true return common.TxResultData{}, utils.LavaFormatError("failed sending tx, wasn't found after timeout", nil, utils.Attribute{Key: "hash", Value: hex.EncodeToString(resultData.Txhash)}) } // we found the tx on chain and it failed