Repository navigation
refactor(network-controller)!: remove legacy per-endpoint failoverUrls - #11266
Merged
Merged
Conversation
cryptodev-2s
temporarily deployed
to
default-branch
November 3, 2026 13:55 — with
GitHub Actions
Inactive
cryptodev-2s
marked this pull request as draft
November 3, 2026 14:01
…s from RPC endpoints Failover URLs are now sourced only from the failoverUrls constructor option, keyed by chain ID. The failoverUrls property on RpcEndpoint (and on endpoints accepted by addNetwork/updateNetwork) is removed.
cryptodev-2s
force-pushed
the
worktree-zazzy-hatching-clover
branch
from
November 3, 2026 14:08
1c0fd72 to
3a0f39d
Compare
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
This was referenced Nov 3, 2026
cryptodev-2s
marked this pull request as ready for review
November 3, 2026 21:55
cryptodev-2s
temporarily deployed
to
default-branch
November 3, 2026 21:55 — with
GitHub Actions
Inactive
cryptodev-2s
enabled auto-merge
November 3, 2026 21:59
FrederikBolding
approved these changes
Nov 5, 2026
sahar-fehri
approved these changes
Nov 5, 2026
Merged
Naz-Ovh
pushed a commit
to 0x-fork/metamask-core
that referenced
this pull request
Nov 7, 2026
## Explanation Release 1397.0.0. It bumps two packages: | Package | From | To | Why | | --- | --- | --- | --- | | `@metamask/assets-controller` | 20.2.2 | **20.2.3** (patch) | Unreleased only has a `Changed` entry: asset state now included in state logs ([MetaMask#11319](MetaMask#11319)) | | `@metamask/assets-controllers` | 113.1.1 | **113.2.0** (minor) | `Added`: `serviceProfile` option on `searchTokens` ([MetaMask#11274](MetaMask#11274)), plus a `uuid` bump | Nothing breaking has landed in either package since its last release. The `refactor(network-controller)!` commit (MetaMask#11266) only touched test fixtures in these packages. Generated with `yarn create-release-branch`. I didn't edit any changelog by hand. Uncategorized entries are left for the changelog bot. ### Other changes the tool made - Bumped dependents' ranges: `bridge-controller` (`assets-controller` ^20.2.3, `assets-controllers` ^113.2.0), `transaction-pay-controller` (`assets-controller` ^20.2.3), `assets-controller` (`assets-controllers` ^113.2.0), and `yarn.lock`. - Root version 1396.0.0 → 1397.0.0. ### Packages marked `intentionally-skip` The tool requires these because they are dependencies of the released packages. Neither release relies on any unreleased change in them: account-tree-controller, accounts-controller, approval-controller, base-controller, client-controller, config-registry-controller, controller-utils, core-backend, keyring-controller, messenger, multichain-account-service, multichain-transactions-controller, network-controller, network-enablement-controller, permission-controller, phishing-controller, polling-controller, preferences-controller, profile-sync-controller, remote-feature-flag-controller, storage-service, transaction-controller, utils. ## Checks run locally - `yarn constraints`: passes - Tests for `@metamask/assets-controller` (1384 passed) and `@metamask/assets-controllers` (1863 passed): pass - `yarn changelog:validate`: passes (after the internal-only `Uncategorized` entries were removed) ## Adversarial review (adverse) Round 1 verdict: **SHIP-WITH-CAVEATS (3/3 ship, 0/3 block)**. Findings: 0 critical, 2 warnings, 2 info. - Warning: the `Uncategorized` block is left in both changelogs. **Fixed.** I removed both blocks. They held only MetaMask#11324 (dev tooling) and MetaMask#11266 (test fixtures only in these packages), so nothing changes for consumers. - Warning: patch bump despite a `Changed` entry. **Declined.** The change only adds state-log metadata, with no API change and no new behavior for consumers, so patch is right. - Info: the `refactor(network-controller)!` entry appears in packages that weren't really affected. **Fixed** by the same removal. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
dmytrozahumennov-wb
pushed a commit
to dmytrozahumennov-wb/metamask-extension
that referenced
this pull request
Nov 10, 2026
) ## **Description** MetaMask/core#11266 removes the per-endpoint `failoverUrls` property from `NetworkController`. Failover URLs now come only from the `failoverUrls` constructor option (chain ID to URLs), and only apply to `*.infura.io` endpoints. This PR adopts that change: - Drops `failoverUrls` from the built-in and featured RPC endpoints, the network form state, and the `wallet_addEthereumChain` confirmation. - Adds `getFailoverUrlsForEndpoint` so the "Failover" tag in the network form and RPC list reads from the constructor map for Infura endpoints. - Adds migration 235 to strip `failoverUrls` from persisted `rpcEndpoints`. Migrations 182 and 184 no longer write the field (needed to type-check). The v38 bump also changes failover behavior beyond the `failoverUrls` removal: - RPC failover mode now defaults to `enabled`. Before, a missing or malformed `corePlatformRpcFailoverMode` flag was read as `disabled`. Now it is skipped, so the default applies. A valid flag value (`disabled`, `enabled`, `forced`) is still honored, so the e2e specs that set `disabled` keep working. - The Failover tag in the network form and RPC list now follows `corePlatformRpcFailoverMode` (on unless `disabled`), matching the controller. The retired `walletFrameworkRpcFailoverEnabled` flag is no longer referenced, including in the feature flag registry. - Anyone with a custom `failoverUrls` value on an endpoint outside the chain ID map loses it. This is expected. ## **Changelog** CHANGELOG entry: null ## **Related issues** Related: MetaMask/core#11266 ## **Manual testing steps** 1. In `.metamaskrc`, set `QUICKNODE_MAINNET_URL` to any URL, then run `yarn start` and load the extension. RPC failover mode defaults to `enabled`, so no flag override is needed. 2. Open Settings > Networks and edit Ethereum Mainnet. 3. Verify the "Failover" tag shows on the Infura RPC endpoint and the failover URL field shows the QuickNode URL. 4. Add a custom (non-Infura) RPC to the same network and verify it shows no failover tag. 5. On a build from main, create a wallet, then switch to this branch's build. Verify the wallet loads, networks still work, and a downloaded state log has no `failoverUrls` on any RPC endpoint. <!-- ## **Screenshots/Recordings** ### **Before** ### **After** --> ## **Pre-merge author checklist** - [ ] 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). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] 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] > **Medium Risk** > Touches persisted network configuration via a migration and changes default RPC failover gating when remote flags are missing; custom per-endpoint failover values in old state are dropped. > > **Overview** > Adopts `@metamask/network-controller` **v38** by removing the legacy **`failoverUrls` field on individual RPC endpoints** from persisted state, built-in/featured network definitions, network form state, and `wallet_addEthereumChain` approvals. **Migration 235** strips any leftover per-endpoint `failoverUrls` from `NetworkController` state; migrations **182** and **184** no longer write that field. > > Failover display and behavior now follow the controller model: **`getFailoverUrlsForEndpoint`** looks up chain-keyed QuickNode URLs only for `*.infura.io` endpoints, and the network form / RPC list use that instead of persisted endpoint data. RPC failover UI gating switches from **`walletFrameworkRpcFailoverEnabled`** to **`corePlatformRpcFailoverMode`** (on unless explicitly `disabled`, matching the controller default). E2E fixtures and validation are updated to state version **235** without endpoint `failoverUrls`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 781592d. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: MetaMask Bot <metamaskbot@users.noreply.github.com>
darkwing
pushed a commit
to darkwing/metamask-mobile
that referenced
this pull request
Nov 12, 2026
## **Description** MetaMask/core#11266 removes the per endpoint `failoverUrls` property from `@metamask/network-controller` (v38). Failover URLs now come only from the controller's `failoverUrls` constructor option (chain ID to URLs), and core applies them only to `*.infura.io` endpoints. This PR adapts mobile to that: * Builds the constructor option from one chain keyed map in `customNetworks.tsx`, and stops writing `failoverUrls` on endpoints (popular networks, config registry, swap deeplink, card and bridge hooks). * Adds migration 162 to strip `failoverUrls` from persisted `NetworkController` state. Migrations 72 and 83 no longer write the field (needed to type check). * Network details UI reads failover from the chain map and shows the Failover tag only for Infura hosted endpoints, matching what core does. * Adds Robinhood (`0x1237`) to the map. Its only failover source used to be the endpoint state value. The v38 bump also changes failover behavior beyond the `failoverUrls` removal: * RPC failover mode now defaults to `enabled`. Before, a missing or malformed `corePlatformRpcFailoverMode` flag was read as `disabled`. Now it is skipped, so the default applies. A valid value (`disabled`, `enabled`, `forced`) is still honored. * The Failover tag follows `corePlatformRpcFailoverMode` (on unless `disabled`), matching the controller. The retired `walletFrameworkRpcFailoverEnabled` flag is no longer referenced, and the feature flag registry is updated. ## **Changelog** CHANGELOG entry: null ## **Related issues** Refs: MetaMask/core#11266 ## **Manual testing steps** Before testing, set a failover URL for Ethereum Mainnet in `.js.env`. Without it the chain has no failover configured and the tag never shows: ``` export QUICKNODE_MAINNET_URL="https://example.quiknode.pro/test" ``` Then restart Metro with `yarn watch:clean` (the value is baked into the bundle, so a plain reload is not enough) and reload the app. Any URL works for checking the display. ```gherkin Feature: RPC failover display Scenario: Infura endpoint shows failover Given Ethereum Mainnet with its Infura RPC selected and QUICKNODE_MAINNET_URL set When user opens the network details Then the Failover tag and read only failover URL are shown Scenario: custom endpoint does not show failover Given the same chain with a custom RPC that is not Infura selected When user opens the network details Then no Failover tag or failover URL is shown Scenario: upgrading from a build of main Given a wallet created on a build of main When user installs this branch on top and opens the app Then the wallet loads, networks still work, and persisted NetworkController state has no `failoverUrls` on any RPC endpoint ``` ## **Screenshots/Recordings** https://github.com/user-attachments/assets/64f199c7-df4d-4179-839e-4b534d372966 ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/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 - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/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] > **Medium Risk** > Touches core RPC configuration, a persistence migration, and a major `network-controller` bump; failover gating and defaults change when remote flags are missing, but scope is largely aligned with upstream core behavior. > > **Overview** > Upgrades **`@metamask/network-controller` to v38** and removes the legacy **`failoverUrls` field on RPC endpoints** everywhere the app adds or edits networks (PopularList, bridge/card hooks, swap deeplinks, config registry, network form state). > > **Failover is now chain-level only:** `customNetworks.tsx` exposes `getFailoverUrlsByChainId()` (including Robinhood chain `0x1237`), passed into `NetworkController` via wallet init options. The network details UI and RPC list use `getFailoverUrlsForEndpoint(chainId, rpcUrl)` so the **Failover** tag and read-only URL appear only for **`*.infura.io`** endpoints when failover is enabled—matching core behavior. > > **Migration 162** strips persisted per-endpoint `failoverUrls` from `networkConfigurationsByChainId`. Older migrations and fixtures stop writing the field. > > **Feature flags:** `selectIsRpcFailoverEnabled` now keys off `corePlatformRpcFailoverMode` (off only when `disabled`; absent flag defaults to on), replacing `walletFrameworkRpcFailoverEnabled`. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 25c1ebe. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
NetworkControllerhas two places to define RPC failover URLs: thefailoverUrlsconstructor option (keyed by chain ID) and a legacyfailoverUrlsproperty on each RPC endpoint in state. The state property was only a fallback for chains missing from the constructor option, and both clients now pass that option.This PR removes the legacy property:
failoverUrlsis gone fromInfuraRpcEndpointandCustomRpcEndpoint, soaddNetworkandupdateNetworkno longer accept it.failoverUrls?.[chainId] ?? [], soconfiguration.failoverRpcUrlskeeps its shape.References
Checklist
Note
High Risk
Breaking API and behavior change to RPC failover sourcing in core network infrastructure; clients relying on per-endpoint persisted failover URLs will lose failover unless they migrate to the constructor option.
Overview
Breaking change:
failoverUrlsis removed fromInfuraRpcEndpointandCustomRpcEndpoint, so persisted RPC endpoints andaddNetwork/updateNetworkpayloads must no longer include it. Default and custom network templates inNetworkControllerstop emitting emptyfailoverUrlsarrays on each endpoint.RPC failover is now only supplied via the
NetworkControllerconstructor optionfailoverUrls(keyed by chain ID). When building network clients,failoverRpcUrlsis set tofailoverUrls?.[chainId] ?? []with no fallback to values that used to live on individual endpoints—chains without a constructor entry get no failover URLs.Tests and fixtures across
network-controller,assets-controller,assets-controllers,multichain-network-controller, andselected-network-controllerare updated accordingly (provider failover tests now pass chain-levelfailoverUrls). The changelog documents client migration (stop writing endpointfailoverUrls, optionally strip them from persisted state).Reviewed by Cursor Bugbot for commit 76a9a4b. Bugbot is set up for automated code reviews on this repo. Configure here.