Skip to content

Commit

Permalink
cherry pick hotfix for bitcoin outbound performance and updated some …
Browse files Browse the repository at this point in the history
…log prints
  • Loading branch information
ws4charlie committed Oct 6, 2023
1 parent e0cf329 commit 5a97527
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions zetaclient/bitcoin_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -891,9 +891,9 @@ func (ob *BitcoinChainClient) checkNSaveIncludedTx(txHash string, params types.O
ob.includedTxHashes[txHash] = params.OutboundTxTssNonce
ob.includedTxResults[outTxID] = *getTxResult
if params.OutboundTxTssNonce >= ob.pendingNonce { // try increasing pending nonce on every newly included outTx
ob.pendingNonce = params.OutboundTxTssNonce
ob.pendingNonce = params.OutboundTxTssNonce + 1
}
ob.logger.ObserveOutTx.Info().Msgf("checkNSaveIncludedTx: included new bitcoin outTx %s outTxID %s", txHash, outTxID)
ob.logger.ObserveOutTx.Info().Msgf("checkNSaveIncludedTx: included new bitcoin outTx %s outTxID %s pending nonce %d", txHash, outTxID, ob.pendingNonce)
}
// update saved tx result as confirmations may increase
if foundHash && foundRes {
Expand Down
14 changes: 7 additions & 7 deletions zetaclient/evm_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func (ob *EVMChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64, co
if err != nil {
logger.Error().Err(err).Msg("error posting confirmation to meta core")
}
logger.Info().Msgf("Zeta tx hash: %s\n", zetaHash)
logger.Info().Msgf("Zeta tx hash: %s cctx %s nonce %d", zetaHash, sendHash, nonce)
return true, true, nil

} else if cointype == common.CoinType_Gas { // the outbound is a regular Ether/BNB/Matic transfer; no need to check events
Expand All @@ -278,7 +278,7 @@ func (ob *EVMChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64, co
if err != nil {
logger.Error().Err(err).Msg("error posting confirmation to meta core")
}
logger.Info().Msgf("Zeta tx hash: %s\n", zetaHash)
logger.Info().Msgf("Zeta tx hash: %s cctx %s nonce %d", zetaHash, sendHash, nonce)
return true, true, nil
} else if receipt.Status == 0 { // the same as below events flow
logger.Info().Msgf("Found (failed tx) sendHash %s on chain %s txhash %s", sendHash, ob.chain.String(), receipt.TxHash.Hex())
Expand All @@ -298,7 +298,7 @@ func (ob *EVMChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64, co
if err != nil {
logger.Error().Err(err).Msgf("PostReceiveConfirmation error in WatchTxHashWithTimeout; zeta tx hash %s", zetaTxHash)
}
logger.Info().Msgf("Zeta tx hash: %s", zetaTxHash)
logger.Info().Msgf("Zeta tx hash: %s cctx %s nonce %d", zetaTxHash, sendHash, nonce)
return true, true, nil
}
} else if cointype == common.CoinType_Zeta { // the outbound is a Zeta transfer; need to check events ZetaReceived
Expand Down Expand Up @@ -344,7 +344,7 @@ func (ob *EVMChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64, co
logger.Error().Err(err).Msg("error posting confirmation to meta core")
continue
}
logger.Info().Msgf("Zeta tx hash: %s\n", zetaHash)
logger.Info().Msgf("Zeta tx hash: %s cctx %s nonce %d", zetaHash, sendHash, nonce)
return true, true, nil
}
// #nosec G701 always in range
Expand Down Expand Up @@ -380,7 +380,7 @@ func (ob *EVMChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64, co
logger.Err(err).Msg("error posting confirmation to meta core")
continue
}
logger.Info().Msgf("Zeta tx hash: %s", metaHash)
logger.Info().Msgf("Zeta tx hash: %s cctx %s nonce %d", metaHash, sendHash, nonce)
return true, true, nil
}
// #nosec G701 always in range
Expand All @@ -407,7 +407,7 @@ func (ob *EVMChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64, co
if err != nil {
logger.Error().Err(err).Msgf("PostReceiveConfirmation error in WatchTxHashWithTimeout; zeta tx hash %s", zetaTxHash)
}
logger.Info().Msgf("Zeta tx hash: %s", zetaTxHash)
logger.Info().Msgf("Zeta tx hash: %s cctx %s nonce %d", zetaTxHash, sendHash, nonce)
return true, true, nil
}
} else if cointype == common.CoinType_ERC20 {
Expand Down Expand Up @@ -446,7 +446,7 @@ func (ob *EVMChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64, co
logger.Error().Err(err).Msg("error posting confirmation to meta core")
continue
}
logger.Info().Msgf("Zeta tx hash: %s\n", zetaHash)
logger.Info().Msgf("Zeta tx hash: %s cctx %s nonce %d", zetaHash, sendHash, nonce)
return true, true, nil
}
// #nosec G701 always in range
Expand Down

0 comments on commit 5a97527

Please sign in to comment.