-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat: bump mobile snaps packages to bring new snaps architecture #8607
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. |
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
🚮 Removed packages: npm/@metamask/json-rpc-engine@7.3.0, npm/@metamask/post-message-stream@7.0.0, npm/@metamask/snaps-controllers@3.2.0, npm/@metamask/snaps-rpc-methods@3.2.1, npm/@metamask/snaps-utils@3.2.0, npm/@noble/hashes@1.3.2 |
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎ This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring: Next stepsTake a deeper look at the dependencyTake a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev. Remove the packageIf you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency. Mark a package as acceptable riskTo ignore an alert, reply with a comment starting with |
@@ -175,8 +175,8 @@ | |||
"@ledgerhq/react-native-hw-transport-ble": "^6.29.5", | |||
"@metamask/address-book-controller": "^3.0.0", | |||
"@metamask/approval-controller": "^3.4.0", | |||
"@metamask/base-controller": "^4.1.1", |
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.
are there any breaking changes that we need to worry about with this base controller change?
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.
seems like there is: https://github.com/MetaMask/core/blob/main/packages/base-controller/CHANGELOG.md#400
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 package is used in two files, this and this. The second make usage of this.controllerMessenger.subscribe
14 times. This method was named deprecated on 4.0.0 but restored [here] (MetaMask/core#3698). That's the reason it didn't break anything on our end.
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.
Thanks for pointing this out. Then I think its safe to move forward here.
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.
@Jonathansoufer @owencraston Just a heads-up that subscribe
will be removed from BaseController
(formerly BaseControllerV2
) in its next release.
However, that shouldn't break this.controllerMessenger.subscribe
calls, since this.controllerMessenger
is an instance of ControllerMessenger
, and the subscribe
property is not being removed from ControllerMessenger
(or RestrictedControllerMessenger
).
6b0704a
to
9f2260b
Compare
…/metamask-mobile into feat/bump-mobile-snaps-packages
…/metamask-mobile into feat/bump-mobile-snaps-packages
@@ -0,0 +1,13 @@ | |||
diff --git a/node_modules/@metamask/base-controller/dist/RestrictedControllerMessenger.d.ts b/node_modules/@metamask/base-controller/dist/RestrictedControllerMessenger.d.ts | |||
index 423c1a9..5c62cb3 100644 | |||
--- a/node_modules/@metamask/base-controller/dist/RestrictedControllerMessenger.d.ts |
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 you pleas provide a brief explanation of why we need this path and perhaps what conditions need to be met for us to remove it?
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 patch is also related to the issue, adding a "default" to the base-controller.
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 is unrelated to the linked issue. The intended interface for RestrictedControllerMessenger
is to require all five generic parameters.
The added default arguments (=string
) here allow all possible external actions and events to be used by all messenger instances, which completely negates the allowlist paradigm we have in place for controllers.
This is acceptable if it's absolutely needed to unblock development, but I would suggest that this patch be reverted in the near future as it compromises secure coding practices.
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.
Looking good. I added a few comments but nothing major. Let me know when you need me to take another pass.
@SocketSecurity ignore npm/extension-port-stream@3.0.0 |
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.
All comments addressed.
@@ -0,0 +1,13 @@ | |||
diff --git a/node_modules/@metamask/base-controller/dist/RestrictedControllerMessenger.d.ts b/node_modules/@metamask/base-controller/dist/RestrictedControllerMessenger.d.ts | |||
index 423c1a9..5c62cb3 100644 | |||
--- a/node_modules/@metamask/base-controller/dist/RestrictedControllerMessenger.d.ts |
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 patch is also related to the issue, adding a "default" to the base-controller.
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.
💪
Quality Gate passedIssues Measures |
Description
This PR bumps snaps packages alongside others in order to allow snaps new architecture and refactored code from snaps codebase be used into mobile as an external dependency.
The current PR builds the bases to the 8369. Any failing tests related to snaps can be safely ignored since the snaps "consumer" code is/will be handled/refactored on the PR above.
Related issues
Fixes: N/A
Pre-merge author checklist
Pre-merge reviewer checklist