Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

17649 - Hardware wallet signing state #17786

Closed
wants to merge 305 commits into from

Conversation

flexa-rob
Copy link
Contributor

@flexa-rob flexa-rob commented Feb 16, 2023

Explanation

Issue explained via story:

  1. User initiates a signing request with an unlocked Ledger
  2. Confirmation Modal pops up, and no warning is present because the Ledger is unlocked
  3. Ledger locks while the Confirmation is open (e.g. the user may be hesitating the confirmation for a bit, or may be playing around with fees etc.)
  4. User hits "Sign" and the signing request fails silently as the Ledger is now locked

Fixes:
#17649
#17630
#17606

See related:
#17937
#17940

Screenshots/Screencaps

Before

Signing request was allowed to proceed with a locked device:
image

Resulting in a silent error and no result:
image

After

Signing requests now monitor HD wallet state and displays an appropriate error message when locked.

Personal Sign:
image

Sign Typed Data:
image

Sign Typed Data V3:
image

Sign Typed Data V4:
image

Sign in With Ethereum:
image

Send Transaction:
image

Manual Testing Steps

  1. Initiate signing request with Ledger
  2. While on the confirm screen, wait for the Ledger to lock. Signing request should be blocked with ledgerLocked warning message showing
  3. Unlock Ledger. The ledgerLocked warning should no longer be present and the signing request should now be able to proceed
  4. Sign request and proceed as normal

Pre-merge author checklist

  • I've clearly explained:
    • What problem this PR is solving
    • How this problem was solved
    • How reviewers can test my changes
  • Sufficient automated test coverage has been added

Pre-merge reviewer checklist

  • Manual testing (e.g. pull and build branch, run in browser, test code being changed)
  • PR is linked to the appropriate GitHub issue
  • IF this PR fixes a bug in the release milestone, add this PR to the release milestone

If further QA is required (e.g. new feature, complex testing steps, large refactor), add the Extension QA Board label.

In this case, a QA Engineer approval will be be required.

@github-actions
Copy link
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.

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to do a comprehensive review and check out the branch but one suggestion. Great work on the story creation!

@metamaskbot
Copy link
Collaborator

Builds ready [1a2b103]
Page Load Metrics (1798 ± 170 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint983021505928
domContentLoaded137325141764365175
load137325151798354170
domInteractive137325141764365175
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 273 bytes
  • ui: 5891 bytes
  • common: 124 bytes

@metamaskbot
Copy link
Collaborator

Builds ready [36814e7]
Page Load Metrics (1427 ± 43 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint92130106105
domContentLoaded1198156414068340
load1198156514279043
domInteractive1198156414068340
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 273 bytes
  • ui: 5938 bytes
  • common: 124 bytes

@codecov-commenter
Copy link

codecov-commenter commented Feb 17, 2023

Codecov Report

Merging #17786 (e06f915) into develop (26d7520) will increase coverage by 1.01%.
The diff coverage is 84.68%.

❗ Current head e06f915 differs from pull request most recent head 9a64a71. Consider uploading reports for the commit 9a64a71 to get more accurate results

@@             Coverage Diff             @@
##           develop   #17786      +/-   ##
===========================================
+ Coverage    69.38%   70.38%   +1.01%     
===========================================
  Files          987      962      -25     
  Lines        37267    36950     -317     
  Branches     10008     9620     -388     
===========================================
+ Hits         25854    26006     +152     
+ Misses       11413    10944     -469     
Impacted Files Coverage Δ
ui/pages/create-account/connect-hardware/index.js 42.47% <0.00%> (-0.29%) ⬇️
...p/signature-request-siwe/signature-request-siwe.js 63.27% <50.00%> (-8.66%) ⬇️
...p/signature-request/signature-request.component.js 77.22% <60.00%> (ø)
...saction-base/confirm-transaction-base.component.js 48.16% <60.00%> (-9.18%) ⬇️
...t-original/signature-request-original.component.js 54.72% <66.67%> (-5.28%) ⬇️
ui/ducks/app/app.ts 64.75% <66.67%> (+2.25%) ⬆️
app/scripts/metamask-controller.js 67.84% <76.92%> (+1.87%) ⬆️
...app/hardware-wallet-state/hardware-wallet-state.js 96.77% <96.77%> (ø)
shared/constants/hardware-wallets.ts 100.00% <100.00%> (ø)
...dger-instruction-field/ledger-instruction-field.js 60.53% <100.00%> (+1.62%) ⬆️
... and 6 more

... and 354 files with indirect coverage changes

@metamaskbot
Copy link
Collaborator

Builds ready [330639c]
Page Load Metrics (1597 ± 50 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint91154119199
domContentLoaded12531745156410249
load12531745159710550
domInteractive12531745156410249
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 273 bytes
  • ui: 5938 bytes
  • common: 124 bytes

Copy link
Contributor

@georgewrmarshall georgewrmarshall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great! Left a few minor suggestions. Travelling right now so don't have a hardware wallet on me to test locally so will need another approval to test funcitonality. I think it's out of the scope of this ticket but it would be great to update this notification to use BannerAlert as well. Might need some design attention 😅

Screenshot 2023-02-21 at 10 37 27 PM

@metamaskbot
Copy link
Collaborator

Builds ready [22522eb]
Page Load Metrics (1890 ± 279 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint943521528139
domContentLoaded126430341860573275
load134730451890580279
domInteractive126430341860573275

@flexa-rob
Copy link
Contributor Author

Looking great! Left a few minor suggestions. Travelling right now so don't have a hardware wallet on me to test locally so will need another approval to test funcitonality. I think it's out of the scope of this ticket but it would be great to update this notification to use BannerAlert as well. Might need some design attention sweat_smile

Screenshot 2023-02-21 at 10 37 27 PM

Thanks @georgewrmarshall - I just looked into updating the ledger-instruction-field too.

I'd be happy to do this, though would recommend that it be implemented in a separate PR - it uses Typography under the covers with some Button functionality in certain cases. So, there's probably enough effort (and testing) to warrant a separate PR/issue, if that's ok with you?

@georgewrmarshall
Copy link
Contributor

@flexa-rob absolutely! Created another ticket here #17873

andrewpeters9 and others added 18 commits June 21, 2023 21:54
Copy link

@Silvrbckw Silvrbckw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit and push

@github-actions
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity in the last 60 days. It will be closed in 14 days. Thank you for your contributions.

@github-actions github-actions bot added stale issues and PRs marked as stale and removed stale issues and PRs marked as stale labels Sep 19, 2023
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity in the last 60 days. It will be closed in 14 days. Thank you for your contributions.

@github-actions github-actions bot added the stale issues and PRs marked as stale label Nov 18, 2023
Copy link
Contributor

github-actions bot commented Dec 2, 2023

This PR was closed because there has been no follow up activity in the last 14 days. Thank you for your contributions.

@github-actions github-actions bot closed this Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale issues and PRs marked as stale
Projects
None yet
8 participants