Skip to content

Conversation

@tuna1207
Copy link
Member

@tuna1207 tuna1207 commented Nov 22, 2025

Description

This PR updates the Shield subscription feature to properly handle multichain account scenarios where the currently selected account may be a non-EVM account (e.g., Bitcoin, Solana). Previously, Shield subscription features would fail or throw errors when a non-EVM account was selected, as Shield is only supported for EVM accounts.

  1. Multichain account support: Added OTHER account type to ShieldUserAccountTypeEnum to handle cases where the selected account is non-EVM (Bitcoin, Solana, etc.)

  2. EVM account selection: Updated Shield subscription hooks and metrics to explicitly select EVM accounts (using eip155:1 CAIP-2 identifier) instead of relying on the currently selected account, which may be non-EVM

Open in GitHub Codespaces

Changelog

CHANGELOG entry: Fixed Shield subscription feature to properly handle multichain scenarios where non-EVM accounts (Bitcoin, Solana) are selected

Related issues

Fixes: #38131

Manual testing steps

  1. Set up a wallet with both EVM and non-EVM accounts (e.g., Bitcoin or Solana account)
  2. Select a non-EVM account as the active account
  3. Navigate to Shield subscription features (e.g., Shield plan page, subscription settings)
  4. Verify that Shield subscription features work correctly and use the EVM account for balance calculations and metrics
  5. Verify that metrics tracking properly categorizes the account as OTHER when a non-EVM account is selected
  6. Test Shield subscription eligibility checks with non-EVM account selected
  7. Test Shield subscription pricing and payment token selection with non-EVM account selected

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

Cursor Bugbot is generating a summary for commit a3579a5. Configure here.

@metamaskbot metamaskbot added the team-onboarding Onboarding team label Nov 22, 2025
@metamaskbot
Copy link
Collaborator

✨ Files requiring CODEOWNER review ✨

🔐 @MetaMask/web3auth (2 files, +23 -6)
  • 📁 ui/
    • 📁 hooks/
      • 📁 subscription/
        • 📄 useSubscription.ts +5 -3
        • 📄 useSubscriptionPricing.ts +18 -3

@tuna1207 tuna1207 added team-shield Shield team area-shield and removed team-onboarding Onboarding team labels Nov 22, 2025
@tuna1207 tuna1207 marked this pull request as ready for review November 22, 2025 05:52
@tuna1207 tuna1207 requested a review from a team as a code owner November 22, 2025 05:52
@metamaskbot
Copy link
Collaborator

Builds ready [a3579a5]
UI Startup Metrics (1231 ± 104 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup12311047155010412891394
load104789312799211131217
domContentLoaded104189012689111091209
domInteractive231485171977
firstPaint60180128342610641198
backgroundConnect21319027015217244
firstReactRender301972113651
getState341776113955
initialActions106112
loadScripts835681103789902997
setupStore1163241219
numNetworkReqs1257720572
BrowserifyPower User HomeuiStartup18721551275425320282353
load992883163114210101406
domContentLoaded97787516201409871395
domInteractive33171803329144
firstPaint5128416793849171320
backgroundConnect22120027514227254
firstReactRender86461722194131
getState17613038849191307
initialActions1010114
loadScripts77467014131407871186
setupStore19104292637
numNetworkReqs1046527044121204
WebpackStandard HomeuiStartup824730106574875964
load61555782361622786
domContentLoaded61055481460618775
domInteractive2414102202082
firstPaint20384807124199599
backgroundConnect1253981528
firstReactRender3120170193337
getState291356103644
initialActions104112
loadScripts60755280558616766
setupStore1273341419
numNetworkReqs1257719569
WebpackPower User HomeuiStartup14701205259224216061958
load68159213501326891025
domContentLoaded67058613411316711014
domInteractive37182014030156
firstPaint276801054194301649
backgroundConnect1585461824
firstReactRender85541071292105
getState15812228334164262
initialActions103112
loadScripts66758413311296691002
setupStore21970122745
numNetworkReqs1456429852189265
FirefoxBrowserifyStandard HomeuiStartup12471067156910912901476
load104991512497811041217
domContentLoaded104791112497911001217
domInteractive66302344183155
firstPaint------
backgroundConnect352388133874
firstReactRender22183642334
getState146151211134
initialActions103122
loadScripts102790112287610821186
setupStore12681101326
numNetworkReqs1156715659
BrowserifyPower User HomeuiStartup26001892360233628033233
load1159964156217312641528
domContentLoaded1159955156117312641528
domInteractive13434614117155423
firstPaint------
backgroundConnect18029926207194791
firstReactRender87381341795115
getState25584887253198820
initialActions2114227
loadScripts1123930153216612111489
setupStore1065831162113539
numNetworkReqs90582164088188
WebpackStandard HomeuiStartup14771301194613015421761
load1255109615309913171463
domContentLoaded1254109615309913171463
domInteractive63292303582130
firstPaint------
backgroundConnect42181432544106
firstReactRender302182123063
getState136153171241
initialActions103012
loadScripts1228107914939012931397
setupStore13671121140
numNetworkReqs1256717663
WebpackPower User HomeuiStartup28872120374433430723512
load14041108200219515881735
domContentLoaded14031108200219615881734
domInteractive12428639131138459
firstPaint------
backgroundConnect15923724177175610
firstReactRender85431441893125
getState28886949278279868
initialActions4154838
loadScripts13711092188918815611711
setupStore1155813188107720
numNetworkReqs90582144483203
📊 Page Load Benchmark Results

Current Commit: a3579a5 | Date: 11/22/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.04s (±39ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 725ms (±36ms) 🟢 | historical mean value: 731ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±12ms) 🟢 | historical mean value: 80ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.04s 39ms 1.02s 1.32s 1.08s 1.32s
domContentLoaded 725ms 36ms 706ms 987ms 753ms 987ms
firstPaint 77ms 12ms 60ms 176ms 84ms 176ms
firstContentfulPaint 77ms 12ms 60ms 176ms 84ms 176ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 53 Bytes (0%)
  • ui: 468 Bytes (0.01%)
  • common: 126 Bytes (0%)

@tuna1207 tuna1207 changed the title fix: shield handle evm account only from account group (multichain) fix: shield handle evm account only from account group (multichain) cp-13.11.0 Nov 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

4 participants