-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Sentry] feat: network controller upgrade + network editing UI #26433
[Sentry] feat: network controller upgrade + network editing UI #26433
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@metamask/[email protected] |
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
@metamaskbot update-policies |
Policies updated |
@metamaskbot update-policies |
Policies updated |
@metamaskbot update-policies |
Policies updated |
@metamaskbot update-policies |
No policy changes |
@metamaskbot update-policies |
Policies updated |
@metamaskbot update-policies |
Quality Gate failedFailed conditions |
e2e ci is flakier today despite no real changes here. Some failures have happened recently on develop and I don't think are related, like |
Builds ready [9107a7b]
Page Load Metrics (1626 ± 102 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Missing release label release-12.5.0 on PR. Adding release label release-12.5.0 on PR and removing other release labels(release-12.6.0), as PR was added to branch 12.5.0 when release was cut. |
Description
This PR upgrades the network controller, and enables a new UI for adding and editing networks.
The network controller changes are described in full in MetaMask/core#4286
In short, there's now a single network per chain id. Multiple RPC endpoints for a chain are now represented as an array under the single network configuration, instead of being separate networks. Each network has some RPC endpoint chosen as the default. Also the built in Infura networks are now represented in state, where they were not before.
A migration is added to transform the network controller state to this new format.
For the UI, networks are now added, edited, and deleted directly in the network list. Networks are no longer edited via the settings page.
Users with multiple RPC endpoints per chain are shown a modal upon upgrade, allowing them to select a different endpoint as the default.
The UI for
wallet_addEthereumChain
is changed, to message that users may be adding an additional endpoint to an existing network, rather than adding a new network.This PR contains both the controller upgrade and UI, because it's not possible to perfectly recrate the old UI with the new state or vice versa.
To minimize changes, some selectors are shimmed to return equivalent data. This includes
getProviderConfig
andgetCurrentNetwork
.Other selectors have been removed in favor of selecting the new state, as there was no behavior that satisfied every caller. This includes
getNetworkConfigurations
and its dependents likegetNonTestNetworks
getTestNetworks
. Places listing networks now go through the newgetNetworkConfigurationsByChainId
.Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Screen.Recording.2024-08-20.at.10.42.23.AM.mov
Pre-merge author checklist
Pre-merge reviewer checklist