-
Notifications
You must be signed in to change notification settings - Fork 1
Updates Part III: Smapp Update #34
Comments
I'm not sure that letting the node take care of updating itself is the best option when it runs managed by Smapp. We are going to maintain the minimum latest node release version in the discovery web service so smapp can easily compare and know if there's a new node version and manage the node update process from outside the node. I think this is much simpler solution because much less API interaction is needed between smapp and the go-sm node in this case. For example, on startup, smapp is going to get all data from the discovery service when it is configured to use a specific network - we need this anyhow. For example, for displaying the correct network dashboard in the ui and to configure explorer links. If it detects that a new node release is available it can easily handle the update process by gracefully shutting down the local node, downloading & replacing it with a new go-sm executable and starting it again with the proper cli flags. The discovery web service is outlined here: https://product.spacemesh.io/#/public_webservices?id=discovery-web-service-phase-i |
I don't have a strong opinion about this. I'm fine with smapp managing updates for go-sm. And I don't think it changes much of this proposal. Just to fully explore the decision space here, another option would be to add a new API service to manage updates, that would let smapp tell go-sm to immediately initiate an update. But what you propose is simpler. |
All update related SMIPs needs to be productized. The go-sm full node config for updates need to be fully speced and the interaction between smapp and go-sm for updates needs to be defined. Thanks @lrettig for the good work on the related smips. We have a clear direction and consensus but there are many details to be figured out. |
Yes, I'm inclined to head in this design direction: when go-sm is managed by smapp, smapp handles node updates. When go-sm is started from the command line w/o smapp it will use flags to determine update configuration which needs to include a discovery service url (where to get updates meta-data such as latest release for a network). |
There's more to discuss about this proposed smip. Currently a specific version of go-sm is bundled in smapp so there can't be a ui update only. It actually make sense to release a new version of smapp when a new node version is available and was tested to work with it, so updating |
Updated smapp update spec rough summary: Preliminaries
Configuration
User should be able change these settings at any time from the settings screen. There should also be a manual check for updates button in the settings that will trigger a check for update when the user clicks it regardless of the other settings.
Updating Smapp to join a new testnet
Visual DesignApp Startup Flow Changes
Title: App Updates
App Update Section in Settings Screen
New Update Available Modal Dialog Box
Migrate to a New Network Modal Dialog Box
Notes:
|
Personally I would like to see less tight coupling between smapp and go-sm, e.g., so that a user could install go-sm via another trusted means (like a system package manager, homebrew or aptitude), that they could have multiple versions of go-sm installed (nvm/pyenv-style) and upgrade the two separately, etc., but I can see why it's simpler to do things this way for now.
I think a more common pattern these days is "remind me again in X hours" (e.g., 24 hrs), or "try again tonight" (i.e., specify a timeframe)
Is this intended to work for mainnet hard fork network upgrades as well? We need to consider the mainnet use case. Regarding the testnet, one issue here is that our testnet upgrades haven't been so smooth - there's typically been a period of a few days before we troubleshoot and relaunch the testnet, so there's isn't a new network available to switch to immediately. What should the UX look like in this case? In practice many smeshers will have closed the Smapp completely by the time the new testnet is online. |
There's a fine line here between over-engineering for testnet and providing a decent testnet user experience. |
It is quite hard to write a spec in a comment. I moved the spec draft here https://product.spacemesh.io/#/smapp_update_spec and we can discuss it here and move back to a smip once it is ready. |
The spec that Aviv proposed sounds much easier to implement. Bundling VS Downloading Go-SpacemeshI don't really like the idea to download the whole Smapp to update go-sm. I see the Pros:
I see these Cons:
So, I'd prefer to download and install go-spacemesh updates separately from Smapp.
But, as I said before, we can change it later, if we'll have any auto-update mechanism of Smapp :) Who Updates the Node(if not bundling it into Smapp) We have two options:
I think that since the Node can do this, it is much better to put it under her control.
API & Node Auto-UpdatingFirst of all, API should have a stream to notify about availability of new updates, download process, and "ready-to-install" state. So when the go-sm sends a message "ready-to-install" Smapp will check is it in the foreground and then prompt the User to install it or just install if auto-update is turned on and Smapp is in the background. How to prompt about new update of go-smI think that is to prompt with modal dialog is not a good way, because it requires to make an immediate decision about it (to choose "Later" for example), and then it is a bit complicated to run update after interaction with Smapp (E.G. go to Settings, find "Update" section, click on "Update" button...). So I'd like more if we show such messages in the "Snackbar". I mean that this should not be a modal dialog, but a little notification, that would not block an application from interaction, and will be available on any screen. So the User can decide to click on "Update" any time when it is convenient. How to prompt about new Smapp updateI think that updating Smapp might be the same as I proposed above for go-sm. So when the update is available, it will download it and: Avoid stopping the Node on Smapp updateIf we decouple Smapp from go-sm, then we can tweak our App a little bit and run go-sm in the parallel process (Smapp would not be a parent anymore). It will make it possible to:
Force auto-updatingSince auto-updating is the recommended option, I think that we can not bother Users with any questions about it on the initial startup and turn it on by default. But in case if someone wants to turn it off — he can open Settings screen and turn it off. It also will require to switch auto-updating mode of go-sm. Switching auto-update on or offIn any case, if even we will ask the User on the initial startup to select do auto-updates or not, we will provide a possibility to User to change the mind and turn it on or off. And I think that is much desirable to avoid restarting Node. So probably this is another case that should be handled properly by API.
Something, like described there, is done within spacemeshos/smapp#851
To sum up, I think we can start with the simplest solution: make auto-updates for Smapp, which bundles go-sm.
And then we can improve it at any moment, after discussing all the details. See also comment about node updates: #32 (comment) |
Okay with me. I see the benefits.
Why not just bundle this metadata with smapp?
This is totally fine. The API is split up into multiple services, and some of them (e.g., the
There's no need for a PID or IPC, all communication can flow over the API. It just needs to try a default endpoint, e.g., |
Requirements
Design
--auto-update
flag to go-spacemesh (see Updates Part I: node auto-update #32). The app should track all node update events and surface them to the user: when a new update is detected, when it's downloaded, when the activation countdown has begun, when an update succeeds or fails to activate, etc. (This may be accomplished using the API or by monitoring logs.)Tasks
The text was updated successfully, but these errors were encountered: