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 mainnet rpc to infura #28974

Merged
merged 5 commits into from
Dec 6, 2024

Conversation

salimtb
Copy link
Contributor

@salimtb salimtb commented Dec 5, 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.

Acceptance Criteria:

  • Migrate Base Mainnet to Infura only if users are using an Infura RPC as the default on at least one supported network, excluding testnets and Linea Mainnet.

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

before

After

Screenshot 2024-12-05 at 20 12 53

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 5, 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 changed the title Salim/migrate base mainnet rpc to infura feat: migrate base mainnet rpc to infura Dec 5, 2024
@salimtb salimtb force-pushed the salim/migrate-base-mainnet-rpc-to-infura branch from 8819652 to b6ae9e4 Compare December 5, 2024 20:35
@salimtb salimtb force-pushed the salim/migrate-base-mainnet-rpc-to-infura branch from b6ae9e4 to 0d2ae6e Compare December 5, 2024 20:44
'bsc-mainnet.infura.io',
'mantle-mainnet.infura.io',
'opbnb-mainnet.infura.io',
'scroll-mainnet.infura.io',
Copy link
Contributor Author

@salimtb salimtb Dec 5, 2024

Choose a reason for hiding this comment

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

testnet are included here, i addded this list because of the comment above from github-advanced-security

Copy link
Contributor

Choose a reason for hiding this comment

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

where did you get this list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i got it from infura doc here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

testnet are excluded now

@salimtb salimtb force-pushed the salim/migrate-base-mainnet-rpc-to-infura branch from f23cf64 to 282122f Compare December 5, 2024 21:24
@salimtb salimtb force-pushed the salim/migrate-base-mainnet-rpc-to-infura branch from 282122f to 5eec9b4 Compare December 5, 2024 21:24
@salimtb salimtb marked this pull request as ready for review December 5, 2024 21:28
@salimtb salimtb requested a review from danjm December 5, 2024 21:30
@danjm
Copy link
Contributor

danjm commented Dec 5, 2024

Code looks good. I will do a manual test

const urlHost = new URL(defaultRpcEndpoint.url).host;
return (
defaultRpcEndpoint.type === RpcEndpointType.Infura ||
allowedInfuraHosts.includes(urlHost)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

doing this because some infura network can be added as custom network

@metamaskbot
Copy link
Collaborator

Builds ready [c71d569]
Page Load Metrics (1900 ± 75 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint16632245189515574
domContentLoaded16572191186414871
load16622249190015675
domInteractive2498392010
backgroundConnect779362110
firstReactRender159222168
getState772751334220
initialActions01000
loadScripts12631696143913364
setupStore77211147
uiStartup188726732210228110
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 2.03 KiB (0.04%)
  • ui: 0 Bytes (0.00%)
  • common: 891 Bytes (0.01%)

@metamaskbot
Copy link
Collaborator

Builds ready [919d18b]
Page Load Metrics (2009 ± 74 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint24024031921415199
domContentLoaded17462318197914771
load17552398200915374
domInteractive256334105
backgroundConnect976302110
firstReactRender159325189
getState1033001454120
initialActions00000
loadScripts13151852151613967
setupStore778152010
uiStartup205628542362238114
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 2.12 KiB (0.04%)
  • ui: 0 Bytes (0.00%)
  • common: 988 Bytes (0.01%)

@salimtb salimtb added this pull request to the merge queue Dec 5, 2024
Merged via the queue into main with commit 4fc45f0 Dec 6, 2024
75 checks passed
@salimtb salimtb deleted the salim/migrate-base-mainnet-rpc-to-infura branch December 6, 2024 00:14
@github-actions github-actions bot locked and limited conversation to collaborators Dec 6, 2024
@metamaskbot metamaskbot added the release-12.10.0 Issue or pull request that will be included in release 12.10.0 label Dec 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.10.0 Issue or pull request that will be included in release 12.10.0 team-assets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants