Skip to content

test(benchmarks): port the completed Solana discovery mocks into the benchmark suite - #45443

Open
MajorLift wants to merge 1 commit into
mainfrom
jongsun/test/benchmark-solana-discovery-mocks
Open

test(benchmarks): port the completed Solana discovery mocks into the benchmark suite#45443
MajorLift wants to merge 1 commit into
mainfrom
jongsun/test/benchmark-solana-discovery-mocks

Conversation

@MajorLift

@MajorLift MajorLift commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Changelog

CHANGELOG entry: null

Description

#43961 completed SOLANA_DISCOVERY_RPC_RESULTS in test/e2e/mock-e2e.js, giving every JSON-RPC method the Solana snap calls during account discovery a well-formed result. The benchmark suite is a separate mock implementation in test/e2e/benchmarks/mocks/ and never loaded that helper, so it kept the defect the earlier PR removed.

It matched 8 of the 15 discovery methods. The other 7 — getGenesisHash, getHealth, getVersion, getSlot, getMultipleAccounts, getProgramAccounts, getTokenAccountBalance, getEpochInfo — fell through to solanaCatchAllResponse, which returns:

result: { context: { slot: 250000000 }, value: null },

That is a valid JSON-RPC envelope with the wrong shape for every one of them: getGenesisHash expects a string, getVersion an object, getSlot a number, getHealth "ok". This is the condition #43961 measured — malformed bodies throw inside the snap and restart discovery, a ~516-request retry storm.

This commit ports that result map into the benchmark fixtures and registers each method at HIGH_PRIORITY. Each is matched on its own method name, so the 8 existing handlers and their calibrated delays are untouched.

Verification

Coverage of the discovery method set, computed from the two files:

explicit handlers : 8
ported defaults   : 8   getEpochInfo getGenesisHash getHealth getMultipleAccounts
                        getProgramAccounts getSlot getTokenAccountBalance getVersion
overlap           : none
snap discovery set covered: 15/15
still uncovered           : NONE

tsc clean on both files, oxfmt clean, and the benchmark tooling suites pass (16 suites, 414 tests).

There is no test here that fails without this change, and this PR does not claim one. The benchmark mock suite has no unit coverage, and the defect only manifests when a real Solana snap parses a real response — the passing suites show nothing regressed, not that this fixes anything.

The check is the next main run, and it is falsifiable: onboardingNewWallet.doneButtonToAssetList currently lands at ~1.7–2.5s or ~8.4–10.2s with nothing between, on 24 of 65 sampled iterations slow (#45266). If this is the cause, that collapses to the single fast mode. If it does not move, the Solana attribution in #45266 is wrong and the search reopens — which is a useful result either way, and the reason this is worth landing before the instrumentation rather than after it.

Follow-up

The two mock suites are parallel implementations of overlapping behaviour, and this is the second fix to one that did not reach the other. Filed separately rather than expanded here.

Related issues

Fixes: #45266

Manual testing steps

  1. yarn jest development/metamaskbot-build-announce/ test/e2e/benchmarks/utils/
  2. On the next main run, read per-iteration doneButtonToAssetList from the run-benchmarks / chrome-webpack-userJourneyOnboardingNew job log and confirm the slow cluster is absent.

Pre-merge author checklist


Note

Low Risk
Test-only mock changes in the benchmark suite; no production, auth, or data-handling code is modified.

Overview
Ports the completed SOLANA_DISCOVERY_RPC_RESULTS map from the shared e2e suite into the benchmark mocks so Solana discovery methods no longer fall through to the wrong-shaped catch-all.

Adds well-formed responses for getGenesisHash, getHealth, getVersion, getSlot, getMultipleAccounts, getProgramAccounts, getTokenAccountBalance, and getEpochInfo, and registers each at HIGH_PRIORITY with a 100ms delay. Existing calibrated handlers are left untouched.

This targets the intermittent ~6.5s slow path in onboarding benchmarks caused by malformed RPC bodies restarting Solana snap discovery.

Reviewed by Cursor Bugbot for commit f798148. Bugbot is set up for automated code reviews on this repo. Configure here.

@MajorLift
MajorLift deployed to pr-comment August 12, 2026 09:20 — with GitHub Actions Active
@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.

@metamask-ci metamask-ci Bot added team-extension-platform Extension Platform team INVALID-PR-TEMPLATE PR's body doesn't match template labels Aug 12, 2026
@MajorLift
MajorLift deployed to pr-comment August 12, 2026 09:21 — with GitHub Actions Active
@metamask-ci

metamask-ci Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
Builds ready [ea053df] [reused from 244ac8b]
⚡ Performance Benchmarks (Total: 🟢 12 pass · 🟡 6 warn · 🔴 4 fail)

Baseline (latest main): 171ed20 | Date: 7/28/2026 | Pipeline: 31582455153 | Baseline logs

Metricschrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🔴 doneButtonToHomeScreen(p95) [CI log]🔴 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🔴 longTaskMaxDuration(p95) [CI log]🔴 [CI log]

Regressions (🔴 4 failures)

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 load_new_account
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/inp: -24%
  • loadNewAccount/fcp: -12%
  • loadNewAccount/lcp: -12%
  • confirmTx/longTaskCount: -67%
  • confirmTx/longTaskTotalDuration: -68%
  • confirmTx/longTaskMaxDuration: -13%
  • confirmTx/tbt: -69%
  • confirmTx/inp: -32%
  • confirmTx/fcp: -28%
  • confirmTx/lcp: -12%
  • bridgeUserActions/bridge_load_page: -29%
  • bridgeUserActions/bridge_load_asset_picker: -40%
  • bridgeUserActions/longTaskCount: -100%
  • bridgeUserActions/longTaskTotalDuration: -100%
  • bridgeUserActions/longTaskMaxDuration: -100%
  • bridgeUserActions/tbt: -100%
  • bridgeUserActions/total: -17%
  • bridgeUserActions/fcp: -31%
  • bridgeUserActions/lcp: -21%
  • loadNewAccount/load_new_account: +21%
  • loadNewAccount/total: +21%
  • loadNewAccount/inp: -24%
  • loadNewAccount/lcp: +1128%
  • confirmTx/longTaskCount: -100%
  • confirmTx/longTaskTotalDuration: -100%
  • confirmTx/longTaskMaxDuration: -100%
  • confirmTx/tbt: -100%
  • confirmTx/inp: -24%
  • confirmTx/lcp: +1194%
  • bridgeUserActions/bridge_load_page: +206%
  • bridgeUserActions/bridge_load_asset_picker: +87%
  • bridgeUserActions/longTaskCount: -100%
  • bridgeUserActions/longTaskTotalDuration: -100%
  • bridgeUserActions/longTaskMaxDuration: -100%
  • bridgeUserActions/tbt: -100%
  • bridgeUserActions/total: +23%
  • bridgeUserActions/inp: +100%
  • bridgeUserActions/lcp: +1126%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 1.9s
  • 🟡 bridgeUserActions/INP: p75 208ms
  • 🟡 bridgeUserActions/FCP: p75 1.8s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
startupPowerUserHome
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/firstReactRender: -99%
  • startupStandardHome/numNetworkReqs: -14%
  • startupStandardHome/domInteractive: -29%
  • startupStandardHome/firstReactRender: -98%
  • startupStandardHome/numNetworkReqs: -13%
  • startupStandardHome/fcp: -24%
  • startupPowerUserHome/uiStartup: -35%
  • startupPowerUserHome/load: -25%
  • startupPowerUserHome/domContentLoaded: -25%
  • startupPowerUserHome/backgroundConnect: -25%
  • startupPowerUserHome/firstReactRender: -99%
  • startupPowerUserHome/initialActions: +11%
  • startupPowerUserHome/loadScripts: -26%
  • startupPowerUserHome/setupStore: -76%
  • startupPowerUserHome/numNetworkReqs: +12%
  • startupPowerUserHome/inp: -36%
  • startupPowerUserHome/fcp: -11%
  • startupPowerUserHome/lcp: -30%
User Journey Benchmarks · Samples: 5 · mock API 🔴 4

⚠️ Missing data: chrome/webpack/userJourneyTransactions

Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🔴 [CI log]
🔴 doneButtonToHomeScreen
🔴 total
🔴 [CI log]
🔴 total
onboardingNewWallet
[Sentry log · main/release]
🔴 [CI log]
🔴 total
🔴 [CI log]
🔴 total
assetDetails
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
solanaAssetDetails
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
importSrpHome
[Sentry log · main/release]
🟡 [CI log]
🟡 total
🟢 [CI log]
sendTransactions
[Sentry log · main/release]
🟡 [CI log]
swap
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/srpButtonToSrpForm: -13%
  • onboardingImportWallet/confirmSrpToPwForm: -19%
  • onboardingImportWallet/pwFormToMetricsScreen: -18%
  • onboardingImportWallet/metricsToWalletReadyScreen: -42%
  • onboardingImportWallet/doneButtonToHomeScreen: +41%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +75%
  • onboardingImportWallet/longTaskTotalDuration: -24%
  • onboardingImportWallet/longTaskMaxDuration: -13%
  • onboardingImportWallet/tbt: -27%
  • onboardingImportWallet/total: +48%
  • onboardingNewWallet/agreeButtonToOnboardingSuccess: -19%
  • onboardingNewWallet/longTaskMaxDuration: +10%
  • onboardingNewWallet/tbt: +21%
  • solanaAssetDetails/assetClickToPriceChart: +286%
  • solanaAssetDetails/longTaskCount: -100%
  • solanaAssetDetails/longTaskTotalDuration: -100%
  • solanaAssetDetails/longTaskMaxDuration: -100%
  • solanaAssetDetails/tbt: -100%
  • solanaAssetDetails/total: +286%
  • solanaAssetDetails/inp: +35%
  • importSrpHome/loginToHomeScreen: +31%
  • importSrpHome/openAccountMenuAfterLogin: +12%
  • importSrpHome/homeAfterImportWithNewWallet: +33%
  • importSrpHome/longTaskCount: +27%
  • importSrpHome/longTaskTotalDuration: +22%
  • importSrpHome/longTaskMaxDuration: -15%
  • importSrpHome/tbt: +17%
  • importSrpHome/total: +32%
  • importSrpHome/inp: -17%
  • importSrpHome/fcp: +11%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 importSrpHome/INP: p75 256ms
  • 🟡 importSrpHome/FCP: p75 1.9s
  • 🟡 assetDetails/FCP: p75 2.0s
  • 🟡 assetDetails/LCP: p75 2.9s
  • 🟡 solanaAssetDetails/FCP: p75 2.1s
  • 🟡 solanaAssetDetails/LCP: p75 2.7s
  • 🟡 sendTransactions/FCP: p75 2.0s
  • 🟡 sendTransactions/LCP: p75 2.6s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • dappPageLoad/pageLoadTime: -58%
  • dappPageLoad/firstPaint: -46%
  • dappPageLoad/firstContentfulPaint: -46%
Bundle size diffs
  • background: 0 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 0 Bytes (0%)
  • other: 0 Bytes (0%)
  • contentScripts: 0 Bytes (0%)
  • zip: 0 Bytes (0%)

#43961 completed `SOLANA_DISCOVERY_RPC_RESULTS` in `test/e2e/mock-e2e.js`,
but the benchmark suite is a separate mock implementation that never loaded
that helper, so it kept the defect. It matched 8 of the 15 JSON-RPC methods
the Solana snap calls during discovery; the other 7 fell through to
`solanaCatchAllResponse`, whose `{ context, value: null }` is the wrong shape
for a genesis hash, a version object, a slot number or a health string.

This is the mechanism #43961 measured — malformed bodies throw inside the
snap and restart discovery — and it is the likely source of the ~6.5s slow
path #45266 sees on 37% of iterations. Verifiable on the next run:
`doneButtonToAssetList` should collapse to its single ~1.7-2.5s mode.
@MajorLift
MajorLift force-pushed the jongsun/test/benchmark-solana-discovery-mocks branch from ea053df to f798148 Compare August 12, 2026 10:34
@MajorLift
MajorLift deployed to pr-comment August 12, 2026 10:34 — with GitHub Actions Active
@MajorLift
MajorLift deployed to pr-comment August 12, 2026 10:35 — with GitHub Actions Active
@metamask-ci

metamask-ci Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor
Builds ready [f798148] [reused from cc5d691]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 5 warn · 🔴 4 fail)

Baseline (latest main): 171ed20 | Date: 7/28/2026 | Pipeline: 31588057566 | Baseline logs

Metricschrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🔴 srpButtonToSrpForm(p95) [CI log]🔴 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🔴 doneButtonToAssetList(p95) [CI log]🔴 [CI log]

Regressions (🔴 4 failures)

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟡 [CI log]
🟡 load_new_account
🟡 [CI log]
🟡 load_new_account
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • loadNewAccount/load_new_account: +17%
  • loadNewAccount/total: +17%
  • loadNewAccount/inp: +14%
  • confirmTx/longTaskTotalDuration: -18%
  • confirmTx/longTaskMaxDuration: +33%
  • confirmTx/tbt: -32%
  • bridgeUserActions/bridge_load_asset_picker: +80%
  • bridgeUserActions/longTaskCount: +11%
  • bridgeUserActions/longTaskTotalDuration: +11%
  • bridgeUserActions/tbt: +14%
  • bridgeUserActions/inp: +23%
  • loadNewAccount/load_new_account: +23%
  • loadNewAccount/total: +23%
  • loadNewAccount/inp: -17%
  • loadNewAccount/fcp: -45%
  • loadNewAccount/lcp: +1244%
  • confirmTx/longTaskCount: -100%
  • confirmTx/longTaskTotalDuration: -100%
  • confirmTx/longTaskMaxDuration: -100%
  • confirmTx/tbt: -100%
  • confirmTx/inp: -24%
  • confirmTx/fcp: -46%
  • confirmTx/lcp: +1298%
  • bridgeUserActions/bridge_load_page: +217%
  • bridgeUserActions/bridge_load_asset_picker: +170%
  • bridgeUserActions/longTaskCount: -100%
  • bridgeUserActions/longTaskTotalDuration: -100%
  • bridgeUserActions/longTaskMaxDuration: -100%
  • bridgeUserActions/tbt: -100%
  • bridgeUserActions/total: +25%
  • bridgeUserActions/inp: -23%
  • bridgeUserActions/lcp: +1197%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 bridgeUserActions/FCP: p75 1.8s
Startup Benchmarks · Samples: 100

⚠️ Missing data: firefox/webpack/startupPowerUserHome

Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • startupStandardHome/uiStartup: -18%
  • startupStandardHome/load: -15%
  • startupStandardHome/domContentLoaded: -15%
  • startupStandardHome/domInteractive: -14%
  • startupStandardHome/backgroundConnect: -11%
  • startupStandardHome/firstReactRender: -99%
  • startupStandardHome/initialActions: -33%
  • startupStandardHome/loadScripts: -15%
  • startupStandardHome/setupStore: -24%
  • startupStandardHome/numNetworkReqs: -14%
  • startupStandardHome/longTaskCount: -33%
  • startupStandardHome/longTaskTotalDuration: -23%
  • startupStandardHome/longTaskMaxDuration: -17%
  • startupStandardHome/tbt: -21%
  • startupStandardHome/fcp: -15%
  • startupStandardHome/lcp: +284%
  • startupStandardHome/uiStartup: -17%
  • startupStandardHome/load: -11%
  • startupStandardHome/domContentLoaded: -10%
  • startupStandardHome/domInteractive: +32%
  • startupStandardHome/firstReactRender: -99%
  • startupStandardHome/initialActions: -50%
  • startupStandardHome/loadScripts: -11%
  • startupStandardHome/numNetworkReqs: -13%
  • startupStandardHome/fcp: +34%
User Journey Benchmarks · Samples: 5 · mock API 🔴 4

⚠️ Missing data: chrome/webpack/userJourneyAssets, chrome/webpack/userJourneyTransactions, firefox/webpack/userJourneyTransactions

Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🔴 [CI log]
🔴 doneButtonToHomeScreen
🔴 total
🔴 [CI log]
🔴 total
onboardingNewWallet
[Sentry log · main/release]
🔴 [CI log]
🔴 total
🔴 [CI log]
🔴 total
importSrpHome
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]
assetDetails
[Sentry log · main/release]
🟡 [CI log]
solanaAssetDetails
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • onboardingImportWallet/srpButtonToSrpForm: +20%
  • onboardingImportWallet/confirmSrpToPwForm: +17%
  • onboardingImportWallet/metricsToWalletReadyScreen: -12%
  • onboardingImportWallet/doneButtonToHomeScreen: -13%
  • onboardingImportWallet/openAccountMenuToAccountListLoaded: +127%
  • onboardingImportWallet/longTaskCount: +43%
  • onboardingImportWallet/longTaskTotalDuration: +22%
  • onboardingImportWallet/longTaskMaxDuration: +10%
  • onboardingImportWallet/tbt: +22%
  • onboardingImportWallet/total: +21%
  • onboardingNewWallet/doneButtonToAssetList: +15%
  • onboardingNewWallet/longTaskTotalDuration: +12%
  • onboardingNewWallet/tbt: +50%
  • onboardingNewWallet/total: +14%
  • importSrpHome/longTaskCount: +13%
  • importSrpHome/longTaskMaxDuration: -24%
  • importSrpHome/tbt: -15%
  • importSrpHome/inp: -35%
  • importSrpHome/fcp: +14%
  • importSrpHome/lcp: +42%
  • importSrpHome/cls: +899%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 importSrpHome/FCP: p75 1.9s
  • 🟡 assetDetails/INP: p75 216ms
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • dappPageLoad/pageLoadTime: -58%
  • dappPageLoad/firstPaint: -46%
  • dappPageLoad/firstContentfulPaint: -46%
Bundle size diffs
  • background: 0 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 0 Bytes (0%)
  • other: 0 Bytes (0%)
  • contentScripts: 0 Bytes (0%)
  • zip: 0 Bytes (0%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

INVALID-PR-TEMPLATE PR's body doesn't match template risk:low size-S team-extension-platform Extension Platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P1] Onboarding benchmarks still take a ~7s slow path on 37% of iterations after #43961

1 participant