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: Bump Snaps packages #28215

Merged
merged 8 commits into from
Nov 5, 2024
Merged

chore: Bump Snaps packages #28215

merged 8 commits into from
Nov 5, 2024

Conversation

FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Oct 31, 2024

Description

Bump Snaps packages and handle any required changes.

Summary of Snaps changes:

  • Add truncate, displayName and avatar props to Address component
  • Reduce unnecessary JSON validation (performance improvement)
  • Allow platformVersion in the manifest and reject invalid versions when specified in stable
  • Add Kadena derivation path
  • Bump MetaMask dependencies

Open in GitHub Codespaces

@github-actions github-actions bot added the team-snaps-platform Snaps Platform team label Oct 31, 2024
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Oct 31, 2024
Copy link

socket-security bot commented Oct 31, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/@metamask/snaps-sdk@6.10.0

View full report↗︎

Next steps

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 ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

@FrederikBolding
Copy link
Member Author

@SocketSecurity ignore npm/@metamask/snaps-sdk@6.10.0

This is ours.

@metamaskbot
Copy link
Collaborator

Builds ready [94895b1]
Page Load Metrics (1904 ± 71 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16762328190514972
domContentLoaded16592309186914268
load16782330190414871
domInteractive17108502311
backgroundConnect10102353014
firstReactRender52223873718
getState576212010
initialActions01000
loadScripts11571804137313163
setupStore1192382412
uiStartup18792536212617584
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 78.5 KiB (1.75%)
  • ui: 1 Bytes (0.00%)
  • common: 56.97 KiB (0.71%)

FrederikBolding and others added 6 commits November 4, 2024 13:25
## **Description**
Add changes to Snaps Address UI component to support more flexible use
cases.

This PR needs release of the `snaps-sdk` after merging:
MetaMask/snaps#2833

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

## **Related issues**
Fixes: MetaMask/snaps#2758

## **Manual testing steps**
1. Use custom Snap build from template-snap-monorepo and add few
varieties of address component to test new capabilities.
2. Make sure UI is looking good.
3. Make sure that there are no regressions.

## **Screenshots/Recordings**
### **Before**
![Screenshot 2024-10-11 at 18 12
06](https://github.com/user-attachments/assets/4d498bd6-0ef0-445c-90ab-40918e63b421)

### **After**
![Screenshot 2024-10-15 at 14 34
16](https://github.com/user-attachments/assets/792244b6-300d-45e2-b7e1-91bbcb93a9a6)
![Screenshot 2024-10-15 at 14 34
28](https://github.com/user-attachments/assets/9c6776e1-f6b6-4888-864b-b95621e83069)
![Screenshot 2024-10-15 at 14 34
47](https://github.com/user-attachments/assets/054a9127-ce9a-43d9-ab06-61c4099990a6)
![Screenshot 2024-10-15 at 14 35
10](https://github.com/user-attachments/assets/4c829486-2195-4f14-947e-cbc3572eb822)

### Snap code used for testing
#### (_Might be useful for QA_)
```typescript
export const onRpcRequest: OnRpcRequestHandler = async ({ request }) => {
  switch (request.method) {
    case 'hello':
      return snap.request({
        method: 'snap_dialog',
        params: {
          type: 'confirmation',
          content: (
            <Box>
              <Heading size="lg">Some unknown address</Heading>

              <Text>Default address</Text>
              <Address address="0x1acC6721CF7642Eb37651F8019AC9a785C064002" />

              <Text>Custom address (displayName=true)</Text>
              <Address
                address="0x1acC6721CF7642Eb37651F8019AC9a785C064002"
                displayName={true}
              />

              <Text>Custom address (avatar=false)</Text>
              <Address
                address="0x1234567890123456789012345678901234567890"
                avatar={false}
              />

              <Text>Custom address (displayName=true, avatar=false)</Text>
              <Address
                address="0x1234567890123456789012345678901234567890"
                displayName={true}
                avatar={false}
              />

              <Text>Custom address (truncate=false)</Text>
              <Address
                address="0x1234567890123456789012345678901234567890"
                truncate={false}
              />

              <Text>Custom address (truncate=false, avatar=false)</Text>
              <Address
                address="0x1234567890123456789012345678901234567890"
                truncate={false}
                avatar={false}
              />

              <Heading size="lg">My address</Heading>

              <Text>Default address</Text>
              <Address address="0xBc641D258aA0e90F70AaDbcC4dE2D58d88029713" />

              <Text>Custom address (displayName=true)</Text>
              <Address
                address="0xBc641D258aA0e90F70AaDbcC4dE2D58d88029713"
                displayName={true}
              />

              <Text>Custom address (avatar=false)</Text>
              <Address
                address="0xBc641D258aA0e90F70AaDbcC4dE2D58d88029713"
                avatar={false}
              />

              <Text>Custom address (displayName=true, avatar=false)</Text>
              <Address
                address="0xBc641D258aA0e90F70AaDbcC4dE2D58d88029713"
                displayName={true}
                avatar={false}
              />

              <Text>Custom address (truncate=false)</Text>
              <Address
                address="0xBc641D258aA0e90F70AaDbcC4dE2D58d88029713"
                truncate={false}
              />

              <Text>Custom address (truncate=false, avatar=false)</Text>
              <Address
                address="0xBc641D258aA0e90F70AaDbcC4dE2D58d88029713"
                truncate={false}
                avatar={false}
              />

              <Heading size="lg">Contact address</Heading>

              <Text>Default address</Text>
              <Address address="0x1acC6721CF7642Eb37651F8019AC9a785C064002" />

              <Text>Custom address (displayName=true)</Text>
              <Address
                address="0x1acC6721CF7642Eb37651F8019AC9a785C064002"
                displayName={true}
              />

              <Text>Custom address (avatar=false)</Text>
              <Address
                address="0x1acC6721CF7642Eb37651F8019AC9a785C064002"
                avatar={false}
              />

              <Text>Custom address (displayName=true, avatar=false)</Text>
              <Address
                address="0x1acC6721CF7642Eb37651F8019AC9a785C064002"
                displayName={true}
                avatar={false}
              />

              <Text>Custom address (truncate=false)</Text>
              <Address
                address="0x1acC6721CF7642Eb37651F8019AC9a785C064002"
                truncate={false}
              />

              <Text>Custom address (truncate=false, avatar=false)</Text>
              <Address
                address="0x1acC6721CF7642Eb37651F8019AC9a785C064002"
                truncate={false}
                avatar={false}
              />
            </Box>
          ),
        },
      });
    default:
      throw new Error('Method not found.');
  }
};
```

## **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: Guillaume Roux <hello@guillaumerx.fr>
Copy link
Contributor

github-actions bot commented Nov 4, 2024

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.

@FrederikBolding FrederikBolding marked this pull request as ready for review November 4, 2024 12:27
@FrederikBolding FrederikBolding requested review from a team as code owners November 4, 2024 12:27
@metamaskbot
Copy link
Collaborator

Builds ready [093caf7]
Page Load Metrics (1843 ± 57 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint25822531696492236
domContentLoaded16702184182611455
load16802211184311957
domInteractive1779462010
backgroundConnect84820126
firstReactRender6812196126
getState55413167
initialActions01000
loadScripts12141722135511455
setupStore1165312311
uiStartup18982414203912560
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 78.5 KiB (1.75%)
  • ui: 201 Bytes (0.00%)
  • common: 56.97 KiB (0.71%)

Mrtenz
Mrtenz previously approved these changes Nov 5, 2024
? toChecksumHexAddress(parsed.address)
: parsed.address,
);
// For EVM addresses, we make sure they are checksummed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm how come we aren't checksumming for non-evm (at least the one that we know about -- bitcoin)?

Copy link
Member Author

Choose a reason for hiding this comment

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

We are assuming that Snaps take care of this part and won't build in special checksum logic for additional chains

hmalik88
hmalik88 previously approved these changes Nov 5, 2024
@FrederikBolding FrederikBolding dismissed stale reviews from hmalik88 and Mrtenz via da7906a November 5, 2024 20:10
@metamaskbot
Copy link
Collaborator

Builds ready [da7906a]
Page Load Metrics (1846 ± 64 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16402094185311957
domContentLoaded15892083180612560
load16292123184613364
domInteractive16243524622
backgroundConnect882362412
firstReactRender482921055326
getState46420199
initialActions01000
loadScripts11381584133911756
setupStore1195332914
uiStartup18102434208618187
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 78.53 KiB (1.75%)
  • ui: 201 Bytes (0.00%)
  • common: 56.97 KiB (0.71%)

@FrederikBolding FrederikBolding added this pull request to the merge queue Nov 5, 2024
Merged via the queue into develop with commit 93e3872 Nov 5, 2024
76 checks passed
@FrederikBolding FrederikBolding deleted the fb/snaps-bump-v75 branch November 5, 2024 21:21
@github-actions github-actions bot locked and limited conversation to collaborators Nov 5, 2024
@metamaskbot metamaskbot added the release-12.8.0 Issue or pull request that will be included in release 12.8.0 label Nov 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template release-12.8.0 Issue or pull request that will be included in release 12.8.0 team-snaps-platform Snaps Platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants