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): force secp256k1 4.0.4 version with resolutions #28177

Merged

Conversation

ccharly
Copy link
Contributor

@ccharly ccharly commented Oct 30, 2024

Description

Forcing resolutions to fix yarn audit warnings and more specifically this issue:

I decided to be very explicit about the resolution itself based on the output of:

$ yarn why secp256k1
├─ ethereum-cryptography@npm:0.1.3
│  └─ secp256k1@npm:4.0.4 (via npm:^4.0.1)

├─ ganache@npm:7.9.2
│  └─ secp256k1@npm:4.0.3 (via npm:4.0.3)

├─ ganache@patch:ganache@npm%3A7.9.2#~/.yarn/patches/ganache-npm-7.9.2-a70dc8da34.patch::version=7.9.2&hash=7d7c66
│  └─ secp256k1@npm:4.0.3 (via npm:4.0.3)

├─ gridplus-sdk@npm:2.5.1
│  └─ secp256k1@npm:4.0.2 (via npm:4.0.2)

└─ hdkey@npm:2.1.0
   └─ secp256k1@npm:4.0.4 (via npm:^4.0.0)

We could also have a more straightforward resolution like:

  ...
  "resolutions": {
    ...
    "secp256k1": "4.0.4"
  }
  ...

But that could also catch version with different major.

Let me know what would be the preferred solution here.

Open in GitHub Codespaces

Related issues

Fixes: GHSA-584q-6j8j-r5pm

Manual testing steps

N/A

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.

@ccharly ccharly requested review from a team as code owners October 30, 2024 10:05
Copy link
Contributor

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.

Copy link

socket-security bot commented Oct 30, 2024

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

🚮 Removed packages: npm/[email protected]

View full report↗︎

@metamaskbot
Copy link
Collaborator

Builds ready [8a67e17]
Page Load Metrics (2274 ± 218 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint37426181730748359
domContentLoaded178136352239456219
load179136732274455218
domInteractive24203644220
backgroundConnect876392210
firstReactRender743001245024
getState688302311
initialActions01000
loadScripts125928481679395190
setupStore1299352612
uiStartup200840842570529254
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -88.63 KiB (-1.78%)
  • ui: 1.06 KiB (0.01%)
  • common: 740 Bytes (0.01%)

@ccharly ccharly force-pushed the fix/Version-v12.6.0-secp256k1-temporary-resolutions branch from 8a67e17 to 2674d2d Compare October 30, 2024 12:12
@metamaskbot
Copy link
Collaborator

Builds ready [2674d2d]
Page Load Metrics (2493 ± 363 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint36039092219815391
domContentLoaded177745222454757364
load182745432493757363
domInteractive27259795426
backgroundConnect9154433718
firstReactRender523021305828
getState666252210
initialActions01000
loadScripts129334971845631303
setupStore12100432613
uiStartup198751482833838402
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -88.63 KiB (-1.78%)
  • ui: 1.06 KiB (0.01%)
  • common: 740 Bytes (0.01%)

danjm
danjm previously approved these changes Oct 30, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [13c075a]
Page Load Metrics (1908 ± 173 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint158431071902326157
domContentLoaded157426461848238114
load158332871908360173
domInteractive18241504622
backgroundConnect95565612058
firstReactRender451951003617
getState5368377938
initialActions00000
loadScripts11311720134415374
setupStore10121413316
uiStartup179444872189573275
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -88.63 KiB (-1.78%)
  • ui: 1.06 KiB (0.01%)
  • common: 740 Bytes (0.01%)

@@ -4273,22 +4273,6 @@
"TextEncoder": true
}
},
"eth-lattice-keyring>gridplus-sdk>secp256k1": {
Copy link
Contributor

Choose a reason for hiding this comment

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

this change indicates there's now one less version of the package.
This adds up with what we see in the lockfile too.
I can confirm you've successfully upgraded secp256k1 to 4.0.4 only.

package.json Outdated
"secp256k1@npm:^4.0.0": "4.0.4",
"secp256k1@npm:^4.0.1": "4.0.4",
"secp256k1@npm:4.0.2": "4.0.4",
"secp256k1@npm:4.0.3": "4.0.4"
Copy link
Contributor

Choose a reason for hiding this comment

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

It's a bit messy, but if it's not ending up in main branch later, it doesn't matter

@danjm danjm changed the base branch from Version-v12.6.0 to Version-v12.5.1 October 30, 2024 15:14
@danjm danjm dismissed their stale review October 30, 2024 15:14

The base branch was changed.

@danjm danjm requested review from a team and kumavis as code owners October 30, 2024 15:14
@danjm danjm changed the base branch from Version-v12.5.1 to Version-v12.6.0 October 30, 2024 15:15
Copy link
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

danjm added a commit that referenced this pull request Oct 31, 2024
Cherry-picks #28145
to v12.5.1, and brings
#28177 into v12.5.1
as well. The latter originally targeted v12.6.0, but we need it for a
hotfix ahead of that. The PR description for that was:

## **Description**

Forcing resolutions to fix `yarn audit` warnings and more specifically
this issue:
- GHSA-584q-6j8j-r5pm

I decided to be very explicit about the resolution itself based on the
output of:
```console
$ yarn why secp256k1
├─ ethereum-cryptography@npm:0.1.3
│  └─ secp256k1@npm:4.0.4 (via npm:^4.0.1)
│
├─ ganache@npm:7.9.2
│  └─ secp256k1@npm:4.0.3 (via npm:4.0.3)
│
├─ ganache@patch:ganache@npm%3A7.9.2#~/.yarn/patches/ganache-npm-7.9.2-a70dc8da34.patch::version=7.9.2&hash=7d7c66
│  └─ secp256k1@npm:4.0.3 (via npm:4.0.3)
│
├─ gridplus-sdk@npm:2.5.1
│  └─ secp256k1@npm:4.0.2 (via npm:4.0.2)
│
└─ hdkey@npm:2.1.0
   └─ secp256k1@npm:4.0.4 (via npm:^4.0.0)
```

We could also have a more straightforward resolution like:
```json
  ...
  "resolutions": {
    ...
    "secp256k1": "4.0.4"
  }
  ...
```

But that could also catch version with different major.

Let me know what would be the preferred solution here.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/28176?quickstart=1)

## **Related issues**

Fixes: GHSA-584q-6j8j-r5pm

## **Manual testing steps**

N/A

## **Screenshots/Recordings**

### **Before**

### **After**

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.

---------

Co-authored-by: Charly Chevalier <[email protected]>
Co-authored-by: sahar-fehri <[email protected]>
@Gudahtt Gudahtt closed this Oct 31, 2024
@Gudahtt Gudahtt force-pushed the fix/Version-v12.6.0-secp256k1-temporary-resolutions branch from 13c075a to 3df0a16 Compare October 31, 2024 19:57
@ccharly ccharly merged commit 3df0a16 into Version-v12.6.0 Oct 31, 2024
77 of 79 checks passed
@ccharly ccharly deleted the fix/Version-v12.6.0-secp256k1-temporary-resolutions branch October 31, 2024 19:57
@github-actions github-actions bot locked and limited conversation to collaborators Oct 31, 2024
@metamaskbot
Copy link
Collaborator

Builds ready [3df0a16]
Page Load Metrics (1871 ± 118 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint156725071863221106
domContentLoaded15522281181917886
load156126611871246118
domInteractive18112492612
backgroundConnect9376538943
firstReactRender472511065225
getState4195264923
initialActions0523115
loadScripts11351832134314369
setupStore10239415325
uiStartup172843642185556267
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -168.37 KiB (-3.37%)
  • ui: 4.01 KiB (0.05%)
  • common: 107.58 KiB (1.36%)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants