metamask-extension
metamask-extension copied to clipboard
feat: Prevent rpc node requests on locked state
Description
See the task below for more details.
Related issues
Fixes: #2151
Manual testing steps
- Checkout this branch
- Build the app
- Lock the wallet
- Open the dev tools on the network tab
- Refresh the wallet
- No requests to rpc node should be visible
Screenshots/Recordings
N/A
Pre-merge author checklist
- [ ] I’ve followed MetaMask Coding Standards.
- [ ] I've clearly explained what problem this PR is solving and how it is solved.
- [ ] I've linked related issues
- [ ] I've included manual testing steps
- [ ] I've included screenshots/recordings if applicable
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using JSDoc format if applicable
- [ ] I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
- [ ] I’ve properly set the pull request status:
- [ ] In case it's not yet "ready for review", I've set it to "draft".
- [ ] In case it's "ready for review", I've changed it from "draft" to "non-draft".
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.
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.
Builds ready [1f57f78]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1010 ± 401 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 72 | 163 | 112 | 23 | 11 |
domContentLoaded | 10 | 61 | 27 | 18 | 9 | ||
load | 56 | 1885 | 1010 | 835 | 401 | ||
domInteractive | 10 | 61 | 27 | 18 | 9 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 49 Bytes (0.00%)
- ui: 0 Bytes (0.00%)
- common: 0 Bytes (0.00%)
Codecov Report
Attention: Patch coverage is 65.00000%
with 7 lines
in your changes are missing coverage. Please review.
Project coverage is 68.69%. Comparing base (
3d861ca
) to head (900034f
).
:exclamation: Current head 900034f differs from pull request most recent head 8560806
Please upload reports for the commit 8560806 to get more accurate results.
Files | Patch % | Lines |
---|---|---|
app/scripts/metamask-controller.js | 65.00% | 7 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## develop #23175 +/- ##
===========================================
+ Coverage 65.77% 68.69% +2.92%
===========================================
Files 1366 1098 -268
Lines 54255 43132 -11123
Branches 14102 11523 -2579
===========================================
- Hits 35685 29627 -6058
+ Misses 18570 13505 -5065
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Builds ready [2614f5f]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1474 ± 329 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 86 | 268 | 165 | 51 | 25 |
domContentLoaded | 17 | 78 | 46 | 22 | 10 | ||
load | 72 | 2020 | 1474 | 684 | 329 | ||
domInteractive | 17 | 78 | 46 | 22 | 10 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 49 Bytes (0.00%)
- ui: 0 Bytes (0.00%)
- common: 0 Bytes (0.00%)
Builds ready [9509369]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1544 ± 295 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 61 | 205 | 145 | 35 | 17 |
domContentLoaded | 10 | 85 | 38 | 23 | 11 | ||
load | 49 | 2085 | 1544 | 614 | 295 | ||
domInteractive | 10 | 85 | 38 | 23 | 11 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 209 Bytes (0.01%)
- ui: 0 Bytes (0.00%)
- common: 0 Bytes (0.00%)
Builds ready [900034f]
- builds: chrome, firefox
- builds (beta): chrome
- builds (flask): chrome, firefox
- builds (MMI): chrome, firefox
- builds (test): chrome, firefox
- builds (test-flask): chrome, firefox
- build viz: Build System
- mv3: Background Module Init Stats
- mv3: UI Init Stats
- mv3: Module Load Stats
- mv3: Bundle Size Stats
- mv2: E2e Actions Stats
- code coverage: Report
- storybook: Storybook
- typescript migration: Dashboard
- all artifacts
Page Load Metrics (1071 ± 427 ms)
Platform | Page | Metric | Min (ms) | Max (ms) | Average (ms) | StandardDeviation (ms) | MarginOfError (ms) |
---|---|---|---|---|---|---|---|
Chrome | Home | firstPaint | 74 | 268 | 142 | 54 | 26 |
domContentLoaded | 10 | 88 | 30 | 22 | 10 | ||
load | 61 | 2213 | 1071 | 889 | 427 | ||
domInteractive | 10 | 88 | 30 | 22 | 10 |
Bundle size diffs [🚨 Warning! Bundle size has increased!]
- background: 209 Bytes (0.01%)
- ui: 0 Bytes (0.00%)
- common: 0 Bytes (0.00%)
Recap from a Slack conversation to address comment by @danjm here.
Given performance concerns we will introduce a setting Optimize performance when opening MetaMask
which reflects the current behavior of pulling data while MetaMask is locked; To avoid the UI getting bogged down and latency affecting users' ability to provide their password.
The setting would be offered as Opt-out and will be included in onboarding and the Settings menu inside Extension itself.
This work is pending an update to Advanced Configuration.
I attempted at a clean merge to sync with develop
in f465de5fbe08e4f6747b3ddb3a24df89881d7c0d but it seems like there is something left to be done, looking at e2e results.
Closing this PR as the work has been handed over to the Wallet UX team.