Skip to content
This repository was archived by the owner on Dec 26, 2023. It is now read-only.
This repository was archived by the owner on Dec 26, 2023. It is now read-only.

Updates Part I: node auto-update #32

@lrettig

Description

@lrettig

Requirements

  • Don't cause the network to fail, or security assumptions to be violated, after a hard fork upgrade
  • Don't take agency away from node operators or make minority forks unreasonably burdensome
  • Allow emergency fixes to be deployed to as many nodes as possible as quickly as possible, while giving node operators more time to respond to non-emergency fixes
  • Minimize node downtime around an update
  • Give clarity and transparency into which nodes are running which version of the software
  • Simplest UX and implementation possible subject to these constraints: make it as quick and easy as possible for node operators to stay up to date.

Non-requirements

  • Easy for non-technical users (this should be handled at the application layer, which is outside the scope of this proposal, not at the node layer)

Design

  • Opt-in --auto-update flag. When enabled, this tracks a Spacemesh team-managed beacon that announces when an update is available, and automatically downloads and installs it, and restarts the node.
    • Optional but desirable: this flag requires a tracker URL and/or a pub key so that the user can choose to follow another update “channel."
    • When an update is detected, the app automatically downloads it, using HTTP or over the P2P network if it’s available from a peer.
    • The update includes metadata that indicates when the change should be activated (layer number or clock time) and whether it’s an emergency fix or not. If there is still time before it’s set to go live, a countdown warning will be printed, giving the node operator the opportunity to cancel the update (e.g., simply by restarting the node). This period should not be less than 24 hours, and should be longer for non-emergency than for emergency updates.
    • A warning message is logged when the node first starts, to the effect of, “You’ve enabled auto-updates. This means that updates released by the Spacemesh core team will automatically be downloaded and installed. Please read for more information on how to participate in network governance.” This message is printed every time the node updates itself and restarts.
    • Note: The application layer (smapp) is outside the scope of this proposal, and this flag can be enabled or disabled by the application according to its own criteria.
    • If the update is old for some reason, i.e., its hardcoded activation layer number has already passed, it’s discarded, and an error message is printed.
  • Add a --testnet flag that sets the right network ID and network/consensus params for the testnet, and turns auto-updates on by default. They can be turned off with --auto-update=false. This information will be printed in a warning message when the node first starts.
  • The node adds a small piece of data to each ATX, or each block, it publishes that contains a hash of the client and/or protocol version it’s running.
    • To discuss: versioning for client, core protocol, P2P protocol, and how to compress/convey all of this succinctly and clearly (see Version information metadata #75)
  • Optional: hardcode an end-of-life (EOL) for each node release. This would be some number of months (measured in layers) since the release occurs. When used on mainnet, after this point, the node would cease to function and would print an error if started. Warnings would be printed regularly leading up to the EOL point. Note that the node software could still be used on another network, such as on a private network.

Tasks

  • Research, design, and develop auto-update mechanism
  • Research, design, and develop update beacon
  • Finalize testnet params and add --testnet flag
  • Finalize the design of the update/version “signature” that nodes add to ATXs and/or blocks. Consider pros and cons of adding to ATXs versus blocks.
  • Finalize criteria for an “emergency update"
  • Finalize copy, order, and timing of warning messages, and write a longer doc explaining this
  • Add tests for upgrade mechanism

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions