Skip to content

Commit

Permalink
fix(zetaclient): report failed ERC20 transfers from TSS (#1315)
Browse files Browse the repository at this point in the history
* report failed ERC20 transfers from TSS

* adjust zetaclient minimum outbound gaslimit to be 100K

* Update zetaclient/evm_client.go

Co-authored-by: Lucas Bertrand <[email protected]>

---------

Co-authored-by: Lucas Bertrand <[email protected]>
  • Loading branch information
brewmaster012 and lumtis authored Oct 20, 2023
1 parent 7437b35 commit d41cf7f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions zetaclient/evm_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
4 changes: 2 additions & 2 deletions zetaclient/evm_signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d41cf7f

Please sign in to comment.