MetaMask / MetaMask/metamask-extension

[Epic] Issues related to enabled network state deprecated networks

Open
#37,625 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

### What is this about?

Two issues have surfaced that relate to enabled network state:

1. https://github.com/MetaMask/metamask-extension/issues/36992
2. https://github.com/MetaMask/metamask-extension/issues/33432

For 1, the report states that the toast persists and blocks signing a confirmation.
For 2, there are many instances of the error appearing. When the error appears on app open, we have reports that the error blocks users from opening Extension without reinstall

Plausible cause is that the NetworkEnablementController does not check for deprecated networks. The Controller was introduced [here](https://github.com/MetaMask/core/pull/6028) with a migration in the client added [here](https://github.com/MetaMask/metamask-extension/pull/36150).

- Start using SelectedNetworkClient for blocktracker ([PR](https://github.com/MetaMask/core/pull/4063))
- 'No Custom network found with the ID' oldest version occurrence on Sentry 11.16.13, released June 22
- Goerli deprecation 11.16.0 May 21, 2024 https://github.com/MetaMask/metamask-extension/pull/23695
- Migration to NetworkEnablementController
- Rolled out in 13.5 to 1% and paused on Oct 20, 13.6 100% on Oct 29
- Increase in reports
- Increase since Mid-September ([Sentry](https://metamask.sentry.io/explore/discover/results/?dataset=errors&field=title&field=release&field=environment&field=user.display&field=timestamp&interval=4h&name=Error%3A%20No%20custom%20network%20client%20was%20found%20with%20the%20ID%20%22bbc914bf-56e8-4933-b9a4-8f3b8ac58cc8%22.&project=273505&query=issue%3AMETAMASK-XMKK&queryDataset=error-events&sort=release&statsPeriod=90d&yAxis=count%28%29&yAxis=count_unique%28user%29))
- Reports on Network deprecated 13.5 onwards (Oct 20)
- Locked out with chain id not found error
- Banner for issue 1 is expected to appear for deprecated network. Statelogs shared [here](https://github.com/MetaMask/metamask-extension/issues/33432#issuecomment-3442999584) for issue 2 include Goerli

**Hypotheses**
- enabledNetworkMap still has Goerli `0x5` set as true in state
- When MetaMask is open and a feature calls an RPC for All networks, deprecated networks are also called as they are not cleaned from enabledNetworks. These updates might all be attempted for a deprecated network
- Poll account balances
- Fetch token prices
- Auto-detect tokens
- Fetch token lists
- Fetch currency exchange rates
- Consolidation into the NetworkEnablementController might have actually already reduced occurrence, although the error still appears on 13.7
- When opening MetaMask from a dapp connection or confirmation request, SelectedNetworkController `NetworkController.getNetworkClientById` does not check Network RPC from another controller or service that checks for deprecated networks. It does not use enabledNetworkMap but also does not have it's own mechanism to filter for deprecated networks

### Impact
Impacts users that have updated but not reinstalled since May 2024. We don't know if severity is the same for these users. Severity is impacted by whether how Extension is opened, from a dapp (uses SelectedNetworkController) or from favicon, which still uses other controllers that don't check for deprecated networks.

Severity varies
- Select users are unable to confirm a transaction
- Select users are unable to open Extension (past the error screen)
- No noticeable impact

### Cursor Conclusion

- v13.5.0 actually REDUCED the polling errors because the selector automatically filtered out deprecated networks. However, it created/exposed NEW issues:

- [ ] Deprecated networks stuck in enabledNetworkMap → Persistent banner
- [ ] Domain mappings with deprecated network client IDs → Lockout errors (different error than polling)

- The Sentry decrease confirms Migration 171's filtering worked for polling, but users are now hitting different code paths that don't have the same protection.

### Scenario

_No response_

### Design

_No response_

### Technical Details

_No response_

### Threat Modeling Framework

_No response_

### Acceptance Criteria

_No response_

### Stakeholder review needed before the work gets merged

- [ ] Engineering (needed in most cases)
- [ ] Design
- [ ] Product
- [ ] QA (automation tests are required to pass before merging PRs but not all changes are covered by automation tests - please review if QA is needed beyond automation tests)
- [ ] Security
- [ ] Legal
- [ ] Marketing
- [ ] Management (please specify)
- [ ] Other (please specify)

### References

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing issues 36992 and 33432, then trace NetworkEnablementController, SelectedNetworkController, enabledNetworkMap, and the deprecated Goerli network path. Compare the persistent banner and lockout reports with the hypotheses in this issue. Done should address both listed deprecated-network failure modes, but acceptance criteria and test locations are not provided.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
networking
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.