Skip to content

feat: use defaultInfuraNetworks as default networks list#8767

Merged
mikesposito merged 11 commits into
mainfrom
mikesposito/feat/default-infura-networks
May 11, 2026
Merged

feat: use defaultInfuraNetworks as default networks list#8767
mikesposito merged 11 commits into
mainfrom
mikesposito/feat/default-infura-networks

Conversation

@mikesposito
Copy link
Copy Markdown
Member

@mikesposito mikesposito commented May 11, 2026

Explanation

Some new Infura network have been added to InfuraNetworkType (#8680), but NetworkController uses the same list of networks to:

  • Build the default list of networks when creating the initial default state
  • Validate new Infura networks being enabled

This has been fine until now because additional networks that can be enabled by users were added as "custom" networks. However, with the addition of new Infura networks, we have some networks that can be enabled by users but are not included in the default list of networks. This causes validation to fail when users try to enable those networks (via the Additional Networks list).

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
Changes the set of networks that are auto-included on initialization, which is a breaking behavioral change that can affect users’ ability to switch to previously-default networks without first adding configurations.

Overview
Introduces DEFAULT_INFURA_NETWORKS (a curated subset of InfuraNetworkType) in @metamask/controller-utils and exports it for consumers.

Updates NetworkController to build its default networkConfigurationsByChainId from DEFAULT_INFURA_NETWORKS instead of Object.values(InfuraNetworkType), effectively removing Sei, MegaETH, Avalanche, and ZKSync from the default network set while keeping them available as Infura-supported networks.

Adjusts controller-utils export snapshots and network-controller tests/changelogs to reflect the new default-network behavior (breaking).

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

@mikesposito mikesposito changed the title feat: use defaultInfuraNetwork as default networks list feat: use defaultInfuraNetworks as default networks list May 11, 2026
@mikesposito mikesposito marked this pull request as ready for review May 11, 2026 19:29
@mikesposito mikesposito requested review from a team as code owners May 11, 2026 19:29
InfuraNetworkType['bsc-mainnet'],
InfuraNetworkType['optimism-mainnet'],
InfuraNetworkType['polygon-mainnet'],
InfuraNetworkType['monad-mainnet'],
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I’m leaving Monad here intentionally as requested by the Money team

cc @Matt561

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.

Had some comments.

Comment thread packages/controller-utils/src/types.ts Outdated
Comment on lines +32 to +45
export const defaultInfuraNetworks: InfuraNetworkType[] = [
InfuraNetworkType.mainnet,
InfuraNetworkType.goerli,
InfuraNetworkType.sepolia,
InfuraNetworkType['linea-goerli'],
InfuraNetworkType['linea-sepolia'],
InfuraNetworkType['linea-mainnet'],
InfuraNetworkType['base-mainnet'],
InfuraNetworkType['arbitrum-mainnet'],
InfuraNetworkType['bsc-mainnet'],
InfuraNetworkType['optimism-mainnet'],
InfuraNetworkType['polygon-mainnet'],
InfuraNetworkType['monad-mainnet'],
];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: Should we use the standard name for constants?

Suggested change
export const defaultInfuraNetworks: InfuraNetworkType[] = [
InfuraNetworkType.mainnet,
InfuraNetworkType.goerli,
InfuraNetworkType.sepolia,
InfuraNetworkType['linea-goerli'],
InfuraNetworkType['linea-sepolia'],
InfuraNetworkType['linea-mainnet'],
InfuraNetworkType['base-mainnet'],
InfuraNetworkType['arbitrum-mainnet'],
InfuraNetworkType['bsc-mainnet'],
InfuraNetworkType['optimism-mainnet'],
InfuraNetworkType['polygon-mainnet'],
InfuraNetworkType['monad-mainnet'],
];
export const DEFAULT_INFURA_NETWORKS: InfuraNetworkType[] = [
InfuraNetworkType.mainnet,
InfuraNetworkType.goerli,
InfuraNetworkType.sepolia,
InfuraNetworkType['linea-goerli'],
InfuraNetworkType['linea-sepolia'],
InfuraNetworkType['linea-mainnet'],
InfuraNetworkType['base-mainnet'],
InfuraNetworkType['arbitrum-mainnet'],
InfuraNetworkType['bsc-mainnet'],
InfuraNetworkType['optimism-mainnet'],
InfuraNetworkType['polygon-mainnet'],
InfuraNetworkType['monad-mainnet'],
];

Alternatively should we narrow the type?

Suggested change
export const defaultInfuraNetworks: InfuraNetworkType[] = [
InfuraNetworkType.mainnet,
InfuraNetworkType.goerli,
InfuraNetworkType.sepolia,
InfuraNetworkType['linea-goerli'],
InfuraNetworkType['linea-sepolia'],
InfuraNetworkType['linea-mainnet'],
InfuraNetworkType['base-mainnet'],
InfuraNetworkType['arbitrum-mainnet'],
InfuraNetworkType['bsc-mainnet'],
InfuraNetworkType['optimism-mainnet'],
InfuraNetworkType['polygon-mainnet'],
InfuraNetworkType['monad-mainnet'],
];
export const DEFAULT_INFURA_NETWORKS = [
InfuraNetworkType.mainnet,
InfuraNetworkType.goerli,
InfuraNetworkType.sepolia,
InfuraNetworkType['linea-goerli'],
InfuraNetworkType['linea-sepolia'],
InfuraNetworkType['linea-mainnet'],
InfuraNetworkType['base-mainnet'],
InfuraNetworkType['arbitrum-mainnet'],
InfuraNetworkType['bsc-mainnet'],
InfuraNetworkType['optimism-mainnet'],
InfuraNetworkType['polygon-mainnet'],
InfuraNetworkType['monad-mainnet'],
] as const satisfies InfuraNetworkType[];

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good point, applied in dbadfd5

Comment thread packages/network-controller/CHANGELOG.md Outdated
Comment thread packages/controller-utils/CHANGELOG.md Outdated
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 dbadfd5. Configure here.

Comment thread packages/controller-utils/src/index.test.ts Outdated
mikesposito and others added 3 commits May 11, 2026 22:01
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
mcmire
mcmire previously approved these changes May 11, 2026
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.

LGTM!

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.

LGTM.

@mikesposito mikesposito added this pull request to the merge queue May 11, 2026
Merged via the queue into main with commit bb1349e May 11, 2026
366 checks passed
@mikesposito mikesposito deleted the mikesposito/feat/default-infura-networks branch May 11, 2026 22:24
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.

2 participants