Skip to content
This repository was archived by the owner on Sep 11, 2026. It is now read-only.

chore: getChecksumAddress memoized and faster - #246

Merged
Mrtenz merged 2 commits into
MetaMask:mainfrom
Nodonisko:chore/memoized-checksum-address
Jun 30, 2025
Merged

Mrtenz merged 2 commits into
MetaMask:mainfrom
Nodonisko:chore/memoized-checksum-address

Conversation

@Nodonisko

Copy link
Copy Markdown
Contributor

What is the current state of things and why does it need to change?

Mobile app and some controllers is using toChecksumAddress from ethereumjs-util package but this function is quite slow because of crypto operations happening inside. I plan to replace it with function from this package which is doing crypto operations too but it's memoized at least.

Memoization should help quite a lot because address pool is usually quite limited. I also made implementation in this package 4x faster and added few more addresses to test file.

Screenshot 2025-06-26 at 21 06 11

@socket-security

socket-security Bot commented Jun 26, 2025 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​types/​lodash.memoize@​4.1.91001005476100
Added@​types/​lodash@​4.17.191001007892100

View full report

Comment thread package.json Resolved
Comment thread package.json Resolved
Comment thread src/hex.ts Resolved
Comment thread src/index.test.ts Resolved
Comment thread src/hex.ts Resolved
@Nodonisko
Nodonisko force-pushed the chore/memoized-checksum-address branch from adcfef6 to a520d22 Compare June 27, 2025 12:04
Comment thread src/hex.ts Resolved
@Nodonisko
Nodonisko force-pushed the chore/memoized-checksum-address branch from a520d22 to ac8cf00 Compare June 27, 2025 12:08
@Nodonisko
Nodonisko force-pushed the chore/memoized-checksum-address branch from ac8cf00 to 4a6b68b Compare June 27, 2025 12:10
Mrtenz
Mrtenz previously approved these changes Jun 27, 2025

@Mrtenz Mrtenz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

@Mrtenz
Mrtenz requested a review from Prithpal-Sooriya June 27, 2025 12:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants