Skip to content

Conversation

@matthewwalsh0
Copy link
Member

@matthewwalsh0 matthewwalsh0 commented Feb 14, 2025

Upgrade all @ethereumjs/* packages:

  • @ethereumjs/util - ^8.1.0 > ^9.1.0
  • @ethereumjs/tx - ^4.2.0 > ^5.4.0
  • @ethereumjs/common - ^3.2.0 > ^4.4.0

Necessary to align with @metamask/transaction-controller which requires the latest versions to support EIP-7702 transactions.

Minor refactors to support breaking changes, primarily:

  • Buffer usage replaced with Uint8Array.
  • bufferToHex > bytesToHex
  • Transaction Constructor > LegacyTransaction.fromTxData
  • TxData > TypedTxData
  • getMessageToSign(false) > getMessageToSign
  • getMessageToSign(true) > getHashedMessageToSign

Notes

  • Using bytesToHex from @metamask/utils rather than @ethereumjs/utils for additional control and performance.
  • Intentionally doing the minimum refactors to private methods and existing logic hence some continued use of Buffer.

@matthewwalsh0
Copy link
Member Author

@metamaskbot publish-preview

@github-actions
Copy link

Preview builds have been published. See these instructions (from the core monorepo) for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/keyring-api": "17.0.0-44b05d1",
  "@metamask-previews/eth-hd-keyring": "10.0.0-44b05d1",
  "@metamask-previews/eth-ledger-bridge-keyring": "8.0.4-44b05d1",
  "@metamask-previews/eth-simple-keyring": "8.1.0-44b05d1",
  "@metamask-previews/eth-trezor-keyring": "6.1.0-44b05d1",
  "@metamask-previews/keyring-internal-api": "4.0.2-44b05d1",
  "@metamask-previews/keyring-internal-snap-client": "4.0.0-44b05d1",
  "@metamask-previews/eth-snap-keyring": "10.0.0-44b05d1",
  "@metamask-previews/keyring-snap-client": "4.0.0-44b05d1",
  "@metamask-previews/keyring-snap-sdk": "3.0.0-44b05d1",
  "@metamask-previews/keyring-utils": "2.1.0-44b05d1"
}

@matthewwalsh0 matthewwalsh0 marked this pull request as ready for review February 14, 2025 23:07
@matthewwalsh0 matthewwalsh0 requested a review from a team as a code owner February 14, 2025 23:07
@matthewwalsh0
Copy link
Member Author

@metamaskbot publish-preview

@github-actions
Copy link

Preview builds have been published. See these instructions (from the core monorepo) for more information about preview builds.

Expand for full list of packages and versions.
{
  "@metamask-previews/keyring-api": "17.2.1-f2dd645",
  "@metamask-previews/eth-hd-keyring": "10.0.1-f2dd645",
  "@metamask-previews/eth-ledger-bridge-keyring": "8.0.5-f2dd645",
  "@metamask-previews/eth-simple-keyring": "8.1.1-f2dd645",
  "@metamask-previews/eth-trezor-keyring": "6.1.1-f2dd645",
  "@metamask-previews/keyring-internal-api": "4.0.3-f2dd645",
  "@metamask-previews/keyring-internal-snap-client": "4.0.1-f2dd645",
  "@metamask-previews/eth-snap-keyring": "11.1.0-f2dd645",
  "@metamask-previews/keyring-snap-client": "4.0.1-f2dd645",
  "@metamask-previews/keyring-snap-sdk": "3.0.1-f2dd645",
  "@metamask-previews/keyring-utils": "2.3.1-f2dd645"
}

@matthewwalsh0 matthewwalsh0 added this pull request to the merge queue Feb 28, 2025
Merged via the queue into main with commit bf991be Feb 28, 2025
31 checks passed
@matthewwalsh0 matthewwalsh0 deleted the chore/upgrade-ethereumjs branch February 28, 2025 12:30
matthewwalsh0 added a commit to MetaMask/core that referenced this pull request Mar 5, 2025
## Explanation

Align `@ethereumjs/*` package versions to avoid any risk of
incompatibility and simplify future maintenance.

Upgrade originally required by `@metamask/transaction-controller` to
support EIP-7702 transactions.

## References

- `@metamask/accounts`
[PR](MetaMask/accounts#209)

## Changelog

See changelogs.

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes

---------

Co-authored-by: Michele Esposito <michele@esposito.codes>
Co-authored-by: Michele Esposito <34438276+mikesposito@users.noreply.github.com>
github-merge-queue bot pushed a commit that referenced this pull request Mar 21, 2025
…` (due to latest `@ethereumjs` upgrade) (#253)

This PR will fix the ledger sign transaction issue due to this
ethereumjs upgrade PR #209

and basically the ethereumjs upgrade code change make the transaction
rawTxHex contain `0x` prefix which is not valid for to
@ledgerhq/hw-eth-app clearSignTransaction function. that functions
expect a rawTxHex without `0x` prefix.
 
<!--
Thanks for your contribution! Take a moment to answer these questions so
that reviewers have the information they need to properly understand
your changes:

* What is the current state of things and why does it need to change?
* What is the solution your changes offer and how does it work?

Are there any issues or other links reviewers should consult to
understand this pull request better? For instance:

* Fixes
[#31004](MetaMask/metamask-extension#31004)
* See: #67890
-->


<!--
Are there any examples of this change being used in another repository?

When considering changes to the MetaMask module template, it's strongly
preferred that the change be experimented with in another repository
first. This gives reviewers a better sense of how the change works,
making it less likely the change will need to be reverted or adjusted
later.
-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants