-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
chore: cp-7.51.0 faster address checksum (#16926) #17174
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
Conversation
## **Description** 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.
|
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. |
|
d7dc614
|
No need to re-run e2e since merged conflicts from main and e2e passed before |
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.
Bug: Null Safety and Address Formatting Issues
The commit unconditionally calls toFormattedAddress with selectedAddress, which can be null or undefined, removing the prior null-safety fallback. This may cause runtime errors or unexpected behavior. Furthermore, replacing the !isNonEvmAddress check with toFormattedAddress changes the address formatting logic, potentially leading to incorrect formatting for non-EVM addresses and breaking balance lookups.
app/selectors/earnController/earn/index.ts#L192-L200
metamask-mobile/app/selectors/earnController/earn/index.ts
Lines 192 to 200 in d7dc614
| // TODO: balance logic, extract to utils then use when we are clear to add token | |
| const formattedAddress = toFormattedAddress(selectedAddress as Hex); | |
| const rawAccountBalance = selectedAddress | |
| ? accountsByChainId[token?.chainId as Hex]?.[formattedAddress]?.balance | |
| : '0'; | |
| const rawStakedAccountBalance = selectedAddress | |
| ? accountsByChainId[token?.chainId as Hex]?.[formattedAddress] | |
| ?.stakedBalance | |
| : '0'; |
Was this report helpful? Give feedback by reacting with 👍 or 👎
|
|
Missing release label release-7.52.0 on PR. Adding release label release-7.52.0 on PR and removing other release labels(release-7.53.0), as PR was cherry-picked in branch 7.52.0. |



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
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.
After
Here it takes only around ~3s to mount. (still slow but much better than before)
Pre-merge author checklist
Standards.
Pre-merge reviewer checklist
Description
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist