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

Dump state and restart #131

Closed
ebuchman opened this issue Jun 21, 2017 · 9 comments
Closed

Dump state and restart #131

ebuchman opened this issue Jun 21, 2017 · 9 comments
Assignees
Labels

Comments

@ebuchman
Copy link
Member

We need a way to dump state to a neutral format that can be included in a genesis.json so we can do upgrades where we throw away history

@ethanfrey
Copy link
Contributor

Yup, I think there was some attempt in tooling for merkleeyes for a generic restart tooling. Or should this be basecoin-specific stuff?

@jaekwon jaekwon removed the 0.6.x label Jan 14, 2018
@adrianbrink adrianbrink changed the title dump state and restart Dump state and restart Feb 26, 2018
@cwgoes
Copy link
Contributor

cwgoes commented Apr 11, 2018

Is "upgrades where we throw away history" a desired capability at launch? What's an example of an upgrade that would require this - a serialization format upgrade where the store needs to be rewritten?

@cwgoes
Copy link
Contributor

cwgoes commented Apr 11, 2018

Relevant - #758 - if we implement a simple "dump store state to JSON", should solve both.

@ethanfrey
Copy link
Contributor

Sure. Usecase was constant breaking testnets where we kept throwing away history. It would have been nice to easily transfer the balances on an upgrade.

Maybe this is unnecessary now. But if people ask some way to do this, it would be nice to give some path. JSON dump is nice...

@cwgoes cwgoes self-assigned this Apr 12, 2018
@ebuchman
Copy link
Member Author

Yes if there are changes in execution logic but you have a latest state you want to preserve, ideally we can dump this to json, and use it in the genesi json of a new chain

@ebuchman ebuchman added the C:CLI label Apr 21, 2018
@cwgoes
Copy link
Contributor

cwgoes commented Apr 23, 2018

If our goal is to allow restarting from a new genesis.json, retaining state, one way to do this would be to have modules specify a WriteGenesis function - the reverse of InitGenesis, reading the store and writing all module state to JSON, such that InitGenesis . WriteGenesis = id.

Besides the utility in easily making large changes (serialization format) and restarting the chain while retaining state, this is also a convenient debugging/analysis tool in general: JSON from gaiacli export MODULE could easily be piped into data analysis software.

It does, however, require that all modules can enumerate over all state (e.g. accounts).

Example implementation of a WriteGenesis function: 6526652

@cwgoes
Copy link
Contributor

cwgoes commented Apr 24, 2018

Additionally, applications using the SDK, including gaia, can implement an dump command which calls WriteGenesis for all modules used by the application.

@cwgoes
Copy link
Contributor

cwgoes commented Apr 24, 2018

Example export-stake command added in 00d1b15 - works, but the architecture to pass a keeper to a CLI command is a bit clumsy.

@cwgoes cwgoes added this to the 1.0 Code Freeze milestone Apr 24, 2018
@cwgoes
Copy link
Contributor

cwgoes commented May 1, 2018

Closed by #901.

alexanderbez pushed a commit that referenced this issue Apr 5, 2022
* iavl v0.17.3-osmo-v4.rc2

* upgrade iavl to v0.17.3-osmo-v4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants