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 EVM-specific code and update bridge types #30078

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

micaelae
Copy link
Member

@micaelae micaelae commented Feb 3, 2025

Description

Changes

  • enables solana support based on bridge feature flags
  • adds mutlichain utils to remove EVM assumptions when processing bridge-api requests and responses
    • replaces dec->hex chainId conversions with a formatter util
    • replaces hex->dec chainId conversions with a formatter util
    • only lowercase EVM addresses bc solana is case-sensitive
  • adds solana native asset definition
  • assumes that MC network config will be similar to NetworkConfiguration

Open in GitHub Codespaces

Related issues

Fixes: https://consensyssoftware.atlassian.net/browse/MMS-1845

Manual testing steps

  1. Verify that there are no changes to EVM e2e flows
  2. If solana account is active, Swap and Bridge buttons should be disabled
  3. Load Flask build and activate solana account
    5. Swap button should link to Bridge experience
    6. Bridge button should link to Bridge experience
    4. solana should be set as the bridge src network if a solana account is active

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.

@metamaskbot
Copy link
Collaborator

Builds ready [3a1bbf2]
Page Load Metrics (1827 ± 96 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15162215182420096
domContentLoaded14662207179219594
load15182219182720196
domInteractive27122483014
backgroundConnect1069322211
firstReactRender1694382512
getState562222110
initialActions01000
loadScripts10501651132917182
setupStore869192010
uiStartup171426072119242116
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 254 Bytes (0.00%)
  • ui: 201 Bytes (0.00%)
  • common: 1.49 KiB (0.02%)

@micaelae micaelae force-pushed the mms1845-swaps-sol-base branch from 683d792 to 6669a10 Compare February 5, 2025 00:53
@micaelae micaelae changed the title chore: update bridge controllers and types to support multichain networks chore: remove EVM-specific code and update bridge types Feb 5, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [610c9f9]
Page Load Metrics (1670 ± 40 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1543188216718440
domContentLoaded1497186716498541
load1545188016708440
domInteractive19122432713
backgroundConnect126526178
firstReactRender1680362412
getState4519105
initialActions01000
loadScripts1057139611977837
setupStore860232110
uiStartup17152414192614469
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 299 Bytes (0.00%)
  • ui: 2.48 KiB (0.03%)
  • common: 2.1 KiB (0.02%)

@metamaskbot
Copy link
Collaborator

Builds ready [ad7091c]
Page Load Metrics (1655 ± 79 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14392127165816378
domContentLoaded14322034163115273
load14402129165516579
domInteractive246934105
backgroundConnect10100342411
firstReactRender1678372411
getState4471094
initialActions01000
loadScripts9911477116811957
setupStore86215157
uiStartup16552323188616680
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 299 Bytes (0.00%)
  • ui: 2.48 KiB (0.03%)
  • common: 2.1 KiB (0.02%)

@micaelae micaelae force-pushed the mms1845-swaps-sol-base branch from e7b15c1 to 787948a Compare February 6, 2025 01:21
@micaelae micaelae marked this pull request as ready for review February 6, 2025 01:31
@micaelae micaelae requested a review from a team as a code owner February 6, 2025 01:31
@metamaskbot
Copy link
Collaborator

Builds ready [3e0753b]
Page Load Metrics (1957 ± 101 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint35024431882413198
domContentLoaded158923421926209100
load160123601957210101
domInteractive26125502412
backgroundConnect1277292010
firstReactRender17100442814
getState472282512
initialActions01000
loadScripts11111734141216680
setupStore889272512
uiStartup184429362302307147
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 299 Bytes (0.00%)
  • ui: 3.24 KiB (0.04%)
  • common: 2.1 KiB (0.02%)

ghgoodreau
ghgoodreau previously approved these changes Feb 6, 2025
ghgoodreau
ghgoodreau previously approved these changes Feb 6, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [a505087]
Page Load Metrics (1827 ± 84 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint29121911757376181
domContentLoaded15252128179016378
load15452196182717484
domInteractive238838168
backgroundConnect1186432412
firstReactRender1794352311
getState56123189
initialActions01000
loadScripts10781627130215072
setupStore75316147
uiStartup180825012129210101
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 299 Bytes (0.00%)
  • ui: 3.24 KiB (0.04%)
  • common: 2.1 KiB (0.02%)

@micaelae micaelae changed the base branch from main to mms-1867-fix-bridge-header February 6, 2025 19:51
@micaelae micaelae changed the base branch from mms-1867-fix-bridge-header to main February 6, 2025 19:51
@micaelae micaelae dismissed ghgoodreau’s stale review February 6, 2025 19:51

The base branch was changed.

// This override allows quotes to be returned when the rpcUrl is a tenderly fork
// Otherwise quotes get filtered out by the bridge-api when the wallet's real
// balance is less than the tenderly balance
insufficientBal: Boolean(providerConfig?.rpcUrl?.includes('tenderly')),
slippage,
walletAddress:
fromChain?.chainId && isCaipChainId(fromChain.chainId)
Copy link
Member Author

Choose a reason for hiding this comment

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

use explicit non-evm check

@metamaskbot
Copy link
Collaborator

Builds ready [ab0ab94]
Page Load Metrics (1730 ± 54 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint15632060173710852
domContentLoaded15462038170410751
load15562065173011254
domInteractive2598442010
backgroundConnect1176332211
firstReactRender1593322412
getState45313136
initialActions01000
loadScripts1094148412398842
setupStore761232210
uiStartup17252354197714871
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 299 Bytes (0.00%)
  • ui: 3.16 KiB (0.04%)
  • common: 2.1 KiB (0.02%)

@micaelae micaelae force-pushed the mms1845-swaps-sol-base branch from ab0ab94 to fdce791 Compare February 7, 2025 20:30
@metamaskbot
Copy link
Collaborator

Builds ready [fdce791]
Page Load Metrics (1643 ± 53 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint14981935163811153
domContentLoaded14851918160810952
load14991933164311153
domInteractive25174453517
backgroundConnect1086362311
firstReactRender156728189
getState65123178
initialActions01000
loadScripts1052142711619144
setupStore75413136
uiStartup16592174185611857
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 299 Bytes (0.00%)
  • ui: 2.24 KiB (0.03%)
  • common: 2.1 KiB (0.02%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants