Skip to content

fix: preserve Money Account EIP-7702 auths on same-chain pay batches - #9765

Open
jpuri wants to merge 5 commits into
mainfrom
fix/batch-authorization-list-money-account
Open

fix: preserve Money Account EIP-7702 auths on same-chain pay batches#9765
jpuri wants to merge 5 commits into
mainfrom
fix/batch-authorization-list-money-account

Conversation

@jpuri

@jpuri jpuri commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add optional authorizationList to TransactionBatchRequest and merge it with the batch payer (from) upgrade authorization when building the type-4 batch transaction.
  • Retain pre-signed EIP-7702 authorizations in signAuthorizationList instead of re-signing them with txParams.from.
  • In Relay same-chain batch submit with account override, forward the quote's full signed authorizationList through addTransactionBatch so Money Account vault upgrades are not dropped (CONF-1741 / Monad mUSD deposits).

Related to task: https://consensyssoftware.atlassian.net/browse/CONF-1757

Test plan

  • Unit: @metamask/transaction-controllerbatch.test.ts / eip7702.test.ts (merge provided auths; retain pre-signed)
  • Unit: @metamask/transaction-pay-controllerrelay-submit.test.ts (batch gets signed auth list only when same-chain + account override; single-tx path unchanged)
  • Manual (with mobile Gas Station merge): new user Money Account deposit, pay with Monad mUSD, same-chain batch path — Sentinel request includes 2 authorizations (EOA + Money Account) and vault leg succeeds
  • Regression: single-tx same-chain route and cross-chain routes unchanged

Note

Medium Risk
Changes EIP-7702 batch assembly and signing behavior for pay flows; impact is narrowed by account-override gating and tests, but failed auth handling could still break Money Account deposits.

Overview
Fixes same-chain MetaMask Pay relay batches where an EOA pays but the Money Account still needs its own EIP-7702 vault upgrade: those pre-signed authorizations were dropped or re-signed with the wrong account.

Transaction controller: TransactionBatchRequest gains optional authorizationList. Batch building merges the batch payer (from) upgrade auth (when needed) with caller-provided entries on one type-4 tx. signAuthorizationList keeps fully signed authorizations instead of re-signing with txParams.from. Security delegationMock still reflects only the payer upgrade, not foreign auths in the list.

Transaction pay controller: On same-chain multi-tx submit with account override (quote from ≠ transaction from), the quote’s full signed authorizationList is forwarded into addTransactionBatch; single-tx and non-override paths are unchanged.

Reviewed by Cursor Bugbot for commit be660d9. Bugbot is set up for automated code reviews on this repo. Configure here.

Pass pre-signed authorizationList through addTransactionBatch when an
account override is active, retain those signatures on publish, and merge
them with the batch payer upgrade so Monad mUSD vault deposits succeed.
@jpuri
jpuri requested review from a team as code owners August 3, 2026 15:36
@jpuri
jpuri temporarily deployed to default-branch August 3, 2026 15:36 — with GitHub Actions Inactive

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 c9dcd37. Configure here.

Comment thread packages/transaction-controller/src/utils/batch.ts
delegationMock is for the batch payer. When from is already upgraded and
only foreign authorizations are provided, do not mock authorizationList[0]
onto the sender.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant