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

refactor: remove global network usage from signatures #28167

Merged

Conversation

matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Oct 29, 2024

Description

Remove global network usage from all signature components and hooks.

Specifically:

  • Replace usages of the following selectors with the chain ID extracted from the signature request.
    • getCurrentChainId
    • getNativeCurrency
    • getProviderConfig
  • Add new selectors:
    • selectNetworkConfigurationByChainId
    • selectDefaultRpcEndpointByChainId

Open in GitHub Codespaces

Related issues

Fixes: #3375 #3500 #3459 #3374

Manual testing steps

Regression of all signature types including legacy and redesigned confirmations.

Also verify Blockaid warnings.

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

@github-actions github-actions bot added the team-confirmations Push issues to confirmations team label Oct 29, 2024
Base automatically changed from chore/upgrade-signature-controller-remove-global-network to develop October 30, 2024 11:02
@matthewwalsh0 matthewwalsh0 force-pushed the refactor/remove-global-network-usage-signatures branch from 6ea4e7e to 5eae3ec Compare October 30, 2024 13:54
@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review October 30, 2024 16:57
@matthewwalsh0 matthewwalsh0 requested review from a team as code owners October 30, 2024 16:57
@metamaskbot
Copy link
Collaborator

Builds ready [6846f69]
Page Load Metrics (1765 ± 87 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint33921881703361173
domContentLoaded14852119174417383
load14942144176518087
domInteractive25187543617
backgroundConnect77026189
firstReactRender4411687199
getState45714178
initialActions01000
loadScripts10831576129913665
setupStore106118157
uiStartup16622372195020498
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 0 Bytes (0.00%)
  • ui: -406 Bytes (-0.01%)
  • common: 318 Bytes (0.00%)

@sleepytanya
Copy link
Contributor

Blockaid banners, network change alerts, network balance works as expected for all types of Signatures:

signatures.mov
maliciousSign.mov
123.mov
Screenshot 2024-10-30 at 17 18 12

@matthewwalsh0 matthewwalsh0 added this pull request to the merge queue Nov 4, 2024
Merged via the queue into develop with commit 3e1dd23 Nov 4, 2024
78 checks passed
@matthewwalsh0 matthewwalsh0 deleted the refactor/remove-global-network-usage-signatures branch November 4, 2024 10:12
@github-actions github-actions bot locked and limited conversation to collaborators Nov 4, 2024
@metamaskbot metamaskbot added the release-12.8.0 Issue or pull request that will be included in release 12.8.0 label Nov 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
QA Passed release-12.8.0 Issue or pull request that will be included in release 12.8.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants