Propagate InsufficientGasLimit errors from v2_dispatch#1688
Merged
yrong merged 4 commits intoron/multi-contract-callsfrom Jan 26, 2026
Merged
Propagate InsufficientGasLimit errors from v2_dispatch#1688yrong merged 4 commits intoron/multi-contract-callsfrom
yrong merged 4 commits intoron/multi-contract-callsfrom
Conversation
Co-authored-by: yrong <4383920+yrong@users.noreply.github.com>
Co-authored-by: yrong <4383920+yrong@users.noreply.github.com>
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot
AI
changed the title
[WIP] Address feedback and apply patch based on Option A for multiple contract calls
Propagate InsufficientGasLimit errors from v2_dispatch
Jan 26, 2026
yrong
added a commit
that referenced
this pull request
Feb 6, 2026
* Multiple calls support * Support multiple calls * Add test * Revamp test * Improve L1 adapter * Harden L1 adapter * Update contracts/src/AgentExecutor.sol Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Revert L2 changes * Add atomic flag * [WIP] Address feedback on multiple contract calls implementation (#1685) * Initial plan * Fix dispatchSuccess initialization to false Co-authored-by: yrong <4383920+yrong@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: yrong <4383920+yrong@users.noreply.github.com> * Remove trailing blank line in GatewayV2.t.sol (#1686) * Initial plan * Remove extra blank line for consistency Co-authored-by: yrong <4383920+yrong@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: yrong <4383920+yrong@users.noreply.github.com> * Propagate InsufficientGasLimit errors from v2_dispatch (#1688) * Initial plan * Implement Option A: Propagate InsufficientGasLimit from v2_dispatch Co-authored-by: yrong <4383920+yrong@users.noreply.github.com> * Simplify InsufficientGasLimit rethrow logic Co-authored-by: yrong <4383920+yrong@users.noreply.github.com> * Fix tests --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: yrong <4383920+yrong@users.noreply.github.com> Co-authored-by: ron <yrong1997@gmail.com> * Fix tests * Optimize gas usage for atomic command failures by skipping event emission (#1690) * Initial plan * Fix: Check atomic flag before emitting CommandFailed event Co-authored-by: yrong <4383920+yrong@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: yrong <4383920+yrong@users.noreply.github.com> * More tests * Improve test * Improve AtomicCommandFailed error * Remove the atomic control in Comand * Move multi-call out * Revert change * Revert change * Revert change * Restore the comments * Revamp tests * Refactor Gateway * Fix tests * Comments * Fix mock --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: yrong <4383920+yrong@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements Option A from review feedback:
InsufficientGasLimiterrors thrown in_dispatchCommandwere being caught byv2_dispatchand converted toCommandFailedevents, preventing the rethrow logic inv2_submitfrom ever triggering.Changes
v2_dispatch: Added revert data inspection in catch block to detect and rethrowInsufficientGasLimiterrors instead of converting them toCommandFailedeventstestAgentCallContractRevertedForInsufficientGas: Updated to expect transaction revert instead of successful dispatch with command failureBehavior
Gas limit violations now propagate through the call stack and revert the entire transaction:
Other command failures continue to emit
CommandFailedevents as before.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.