-
Notifications
You must be signed in to change notification settings - Fork 5.5k
feat: surface Sign Permission view for eth_signTypedData_v4 with decoded permission #36054
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
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. |
✨ Files requiring CODEOWNER review ✨✅ @MetaMask/confirmations (7 files, +6423 -14)
🧩 @MetaMask/extension-devs (4 files, +36 -0)
📜 @MetaMask/policy-reviewers (4 files, +36 -0)
Tip Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers. 🔗 @MetaMask/supply-chain (4 files, +36 -0)
|
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [35fc02f]
UI Startup Metrics (1242 ± 58 ms)
Benchmark value 1078 exceeds gate value 1070 for chrome browserify home mean load Benchmark value 1071 exceeds gate value 1061 for chrome browserify home mean domContentLoaded Benchmark value 254 exceeds gate value 10 for chrome browserify home mean backgroundConnect Benchmark value 26 exceeds gate value 23 for chrome browserify home mean firstReactRender Benchmark value 5 exceeds gate value 1 for chrome browserify home mean initialActions Benchmark value 266 exceeds gate value 18 for chrome browserify home p95 backgroundConnect Benchmark value 15 exceeds gate value 1.2 for chrome browserify home p95 initialActions Benchmark value 21 exceeds gate value 17 for chrome browserify home p95 setupStore Benchmark value 14 exceeds gate value 7 for chrome webpack home p95 initialActions Benchmark value 33 exceeds gate value 25 for firefox browserify home mean backgroundConnect Benchmark value 27 exceeds gate value 25 for firefox browserify home mean firstReactRender Benchmark value 3 exceeds gate value 1 for firefox browserify home mean initialActions Benchmark value 246 exceeds gate value 195 for firefox browserify home p95 domInteractive Benchmark value 80 exceeds gate value 70 for firefox browserify home p95 backgroundConnect Benchmark value 5 exceeds gate value 2 for firefox browserify home p95 initialActions Benchmark value 1649 exceeds gate value 1615 for firefox webpack home mean uiStartup Benchmark value 1407 exceeds gate value 1380 for firefox webpack home mean load Benchmark value 1407 exceeds gate value 1380 for firefox webpack home mean domContentLoaded Benchmark value 113 exceeds gate value 100 for firefox webpack home mean domInteractive Benchmark value 32 exceeds gate value 26 for firefox webpack home mean backgroundConnect Benchmark value 47 exceeds gate value 38 for firefox webpack home mean firstReactRender Benchmark value 5 exceeds gate value 1 for firefox webpack home mean initialActions Benchmark value 1384 exceeds gate value 1360 for firefox webpack home mean loadScripts Benchmark value 1996 exceeds gate value 1935 for firefox webpack home p95 uiStartup Benchmark value 1664 exceeds gate value 1660 for firefox webpack home p95 load Benchmark value 1663 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded Benchmark value 300 exceeds gate value 156 for firefox webpack home p95 domInteractive Benchmark value 57 exceeds gate value 50 for firefox webpack home p95 firstReactRender Benchmark value 6 exceeds gate value 2 for firefox webpack home p95 initialActions Benchmark value 1640 exceeds gate value 1630 for firefox webpack home p95 loadScripts Sum of mean exceeds: 434ms | Sum of p95 exceeds: 569.8ms Sum of all benchmark exceeds: 1003.8ms Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
35fc02f to
97e73e7
Compare
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [97e73e7]
UI Startup Metrics (1231 ± 61 ms)
Benchmark value 26 exceeds gate value 23 for chrome browserify home mean firstReactRender Benchmark value 5 exceeds gate value 1 for chrome browserify home mean initialActions Benchmark value 264 exceeds gate value 18 for chrome browserify home p95 backgroundConnect Benchmark value 13 exceeds gate value 1.2 for chrome browserify home p95 initialActions Benchmark value 18 exceeds gate value 17 for chrome browserify home p95 setupStore Benchmark value 15 exceeds gate value 7 for chrome webpack home p95 initialActions Benchmark value 33 exceeds gate value 25 for firefox browserify home mean backgroundConnect Benchmark value 28 exceeds gate value 25 for firefox browserify home mean firstReactRender Benchmark value 3 exceeds gate value 1 for firefox browserify home mean initialActions Benchmark value 10 exceeds gate value 9 for firefox browserify home mean setupStore Benchmark value 212 exceeds gate value 195 for firefox browserify home p95 domInteractive Benchmark value 84 exceeds gate value 70 for firefox browserify home p95 backgroundConnect Benchmark value 9 exceeds gate value 2 for firefox browserify home p95 initialActions Benchmark value 106 exceeds gate value 100 for firefox webpack home mean domInteractive Benchmark value 32 exceeds gate value 26 for firefox webpack home mean backgroundConnect Benchmark value 45 exceeds gate value 38 for firefox webpack home mean firstReactRender Benchmark value 4 exceeds gate value 1 for firefox webpack home mean initialActions Benchmark value 289 exceeds gate value 156 for firefox webpack home p95 domInteractive Benchmark value 52 exceeds gate value 50 for firefox webpack home p95 firstReactRender Benchmark value 5 exceeds gate value 2 for firefox webpack home p95 initialActions Sum of mean exceeds: 288ms | Sum of p95 exceeds: 442.8ms Sum of all benchmark exceeds: 730.8ms Bundle size diffs [🚀 Bundle size reduced!]
|
97e73e7 to
8539332
Compare
🔗 Link your GitHub account to AtlassianTo enable Code Reviewer, please link your GitHub account to your Atlassian account. Click here to connect your accounts This is a one-time setup that takes less than a minute. |
8539332 to
98188e7
Compare
98188e7 to
44ee1ec
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
|
@SocketSecurity ignore @metamask/[email protected] This is package that we produce and uses fetch for some API calls. |
## **Description** This PR adds `@metamask/gator-permissions-snaps` and `@metamask/permissions-kernel-snap` as preinstalled snaps in flask. It also enables the Gator Permissions feature with `GATOR_PERMISSIONS_SNAP` env variable, and adds the `gator-permissions` build feature. [](https://codespaces.new/MetaMask/metamask-extension/pull/36230?quickstart=1) ## **Changelog** CHANGELOG entry: Adds EIP-7715 Readable Permissions to MetaMask flask, allowing dapps to call `wallet_requestExecutionPermissions` ## **Related issues** ## **Manual testing steps** Call `wallet_requestExecutionPermissions` with appropriate args, or use the Delegation Toolkit's experimental action to request a permission. This will allow the user to modify and / or approve the permission, but signing will fail until #36054 is merged. ## **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/main/.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/main/.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. --------- Co-authored-by: MoMannn <[email protected]>
17f74d3 to
0396e5c
Compare
| case WEEK: | ||
| return 'Weekly'; | ||
| default: | ||
| return `${seconds} seconds`; |
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.
This could be updated to show seconds/minutes/days/weeks whichever is more appropriate based on the amount. So that it doesn't say 120 seconds but 2 minutes. But can be done in a separate PR.
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! I think we should leave this until we do an actual designed UI.
| const { periodDuration } = permission.data; | ||
| const { startTime } = permission.data; | ||
| const { tokenAddress } = permission.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.
Shouldn't startTime also be validated here that is should exist like with streaming?
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, good call! It should always be set, but the type is overly permissive.
I've added validation for all of the permission types.
| <ConfirmInfoAlertRow | ||
| alertKey={RowAlertKey.RequestFrom} | ||
| ownerId={id} | ||
| label={t('requestFrom')} |
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 see we are using translations here but not at other points. Is this intentional?
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 only used translations for existing keys, because this isn't yet designed, I didn't want to add keys that we aren't going to end up keeping.
85716bc to
ce3b6b9
Compare
…ests from gator-permissions-snap - adds new component typed-sign-permission.tsx - routes requests to typed-sign-permission.tsx within info.tsx when permission has been decoded
ce3b6b9 to
96c5198
Compare
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [96c5198]
UI Startup Metrics (1229 ± 69 ms)
Benchmark value 24 exceeds gate value 23 for chrome browserify home mean firstReactRender Benchmark value 6 exceeds gate value 1 for chrome browserify home mean initialActions Benchmark value 1201 exceeds gate value 1190 for chrome browserify home p95 load Benchmark value 1194 exceeds gate value 1180 for chrome browserify home p95 domContentLoaded Benchmark value 1182 exceeds gate value 1180 for chrome browserify home p95 firstPaint Benchmark value 259 exceeds gate value 18 for chrome browserify home p95 backgroundConnect Benchmark value 15 exceeds gate value 1.2 for chrome browserify home p95 initialActions Benchmark value 958 exceeds gate value 940 for chrome browserify home p95 loadScripts Benchmark value 21 exceeds gate value 17 for chrome browserify home p95 setupStore Benchmark value 14 exceeds gate value 7 for chrome webpack home p95 initialActions Benchmark value 1429 exceeds gate value 1405 for firefox browserify home mean uiStartup Benchmark value 34 exceeds gate value 25 for firefox browserify home mean backgroundConnect Benchmark value 29 exceeds gate value 25 for firefox browserify home mean firstReactRender Benchmark value 7 exceeds gate value 1 for firefox browserify home mean initialActions Benchmark value 12 exceeds gate value 9 for firefox browserify home mean setupStore Benchmark value 224 exceeds gate value 195 for firefox browserify home p95 domInteractive Benchmark value 11 exceeds gate value 2 for firefox browserify home p95 initialActions Benchmark value 51 exceeds gate value 27 for firefox browserify home p95 setupStore Benchmark value 107 exceeds gate value 100 for firefox webpack home mean domInteractive Benchmark value 33 exceeds gate value 26 for firefox webpack home mean backgroundConnect Benchmark value 5 exceeds gate value 1 for firefox webpack home mean initialActions Benchmark value 298 exceeds gate value 156 for firefox webpack home p95 domInteractive Benchmark value 6 exceeds gate value 2 for firefox webpack home p95 initialActions Sum of mean exceeds: 312ms | Sum of p95 exceeds: 518.8ms Sum of all benchmark exceeds: 830.8ms Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
mj-kiwi
left a comment
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.
LGTM
OGPoyraz
left a comment
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.
Confirmation changes LGTM
Description
This feature is only enabled in Flask.
When a dapp requests an EIP-7715 Readable Permission, the user must sign with
eth_signTypedData_v4, but it's important that the user can understand what is being signed. This PR surfaced the decoded permission information in a new Sign Permission view.When a
eth_signTypedData_v4request is received by@metamask/signature-controllerthat appears to be a delegation, it will pass this request to@metamask/gator-permissions-controllerto decode the request into the originating permission. If this is successful,@metamask/signature-controllerattaches the decoded permission to the requestmetadata.This PR adds a new view showing the details of the permission that the user is signing. This does not implement the final design, and focusses only on introducing the functionality to extension. Further iteration will be made to improve the UX. As such, no internationalization has been included in this change.
A couple important points to note:
GATOR_PERMISSIONS_ENABLEDis not true, the request will be rejected here (this should never happen, because the methodwallet_requestExecutionPermissionswill not allow requests if the feature is not enabledGatorPermissionsControllerChangelog
CHANGELOG entry: presents a Permission confirmation view when a decoded permission exists on signTypedData metadata. Flask only.
Related issues
These PRs are related to this feature:
decodePermissionFromPermissionContextForOrigintoGatorPermissionsControllerAdd method to decode permission to GatorPermissionsController core#6556Manual testing steps
GATOR_PERMISSIONS_ENABLED=trueandGATOR_PERMISSIONS_PROVIDER_SNAP_ID=local:http://localhost:8082Expect to see the sign permission screen:
Screenshots/Recordings
Pre-merge author checklist
Pre-merge reviewer checklist