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

Get infuraBlocked from network state #20822

Merged
merged 20 commits into from
Sep 22, 2023

Conversation

jiexi
Copy link
Contributor

@jiexi jiexi commented Sep 11, 2023

Currently, infuraBlocked is managed via the PreferencesController through the NetworkController:infuraIsBlocked and NetworkController:infuraIsUnblocked events. As part of multichain work, we want to move away from a globally selected network. This PR removes state.metamask.infuraBlocked and checks state.metamask.networksMetadata for network status instead. This still checks the currently the state for the selected network only though.

Explanation

Screenshots/Screencaps

Before

After

Manual Testing Steps

Not super easy to test manually as you will need to use a VPN to connect from a location where infura is blocked or some how catch and modify the initial wallet rpc request to return a blocked error. You should see the infura blocked popup on the main wallet homepage when you have selected an infura RPC while connecting from a blocked location

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.

@jiexi jiexi requested a review from a team as a code owner September 11, 2023 20:49
@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.

package.json Outdated Show resolved Hide resolved
@jiexi
Copy link
Contributor Author

jiexi commented Sep 11, 2023

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policy update failed. You can review the logs or retry the policy update here

ui/selectors/selectors.js Outdated Show resolved Hide resolved
@jiexi jiexi requested review from a team as code owners September 18, 2023 18:39
@jiexi
Copy link
Contributor Author

jiexi commented Sep 18, 2023

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated

@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.02% ⚠️

Comparison is base (f690d9a) 68.35% compared to head (14a02e1) 68.34%.
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #20822      +/-   ##
===========================================
- Coverage    68.35%   68.34%   -0.02%     
===========================================
  Files         1007     1007              
  Lines        40261    40254       -7     
  Branches     10766    10761       -5     
===========================================
- Hits         27519    27508      -11     
- Misses       12742    12746       +4     
Files Changed Coverage Δ
app/scripts/controllers/preferences.js 56.91% <ø> (-3.47%) ⬇️
app/scripts/lib/setupSentry.js 41.07% <ø> (ø)
app/scripts/metamask-controller.js 54.02% <ø> (+0.16%) ⬆️
ui/selectors/selectors.js 86.76% <100.00%> (+0.04%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Collaborator

Builds ready [f0e8e6e]
Page Load Metrics (1744 ± 121 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1142491563718
domContentLoaded145422941743252121
load145422941744252121
domInteractive145422941743252121
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -588 Bytes (-0.02%)
  • ui: 33 Bytes (0.00%)
  • common: -17 Bytes (-0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [cd7d8e6]
Page Load Metrics (1498 ± 37 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint110149126105
domContentLoaded1396173114987837
load1397173114987837
domInteractive1396173114987837
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -588 Bytes (-0.02%)
  • ui: 33 Bytes (0.00%)
  • common: -17 Bytes (-0.00%)

adonesky1
adonesky1 previously approved these changes Sep 19, 2023
Copy link
Contributor

@adonesky1 adonesky1 left a comment

Choose a reason for hiding this comment

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

LGTM! Maybe we should add a test for the selector but otherwise looks good. Manually tested as well!

adonesky1
adonesky1 previously approved these changes Sep 20, 2023
@metamaskbot
Copy link
Collaborator

Builds ready [2d13a1d]
Page Load Metrics (1591 ± 88 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1183211524321
domContentLoaded13702250159018288
load13702250159118288
domInteractive13702250159018288
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -588 Bytes (-0.02%)
  • ui: 33 Bytes (0.00%)
  • common: -17 Bytes (-0.00%)

adonesky1
adonesky1 previously approved these changes Sep 21, 2023
@jiexi
Copy link
Contributor Author

jiexi commented Sep 21, 2023

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

Policies updated

adonesky1
adonesky1 previously approved these changes Sep 21, 2023
@metamaskbot
Copy link
Collaborator

Builds ready [888a247]
Page Load Metrics (1709 ± 76 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1212381582914
domContentLoaded14972012170915876
load14972012170915876
domInteractive14972012170915876
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -588 Bytes (-0.02%)
  • ui: 33 Bytes (0.00%)
  • common: -17 Bytes (-0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [888a247]
Page Load Metrics (1709 ± 76 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1212381582914
domContentLoaded14972012170915876
load14972012170915876
domInteractive14972012170915876
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -588 Bytes (-0.02%)
  • ui: 33 Bytes (0.00%)
  • common: -17 Bytes (-0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [888a247]
Page Load Metrics (1709 ± 76 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1212381582914
domContentLoaded14972012170915876
load14972012170915876
domInteractive14972012170915876
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -588 Bytes (-0.02%)
  • ui: 33 Bytes (0.00%)
  • common: -17 Bytes (-0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [3b998b6]
Page Load Metrics (1624 ± 61 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint110177142199
domContentLoaded14782025162412761
load14782025162412761
domInteractive14782025162412761
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -588 Bytes (-0.02%)
  • ui: 33 Bytes (0.00%)
  • common: -17 Bytes (-0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [dc5436a]
Page Load Metrics (1672 ± 60 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint129201151199
domContentLoaded14731916167112460
load14731916167212560
domInteractive14731916167112460
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -588 Bytes (-0.02%)
  • ui: 33 Bytes (0.00%)
  • common: -17 Bytes (-0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [623a52e]
Page Load Metrics (1602 ± 49 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint123192141157
domContentLoaded14281806160210349
load14281806160210349
domInteractive14281806160210349
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -588 Bytes (-0.02%)
  • ui: 33 Bytes (0.00%)
  • common: -17 Bytes (-0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [14a02e1]
Page Load Metrics (1845 ± 86 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint102148125147
domContentLoaded99145120157
load16022243184517986
domInteractive99145120157
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -588 Bytes (-0.02%)
  • ui: 33 Bytes (0.00%)
  • common: -17 Bytes (-0.00%)

@jiexi jiexi merged commit 315c043 into develop Sep 22, 2023
9 checks passed
@jiexi jiexi deleted the jl/mmp-1033/preferences-controller-network-meta branch September 22, 2023 22:58
@github-actions github-actions bot locked and limited conversation to collaborators Sep 22, 2023
@metamaskbot metamaskbot added the release-11.3.0 Issue or pull request that will be included in release 11.3.0 label Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-11.3.0 Issue or pull request that will be included in release 11.3.0 team-wallet-api-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants