Repository navigation
feat(transaction-pay-controller): support second-leg submission of target calls - #10501
Merged
Merged
Conversation
matthewwalsh0
force-pushed
the
refactor/transaction-pay-gas-payment
branch
2 times, most recently
from
September 29, 2026 12:19
93984a0 to
71ec7a0
Compare
matthewwalsh0
force-pushed
the
feat/transaction-pay-non-atomic-second-leg
branch
from
September 29, 2026 13:41
fa035bc to
a0834c6
Compare
matthewwalsh0
force-pushed
the
refactor/transaction-pay-gas-payment
branch
from
September 30, 2026 15:45
fc6005d to
b868774
Compare
matthewwalsh0
force-pushed
the
feat/transaction-pay-non-atomic-second-leg
branch
2 times, most recently
from
October 1, 2026 11:47
0fe4cf7 to
4791df2
Compare
matthewwalsh0
force-pushed
the
refactor/transaction-pay-gas-payment
branch
from
October 1, 2026 12:31
d062d63 to
f58e3a8
Compare
matthewwalsh0
force-pushed
the
feat/transaction-pay-non-atomic-second-leg
branch
from
October 1, 2026 12:32
4791df2 to
2552899
Compare
matthewwalsh0
force-pushed
the
feat/transaction-pay-non-atomic-second-leg
branch
from
October 7, 2026 13:43
f46884a to
acf8b02
Compare
3 of 4 tasks
matthewwalsh0
force-pushed
the
feat/transaction-pay-non-atomic-second-leg
branch
from
October 8, 2026 08:47
acf8b02 to
e912f9f
Compare
matthewwalsh0
marked this pull request as ready for review
October 8, 2026 11:03
OGPoyraz
reviewed
Oct 8, 2026
jpuri
previously approved these changes
Oct 9, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e2cc524. Configure here.
… when the provider cannot execute them Server quote providers either execute the target calls as part of the quote or decline the request outright, so flows whose calls no provider can run were simply unsupported. Request such calls as optional, so providers that cannot execute them still return a funds-only quote flagged with `callsSupported: false`. When that happens the quote is marked `requiresSecondLeg` and the calls are submitted separately on the target chain once the quote settles. Extract the second-leg submission that the Money Account vault deposit already performed into a shared `second-leg` util, reading the settled amount from the settlement transfer logs so the second leg spends what actually landed rather than the quoted amount. `ma-vault-deposit` is now a thin Monad-pinned wrapper that layers on CHOMP race handling, and the relay strategy's recipient resolution moves into the same util so both strategies settle non-atomic funds on the executing account.
… to supportsDeferredCalls and callsDeferred
… submitSecondLeg with CHOMP recovery
…the second leg can be sponsored
…second leg tests Raise the `server-quotes.test.ts` counts and add a `second-leg.test.ts` entry to cover the literals added by the new tests, matching the call sites already suppressed in those files. Drop the `ma-vault-deposit.test.ts` entries, whose violations no longer occur now that the second leg resolves its own execution account.
… into submitSecondLeg and update tests
…ate and tidy second leg tests
…olymarket deposit wallet withdraws
…d realign lint suppressions
…t HyperCore from the built quote request - Send the embedded server transfer to the account the delegated calls run from, rather than the paying account, when an account override is active. - Check the built request body for HyperCore when deciding whether a second leg is required, since perps deposits are only rewritten there. - Read the execution account from txParams.from directly and drop resolveExecutionAccount, as from is always set.
…second leg Mark the parent transaction complete once the second leg has been submitted, for both the server and relay strategies, so a failed second leg no longer leaves a failed transaction flagged as complete.
…n has nested calls The second leg only re-encodes nested transactions, so a funds-only quote for calls that exist only on the top-level transaction would complete without running them. Temporarily skip opting in to deferred calls in that case.
matthewwalsh0
force-pushed
the
feat/transaction-pay-non-atomic-second-leg
branch
from
October 11, 2026 12:33
5429248 to
fd5bbe3
Compare
matthewwalsh0
enabled auto-merge
October 12, 2026 12:24
OGPoyraz
approved these changes
Oct 12, 2026
OGPoyraz
approved these changes
Oct 12, 2026
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.

Explanation
Server quote providers either execute the target calls or decline the request, and the server strategy declined non-atomic requests outright, so flows whose calls no provider can run were unsupported.
supportsDeferredCalls, so a provider that can't execute the calls returns a funds-only quote (callsDeferred: true) instead of declining.requiresSecondLeg, and the calls are submitted separately on the target chain once the funds settle.submitSecondLegutil, which:ma-vault-depositis removed in favour of the shared util.References
Stacked on #10404.
Checklist
Note
High Risk
Changes multi-leg settlement, amount resolution, and completion semantics across Relay, Server, and Fiat paths; stricter on-chain reads can fail flows that previously fell back to provider-reported amounts.
Overview
Adds non-atomic pay flows where a quote may only move funds and the target calls run afterward on the chain where they settled.
Quotes can now carry
requiresSecondLeg(driven by servercallsDeferred/supportsDeferredCalls, explicitatomic: false, etc.). Relay, Server, and Fiat (including direct mUSD vault) all submit that follow-up through sharedsubmitSecondLeg, replacingma-vault-deposit. Settlement amounts come only from on-chain transfer logs via a settlement hash; missing hash or transfer fails instead of using rampcryptoAmountor quote minimums.Server quotes settle on the executing account (
txParams.from) vs the payer, Money Account post-quote drops the forwarding transfer, and non-atomic requests are allowed.isIntentCompleteis set after a successful second leg (Relay/Server). Relay zeros origin network fees for Polymarket deposit-wallet Predict withdraws. CHOMP race recovery moves intowithChompRecoveryaround second-leg vault deposits. Server provider IDs are plain strings instead of an enum.Reviewed by Cursor Bugbot for commit 6244985. Bugbot is set up for automated code reviews on this repo. Configure here.