refactor(engine): wire TransactionController into @metamask/wallet init#32937
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
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. |
e9bb5ba to
359a528
Compare
f6d80b9 to
8fc03e3
Compare
d8fdad5 to
114da02
Compare
…tState arg Remove the `getState` parameter from `getTransactionControllerInstanceOptions`, `setupTransactionControllerListeners`, and `initializeWallet` — and from `isEIP7702GasFeeTokensEnabled`'s private parameter bag. All call sites were already passing `() => store.getState()`; import `store` directly instead. Aligns with the pattern used by the other wallet-init instance-option helpers (e.g. `remote-feature-flag-controller`).
…C 69.0.0) Forward-port the getSavedGasFees hook added to transaction-controller-init.ts on main (TC 69.0.0) into our wallet-init instance-options equivalent. Reads advancedGasFee preferences from PreferencesController state and returns the saved fee tier/values for the transaction account + chain, allowing TC to apply user-saved gas fee preferences to non-internal transactions.
aac098f to
78de67e
Compare
| "@metamask/superstruct": "^3.2.1", | ||
| "@metamask/swappable-obj-proxy": "^2.1.0", | ||
| "@metamask/transaction-controller": "^69.0.0", | ||
| "@metamask/transaction-controller": "^68.4.0", |
There was a problem hiding this comment.
Is this downgrade intentional?
- Bump @metamask/wallet ^7.0.0 → ^7.0.1 wallet@7.0.1 natively requires @metamask/transaction-controller@^69.0.0 so the resolution override is no longer needed. - Remove @metamask/transaction-controller resolution pin (69.0.0) TC version is managed by main/wallet; not ours to override. - Bump @metamask/transaction-controller direct dep ^68.4.0 → ^69.0.0 Aligns our declaration with what main already has. - Bump @metamask/connectivity-controller ^0.2.0 → ^0.3.0 wallet@7.0.1 requires ^0.3.0; deduplicated the nested copy.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ 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 3e739cb. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #32937 +/- ##
==========================================
+ Coverage 84.34% 84.37% +0.03%
==========================================
Files 6115 6132 +17
Lines 163209 163725 +516
Branches 39822 39924 +102
==========================================
+ Hits 137651 138143 +492
- Misses 16047 16070 +23
- Partials 9511 9512 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
⚡ Performance Test Results
❌ 1 test failed · 2 tests · 1 device 📱 Devices tested (1)Android: Google Pixel 8 Pro (v14.0) ❌ Failed Tests (1)@swap-bridge-dev-team
✅ Passed Tests (1)
Branch: |



Description
Moves
TransactionControllerconstruction from the legacy Engine init registry into the@metamask/wallet-ownedwallet-initflow, mirroring extension PR #43182.@metamask/walletnow owns the TC's controller messenger and persisted statewallet.getInstance('TransactionController')instead of the legacymessengerClientsByNameregistrygetState()+selectShouldUseSmartTransaction,isAutomaticGasFeeUpdateEnabled, metrics / notification / money-account event handlers@metamask/wallet6→7,@metamask/transaction-controllerto 68.4.0,@metamask/messengerto 2.0.0Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
N/A
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
High Risk
This changes how the transaction lifecycle controller is constructed and accessed on the critical send/confirm/publish path; regressions could break submission, smart transactions, or metrics without obvious UI failures.
Overview
TransactionController is no longer created through the Engine’s
MessengerClientInitregistry. Construction and persisted state move to@metamask/wallet, with mobile supplyingtransactionControllerinstance options andsetupTransactionControllerListenersduringinitializeWallet.Engine drops
TransactionControllerfrom the init map and messenger registry; it resolves the controller viathis.#wallet.getInstance('TransactionController')instead ofmessengerClientsByName. The oldTransactionControllerInitmodule and its large init test file are removed in favor ofwallet-init/instance-options/transaction-controllerand focused unit tests.Mobile-specific behavior is preserved in the new builders: publish hooks (via a messenger-backed
getTransactionControllerproxy), gas-fee helpers, EIP-7702 token gating, and metrics / notification / money-account event subscriptions. The init messenger lives underwallet-init/messengers(controller messenger wiring removed from Engine messengers index), with extra delegated actions for nonce lock and atomic batch support.Dependencies:
@metamask/wallet^6→^7.0.1,@metamask/connectivity-controller^0.3.0.Reviewed by Cursor Bugbot for commit 6067326. Bugbot is set up for automated code reviews on this repo. Configure here.