Closed lumtis closed 1 week ago
After experimentation this solution can't be used: it rely on using gasleft()
to prevent tx with high estimated gas limit. The problem is that the check will be run when estimating the gas limit, it will create discrepancies given that gasleft()
will return a different value when tx is simulated. This makes the solution unreliable because the tx simulation is different than the tx execution.
Related: https://github.com/zeta-chain/node/issues/3084
A limit for the gas usage must be set. We set a gas limit value in the call in https://github.com/zeta-chain/node/pull/3106 however this requires the next chain upgrade to fix the issue
This issue is about setting a temporary workaround at the smart contract level and upgrade the GatewayZEVM
Since no gas limit is not manually set currently, the gas limit is set with the estimated call function.
We can therefore revert automatically when the "gasleft" value is above a certain threshold https://www.rareskills.io/post/solidity-gasleft
Example: if the developer
onCall
is too expensive, gasleft will be set to a high value because of the gas estimated.Example: