Skip to content
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

Migrate @metamask/eth-json-rpc-provider into core monorepo #1707

Closed
wants to merge 31 commits into from

Conversation

MajorLift
Copy link
Contributor

@MajorLift MajorLift commented Sep 22, 2023

Explanation

References

Changelog

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

Gudahtt and others added 26 commits February 8, 2023 18:30
The package manifest, README, and PR template have been updated.
* Migrate both provider functions

The functions `providerFromEngine` and `providerFromMiddleware` have
been migrated from `@metamask/eth-json-rpc-middleware`.

The `SafeEventEmitterProvider` is now a class with its own separate
module, rather than a type. Hopefully this will help prevent future
type errors. The error in the `SafeEventEmitterProvider` type in
`@metamask/eth-json-rpc-middleware` has been corrected; the response in
in the callback is now optional.

Everything should be fully documented and tested.

* Export type

* Fix spelling mistake

Co-authored-by: Alex Donesky <[email protected]>

* Improve test names

---------

Co-authored-by: Alex Donesky <[email protected]>
Bumps [@metamask/eslint-config-jest](https://github.com/MetaMask/eslint-config) from 11.0.0 to 11.1.0.
- [Release notes](https://github.com/MetaMask/eslint-config/releases)
- [Commits](MetaMask/eslint-config@v11.0.0...v11.1.0)

---
updated-dependencies:
- dependency-name: "@metamask/eslint-config-jest"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@metamask/eslint-config](https://github.com/MetaMask/eslint-config) from 11.0.2 to 11.1.0.
- [Release notes](https://github.com/MetaMask/eslint-config/releases)
- [Commits](MetaMask/eslint-config@v11.0.2...v11.1.0)

---
updated-dependencies:
- dependency-name: "@metamask/eslint-config"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mark Stacey <[email protected]>
Bumps [@metamask/eslint-config-typescript](https://github.com/MetaMask/eslint-config) from 11.0.2 to 11.1.0.
- [Release notes](https://github.com/MetaMask/eslint-config/releases)
- [Commits](MetaMask/eslint-config@v11.0.2...v11.1.0)

---
updated-dependencies:
- dependency-name: "@metamask/eslint-config-typescript"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mark Stacey <[email protected]>
Bumps [@metamask/eslint-config-nodejs](https://github.com/MetaMask/eslint-config) from 11.0.1 to 11.1.0.
- [Release notes](https://github.com/MetaMask/eslint-config/releases)
- [Commits](MetaMask/eslint-config@v11.0.1...v11.1.0)

---
updated-dependencies:
- dependency-name: "@metamask/eslint-config-nodejs"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mark Stacey <[email protected]>
The version has been changed to v0.0.1 so that the first release can be
v1. I set this to v1 forgetting that our release automation would also
attempt to set this.
* 1.0.0

* Update changelog

---------

Co-authored-by: github-actions <[email protected]>
Co-authored-by: Mark Stacey <[email protected]>
* deps: @metamask/safe-event-emitter@^2.0.0->^3.0.0
* deps: migrate from json-rpc-engine to @metamask/json-rpc-engine

---------

Co-authored-by: github-actions <[email protected]>
Co-authored-by: legobt <[email protected]>
v1.0.1 contains two changes that should have been considered
semver-major:

- Type-interface incompatability with previous version (MetaMask/json-rpc-engine#139)
- Introduced dependency `@metamask/json-rpc-engine` indicates a minimum
  supported Node.js version of 16. This prevents the module from
  installing on some package manager configurations, like default
  yarn classic.

This will be re-released as v2.0.0.
Required by update of `@metamask/json-rpc-engine` (#16)
Required by update of `@metamask/json-rpc-engine` (#16)

---------

Co-authored-by: github-actions <[email protected]>
Co-authored-by: legobt <[email protected]>
…25)

* deps: @metamask/utils@^5.0.1->^8.1.0
* deps: @metamask/json-rpc-engine@^7.0.0->^7.1.0
* deps: @metamask/utils@^7.1.0->^8.1.0
---------

Co-authored-by: github-actions <[email protected]>
Co-authored-by: legobt <[email protected]>
Co-authored-by: legobeat <[email protected]>
Co-authored-by: Maarten Zuidhoorn <[email protected]>
…norepo

- added: `eslint-plugin-promise`
- removed: `eslint-plugin-node`

Closes #1683
@MajorLift MajorLift added dependencies Pull requests that update a dependency file team-wallet-framework labels Sep 22, 2023
@MajorLift MajorLift self-assigned this Sep 22, 2023
@MajorLift MajorLift force-pushed the 230921-migrate-eth-json-rpc-provider branch from f6738df to 72ae659 Compare September 22, 2023 22:23
@socket-security
Copy link

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
jest-it-up 2.2.0 filesystem, environment +16 533 kB rbardini
@metamask/keyring-api 0.2.5...0.2.6 None +38/-50 28.3 MB metamaskbot
jest-when 3.5.2...3.6.0 None +30/-24 18.2 MB timkindberg

🚮 Removed packages: @lavamoat/[email protected], @metamask/[email protected], @metamask/[email protected], @metamask/[email protected], @types/[email protected]

@socket-security
Copy link

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Issue Package Version Note Source
Network access ws 7.5.9
New author @lavamoat/aa 3.1.5
Unstable ownership @lavamoat/aa 3.1.5
No README @inquirer/core 0.0.15-alpha.0
Shell access @metamask/snaps-controllers 2.0.0
Shell access @metamask/snaps-utils 2.0.0

Next steps

What is network access?

This module accesses the network.

Packages should remove all network access that is functionally unnecessary. Consumers should audit network access to ensure legitimate use.

What is new author?

A new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.

Scrutinize new collaborator additions to packages because they now have the ability to publish code into your dependency tree. Packages should avoid frequent or unnecessary additions or changes to publishing rights.

What is unstable ownership?

A new collaborator has begun publishing package versions. Package stability and security risk may be elevated.

Try to reduce the amount of authors you depend on to reduce the risk to malicious actors gaining access to your supply chain. Packages should remove inactive collaborators with publishing rights from packages on npm.

Why are READMEs important?

Package does not have a README. This may indicate a failed publish or a low quality package.

Add a README to to the package and publish a new version.

What is shell access?

This module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.

Packages should avoid accessing the shell which can reduce portability, and make it easier for malicious shell access to be introduced.

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 [email protected] bar@* or ignore all packages with @SocketSecurity ignore-all

@MajorLift MajorLift added the enhancement New feature or request label Sep 22, 2023
@legobeat
Copy link
Contributor

I think this should not be merged before bumping workspace dependencies on the package in line with latest:

@mikesposito
Copy link
Member

@MajorLift perhaps would be better to break down this PR into multiple ones to make it easier to see and review the changes, and creating the first two PRs on the original repository:

@MajorLift
Copy link
Contributor Author

Thanks for the feedback! I'll be closing this PR and reopening it.

@legobeat Thanks for pointing this out. It looks like using the latest version of @metamask/utils is necessary to clear the errors currently showing up in CI. I'll bump it in the new PR.

@mikesposito I just opened the first two PRs on the original repo. It's looking like most of the commits will happen on the last PR after the merging step.

Jamstar00

This comment was marked as spam.

@MetaMask MetaMask locked as spam and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request team-wallet-framework
Projects
None yet
5 participants