From 5a975273bdb308e00763031febf736f258162546 Mon Sep 17 00:00:00 2001 From: charliec Date: Fri, 6 Oct 2023 18:38:33 -0500 Subject: [PATCH] cherry pick hotfix for bitcoin outbound performance and updated some log prints --- zetaclient/bitcoin_client.go | 4 ++-- zetaclient/evm_client.go | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/zetaclient/bitcoin_client.go b/zetaclient/bitcoin_client.go index 312e4aabdb..a1be56b308 100644 --- a/zetaclient/bitcoin_client.go +++ b/zetaclient/bitcoin_client.go @@ -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 { diff --git a/zetaclient/evm_client.go b/zetaclient/evm_client.go index 6f0058a2c0..5bc89ae547 100644 --- a/zetaclient/evm_client.go +++ b/zetaclient/evm_client.go @@ -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 @@ -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()) @@ -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 @@ -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 @@ -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 @@ -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 { @@ -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