Repository navigation
chore: bump @metamask/perps-controller from ^20.1.0 to ^22.1.1 - #47600
Conversation
Co-authored-by: Amélie <ameliejyc@users.noreply.github.com>
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/perps (5 files, +100 -16)
📜 @MetaMask/policy-reviewers (8 files, +24 -112)
Tip Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Builds ready [05eecb0]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 3 warn · 🔴 3 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
| "@metamask/permission-log-controller": "^5.0.0", | ||
| "@metamask/permissions-kernel-snap": "^1.3.0", | ||
| "@metamask/perps-controller": "^20.1.0", | ||
| "@metamask/perps-controller": "^22.1.1", |
There was a problem hiding this comment.
@metamask/perps-controller@22.1.0 stops resubmitting an opening order 1.5% larger when Hyperliquid rejects it for the $10 minimum, and returns ORDER_SIZE_MIN instead. In 20.1.0, HyperLiquidProvider.placeOrder grew usdAmount by 1.015 and retried once.
Order entry already disables submit below PERPS_MIN_MARKET_ORDER_USD ($10), so the remaining case is a size the form accepts whose venue price still falls under $10. ERROR_CODE_TO_I18N_KEY in ui/components/app/perps/utils/translate-perps-error.ts maps that code to perpsOrderFailed ("Order could not be placed. Try again."), which submits the same size again.
Core 22.1.0 says the client should re-quote and ask the user to confirm a larger size. The changelog entry and manual steps only cover the userFills reconnect. Handle this result (re-quote, or show perpsMinOrderSize) and add a minimum-notional open to the test plan.
|
@MetaMask/policy-reviewers I have review the policy diff for @metamask/perps-controller ^20.1.0 → ^22.1.1 bump. No new powers and no new packages:
|
…polia deposits, grant fee source) Co-authored-by: Amélie <ameliejyc@users.noreply.github.com>
Builds ready [a3f83e6]
⚡ Performance Benchmarks (Total: 🟢 7 pass · 🟡 3 warn · 🔴 3 fail)
Bundle Size Diffs [🚨 Warning! Bundle size has increased!]
|
|



Description
Bumps
@metamask/perps-controllerfrom^20.1.0to^22.1.1so the extension picks up MetaMask/core#11160, which prevents HyperLiquiduserFillsfrom going silent after a WebSocket reconnect when an in-flight subscribe races withrestoreSubscriptions. That fix was released in core release1384.0.0.Notes on the bump:
21.0.0,22.0.0).@metamask/[email protected]was already resolved transitively via@metamask/transaction-pay-middleware, so the version bump itself compiles with no changes; the UI adaptations below (ported from the earlier, now-closed #47337) keep perps behavior correct on 22.x.ui/components/app/perps/hooks/usePerpsNetworkManagement.ts: on testnet, ensure the Arbitrum Sepolia network (where HyperLiquid testnet deposits now settle USDC2 after the 22.0.0 change) instead of always Arbitrum One, gated onselectPerpsIsTestnet.ui/hooks/perps/usePerpsOrderFees.ts: treat the new'grant'PerpsFeeSourceas a fee-reducing source alongsiderewards/subscription.ui/pages/perps/perps-withdraw-page.test.tsx: update the testnet USDC asset-id mock to USDC2.yarn.locknow dedupes the direct dependency andtransaction-pay-middleware's^22.0.0range onto a single22.1.1, and perps-controller now pullsuuid@^14(already present in the tree).yarn lavamoat:auto): the duplicatetransaction-pay-middleware>@metamask/perps-controllerentries collapse into the shared@metamask/perps-controller, and@metamask/perps-controller>uuidmoves fromcryptoto the finer-grainedcrypto.getRandomValues/crypto.randomUUIDthatuuid@14uses.yarn lint:tscpasses and the affected perps unit suites (72 tests across the three touched files) pass.Changelog
CHANGELOG entry: Fixed HyperLiquid live fills going silent after a WebSocket reconnect by updating
@metamask/perps-controllerto22.1.1.Related issues
Related to: #47287
Manual testing steps
Pre-merge author checklist
Pre-merge reviewer checklist
Slack Thread
Note
Medium Risk
Changes deposit network preflight and fee UI for testnet/grant paths, plus dependency and LavaMoat policy updates around crypto globals used by perps flows.
Reviewed by Cursor Bugbot for commit a3f83e6. Bugbot is set up for automated code reviews on this repo. Configure here.