Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion x/crosschain/keeper/evm_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion zetaclient/chains/evm/observer/outbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion zetaclient/chains/solana/observer/outbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
gasLimit = zetacore.PostVoteOutboundGasLimit
)

var retryGasLimit uint64
retryGasLimit := zetacore.PostVoteOutboundRetryGasLimit

Check warning on line 181 in zetaclient/chains/solana/observer/outbound.go

View check run for this annotation

Codecov / codecov/patch

zetaclient/chains/solana/observer/outbound.go#L181

Added line #L181 was not covered by tests
if msg.Status == chains.ReceiveStatus_failed {
retryGasLimit = zetacore.PostVoteOutboundRevertGasLimit
}
Expand Down
2 changes: 1 addition & 1 deletion zetaclient/chains/sui/observer/outbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion zetaclient/chains/ton/observer/outbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@

const gasLimit = zetacore.PostVoteOutboundGasLimit

var retryGasLimit uint64
retryGasLimit := zetacore.PostVoteOutboundRetryGasLimit

Check warning on line 255 in zetaclient/chains/ton/observer/outbound.go

View check run for this annotation

Codecov / codecov/patch

zetaclient/chains/ton/observer/outbound.go#L255

Added line #L255 was not covered by tests
if msg.Status == chains.ReceiveStatus_failed {
retryGasLimit = zetacore.PostVoteOutboundRevertGasLimit
}
Expand Down
3 changes: 3 additions & 0 deletions zetaclient/zetacore/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down