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

feat: migrate Base network RPC from https://mainnet.base.org to base-… #28895

Closed
wants to merge 8 commits into from

Conversation

salimtb
Copy link
Contributor

@salimtb salimtb commented Dec 3, 2024

Description

This PR introduces a migration to replace the Base network RPC URL (https://mainnet.base.org) with the new Infura RPC URL (https://base-mainnet.infura.io/v3/{infuraProjectId}) in the MetaMask state.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. build the app on main branch and put the file on tmp-chrome folder
  2. Add base network
  3. build the app on the current branch
  4. replace the main build with the new one
  5. base url should be updated

Screenshots/Recordings

Before

After

migration.mov

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.

Copy link
Contributor

github-actions bot commented Dec 3, 2024

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.

@salimtb salimtb force-pushed the salim/migrate-base-rpc branch from a87285b to 0ee11f7 Compare December 3, 2024 18:56
@salimtb salimtb marked this pull request as ready for review December 3, 2024 18:58
@salimtb salimtb requested a review from a team as a code owner December 3, 2024 18:58
@salimtb salimtb marked this pull request as draft December 4, 2024 10:27
@salimtb salimtb force-pushed the salim/migrate-base-rpc branch from 0ee11f7 to 92a09ff Compare December 5, 2024 11:55
@salimtb salimtb marked this pull request as ready for review December 5, 2024 12:02
@salimtb salimtb requested a review from a team as a code owner December 5, 2024 12:02
@metamaskbot
Copy link
Collaborator

Builds ready [d001d7c]
Page Load Metrics (1763 ± 62 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint27021391694348167
domContentLoaded16082127173812259
load16192194176313062
domInteractive259939199
backgroundConnect96729189
firstReactRender158621157
getState681851132813
initialActions01000
loadScripts12211713134911354
setupStore611711
uiStartup18482441204216680
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.77 KiB (0.03%)
  • ui: 1.02 KiB (0.01%)
  • common: 229 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [51abcd1]
Page Load Metrics (1863 ± 55 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint27821061773360173
domContentLoaded16392084184311656
load17062107186311455
domInteractive2610237168
backgroundConnect84320105
firstReactRender15311942
getState77174131189
initialActions0724168
loadScripts12341636138911455
setupStore7311063
uiStartup19142468218416579
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.77 KiB (0.03%)
  • ui: 1.02 KiB (0.01%)
  • common: 229 Bytes (0.00%)

danjm
danjm previously approved these changes Dec 5, 2024
ui/components/app/toast-master/toast-master.js Outdated Show resolved Hide resolved
ui/components/app/toast-master/toast-master.js Outdated Show resolved Hide resolved
@metamaskbot
Copy link
Collaborator

Builds ready [cde651e]
Page Load Metrics (2202 ± 411 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint27441791831991476
domContentLoaded155541562174838402
load156342002202857411
domInteractive25266606029
backgroundConnect66685814369
firstReactRender156625136
getState1083871516230
initialActions01000
loadScripts116434321703723347
setupStore77515157
uiStartup1771542726081077517
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.8 KiB (0.03%)
  • ui: 1.06 KiB (0.01%)
  • common: 253 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [a936f0f]
Page Load Metrics (1857 ± 62 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint32022571793360173
domContentLoaded16402236182912862
load16592250185712962
domInteractive27117442512
backgroundConnect105324168
firstReactRender158822157
getState781981272211
initialActions01000
loadScripts12551823142812158
setupStore710810
uiStartup18852558214117383
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 1.8 KiB (0.03%)
  • ui: 1.21 KiB (0.02%)
  • common: 253 Bytes (0.00%)

danjm
danjm previously approved these changes Dec 5, 2024
Copy link
Contributor

@danjm danjm left a comment

Choose a reason for hiding this comment

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

LGTM

@darkwing
Copy link
Contributor

darkwing commented Dec 5, 2024

Upon starting extension locally, I see the following:

Error: BaseNetworkToast(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null. '\n  at BaseNetworkToast (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-5.js:11818:48)\n  at div\n  at chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/common-10.js:18991:3\n  at ToastContainer (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-7.js:3811:3)\n  at ToastMaster (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-5.js:11689:52)\n  at div\n  at Routes (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-11.js:10280:1)\n  at ConnectFunction (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/common-9.js:31876:41)\n  at C (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-3.js:16054:37)\n  at MetamaskNotificationsProvider (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-8.js:35:3)\n  at AssetPollingProvider (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-7.js:15366:3)\n  at LegacyI18nProvider (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/common-10.js:24087:1)\n  at I18nProvider (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/common-10.js:24070:53)\n  at LegacyMetaMetricsProvider (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-8.js:222:1)\n  at MetaMetricsProvider (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-8.js:132:3)\n  at RenderedRoute (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-3.js:16767:7)\n  at Routes (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-3.js:17468:7)\n  at Router (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-3.js:17402:17)\n  at CompatRouter (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-3.js:13274:7)\n  at Router (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-3.js:15416:30)\n  at HashRouter (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-3.js:13755:35)\n  at Provider (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/common-9.js:31583:20)\n  at Index (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-11.js:945:5)'
SCR-20241205-lbvl

After refreshing the extension, it works:

SCR-20241205-lclb

I believe this is fine because upon updating the extension in prod, the extension restarts.

The migration also worked great.

darkwing
darkwing previously approved these changes Dec 5, 2024
@salimtb salimtb dismissed stale reviews from darkwing and danjm via 83fe992 December 5, 2024 18:46
@salimtb
Copy link
Contributor Author

salimtb commented Dec 5, 2024

Upon starting extension locally, I see the following:

Error: BaseNetworkToast(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null. '\n  at BaseNetworkToast (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-5.js:11818:48)\n  at div\n  at chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/common-10.js:18991:3\n  at ToastContainer (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-7.js:3811:3)\n  at ToastMaster (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-5.js:11689:52)\n  at div\n  at Routes (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-11.js:10280:1)\n  at ConnectFunction (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/common-9.js:31876:41)\n  at C (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-3.js:16054:37)\n  at MetamaskNotificationsProvider (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-8.js:35:3)\n  at AssetPollingProvider (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-7.js:15366:3)\n  at LegacyI18nProvider (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/common-10.js:24087:1)\n  at I18nProvider (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/common-10.js:24070:53)\n  at LegacyMetaMetricsProvider (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-8.js:222:1)\n  at MetaMetricsProvider (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-8.js:132:3)\n  at RenderedRoute (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-3.js:16767:7)\n  at Routes (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-3.js:17468:7)\n  at Router (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-3.js:17402:17)\n  at CompatRouter (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-3.js:13274:7)\n  at Router (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-3.js:15416:30)\n  at HashRouter (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-3.js:13755:35)\n  at Provider (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/common-9.js:31583:20)\n  at Index (chrome-extension://oehplhbehlbgjdapfkoemdgjlgbjpkkg/ui-11.js:945:5)'
SCR-20241205-lbvl After refreshing the extension, it works: SCR-20241205-lclb I believe this is fine because upon updating the extension in prod, the extension restarts.

The migration also worked great.

I believe I understand why you encountered the strange local error. It's likely due to the use of the showBaseNetworkToast && ... expression, which doesn't always guarantee a return value. To improve the code's clarity and ensure consistent returns, I’ve switched to using a ternary expression instead.
83fe992

@salimtb salimtb requested a review from danjm December 5, 2024 18:55
@salimtb salimtb closed this Dec 5, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants