Skip to content

fix: migrate hype slip44 correct value NE ctrl#26231

Merged
maxime-oe merged 1 commit intomainfrom
migration/fix-hype-nec-slip44
Feb 24, 2026
Merged

fix: migrate hype slip44 correct value NE ctrl#26231
maxime-oe merged 1 commit intomainfrom
migration/fix-hype-nec-slip44

Conversation

@maxime-oe
Copy link
Copy Markdown
Contributor

@maxime-oe maxime-oe commented Feb 18, 2026

Description

Context: HYPE token (eip155:999/slip44:2457) was incorrectly set to eip155:999/slip44:1 (1 instead of 2457)
for some users in NetworkEnablementController.nativeAssetIdentifiers state.
This is because https://chainid.network/chains.json is fetched to populate this state,
and that chainId "999" references a "WanChain testnet" instead of HyperEVM.
PR MetaMask/core#7975 addresses future population by forcing an
override at fetch-time.
However such fetching is not always triggered if an user had already added the network,
hence the need for this migration that - ontop of the PR above - will migrate the incorrect
entry ('eip155:999/slip44:1') to the correct one ('eip155:999/slip44:2457').

This migration will operate only if an entry already exists AND is not 'eip155:999/slip44:2457'.

Changelog

CHANGELOG entry: migrates NetworkEnablementController.nativeAssetIdentifiers['eip155:999'] to value eip155:999/slip44:2457 if applicable.

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/NEB-574

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

Note

Medium Risk
Touches persisted migration logic and mutates controller state in-place for affected users, so a bug could impact stored network asset identifiers. Scope is narrowly targeted to one key/value and is covered by focused unit tests and defensive guards.

Overview
Adds migration 121 to correct the persisted NetworkEnablementController.nativeAssetIdentifiers['eip155:999'] value to eip155:999/slip44:2457 only when the key exists and is set incorrectly; invalid/missing controller shapes are detected and reported via captureException without mutating state.

Introduces 121_utils.ts for type-guard/validation logic (with Sentry reporting) and adds Jest coverage for the main success path and all early-return/error conditions. Registers the new migration in migrations/index.ts and bumps @metamask/network-enablement-controller from ^4.1.0 to ^4.1.1.

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

@maxime-oe maxime-oe marked this pull request as ready for review February 18, 2026 16:33
@maxime-oe maxime-oe requested a review from a team as a code owner February 18, 2026 16:34
@github-actions
Copy link
Copy Markdown
Contributor

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.

@metamaskbot metamaskbot added the team-networks Networks team label Feb 18, 2026
@maxime-oe maxime-oe force-pushed the migration/fix-hype-nec-slip44 branch 3 times, most recently from 50949ce to ba86523 Compare February 18, 2026 19:38
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.75862% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.14%. Comparing base (8d668fa) to head (ba86523).
⚠️ Report is 32 commits behind head on main.

Files with missing lines Patch % Lines
app/store/migrations/120_utils.ts 80.00% 2 Missing and 1 partial ⚠️
app/store/migrations/120.ts 85.71% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #26231      +/-   ##
==========================================
+ Coverage   81.12%   81.14%   +0.02%     
==========================================
  Files        4404     4412       +8     
  Lines      114202   114563     +361     
  Branches    24577    24661      +84     
==========================================
+ Hits        92643    92964     +321     
- Misses      15138    15160      +22     
- Partials     6421     6439      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@maxime-oe maxime-oe force-pushed the migration/fix-hype-nec-slip44 branch from ba86523 to f78b782 Compare February 19, 2026 08:09
@maxime-oe maxime-oe force-pushed the migration/fix-hype-nec-slip44 branch from f78b782 to fb14fbd Compare February 19, 2026 08:26
Julink-eth
Julink-eth previously approved these changes Feb 19, 2026
@maxime-oe maxime-oe enabled auto-merge February 19, 2026 15:47
@maxime-oe maxime-oe force-pushed the migration/fix-hype-nec-slip44 branch 2 times, most recently from 87e8b48 to 99910f9 Compare February 20, 2026 08:26
@maxime-oe maxime-oe moved this to Needs dev review in PR review queue Feb 20, 2026
@maxime-oe maxime-oe force-pushed the migration/fix-hype-nec-slip44 branch from 99910f9 to b4cdc15 Compare February 23, 2026 11:13
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@maxime-oe maxime-oe force-pushed the migration/fix-hype-nec-slip44 branch from b4cdc15 to 5969ed6 Compare February 23, 2026 13:03
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAccounts, SmokeConfirmations, SmokeIdentity, SmokeNetworkAbstractions, SmokeNetworkExpansion, SmokeTrade, SmokeWalletPlatform, SmokeCard, SmokePerps, SmokeRamps, SmokeMultiChainAPI, SmokePredictions, FlaskBuildTests
  • Selected Performance tags: @PerformanceAccountList, @PerformanceOnboarding, @PerformanceLogin, @PerformanceSwaps, @PerformanceLaunch, @PerformanceAssetLoading, @PerformancePredict, @PerformancePreps
  • Risk Level: high
  • AI Confidence: 100%
click to see 🤖 AI reasoning details

E2E Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/network-enablement-controller. Running all tests.

Performance Test Selection:
Hard rule (controller-version-update): @MetaMask controller package version updated in package.json: @metamask/network-enablement-controller. Running all tests.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM

@maxime-oe maxime-oe added this pull request to the merge queue Feb 23, 2026
@github-project-automation github-project-automation bot moved this from Needs dev review to Review finalised - Ready to be merged in PR review queue Feb 23, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 23, 2026
@maxime-oe maxime-oe added this pull request to the merge queue Feb 24, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 24, 2026
@maxime-oe maxime-oe added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit 324f3ef Feb 24, 2026
181 of 196 checks passed
@maxime-oe maxime-oe deleted the migration/fix-hype-nec-slip44 branch February 24, 2026 07:06
@github-actions github-actions bot locked and limited conversation to collaborators Feb 24, 2026
@metamaskbot metamaskbot added the release-7.68.0 Issue or pull request that will be included in release 7.68.0 label Feb 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.68.0 Issue or pull request that will be included in release 7.68.0 size-M team-networks Networks team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants