-
Notifications
You must be signed in to change notification settings - Fork 5.2k
feat: trezor web connect library upgrade. #33834
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
base: main
Are you sure you want to change the base?
Conversation
- Bump @trezor/connect-web version from 9.4.7 to 9.6.0 in package.json and yarn.lock. - Update @emurgo/cardano-serialization-lib-browser and @emurgo/cardano-serialization-lib-nodejs to version 13.2.0 in yarn.lock. - Add manifest name 'MetaMask' to Trezor SDK initialization in trezor.ts for better identification.
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. |
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. Ignoring alerts on:
|
@metamaskbot update-policies |
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
✨ Files requiring CODEOWNER review ✨🧩 @MetaMask/extension-devs (4 files, +136 -36)
📜 @MetaMask/policy-reviewers (4 files, +136 -36)
Tip Follow the policy review process outlined in the LavaMoat Policy Review Process doc before expecting an approval from Policy Reviewers. 🔗 @MetaMask/supply-chain (4 files, +136 -36)
|
@metamaskbot update-policies |
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
All those alerts from Trezor/connect-web library upgrade and those network access libraries is required to access trezor dapp external to complete the trezor funciton. therefore we need those libraries otherwise, trezor feature will not work. @SocketSecurity ignore-all |
@SocketSecurity ignore-all |
@metamaskbot update-policies |
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
Root Cause: The webpack configuration was trying to process all vendor JavaScript files (including Trezor library files) through the ecmaLoader, which uses SWC configured for ES modules. The Problem: Some files in @trezor/connect-web version 9.6.0 still use CommonJS format (exports.something = value), but SWC was trying to process them as ES modules where exports isn't available. The Solution: By excluding @trezor packages from the SWC loader (just like @lavamoat/snow was already excluded), webpack will use its default JavaScript processing which can handle mixed module formats better.
Builds ready [e0ae2b0]
UI Startup Metrics (1195 ± 64 ms)
Benchmark value 34 exceeds gate value 33 for chrome browserify home p95 getState Benchmark value 2223 exceeds gate value 2192 for chrome webpack home mean uiStartup Benchmark value 264 exceeds gate value 235 for chrome webpack home mean firstReactRender Benchmark value 2648 exceeds gate value 2454 for chrome webpack home p95 uiStartup Benchmark value 58 exceeds gate value 57 for chrome webpack home p95 domInteractive Benchmark value 412 exceeds gate value 370 for chrome webpack home p95 firstReactRender Benchmark value 1986 exceeds gate value 1970 for chrome webpack home p95 loadScripts Benchmark value 116 exceeds gate value 110 for firefox browserify home mean domInteractive Benchmark value 26 exceeds gate value 25 for firefox browserify home mean backgroundConnect Benchmark value 26 exceeds gate value 25 for firefox browserify home mean firstReactRender Benchmark value 17 exceeds gate value 11 for firefox browserify home mean getState Benchmark value 11 exceeds gate value 9 for firefox browserify home mean setupStore Benchmark value 67 exceeds gate value 24 for firefox browserify home p95 getState Benchmark value 31 exceeds gate value 27 for firefox browserify home p95 setupStore Benchmark value 1634 exceeds gate value 1615 for firefox webpack home mean uiStartup Benchmark value 1406 exceeds gate value 1380 for firefox webpack home mean load Benchmark value 1406 exceeds gate value 1380 for firefox webpack home mean domContentLoaded Benchmark value 107 exceeds gate value 100 for firefox webpack home mean domInteractive Benchmark value 43 exceeds gate value 38 for firefox webpack home mean firstReactRender Benchmark value 1386 exceeds gate value 1360 for firefox webpack home mean loadScripts Benchmark value 16 exceeds gate value 13 for firefox webpack home mean setupStore Benchmark value 2001 exceeds gate value 1935 for firefox webpack home p95 uiStartup Benchmark value 1756 exceeds gate value 1660 for firefox webpack home p95 load Benchmark value 1755 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded Benchmark value 280 exceeds gate value 156 for firefox webpack home p95 domInteractive Benchmark value 1738 exceeds gate value 1630 for firefox webpack home p95 loadScripts Benchmark value 61 exceeds gate value 28 for firefox webpack home p95 setupStore Sum of mean exceeds: 191ms | Sum of p95 exceeds: 823ms Sum of all benchmark exceeds: 1014ms Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
@metamaskbot update-policies |
// never process `@lavamoat/snow/**.*` | ||
exclude: /^.*\/node_modules\/@lavamoat\/snow\/.*$/u, | ||
// never process `@lavamoat/snow/**.*` and `@trezor/**.*` | ||
exclude: /^.*\/node_modules\/(@lavamoat\/snow|@trezor)\/.*$/u, |
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 line will fix the webpack build .
Root Cause: The webpack configuration was trying to process all vendor JavaScript files (including Trezor library files) through the ecmaLoader, which uses SWC configured for ES modules.
The Problem: Some files in @trezor/connect-web version 9.6.0 still use CommonJS format (exports.something = value), but SWC was trying to process them as ES modules where exports isn't available.
The Solution: By excluding https://github.com/trezor packages from the SWC loader (just like @lavamoat/snow was already excluded), webpack will use its default JavaScript processing which can handle mixed module formats better.
Policies updated. 🧠 Learn how: https://lavamoat.github.io/guides/policy-diff/#what-to-look-for-when-reviewing-a-policy-diff |
Builds ready [57f8ab7]
UI Startup Metrics (1274 ± 56 ms)
Benchmark value 1096 exceeds gate value 1070 for chrome browserify home mean load Benchmark value 1088 exceeds gate value 1061 for chrome browserify home mean domContentLoaded Benchmark value 24 exceeds gate value 23 for chrome browserify home mean firstReactRender Benchmark value 18 exceeds gate value 15 for chrome browserify home mean getState Benchmark value 1377 exceeds gate value 1365 for chrome browserify home p95 uiStartup Benchmark value 1182 exceeds gate value 1180 for chrome browserify home p95 domContentLoaded Benchmark value 1183 exceeds gate value 1180 for chrome browserify home p95 firstPaint Benchmark value 27 exceeds gate value 18 for chrome browserify home p95 backgroundConnect Benchmark value 23 exceeds gate value 17 for chrome browserify home p95 setupStore Benchmark value 2256 exceeds gate value 2192 for chrome webpack home mean uiStartup Benchmark value 269 exceeds gate value 235 for chrome webpack home mean firstReactRender Benchmark value 2790 exceeds gate value 2454 for chrome webpack home p95 uiStartup Benchmark value 2071 exceeds gate value 2030 for chrome webpack home p95 load Benchmark value 2055 exceeds gate value 2005 for chrome webpack home p95 domContentLoaded Benchmark value 63 exceeds gate value 57 for chrome webpack home p95 domInteractive Benchmark value 413 exceeds gate value 370 for chrome webpack home p95 firstReactRender Benchmark value 2044 exceeds gate value 1970 for chrome webpack home p95 loadScripts Benchmark value 125 exceeds gate value 110 for firefox browserify home mean domInteractive Benchmark value 16 exceeds gate value 11 for firefox browserify home mean getState Benchmark value 11 exceeds gate value 9 for firefox browserify home mean setupStore Benchmark value 1668 exceeds gate value 1660 for firefox browserify home p95 uiStartup Benchmark value 318 exceeds gate value 195 for firefox browserify home p95 domInteractive Benchmark value 72 exceeds gate value 24 for firefox browserify home p95 getState Benchmark value 50 exceeds gate value 27 for firefox browserify home p95 setupStore Benchmark value 1665 exceeds gate value 1615 for firefox webpack home mean uiStartup Benchmark value 1427 exceeds gate value 1380 for firefox webpack home mean load Benchmark value 1427 exceeds gate value 1380 for firefox webpack home mean domContentLoaded Benchmark value 110 exceeds gate value 100 for firefox webpack home mean domInteractive Benchmark value 28 exceeds gate value 26 for firefox webpack home mean backgroundConnect Benchmark value 44 exceeds gate value 38 for firefox webpack home mean firstReactRender Benchmark value 16 exceeds gate value 15 for firefox webpack home mean getState Benchmark value 1406 exceeds gate value 1360 for firefox webpack home mean loadScripts Benchmark value 2140 exceeds gate value 1935 for firefox webpack home p95 uiStartup Benchmark value 1763 exceeds gate value 1660 for firefox webpack home p95 load Benchmark value 1762 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded Benchmark value 307 exceeds gate value 156 for firefox webpack home p95 domInteractive Benchmark value 51 exceeds gate value 50 for firefox webpack home p95 firstReactRender Benchmark value 36 exceeds gate value 32 for firefox webpack home p95 getState Benchmark value 1741 exceeds gate value 1630 for firefox webpack home p95 loadScripts Benchmark value 36 exceeds gate value 28 for firefox webpack home p95 setupStore Sum of mean exceeds: 426ms | Sum of p95 exceeds: 1469ms Sum of all benchmark exceeds: 1895ms Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [791d8dd]
UI Startup Metrics (1234 ± 60 ms)
Benchmark value 17 exceeds gate value 1.2 for chrome browserify home p95 initialActions Benchmark value 18 exceeds gate value 17 for chrome browserify home p95 setupStore Benchmark value 2231 exceeds gate value 2192 for chrome webpack home mean uiStartup Benchmark value 266 exceeds gate value 235 for chrome webpack home mean firstReactRender Benchmark value 11 exceeds gate value 7 for chrome webpack home mean initialActions Benchmark value 2683 exceeds gate value 2454 for chrome webpack home p95 uiStartup Benchmark value 65 exceeds gate value 57 for chrome webpack home p95 domInteractive Benchmark value 401 exceeds gate value 370 for chrome webpack home p95 firstReactRender Benchmark value 34 exceeds gate value 7 for chrome webpack home p95 initialActions Benchmark value 1984 exceeds gate value 1970 for chrome webpack home p95 loadScripts Benchmark value 1412 exceeds gate value 1405 for firefox browserify home mean uiStartup Benchmark value 118 exceeds gate value 110 for firefox browserify home mean domInteractive Benchmark value 26 exceeds gate value 25 for firefox browserify home mean firstReactRender Benchmark value 16 exceeds gate value 11 for firefox browserify home mean getState Benchmark value 5 exceeds gate value 1 for firefox browserify home mean initialActions Benchmark value 13 exceeds gate value 9 for firefox browserify home mean setupStore Benchmark value 1752 exceeds gate value 1660 for firefox browserify home p95 uiStartup Benchmark value 309 exceeds gate value 195 for firefox browserify home p95 domInteractive Benchmark value 42 exceeds gate value 24 for firefox browserify home p95 getState Benchmark value 18 exceeds gate value 2 for firefox browserify home p95 initialActions Benchmark value 51 exceeds gate value 27 for firefox browserify home p95 setupStore Benchmark value 1655 exceeds gate value 1615 for firefox webpack home mean uiStartup Benchmark value 1431 exceeds gate value 1380 for firefox webpack home mean load Benchmark value 1431 exceeds gate value 1380 for firefox webpack home mean domContentLoaded Benchmark value 113 exceeds gate value 100 for firefox webpack home mean domInteractive Benchmark value 43 exceeds gate value 38 for firefox webpack home mean firstReactRender Benchmark value 6 exceeds gate value 1 for firefox webpack home mean initialActions Benchmark value 1412 exceeds gate value 1360 for firefox webpack home mean loadScripts Benchmark value 2034 exceeds gate value 1935 for firefox webpack home p95 uiStartup Benchmark value 1687 exceeds gate value 1660 for firefox webpack home p95 load Benchmark value 1686 exceeds gate value 1660 for firefox webpack home p95 domContentLoaded Benchmark value 303 exceeds gate value 156 for firefox webpack home p95 domInteractive Benchmark value 25 exceeds gate value 2 for firefox webpack home p95 initialActions Benchmark value 1667 exceeds gate value 1630 for firefox webpack home p95 loadScripts Sum of mean exceeds: 325ms | Sum of p95 exceeds: 948.8ms Sum of all benchmark exceeds: 1273.8ms Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Description
This PR will upgrade trezor/connect-web library based on trezor team suggestion. please refer to plan https://github.com/MetaMask/accounts-planning/issues/936 for details.
This PR will add a appName parameter to manifest to initialise TrezorSDK.
Related issues
Fixes: https://github.com/MetaMask/accounts-planning/issues/936
Manual testing steps
All trezor flows will need to tested to make sure nothing broken.
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist