-
-
Notifications
You must be signed in to change notification settings - Fork 254
chore: change Monad Testnet to infura network
#7067
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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-testnetfromCustomNetworkTypetoInfuraNetworkType - 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', | ||
| /** |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good call.
|
@metamaskbot publish-preview |
|
@metamaskbot publish preview |
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
Monad Testnet to infura network
| - Change Monad Testnet as infura network ([#7067](https://github.com/MetaMask/core/pull/7067)) | ||
| - Add `monad-testnet` to `InfuraNetworkType` |
There was a problem hiding this comment.
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.
| - 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 { |
There was a problem hiding this comment.
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))There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
8b0b508 to
e520e29
Compare
| 'megaeth-testnet': 'megaeth-testnet', | ||
| /** | ||
| * @deprecated `monad-testnet` is supported on InfuraNetworkType instead. | ||
| */ |
There was a problem hiding this comment.
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.
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.
References
Checklist
Note
Migrates Monad Testnet from a custom network to an Infura-supported network, adds chainId
0x279fconfig, and updates tests/changelog accordingly.monad-testnettoInfuraNetworkType; deprecateCustomNetworkType['monad-testnet']via JSDoc.CHANGELOG.mdto note the Infura addition.0x279f(“Monad Testnet”) with tickerMONand Infura RPChttps://monad-testnet.infura.io/v3/{infuraProjectId}.0x279fin supportedchainIdsfor token detection expectations.Written by Cursor Bugbot for commit ba44305. This will update automatically on new commits. Configure here.