chore(runway): cherry-pick fix: hw account abstraction migration#30261
Merged
Conversation
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. |
Contributor
🔍 Smart E2E Test Selection⏭️ Smart E2E selection skipped - PR targets a release branch (release/*) All E2E tests pre-selected. |
|
owencraston
approved these changes
May 15, 2026
vpintorico
approved these changes
May 15, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.



Description
This PR prevents Perps from triggering browsing-time signing flows for
hardware wallet users while the screen is idle.
Previously, Unified Account setup only deferred the
dexAbstractionmigration when user signing was not allowed. Other signing-backed
HyperLiquid abstraction modes could still attempt setup during passive
Perps initialization, which could surface repeated hardware wallet
prompts without an explicit user action.
The fix adds a shared helper for deciding when Unified Account setup
must be deferred, applies it during HyperLiquid provider initialization,
and expands hardware wallet detection to cover MetaMask's hardware
keyring types: Ledger, Trezor, OneKey, Lattice, and QR hardware wallets.
Software wallets can still complete setup during initialization so the
first trade sees unified collateral, while hardware wallets defer setup
until an explicit trading or withdrawal action.
Changelog
CHANGELOG entry: Fixed a bug that could repeatedly prompt hardware
wallet users while Perps was idle.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
N/A. This is a controller behavior change with no intended UI changes.
Before
N/A
After
N/A
Pre-merge author checklist
Docs and MetaMask Mobile
Coding
Standards.
if applicable
guidelines).
Not required for external contributors.
Performance checks (if applicable)
SRPs
to import wallets with many accounts and tokens
performance metrics
trace()for usage andaddTokenfor an example
For performance guidelines and tooling, see the Performance
Guide.
Pre-merge reviewer checklist
app, test code being changed).
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Note
Medium Risk
Changes when unified-account migration and other signing-backed setup
runs, which can affect Perps initialization and migration behavior for
hardware wallet users. Risk is moderated by added unit tests and a
narrow decision helper, but incorrect deferral could delay required
setup until action time.
Overview
Prevents browsing-time hardware wallet signing prompts by deferring
HyperLiquid unified-account migration during Perps initialization
whenever the current abstraction mode would require a signing-backed
transition and user signing is not allowed.
Adds
shouldDeferUnifiedAccountSetupto centralize this decision(with new unit tests), updates
HyperLiquidProviderto use it, andexpands
HyperLiquidWalletService.isSelectedHardwareWallet()torecognize additional MetaMask hardware keyring types (Ledger, Trezor,
OneKey, Lattice, QR). Also updates related tests and log/comment wording
from QR popup spam to hardware wallet signing prompt spam.
Reviewed by Cursor Bugbot for commit
6f8cfe2. Bugbot is set up for automated
code reviews on this repo. Configure
here.