Skip to content

chore(runway): cherry-pick fix: hw account abstraction migration#30261

Merged
vpintorico merged 2 commits into
release/7.77.0from
cherry-pick-7-77-0-4669b3a
May 15, 2026
Merged

chore(runway): cherry-pick fix: hw account abstraction migration#30261
vpintorico merged 2 commits into
release/7.77.0from
cherry-pick-7-77-0-4669b3a

Conversation

@runway-github

@runway-github runway-github Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

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 dexAbstraction
migration 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

Feature: Perps hardware wallet idle setup

  Scenario: Hardware wallet user opens Perps and leaves it idle
    Given the user has selected a Ledger, Trezor, OneKey, Lattice, or QR hardware wallet account
    And Perps is enabled and available

    When the user opens the Perps screen
    And leaves the Perps screen idle without placing an order, withdrawing, or otherwise starting a signing action
    Then the app does not repeatedly show hardware wallet signing prompts
Feature: Perps software wallet setup

  Scenario: Software wallet user opens Perps
    Given the user has selected a software wallet account that needs Unified Account setup

    When the user opens the Perps screen
    Then Perps can complete the setup flow during initialization
    And the first trade can use unified collateral without an extra setup step

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

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
  • Use these power-user
    SRPs

    to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production
    performance metrics
  • See trace() for usage and
    addToken
    for an example

For performance guidelines and tooling, see the Performance
Guide
.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the
    app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described
    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 shouldDeferUnifiedAccountSetup to centralize this decision
(with new unit tests), updates HyperLiquidProvider to use it, and
expands HyperLiquidWalletService.isSelectedHardwareWallet() to
recognize 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.

[4669b3a](https://github.com/MetaMask/metamask-mobile/commit/4669b3af277245303255ecbba46a29d12a765fbd)

@runway-github runway-github Bot requested a review from a team as a code owner May 15, 2026 15:19
@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.

@metamaskbotv2 metamaskbotv2 Bot added the team-bots Bot team (for MetaMask Bot, Runway Bot, etc.) label May 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - PR targets a release branch (release/*)

All E2E tests pre-selected.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@vpintorico vpintorico enabled auto-merge (squash) May 15, 2026 16:47
@vpintorico vpintorico merged commit a8a95d8 into release/7.77.0 May 15, 2026
200 of 203 checks passed
@vpintorico vpintorico deleted the cherry-pick-7-77-0-4669b3a branch May 15, 2026 16:53
@github-actions github-actions Bot locked and limited conversation to collaborators May 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size-M team-bots Bot team (for MetaMask Bot, Runway Bot, etc.)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants