fix: gate Money Account payment override prepend to same-chain flows#9449
Open
OGPoyraz wants to merge 4 commits into
Open
fix: gate Money Account payment override prepend to same-chain flows#9449OGPoyraz wants to merge 4 commits into
OGPoyraz wants to merge 4 commits into
Conversation
Cross-chain flows (e.g. Predict withdraw on Polygon depositing to a Money Account on Monad) carry the deposit in the Relay quote's destination txs[] with a delegation signed for the destination chain. Prepending it onto the source-chain execute batch made that delegation get redeemed on the source chain, so the on-chain signature check recovered a wrong signer and reverted with InvalidEOASignature() (0x3db6791c). Only prepend the override for same-chain flows; cross-chain flows fall through to prepend the original tx.
jpuri
approved these changes
Jul 9, 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
Cross-chain Money Account deposits — e.g. a Predict (Polymarket) withdrawal on Polygon that deposits into a Money Account on Monad — failed on the Relay
/executestep with the custom errorInvalidEOASignature()(selector0x3db6791c).Current state:
submitTransactionsunconditionally prepends the Money Account payment override onto the source-chain execute batch wheneverquote.request.paymentOverrideis set. For a cross-chain deposit, the payment override is a Money Account deposit delegation that belongs on the destination chain — it is already carried in the Relay quote's destinationtxs[], and its delegation is EIP-712 signed for the destinationchainId. Prepending it onto the source-chain batch caused that destination-signed delegation to be redeemed on the source chain, soredeemDelegations→executeFromExecutorvalidated the signature with the source chain's domain, recovered a different signer, and theEIP7702StatelessDeleGatorreverted withInvalidEOASignature().Solution: Only prepend the payment override onto the source execute batch for same-chain flows (
currencyIn.chainId === currencyOut.chainId). For cross-chain flows we fall through to the existing post-quote path, which prepends the original transaction (e.g. the Predict withdrawal); the Money Account deposit continues to run on the destination side via the quote'stxs[].The change is a one-line guard (
&& isSameChainOverride) plus a comment explaining the invariant.Proof
Before the fix, the Relay
/executesimulation returned (decoded revert trace):The delegation being redeemed was signed for the destination chain (Monad,
chainId 143) but executed on the source chain (Polygon,chainId 137) — confirmed viasignDelegationlogs showingdomain.chainId: 143for the Money Account delegation while the execute body useddata.chainId: 137.After the fix, the cross-chain source batch no longer contains the destination-signed override, so the
InvalidEOASignature()revert no longer occurs.References
Checklist
Note
Medium Risk
Touches Relay submit batch composition for paymentOverride flows; wrong gating could break same-chain Money Account deposits or leave cross-chain paths unchanged.
Overview
Fixes cross-chain Money Account deposits (e.g. Predict withdraw on Polygon → Money Account on another chain) failing Relay
/executewithInvalidEOASignature()by changing when the Money Account payment override is injected into the source-chain batch.submitTransactionsinrelay-submit.tsnow prepends override calls fromgetPaymentOverrideDataonly whenpaymentOverrideis set andcurrencyIn.chainId === currencyOut.chainId. For cross-chain quotes, the override delegation is already on the destinationtxs[]and is EIP-712 signed for the destination chain; putting it on the source batch caused wrong-domain signature recovery. Cross-chain flows skip the override prepend (andgetPaymentOverrideData) and use the existing post-quote behavior (e.g. prepend the original withdraw tx).Tests align same-chain override cases and add coverage that cross-chain flows do not call
getPaymentOverrideData. Changelog updated under Fixed.Reviewed by Cursor Bugbot for commit cc17bcb. Bugbot is set up for automated code reviews on this repo. Configure here.