feat(L2toL2CDM): revert on target call failure in `relayMessage`
Closes Issue #143
Summary:
This PR updates the L2ToL2CrossDomainMessenger#relayMessage to revert when the target contract call fails.
Problem:
Previously, when the target contract call within relayMessage failed, it would only emit a FailedRelayedMessage. This caused gas estimation tools to produce unreliable estimates. Specifically, gas estimators would return the minimum amount of gas required for relayMessage itself to succeed, without accounting for the actual gas needed by the target contract call.
Solution:
By introducing a revert when the target call fails, we ensure that gas estimation tools are forced to include the gas required for the target call to succeed. This leads to more accurate and consistent gas estimates across different tools and scenarios, particularly when interacting with complex contracts where gas usage can vary significantly.
Impact:
- More accurate gas estimation: Gas tools will now estimate based on the real cost of the full transaction, including the target call.
- Improved developer experience: Reduces the likelihood of transactions failing due to underestimated gas limits.
This stack of pull requests is managed by Graphite. Learn more about stacking.
Join @tremarkley and the rest of your teammates on
Graphite
Semgrep found 1 golang_fmt_errorf_no_params finding:
No fmt.Errorf invocations without fmt arguments allowed
This may impact the rollback feature, if its problematic then we can figure out how to make the rollback feature work well on top of this given the gas estimation issues using the old scheme