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)_: implement deactivatable networks #6315

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

dlipicar
Copy link
Contributor

@dlipicar dlipicar commented Jan 31, 2025

Part of status-im/status-desktop#17091

There's basically three parts to this PR:

  1. Add parameters IsActive and IsDeactivatable to each network: f87f53e

IsActive lets the user select which chains are available for use across the app (as opposed to IsEnabled, which simply means whether a chain is considered when displaying balances, collectibles and activity). No provider calls should occur for networks that are not active at a given time (just like what's expected of Testnet chains when the app is in Mainnet mode and viceversa)
IsDeactivatable lets the client know whether a network can be deactivated. Some critical app features require specific networks to always be active (Mainnet and Sepolia).
New API SetChainActive lets the user toggle this setting. Some checks are in place to ensure only Deactivatable chains can be deactivated, and no more than 5 chains are active at a given time.

Since custom chains are not supported for now AddEthereumChain and DeleteEthereumChain are marked as deprecated. Half the app will malfunction if the client uses these endpoints.

  1. Implement network events: 05d0f37

This is just a pub-subby way for status-go modules to react to changes in the list of networks.

  1. Use networks events for automatic collectibles ownership refreshes: f3bfddb

Ideally we extend this to other modules which depend on the client to notify about network changes, which is more error-prone. (Separate issues status-im/status-desktop#17182 and status-im/status-desktop#17183)

The rest is just changes to make tests happy.

@status-im-auto
Copy link
Member

status-im-auto commented Feb 1, 2025

Jenkins Builds

Click to see older builds (66)
Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 3831b4a #1 2025-02-01 00:01:01 ~1 min tests 📄log
✔️ 3831b4a #1 2025-02-01 00:03:05 ~4 min macos 📦zip
✔️ 3831b4a #1 2025-02-01 00:03:24 ~4 min ios 📦zip
✔️ 3831b4a #1 2025-02-01 00:04:30 ~5 min linux 📦zip
✔️ 3831b4a #1 2025-02-01 00:04:45 ~5 min macos 📦zip
✔️ 3831b4a #1 2025-02-01 00:04:54 ~5 min windows 📦zip
✔️ 3831b4a #1 2025-02-01 00:05:11 ~6 min android 📦aar
✔️ 3831b4a #1 2025-02-01 00:06:19 ~7 min tests-rpc 📄log
✔️ 3831b4a #2 2025-02-03 18:31:50 ~6 min tests-rpc 📄log
✖️ be87d05 #2 2025-02-03 18:28:31 ~1 min tests 📄log
✔️ be87d05 #2 2025-02-03 18:30:50 ~4 min windows 📦zip
✔️ be87d05 #2 2025-02-03 18:30:51 ~4 min macos 📦zip
✔️ be87d05 #2 2025-02-03 18:30:59 ~4 min ios 📦zip
✔️ be87d05 #2 2025-02-03 18:32:06 ~5 min linux 📦zip
✔️ be87d05 #2 2025-02-03 18:32:19 ~5 min macos 📦zip
✔️ be87d05 #2 2025-02-03 18:32:45 ~6 min android 📦aar
✔️ be87d05 #3 2025-02-03 18:36:48 ~4 min tests-rpc 📄log
✔️ 2f4a1d5 #3 2025-02-03 20:47:10 ~3 min macos 📦zip
✖️ 2f4a1d5 #3 2025-02-03 20:47:12 ~3 min tests 📄log
✔️ 2f4a1d5 #3 2025-02-03 20:47:14 ~3 min windows 📦zip
✔️ 2f4a1d5 #3 2025-02-03 20:47:20 ~3 min ios 📦zip
✔️ 2f4a1d5 #4 2025-02-03 20:47:52 ~4 min tests-rpc 📄log
✔️ 2f4a1d5 #3 2025-02-03 20:48:42 ~5 min linux 📦zip
✔️ 2f4a1d5 #3 2025-02-03 20:49:10 ~5 min macos 📦zip
✔️ 2f4a1d5 #3 2025-02-03 20:49:22 ~6 min android 📦aar
✖️ 2f4a1d5 #4 2025-02-03 20:49:31 ~2 min tests 📄log
✔️ 2f4a1d5 #4 2025-02-03 20:51:06 ~3 min windows 📦zip
✔️ 2f4a1d5 #4 2025-02-03 20:51:11 ~3 min macos 📦zip
✖️ 2f4a1d5 #5 2025-02-03 20:51:16 ~3 min tests-rpc 📄log
✔️ 2f4a1d5 #4 2025-02-03 20:51:43 ~4 min ios 📦zip
✔️ 2f4a1d5 #4 2025-02-03 20:54:04 ~5 min linux 📦zip
✔️ 2f4a1d5 #4 2025-02-03 20:54:47 ~5 min macos 📦zip
✔️ 2f4a1d5 #4 2025-02-03 20:55:37 ~6 min android 📦aar
✔️ 0494fff #5 2025-02-04 13:41:51 ~3 min macos 📦zip
✔️ 0494fff #5 2025-02-04 13:41:52 ~3 min windows 📦zip
✔️ 0494fff #5 2025-02-04 13:42:30 ~4 min ios 📦zip
✖️ 0494fff #6 2025-02-04 13:42:47 ~4 min tests-rpc 📄log
✔️ 0494fff #5 2025-02-04 13:42:59 ~5 min linux 📦zip
✔️ 0494fff #5 2025-02-04 13:43:14 ~5 min android 📦aar
✔️ 0494fff #5 2025-02-04 13:43:27 ~5 min macos 📦zip
✖️ 0494fff #5 2025-02-04 14:07:22 ~29 min tests 📄log
✔️ 0494fff #7 2025-02-04 14:10:48 ~4 min tests-rpc 📄log
✔️ 72be83f #6 2025-02-04 14:48:40 ~3 min ios 📦zip
✖️ 72be83f #6 2025-02-04 14:48:58 ~4 min tests 📄log
✔️ 72be83f #6 2025-02-04 14:49:35 ~4 min macos 📦zip
✔️ 72be83f #6 2025-02-04 14:49:53 ~5 min linux 📦zip
✔️ 72be83f #8 2025-02-04 14:50:11 ~5 min tests-rpc 📄log
✔️ 72be83f #6 2025-02-04 14:50:23 ~5 min windows 📦zip
✔️ 72be83f #6 2025-02-04 14:50:33 ~5 min macos 📦zip
✔️ 72be83f #6 2025-02-04 14:50:51 ~6 min android 📦aar
✔️ ae1544a #7 2025-02-04 15:24:46 ~3 min macos 📦zip
✔️ ae1544a #7 2025-02-04 15:24:49 ~3 min windows 📦zip
✔️ ae1544a #7 2025-02-04 15:26:05 ~5 min linux 📦zip
✔️ ae1544a #7 2025-02-04 15:26:08 ~5 min ios 📦zip
✔️ ae1544a #9 2025-02-04 15:26:14 ~5 min tests-rpc 📄log
✔️ ae1544a #7 2025-02-04 15:26:24 ~5 min macos 📦zip
✔️ ae1544a #7 2025-02-04 15:26:47 ~6 min android 📦aar
✖️ ae1544a #7 2025-02-04 15:52:11 ~31 min tests 📄log
✔️ 2ee1371 #8 2025-02-04 17:52:28 ~3 min macos 📦zip
✔️ 2ee1371 #8 2025-02-04 17:52:32 ~4 min ios 📦zip
✔️ 2ee1371 #8 2025-02-04 17:52:33 ~3 min windows 📦zip
✔️ 2ee1371 #8 2025-02-04 17:53:46 ~5 min linux 📦zip
✔️ 2ee1371 #8 2025-02-04 17:53:55 ~5 min android 📦aar
✔️ 2ee1371 #10 2025-02-04 17:53:56 ~5 min tests-rpc 📄log
✔️ 2ee1371 #8 2025-02-04 17:54:12 ~5 min macos 📦zip
✔️ 2ee1371 #8 2025-02-04 18:17:54 ~29 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ e68cd86 #9 2025-02-04 18:38:26 ~3 min windows 📦zip
✔️ e68cd86 #9 2025-02-04 18:38:36 ~3 min macos 📦zip
✔️ e68cd86 #9 2025-02-04 18:38:55 ~4 min ios 📦zip
✔️ e68cd86 #9 2025-02-04 18:39:44 ~5 min linux 📦zip
✔️ e68cd86 #11 2025-02-04 18:39:47 ~5 min tests-rpc 📄log
✔️ e68cd86 #9 2025-02-04 18:40:42 ~6 min macos 📦zip
✔️ e68cd86 #9 2025-02-04 18:40:42 ~6 min android 📦aar
✔️ e68cd86 #9 2025-02-04 19:04:12 ~29 min tests 📄log
✔️ e68cd86 #10 2025-02-04 19:15:14 ~3 min macos 📦zip
✔️ e68cd86 #10 2025-02-04 19:15:21 ~3 min windows 📦zip
✔️ e68cd86 #10 2025-02-04 19:15:22 ~4 min ios 📦zip
✖️ e68cd86 #12 2025-02-04 19:16:11 ~4 min tests-rpc 📄log
✔️ e68cd86 #10 2025-02-04 19:16:20 ~5 min linux 📦zip
✔️ e68cd86 #10 2025-02-04 19:16:56 ~5 min macos 📦zip
✔️ e68cd86 #10 2025-02-04 19:17:46 ~6 min android 📦aar
✔️ e68cd86 #10 2025-02-04 19:40:13 ~28 min tests 📄log
✔️ 668fc27 #11 2025-02-04 19:19:30 ~4 min windows 📦zip
✔️ 668fc27 #11 2025-02-04 19:19:46 ~4 min macos 📦zip
✔️ 668fc27 #11 2025-02-04 19:20:06 ~4 min ios 📦zip
✔️ 668fc27 #13 2025-02-04 19:21:12 ~4 min tests-rpc 📄log
✔️ 668fc27 #11 2025-02-04 19:21:31 ~5 min linux 📦zip
✔️ 668fc27 #11 2025-02-04 19:22:33 ~5 min macos 📦zip
✔️ 668fc27 #11 2025-02-04 19:23:59 ~6 min android 📦aar
✔️ 668fc27 #11 2025-02-04 20:09:54 ~29 min tests 📄log

@dlipicar dlipicar changed the title Feat/implement deactiveable networks feat(network)_: implement deactivatable networks Feb 3, 2025
@dlipicar dlipicar force-pushed the feat/implement-deactiveable-networks branch 2 times, most recently from be87d05 to 2f4a1d5 Compare February 3, 2025 20:43
@dlipicar dlipicar changed the base branch from develop to fix/migration-check-script February 3, 2025 20:43
Copy link

codecov bot commented Feb 3, 2025

Codecov Report

Attention: Patch coverage is 71.74721% with 76 lines in your changes missing coverage. Please review.

Project coverage is 60.31%. Comparing base (712fc66) to head (668fc27).

Files with missing lines Patch % Lines
rpc/network/network.go 54.63% 40 Missing and 4 partials ⚠️
rpc/network/networksevent/watcher.go 57.89% 15 Missing and 1 partial ⚠️
services/wallet/api.go 0.00% 9 Missing ⚠️
rpc/network/db/network_db.go 82.60% 2 Missing and 2 partials ⚠️
services/wallet/collectibles/controller.go 81.25% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6315      +/-   ##
===========================================
+ Coverage    60.30%   60.31%   +0.01%     
===========================================
  Files          845      846       +1     
  Lines       111258   111409     +151     
===========================================
+ Hits         67095    67201     +106     
- Misses       36342    36394      +52     
+ Partials      7821     7814       -7     
Flag Coverage Δ
functional 0.45% <0.00%> (-0.01%) ⬇️
unit 60.33% <71.74%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
api/default_networks.go 100.00% <100.00%> (ø)
api/defaults.go 76.32% <100.00%> (ø)
node/get_status_node.go 50.72% <100.00%> (+0.43%) ⬆️
node/status_node_services.go 71.12% <100.00%> (-0.07%) ⬇️
params/network_config.go 100.00% <ø> (ø)
rpc/client.go 63.47% <100.00%> (+0.85%) ⬆️
rpc/network/testutil/testutil.go 100.00% <100.00%> (ø)
services/connector/commands/test_helpers.go 100.00% <100.00%> (ø)
services/connector/test_helpers.go 100.00% <100.00%> (ø)
services/wallet/collectibles/service.go 14.51% <100.00%> (ø)
... and 6 more

... and 18 files with indirect coverage changes

@dlipicar dlipicar force-pushed the fix/migration-check-script branch from 7c849a8 to d7d7aa8 Compare February 4, 2025 13:45
@dlipicar dlipicar force-pushed the feat/implement-deactiveable-networks branch 2 times, most recently from ae1544a to 2ee1371 Compare February 4, 2025 17:48
@dlipicar dlipicar requested review from a team, friofry and briansztamfater February 4, 2025 18:33
@dlipicar dlipicar force-pushed the feat/implement-deactiveable-networks branch from 2ee1371 to e68cd86 Compare February 4, 2025 18:34
@dlipicar dlipicar requested review from alaibe and saledjenic February 4, 2025 18:34
@dlipicar dlipicar marked this pull request as ready for review February 4, 2025 18:37
Base automatically changed from fix/migration-check-script to develop February 4, 2025 19:11
@dlipicar dlipicar requested a review from a team as a code owner February 4, 2025 19:11
@dlipicar dlipicar force-pushed the feat/implement-deactiveable-networks branch from e68cd86 to 668fc27 Compare February 4, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants