Skip to content

feat: [MUSD-445] complete money account upgrade controller flow#30002

Merged
Jwhiles merged 7 commits into
mainfrom
MUSD-445
May 14, 2026
Merged

feat: [MUSD-445] complete money account upgrade controller flow#30002
Jwhiles merged 7 commits into
mainfrom
MUSD-445

Conversation

@Jwhiles

@Jwhiles Jwhiles commented May 11, 2026

Copy link
Copy Markdown
Contributor

Description

This PR upgrades to the final version of the money account upgrade controller - which can in theory run through the entire chomp upgrade flow.

Things that we've changed in this PR in addition to bumping the package

  1. Updated the config that is passed into the upgrade controller
  2. Added a check which ensures the monad network is enabled before we start the upgrade process. This is necessary, because monad is enabled by default

TODO

  1. This PR builds on @MoMannn's PR chore: add monad mUSD #29897 - and it should be merged first.
  2. This PR requires us to change the vault config feature flag before it will function correctly.
  3. Chomp returns a 500 on the final step of the upgrade process. We need to figure out why this is happening and fix it
  4. We need to merge and publish this core pr and update the preview packages that are currently used in this branch to the real published updates.

Changelog

CHANGELOG entry: Update to final version of money account upgrade controller

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

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
Touches money account upgrade bootstrap logic and programmatically adds missing networks via NetworkController.addNetwork, which can affect upgrade flow behavior and user network state if misconfigured. Also bumps to @metamask/money-account-upgrade-controller@^2.0.0 with related dependency updates.

Overview
Updates moneyAccountUpgradeControllerInit to initialize MoneyAccountUpgradeController using the Money Account vault config (chainId + boring vault address) instead of deriving addresses from CHOMP service details / delegator environment.

Adds a bootstrap guard (ensureChainConfigured) that checks whether the vault chain is present in the user’s NetworkController config and, if missing, auto-adds it from PopularList (or logs an error and aborts if unsupported). Tests are updated to cover the new init parameters, missing vault config handling, and the chain auto-add behavior.

Expands the controller messenger permissions for the full upgrade flow (delegation + additional CHOMP actions) and bumps @metamask/money-account-upgrade-controller to ^2.0.0 plus related dependency versions in package.json/yarn.lock.

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

@Jwhiles Jwhiles requested a review from a team as a code owner May 11, 2026 19:37
@github-actions

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.

@Jwhiles Jwhiles changed the title Musd 445 feat: [MUSD-445] complete money account upgrade controller flow May 11, 2026
@socket-security

socket-security Bot commented May 11, 2026

Copy link
Copy Markdown

@Jwhiles Jwhiles changed the base branch from main to chore--add-monad-mUSD May 12, 2026 15:09
@Jwhiles Jwhiles requested review from a team as code owners May 12, 2026 15:09
@Jwhiles Jwhiles changed the base branch from chore--add-monad-mUSD to main May 12, 2026 15:10
Matt561
Matt561 previously approved these changes May 12, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

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 9dd3275. Configure here.


const popularEntry = PopularList.find(
(network) => toHex(network.chainId as string) === chainId,
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Redundant toHex on already-hex PopularList chainId values

Low Severity

The PopularList entries already store chainId as hex strings (produced by toHex() at definition time, e.g. toHex('143')'0x8f'). Calling toHex(network.chainId as string) applies the conversion a second time on an already-hex value. A direct comparison like network.chainId === chainId is clearer and avoids relying on toHex being idempotent for hex string inputs, which is an undocumented assumption about the @metamask/controller-utils implementation.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9dd3275. Configure here.

@Matt561 Matt561 self-requested a review May 13, 2026 19:30
@Jwhiles Jwhiles enabled auto-merge May 13, 2026 19:31
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeSwap, SmokeStake, SmokeWalletPlatform, SmokeMoney, SmokePerps, SmokeMultiChainAPI, SmokePredictions, SmokeSeedlessOnboarding, SmokeBrowser, SmokeSnaps
  • Selected Performance tags: @PerformanceAccountList, @PerformanceOnboarding, @PerformanceLogin, @PerformanceSwaps, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePredict, @PerformancePreps
  • Risk Level: high
  • AI Confidence: 100%
click to see 🤖 AI reasoning details

E2E Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/money-account-upgrade-controller. Running all tests.

Performance Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/money-account-upgrade-controller. Running all tests.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@Jwhiles Jwhiles added this pull request to the merge queue May 14, 2026
Merged via the queue into main with commit b1c3a75 May 14, 2026
114 of 116 checks passed
@Jwhiles Jwhiles deleted the MUSD-445 branch May 14, 2026 13:28
@github-actions github-actions Bot locked and limited conversation to collaborators May 14, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.78.0 Issue or pull request that will be included in release 7.78.0 label May 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.78.0 Issue or pull request that will be included in release 7.78.0 size-M team-earn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants