From edb2db49a199c398ae77f8d69ed688c5d8869058 Mon Sep 17 00:00:00 2001 From: skosito Date: Tue, 22 Apr 2025 18:52:17 +0200 Subject: [PATCH 1/2] set retry gas limit if evm outbound is successful --- zetaclient/chains/evm/observer/outbound.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zetaclient/chains/evm/observer/outbound.go b/zetaclient/chains/evm/observer/outbound.go index a6e6b0a500..7af4b85f96 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 := uint64(1_000_000) if msg.Status == chains.ReceiveStatus_failed { retryGasLimit = zetacore.PostVoteOutboundRevertGasLimit } From c2496fce6c491196d1e5a4f6e4e7bf9533eeaeb3 Mon Sep 17 00:00:00 2001 From: skosito Date: Tue, 22 Apr 2025 20:44:20 +0200 Subject: [PATCH 2/2] add constant for retry gas limit --- zetaclient/chains/evm/observer/outbound.go | 2 +- zetaclient/chains/solana/observer/outbound.go | 2 +- zetaclient/chains/sui/observer/outbound.go | 2 +- zetaclient/chains/ton/observer/outbound.go | 2 +- zetaclient/zetacore/constant.go | 3 +++ 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/zetaclient/chains/evm/observer/outbound.go b/zetaclient/chains/evm/observer/outbound.go index 7af4b85f96..09340c9444 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 - retryGasLimit := uint64(1_000_000) + 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 61060e5a58..8b037feb5b 100644 --- a/zetaclient/chains/solana/observer/outbound.go +++ b/zetaclient/chains/solana/observer/outbound.go @@ -151,7 +151,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 5d53d452e3..331c775f03 100644 --- a/zetaclient/chains/sui/observer/outbound.go +++ b/zetaclient/chains/sui/observer/outbound.go @@ -232,7 +232,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