diff --git a/changelog.md b/changelog.md index cdc633a88d..6607f62a3c 100644 --- a/changelog.md +++ b/changelog.md @@ -35,6 +35,7 @@ * [3770](https://github.com/zeta-chain/node/pull/3770) - improve fallback tx error handling * [3802](https://github.com/zeta-chain/node/pull/3802) - prevent Sui withdraw with invalid address * [3786](https://github.com/zeta-chain/node/pull/3786) - reorder end block order to allow gov changes to be added before staking. +* [3821](https://github.com/zeta-chain/node/pull/3821) - set retry gas limit if outbound is successful ### Tests diff --git a/x/crosschain/keeper/evm_hooks.go b/x/crosschain/keeper/evm_hooks.go index 2e91400c80..1c4e679f35 100644 --- a/x/crosschain/keeper/evm_hooks.go +++ b/x/crosschain/keeper/evm_hooks.go @@ -349,7 +349,8 @@ func (k Keeper) validateOutbound( } } else if chains.IsSolanaChain(chainID, additionalChains) { // The rent exempt check is not needed for ZRC20 (SPL) tokens because withdrawing SPL token - // already needs a non-trivial amount of SOL for potential ATA creation so we can skip the check. + // already needs a non-trivial amount of SOL for potential ATA creation so we can skip the check, + // and also not needed for simple no asset call. if coinType == coin.CoinType_Gas && value.Cmp(big.NewInt(constant.SolanaWalletRentExempt)) < 0 { return errorsmod.Wrapf( types.ErrInvalidWithdrawalAmount, diff --git a/zetaclient/chains/evm/observer/outbound.go b/zetaclient/chains/evm/observer/outbound.go index 07a9bf7537..f71e849366 100644 --- a/zetaclient/chains/evm/observer/outbound.go +++ b/zetaclient/chains/evm/observer/outbound.go @@ -121,7 +121,7 @@ func (ob *Observer) postVoteOutbound( const gasLimit = zetacore.PostVoteOutboundGasLimit - var retryGasLimit uint64 + retryGasLimit := zetacore.PostVoteOutboundRetryGasLimit if msg.Status == chains.ReceiveStatus_failed { retryGasLimit = zetacore.PostVoteOutboundRevertGasLimit } diff --git a/zetaclient/chains/solana/observer/outbound.go b/zetaclient/chains/solana/observer/outbound.go index 416233871d..c50215326e 100644 --- a/zetaclient/chains/solana/observer/outbound.go +++ b/zetaclient/chains/solana/observer/outbound.go @@ -178,7 +178,7 @@ func (ob *Observer) PostVoteOutbound( gasLimit = zetacore.PostVoteOutboundGasLimit ) - var retryGasLimit uint64 + retryGasLimit := zetacore.PostVoteOutboundRetryGasLimit if msg.Status == chains.ReceiveStatus_failed { retryGasLimit = zetacore.PostVoteOutboundRevertGasLimit } diff --git a/zetaclient/chains/sui/observer/outbound.go b/zetaclient/chains/sui/observer/outbound.go index f4044ae76e..9b809b4912 100644 --- a/zetaclient/chains/sui/observer/outbound.go +++ b/zetaclient/chains/sui/observer/outbound.go @@ -227,7 +227,7 @@ func (ob *Observer) validateOutbound(cctx *cctypes.CrossChainTx, tx models.SuiTr func (ob *Observer) postVoteOutbound(ctx context.Context, msg *cctypes.MsgVoteOutbound) error { const gasLimit = zetacore.PostVoteOutboundGasLimit - retryGasLimit := uint64(0) + retryGasLimit := zetacore.PostVoteOutboundRetryGasLimit if msg.Status == chains.ReceiveStatus_failed { retryGasLimit = zetacore.PostVoteOutboundRevertGasLimit } diff --git a/zetaclient/chains/ton/observer/outbound.go b/zetaclient/chains/ton/observer/outbound.go index 8887e3d205..90b98eb0a8 100644 --- a/zetaclient/chains/ton/observer/outbound.go +++ b/zetaclient/chains/ton/observer/outbound.go @@ -252,7 +252,7 @@ func (ob *Observer) postVoteOutbound( const gasLimit = zetacore.PostVoteOutboundGasLimit - var retryGasLimit uint64 + retryGasLimit := zetacore.PostVoteOutboundRetryGasLimit if msg.Status == chains.ReceiveStatus_failed { retryGasLimit = zetacore.PostVoteOutboundRevertGasLimit } diff --git a/zetaclient/zetacore/constant.go b/zetaclient/zetacore/constant.go index ceeba2df32..fb33c3bba1 100644 --- a/zetaclient/zetacore/constant.go +++ b/zetaclient/zetacore/constant.go @@ -39,6 +39,9 @@ const ( // PostVoteOutboundRevertGasLimit is the gas limit for voting on observed outbound tx for revert (when outbound fails) // The value is set to 7M because in case of onRevert call, it might consume lot of gas PostVoteOutboundRevertGasLimit = 7_000_000 + + // PostVoteOutboundRevertGasLimit is the retry gas limit for voting on observed outbound tx for success outbound + PostVoteOutboundRetryGasLimit uint64 = 1_000_000 ) // constants for monitoring tx results