-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
chore: Fully remove eth_sign
#24756
chore: Fully remove eth_sign
#24756
Conversation
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. |
036e0c6
to
2256e62
Compare
641c3e5
to
dd98d96
Compare
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@metamask/logging-controller@3.0.1, npm/@metamask/signature-controller@16.0.0 |
@metamaskbot update-policies |
Policies updated |
408b612
to
60271aa
Compare
9992fc4
to
6c131d4
Compare
app/scripts/metamask-controller.js
Outdated
this.preferencesController.store.getState() | ||
?.disabledRpcMethodPreferences?.eth_sign, | ||
// TODO remove this option | ||
isEthSignEnabled: () => false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Not sure why but I thought I'd forgotten to remove it as an option so was going to loop back to it but it can be remove removed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -63,10 +27,21 @@ const props = { | |||
txData: { | |||
msgParams: { | |||
from: address, | |||
data: MOCK_SIGN_DATA, | |||
data: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the change in test data here? IIRC the data is stringified like MOCK_SIGN_DATA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I didn't change the way the data was formatted in the actual component for eth_signTypedData
see here... I agree this doesn't seem right. But as you can see here, this data is expected to be mappable. So what I've done here is preserve the existing behavior but make the test pass because of expectations embedded in the component that I didn't necessarily want to dig further into because of 👇
A few things. This component is technically deprecated and slated for removal shortly. I'm not clear on the original API method signature for eth_signTypedData
(v1) since EIP-712 doesn't have a changelog...
@@ -313,10 +311,6 @@ export default class SignatureRequestOriginal extends Component { | |||
history.push(mostRecentOverviewPage); | |||
}} | |||
onSubmit={async () => { | |||
if (txData.type === MESSAGE_TYPE.ETH_SIGN) { | |||
return this.setState({ showSignatureRequestWarning: true }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we delete the state and component for showSignatureRequestWarning
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updatedMsgParams as PersonalMessageParams, | ||
req as OriginalRequest, | ||
); | ||
return undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Perhaps just throwing here is simpler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved for team-accounts.
Just reviewed the file snap-keyring/metrics.test.ts
7c1a3b8
Quality Gate passedIssues Measures |
Builds ready [7c1a3b8]
Page Load Metrics (207 ± 218 ms)
Bundle size diffs [🚀 Bundle size reduced!]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved for team-accounts.
Just reviewed the file snap-keyring/metrics.test.ts
return await this.signatureController.newUnsignedPersonalMessage( | ||
updatedMsgParams as PersonalMessageParams, | ||
req as OriginalRequest, | ||
); | ||
} | ||
return await this.signatureController.newUnsignedMessage( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adonesky1, the only thing I'm afraid of in this PR is the removal of this newUnsignedMessage
for the custodian accounts. Let me talk with the team first. cc @zone-live @shane-t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not concerned about it, because it willy only be true if the method is eth_sign
based on the other conditions in the block.
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 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 removeeth_sign
related infrastructure.Additionally it removes all instances of
eth_sign
components and references from the extension codebase.References
Manual testing steps
Eth Sign
card (https://metamask.github.io/test-dapp/#ethSign)Sign
Error: The method "eth_sign" does not exist / is not available.
Pre-merge author checklist
Pre-merge reviewer checklist