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: network Controller Migration + UI #11622

Conversation

salimtb
Copy link
Contributor

@salimtb salimtb commented Oct 4, 2024

Description

This PR migrates the network controller to handle merged networks and introduces a new modal to inform users about the network changes. The network configurations are merged, and the default RPC URL is now set to the last-used RPC endpoint for each network. This ensures network consistency and better user transparency about default network settings.

Related issues

Fixes:

Manual testing steps

  1. Add multiples polygon and ethereum chain on main
  2. switch to this branch and restart the app
  3. Network should be migrated and a modal should be displayed

Screenshots/Recordings

Before

After

Screenshot 2024-10-04 at 11 44 15

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 Oct 4, 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 base branch from main to salim/bump-network-controller-21.0.0 October 4, 2024 09:51
@salimtb salimtb force-pushed the salim/bump-network-controller-21.0.0-migration-script-and-ui branch from 5c89054 to db8bf4b Compare October 4, 2024 12:13
@salimtb salimtb marked this pull request as ready for review October 4, 2024 13:02
@salimtb salimtb requested review from a team as code owners October 4, 2024 13:02
@salimtb salimtb force-pushed the salim/bump-network-controller-21.0.0-migration-script-and-ui branch from db8bf4b to ddbccd8 Compare October 4, 2024 14:01
@salimtb salimtb added team-assets 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 labels Oct 4, 2024
Copy link
Contributor

github-actions bot commented Oct 4, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: ddbccd8
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/84a8d007-f5ac-44a8-8f1e-68e59e6b982d

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

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

github-actions bot commented Oct 4, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 9969816
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/be984c6f-bd64-46f8-85ce-bf01640a44a3

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

@salimtb salimtb changed the title Network Controller Migration & RPC Update Notification Modal Network Controller Migration & RPC Update Migration Modal Oct 7, 2024
@salimtb salimtb added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 7, 2024
Copy link
Contributor

github-actions bot commented Oct 7, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 0ba4c47
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/116a1a68-17fc-496a-b0ba-32b1d2663616

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

@salimtb salimtb changed the title Network Controller Migration & RPC Update Migration Modal feat: network Controller Migration Oct 8, 2024
@salimtb salimtb changed the title feat: network Controller Migration feat: network Controller Migration + UI Oct 8, 2024
android/.project Outdated Show resolved Hide resolved
app/store/migrations/054.ts Outdated Show resolved Hide resolved
app/store/migrations/054.test.ts Outdated Show resolved Hide resolved
app/store/migrations/054.test.ts Outdated Show resolved Hide resolved
app/store/migrations/054.ts Outdated Show resolved Hide resolved
@salimtb salimtb mentioned this pull request Oct 8, 2024
7 tasks
github-merge-queue bot pushed a commit that referenced this pull request Oct 9, 2024
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**
This PR introduces the UI implementation for the Multi-RPC Modal, which
is part of the broader initiative to support multiple RPC endpoints for
networks. The modal allows users to view and select from multiple RPC
options for a specific network, ensuring a smoother transition or switch
between different endpoints.

**UI Only: This PR focuses solely on the implementation of the UI. The
modal is not yet integrated or functional in the application as it
requires the upgrade of the Network Controller to version v21.**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

## **Related issues**

Fixes:

## **Manual testing steps**

1. this Modal is not called yet , it's require the network controller
v21 to be used
2. the use of this modal will be done on this
[PR](#11622)

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<img width="438" alt="Screenshot 2024-10-04 at 11 44 15"
src="https://github.com/user-attachments/assets/f558a5a8-796a-423c-b957-f7e7aee8d0b2">

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
@salimtb salimtb force-pushed the salim/bump-network-controller-21.0.0-migration-script-and-ui branch 2 times, most recently from 77ddc58 to 2f7ff1f Compare October 9, 2024 13:27
@salimtb salimtb added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 9, 2024
Copy link
Contributor

github-actions bot commented Oct 9, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 88d8f75
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/672ac11a-f68b-4a49-9858-5dbdba4b5ed0

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

@salimtb salimtb mentioned this pull request Oct 9, 2024
7 tasks
@salimtb salimtb force-pushed the salim/bump-network-controller-21.0.0-migration-script-and-ui branch 2 times, most recently from d4c52cc to 0474f3d Compare October 10, 2024 12:02
@salimtb salimtb added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Oct 10, 2024
Copy link
Contributor

github-actions bot commented Oct 10, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 0474f3d
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/b2c70a0b-b9b1-4066-bbc0-416efdb92a45

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

@salimtb salimtb force-pushed the salim/bump-network-controller-21.0.0-migration-script-and-ui branch from 0474f3d to bbeb779 Compare October 10, 2024 22:34
@salimtb salimtb force-pushed the salim/bump-network-controller-21.0.0-migration-script-and-ui branch from bbeb779 to e3c7dc5 Compare October 10, 2024 22:35
Copy link

sonarcloud bot commented Oct 10, 2024

@salimtb
Copy link
Contributor Author

salimtb commented Oct 11, 2024

This pull request was merged into this feature branch, so I need approval on that feature branch. I'm keeping the PR open to make the review process easier.

github-merge-queue bot pushed a commit that referenced this pull request Oct 11, 2024
…etworks with Distinct ChainIDs and Multiple RPC URLs (#11705)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**
This PR refactors our network configuration to eliminate the use of
multiple networks with the same ChainID but different RPC URLs. Instead,
we are moving towards a setup where each network is uniquely identified
by a distinct ChainID and can have multiple RPC URLs associated with it.

This PR includes three merge commits. The first primarily addresses the
Network Controller upgrade, as outlined in issue
#[11229](#11229). The
second commit contains the script for migrating the state to v21, and
the third commit includes all the UI changes along with the fix for the
e2e tests.

For more details, please refer to
[this](https://github.com/orgs/MetaMask/projects/120/views/1) .

related PRs:

- #11292
- #11622
- #11436

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

## **Related issues**

Fixes:
#[11229](#11229)
#[11232](#11232)
#[11234](#11234)
#11233

## **Manual testing steps**

1. Go to add network flow and test

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**


https://drive.google.com/drive/folders/149Xji42k5of5Vl8nBlI0pFYFgPnWqILH?usp=drive_link

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **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.
@salimtb salimtb marked this pull request as draft October 13, 2024 16:05
@salimtb salimtb closed this Oct 14, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants