Skip to content

Conversation

@salimtb
Copy link
Contributor

@salimtb salimtb commented Oct 27, 2025

Explanation

This PR adds support for five additional networks to MetaMask Core's Infura network types: Arbitrum, BSC (Binance Smart Chain), Optimism, Polygon, and Sei. These networks are now available as built-in Infura networks across the MetaMask ecosystem.

Changes Made:

Core Network Definitions (@metamask/controller-utils):

  • Added network identifiers to InfuraNetworkType and BUILT_IN_NETWORKS
  • Updated BuiltInNetworkName enum with new entries
  • Added chain IDs: Arbitrum (0xa4b1), BSC (0x38), Optimism (0xa), Polygon (0x89), Sei (0x531)
  • Added network tickers: ETG, BNB, ETH, POL, SEI
  • Added block explorer URLs and network nicknames

Token Detection Support (@metamask/assets-controllers):

  • Extended TokenDetectionController to support token tracking on these networks
  • Users can now automatically detect tokens on these additional chains

Network Controller (@metamask/network-controller):

  • Added these networks to the default Infura network configurations
  • Networks are now available as first-class network options

Network Enablement (@metamask/network-enablement-controller):

  • These networks are included in the popular networks list
  • Will be enabled when users call enableAllPopularNetworks()

Impact:

This change expands MetaMask's multi-chain capabilities by making these popular L1 and L2 networks available as built-in options, improving the user experience for accessing DeFi and Web3 applications across these ecosystems.

References

Related to the initiative to expand MetaMask's multi-chain support and provide better out-of-the-box network coverage for users.

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, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Add Arbitrum, BSC, Optimism, Polygon, and Sei as built-in Infura networks and update related constants, configs, and tests across packages.

  • Networks (controller-utils):
    • Extend BUILT_IN_NETWORKS, InfuraNetworkType, BuiltInNetworkName, ChainId, NetworksTicker, BlockExplorerUrl, and NetworkNickname with Arbitrum, BSC, Optimism, Polygon, and Sei (chain IDs: 0xa4b1, 0x38, 0xa, 0x89, 0x531).
    • Update CHANGELOG.md documenting the additions.
  • Network Controller:
    • Add default Infura configurations and client registry entries for the new networks (URLs, names, native currencies).
    • Update tests to assert presence of these networks and endpoints.
  • Assets Controllers:
    • Update TokenDetectionController tests to include the new networks in the token detection chain ID set.

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

@salimtb salimtb marked this pull request as ready for review October 27, 2025 22:48
@salimtb salimtb requested review from a team as code owners October 27, 2025 22:48
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

bergarces
bergarces previously approved these changes Oct 29, 2025

### Added

- Arbitrum, BSC, Optimism, Polygon, and Sei networks to Infura networks ([#6972](https://github.com/MetaMask/core/pull/6972))
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we mark this as a breaking change?
Technically this is an addition, however I remember adding base-mainnet as a default network caused cascading changes on other controllers/clients.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed that these changes look innocuous. Also these changes make it so that these can be used as default networks but don't change the set of default networks themselves. I would expect that we would do that by changing network-controller. Do we anticipate also doing that in a separate PR?

That said, if have concerns, perhaps we could confirm by publishing a preview build and updating the clients as a preemptive measure?

Copy link
Contributor Author

@salimtb salimtb Oct 29, 2025

Choose a reason for hiding this comment

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

@mcmire this has been tested on the client side already , a PR for it has been merged MetaMask/metamask-extension#37172 using a patch , it was test by QA and all works as expected
let me know if this answer your concerns

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we applied a patch since core releases was blocked, and we needed this change to be included in the current release cut.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh perfect, okay, no problem then!

github-merge-queue bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Oct 29, 2025
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**
The goal of this PR is to add popular networks by default for both new
and existing users, but only those supported by the accounts API v4.

core PR: MetaMask/core#6972

This implementation adds 6 popular networks (Arbitrum, BSC, Optimism,
Polygon, Sei, and Base) to MetaMask by default, making them immediately
available to users without requiring manual addition. The feature works
for both new users during onboarding and existing users through a
migration. Networks are filtered to only include those supported by the
accounts API v4.

**Key changes:**
1. **For new users**: Added `_addPopularNetworks()` and
`_enableDefaultNetwork()` methods to the MetaMask controller that
automatically add and enable popular networks after onboarding
completion
2. **For existing users**: Created migration `182` that adds supported
FEATURED_RPCS networks to existing users' network configurations,
filtered by `SUPPORTED_NETWORKS_ACCOUNTS_API_V4`
3. **Network enablement**: Popular networks are automatically enabled
based on environment (test vs production) after onboarding
4. **API compatibility**: Only networks supported by accounts API v4 are
added to ensure compatibility

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/37172?quickstart=1)

## **Changelog**

CHANGELOG entry: Added popular networks (Arbitrum, BSC, Optimism,
Polygon, Sei, and Base) by default for all users, filtered to only
include networks supported by accounts API v4

## **Related issues**

Fixes:

## **Manual testing steps**

1. **For new users:**
   - Create a fresh MetaMask installation
   - Complete the onboarding process
- Verify that supported popular networks are automatically added and
available in the network dropdown
   - Check that networks are enabled and can be switched to
- Verify that unsupported networks (Linea, Avalanche, zkSync Era) are
not added

2. **For existing users:**
   - Open MetaMask with an existing wallet
- Verify that supported popular networks are automatically added after
the migration runs
   - Check that existing custom networks are preserved
   - Verify that only supported networks appear in the network list
   - Confirm that unsupported networks are not added

3. **Network functionality:**
   - Switch to each supported popular network and verify connection
   - Check that block explorer URLs are correctly configured
   - Verify that native currency symbols are displayed correctly

## **Screenshots/Recordings**

### **Before**
<!-- [screenshots/recordings] -->
- Users had to manually add popular networks through the "Add Network"
flow
- Only Ethereum mainnet was available by default

### **After**
<!-- [screenshots/recordings] -->
<img width="1142" height="980" alt="Screenshot 2025-10-24 at 11 44 35"
src="https://github.com/user-attachments/assets/bf1d90be-ce6e-4b09-9e6b-445d2771098e"
/>

- Supported popular networks are automatically available in the network
dropdown
- Users can immediately switch to supported popular networks without
manual configuration
- Networks are pre-configured with correct RPC endpoints and block
explorers
- Only networks compatible with accounts API v4 are included

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.



<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Adds Arbitrum, BSC, Optimism, Polygon, and Sei as built‑in/default
networks (with failovers) and migrates existing users to include them;
updates tests, package patches, and endpoints.
> 
> - **Network defaults & failover**:
> - Include `arbitrum-mainnet`, `bsc-mainnet`, `optimism-mainnet`,
`polygon-mainnet`, `sei-mainnet` in built‑in networks with `chainId`,
`ticker`, and `blockExplorerUrl` in `@metamask/controller-utils`
(patched).
> - Initialize failover URLs for new Infura networks in
`app/scripts/controller-init/network-controller-init.ts`.
> - **Migration**:
> - Add migration `182` to insert supported FEATURED_RPCS (`0xa4b1`,
`0x38`, `0xa`, `0x89`, `0x531`) into
`NetworkController.networkConfigurationsByChainId` if missing,
preserving existing configs.
> - **Tests**:
> - Update unit/e2e tests to reflect new default networks, failover
expectations, network counts, and selection flows; add helpers
(`selectNetworkByChainId`).
> - **Build/Config**:
> - Patch and pin `@metamask/controller-utils` in
`package.json`/`yarn.lock`; register migration in `migrations/index.js`.
> - **Privacy/Endpoints**:
> - Extend `privacy-snapshot.json` with new Infura endpoints for added
networks.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8170ef4. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
github-merge-queue bot pushed a commit to MetaMask/metamask-extension that referenced this pull request Oct 29, 2025
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**
The goal of this PR is to add popular networks by default for both new
and existing users, but only those supported by the accounts API v4.

core PR: MetaMask/core#6972

This implementation adds 6 popular networks (Arbitrum, BSC, Optimism,
Polygon, Sei, and Base) to MetaMask by default, making them immediately
available to users without requiring manual addition. The feature works
for both new users during onboarding and existing users through a
migration. Networks are filtered to only include those supported by the
accounts API v4.

**Key changes:**
1. **For new users**: Added `_addPopularNetworks()` and
`_enableDefaultNetwork()` methods to the MetaMask controller that
automatically add and enable popular networks after onboarding
completion
2. **For existing users**: Created migration `182` that adds supported
FEATURED_RPCS networks to existing users' network configurations,
filtered by `SUPPORTED_NETWORKS_ACCOUNTS_API_V4`
3. **Network enablement**: Popular networks are automatically enabled
based on environment (test vs production) after onboarding
4. **API compatibility**: Only networks supported by accounts API v4 are
added to ensure compatibility

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/37172?quickstart=1)

## **Changelog**

CHANGELOG entry: Added popular networks (Arbitrum, BSC, Optimism,
Polygon, Sei, and Base) by default for all users, filtered to only
include networks supported by accounts API v4

## **Related issues**

Fixes:

## **Manual testing steps**

1. **For new users:**
   - Create a fresh MetaMask installation
   - Complete the onboarding process
- Verify that supported popular networks are automatically added and
available in the network dropdown
   - Check that networks are enabled and can be switched to
- Verify that unsupported networks (Linea, Avalanche, zkSync Era) are
not added

2. **For existing users:**
   - Open MetaMask with an existing wallet
- Verify that supported popular networks are automatically added after
the migration runs
   - Check that existing custom networks are preserved
   - Verify that only supported networks appear in the network list
   - Confirm that unsupported networks are not added

3. **Network functionality:**
   - Switch to each supported popular network and verify connection
   - Check that block explorer URLs are correctly configured
   - Verify that native currency symbols are displayed correctly

## **Screenshots/Recordings**

### **Before**
<!-- [screenshots/recordings] -->
- Users had to manually add popular networks through the "Add Network"
flow
- Only Ethereum mainnet was available by default

### **After**
<!-- [screenshots/recordings] -->
<img width="1142" height="980" alt="Screenshot 2025-10-24 at 11 44 35"
src="https://github.com/user-attachments/assets/bf1d90be-ce6e-4b09-9e6b-445d2771098e"
/>

- Supported popular networks are automatically available in the network
dropdown
- Users can immediately switch to supported popular networks without
manual configuration
- Networks are pre-configured with correct RPC endpoints and block
explorers
- Only networks compatible with accounts API v4 are included

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I've included tests if applicable
- [x] I've documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I've applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.



<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> Adds Arbitrum, BSC, Optimism, Polygon, and Sei as built‑in/default
networks (with failovers) and migrates existing users to include them;
updates tests, package patches, and endpoints.
> 
> - **Network defaults & failover**:
> - Include `arbitrum-mainnet`, `bsc-mainnet`, `optimism-mainnet`,
`polygon-mainnet`, `sei-mainnet` in built‑in networks with `chainId`,
`ticker`, and `blockExplorerUrl` in `@metamask/controller-utils`
(patched).
> - Initialize failover URLs for new Infura networks in
`app/scripts/controller-init/network-controller-init.ts`.
> - **Migration**:
> - Add migration `182` to insert supported FEATURED_RPCS (`0xa4b1`,
`0x38`, `0xa`, `0x89`, `0x531`) into
`NetworkController.networkConfigurationsByChainId` if missing,
preserving existing configs.
> - **Tests**:
> - Update unit/e2e tests to reflect new default networks, failover
expectations, network counts, and selection flows; add helpers
(`selectNetworkByChainId`).
> - **Build/Config**:
> - Patch and pin `@metamask/controller-utils` in
`package.json`/`yarn.lock`; register migration in `migrations/index.js`.
> - **Privacy/Endpoints**:
> - Extend `privacy-snapshot.json` with new Infura endpoints for added
networks.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
8170ef4. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
'monad-testnet' = 'MON',
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
'base-mainnet' = 'ETH',
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
Copy link
Contributor

Choose a reason for hiding this comment

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

Ooh, this rule is not very useful, is it. I will look into disabling this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1 on this , i don't think it's really useful actually


### Added

- Arbitrum, BSC, Optimism, Polygon, and Sei networks to Infura networks ([#6972](https://github.com/MetaMask/core/pull/6972))
Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed that these changes look innocuous. Also these changes make it so that these can be used as default networks but don't change the set of default networks themselves. I would expect that we would do that by changing network-controller. Do we anticipate also doing that in a separate PR?

That said, if have concerns, perhaps we could confirm by publishing a preview build and updating the clients as a preemptive measure?

Copy link
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.

LGTM.

@salimtb salimtb merged commit c4790ab into main Oct 29, 2025
255 checks passed
@salimtb salimtb deleted the feat/add-infura-networks branch October 29, 2025 17:45
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