Skip to content

Conversation

@runway-github
Copy link
Contributor

@runway-github runway-github bot commented Jul 22, 2025

Description

This PR is
originally from @Nodonisko from Margelo

This PR uses new faster memoized functions for working with address
checksum.

There is already significant boost in AccountList performance and it
should be even better when MetaMask/core#6054 is
released and also when we fix Blockies Avatars.

Related issues

Fixes: #15560

Manual testing steps

  1. Open Account List
  2. It should feel faster than before

Screenshots/Recordings

Before

You can set that before then was lot of interrupted work before Account
List modal is even displayed. It takes around ~7s from click to modal to
be actually visible.

Screenshot 2025-07-03 at 21 36 06

After

Here it takes only around ~3s to mount. (still slow but much better than
before)

Screenshot 2025-07-03 at 21 38 16

Pre-merge author checklist

Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.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 format
    if applicable
  • I’ve applied the right labels on the PR (see labeling
    guidelines
    ).
    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.

Description

Changelog

CHANGELOG entry:

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

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.

Co-authored-by: Daniel Suchý suchydan@gmail.com 55bc8a6

…16926) (#17174)

## **Description**

This [PR](#16926) is
originally from @Nodonisko from Margelo

This PR uses new faster memoized functions for working with address
checksum.

There is already significant boost in AccountList performance and it
should be even better when MetaMask/core#6054 is
released and also when we fix Blockies Avatars.

## **Related issues**

Fixes: #15560

## **Manual testing steps**

1. Open Account List
2. It should feel faster than before

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**
You can set that before then was lot of interrupted work before Account
List modal is even displayed. It takes around ~7s from click to modal to
be actually visible.

<img width="1324" alt="Screenshot 2025-07-03 at 21 36 06"
src="https://github.com/user-attachments/assets/7c624f31-db84-4ade-9df6-a116bff9a68f"
/>


### **After**

Here it takes only around ~3s to mount. (still slow but much better than
before)

<img width="1325" alt="Screenshot 2025-07-03 at 21 38 16"
src="https://github.com/user-attachments/assets/96a5a4f1-59b7-4cfa-b58c-ac84eb238654"
/>

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding

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

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

## **Changelog**

<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`

If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`

(This helps the Release Engineer do their job more quickly and
accurately)
-->

CHANGELOG entry:

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.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-mobile/blob/main/.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: Daniel Suchý <suchydan@gmail.com>
@runway-github runway-github bot requested review from a team as code owners July 22, 2025 16:15
@github-actions
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.

@metamaskbot metamaskbot added the team-runway-bot-deprecated DEPRECATED: please use "team-bots" instead label Jul 22, 2025
cursor[bot]

This comment was marked as outdated.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 22, 2025

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: f2c2b73
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/d9a743f6-49a7-46d7-8836-6dae2345a3a2

Note

  • You can rerun any failed steps by opening the Bitrise build, tapping Rebuild on the upper right then Rebuild unsuccessful Workflows
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

Copy link
Contributor

@Cal-L Cal-L left a comment

Choose a reason for hiding this comment

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

LGTM

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Error Handling Flaw in `toChecksumAddress`

The new toChecksumAddress function has flawed and fragile error handling. It attempts backward compatibility by returning certain invalid hex strings (e.g., "0x1", "0x2") as Hex types if isStrictHexString passes, even when getChecksumAddress deems them invalid. This logic relies on catching getChecksumAddress errors with the exact message 'Invalid hex address.', making it fragile. A future change in @metamask/utils error messages would break this specific error handling, causing the original error to be re-thrown instead of handled as intended.

app/util/address/index.ts#L484-L501

export function toChecksumAddress(address: string) {
try {
return getChecksumAddress(address as Hex);
} catch (error) {
// This is necessary for backward compatibility with the old behavior of
// `ethereumjs-util` which would return the original string if the address
// was invalid. This should happen only in tests which uses invalid addresses
// like 0x1, 0x2 etc.
if (error instanceof Error && error.message === 'Invalid hex address.') {
if (isStrictHexString(address)) {
return address as Hex;
}
throw new Error('Invalid hex address.');
}
throw error;
}
}

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@sonarqubecloud
Copy link

@Tyschenko Tyschenko merged commit 282402d into release/7.52.0 Jul 25, 2025
39 of 40 checks passed
@Tyschenko Tyschenko deleted the runway-cherry-pick-7.52.0-1753200899 branch July 25, 2025 15:11
@github-actions github-actions bot locked and limited conversation to collaborators Jul 25, 2025
@metamaskbot metamaskbot added the release-7.52.0 Issue or pull request that will be included in release 7.52.0 label Sep 3, 2025
@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0.

1 similar comment
@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0.

@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0.

7 similar comments
@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0.

@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0.

@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0.

@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0.

@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0.

@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0.

@metamaskbot
Copy link
Collaborator

No release label on PR. Adding release label release-7.52.0 on PR, as PR was cherry-picked in branch 7.52.0.

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

Labels

release-7.52.0 Issue or pull request that will be included in release 7.52.0 team-runway-bot-deprecated DEPRECATED: please use "team-bots" instead

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants