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: remove bridge src token list from controller state #29492

Merged
merged 13 commits into from
Jan 16, 2025

Conversation

micaelae
Copy link
Member

@micaelae micaelae commented Jan 8, 2025

Description

This reduces data stored in the BridgeController by removing stored bridge-specific token lists, and reusing token data from the assets controllers instead.

Changes

  • AssetList: compare symbols in order to determine which token to highlight as "selected"
  • AssetPickerModal: fetch topAssets list on network change, yield tokens with balances first
  • pages/bridge: remove custom src token list (falls back to AssetPicker's default list)
  • bridge-controller, ducks/bridge: remove src token methods and states
  • hooks/bridge: remove allowlist check for tokens since these have moved to the bridge-api

Open in GitHub Codespaces

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MMS-1825
Depends on https://github.com/consensys-vertical-apps/va-mmcx-bridge-api/pull/136

Manual testing steps

  1. Verify that Swap+Send token allowlists have not changed
  2. Verify that Send token allowlists have not changed
  3. Bridging 137:BNB -> 10:USDC should result in no quotes
  4. Bridging 10:USDC -> 137:USDC should result in no quotes
  5. Bridge src token should be pre-filled when navigating from asset page
  6. Bridge inputs should be restored after fetching quotes and reopening extension

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.

@micaelae micaelae force-pushed the mms1825-rm-bridge-src-token-list branch 2 times, most recently from 7584fa1 to 6e1f281 Compare January 13, 2025 22:30
@micaelae micaelae force-pushed the mms1825-rm-bridge-src-token-list branch from 2acbd2a to a5192d5 Compare January 14, 2025 01:02
@metamaskbot
Copy link
Collaborator

Builds ready [2acbd2a]
Page Load Metrics (1708 ± 64 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint26618281473490235
domContentLoaded14701923167211957
load14781942170813364
domInteractive249242199
backgroundConnect997312412
firstReactRender1599492914
getState471182110
initialActions01000
loadScripts1074140712359546
setupStore684152110
uiStartup162324862032231111
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -1.86 KiB (-0.03%)
  • ui: -1.94 KiB (-0.02%)
  • common: -153 Bytes (-0.00%)

@micaelae micaelae marked this pull request as ready for review January 14, 2025 01:09
@micaelae micaelae requested review from a team as code owners January 14, 2025 01:09
@metamaskbot
Copy link
Collaborator

Builds ready [226b4c5]
Page Load Metrics (1841 ± 73 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint28721451547603290
domContentLoaded15492049180414469
load15572068184115373
domInteractive27154503215
backgroundConnect7103363014
firstReactRender16107513417
getState4115242914
initialActions01000
loadScripts11081608133712661
setupStore695293014
uiStartup180028382263295142
Bundle size diffs [🚀 Bundle size reduced!]
  • background: -723 Bytes (-0.01%)
  • ui: -1.82 KiB (-0.02%)
  • common: -95 Bytes (-0.00%)

@micaelae micaelae added this pull request to the merge queue Jan 16, 2025
Merged via the queue into main with commit f503a48 Jan 16, 2025
82 checks passed
@micaelae micaelae deleted the mms1825-rm-bridge-src-token-list branch January 16, 2025 22:17
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2025
@metamaskbot metamaskbot added the release-12.12.0 Issue or pull request that will be included in release 12.12.0 label Jan 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.12.0 Issue or pull request that will be included in release 12.12.0 team-bridge
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants