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 6 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

I swear deactivatable is a real word: https://en.wiktionary.org/wiki/deactivatable

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 to add new chains, and we've got dedicated endpoints for network user-editable fields.

  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 (106)
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
✔️ 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
✔️ d6a67cb #12 2025-02-10 14:31:01 ~3 min macos 📦zip
✔️ d6a67cb #14 2025-02-10 14:32:14 ~5 min tests-rpc 📄log
✔️ d6a67cb #12 2025-02-10 14:32:21 ~5 min windows 📦zip
✔️ d6a67cb #12 2025-02-10 14:32:44 ~5 min linux 📦zip
✔️ d6a67cb #12 2025-02-10 14:33:09 ~6 min android 📦aar
✔️ d6a67cb #12 2025-02-10 14:33:33 ~6 min macos 📦zip
✔️ d6a67cb #12 2025-02-10 14:59:16 ~32 min tests 📄log
✔️ d6a67cb #12 2025-02-10 18:47:35 ~4 hr 20 min ios 📦zip
✔️ 86fa895 #13 2025-02-12 21:16:38 ~3 min macos 📦zip
✔️ 86fa895 #13 2025-02-12 21:16:39 ~4 min ios 📦zip
✔️ 86fa895 #13 2025-02-12 21:17:27 ~4 min windows 📦zip
✔️ 86fa895 #13 2025-02-12 21:18:02 ~5 min linux 📦zip
✔️ 86fa895 #13 2025-02-12 21:18:36 ~5 min macos 📦zip
✔️ 86fa895 #13 2025-02-12 21:18:46 ~6 min android 📦aar
✔️ 86fa895 #15 2025-02-12 21:24:03 ~11 min tests-rpc 📄log
✔️ 86fa895 #13 2025-02-12 21:43:14 ~30 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 21ad7f5 #14 2025-02-13 14:47:42 ~4 min macos 📦zip
✔️ 21ad7f5 #14 2025-02-13 14:47:49 ~4 min ios 📦zip
✔️ 21ad7f5 #14 2025-02-13 14:49:01 ~5 min linux 📦zip
✔️ 21ad7f5 #14 2025-02-13 14:49:10 ~5 min windows 📦zip
✔️ 21ad7f5 #14 2025-02-13 14:49:27 ~5 min macos 📦zip
✔️ 21ad7f5 #14 2025-02-13 14:51:08 ~7 min android 📦aar
✔️ 21ad7f5 #16 2025-02-13 14:55:25 ~11 min tests-rpc 📄log
✔️ 21ad7f5 #14 2025-02-13 15:17:02 ~33 min tests 📄log
✖️ 8003c9c #17 2025-02-13 22:52:27 ~3 min tests-rpc 📄log
✔️ 8003c9c #15 2025-02-13 22:52:39 ~3 min macos 📦zip
✔️ 8003c9c #15 2025-02-13 22:52:59 ~4 min windows 📦zip
✔️ 8003c9c #15 2025-02-13 22:53:06 ~4 min ios 📦zip
✔️ 8003c9c #15 2025-02-13 22:53:45 ~5 min linux 📦zip
✔️ 8003c9c #15 2025-02-13 22:54:32 ~5 min macos 📦zip
✔️ 8003c9c #15 2025-02-13 22:54:43 ~6 min android 📦aar
✔️ 8003c9c #15 2025-02-13 23:18:53 ~30 min tests 📄log
✖️ 8003c9c #18 2025-02-14 12:22:32 ~3 min tests-rpc 📄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 78.90295% with 50 lines in your changes missing coverage. Please review.

Project coverage is 60.41%. Comparing base (157d6eb) to head (21ad7f5).

Files with missing lines Patch % Lines
rpc/network/network.go 72.30% 14 Missing and 4 partials ⚠️
rpc/network/networksevent/watcher.go 62.85% 12 Missing and 1 partial ⚠️
services/wallet/api.go 0.00% 9 Missing ⚠️
services/wallet/collectibles/controller.go 68.42% 4 Missing and 2 partials ⚠️
rpc/network/db/network_db.go 82.60% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6315      +/-   ##
===========================================
+ Coverage    60.38%   60.41%   +0.02%     
===========================================
  Files          845      846       +1     
  Lines       111362   111477     +115     
===========================================
+ Hits         67249    67349     +100     
- Misses       36308    36310       +2     
- Partials      7805     7818      +13     
Flag Coverage Δ
functional 0.45% <0.00%> (-0.01%) ⬇️
unit 60.42% <78.90%> (+0.02%) ⬆️

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%> (-2.02%) ⬇️
... and 6 more

... and 32 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 2 times, most recently from 668fc27 to d6a67cb Compare February 10, 2025 14:26
Copy link
Contributor

@friofry friofry left a comment

Choose a reason for hiding this comment

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

Great job!

@@ -90,10 +80,10 @@ func sepolia(stageName string) params.Network {

return params.Network{
ChainID: chainID,
ChainName: "Mainnet",
ChainName: "Sepolia",
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing this! Before it was confusing and I was not sure if it was right.

Copy link
Contributor Author

@dlipicar dlipicar Feb 12, 2025

Choose a reason for hiding this comment

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

Yeah had a chat with Ben and we decided to have a bit more separation between the mainnets and the testnets, desktop is not even using the Combined networks anymore, we're treating each chain individually.

RelatedChainID: MainnetChainID,
RelatedChainID: common.MainnetChainID,
IsActive: true,
IsDeactivatable: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder why it cannot be deactivated? Was it possible to deactivate it in the old UI?
image

Copy link
Contributor Author

@dlipicar dlipicar Feb 12, 2025

Choose a reason for hiding this comment

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

The element you're showing there changes the isEnabled setting, there's a new UI to toggle the isActive setting in the Profile->Wallet->Networks section.
image

Mainnet is disableable (as in, we let the user not include Ethereum in balances, collectibles list and activity) but it's not deactivatable (as in, we cannot let the user shut down all requests to the Ethereum chain since there's some basic functionality that depends on it).

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's a bit confusing, should there be a indicator that tell us we cannot toggle main net
Either not show it or gray out Mainet?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just thinking out loud. Can we have a list of non-deactivatable networks (since they are known at compile time)
and use isEnabled for both purposes:

  • let the user not include the chain in balances, collectibles list and activity
  • let the user disable all requests to a chain

Copy link
Contributor Author

@dlipicar dlipicar Feb 13, 2025

Choose a reason for hiding this comment

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

@friofry the two settings serve different purposes. The list of activated networks contain those you wish to use across the whole app (for example, to send assets, collectibles, mint community tokens), the user is not supposed to change this setting very often, it's just so that networks they don't use won't make lists unnecessarily long (also since we impose a limit of 5 networks, we have to let them choose which ones they want).

The enabled setting is supposed to be local to the Wallet view, disabled networks should still show up in other parts of the app. It's supposed to be a setting the user will quickly toggle whenever they want to get an overview of their holdings in a subset of the chains they work with.

I don't think that we can merge the two settings into one (or that there's a good reason to)

Copy link
Contributor Author

@dlipicar dlipicar Feb 13, 2025

Choose a reason for hiding this comment

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

@benjthayer Yeah, some generic message on hover like "ChainX is needed for Status to remain fully operational, so it cannot be deactivated" could make things clearer for users

Choose a reason for hiding this comment

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

@benjthayer Yeah, some generic message on hover like "ChainX is needed for Status to remain fully operational, so it cannot be deactivated" could make things clearer for users

Sounds good - what is/are the specific reason/s why the user can't turn off Mainnet? Sorry - fully anticipate this being a silly question!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@benjthayer couple of things that depend on it:

  • ENS names
  • a Status new version checker service, not sure if that's functional
  • address activity check
  • stickers 🤡

Not sure we want to be too specific in our message though.

Copy link

@benjthayer benjthayer Feb 13, 2025

Choose a reason for hiding this comment

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

@benjthayer couple of things that depend on it:

  • ENS names
  • a Status new version checker service, not sure if that's functional
  • address activity check
  • stickers 🤡

Not sure we want to be too specific in our message though.

Thanks! It was just to get a sense of the level of reliance we have on the network.

Something like this could work - better if we can keep the tooltip shorter.
Screenshot 2025-02-13 at 15 10 37

Figma
https://www.figma.com/design/idUoxN7OIW2Jpp3PMJ1Rl8/Settings-%7C-Desktop?node-id=25662-183008&t=tcb6yaJpOxL5kklm-4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -76,6 +76,8 @@ type Network struct {
ShortName string `json:"shortName" validate:"omitempty,min=1"`
TokenOverrides []TokenOverride `json:"tokenOverrides" validate:"omitempty,dive"`
RelatedChainID uint64 `json:"relatedChainId" validate:"omitempty"`
IsActive bool `json:"isActive"`
Copy link
Contributor

Choose a reason for hiding this comment

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

  • we no longer use manager.Get with onlyEnabled = true
  • GetCombinedNetworks is no longer used either

It looks like we can delete (or reuse) the isEnabled field.

image

Copy link
Contributor Author

@dlipicar dlipicar Feb 12, 2025

Choose a reason for hiding this comment

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

oh but we still use isEnabled client side! It's the setting indicating whether a chain is accounted for in balances, collectibles and history in the Wallet view. It should probably have a different name but I cannot change it now without breaking a lot of stuff.

image

)

type ActiveNetworksChangedParams struct {
ActivatedChainIDs []uint64 `json:"activatedChainIds"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe instead of sending these as params make a corresponding getter and send empty events?
Because if there are multiple changes, we can only process the last one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm I thought about the light/chunky signal payload problem and was slightly leaning towards the current solution, but now you've convinced me the other way, dammit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@friofry removed payload from the event here: 21ad7f5

This is probably the right way to do things in general for anything other than the most basic cases. We now don't need to care about order/timing of events, and we are kind of "forced" to have a more explicit dependency injection to get the data required.

@@ -146,11 +237,15 @@ func (nm *Manager) networkWithoutEmbeddedProviders(network *params.Network) *par

// Upsert adds or updates a network, synchronizing RPC providers, wrapped in a transaction.
func (nm *Manager) Upsert(network *params.Network) error {
// New networks are deactivated by default. They are also always deactivatable.
Copy link
Contributor

Choose a reason for hiding this comment

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

Presumably the comment applies to the new networks.
But Upsert can be used to update an existing network (it used to be the way to update RPCURL). In this case the isActive, isDeactivatable should stay as is.

Also, I wonder if we could make isDeactivatable true by default. With no option to set it to false at runtime. So the only way to make it false should be when creating it in default_networks.go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm well that's the problem with using "Upsert" to edit some network fields instead of a dedicated endpoint, there's some fields we don't want to let the user change. And that's why I deprecated the AddEthereumChain API function, which is the only place that calls this Upsert function. If mobile is not using it anymore, I'll just remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whenever we want to bring user custom chains back we can look into it, but there's a thousand different problems with letting a user add their own chains at the moment that need to be looked into before we do that.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's fair. Upsert is dangerous. Or the upsert can simply apply changes manually (exclude fields that cannot be updated).

@dlipicar dlipicar force-pushed the feat/implement-deactiveable-networks branch from d6a67cb to 86fa895 Compare February 12, 2025 21:12
Copy link
Member

@briansztamfater briansztamfater left a comment

Choose a reason for hiding this comment

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

Amazing work @dlipicar!

@dlipicar dlipicar force-pushed the feat/implement-deactiveable-networks branch from 21ad7f5 to 8003c9c Compare February 13, 2025 22:48
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.

6 participants