chore(perps): adopt @metamask/perps-controller 19.0.0 (HyperLiquid SDK 0.33.3) - #37025
Conversation
|
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. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Smart E2E Test SelectionSelected E2E tags: ALL Selected Performance tags: @PerformancePreps AI Confidence: 100 E2E reasoningExpand to readThe PR makes the following changes:
Directly impacted flows: SmokePerps (perps trading, Add Funds, balance verification), SmokeWalletPlatform (Trending tab where Perps is embedded), SmokeConfirmations (Add Funds deposits are on-chain transactions). Why ALL: The hard rule seed mandates ALL due to the controller package version update. The major version bump to perps-controller (v18→v19) with API renames in the integration harness confirms this is a meaningful breaking change that warrants broad test coverage to ensure no regressions in adjacent flows. While the blast radius appears focused on Perps, the controller update could have indirect effects on wallet state management. Performance reasoningExpand to readThe @metamask/perps-controller major version bump (v18→v19) changes the HyperLiquidWalletService API (isKeyringUnlocked→isMainAccountSignerReady, isSelectedHardwareWallet→requiresSignatureConfirmation). These are core service methods used in the perps flow including market loading, position management, and the Add Funds flow. The @PerformancePreps tag covers perps market loading, position management, add funds flow, and order execution — all of which could be affected by the controller API changes. The liquidatedUser optional field change could also affect transaction history rendering performance in the perps activity list. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #37025 +/- ##
==========================================
- Coverage 86.49% 86.49% -0.01%
==========================================
Files 7338 7340 +2
Lines 208093 208113 +20
Branches 51575 51574 -1
==========================================
+ Hits 179993 180009 +16
- Misses 16761 16762 +1
- Partials 11339 11342 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…k#10591) ## Explanation Bumps `@nktkas/hyperliquid` from `^0.33.1` to `^0.33.3` in `@metamask/perps-controller` ([v0.33.2](https://github.com/nktkas/hyperliquid/releases/tag/v0.33.2), [v0.33.3](https://github.com/nktkas/hyperliquid/releases/tag/v0.33.3)). - **Yarn patch dropped.** The patch (MetaMask#9471) stripped `/// <amd-module name="file:///home/runner/...">` directives from the SDK's `.d.ts` files. `0.33.3` no longer ships them, so the patch and its root `resolutions` entry are gone. The built `dist` has no `file:///` references. - **`dexAbstraction` migration removed.** `0.33.2` dropped `dexAbstraction` from `userAbstraction` / `userSetAbstraction` to match the API: HyperLiquid retired the mode (the live `userAbstraction` endpoint now returns `"default"` for the SDK's former `dexAbstraction` fixture users). The `userSetAbstraction` main-wallet migration and its "don't re-prompt after a rejection" cache were dead, so they are removed. `default` / `disabled` accounts still migrate through `agentSetAbstraction`, and deferral with `allowUserSigning: false` is unchanged. An unexpected `dexAbstraction` response now takes the existing unknown-mode bail. - **New order types.** `FrontendOrder.orderType` adds `Twap Slice`, `Vault Close` and `Spot Dust Conversion`. They are mapped explicitly to `'market'` in historical orders, which is what the fallback already returned. - **Type-only breaks:** `OrderFill.liquidation.liquidatedUser` is now optional (HyperLiquid omits it on some liquidation fills), and the re-exported `FrontendOrder.orderType` union gains the three values above. Mobile (`PerpsFillTag`) and Extension (`perps-fill-tag`) already guard `liquidatedUser` at runtime; their local `transactionHistory` types declare it as `string` and may need `?` when adopting this release. - **Historical order statuses.** Every `OrderProcessingStatus` from the SDK now maps explicitly (exhaustive `satisfies` map): the specific `*Rejected` statuses report `rejected` and `outcomeSettledCanceled` / `internalCancel` report `canceled`, where they previously fell through to `queued`. - **Unified-account migration lock.** Waiters re-check the in-flight lock after each wait (same pattern as the referral lock), so an attempt that ends without caching a result (e.g. deferred at init for a hardware wallet) no longer lets every waiter run `agentSetAbstraction` concurrently. ## References - Fixes [TAT-4044](https://consensyssoftware.atlassian.net/browse/TAT-4044) - Mobile validation (draft, preview build `18.0.1-preview-2848be6`, device recipe evidence): MetaMask/metamask-mobile#37025 - Upstream schema change: nktkas/hyperliquid#167 ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md) - [ ] I've introduced [breaking changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md) in this PR and have prepared draft pull requests for clients and consumer packages to resolve them [TAT-4044]: https://consensyssoftware.atlassian.net/browse/TAT-4044?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Replace the preview build with the released 19.0.0.
|
|
| Platform | Device | Reason | Recording |
|---|---|---|---|
| Android | Google Pixel 8 Pro (v14.0) | no_performance_metrics | 📹 Watch |
🔬 App profiling check · Current run 36692716471 · Baseline (last green on main) run 33753179927 @ e869913
Summary:
ℹ️ API calls unavailable:
Network logs API error: Bad Request
Full metric table (+10% variance rules)
Disclaimer — allowed variance: a +10% margin over the baseline is permitted.
- If
Current <= Baseline + 10%, treated as acceptable noise.- If
Current > Baseline + 10%, Current and variance % are highlighted with⚠️ .
| Metric | Baseline | Current | Δ |
|---|---|---|---|
| CPU avg | 9.62% | 7.55% | -2.07 (-21.5%) |
| CPU max | 25.7% | 23.83% | -1.87 (-7.3%) |
| Memory avg | 857.09 MB | 809.72 MB | -47.37 (-5.5%) |
| Memory max | 1065.02 MB | 1035.83 MB | -29.19 (-2.7%) |
| Slow frames | 11.19% | 25.54% | +14.35 (+128.2%) |
| Frozen frames | 0% | 0% | 0 (0%) |
| ANRs | 0 | 0 | 0 (0%) |
| Issues | 2 | 3 | +1 (+50%) |
| Critical issues | 2 | 2 | 0 (0%) |
| App size | 346.62 MB | 405.7 MB | +59.08 (+17%) |
✅ Passed Tests (1)
| Test | Platform | Device | Duration | Team | Recording |
|---|---|---|---|---|---|
| Perps add funds | Android | Google Pixel 8 Pro (v14.0) | 6.59s | @mm-perps-engineering-team | 📹 Watch |
Branch: TAT-4044-chore-perps-controller-next-preview-0210 · Build: E2E · Commit: b5597bc · View full run



Description
Adopts
@metamask/perps-controller19.0.0 and@nktkas/hyperliquid^0.33.3.19.0.0 (core Release 1303.0.0) carries HyperLiquid SDK 0.33.3 (MetaMask/core#10591: retired
dexAbstractionmigration removed, every HyperLiquid order status mapped explicitly, unified-account migration lock fix) plus #10464, #10414, #10559, #10588 and #10589.Mobile adaptations for the breaking changes:
liquidation.liquidatedUseris optional in the localtransactionHistorytype, matching the controller (HyperLiquid omits it on some liquidation fills).PerpsFillTagalready guarded it at runtime; two tests cover fills without it.HyperLiquidWalletServicewith the method names chore: Create app launch times pipeline #10559 renamed (isMainAccountSignerReady,requiresSignatureConfirmation); without it 7 integration tests fail against 19.0.0.This supersedes #36966, which backports #10559 onto 18.0.1 through a Yarn patch.
The release was first validated on device through the preview build
18.0.1-preview-2848be6, then re-validated on 19.0.0 itself (evidence below).Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/TAT-4044
Refs: MetaMask/core#10591, #36966
Manual testing steps
Recipe evidence:
passpr-package/evidence.mdpr-package/recipe-quality.jsonpr-package/runs/artifacts-recipe-run/Validated on the iOS simulator with an automated recipe on 19.0.0 (98/98 nodes pass); see screenshots below.
Screenshots/Recordings
Screenshots are grouped for quick reviewer comparison.
Before
N/A: dependency upgrade with no intended UI change; the same screens on
mainuse 18.0.1.After
Recipe evidence below (iOS simulator, HyperLiquid testnet, perps-controller 19.0.0, 98/98 nodes).
Recipe evidence
Use concise captions; edit into a clearer before/after table when that helps review.
pr-package/images/01-ui-screenshot-screenshot.pngpr-package/images/02-ui-screenshot-screenshot.pngpr-package/images/03-ui-screenshot-screenshot.pngpr-package/images/04-ui-screenshot-screenshot.pngRecipe artifact package
Task path:
/Users/deeeed/dev/metamask/metamask-mobile-4/temp/tasks/recipe-cook/20260930T021012Z-perps-controller-next-previewPR package:
/Users/deeeed/dev/metamask/metamask-mobile-4/temp/tasks/recipe-cook/20260930T021012Z-perps-controller-next-preview/pr-packagepr-package/evidence.mdpr-package/recipe-quality.jsonpr-package/images/pr-package/checklist.mdpr-package/runs/artifacts-recipe-run/Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist