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

fix: add eth_signTypedData and eth_signTypedData_v3 to methodsRequiringNetworkSwitch #25562

Merged

Conversation

adonesky1
Copy link
Contributor

@adonesky1 adonesky1 commented Jun 27, 2024

Description

Though signature requests like personal_sign, eth_signTypedData, eth_signTypedData_v3 and eth_signTypedData_v4 do not depend on state of network connections, these confirmations do use nicknames/addressbook state which is dependent on globally selected network state for parsing signatures and injecting nicknaming where possible. The queueing system introduced with Amon Hen v1 (v12.0.0 release) introduces certain conditions in which these signature confirmations will be rendered on the wrong network. Though this doesn't actually result in faulty signatures, we should switch to the appropriate/expected network for the UX reasons described above. Adding eth_signTypedData_v3 and eth_signTypedData to the methodsRequiringNetworkSwitch array will cause the network to switch to the selected network for the requesting origin before initializing the confirmation.

Open in GitHub Codespaces

Related issues

Fixes: #25528
See this slack thread: https://consensys.slack.com/archives/C06FXU326RL/p1719429561925649?thread_ts=1719415715.492249&cid=C06FXU326RL

Manual testing steps

See videos below 👇

Screenshots/Recordings

Before

Screen.Recording.2024-06-27.at.9.45.06.AM.mov

After

Screen.Recording.2024-06-27.at.9.37.17.AM.mov

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.

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.

@adonesky1 adonesky1 force-pushed the ad/add-signing-methods-to-methodsRequiringNetworkSwitch branch from 4e377b2 to 6f4e8e7 Compare June 27, 2024 14:39
@adonesky1 adonesky1 requested a review from a team as a code owner June 27, 2024 14:39
@adonesky1 adonesky1 force-pushed the ad/add-signing-methods-to-methodsRequiringNetworkSwitch branch from 869d327 to 2295e01 Compare June 27, 2024 16:04
jiexi
jiexi previously approved these changes Jun 27, 2024
@sleepytanya
Copy link
Contributor

Works great!

fixed.mov

@adonesky1 adonesky1 force-pushed the ad/add-signing-methods-to-methodsRequiringNetworkSwitch branch from f19515b to 7235b0e Compare June 27, 2024 17:10
@adonesky1 adonesky1 added the release-12.0.0 Issue or pull request that will be included in release 12.0.0 label Jun 27, 2024
digiwand
digiwand previously approved these changes Jun 27, 2024
@adonesky1 adonesky1 requested review from darkwing, danjm, sleepytanya and a team June 27, 2024 17:34
danjm
danjm previously approved these changes Jun 27, 2024
Copy link
Contributor

@danjm danjm left a comment

Choose a reason for hiding this comment

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

LGTM

sleepytanya
sleepytanya previously approved these changes Jun 27, 2024
@adonesky1 adonesky1 dismissed stale reviews from sleepytanya, danjm, and digiwand via a7b7d07 June 28, 2024 14:44
sleepytanya
sleepytanya previously approved these changes Jun 28, 2024
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25585?quickstart=1)

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
Copy link

sonarcloud bot commented Jun 28, 2024

@adonesky1 adonesky1 merged commit 4a9c480 into develop Jun 28, 2024
71 of 72 checks passed
@metamaskbot
Copy link
Collaborator

Builds ready [d3f4b01]
Page Load Metrics (46 ± 3 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint64998094
domContentLoaded9121011
load39634673
domInteractive9121010
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 43 Bytes (0.00%)
  • ui: 50 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@adonesky1 adonesky1 deleted the ad/add-signing-methods-to-methodsRequiringNetworkSwitch branch June 28, 2024 17:16
@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 2024
@metamaskbot metamaskbot added the release-12.2.0 Issue or pull request that will be included in release 12.2.0 label Jun 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.0.0 Issue or pull request that will be included in release 12.0.0 release-12.2.0 Issue or pull request that will be included in release 12.2.0 team-wallet-api-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Multichain - transaction generated on the wrong network
7 participants