feat!: wire NetworkEnablementController to ConfigRegistryController#9611
Merged
mikesposito merged 7 commits intoJul 23, 2026
Merged
Conversation
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
mikesposito
commented
Jul 22, 2026
Comment on lines
-1477
to
-1483
| const { controller, messenger } = setupController(); | ||
|
|
||
| // Mock the network configurations to include Bitcoin | ||
| jest | ||
| .spyOn(messenger, 'call') | ||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| .mockImplementation((actionType: string, ..._args: unknown[]): any => { |
Member
Author
There was a problem hiding this comment.
These mocks were a bit messy. Mocking the entire messenger.call method has two big drawbacks:
- Each new messenger call introduced breaks all of these test cases using this mocking pattern
- This test case is forced to mock all required messenger actions, even if it only needs one of them
mikesposito
commented
Jul 22, 2026
mikesposito
force-pushed
the
me/network-enablement-controller-dynamic-registry
branch
from
July 23, 2026 08:47
30eb4da to
e61ffda
Compare
mikesposito
marked this pull request as ready for review
July 23, 2026 08:48
mikesposito
temporarily deployed
to
default-branch
July 23, 2026 08:48 — with
GitHub Actions
Inactive
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 e61ffda. Configure here.
gabrieledm
reviewed
Jul 23, 2026
Member
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
7 tasks
bergarces
approved these changes
Jul 23, 2026
mikesposito
deleted the
me/network-enablement-controller-dynamic-registry
branch
July 23, 2026 13:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Explanation
NetworkEnablementControlleruses bundled constants to establish which networks are "popular". We want to keep using those constants as fallback, and change primary source toConfigRegistryController.References
Checklist
Note
Medium Risk
Changes which networks are treated as popular and auto-enabled, and requires clients to wire a new messenger action; misconfiguration or stale registry data could shift user-visible network filters.
Overview
Popular EVM network detection no longer relies only on bundled
POPULAR_NETWORKS.NetworkEnablementControllerunions that list with EVM chains fromConfigRegistryControllerthat are featured, active, and non-testnet, and uses the combined set forenableAllPopularNetworks, popular-networks mode, network-added handling, andlistPopularEvmNetworks.This is a breaking integration change: the controller messenger must expose
ConfigRegistryController:getState, and the package adds@metamask/config-registry-controlleras a dependency (README graph and tsconfig references updated). The standaloneisPopularNetworkhelper is removed in favor of the controller’s private#getPopularEvmChainIds/#getRegistryPopularEvmChainIdslogic.Tests are refactored to mock
ConfigRegistryController:getStateand cover registry-driven enablement and exclusion when registry entries are not “popular.”Reviewed by Cursor Bugbot for commit ba9ebe2. Bugbot is set up for automated code reviews on this repo. Configure here.