Skip to content

fix(money): keep money keyring transactions externally signed when gas sponsorship is opted out - #47616

Merged
pedronfigueiredo merged 3 commits into
mainfrom
pnf/conf-2215-money-account-sponsorship-opt-out
Nov 5, 2026
Merged

pedronfigueiredo merged 3 commits into
mainfrom
pnf/conf-2215-money-account-sponsorship-opt-out

Conversation

@pedronfigueiredo

@pedronfigueiredo pedronfigueiredo commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Description

Problem

Money Account withdrawals (and deposits) on Monad can fail at submit with:

KeyringController - The keyring for the current address does not support the method signTransaction.

In Mixpanel (project 2212883, Transaction Finalized, 26 Oct – 1 Nov) this error accounts for 23 failed money_account_withdraw events (21 on 13.54.0, 2 on 13.53.0) and 7 failed money_account_deposit events (13.54.0 / 13.55.0). The withdraw failures come from only 2 users, and the failure is sticky per user. For example, one user had 3 successful withdrawals via sentinel_relay and then every Money transaction failed from that point on, across sessions. All failures are on Monad (0x8f), have account_hardware_type undefined (so hardware wallets are not involved), and have no transaction_submission_method, meaning they never reached the sponsored relay.

Root cause

  1. Money keyrings cannot sign transactions by design. @metamask/eth-money-keyring and @metamask/eth-money-mpc-keyring only implement signPersonalMessage, signTypedData and signEip7702Authorization. KeyringController.signTransaction throws the error above when the keyring has no signTransaction.

  2. The happy path never signs locally. create-withdraw-transaction.ts / create-deposit-transaction.ts create the batch with isGasFeeSponsored: chainId === CHAIN_IDS.MONAD. TransactionController then sets isExternalSign = true, skips the keyring, and the 7702 relay publish hook submits it.

  3. useTransactionConfirm undid that. At confirm time it recomputes both flags from isSponsorshipOptedOut, the persisted per-chain preference gasSponsorshipOptOutByChainId[chainId], and from isGaslessSupported:

    • Withdrawals had a carve-out for !isGaslessSupported, but not for the opt-out.
    • Deposits had no carve-out at all.

    When either condition hit, isGasFeeSponsored and isExternalSign were cleared. TransactionController then fell back to KeyringController:signTransaction with the Money account as from, and that threw.

How users get into this state: choosing "pay with MON" in the GasSponsorshipModal on any regular Monad confirmation (swap, bridge, send) persists the opt-out for 0x8f. Money confirmations don't render the gas fee row or that modal, so the user cannot see or reverse the preference from the Money flow. Every subsequent Money withdraw/deposit on Monad fails. That matches the sticky per-user pattern in Mixpanel, where the affected users' other Monad transactions stopped going through sentinel_relay right before their Money transactions started failing.

Solution

  • New selector isMoneyKeyringAddress(state, address) in ui/selectors/money-account.ts. It returns true when the address is held by a Money Keyring or MPC Money Keyring.

    • It reads metamask.keyrings directly, because Money Accounts are not internal accounts, so metadata.keyring lookups don't apply.
  • useTransactionConfirm now checks whether txParams.from belongs to a Money keyring. For those transactions:

    • isGasFeeSponsored is kept whenever the controller sponsored the transaction, regardless of isSponsorshipOptedOut or isGaslessSupported.
    • isExternalSign is never cleared.

    The check is keyed on the sending keyring, not the transaction type, so withdrawals, deposits and any other Money-account-sourced flow are covered. The existing moneyAccountWithdraw type-based carve-out is kept as a fallback.

  • Behaviour for all other accounts is unchanged. A user who opted out on Monad still pays native gas for their regular transactions.

Out of scope / follow-ups

  • Defense in depth in Core: TransactionController could reject up front, with a clear error, when it is about to sign locally with a keyring that has no signTransaction.
  • Analytics: consider tracking the sponsorship opt-out toggle. There is currently no Mixpanel event for it, which is why the opt-out could only be inferred from the data.

Changelog

CHANGELOG entry: Fixed Money Account withdrawals and deposits on Monad failing with a "does not support the method signTransaction" error after opting out of gas sponsorship on Monad

Related issues

Fixes: CONF-2215

Manual testing steps

Setup: Extension with a Money Account on Monad that holds some mUSD.

  1. Make a small Money withdrawal (mUSD on Monad). It should succeed via the sponsored relay. This is the baseline.
  2. Opt out of gas sponsorship on Monad, either way:
    • UI: open any sponsored Monad confirmation (e.g. a swap), click the network fee row, choose to pay with MON, then reject the confirmation.
    • Shortcut: in the popup DevTools console of a dev build, run:
      await stateHooks.submitRequestToBackground('PreferencesController:setPreference', ['gasSponsorshipOptOutByChainId', { '0x8f': true }])
  3. Make another Money withdrawal.
    • Before this PR: fails with KeyringController - The keyring for the current address does not support the method signTransaction.
    • After this PR: succeeds via the sponsored relay.
  4. Repeat step 3 with a Money deposit on Monad. Same before/after.
  5. With the opt-out still on, make a regular (non-Money) transaction on Monad and confirm it is still not sponsored (native MON gas). This behaviour is unchanged.
  6. Reset the preference with { '0x8f': false }.

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Medium Risk
Changes transaction confirm flags for Money keyring senders only, but touches gas sponsorship and external signing paths where misclassification could block submits or leave wrong activity labels.

Overview
Fixes Money Account withdraw/deposit failures after a user opts out of Monad gas sponsorship on an unrelated confirmation. useTransactionConfirm was clearing isGasFeeSponsored and isExternalSign based on opt-out and useIsGaslessSupported, which forced local signTransaction on Money keyrings that cannot implement it.

Adds isMoneyKeyringAddress (Money / MPC Money keyrings via metamask.keyrings) and uses txParams.from at confirm time: when the sender is a Money keyring and the controller already marked the tx sponsored, those flags stay set so the 7702 relay path still runs. Deposits get the same treatment as withdrawals; the withdraw-only type carve-out remains only as a fallback when keyring state is not loaded yet. Non–Money-keyring behavior is unchanged (opt-out still clears sponsorship for regular txs).

Tests cover the selector and confirm-hook cases for opt-out, unsupported gasless, and non-money senders.

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

…s sponsorship is opted out

Money keyrings cannot signTransaction. useTransactionConfirm cleared
isGasFeeSponsored/isExternalSign when the user had a per-chain gas
sponsorship opt-out (or gasless was unsupported), so TransactionController
fell back to local signing and KeyringController threw. Keep both flags for
transactions sent from a Money / MPC Money keyring account.

Refs CONF-2215
@pedronfigueiredo pedronfigueiredo added the team-confirmations Push issues to confirmations team label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions github-actions Bot added the size-M label Nov 4, 2026
@metamask-ci

metamask-ci Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

✨ Files requiring CODEOWNER review ✨

✅ @MetaMask/confirmations (2 files, +171 -21)
  • 📁 ui/
    • 📁 pages/
      • 📁 confirmations/
        • 📁 hooks/
          • 📁 transactions/
            • 📄 useTransactionConfirm.test.ts +139 -7
            • 📄 useTransactionConfirm.ts +32 -14

@metamask-ci

metamask-ci Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor
Builds ready [71e33b8]
⚡ Performance Benchmarks (Total: 🟢 4 pass · 🟡 6 warn · 🔴 3 fail)

Baseline (latest main): f693520 | Date: 11/3/2026 | Pipeline: 41831193202 | Baseline logs

Metricschrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 load_new_account(p95) [CI log]🔴 load_new_account(p95) [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]

Regressions (🔴 3 failures)

Interaction Benchmarks · Samples: 5 🔴 2
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 [CI log]
🔴 load_new_account
🔴 [CI log]
🔴 load_new_account
confirmTx
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ loadNewAccount/load_new_account: +182%
  • ↑ loadNewAccount/total: +182%
  • ↓ loadNewAccount/inp: -10%
  • ↑ loadNewAccount/fcp: +14%
  • ↑ loadNewAccount/cls: +282%
  • ↑ confirmTx/longTaskTotalDuration: +60%
  • ↑ confirmTx/longTaskMaxDuration: +79%
  • ↑ confirmTx/tbt: +101%
  • ↑ confirmTx/fcp: +13%
  • ↑ confirmTx/lcp: +10%
  • ↑ bridgeUserActions/bridge_load_page: +86%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +113%
  • ↑ bridgeUserActions/longTaskCount: +82%
  • ↑ bridgeUserActions/longTaskTotalDuration: +124%
  • ↑ bridgeUserActions/longTaskMaxDuration: +59%
  • ↑ bridgeUserActions/tbt: +176%
  • ↑ bridgeUserActions/total: +19%
  • ↑ bridgeUserActions/inp: +10%
  • ↑ bridgeUserActions/fcp: +11%
  • ↑ bridgeUserActions/lcp: +11%
  • ↑ bridgeUserActions/cls: +281%
  • ↑ loadNewAccount/load_new_account: +183%
  • ↑ loadNewAccount/total: +183%
  • ↑ loadNewAccount/inp: +12%
  • ↑ loadNewAccount/fcp: +32%
  • ↑ loadNewAccount/lcp: +1322%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↑ confirmTx/fcp: +29%
  • ↑ confirmTx/lcp: +1377%
  • ↑ bridgeUserActions/bridge_load_page: +338%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +154%
  • ↑ bridgeUserActions/bridge_search_token: +27%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +79%
  • ↑ bridgeUserActions/inp: +62%
  • ↑ bridgeUserActions/fcp: +30%
  • ↑ bridgeUserActions/lcp: +1390%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 2.0s
  • 🟡 confirmTx/FCP: p75 1.9s
  • 🟡 bridgeUserActions/FCP: p75 1.9s
  • 🟡 loadNewAccount/FCP: p75 2.3s
  • 🟡 loadNewAccount/LCP: p75 2.5s
  • 🟡 confirmTx/FCP: p75 2.2s
  • 🟡 confirmTx/LCP: p75 2.5s
  • 🟡 bridgeUserActions/FCP: p75 2.3s
  • 🟡 bridgeUserActions/LCP: p75 2.6s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 loadScripts

📈 Results compared to the previous 5 runs on main

  • ↑ startupStandardHome/uiStartup: +13%
  • ↑ startupStandardHome/load: +10%
  • ↑ startupStandardHome/domContentLoaded: +10%
  • ↑ startupStandardHome/domInteractive: +19%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -29%
  • ↑ startupStandardHome/setupStore: +160%
  • ↑ startupStandardHome/tbt: +14%
  • ↑ startupStandardHome/cls: +400%
  • ↑ startupStandardHome/domInteractive: +45%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -50%
  • ↑ startupStandardHome/setupStore: +138%
  • ↑ startupStandardHome/fcp: +48%
User Journey Benchmarks · Samples: 5 · mock API 🔴 1
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 total
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
🔴 total

📈 Results compared to the previous 5 runs on main

  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -92%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -74%
  • ↓ onboardingImportWallet/longTaskCount: -100%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -100%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -100%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -85%
  • ↑ onboardingNewWallet/agreeButtonToOnboardingSuccess: +24%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -77%
  • ↓ onboardingNewWallet/longTaskCount: -100%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -100%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -100%
  • ↓ onboardingNewWallet/tbt: -100%
  • ↓ onboardingNewWallet/total: -73%
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ dappPageLoad/pageLoadTime: -49%
  • ↓ dappPageLoad/firstPaint: -28%
  • ↓ dappPageLoad/firstContentfulPaint: -28%
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
Status Bundle Total Diff Change
✅ background 15.26 MiB +137 Bytes 0.00%
🚨 ui 19.34 MiB +1.33 KiB +0.01%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.44 MiB +7 Bytes 0.00%
✅ content scripts 3.23 MiB +14 Bytes 0.00%
🚨 unzipped 79.64 MiB +1.49 KiB 0.00%
✅ zip 23.81 MiB +378 Bytes 0.00%

jpuri
jpuri previously approved these changes Nov 4, 2026
- Type the useSelector state as MoneyAccountState
- Mark it.each with the repo's Mocha type-definition ts-expect-error and type callback params
- Address Sonar S7776 by using a Set for MONEY_KEYRING_TYPES
@metamask-ci

metamask-ci Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor
Builds ready [30430aa]
⚡ Performance Benchmarks (Total: 🟢 10 pass · 🟡 0 warn · 🔴 3 fail)

Baseline (latest main): f693520 | Date: 11/3/2026 | Pipeline: 41860067362 | Baseline logs

Metricschrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 load_new_account(p95) [CI log]🔴 load_new_account(p95) [CI log]
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]

Regressions (🔴 3 failures)

Interaction Benchmarks · Samples: 5 🔴 2
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 [CI log]
🔴 load_new_account
🔴 [CI log]
🔴 load_new_account
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ loadNewAccount/load_new_account: +180%
  • ↑ loadNewAccount/total: +180%
  • ↓ loadNewAccount/inp: -25%
  • ↑ loadNewAccount/lcp: +50%
  • ↑ loadNewAccount/cls: +278%
  • ↑ confirmTx/longTaskTotalDuration: +18%
  • ↑ confirmTx/longTaskMaxDuration: +29%
  • ↑ confirmTx/tbt: +32%
  • ↓ confirmTx/inp: -29%
  • ↓ confirmTx/fcp: -17%
  • ↑ bridgeUserActions/bridge_load_page: +27%
  • ↑ bridgeUserActions/longTaskCount: +36%
  • ↑ bridgeUserActions/longTaskTotalDuration: +47%
  • ↑ bridgeUserActions/longTaskMaxDuration: +21%
  • ↑ bridgeUserActions/tbt: +66%
  • ↓ bridgeUserActions/inp: -12%
  • ↓ bridgeUserActions/fcp: -15%
  • ↑ bridgeUserActions/cls: +281%
  • ↑ loadNewAccount/load_new_account: +181%
  • ↑ loadNewAccount/total: +181%
  • ↑ loadNewAccount/inp: +87%
  • ↓ loadNewAccount/fcp: -72%
  • ↑ loadNewAccount/lcp: +1233%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↑ confirmTx/inp: +98%
  • ↓ confirmTx/fcp: -73%
  • ↑ confirmTx/lcp: +872%
  • ↑ bridgeUserActions/bridge_load_page: +132%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +79%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +25%
  • ↑ bridgeUserActions/inp: +69%
  • ↓ bridgeUserActions/fcp: -70%
  • ↑ bridgeUserActions/lcp: +860%
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ startupStandardHome/uiStartup: -20%
  • ↓ startupStandardHome/load: -24%
  • ↓ startupStandardHome/domContentLoaded: -24%
  • ↓ startupStandardHome/firstPaint: -14%
  • ↓ startupStandardHome/backgroundConnect: -26%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -29%
  • ↓ startupStandardHome/loadScripts: -24%
  • ↑ startupStandardHome/setupStore: +56%
  • ↓ startupStandardHome/longTaskCount: -29%
  • ↓ startupStandardHome/longTaskTotalDuration: -30%
  • ↓ startupStandardHome/longTaskMaxDuration: -28%
  • ↓ startupStandardHome/tbt: -30%
  • ↓ startupStandardHome/inp: -11%
  • ↓ startupStandardHome/fcp: -24%
  • ↓ startupStandardHome/lcp: -11%
  • ↑ startupStandardHome/cls: +400%
  • ↓ startupStandardHome/uiStartup: -23%
  • ↓ startupStandardHome/load: -17%
  • ↓ startupStandardHome/domContentLoaded: -18%
  • ↓ startupStandardHome/domInteractive: -48%
  • ↓ startupStandardHome/backgroundConnect: -13%
  • ↓ startupStandardHome/firstReactRender: -99%
  • ↓ startupStandardHome/initialActions: -50%
  • ↓ startupStandardHome/loadScripts: -17%
  • ↑ startupStandardHome/setupStore: +89%
  • ↓ startupStandardHome/fcp: -33%
  • ↓ startupStandardHome/lcp: -15%
User Journey Benchmarks · Samples: 5 · mock API 🔴 1
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
🔴 total
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ onboardingImportWallet/srpButtonToSrpForm: +26%
  • ↑ onboardingImportWallet/confirmSrpToPwForm: +27%
  • ↑ onboardingImportWallet/pwFormToMetricsScreen: +24%
  • ↑ onboardingImportWallet/metricsToWalletReadyScreen: +19%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -92%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -74%
  • ↓ onboardingImportWallet/longTaskCount: -100%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -100%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -100%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -85%
  • ↓ onboardingNewWallet/createPwToRecoveryScreen: -16%
  • ↓ onboardingNewWallet/agreeButtonToOnboardingSuccess: -38%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -77%
  • ↓ onboardingNewWallet/longTaskCount: -100%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -100%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -100%
  • ↓ onboardingNewWallet/tbt: -100%
  • ↓ onboardingNewWallet/total: -74%
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ dappPageLoad/pageLoadTime: -65%
  • ↓ dappPageLoad/domContentLoaded: -29%
  • ↓ dappPageLoad/firstPaint: -47%
  • ↓ dappPageLoad/firstContentfulPaint: -47%
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
Status Bundle Total Diff Change
✅ background 15.26 MiB +170 Bytes 0.00%
🚨 ui 19.34 MiB +1.51 KiB +0.01%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.44 MiB +7 Bytes 0.00%
✅ content scripts 3.23 MiB +14 Bytes 0.00%
🚨 unzipped 79.64 MiB +1.7 KiB 0.00%
✅ zip 23.81 MiB +401 Bytes 0.00%

@metamask-ci

metamask-ci Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor
Builds ready [325303a] [reused from 30430aa]
⚡ Performance Benchmarks (Total: 🟢 10 pass · 🟡 0 warn · 🔴 3 fail)

Baseline (latest main): f693520 | Date: 11/3/2026 | Pipeline: 41867636958 | Baseline logs

Metricschrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 load_new_account(p95) [CI log]🔴 load_new_account(p95) [CI log]
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]

Regressions (🔴 3 failures)

Interaction Benchmarks · Samples: 5 🔴 2
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🔴 [CI log]
🔴 load_new_account
🔴 [CI log]
🔴 load_new_account
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ loadNewAccount/load_new_account: +180%
  • ↑ loadNewAccount/total: +180%
  • ↓ loadNewAccount/inp: -25%
  • ↑ loadNewAccount/lcp: +50%
  • ↑ loadNewAccount/cls: +278%
  • ↑ confirmTx/longTaskTotalDuration: +18%
  • ↑ confirmTx/longTaskMaxDuration: +29%
  • ↑ confirmTx/tbt: +32%
  • ↓ confirmTx/inp: -29%
  • ↓ confirmTx/fcp: -17%
  • ↑ bridgeUserActions/bridge_load_page: +27%
  • ↑ bridgeUserActions/longTaskCount: +36%
  • ↑ bridgeUserActions/longTaskTotalDuration: +47%
  • ↑ bridgeUserActions/longTaskMaxDuration: +21%
  • ↑ bridgeUserActions/tbt: +66%
  • ↓ bridgeUserActions/inp: -12%
  • ↓ bridgeUserActions/fcp: -15%
  • ↑ bridgeUserActions/cls: +281%
  • ↑ loadNewAccount/load_new_account: +181%
  • ↑ loadNewAccount/total: +181%
  • ↑ loadNewAccount/inp: +87%
  • ↓ loadNewAccount/fcp: -72%
  • ↑ loadNewAccount/lcp: +1233%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↑ confirmTx/inp: +98%
  • ↓ confirmTx/fcp: -73%
  • ↑ confirmTx/lcp: +872%
  • ↑ bridgeUserActions/bridge_load_page: +132%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +79%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +25%
  • ↑ bridgeUserActions/inp: +69%
  • ↓ bridgeUserActions/fcp: -70%
  • ↑ bridgeUserActions/lcp: +860%
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ startupStandardHome/uiStartup: -20%
  • ↓ startupStandardHome/load: -24%
  • ↓ startupStandardHome/domContentLoaded: -24%
  • ↓ startupStandardHome/firstPaint: -14%
  • ↓ startupStandardHome/backgroundConnect: -26%
  • ↓ startupStandardHome/firstReactRender: -98%
  • ↓ startupStandardHome/initialActions: -29%
  • ↓ startupStandardHome/loadScripts: -24%
  • ↑ startupStandardHome/setupStore: +56%
  • ↓ startupStandardHome/longTaskCount: -29%
  • ↓ startupStandardHome/longTaskTotalDuration: -30%
  • ↓ startupStandardHome/longTaskMaxDuration: -28%
  • ↓ startupStandardHome/tbt: -30%
  • ↓ startupStandardHome/inp: -11%
  • ↓ startupStandardHome/fcp: -24%
  • ↓ startupStandardHome/lcp: -11%
  • ↑ startupStandardHome/cls: +400%
  • ↓ startupStandardHome/uiStartup: -23%
  • ↓ startupStandardHome/load: -17%
  • ↓ startupStandardHome/domContentLoaded: -18%
  • ↓ startupStandardHome/domInteractive: -48%
  • ↓ startupStandardHome/backgroundConnect: -13%
  • ↓ startupStandardHome/firstReactRender: -99%
  • ↓ startupStandardHome/initialActions: -50%
  • ↓ startupStandardHome/loadScripts: -17%
  • ↑ startupStandardHome/setupStore: +89%
  • ↓ startupStandardHome/fcp: -33%
  • ↓ startupStandardHome/lcp: -15%
User Journey Benchmarks · Samples: 5 · mock API 🔴 1
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
🔴 total
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ onboardingImportWallet/srpButtonToSrpForm: +26%
  • ↑ onboardingImportWallet/confirmSrpToPwForm: +27%
  • ↑ onboardingImportWallet/pwFormToMetricsScreen: +24%
  • ↑ onboardingImportWallet/metricsToWalletReadyScreen: +19%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -92%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -74%
  • ↓ onboardingImportWallet/longTaskCount: -100%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -100%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -100%
  • ↓ onboardingImportWallet/tbt: -100%
  • ↓ onboardingImportWallet/total: -85%
  • ↓ onboardingNewWallet/createPwToRecoveryScreen: -16%
  • ↓ onboardingNewWallet/agreeButtonToOnboardingSuccess: -38%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -77%
  • ↓ onboardingNewWallet/longTaskCount: -100%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -100%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -100%
  • ↓ onboardingNewWallet/tbt: -100%
  • ↓ onboardingNewWallet/total: -74%
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ dappPageLoad/pageLoadTime: -65%
  • ↓ dappPageLoad/domContentLoaded: -29%
  • ↓ dappPageLoad/firstPaint: -47%
  • ↓ dappPageLoad/firstContentfulPaint: -47%
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
Status Bundle Total Diff Change
✅ background 15.26 MiB +170 Bytes 0.00%
🚨 ui 19.34 MiB +1.51 KiB +0.01%
✅ common 0 Bytes 0 Bytes 0.00%
✅ other 4.44 MiB +7 Bytes 0.00%
✅ content scripts 3.23 MiB +14 Bytes 0.00%
🚨 unzipped 79.64 MiB +1.7 KiB 0.00%
✅ zip 23.81 MiB +401 Bytes 0.00%

@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@pedronfigueiredo
pedronfigueiredo added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit 216e863 Nov 5, 2026
142 of 143 checks passed
@pedronfigueiredo
pedronfigueiredo deleted the pnf/conf-2215-money-account-sponsorship-opt-out branch November 5, 2026 10:29
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 5, 2026
weitingsun pushed a commit to Poovarasan-Sandhanam/metamask-mobile that referenced this pull request Nov 6, 2026
…MetaMask#38961)

## **Description**

### Problem

Money account deposits fail at submit with:

```
KeyringController - The keyring for the current address does not support the method signTransaction.
```

Reported on RC 8.19.0.

### Root cause

1. **Money keyrings cannot sign transactions by design.**
`@metamask/eth-money-keyring` implements `signPersonalMessage`,
`signTypedData` and `signEip7702Authorization` only.
`KeyringController.signTransaction` throws the error above when the
keyring has no `signTransaction`.
2. **The happy path never signs locally.**
`useMoneyAccount.initiateDeposit` creates the batch with
`isGasFeeSponsored: isMonadMainnetChainId(chainId)`.
`TransactionController` then sets `isExternalSign = true`, skips the
keyring (`Skipping sign as signed externally`), and the 7702 relay
publish hook submits it.
3. **`useTransactionConfirm` undid that.** At confirm time it recomputed
both flags from `useIsGaslessSupported`:

   ```ts
   updatedMetadata.isGasFeeSponsored = isGaslessEligible;

   const isExternalSignStale =
     Boolean(transactionMetadata.isExternalSign) && !isGaslessEligible;
   ```

When `isGaslessEligible` was false both flags were cleared,
`TransactionController` fell back to `KeyringController:signTransaction`
with the money account as `from`, and that threw.

That revert exists for **hardware wallets**, which genuinely must sign
locally — leaving the flag set there would send an empty `'0x'` to
`eth_sendRawTransaction`. It simply did not exclude money accounts,
which are the opposite case.

**Why `isGaslessSupported` goes false for a deposit:**
`useIsGaslessSupported` resolves asynchronously and checks
`isAtomicBatchSupported` for the **paying** account. For a money deposit
the payer is the funding EOA (via `accountOverride`), not the money
account, so it can legitimately disagree with the 7702 publish hook —
which keys on `txParams.from`. Any transient relay/`isRelaySupported`
failure produces the same outcome.

> Note: this differs from the Extension's trigger in
[MetaMask/metamask-extension#47616](MetaMask/metamask-extension#47616).
Mobile has no per-chain gas sponsorship opt-out preference
(`gasSponsorshipOptOutByChainId` does not exist here), so on Mobile the
`useIsGaslessSupported` disagreement is the cause.

### Solution

- **New selectors `selectMoneyKeyringAddresses` /
`selectIsMoneyKeyringAddress`** in `app/selectors/keyringController`.
They read `keyrings` directly, because money accounts are not internal
accounts, so `metadata.keyring` lookups do not apply.
- **`useTransactionConfirm` now checks whether `txParams.from` belongs
to a money keyring.** For those transactions:
- `isGasFeeSponsored` is kept whenever the controller sponsored the
transaction, regardless of `isGaslessSupported`.
  - `isExternalSign` is never cleared.

The check is keyed on the **sending keyring**, not the transaction type,
so deposits, withdrawals, rescue sends and rewards claims are all
covered.
- **Behaviour for all other accounts is unchanged.** The hardware-wallet
revert still applies, and a money transaction the controller did *not*
sponsor is still not force-marked as sponsored.

### Also fixed (found while verifying)

`KEYRING_TYPES_SUPPORTING_7702` in `account-supports-7702.ts` listed
`money` but not `mpcMoney`. Since `accountSupports7702` is the outermost
condition in both the publish hook
(`app/util/transactions/hooks/index.ts`) and
`isEIP7702GasFeeTokensEnabled`, MPC money accounts would have been
blocked from the relay even with the flags preserved.

This is **latent, not user-facing** — MPC keyring registration is fenced
behind `MM_MONEY_MPC_KEYRING_ENABLED`, which ships off. It is fixed here
because the new selector treats both variants as money keyrings, so
leaving the allowlist inconsistent would be a trap for whoever enables
that flag. Both lists now derive from a single `MONEY_KEYRING_TYPES`
constant so they cannot drift again.

## **Changelog**

CHANGELOG entry: Fixed money account deposits failing with a "does not
support the method signTransaction" error

## **Related issues**

Fixes:
[CONF-2227](https://consensyssoftware.atlassian.net/browse/CONF-2227)

Mirrors the Extension fix:
MetaMask/metamask-extension#47616

## **Manual testing steps**

**Setup:** a build with a money account on Monad holding some mUSD.

```gherkin
Feature: Money account deposit

  Scenario: user makes a money account deposit
    Given the user has a money account on Monad
    When the user makes a money account deposit
    Then the deposit is submitted through the sponsored 7702 relay
    And no "does not support the method signTransaction" error is shown

  Scenario: user makes a money account withdrawal
    Given the user has a money account on Monad holding mUSD
    When the user makes a money account withdrawal
    Then the withdrawal is submitted through the sponsored 7702 relay

  Scenario: hardware wallet signing is unaffected
    Given the user has a hardware wallet account on a sponsored chain
    When the user confirms a transaction from that account
    Then the transaction is signed on device and submitted normally
```

Because the trigger is a race/transient in `useIsGaslessSupported`, the
most reliable way to reproduce the failure on `main` is to force the
disagreement — e.g. make `useIsGaslessSupported` return `isSupported:
false` (stub `isRelaySupported` to resolve `false`), then attempt a
deposit:

- **Before this PR:** fails with `KeyringController - The keyring for
the current address does not support the method signTransaction.`
- **After this PR:** succeeds via the sponsored relay.

Please also confirm step 3 (hardware wallet) to verify the existing
revert is intact.

## **Screenshots/Recordings**

N/A — no UI change. The fix only affects which flags are sent to
`TransactionController` at confirm time.

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

### Testing notes

- **Regression-proven:** the hook logic was reverted locally to confirm
the two bug-specific tests fail, then restored. They catch the bug
rather than passing vacuously. The two guard tests (non-money sender
still reverted; unsponsored money tx not force-marked) correctly stayed
green throughout.
- 112 tests pass across the 4 affected suites, including the 53
pre-existing `useTransactionConfirm` tests.
- `yarn lint:tsc` exits 0; ESLint reports 0 errors and 0 warnings on the
changed files.
- **Not verified on device** — this is covered by unit tests and code
analysis only. Reviewer device testing on a real money account would be
valuable.

#### Performance checks (if applicable)

- [x] I've tested on Android
  - Ideally on a mid-range device; emulator is acceptable
- [x] I've tested with a power user scenario
- Use these [power-user
SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93)
to import wallets with many accounts and tokens
- [x] I've instrumented key operations with Sentry traces for production
performance metrics
- See [`trace()`](/app/util/trace.ts) for usage and
[`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274)
for an example

For performance guidelines and tooling, see the [Performance
Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.


[CONF-2227]:
https://consensyssoftware.atlassian.net/browse/CONF-2227?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes transaction confirm metadata for sponsored signing paths;
scope is narrow (money signers only) but incorrect logic would break
money flows or regress hardware external-sign reverts.
> 
> **Overview**
> Fixes money account deposits and withdrawals failing at confirm when
**`useIsGaslessSupported`** returns false and
**`useTransactionConfirm`** was clearing **`isExternalSign`** /
**`isGasFeeSponsored`**, which forced local **`signTransaction`** on
keyrings that only support message signing.
> 
> **`useTransactionConfirm`** now detects Money signers via
**`selectIsMoneyKeyringAddress`** on **`txParams.from`**. For those
accounts it preserves controller-sponsored **`isGasFeeSponsored`**
(using **`isTransactionMarkedAsGasFeeSponsored`**) and never reverts
**`isExternalSign`** when gasless eligibility disagrees; hardware-wallet
and non-money behavior is unchanged.
> 
> Adds **`selectMoneyKeyringAddresses`** /
**`selectIsMoneyKeyringAddress`**, a shared **`MONEY_KEYRING_TYPES`**
list (SRP and MPC Money keyrings), and aligns **`accountSupports7702`**
with that list so MPC money accounts are not blocked from the 7702
relay. Regression tests cover deposit, withdraw, unsponsored guard, and
non-money revert paths.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f28bc31. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@metamaskbot metamaskbot added the release-13.57.0 Issue or pull request that will be included in release 13.57.0 label Nov 9, 2026
@gauthierpetetin

Copy link
Copy Markdown
Contributor

No release label on PR. Adding release label release-13.57.0 on PR, as PR was added to branch 13.57.0 when release was cut.

This branch had an error being deployed

1 failed and 1 inactive deployments
segment-schema — 325303a8 Deployed Nov 4, 2026 by pedronfigueiredo via propose #3158
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.57.0 Issue or pull request that will be included in release 13.57.0 size-M team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants