Description
The ConnextRouter places the xBundleConnext(...) call on a try/catch block to prevent failed actions to make the transaction revert and the funds being given to Connext. The EVM saves 1/64th of gas before an external call to try to finish execution after the external call.
However, if the xBundleConnext(...) transaction inside the try/catch fails, the following execution consumes a non significant amount of gas (transferring and recording the failed message), such that 1/64 of the sent gas could not be enough to finish the execution.
Recommendation
Calculate the minimum amount required of gas to finish execution after the try/catch block and revert if this gas is not available prior to the block with gasleft(). This ensures that whatever actions users do inside the try/catch block, the message will always be recorded if it fails.
POC
https://github.com/threesigmaxyz/fuji-issues/blob/master/test/POC/POCXReceiveGas.t.sol#L34
Status
Acknowledged with the following statement: The issue identified is acknowledged by the Fuji team, however, as indicated the likelihood of its occurrence is low.
Along with issue 3S-FUJI-N05, during Q3-2023 we will be working on general optimizations/improvements on the router contracts that will allow a more consistent estimation of gas during a failed transfer and implement fix as suggested.