node icon indicating copy to clipboard operation
node copied to clipboard

bug: a low gas limit in ERC20 revert outbound will block whole outbound

Open ws4charlie opened this issue 9 months ago • 3 comments

Describe the Bug A recent zetaclientd hotfix removed the 100K minimum gas limit check and the gas limit field in the CCTX was used instead. This caused a situation when a ERC20 revert outbound has a low gas limit 21000 and blocks outbound due to the error intrinsic gas too low.

The blocked CCTX in BASE was this one.

Image

To unblock the outbound without zetacore change, we added back the 100K gas limit check only for ERC20 token in a zetaclient-only hotfix.

Expected Behavior

I think a proper gas limit should be used for ERC20 revert outbound in order to both charge correct gas fee from end user and avoid blocked outbound.

Image

ws4charlie avatar Mar 17 '25 04:03 ws4charlie

There are two issues:

  • If a revert happens, either gas limit in revertOptions should be used, otherwise the default gas limit of the ZRC20 (should have been 100000 for this cctx)
  • Outbounds shouldn't be blocked because of low gas limit, if this happens we should have a mechanism to revert the transaction

This issue looks more outlining the first problem, I will create an issue for the second one

lumtis avatar Mar 17 '25 09:03 lumtis

Can this be closed? @ws4charlie

CharlieMc0 avatar Apr 11 '25 17:04 CharlieMc0

We should, overwrite the limit if the one provided is too low when updating the revertOptions for the cctx

kingpinXD avatar Apr 24 '25 10:04 kingpinXD

The initial issue with the wrong gas limit set was fixed, Outbound with gas limit too low should not block outbounds #3725 is the followup

lumtis avatar Jun 16 '25 11:06 lumtis