Skip to content

Replace ethjs packages with @metamask/ethjs forks#2064

Merged
legobeat merged 4 commits intoMetaMask:mainfrom
legobeat:deps-ethjs
Nov 20, 2023
Merged

Replace ethjs packages with @metamask/ethjs forks#2064
legobeat merged 4 commits intoMetaMask:mainfrom
legobeat:deps-ethjs

Conversation

@legobeat
Copy link
Copy Markdown
Contributor

@legobeat legobeat commented Nov 20, 2023

Explanation

Use MetaMask forks of ethjs packages. This is the first step of a gradual update which will result in removing dependency on babel-runtime@6.x, amongst other improvements.

References

Related

Changelog

@metamask/controller-utils

  • CHANGED: Update from ethjs-unit to @metamask/ethjs-unit

@metamask/gas-fee-controller

  • CHANGED: Update from ethjs-unit to @metamask/ethjs-unit

@metamask/assets-controllers

  • CHANGED: Update from ethjs-provider-http to @metamask/ethjs-provider-http

@metamask/transactions-controller

  • CHANGED: Update from ethjs-provider-http to @metamask/ethjs-provider-http

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@socket-security
Copy link
Copy Markdown

socket-security bot commented Nov 20, 2023

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@metamask/ethjs-provider-http 0.2.0 environment +3 465 kB lgbot
@metamask/ethjs-unit 0.2.1 None +0 457 kB

@legobeat legobeat added the dependencies Pull requests that update a dependency file label Nov 20, 2023
@socket-security
Copy link
Copy Markdown

socket-security bot commented Nov 20, 2023

👍 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: @metamask/ethjs-unit@0.2.1

Next steps

Take a deeper look at the dependency

Take 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 package

If 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 risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

@legobeat
Copy link
Copy Markdown
Contributor Author

@SocketSecurity ignore @metamask/ethjs-unit@0.2.1

@legobeat legobeat requested a review from MajorLift November 20, 2023 09:05
@legobeat legobeat force-pushed the deps-ethjs branch 4 times, most recently from 5a4954c to 4cf75e8 Compare November 20, 2023 09:22
Copy link
Copy Markdown
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Most of the places we are using these packages are in tests, so there is an opportunity to remove usage entirely, but we can leave that for another PR. Looks good.

@legobeat
Copy link
Copy Markdown
Contributor Author

legobeat commented Nov 20, 2023

Most of the places we are using these packages are in tests, so there is an opportunity to remove usage entirely, but we can leave that for another PR. Looks good.

Isn't the point of using it in tests to preserve compatibility with existing downstream use, ie extension and mobile? That is, they should be removed there before being removed as tests here.

@legobeat legobeat merged commit 6822b6f into MetaMask:main Nov 20, 2023
@mcmire
Copy link
Copy Markdown
Contributor

mcmire commented Nov 20, 2023

Sure, we can definitely wait until we remove them from the clients before removing them here.

@legobeat legobeat deleted the deps-ethjs branch November 20, 2023 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants