fix(perps): skip unified migration for multi-sig accounts - #9764
Closed
abretonc7s wants to merge 3 commits into
Closed
fix(perps): skip unified migration for multi-sig accounts#9764abretonc7s wants to merge 3 commits into
abretonc7s wants to merge 3 commits into
Conversation
Opening the Perps tab with a HyperLiquid multi-sig account raised
`ApiRequestError: Multi-sig required` on every entry.
`#ensureUnifiedAccountEnabled` migrates legacy abstraction modes with a
single-signer `agentSetAbstraction` / `userSetAbstraction` write, which
HyperLiquid rejects outright for a converted multi-sig account. Nothing
classified the account shape before the write or the rejection after it,
so it fell through to the generic failure handler: no cache entry, retry
flag set, error reported.
Query `userToMultiSigSigners` immediately before the migration write and
skip it for a multi-sig account, recording the setup as not applicable
and caching `{ attempted: true, enabled: false }` so it is not retried.
The lookup only runs when a write would otherwise be made, so accounts
already on a compatible mode and deferred accounts pay no extra round
trip, and it fails open so a transient info-API error cannot block
migration for a single-signer account.
Add `isHyperLiquidMultiSigRequiredError` and apply it in the same
method's catch block, covering the conversion racing the write and the
failed-open probe. Both `multi-sig required` and `multisig required`
spellings are matched.
Fixes TAT-3214
The Unreleased entry documented the classifier as exported from `@metamask/perps-controller/utils`, but the package exports map declares `./utils/*` with no bare `./utils`, so that specifier fails to resolve with ERR_PACKAGE_PATH_NOT_EXPORTED. Point it at `utils/*`, matching the neighbouring floorToSizeDecimals entry. Refs TAT-3214
abretonc7s
marked this pull request as ready for review
August 4, 2026 13:43
abretonc7s
temporarily deployed
to
default-branch
August 4, 2026 13:43 — with
GitHub Actions
Inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation
Opening Perps for a HyperLiquid multi-sig account attempted a single-signer unified-account migration on every entry, producing
Multi-sig requiredand recurring error reports.This change detects the account signer set before that write, skips migration for multi-sig accounts, and caches the final non-unified readiness state. It also handles a conversion race by classifying the same rejection in the write fallback.
Validation
main: reproducedMulti-sig requiredandUnified Account setup failed.@metamask/perps-controllersuite and root build passed before the final rebase. Required GitHub checks provide the authoritative post-rebase validation.This is a headless controller change, so visual evidence does not apply.
References
ApiRequestError: Multi-sig requiredmetamask-mobile#34170Checklist
Note
Low Risk
Scoped to unified-account setup in
HyperLiquidProviderwith fail-open probing and extensive tests; no changes to order placement or auth beyond skipping an impossible migration.Overview
Fixes recurring
Multi-sig requiredfailures when opening Perps for HyperLiquid accounts that were converted to multi-sig, where each visit retried a single-signer unified-account migration that the venue cannot accept.The provider now calls
userToMultiSigSignersimmediately before a migration write would run (only on paths that need migration, so already-unified accounts are unchanged). Multi-sig accounts skipagentSetAbstraction/userSetAbstraction, record trading readiness as{ attempted: true, enabled: false }, and emit account-setup analytics withnot_applicable/multi_sig_accountinstead of treating setup as failed.A new exported helper
isHyperLiquidMultiSigRequiredErrorclassifies HyperLiquid’s multi-sig rejection (both hyphen spellings). The migration catch path uses it as a fallback when the probe fails open on network errors or the account flips multi-sig between probe and write, so those cases are not logged as setup failures or retried endlessly.Unified mode stays off for these users; HIP-3 collateral continues via the existing programmatic transfer fallback.
Reviewed by Cursor Bugbot for commit 42d5ebd. Bugbot is set up for automated code reviews on this repo. Configure here.