Skip to content

chore: add missing Infura networks#8680

Merged
mikesposito merged 8 commits intomainfrom
mikesposito/chore/add-missing-infura-networks
May 6, 2026
Merged

chore: add missing Infura networks#8680
mikesposito merged 8 commits intomainfrom
mikesposito/chore/add-missing-infura-networks

Conversation

@mikesposito
Copy link
Copy Markdown
Member

@mikesposito mikesposito commented May 4, 2026

Explanation

Adding networks to controller-utils that are included in the dynamic registry but were missing from the package Infura networks list. This addition is necessary to get passed the validation checks in NetworkController when adding these networks from the dynamic registry (https://client-config.api.cx.metamask.io/v1/config/networks).

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Medium Risk
Moderate risk because it expands the set of built-in Infura networks (chain IDs, tickers, explorer URLs, nicknames), which can affect network validation and default network configuration behavior for consumers.

Overview
Adds missing Infura-supported mainnet networks to controller-utils by extending InfuraNetworkType and related constants (BuiltInNetworkName, ChainId, NetworksTicker, BlockExplorerUrl, NetworkNickname) for megaeth-mainnet, monad-mainnet, avalanche-mainnet, and zksync-mainnet.

Updates NetworkController test snapshots/expectations so these networks are included in default state/config and corresponding Infura network clients, and records the change in the controller-utils changelog.

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

@mikesposito mikesposito requested a review from a team as a code owner May 4, 2026 15:53
Comment thread packages/controller-utils/src/types.ts Outdated
Comment thread packages/controller-utils/src/types.ts Outdated
@mikesposito mikesposito requested a review from a team as a code owner May 4, 2026 16:05
Comment thread packages/controller-utils/src/types.ts Outdated
@mikesposito mikesposito marked this pull request as draft May 4, 2026 16:25
@mikesposito mikesposito marked this pull request as ready for review May 4, 2026 16:41
Copy link
Copy Markdown
Contributor

@wantedsystem wantedsystem left a comment

Choose a reason for hiding this comment

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

LGTM

@mikesposito mikesposito enabled auto-merge May 4, 2026 16:46
@mikesposito
Copy link
Copy Markdown
Member Author

@metamaskbot publish-previews

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

Preview builds have been published. Learn how to use preview builds in other projects.

Expand for full list of packages and versions.
@metamask-previews/account-tree-controller@7.2.0-preview-d6324f95d
@metamask-previews/accounts-controller@38.0.0-preview-d6324f95d
@metamask-previews/address-book-controller@7.1.1-preview-d6324f95d
@metamask-previews/ai-controllers@0.6.3-preview-d6324f95d
@metamask-previews/analytics-controller@1.0.1-preview-d6324f95d
@metamask-previews/analytics-data-regulation-controller@0.0.0-preview-d6324f95d
@metamask-previews/announcement-controller@8.1.0-preview-d6324f95d
@metamask-previews/app-metadata-controller@2.0.1-preview-d6324f95d
@metamask-previews/approval-controller@9.0.1-preview-d6324f95d
@metamask-previews/assets-controller@6.3.0-preview-d6324f95d
@metamask-previews/assets-controllers@105.1.0-preview-d6324f95d
@metamask-previews/authenticated-user-storage@1.0.0-preview-d6324f95d
@metamask-previews/base-controller@9.1.0-preview-d6324f95d
@metamask-previews/base-data-service@0.1.1-preview-d6324f95d
@metamask-previews/bridge-controller@71.0.0-preview-d6324f95d
@metamask-previews/bridge-status-controller@71.1.0-preview-d6324f95d
@metamask-previews/build-utils@3.0.4-preview-d6324f95d
@metamask-previews/chain-agnostic-permission@1.5.0-preview-d6324f95d
@metamask-previews/chomp-api-service@3.0.0-preview-d6324f95d
@metamask-previews/claims-controller@0.5.0-preview-d6324f95d
@metamask-previews/client-controller@1.0.1-preview-d6324f95d
@metamask-previews/compliance-controller@2.0.0-preview-d6324f95d
@metamask-previews/composable-controller@12.0.1-preview-d6324f95d
@metamask-previews/config-registry-controller@0.3.0-preview-d6324f95d
@metamask-previews/connectivity-controller@0.2.0-preview-d6324f95d
@metamask-previews/controller-utils@11.20.0-preview-d6324f95d
@metamask-previews/core-backend@6.2.1-preview-d6324f95d
@metamask-previews/delegation-controller@3.0.0-preview-d6324f95d
@metamask-previews/earn-controller@12.1.0-preview-d6324f95d
@metamask-previews/eip-5792-middleware@3.0.3-preview-d6324f95d
@metamask-previews/eip-7702-internal-rpc-middleware@0.1.0-preview-d6324f95d
@metamask-previews/eip1193-permission-middleware@2.0.0-preview-d6324f95d
@metamask-previews/ens-controller@19.1.1-preview-d6324f95d
@metamask-previews/eth-block-tracker@15.0.1-preview-d6324f95d
@metamask-previews/eth-json-rpc-middleware@23.1.3-preview-d6324f95d
@metamask-previews/eth-json-rpc-provider@6.0.1-preview-d6324f95d
@metamask-previews/foundryup@1.0.1-preview-d6324f95d
@metamask-previews/gas-fee-controller@26.1.1-preview-d6324f95d
@metamask-previews/gator-permissions-controller@4.0.0-preview-d6324f95d
@metamask-previews/geolocation-controller@0.1.2-preview-d6324f95d
@metamask-previews/json-rpc-engine@10.3.0-preview-d6324f95d
@metamask-previews/json-rpc-middleware-stream@8.0.8-preview-d6324f95d
@metamask-previews/keyring-controller@25.4.0-preview-d6324f95d
@metamask-previews/logging-controller@8.0.1-preview-d6324f95d
@metamask-previews/message-manager@14.1.1-preview-d6324f95d
@metamask-previews/messenger@1.2.0-preview-d6324f95d
@metamask-previews/messenger-cli@0.2.0-preview-d6324f95d
@metamask-previews/money-account-balance-service@0.2.0-preview-d6324f95d
@metamask-previews/money-account-controller@0.2.0-preview-d6324f95d
@metamask-previews/money-account-upgrade-controller@1.3.0-preview-d6324f95d
@metamask-previews/multichain-account-service@8.0.1-preview-d6324f95d
@metamask-previews/multichain-api-middleware@3.0.0-preview-d6324f95d
@metamask-previews/multichain-network-controller@3.1.0-preview-d6324f95d
@metamask-previews/multichain-transactions-controller@7.1.0-preview-d6324f95d
@metamask-previews/name-controller@9.1.1-preview-d6324f95d
@metamask-previews/network-controller@30.1.0-preview-d6324f95d
@metamask-previews/network-enablement-controller@5.1.0-preview-d6324f95d
@metamask-previews/notification-services-controller@23.1.0-preview-d6324f95d
@metamask-previews/passkey-controller@2.0.0-preview-d6324f95d
@metamask-previews/permission-controller@13.0.0-preview-d6324f95d
@metamask-previews/permission-log-controller@5.1.0-preview-d6324f95d
@metamask-previews/perps-controller@5.0.0-preview-d6324f95d
@metamask-previews/phishing-controller@17.1.1-preview-d6324f95d
@metamask-previews/polling-controller@16.0.4-preview-d6324f95d
@metamask-previews/preferences-controller@23.1.0-preview-d6324f95d
@metamask-previews/profile-metrics-controller@3.1.3-preview-d6324f95d
@metamask-previews/profile-sync-controller@28.0.2-preview-d6324f95d
@metamask-previews/ramps-controller@13.2.0-preview-d6324f95d
@metamask-previews/rate-limit-controller@7.0.1-preview-d6324f95d
@metamask-previews/react-data-query@0.2.0-preview-d6324f95d
@metamask-previews/remote-feature-flag-controller@4.2.0-preview-d6324f95d
@metamask-previews/sample-controllers@4.0.4-preview-d6324f95d
@metamask-previews/seedless-onboarding-controller@9.1.0-preview-d6324f95d
@metamask-previews/selected-network-controller@26.1.1-preview-d6324f95d
@metamask-previews/shield-controller@5.1.1-preview-d6324f95d
@metamask-previews/signature-controller@39.2.0-preview-d6324f95d
@metamask-previews/snap-account-service@0.0.0-preview-d6324f95d
@metamask-previews/social-controllers@2.2.0-preview-d6324f95d
@metamask-previews/storage-service@1.0.1-preview-d6324f95d
@metamask-previews/subscription-controller@6.1.2-preview-d6324f95d
@metamask-previews/transaction-controller@65.0.0-preview-d6324f95d
@metamask-previews/transaction-pay-controller@21.0.0-preview-d6324f95d
@metamask-previews/user-operation-controller@41.2.0-preview-d6324f95d

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 bd05e8d. Configure here.

'monad-mainnet': 'monad-mainnet',
'megaeth-mainnet': 'megaeth-mainnet',
'avalanche-mainnet': 'avalanche-mainnet',
'zksync-mainnet': 'zksync-mainnet',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

BUILT_IN_NETWORKS missing new Infura network entries

Medium Severity

Four new networks (monad-mainnet, megaeth-mainnet, avalanche-mainnet, zksync-mainnet) are added to InfuraNetworkType but the publicly exported BUILT_IN_NETWORKS constant in constants.ts is not updated with corresponding entries. This object is documented as "Map of all build-in Infura networks" and every previous Infura network has an entry. The test helper in packages/network-controller/tests/network-client/helpers.ts accesses BUILT_IN_NETWORKS[infuraNetwork] where infuraNetwork is typed as InfuraNetworkType — passing any of the new networks would return undefined, causing a runtime crash when accessing .chainId or .ticker.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bd05e8d. Configure here.

@mikesposito mikesposito added this pull request to the merge queue May 6, 2026
Merged via the queue into main with commit a4afaa1 May 6, 2026
366 checks passed
@mikesposito mikesposito deleted the mikesposito/chore/add-missing-infura-networks branch May 6, 2026 08:06
@mikesposito mikesposito mentioned this pull request May 6, 2026
4 tasks
marcopeereboom pushed a commit to marcopeereboom/core that referenced this pull request May 6, 2026
## Explanation

<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?
* Are there any changes whose purpose might not obvious to those
unfamiliar with the domain?
* If your primary goal was to update one package but you found you had
to update another one along the way, why did you do so?
* If you had to upgrade a dependency, why did you do so?
-->
Additional Infura networks have been added in MetaMask#8680, but the
`BUILT_IN_NETWORKS` object was missed. This object is not used outside
of tests in `core`, though it’s exported by `controller-utils` and used
by clients. This PR adds the networks to `BUILT_IN_NETWORKS` as well

## References

<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?

For example:

* Fixes #12345
* Related to #67890
-->

## Checklist

- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [ ] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk: adds new entries to exported network constants and updates
the changelog; behavior changes only for consumers referencing these
newly supported networks.
> 
> **Overview**
> Adds the previously-missing Infura mainnet networks (`monad-mainnet`,
`zksync-mainnet`, `megaeth-mainnet`, `avalanche-mainnet`) to
`BUILT_IN_NETWORKS`, including their `chainId`, `ticker`, and
`blockExplorerUrl` mappings.
> 
> Updates the `@metamask/controller-utils` changelog entry to reflect
the expanded `BUILT_IN_NETWORKS` coverage.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
4cb1018. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

5 participants