Skip to content

refactor: migrate SmartTransactionController to @metamask/messenger#543

Merged
cryptodev-2s merged 6 commits intomainfrom
mikesposito/messenger
Oct 27, 2025
Merged

refactor: migrate SmartTransactionController to @metamask/messenger#543
cryptodev-2s merged 6 commits intomainfrom
mikesposito/messenger

Conversation

@mikesposito
Copy link
Copy Markdown
Member

@mikesposito mikesposito commented Sep 29, 2025

This PR migrates SmartTransactionController to @metamask/messenger instead of @metamask/base-controller. This is part of a larger effort to migrate all controllers to use @metamask/messenger.

Depends on MetaMask/core#6444 for StaticIntervalPollingController.


Note

Migrate SmartTransactionsController to the new @metamask/messenger, rename debug metadata, and bump related controller deps; update tests and TS module resolution.

  • Controller
    • Migrate from RestrictedMessenger/messagingSystem (from @metamask/base-controller) to new Messenger (@metamask/messenger).
    • Update SmartTransactionsControllerMessenger type and all call/publish/subscribe usages to messenger APIs.
    • Rename state metadata key from anonymous to includeInDebugSnapshot and update metadata-driven state derivation/tests.
    • Internal networking/state access updated to use messenger calls for NetworkController and TransactionController.
  • Tests
    • Rework test harness to use root Messenger, namespacing, and delegate for allowed actions/events.
    • Adjust metadata tests to use includeInDebugSnapshot.
  • Build/Config
    • Set TypeScript module/moduleResolution to Node16.
  • Dependencies
    • Add @metamask/messenger.
    • Bump @metamask/base-controller to ^9.0.0 and @metamask/polling-controller to ^15.0.0.
    • BREAKING: Update peer deps @metamask/network-controller to ^25.0.0 and @metamask/transaction-controller to ^61.0.0.

Written by Cursor Bugbot for commit 1e109ac. This will update automatically on new commits. Configure here.

@mikesposito mikesposito marked this pull request as ready for review September 29, 2025 12:29
@mikesposito mikesposito requested a review from a team as a code owner September 29, 2025 12:29
Copy link
Copy Markdown
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Looks good. Let me know when this is ready for final review.

@mikesposito
Copy link
Copy Markdown
Member Author

@metamaskbot publish-preview

@github-actions
Copy link
Copy Markdown
Contributor

A preview build for this branch has been published.

You can configure your project to use the preview build with this identifier:

npm:@metamask-previews/smart-transactions-controller@19.2.1-preview-54c655a

See these instructions for more information about preview builds.

@mikesposito
Copy link
Copy Markdown
Member Author

@metamaskbot publish-preview

@github-actions
Copy link
Copy Markdown
Contributor

A preview build for this branch has been published.

You can configure your project to use the preview build with this identifier:

npm:@metamask-previews/smart-transactions-controller@19.2.1-preview-520a56d

See these instructions for more information about preview builds.

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Oct 27, 2025

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Oct 27, 2025

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
Action Severity Alert  (click "▶" to expand/collapse)
Warn Low
@metamask/transaction-controller@61.0.0 is a AI-detected potential code anomaly.

Notes: The code performs straightforward signature verification using ethers.js, returning true when the recovered signer matches the provided publicKey. While generally safe, the silent catch and potential mismatch between data formatting and signing process should be addressed to avoid silent failures. Overall, a benign utility with moderate input-format sensitivity.

Confidence: 0.75

Severity: 0.50

From: package.jsonnpm/@metamask/transaction-controller@61.0.0

ℹ Read more on: This package | This alert | What is an AI-detected potential code anomaly?

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: An AI system found a low-risk anomaly in this package. It may still be fine to use, but you should check that it is safe before proceeding.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/@metamask/transaction-controller@61.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.

View full report

Comment thread CHANGELOG.md
@cryptodev-2s cryptodev-2s requested a review from Gudahtt October 27, 2025 20:39
Copy link
Copy Markdown
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@cryptodev-2s cryptodev-2s merged commit 93b16b5 into main Oct 27, 2025
18 checks passed
@cryptodev-2s cryptodev-2s deleted the mikesposito/messenger branch October 27, 2025 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace RestrictedMessenger with delegated Messenger

4 participants