-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Stop blocking display of transaction approval window on resolution of ppom security alert response #22778
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
Conversation
|
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. |
382c36c to
30df005
Compare
| } | ||
| } | ||
| } catch (error: any) { | ||
| sentry?.captureException(error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not important in this PR, but later we can refactor out validation from here as middleware is not needed for async validation - validation can now be done in controllers.
app/scripts/lib/transaction/util.ts
Outdated
| providerRequestsCount?: Record<string, number>; | ||
| securityAlertId?: string; | ||
| }; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This files does not seems to be present in 11.9 branch.
| if (!foundConfirmation) { | ||
| await new Promise((resolve) => setTimeout(resolve, 100)); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we move validation from middleware I think we can avoid above logic for search confirmation.
digiwand
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌🏼
Works as expected and displays the LoadingIndicator while validation is in progress. Left a couple of non-blocking comments
app/scripts/controllers/app-state.js
Outdated
|
|
||
| addSignatureSecurityAlertResponse(securityAlertResponse) { | ||
| const currentState = this.store.getState(); | ||
| const { signatureSecurityAlertResponses } = currentState; // |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const { signatureSecurityAlertResponses } = currentState; // | |
| const { signatureSecurityAlertResponses } = currentState; |
| reason: 'loading', | ||
| result_type: 'validation_in_progress', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] we could define these as local values in shared/constants/security-provider.ts
| 'eth_signTypedData_v1', | ||
| 'eth_signTypedData_v3', | ||
| 'eth_signTypedData_v4', | ||
| 'personal_sign', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we spoke with the Blockaid team about removing validation for 'personal_sign' types. We can do this here or another PR
| 'personal_sign', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's do this in a separate PR
jpuri
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
QA findings1. Error when initiating Send from inside the WalletNote: this issue is not happening on develop. Whenever initiating a send from inside the wallet, I see the error reading-security-alerts.mp42. e2e failures: Spinner stays loading indefinitely in failed validation caseWhenever we are in the case where the validation will fail, we now see the spinner loading indefinitely instead of displaying the This is what's happening with the e2e failures: we simulated a failed validation by using this mock and we can see on the screenshot that thet Failed Validation warning never appeared. Instead, the spinner stayed there validation-failed.mp4 |
Builds ready [a9f4524]
Page Load Metrics (751 ± 29 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
Missing release label release-11.9.0 on PR. Adding release label release-11.9.0 on PR and removing other release labels(release-11.11.0), as PR was cherry-picked in branch 11.9.0. |
Description
Solves this problem:
For people on slow networks, the amount of time it takes from "Dapp button click" -> "Popup notification window appears" might be a problem. When blockaid is toggled off, and the network is throttled to slow via the chrome dev tools, I see a ~3 second worse case for this time, but when blockaid is toggled on, I see a 12 second (or even a bit longer) worst case scenario for this time.
The risk here is that users unexpectedly see a longer delay then usual, and so think they need to click the button again, and then get shown multiple confirmation requests and confirm all of them, leading to fund loss.
This can happen on either slow internet connections, or if an infura request is taking longer than usual (which could effect people regardless of internet connection). Yesterday when I first saw this issue, I wasn't slowing down my connection, but it still took ~20 seconds to open. Probably a somewhat rare case (because as I mentioned I didn't notice any problems again until I intentionally throttled the network requests), but even if it only affected 10% of users only once a month, that would be enough to get plenty of "why did metamask just take 20 seconds to open a confirmation window?!?" complaints.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist