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: bump network controller 21.0.0 #11292

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

Conversation

salimtb
Copy link
Contributor

@salimtb salimtb commented Sep 18, 2024

Description

This PR updates the network-controller from version 20.0.0 to 21.0.0. The migration introduces changes in the handling of network configurations, particularly regarding how network data is structured and referenced.

Key Changes:
Consolidation of Network Configurations:

Network configurations in v21 are now organized by chainId in a new networkConfigurationsByChainId structure, replacing the networkConfigurations section in v20.
The new structure supports multiple RPC endpoints per network, as seen in the list of rpcEndpoints, with support for Infura-based connections (e.g., https://mainnet.infura.io/v3/{infuraProjectId}).

Remark

As part of the update to version 21 (v21) of the network controller, we are making a key change in how networks are handled. Previously, networks could have the same chain ID but different RPC URLs. With v21, each network will now have a unique chain ID that can include multiple RPC URLs.

To support this, the UI will also be updated—for example, the RPC URL field in the network form will become a dropdown menu instead of a simple text input.

These changes have been implemented behind a feature flag, which will remain in place until the v21 upgrade is finalized.

To complete this migration, we have 3 PRs that need to be reviewed and merged together:

The first PR upgrades the network controller to v21.
The second PR adds the migration script and the necessary UI for migration.
The third PR removes the feature flag, making the v21 changes active.
For the review process, it's recommended to start with the third PR (removing the feature flag), then proceed to the > second and first PRs. This order ensures a smooth transition and proper implementation of the changes.

Related PRS

Related issues

Fixes: #11229

Manual testing steps

  • Verify that networkConfigurations has been replaced by networkConfigurationsByChainId.
  • Check that each network in networkConfigurationsByChainId is identified by its chainId.
  • Ensure that all rpcEndpoints are correctly listed for each network in networkConfigurationsByChainId.
  • Validate that the defaultRpcEndpointIndex points to a valid and functional RPC endpoint for each network.
  • Check that Infura-based RPC URLs (e.g., Mainnet, Goerli, Sepolia, Linea networks) are properly formatted with the correct {infuraProjectId}.
  • Verify that networks like Linea Goerli, Linea Sepolia, and Linea Mainnet are listed under networkConfigurationsByChainId with their correct chainId values.
  • Ensure that any unused or outdated custom network configurations (e.g., BNB Chain from v20) have been removed.
  • Check that all network names (e.g., "Mainnet", "Goerli", "Sepolia") in networkConfigurationsByChainId match their respective chainId values.
  • Validate that nativeCurrency fields are correctly set for each network in networkConfigurationsByChainId (e.g., ETH for Mainnet, SepoliaETH for Sepolia).
  • Ensure that each network's blockExplorerUrls is present and correctly configured where applicable.

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.

@cryptodev-2s cryptodev-2s added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 1, 2024
Copy link
Contributor

github-actions bot commented Oct 1, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 38ae18a
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/12fbc9da-0270-4ae2-8aa2-00ceefb217cf

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@MajorLift
Copy link
Contributor

Looks like there are a few unused imports that should be removed:
https://sonarcloud.io/project/issues?pullRequest=11292&id=metamask-mobile&open=AZIpDbcZclZm4itKzMCp

@salimtb salimtb added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 2, 2024
Copy link
Contributor

github-actions bot commented Oct 2, 2024

https://bitrise.io/ Bitrise

🔄🔄🔄 pr_smoke_e2e_pipeline started on Bitrise...🔄🔄🔄

Commit hash: 5de757f
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/0c29c84b-0858-400f-b6de-2abb63aa2815

Note

  • This comment will auto-update when build completes
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@salimtb salimtb added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 2, 2024
Copy link
Contributor

github-actions bot commented Oct 2, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 3a054f2
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/0e321497-4bd8-4241-9b68-98551c5c6aec

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@legobeat

This comment was marked as resolved.

@cryptodev-2s cryptodev-2s requested a review from a team as a code owner October 3, 2024 09:14
@cryptodev-2s
Copy link
Contributor

cryptodev-2s commented Oct 3, 2024

@salimtb Needs conflict-resolution with main

Conflicts resolved @legobeat

@cryptodev-2s cryptodev-2s added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 3, 2024
Copy link
Contributor

github-actions bot commented Oct 3, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 2bbbe0c
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/1f9ce78e-0c25-4d4a-9f3d-b94aaa00898e

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Copy link

sonarcloud bot commented Oct 4, 2024

@salimtb salimtb requested review from cryptodev-2s and removed request for a team October 4, 2024 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-assets-ux-review A shared label between the Assets and UX team to flag PRs ready for consolidated team review. Run Smoke E2E Triggers smoke e2e on Bitrise team-assets
Projects
Status: Needs dev review
Development

Successfully merging this pull request may close these issues.

[Network-controller-upgrade ] Update Controller Version to v21
5 participants