Skip to content

feat: support bulk balance fetch on more chains#23436

Merged
HowardBraham merged 2 commits intodevelopfrom
brian/bulk-native-balance
Mar 26, 2024
Merged

feat: support bulk balance fetch on more chains#23436
HowardBraham merged 2 commits intodevelopfrom
brian/bulk-native-balance

Conversation

@bergeron
Copy link
Copy Markdown
Contributor

@bergeron bergeron commented Mar 12, 2024

Description

On certain chains MetaMask uses https://github.com/wbobeirne/eth-balance-checker to optimize balance fetches into a single RPC call rather than 1 per address.

This PR adds support for Linea, Aurora, Base, and ZkSync. These chains already use the contract for bulk ERC20 lookups here. This change will use it for native balance lookups tool.

I tested all 5 of the new chains.

Open in GitHub Codespaces

Related issues

Manual testing steps

  1. Switch to Linea, Aurora, Base, or ZkSync
  2. Native ETH balances should be correct for all acounts

Screenshots/Recordings

No visible differences

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • 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.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@bergeron bergeron requested a review from a team as a code owner March 12, 2024 20:45
@github-actions
Copy link
Copy Markdown
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.

@bergeron bergeron requested review from sahar-fehri and salimtb March 12, 2024 20:48
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.79%. Comparing base (d23a71a) to head (f25d368).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop   #23436   +/-   ##
========================================
  Coverage    68.79%   68.79%           
========================================
  Files         1125     1125           
  Lines        43572    43572           
  Branches     11655    11655           
========================================
  Hits         29972    29972           
  Misses       13600    13600           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [f25d368]
Page Load Metrics (960 ± 418 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint732371364220
domContentLoaded1184382211
load602342960870418
domInteractive1184382211
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 345 Bytes (0.01%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@HowardBraham HowardBraham merged commit f78b6da into develop Mar 26, 2024
@HowardBraham HowardBraham deleted the brian/bulk-native-balance branch March 26, 2024 18:31
@github-actions github-actions bot locked and limited conversation to collaborators Mar 26, 2024
@metamaskbot metamaskbot added the release-11.15.0 Issue or pull request that will be included in release 11.15.0 label Mar 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-11.15.0 Issue or pull request that will be included in release 11.15.0 team-assets

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants