The network configuration is currently stored in the PreferencesController. We should migrate it to the NetworkController instead. The network controller is a more sensible place for managing network config, and this will make multi-network support easier to manage (it needs to know which networks exist in config to manage active network connections).
Each network should have its own id, which we can expose to the UI for updating/deleting networks or switching networks
Add new CRUD methods in NetworkController for the list (keep existing methods as they are)
Add new way to keep track of which network is current (and add method to get it)
(controllers) Prepare for removing address book syncing code from PreferencesController
Add onNetworkStateChange to AddressBookController
Copy code in PreferencesController around updating address book (indirectly) to AddressBookController
(extension) Wire up new changes
Update controller instantiation code in MetamaskController to pass onNetworkStateChange to AddressBookController
Change actions bound to the UI to use NetworkController methods instead of PreferencesController methods (includes bound methods in MetamaskController)
Update NetworksTab component and Redux selector to pull network list out of state correctly
Remove network code from PreferencesController and related actions
Update existing NetworkController methods to use new methods (and add logic when switching networks to validate that the passed in provider config matches a network in the list)
(mobile) Wire up new changes
Update controller instantiation code in Engine to pass onNetworkStateChange to AddressBookController
The network configuration is currently stored in the PreferencesController. We should migrate it to the NetworkController instead. The network controller is a more sensible place for managing network config, and this will make multi-network support easier to manage (it needs to know which networks exist in config to manage active network connections).