Skip to content

fix: ensure mUSD is tracked by default cp-13.29.0#42333

Open
Matt561 wants to merge 14 commits into
mainfrom
fix/ensure-musd-is-tracked-by-default
Open

fix: ensure mUSD is tracked by default cp-13.29.0#42333
Matt561 wants to merge 14 commits into
mainfrom
fix/ensure-musd-is-tracked-by-default

Conversation

@Matt561
Copy link
Copy Markdown
Contributor

@Matt561 Matt561 commented May 1, 2026

Description

This PR updates dependencies to ensure that mUSD is tracked by default in the wallet; removes the previous ensureMusdTokenImportedForChain solution; removes ability for users to hide mUSD on the asset details page.

Changes:

Changelog

CHANGELOG entry: bumped assets-controllers to ^105.1.0; removed ensureMusdTokenImportedForChain.

Related issues

Fixes:

Manual testing steps

Prerequisite: To replicate the "insufficient balance" error in the mUSD conversion flow you must have a fresh install with an SRP that doesn't hold mUSD but does hold ETH and a convertible stablecoin (e.g. USDC).

  1. After onboarding, click the "Get mUSD" button above the token list. This will redirect you to the conversion screen.
  2. Enter a valid amount to convert.
  3. You should not see the "insufficient balance" error

Screenshots/Recordings

Before

mm_extension_auto_import_mUSD_demo_before.mov

After

mm_extension_auto_import_mUSD_demo_after.mov

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
Introduces a new state migration that mutates TokensController.allTokens across accounts and networks, which can affect users’ token lists if edge cases were missed. Additional changes update controller event subscriptions and LavaMoat policies, so misconfiguration could cause runtime messaging or bundling issues.

Overview
Adds migration 207 to auto-track mUSD by default. On upgrade, it seeds the mUSD token into TokensController.allTokens for every EVM account on 0x1, 0xe708, and 0x8f, preserving existing tokens and avoiding duplicates via case-insensitive address checks.

Updates messenger allowlists so assets/tokens/token-detection controllers also react to NetworkController:networkAdded (and tokens additionally to AccountsController:accountAdded and KeyringController:unlock). Tests and E2E state snapshots are adjusted to reflect seeded tokens and updated network/controller state, @metamask/assets-controllers is bumped to ^105.1.0, privacy-snapshot.json adds api.merkl.xyz, and multiple LavaMoat policies are updated for revised keyring dependency paths and @metamask/messenger access.

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

@Matt561 Matt561 requested a review from a team as a code owner May 1, 2026 16:38
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 1, 2026

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.

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 1, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​assets-controller@​6.2.1 ⏵ 6.3.06910080 +198 +1100
Updated@​metamask/​assets-controllers@​105.0.0 ⏵ 105.1.072 +110091 +198 +1100
Updated@​metamask/​keyring-controller@​25.2.0 ⏵ 25.4.09810078 +196 +2100
Updated@​metamask/​json-rpc-engine@​10.2.4 ⏵ 10.3.09910010093 +4100

View full report

@github-actions github-actions Bot added the size-M label May 1, 2026
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 Bot commented May 1, 2026

✨ Files requiring CODEOWNER review ✨

👨‍🔧 @MetaMask/earn (4 files, +0 -171)
  • 📁 ui/
    • 📁 components/
      • 📁 app/
        • 📁 musd/
          • 📁 utils/
            • 📄 ensure-musd-token-imported.test.ts +0 -89
            • 📄 ensure-musd-token-imported.ts +0 -48
            • 📄 index.ts +0 -3
    • 📁 hooks/
      • 📁 musd/
        • 📄 useMusdConversion.test.ts +0 -31

🕵️ @MetaMask/extension-privacy-reviewers (1 files, +1 -0)
  • 📄 privacy-snapshot.json +1 -0

📜 @MetaMask/policy-reviewers (12 files, +812 -232)
  • 📁 lavamoat/
    • 📁 browserify/
      • 📁 beta/
        • 📄 policy.json +69 -17
      • 📁 experimental/
        • 📄 policy.json +69 -17
      • 📁 flask/
        • 📄 policy.json +69 -17
      • 📁 main/
        • 📄 policy.json +69 -17
    • 📁 webpack/
      • 📁 mv2/
        • 📁 beta/
          • 📄 policy.json +69 -20
        • 📁 experimental/
          • 📄 policy.json +69 -20
        • 📁 flask/
          • 📄 policy.json +69 -20
        • 📁 main/
          • 📄 policy.json +69 -20
      • 📁 mv3/
        • 📁 beta/
          • 📄 policy.json +65 -21
        • 📁 experimental/
          • 📄 policy.json +65 -21
        • 📁 flask/
          • 📄 policy.json +65 -21
        • 📁 main/
          • 📄 policy.json +65 -21

Tip

Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers.

Comment thread ui/hooks/musd/useMusdConversion.ts
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 Bot commented May 1, 2026

Builds ready [c4944d4]
⚡ Performance Benchmarks (Total: 🟢 0 pass · 🟡 0 warn · 🔴 0 fail)

Baseline (latest main): 71bd826 | Date: 4/10/2026 | Pipeline: 25225197873 | Baseline logs

Interaction Benchmarks · Samples: 5

⚠️ Missing data: chrome/webpack/interactionUserActions, firefox/webpack/interactionUserActions

✅ No regressions detected

Startup Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/startupStandardHome, chrome/webpack/startupPowerUserHome, firefox/webpack/startupStandardHome, firefox/webpack/startupPowerUserHome

✅ No regressions detected

User Journey Benchmarks · Samples: 5 · mock API

⚠️ Missing data: chrome/webpack/userJourneyOnboardingImport, chrome/webpack/userJourneyOnboardingNew, chrome/webpack/userJourneyAssets, chrome/webpack/userJourneyAccountManagement, chrome/webpack/userJourneyTransactions, firefox/webpack/userJourneyOnboardingImport, firefox/webpack/userJourneyOnboardingNew, firefox/webpack/userJourneyAssets, firefox/webpack/userJourneyAccountManagement, firefox/webpack/userJourneyTransactions

✅ No regressions detected

Dapp Page Load Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/pageLoadBenchmark

✅ No regressions detected

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 55 Bytes (0%)
  • ui: -686 Bytes (-0.01%)
  • common: 181.84 KiB (1.37%)

@Prithpal-Sooriya Prithpal-Sooriya requested a review from a team as a code owner May 1, 2026 19:08
@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 Bot commented May 1, 2026

Builds ready [280331f]
⚡ Performance Benchmarks (Total: 🟢 0 pass · 🟡 0 warn · 🔴 0 fail)

Baseline (latest main): 71bd826 | Date: 4/10/2026 | Pipeline: 25228752125 | Baseline logs

Interaction Benchmarks · Samples: 5

⚠️ Missing data: chrome/webpack/interactionUserActions, firefox/webpack/interactionUserActions

✅ No regressions detected

Startup Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/startupStandardHome, chrome/webpack/startupPowerUserHome, firefox/webpack/startupStandardHome, firefox/webpack/startupPowerUserHome

✅ No regressions detected

User Journey Benchmarks · Samples: 5 · mock API

⚠️ Missing data: chrome/webpack/userJourneyOnboardingImport, chrome/webpack/userJourneyOnboardingNew, chrome/webpack/userJourneyAssets, chrome/webpack/userJourneyAccountManagement, chrome/webpack/userJourneyTransactions, firefox/webpack/userJourneyOnboardingImport, firefox/webpack/userJourneyOnboardingNew, firefox/webpack/userJourneyAssets, firefox/webpack/userJourneyAccountManagement, firefox/webpack/userJourneyTransactions

✅ No regressions detected

Dapp Page Load Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/pageLoadBenchmark

✅ No regressions detected

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 179 Bytes (0%)
  • ui: -686 Bytes (-0.01%)
  • common: 182.1 KiB (1.37%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 Bot commented May 1, 2026

Builds ready [4d23a15] [reused from 280331f]
⚡ Performance Benchmarks (Total: 🟢 0 pass · 🟡 0 warn · 🔴 0 fail)

Baseline (latest main): 71bd826 | Date: 4/10/2026 | Pipeline: 25229813107 | Baseline logs

Interaction Benchmarks · Samples: 5

⚠️ Missing data: chrome/webpack/interactionUserActions, firefox/webpack/interactionUserActions

✅ No regressions detected

Startup Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/startupStandardHome, chrome/webpack/startupPowerUserHome, firefox/webpack/startupStandardHome, firefox/webpack/startupPowerUserHome

✅ No regressions detected

User Journey Benchmarks · Samples: 5 · mock API

⚠️ Missing data: chrome/webpack/userJourneyOnboardingImport, chrome/webpack/userJourneyOnboardingNew, chrome/webpack/userJourneyAssets, chrome/webpack/userJourneyAccountManagement, chrome/webpack/userJourneyTransactions, firefox/webpack/userJourneyOnboardingImport, firefox/webpack/userJourneyOnboardingNew, firefox/webpack/userJourneyAssets, firefox/webpack/userJourneyAccountManagement, firefox/webpack/userJourneyTransactions

✅ No regressions detected

Dapp Page Load Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/pageLoadBenchmark

✅ No regressions detected

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 179 Bytes (0%)
  • ui: -686 Bytes (-0.01%)
  • common: 182.1 KiB (1.37%)

@Prithpal-Sooriya
Copy link
Copy Markdown
Contributor

Some E2E failures are because of the new MUSD addition flow.

  1. On start we call addTokens
  2. This calls TokensController
  3. Which calls TokenRatesController
  4. Which calls the price-api.

We are not permitted to make API calls until after unlock or onboarding.

  • Fix required - we need to wrap the add MUSD startup until onboarding is complete.

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 Bot commented May 1, 2026

Builds ready [8792d80]
⚡ Performance Benchmarks (Total: 🟢 0 pass · 🟡 0 warn · 🔴 0 fail)

Baseline (latest main): 71bd826 | Date: 4/10/2026 | Pipeline: 25233043582 | Baseline logs

Interaction Benchmarks · Samples: 5

⚠️ Missing data: chrome/webpack/interactionUserActions, firefox/webpack/interactionUserActions

✅ No regressions detected

Startup Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/startupStandardHome, chrome/webpack/startupPowerUserHome, firefox/webpack/startupStandardHome, firefox/webpack/startupPowerUserHome

✅ No regressions detected

User Journey Benchmarks · Samples: 5 · mock API

⚠️ Missing data: chrome/webpack/userJourneyOnboardingImport, chrome/webpack/userJourneyOnboardingNew, chrome/webpack/userJourneyAssets, chrome/webpack/userJourneyAccountManagement, chrome/webpack/userJourneyTransactions, firefox/webpack/userJourneyOnboardingImport, firefox/webpack/userJourneyOnboardingNew, firefox/webpack/userJourneyAssets, firefox/webpack/userJourneyAccountManagement, firefox/webpack/userJourneyTransactions

✅ No regressions detected

Dapp Page Load Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/pageLoadBenchmark

✅ No regressions detected

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 180 Bytes (0%)
  • ui: -623 Bytes (-0.01%)
  • common: 184.92 KiB (1.39%)

@chloeYue chloeYue changed the title fix: ensure mUSD is tracked by default fix: ensure mUSD is tracked by default cp-13.29.0 May 4, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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.

There are 2 total unresolved issues (including 1 from previous review).

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 c854983. Configure here.

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 Bot commented May 4, 2026

Builds ready [c854983]
⚡ Performance Benchmarks (Total: 🟢 0 pass · 🟡 0 warn · 🔴 0 fail)

Baseline (latest main): 51036da | Date: 5/2/2026 | Pipeline: 25325269460 | Baseline logs

Interaction Benchmarks · Samples: 5

⚠️ Missing data: chrome/webpack/interactionUserActions, firefox/webpack/interactionUserActions

✅ No regressions detected

Startup Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/startupStandardHome, chrome/webpack/startupPowerUserHome, firefox/webpack/startupStandardHome, firefox/webpack/startupPowerUserHome

✅ No regressions detected

User Journey Benchmarks · Samples: 5 · mock API

⚠️ Missing data: chrome/webpack/userJourneyOnboardingImport, chrome/webpack/userJourneyOnboardingNew, chrome/webpack/userJourneyAssets, chrome/webpack/userJourneyAccountManagement, chrome/webpack/userJourneyTransactions, firefox/webpack/userJourneyOnboardingImport, firefox/webpack/userJourneyOnboardingNew, firefox/webpack/userJourneyAssets, firefox/webpack/userJourneyAccountManagement, firefox/webpack/userJourneyTransactions

✅ No regressions detected

Dapp Page Load Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/pageLoadBenchmark

✅ No regressions detected

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 180 Bytes (0%)
  • ui: -684 Bytes (-0.01%)
  • common: 181.84 KiB (1.37%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 Bot commented May 4, 2026

Builds ready [a406f40]
⚡ Performance Benchmarks (Total: 🟢 0 pass · 🟡 0 warn · 🔴 0 fail)

Baseline (latest main): 51036da | Date: 5/2/2026 | Pipeline: 25337343210 | Baseline logs

Interaction Benchmarks · Samples: 5

⚠️ Missing data: chrome/webpack/interactionUserActions, firefox/webpack/interactionUserActions

✅ No regressions detected

Startup Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/startupStandardHome, chrome/webpack/startupPowerUserHome, firefox/webpack/startupStandardHome, firefox/webpack/startupPowerUserHome

✅ No regressions detected

User Journey Benchmarks · Samples: 5 · mock API

⚠️ Missing data: chrome/webpack/userJourneyOnboardingImport, chrome/webpack/userJourneyOnboardingNew, chrome/webpack/userJourneyAssets, chrome/webpack/userJourneyAccountManagement, chrome/webpack/userJourneyTransactions, firefox/webpack/userJourneyOnboardingImport, firefox/webpack/userJourneyOnboardingNew, firefox/webpack/userJourneyAssets, firefox/webpack/userJourneyAccountManagement, firefox/webpack/userJourneyTransactions

✅ No regressions detected

Dapp Page Load Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/pageLoadBenchmark

✅ No regressions detected

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 10.08 KiB (0.18%)
  • ui: 2.73 KiB (0.03%)
  • common: 183.22 KiB (1.38%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 Bot commented May 4, 2026

Builds ready [9ed4229]
⚡ Performance Benchmarks (Total: 🟢 0 pass · 🟡 0 warn · 🔴 0 fail)

Baseline (latest main): 51036da | Date: 5/2/2026 | Pipeline: 25342605355 | Baseline logs

Interaction Benchmarks · Samples: 5

⚠️ Missing data: chrome/webpack/interactionUserActions, firefox/webpack/interactionUserActions

✅ No regressions detected

Startup Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/startupStandardHome, chrome/webpack/startupPowerUserHome, firefox/webpack/startupStandardHome, firefox/webpack/startupPowerUserHome

✅ No regressions detected

User Journey Benchmarks · Samples: 5 · mock API

⚠️ Missing data: chrome/webpack/userJourneyOnboardingImport, chrome/webpack/userJourneyOnboardingNew, chrome/webpack/userJourneyAssets, chrome/webpack/userJourneyAccountManagement, chrome/webpack/userJourneyTransactions, firefox/webpack/userJourneyOnboardingImport, firefox/webpack/userJourneyOnboardingNew, firefox/webpack/userJourneyAssets, firefox/webpack/userJourneyAccountManagement, firefox/webpack/userJourneyTransactions

✅ No regressions detected

Dapp Page Load Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/pageLoadBenchmark

✅ No regressions detected

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 10.08 KiB (0.18%)
  • ui: 2.73 KiB (0.03%)
  • common: 183.22 KiB (1.38%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 Bot commented May 4, 2026

Builds ready [b5a0c5e]
⚡ Performance Benchmarks (Total: 🟢 0 pass · 🟡 0 warn · 🔴 0 fail)

Baseline (latest main): 51036da | Date: 5/2/2026 | Pipeline: 25344034336 | Baseline logs

Interaction Benchmarks · Samples: 5

⚠️ Missing data: chrome/webpack/interactionUserActions, firefox/webpack/interactionUserActions

✅ No regressions detected

Startup Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/startupStandardHome, chrome/webpack/startupPowerUserHome, firefox/webpack/startupStandardHome, firefox/webpack/startupPowerUserHome

✅ No regressions detected

User Journey Benchmarks · Samples: 5 · mock API

⚠️ Missing data: chrome/webpack/userJourneyOnboardingImport, chrome/webpack/userJourneyOnboardingNew, chrome/webpack/userJourneyAssets, chrome/webpack/userJourneyAccountManagement, chrome/webpack/userJourneyTransactions, firefox/webpack/userJourneyOnboardingImport, firefox/webpack/userJourneyOnboardingNew, firefox/webpack/userJourneyAssets, firefox/webpack/userJourneyAccountManagement, firefox/webpack/userJourneyTransactions

✅ No regressions detected

Dapp Page Load Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/pageLoadBenchmark

✅ No regressions detected

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 10.08 KiB (0.18%)
  • ui: 3 KiB (0.03%)
  • common: 183.22 KiB (1.38%)

@metamaskbotv2
Copy link
Copy Markdown
Contributor

metamaskbotv2 Bot commented May 4, 2026

Builds ready [d4b8877] [reused from b5a0c5e]
⚡ Performance Benchmarks (Total: 🟢 0 pass · 🟡 0 warn · 🔴 0 fail)

Baseline (latest main): 51036da | Date: 5/2/2026 | Pipeline: 25345173263 | Baseline logs

Interaction Benchmarks · Samples: 5

⚠️ Missing data: chrome/webpack/interactionUserActions, firefox/webpack/interactionUserActions

✅ No regressions detected

Startup Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/startupStandardHome, chrome/webpack/startupPowerUserHome, firefox/webpack/startupStandardHome, firefox/webpack/startupPowerUserHome

✅ No regressions detected

User Journey Benchmarks · Samples: 5 · mock API

⚠️ Missing data: chrome/webpack/userJourneyOnboardingImport, chrome/webpack/userJourneyOnboardingNew, chrome/webpack/userJourneyAssets, chrome/webpack/userJourneyAccountManagement, chrome/webpack/userJourneyTransactions, firefox/webpack/userJourneyOnboardingImport, firefox/webpack/userJourneyOnboardingNew, firefox/webpack/userJourneyAssets, firefox/webpack/userJourneyAccountManagement, firefox/webpack/userJourneyTransactions

✅ No regressions detected

Dapp Page Load Benchmarks · Samples: 100

⚠️ Missing data: chrome/webpack/pageLoadBenchmark

✅ No regressions detected

Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 10.08 KiB (0.18%)
  • ui: 3 KiB (0.03%)
  • common: 183.22 KiB (1.38%)

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.

3 participants