From d41cf7f1af4d2cac20bec191b980d69d9d315348 Mon Sep 17 00:00:00 2001 From: brewmaster012 <88689859+brewmaster012@users.noreply.github.com> Date: Fri, 20 Oct 2023 17:37:25 -0500 Subject: [PATCH] fix(`zetaclient`): report failed ERC20 transfers from TSS (#1315) * report failed ERC20 transfers from TSS * adjust zetaclient minimum outbound gaslimit to be 100K * Update zetaclient/evm_client.go Co-authored-by: Lucas Bertrand --------- Co-authored-by: Lucas Bertrand --- zetaclient/evm_client.go | 20 ++++++++++++++++++++ zetaclient/evm_signer.go | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/zetaclient/evm_client.go b/zetaclient/evm_client.go index 43ecf196e2..f5cdbe1de4 100644 --- a/zetaclient/evm_client.go +++ b/zetaclient/evm_client.go @@ -497,6 +497,26 @@ func (ob *EVMChainClient) IsSendOutTxProcessed(sendHash string, nonce uint64, co return true, false, nil } } + } else { + logger.Info().Msgf("Found (failed tx) sendHash %s on chain %s txhash %s", sendHash, ob.chain.String(), receipt.TxHash.Hex()) + zetaTxHash, err := ob.zetaClient.PostReceiveConfirmation( + sendHash, + receipt.TxHash.Hex(), + receipt.BlockNumber.Uint64(), + receipt.GasUsed, + transaction.GasPrice(), + transaction.Gas(), + big.NewInt(0), + common.ReceiveStatus_Failed, + ob.chain, + nonce, + common.CoinType_ERC20, + ) + if err != nil { + logger.Error().Err(err).Msgf("PostReceiveConfirmation error in WatchTxHashWithTimeout; zeta tx hash %s", zetaTxHash) + } + logger.Info().Msgf("Zeta tx hash: %s cctx %s nonce %d", zetaTxHash, sendHash, nonce) + return true, true, nil } } diff --git a/zetaclient/evm_signer.go b/zetaclient/evm_signer.go index 96c6dc728e..925354f27c 100644 --- a/zetaclient/evm_signer.go +++ b/zetaclient/evm_signer.go @@ -320,8 +320,8 @@ func (signer *EVMSigner) TryProcessOutTx(send *types.CrossChainTx, outTxMan *Out } gasLimit := send.GetCurrentOutTxParam().OutboundTxGasLimit - if gasLimit < 50_000 { - gasLimit = 50_000 + if gasLimit < 100_000 { + gasLimit = 100_000 logger.Warn().Msgf("gasLimit %d is too low; set to %d", send.GetCurrentOutTxParam().OutboundTxGasLimit, gasLimit) } if gasLimit > 1_000_000 {