Repository navigation
chore: bump @metamask/wallet to ^21.0.0 and drop obsolete resolutions (3/3) - #39132
Conversation
|
Warning MetaMask internal reviewing guidelines:
|
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
4c8383d to
3d16018
Compare
Smart E2E Test SelectionSelected E2E tags: ALL AI Confidence: 100 E2E reasoningExpand to readThe 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. |
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).
faef1d6 to
d4199fa
Compare
|



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/walletfrom^20.0.0to^21.0.0and removes thepackage.jsonresolutions that only existed because the wallet was behind.Why
TransactionControllercallSentinelApiService:simulateTransactions. Without that, transaction-controller 73 throws on every simulation, which is why it was pinned back to72.3.0in cp-8.20.0 fix: RevertTransactionControllerversion back to72.3#39024. This replaces the wallet-18 patch in fix(engine): delegate Sentinel simulation to TransactionController #38978.NetworkEnablementController7.1.0, which mobile constructed itself (a patched 5.4.1).Changes
networkEnablementControllerInit, its messenger and the 5.4.1 patch. The patch only added Robinhood (0x1237), which is built in from 5.5.0.wallet.init()callsNetworkEnablementController.init(), which readsMultichainNetworkController:getState. Mobile registersMultichainNetworkControllerafter the wallet, so that first call fails silently (Promise.allSettled).Enginerunsinit()again once it exists, as it did before.ConfigRegistryController. The networks integration harness gets aConfigRegistryController:getStatestub.Resolutions
@metamask/transaction-controller72.3.0^73, so all resolve to one copy of 73.1.2@metamask/subscription-controller15.0.0^15.2.0@metamask/remote-feature-flag-controller^6.1.1^7@metamask/seedless-onboarding-controller12.0.0@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)^7.1.0Dependencies 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 andutilseach resolve to one version.jest.config.jsadds packages that are now ESM-only to the transform list:byte-utils,error-utils,node-utilsandtype-utils(split out of@metamask/utils12.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:
@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:failoverUrlsremoved 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
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)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
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/walletto^21.0.0and aligns dependencies so transaction-controller^73can run simulations viaSentinelApiService(dropping the72.3.0resolution) while refreshing several controller/service versions to match the wallet stack.NetworkEnablementControlleris 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.0from the wallet.Engineobtains the controller from the wallet and callsinit()again afterMultichainNetworkControlleris registered, since the firstwallet.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 forConfigRegistryController:getStateused 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.