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

Transparent chain upgrades #1479

Closed
2 tasks
michaelfig opened this issue Aug 15, 2020 · 8 comments
Closed
2 tasks

Transparent chain upgrades #1479

michaelfig opened this issue Aug 15, 2020 · 8 comments
Assignees
Labels
cosmic-swingset package: cosmic-swingset enhancement New feature or request needs-design
Milestone

Comments

@michaelfig
Copy link
Member

michaelfig commented Aug 15, 2020

What is the Problem Being Solved?

We divide upgradability into two forms:

  1. transparently upgrading the underlying chain
  2. more or less transparently installing a new set of Agoric services at any time during the life of the chain, without any loss of data or assets used by existing third-party clients or services

This issue is a proposal for how to handle upgrades of the first form (since its mechanics are more understood by me), specifically within the cosmic-swingset package, which is the interface between the Agoric chain and the underlying Cosmos SDK.

Upgrades of the second form are crucial but not addressed by this issue.

Description of the Design

In order to replicate the current state of the chain, we need to preserve the following state in the SwingSet statedir:

  • the current kernel database
  • a way to recover the heap of each running vat (currently its Javascript source code and up-to-date transcript)

Upgrading a chain:

  • somebody creates a cosmos-sdk governance proposal to upgrade to a given software version at a specific block height/time
  • the proposal is passed
  • at the proposed-upon time, the validator halts with an "upgrade required" message
  • all the SwingSet state is kept intact (both on-chain and statedir)
  • the validator restarts with a new cosmic-swingset program (binaries and sources) to continue the block

The https://github.com/cosmos/cosmos-sdk/tree/master/cosmovisor supervisor program can help automate the upgrade process after governance has passed.

There will be scope changes to these initial requirements. Please update the above if they change before this issue is closed.

Security Considerations

TBD.

Test Plan

TBD.

@michaelfig michaelfig added the enhancement New feature or request label Aug 15, 2020
@michaelfig michaelfig self-assigned this Aug 15, 2020
@michaelfig
Copy link
Member Author

@warner, @dtribble here is the issue to start from.

@dtribble
Copy link
Member

We need the between-blocks scheduler list. Why not preserve that as well?

@michaelfig
Copy link
Member Author

We need the between-blocks scheduler list. Why not preserve that as well?

I only meant to cross it off because it didn't exist yet. Will reinstate it when it exists.

@michaelfig
Copy link
Member Author

My current plan is to use https://github.com/cosmos/cosmos-sdk/tree/master/cosmovisor to manage transparent chain upgrades. To do so requires the kernel to understand prior versions' statedir (including kernel DB) and save static vat sources in the statedir so that they can be replayed.

@michaelfig
Copy link
Member Author

Refs cosmos/cosmos-sdk#7230 for a way to portably bootstrap the binaries using installed tools that meet our stated validator requirements (Node.js, Golang, etc).

@Tartuffo
Copy link
Contributor

Tartuffo commented Feb 2, 2022

This will turn into an epic @michaelfig

@Tartuffo
Copy link
Contributor

Tartuffo commented Feb 2, 2022

Done on Cosmic Swingset side, but not in Swingset. @warner Do you have a ticket for the Swingset side of this?

@Tartuffo Tartuffo added MN-1 and removed MN-1 labels Feb 2, 2022
@Tartuffo Tartuffo removed this from the Mainnet: Phase 1 - RUN Protocol milestone Feb 8, 2022
@Tartuffo
Copy link
Contributor

Done and tested, for a narrow scope of underlying chain software only.

@Tartuffo Tartuffo added this to the Mainnet 1 milestone Mar 23, 2022
@Tartuffo Tartuffo modified the milestones: Mainnet 1, RUN Protocol RC0 Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cosmic-swingset package: cosmic-swingset enhancement New feature or request needs-design
Projects
None yet
Development

No branches or pull requests

4 participants