Skip to content

Conversation

@stanleyyconsensys
Copy link
Contributor

@stanleyyconsensys stanleyyconsensys commented Nov 6, 2025

Explanation

This PR migrates the Monad Testnet from a custom network to an Infura-supported network. The monad-testnet network configuration is moved from CustomNetworkType to InfuraNetworkType, with the custom entry deprecated.

  • Moved monad-testnet from CustomNetworkType to InfuraNetworkType
  • Deprecated the CustomNetworkType['monad-testnet'] entry with a JSDoc comment
  • Removed monad-testnet from custom network configuration initialization
  • Updated test expectations to reflect monad-testnet as an Infura network type

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

Note

Migrates Monad Testnet from a custom network to an Infura-supported network, adds chainId 0x279f config, and updates tests/changelog accordingly.

  • Controller Utils
    • Add monad-testnet to InfuraNetworkType; deprecate CustomNetworkType['monad-testnet'] via JSDoc.
    • Update CHANGELOG.md to note the Infura addition.
  • Network Controller (tests)
    • Add built-in config for chainId 0x279f (“Monad Testnet”) with ticker MON and Infura RPC https://monad-testnet.infura.io/v3/{infuraProjectId}.
  • Assets Controllers (tests)
    • Include 0x279f in supported chainIds for token detection expectations.

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the Monad Testnet from a custom network to an Infura-supported network. The monad-testnet network configuration is moved from CustomNetworkType to InfuraNetworkType, with the custom entry deprecated.

  • Moved monad-testnet from CustomNetworkType to InfuraNetworkType
  • Deprecated the CustomNetworkType['monad-testnet'] entry with a JSDoc comment
  • Removed monad-testnet from custom network configuration initialization
  • Updated test expectations to reflect monad-testnet as an Infura network type

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/controller-utils/src/types.ts Added monad-testnet to InfuraNetworkType and deprecated it in CustomNetworkType
packages/network-controller/src/NetworkController.ts Removed monad-testnet from custom network configuration initialization
packages/network-controller/tests/NetworkController.test.ts Updated test expectations to include monad-testnet as an Infura network with proper configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

*/
export const CustomNetworkType = {
'megaeth-testnet': 'megaeth-testnet',
/**
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 dont remove monad here to avoid breaking change

as controller utils is share everywhere

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, good call.

@stanleyyconsensys
Copy link
Contributor Author

@metamaskbot publish-preview

@stanleyyconsensys
Copy link
Contributor Author

@metamaskbot publish preview

@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2025

Preview builds have been published. See these instructions for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/account-tree-controller": "2.0.0-preview-6b15e01",
  "@metamask-previews/accounts-controller": "34.0.0-preview-6b15e01",
  "@metamask-previews/address-book-controller": "7.0.0-preview-6b15e01",
  "@metamask-previews/announcement-controller": "8.0.0-preview-6b15e01",
  "@metamask-previews/app-metadata-controller": "2.0.0-preview-6b15e01",
  "@metamask-previews/approval-controller": "8.0.0-preview-6b15e01",
  "@metamask-previews/assets-controllers": "87.1.0-preview-6b15e01",
  "@metamask-previews/base-controller": "9.0.0-preview-6b15e01",
  "@metamask-previews/bridge-controller": "59.0.0-preview-6b15e01",
  "@metamask-previews/bridge-status-controller": "59.0.0-preview-6b15e01",
  "@metamask-previews/build-utils": "3.0.4-preview-6b15e01",
  "@metamask-previews/chain-agnostic-permission": "1.2.2-preview-6b15e01",
  "@metamask-previews/composable-controller": "12.0.0-preview-6b15e01",
  "@metamask-previews/controller-utils": "11.15.0-preview-6b15e01",
  "@metamask-previews/core-backend": "4.0.0-preview-6b15e01",
  "@metamask-previews/delegation-controller": "1.0.0-preview-6b15e01",
  "@metamask-previews/earn-controller": "9.0.0-preview-6b15e01",
  "@metamask-previews/eip-5792-middleware": "2.0.0-preview-6b15e01",
  "@metamask-previews/eip-7702-internal-rpc-middleware": "0.1.0-preview-6b15e01",
  "@metamask-previews/eip1193-permission-middleware": "1.0.2-preview-6b15e01",
  "@metamask-previews/ens-controller": "18.0.0-preview-6b15e01",
  "@metamask-previews/error-reporting-service": "3.0.0-preview-6b15e01",
  "@metamask-previews/eth-block-tracker": "14.0.0-preview-6b15e01",
  "@metamask-previews/eth-json-rpc-middleware": "21.0.0-preview-6b15e01",
  "@metamask-previews/eth-json-rpc-provider": "5.0.1-preview-6b15e01",
  "@metamask-previews/foundryup": "1.0.1-preview-6b15e01",
  "@metamask-previews/gas-fee-controller": "25.0.0-preview-6b15e01",
  "@metamask-previews/gator-permissions-controller": "0.4.0-preview-6b15e01",
  "@metamask-previews/json-rpc-engine": "10.1.1-preview-6b15e01",
  "@metamask-previews/json-rpc-middleware-stream": "8.0.8-preview-6b15e01",
  "@metamask-previews/keyring-controller": "24.0.0-preview-6b15e01",
  "@metamask-previews/logging-controller": "7.0.0-preview-6b15e01",
  "@metamask-previews/message-manager": "14.0.0-preview-6b15e01",
  "@metamask-previews/messenger": "0.3.0-preview-6b15e01",
  "@metamask-previews/multichain-account-service": "2.1.0-preview-6b15e01",
  "@metamask-previews/multichain-api-middleware": "1.2.4-preview-6b15e01",
  "@metamask-previews/multichain-network-controller": "2.0.0-preview-6b15e01",
  "@metamask-previews/multichain-transactions-controller": "6.0.0-preview-6b15e01",
  "@metamask-previews/name-controller": "9.0.0-preview-6b15e01",
  "@metamask-previews/network-controller": "25.0.0-preview-6b15e01",
  "@metamask-previews/network-enablement-controller": "3.1.0-preview-6b15e01",
  "@metamask-previews/notification-services-controller": "19.0.0-preview-6b15e01",
  "@metamask-previews/permission-controller": "12.1.0-preview-6b15e01",
  "@metamask-previews/permission-log-controller": "5.0.0-preview-6b15e01",
  "@metamask-previews/phishing-controller": "15.0.0-preview-6b15e01",
  "@metamask-previews/polling-controller": "15.0.0-preview-6b15e01",
  "@metamask-previews/preferences-controller": "21.0.0-preview-6b15e01",
  "@metamask-previews/profile-sync-controller": "26.0.0-preview-6b15e01",
  "@metamask-previews/rate-limit-controller": "7.0.0-preview-6b15e01",
  "@metamask-previews/remote-feature-flag-controller": "2.0.0-preview-6b15e01",
  "@metamask-previews/sample-controllers": "3.0.0-preview-6b15e01",
  "@metamask-previews/seedless-onboarding-controller": "6.1.0-preview-6b15e01",
  "@metamask-previews/selected-network-controller": "25.0.0-preview-6b15e01",
  "@metamask-previews/shield-controller": "2.0.0-preview-6b15e01",
  "@metamask-previews/signature-controller": "36.0.0-preview-6b15e01",
  "@metamask-previews/subscription-controller": "3.2.0-preview-6b15e01",
  "@metamask-previews/token-search-discovery-controller": "4.0.0-preview-6b15e01",
  "@metamask-previews/transaction-controller": "61.1.0-preview-6b15e01",
  "@metamask-previews/transaction-pay-controller": "3.0.0-preview-6b15e01",
  "@metamask-previews/user-operation-controller": "40.0.0-preview-6b15e01"
}

@stanleyyconsensys stanleyyconsensys changed the title chore: move monad testnet as infura network chore: change Monad Testnet to infura network Nov 10, 2025
@stanleyyconsensys stanleyyconsensys marked this pull request as ready for review November 10, 2025 02:33
@stanleyyconsensys stanleyyconsensys requested review from a team as code owners November 10, 2025 02:34
Comment on lines 12 to 13
- Change Monad Testnet as infura network ([#7067](https://github.com/MetaMask/core/pull/7067))
- Add `monad-testnet` to `InfuraNetworkType`
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: What are your thoughts on combining these two? They are essentially saying the same thing.

Suggested change
- Change Monad Testnet as infura network ([#7067](https://github.com/MetaMask/core/pull/7067))
- Add `monad-testnet` to `InfuraNetworkType`
- Add `monad-testnet` to `InfuraNetworkType` ([#7067](https://github.com/MetaMask/core/pull/7067))

Also what are your thoughts on adding this to Added rather than Changed, since this extends the existing API?

},
],
},
"0x279f": Object {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this affects the default set of networks for NetworkController, what are your thoughts on adding a changelog entry for this package? Perhaps we could add an entry to Changed such as:

### Changed

- Update the default set of Infura networks to include Monad Testnet ([#7067](https://github.com/MetaMask/core/pull/7067))

Copy link
Contributor Author

@stanleyyconsensys stanleyyconsensys Nov 11, 2025

Choose a reason for hiding this comment

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

i think we only need that when network controller bump up? otherwise it seem still remain the same?
shall we only do it when i do the bump up?

Copy link
Contributor

Choose a reason for hiding this comment

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

We generally encourage updating changelogs as changes are made to packages, not at release time. As it stands your change affects NetworkController now, not when the release is created. (You can tell because the tests changed.) That's why I suggested updating the network-controller changelog in this PR rather than later.

'megaeth-testnet': 'megaeth-testnet',
/**
* @deprecated `monad-testnet` is supported on InfuraNetworkType instead.
*/
Copy link

Choose a reason for hiding this comment

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

Bug: Network Type Conflict Causes Classification Ambiguity

The monad-testnet entry remains in CustomNetworkType despite being moved to InfuraNetworkType. This causes monad-testnet to be a valid value for both types simultaneously. When NetworkType spreads both objects, the duplicate key creates ambiguity about whether monad-testnet is an Infura or custom network. Type guards like isInfuraNetworkType and runtime checks against CustomNetworkType will produce conflicting results, breaking the intended migration from custom to Infura network classification.

Fix in Cursor Fix in Web

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.

3 participants