Skip to content

fix(confirmations): keep money account transactions externally signed - #38961

Merged
jpuri merged 1 commit into
mainfrom
fix/conf-2227-money-deposit-sign-transaction
Nov 5, 2026
Merged

jpuri merged 1 commit into
mainfrom
fix/conf-2227-money-deposit-sign-transaction

Conversation

@jpuri

@jpuri jpuri commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

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:

    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. 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

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

Manual testing steps

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

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

After

Pre-merge author checklist

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)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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 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.

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

Money account deposits failed at submit with "KeyringController - The
keyring for the current address does not support the method
signTransaction."

Money keyrings implement message signing only; they have no
`signTransaction`, so their transactions must stay externally signed and
publish through the EIP-7702 relay. `useTransactionConfirm` cleared both
`isGasFeeSponsored` and `isExternalSign` whenever `useIsGaslessSupported`
was false, and `TransactionController` then fell back to local signing,
which threw.

That revert exists for hardware wallets, which genuinely must sign
locally, but it did not exclude money accounts. It trips because
`useIsGaslessSupported` resolves asynchronously and reads the *paying*
account's atomic-batch support — for a deposit that is the funding EOA,
not the money account — so it can legitimately disagree with the 7702
publish hook.

Keep both flags for transactions sent from a money keyring account. The
check is keyed on the sending keyring rather than the transaction type,
so deposits, withdrawals, rescue sends and rewards claims are all
covered. `isGasFeeSponsored` is only preserved when the controller
already sponsored the transaction, so nothing is force-marked. Behaviour
for every other account is unchanged.

Also add the missing `mpcMoney` keyring type and route both money
variants through a shared `MONEY_KEYRING_TYPES` constant.
`KEYRING_TYPES_SUPPORTING_7702` listed `money` but not `mpcMoney`, which
would have blocked MPC money accounts from the relay in both
`isEIP7702GasFeeTokensEnabled` and the publish hook. Sharing one constant
keeps the two lists from drifting again.

Fixes CONF-2227
@jpuri jpuri self-assigned this Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 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 5, 2026
@metamask-ci metamask-ci Bot added the team-confirmations Push issues to confirmations team label Nov 5, 2026
@jpuri jpuri added the no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed label Nov 5, 2026
@jpuri
jpuri marked this pull request as ready for review November 5, 2026 10:27
@jpuri
jpuri requested a review from a team as a code owner November 5, 2026 10:27
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Smart E2E Test Selection

Selected E2E tags

SmokeConfirmations
SmokePerps
SmokeWalletPlatform
SmokeMoney

AI Confidence: 88

E2E reasoning

Expand to read

This PR introduces behavioral changes to the transaction confirmation flow for Money Accounts (both SRP-derived 'Money Keyring' and new MPC 'MPC Money Keyring' variant):

  1. useTransactionConfirm.ts (CRITICAL): Core confirmation hook modified to detect Money Account signers via selectIsMoneyKeyringAddress. The isGasFeeSponsored and isExternalSign flag logic is changed so Money Account transactions always stay externally signed via the EIP-7702 relay, even when useIsGaslessSupported returns false. This prevents a "keyring does not support signTransaction" error. This hook is consumed by PerpsOrderView, useConfirmActions, useConfirmReject, and the confirm component.

  2. keyringTypes.ts (CRITICAL path): New mpcMoney keyring type added and MONEY_KEYRING_TYPES array exported — this is a new keyring variant that affects how transactions are classified and routed.

  3. keyringController/index.ts (CRITICAL selector): New selectors selectMoneyKeyringAddresses and selectIsMoneyKeyringAddress added — these drive the Money Account detection in the confirmation hook.

  4. account-supports-7702.ts: Updated to include MPC Money Keyring in EIP-7702 support list.

Tags selected:

  • SmokeConfirmations: Direct impact on transaction confirmation behavior (isGasFeeSponsored, isExternalSign flags). Required for any transaction flow.
  • SmokePerps: PerpsOrderView directly imports useTransactionConfirm. Perps deposits/withdrawals use Money Account transactions and are the primary use case for this fix.
  • SmokeWalletPlatform: Required by SmokePerps tag description (Perps is embedded in Trending tab).
  • SmokeMoney: MetaMask Card/Money Account flows are directly affected by the Money keyring detection logic. The MPC Money Keyring addition suggests new card infrastructure.

Changes are purely in unit-tested hooks and selectors (no UI component changes), so browser/network/swap/stake tags are not warranted. The risk is high because the confirmation hook is widely consumed and the flag logic change could break existing transaction flows if the Money Account detection has edge cases.

View run

@sonarqubecloud

sonarqubecloud Bot commented Nov 5, 2026

Copy link
Copy Markdown

@jpuri
jpuri added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit eccea76 Nov 5, 2026
142 checks passed
@jpuri
jpuri deleted the fix/conf-2227-money-deposit-sign-transaction branch November 5, 2026 11:58
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 5, 2026
@metamask-ci metamask-ci Bot added the release-8.20.0 Issue or pull request that will be included in release 8.20.0 label Nov 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-8.20.0 Issue or pull request that will be included in release 8.20.0 size-M team-confirmations Push issues to confirmations team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants