Skip to content

Commit

Permalink
chore: Fully remove eth_sign (#24756)
Browse files Browse the repository at this point in the history
## Explanation
Months ago, because of phishing risk, we disabled the `eth_sign` API
method by default (users could manually enable it with a preference
toggle). Now because of additional risk associated with [potentially
malicious EIP-3074
invokers](https://ethereum-magicians.org/t/eip-3074-is-unsafe-unnecessary-puts-user-funds-at-risk-while-fragmenting-ux-liquidity-and-the-wallet-stack/19662)
we are fully removing support for this method.

This PR introduces the changes to `@metamask/signature-controller` and
`@metamask/preferences-controller` from
MetaMask/core#4319 which remove `eth_sign`
related infrastructure.

Additionally it removes all instances of `eth_sign` components and
references from the extension codebase.

## References

* Fixes MetaMask/MetaMask-planning#2371

## **Manual testing steps**

1. Go to the [e2e test dapp](https://metamask.github.io/test-dapp/)
2. Connect the wallet
3. Scroll down to the `Eth Sign` card
(https://metamask.github.io/test-dapp/#ethSign)
4. Click `Sign`
5. You should see `Error: The method "eth_sign" does not exist / is not
available.`

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask 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.
  • Loading branch information
adonesky1 authored Aug 1, 2024
1 parent fcf474c commit 757b699
Show file tree
Hide file tree
Showing 115 changed files with 159 additions and 2,294 deletions.
22 changes: 0 additions & 22 deletions .storybook/initial-states/transactions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const MOCK_TX_TYPE = {
INCOMING: 'incoming',
PERSONAL_SIGN: 'personal_sign',
RETRY: 'retry',
SIGN: 'eth_sign',
SIGN_TYPED_DATA: 'eth_signTypedData',
SIMPLE_SEND: 'simpleSend',
SMART: 'smart',
Expand Down Expand Up @@ -420,27 +419,6 @@ export const MOCK_TRANSACTION_BY_TYPE = {
'Error: [ethjs-query] while formatting outputs from RPC \'{"value":{"code":-32000,"message":"replacement transaction underpriced"}}\'\n at chrome-extension://hbljfohiafgaaaabejngpgolnboohpaf/common-5.js:14346:29',
},
},
[MOCK_TX_TYPE.SIGN]: {
id: 5177046356058675,
msgParams: {
from: '0xabce7847fd3661a9b7c86aaf1daea08d9da5750e',
data:
'0x879a053d4800c6354e76c7985a865d2922c82fb5b3f4577b2fe08b998954f2e0',
origin: 'https://metamask.github.io',
},
txParams: {
from: '0xabc14609ef9e09776ac5fe00bdbfef57bcdefebb',
gas: '0x5208',
gasPrice: '0x77359400',
nonce: '0x3',
value: '0x00',
data:
'0x608060405234801561001057600080fd5b5033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000808190555061023b806100686000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632e1a7d4d1461005c5780638da5cb5b1461009d578063d0e30db0146100f4575b600080fd5b34801561006857600080fd5b5061008760048036038101908080359060200190929190505050610112565b6040518082815260200191505060405180910390f35b3480156100a957600080fd5b506100b26101d0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100fc6101f6565b6040518082815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561017057600080fd5b8160008082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156101c5573d6000803e3d6000fd5b506000549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003460008082825401925050819055506000549050905600a165627a7a72305820f237db3ec816a52589d82512117bc85bc08d3537683ffeff9059108caf3e5d400029',
},
time: 1653451051909,
status: 'unapproved',
type: 'eth_sign',
},
[MOCK_TX_TYPE.SIGN_TYPED_DATA]: {
id: 5177046356058598,
msgParams: {
Expand Down
2 changes: 0 additions & 2 deletions .storybook/test-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -1204,8 +1204,6 @@ const state = {
v: '0x93',
},
],
unapprovedMsgs: {},
unapprovedMsgCount: 0,
unapprovedPersonalMsgs: {},
unapprovedPersonalMsgCount: 0,
unapprovedDecryptMsgs: {},
Expand Down
45 changes: 0 additions & 45 deletions app/_locales/de/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 0 additions & 45 deletions app/_locales/el/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 0 additions & 45 deletions app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions app/_locales/en_GB/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 0 additions & 45 deletions app/_locales/es/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 0 additions & 45 deletions app/_locales/fr/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 757b699

Please sign in to comment.