Skip to content

chore: bump @metamask/wallet to ^21.0.0 and drop obsolete resolutions (3/3) - #39132

Merged
OGPoyraz merged 2 commits into
mainfrom
chore/wallet-21
Nov 10, 2026
Merged

OGPoyraz merged 2 commits into
mainfrom
chore/wallet-21

Conversation

@OGPoyraz

@OGPoyraz OGPoyraz commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Description

Stack (merge in order): 1/3 #39130 (wallet 19) → 2/3 #39131 (wallet 20) → 3/3 #39132 (wallet 21)

Based on chore/wallet-20; this diff shows only the wallet 21 step.

Bumps @metamask/wallet from ^20.0.0 to ^21.0.0 and removes the package.json resolutions that only existed because the wallet was behind.

Why

Changes

  • Remove networkEnablementControllerInit, its messenger and the 5.4.1 patch. The patch only added Robinhood (0x1237), which is built in from 5.5.0.
  • Startup order: wallet.init() calls NetworkEnablementController.init(), which reads MultichainNetworkController:getState. Mobile registers MultichainNetworkController after the wallet, so that first call fails silently (Promise.allSettled). Engine runs init() again once it exists, as it did before.
  • NetworkEnablementController 6.0+: popular networks are also taken from ConfigRegistryController. The networks integration harness gets a ConfigRegistryController:getState stub.

Resolutions

Resolution Before After
@metamask/transaction-controller 72.3.0 removed. Every dependent asks for ^73, so all resolve to one copy of 73.1.2
@metamask/subscription-controller 15.0.0 removed, dependency ^15.2.0
@metamask/remote-feature-flag-controller ^6.1.1 removed. It forced 6.1.1 onto 16 packages that ask for ^7
@metamask/seedless-onboarding-controller 12.0.0 removed
@metamask/analytics-controller ^4.1.0 ^4.2.0
@metamask/utils ^12.0.0 ^12.0.1
@metamask/network-enablement-controller@npm:^5.4.1 (patch) patched 5.4.1 removed, dependency ^7.1.0

Dependencies are bumped so the app shares the wallet's copies: address-book-controller, claims-controller, shield-controller, multichain-network-controller, network-connection-banner-controller, signature-controller, gator-permissions-controller, eip-5792-middleware, bridge-controller, bridge-status-controller, smart-transactions-controller, money-account-utils and profile-metrics-controller. In yarn.lock, transaction-controller, analytics-controller, subscription-controller, NetworkEnablementController, remote-feature-flag-controller and utils each resolve to one version.

jest.config.js adds packages that are now ESM-only to the transform list: byte-utils, error-utils, node-utils and type-utils (split out of @metamask/utils 12.0.1), plus remote-feature-flag-controller 7, eip-5792-middleware 4, gator-permissions-controller 6 and network-connection-banner-controller 1.

Known follow-ups:

  • chomp-api-service (6 and 7) and money-account-upgrade-controller (5 and 6) still have two copies each, because subscription-controller 15.1.1+ needs the newer majors. The four actions it calls exist in both.
  • transaction-controller 73.1.2 and gas-fee-controller 27.1.1 ask for @metamask/network-controller ^38.0.0, but mobile still holds network-controller at 37.1.1 through its resolution. Neither release has source changes (dependency bumps only), so nothing uses network-controller 38 yet. This goes away with the network-controller 38 upgrade (breaking: failoverUrls removed from RPC endpoints, RPC failover on by default), which should be its own PR.

Changelog

CHANGELOG entry: Fixed transaction simulations failing, which blocked MM Pay quotes such as Predict withdrawals to a Money Account

Related issues

Refs: #39024, #38978 (superseded), #38688, #39126 (same change as a single PR)

Manual testing steps

Feature: Wallet 21

  Scenario: transaction simulation works
    Given the user is on a send or swap confirmation
    When the confirmation loads
    Then simulated balance changes are shown instead of a simulation error

  Scenario: MM Pay quote for a Predict withdrawal
    Given the user has a Predict balance and a Money account
    When the user opens the Predict withdraw confirmation and selects Money account
    Then the bridge fee row is shown with a quote
    And the "payment route isn't available" alert is not shown

  Scenario: network enablement
    Given the user opens the network selector
    When the user enables all popular networks or adds a custom network
    Then the enabled networks update as before, including Robinhood Chain

Screenshots/Recordings

N/A: dependency upgrade and Engine wiring only, no UI changes.

Before

N/A

After

N/A

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 wallet startup order, transaction simulation, and network enablement wiring across the Engine—behavior should match before but mis-timed init could affect enabled networks or sims.

Overview
Upgrades @metamask/wallet to ^21.0.0 and aligns dependencies so transaction-controller ^73 can run simulations via SentinelApiService (dropping the 72.3.0 resolution) while refreshing several controller/service versions to match the wallet stack.

NetworkEnablementController is no longer constructed in mobile: local init, messenger wiring, tests, and the 5.4.1 Robinhood patch are removed in favor of @metamask/network-enablement-controller ^7.1.0 from the wallet. Engine obtains the controller from the wallet and calls init() again after MultichainNetworkController is registered, since the first wallet.init() cannot read multichain state yet.

Cleanup includes trimmed yarn resolutions, jest transforms for new ESM-only @metamask/* packages from utils 12.0.1, and integration harness stubs for ConfigRegistryController:getState used by network enablement 6.0+.

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

@github-actions github-actions Bot added size-M pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. labels Nov 6, 2026
@metamask-ci metamask-ci Bot added the team-confirmations Push issues to confirmations team label Nov 6, 2026
@socket-security

socket-security Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Warning

MetaMask internal reviewing guidelines:

  • Do not ignore-all
  • Each alert has instructions on how to review if you don't know what it means. If lost, ask your Security Liaison or the supply-chain group
  • Copy-paste ignore lines for specific packages or a group of one kind with a note on what research you did to deem it safe.
    @SocketSecurity ignore npm/PACKAGE@VERSION
Priority Alert  (click "▶" to expand/collapse) Action
Low priority
Network access: npm @metamask/subscription-controller in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: package.json → npm/@metamask/subscription-controller@15.2.0

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@metamask/subscription-controller@15.2.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn
Low priority
Network access: npm @metamask/chomp-api-service in module globalThis["fetch"]

Module: globalThis["fetch"]

Location: Package overview

From: package.json → npm/@metamask/subscription-controller@15.2.0 → npm/@metamask/chomp-api-service@7.0.0

ℹ Read more on: This package | This alert | What is network access?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@metamask/chomp-api-service@7.0.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn

View full report

@OGPoyraz
OGPoyraz added this pull request to stack #39139 November 6, 2026 15:28
@OGPoyraz
OGPoyraz marked this pull request as ready for review November 9, 2026 08:08
@OGPoyraz
OGPoyraz requested review from a team as code owners November 9, 2026 08:08
tommasini
tommasini previously approved these changes Nov 9, 2026
dawnseeker8
dawnseeker8 previously approved these changes Nov 10, 2026

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

LGTM

Base automatically changed from chore/wallet-20 to main November 10, 2026 07:24
@metamask-ci

metamask-ci Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

PR template — items to address before "Ready for review"

Warnings — informational, address before merging:

  • Pre-merge author checklist has unchecked items (e.g. "I've applied the right labels on the PR (see labeling guidelines). Not required for external contributors."). Every box must be consciously checked — see docs/readme/ready-for-review.md.

See docs/readme/ready-for-review.md for the full Definition of Ready for Review.

@OGPoyraz
OGPoyraz dismissed stale reviews from dawnseeker8 and tommasini via 3d16018 November 10, 2026 07:45
@OGPoyraz OGPoyraz removed the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Smart E2E Test Selection

Selected E2E tags: ALL

AI Confidence: 100

E2E reasoning

Expand to read

The hard rule seed selected ALL tags because about 39 @MetaMask controller packages changed in package.json and yarn.lock. The diffs confirm the risk. Engine.ts and wallet-init/initialization.ts changed how NetworkEnablementController is created: the custom init was removed, the controller now comes from the wallet instance, and init() is re-run after MultichainNetworkController is registered. The controller's yarn patch also changed. This is the core startup path and network state, so it can affect every flow, including network selection, multichain permissions, confirmations, swaps, perps, seedless onboarding and snaps. I therefore kept the full smoke set, with all dependent tags included.

View run

dan437
dan437 previously approved these changes Nov 10, 2026
tommasini
tommasini previously approved these changes Nov 10, 2026
Wallet 21 constructs NetworkEnablementController (7.1.0) and delegates
SentinelApiService:simulateTransactions to TransactionController, so
transaction-controller ^73 works again.

- Remove the mobile NetworkEnablementController init and messenger, and
  the 5.4.1 Robinhood patch (built in since 5.5.0). Engine re-runs
  NetworkEnablementController.init() once MultichainNetworkController is
  registered.
- Bump the transaction-controller resolution to ^73.1.1 and remove the
  subscription-controller, remote-feature-flag-controller and
  seedless-onboarding-controller resolutions.
- Bump dependents so the app shares the wallet's controller copies, and
  add the newly ESM-only packages to the Jest transform list.
Every dependent now requests ^73, so the resolution no longer keeps a
single copy; it only held the version at 73.1.1. Removing it resolves
transaction-controller to 73.1.2 and gas-fee-controller to 27.1.1 (both
dependency-range bumps only, no source changes).
@OGPoyraz
OGPoyraz dismissed stale reviews from tommasini and dan437 via d4199fa November 10, 2026 11:08
@sonarqubecloud

Copy link
Copy Markdown

@OGPoyraz
OGPoyraz added this pull request to the merge queue Nov 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 10, 2026
@OGPoyraz
OGPoyraz added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 5a1ee3b Nov 10, 2026
209 of 211 checks passed
@OGPoyraz
OGPoyraz deleted the chore/wallet-21 branch November 10, 2026 13:53
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 10, 2026
@metamask-ci metamask-ci Bot added the release-8.21.0 Issue or pull request that will be included in release 8.21.0 label Nov 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants