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

chore(deps): bump @metamask/eth-trezor-keyring to ^6.0.0 #27689

Merged
merged 16 commits into from
Jan 9, 2025

Conversation

mikesposito
Copy link
Member

@mikesposito mikesposito commented Oct 8, 2024

Description

This PR bumps @metamask/eth-trezor-keyring from ^3.1.3 to ^6.0.0.

## [6.0.0]

### Added

- **BREAKING:** Add ESM build ([#40](https://github.com/MetaMask/accounts/pull/40))
  - It's no longer possible to import files from `./dist` directly.

## [5.0.0]

### Changed

- **BREAKING**: Bump `@metamask/eth-sig-util` dependency from `^7.0.3` to `^8.0.0` ([#79](https://github.com/MetaMask/accounts/pull/79))
  - `signTypedData` no longer support `number` for addresses, see [here](https://github.com/MetaMask/eth-sig-util/blob/main/CHANGELOG.md#800).

## [4.0.0]

### Changed

- **BREAKING**: `addAccounts` will now only return newly created accounts ([#64](https://github.com/MetaMask/accounts/pull/64))
  - This keyring was initially returning every accounts (previous and new ones), which is different from what is expected in the [`Keyring` interface].(https://github.com/MetaMask/utils/blob/v9.2.1/src/keyring.ts#L65)

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

These changes directly impact Trezor devices:

  1. Add one or more Trezor accounts
  2. Sign message
  3. Sign typed data
  4. Sign transaction
  5. Remove Trezor accounts

Screenshots/Recordings

Before

After

Pre-merge author checklist

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.

Copy link

socket-security bot commented Oct 8, 2024

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

Package New capabilities Transitives Size Publisher
npm/@metamask/[email protected] None 0 160 kB metamaskbot
npm/@metamask/[email protected] None 0 136 kB metamaskbot

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

View full report↗︎

Copy link

sonarqubecloud bot commented Oct 8, 2024

@mikesposito mikesposito marked this pull request as ready for review November 19, 2024 12:32
@mikesposito mikesposito requested review from a team as code owners November 19, 2024 12:32
@mikesposito mikesposito self-assigned this Nov 19, 2024
@mikesposito mikesposito changed the title chore(deps): bump trezor keyring to ^4.0.0 chore(deps): bump trezor keyring to ^6.0.0 Dec 9, 2024
package.json Outdated
@@ -251,7 +251,8 @@
"@ledgerhq/hw-app-eth@npm:^6.39.0": "patch:@ledgerhq/hw-app-eth@npm%3A6.39.0#~/.yarn/patches/@ledgerhq-hw-app-eth-npm-6.39.0-866309bbbe.patch",
"@ledgerhq/evm-tools@npm:^1.2.3": "patch:@ledgerhq/evm-tools@npm%3A1.2.3#~/.yarn/patches/@ledgerhq-evm-tools-npm-1.2.3-414f44baa9.patch",
"cross-spawn@npm:^5.0.1": "^7.0.6",
"@solana/web3.js@npm:^1.95.0": "^1.95.8"
"@solana/web3.js@npm:^1.95.0": "^1.95.8",
"tslib": "~2.6.0"
Copy link
Member Author

Choose a reason for hiding this comment

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

this tslib forced resolution has been added to fix this error that prevents the wallet unlock:

TypeError#1: Cannot assign to read only property 'Symbol(Symbol.iterator)' of object '[object Object]'
(anonymous) @ sentry-install.js:37776
sentry-install.js:37776   at Object.__generator (chrome-extension://bclblcklhpbhilglihnehjhmpfchmmpp/common-8.js:49554:131)
  at Mutex.<anonymous> (chrome-extension://bclblcklhpbhilglihnehjhmpfchmmpp/common-5.js:22679:28)
  at chrome-extension://bclblcklhpbhilglihnehjhmpfchmmpp/common-8.js:49548:41
  at new Promise (<anonymous>)
  at Object.__awaiter (chrome-extension://bclblcklhpbhilglihnehjhmpfchmmpp/common-8.js:49544:16)
  at Mutex.acquire (chrome-extension://bclblcklhpbhilglihnehjhmpfchmmpp/common-5.js:22676:24)
  at CurrencyRateController.updateExchangeRate (chrome-extension://bclblcklhpbhilglihnehjhmpfchmmpp/common-1.js:21928:42)
  at CurrencyRateController._executePoll (chrome-extension://bclblcklhpbhilglihnehjhmpfchmmpp/common-1.js:21994:16)
  at chrome-extension://bclblcklhpbhilglihnehjhmpfchmmpp/common-1.js:24712:24
  at sentryWrapped (chrome-extension://bclblcklhpbhilglihnehjhmpfchmmpp/scripts/sentry-install.js:21642:17)

Copy link
Member

Choose a reason for hiding this comment

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

Two suggestions: Could we drop tslib as a top-level dependency, and can we narrow this resolution further?

The resolution is currently applied to all copies of tslib in the dependency tree, not just the one that was causing an issue here. Some of the affected versions are asking for a range that doesn't include 2.6 (e.g. there was on 1.x copy)

Copy link
Member Author

@mikesposito mikesposito Dec 11, 2024

Choose a reason for hiding this comment

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

The direct dependency has been added because it is a peer dependency of @trezor/connect-web, which is a dependency of both the keyring and the client (because of the offscreen client-defined keyring). I suppose that some other package already provided it, but I thought it would be good to add it explicitly. Do you think we should remove it?

Regarding the resolution, it is indeed too broad, and we are getting rid of 1.x - I'll try to narrow it down

This comment was marked as outdated.

Copy link
Contributor

Choose a reason for hiding this comment

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

On a sidenote, I believe we have wrongly added a "direct" dep to tslib on Trezor keyring here:

We probably should have use a peer dep for this one instead... I'll check/track this internally to avoid having this resolution (cause I do believe we could get rid of it if we the dependency was done correctly on our side)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that this issue is due to a specific version range of tslib which is incompatible with certain parts of the extension, so we probably would have experienced it regardless at some point

@mikesposito mikesposito changed the title chore(deps): bump trezor keyring to ^6.0.0 chore(deps): bump @metamask/eth-trezor-keyring to ^6.0.0 Dec 10, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [458e0a1]
Page Load Metrics (1992 ± 88 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint31924371815505242
domContentLoaded17052362195917986
load17132382199218488
domInteractive257038136
backgroundConnect7105332613
firstReactRender1791312311
getState983041727335
initialActions01000
loadScripts13291929153215675
setupStore783172210
uiStartup194029402409272131
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 56.62 KiB (1.08%)
  • ui: 0 Bytes (0.00%)
  • common: -906 Bytes (-0.01%)

gantunesr
gantunesr previously approved these changes Dec 10, 2024
@mikesposito
Copy link
Member Author

@metamaskbot update-policies

@metamaskbot
Copy link
Collaborator

No policy changes

@metamaskbot
Copy link
Collaborator

Builds ready [06a0b65]
Page Load Metrics (1593 ± 83 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint13812049159617584
domContentLoaded13752031157216880
load13882051159317383
domInteractive22131463014
backgroundConnect86328209
firstReactRender1575302211
getState46218199
initialActions01000
loadScripts9971556116613866
setupStore67113189
uiStartup152423321826212102

Copy link
Contributor

@ccharly ccharly left a comment

Choose a reason for hiding this comment

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

LGTM, I rely on e2e tests for validation though.

@metamaskbot
Copy link
Collaborator

Builds ready [37aed22]
Page Load Metrics (1614 ± 132 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint138326101609259124
domContentLoaded134025661586251121
load138526811614275132
domInteractive216630115
backgroundConnect8120283014
firstReactRender1572392412
getState441984
initialActions00000
loadScripts9631924116919694
setupStore65111136
uiStartup157730381812305146

@mikesposito mikesposito enabled auto-merge January 8, 2025 15:18
@Akaryatrh
Copy link
Contributor

Good to me. Tested locally and was able to test successfully (with Trezor simulator) the provided scenario:

  • Add one or more Trezor accounts
  • Sign message
  • Sign typed data
  • Sign transaction
  • Remove Trezor accounts

@mikesposito mikesposito added this pull request to the merge queue Jan 9, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 9, 2025
@mikesposito mikesposito added this pull request to the merge queue Jan 9, 2025
Merged via the queue into main with commit 00a5db7 Jan 9, 2025
77 checks passed
@mikesposito mikesposito deleted the mikesposito/update-trezor branch January 9, 2025 12:42
@github-actions github-actions bot locked and limited conversation to collaborators Jan 9, 2025
@metamaskbot metamaskbot added the release-12.11.0 Issue or pull request that will be included in release 12.11.0 label Jan 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.11.0 Issue or pull request that will be included in release 12.11.0 team-wallet-framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants