Submitted by berndartmueller, also found by zhaojie
Gas fees are underpaid for Zeta token cctxs.
Outbound cctxs are processed, collectively signed, and ultimately sent to the receiver chain by the observers via the TryProcessOutTx function.
The gas limit used for the transaction is specified in the cctxs OutboundTxParams.OutboundTxGasLimit and validated in lines 375-382 to ensure the limit is in reasonable bounds and to prevent the transaction from failing due to insufficient gas.
Specifically, a lower limit of 100k is enforced in lines 375-378:
The fees for such outbound cctxs are paid and deducted from the transfer amount (InboundTxParams.Amount) by calling the PayGasAndUpdateCctx function in the following instances:
Cctxs with the coin type CoinType_Gas or CoinType_ERC20 have the OutboundTxGasLimit gas limit overwritten by a hardcoded value, see lines 121 and 246.
However, cctxs that transfer Zeta tokens, i.e., with the coin type CoinType_Zeta, do not have the gas limit overwritten, instead it is set to the value that was specified by the sender of the cctx. For example, by calling the ZetaConnectorEth.send function. This gas limit can be arbitrarily set and will be picked up by the observers and included in the MsgVoteOnObservedInboundTx message.
As a result, users can set the gas limit to the lowest possible value, 1 (0 is not possible due to Uniswaps getAmountIn preventing zero amounts) so that the calculated gas fee for the outbound transaction is almost zero.
Once observers process the outbound transaction, the gas limit (set by the user to 1) is overwritten with the lower bound of 100k and broadcasted to the receiver chain.
Consequently, users can avoid paying the adequate gas fees for outbound Zeta token transactions and the TSS address will have to pay the gas fees instead.
For completeness it should be mentioned that a protocol fee of currently 2e18 Zeta tokens is charged. This offsets the insufficient gas fees paid by the user to some extent, however, it defeats the purpose of the gas fees and misuses the protocol fee.
Consider enforcing the minimum gas limit of 100k already in the PayGasInZetaAndUpdateCctx function in line 288.
lumtis (Zetachain) confirmed via duplicate Issue #240
