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

ADR-040 Implementation: Migrate storage command/script for store v2 #10803

Closed
4 tasks
Tracked by #9816
roysc opened this issue Dec 17, 2021 · 3 comments
Closed
4 tasks
Tracked by #9816

ADR-040 Implementation: Migrate storage command/script for store v2 #10803

roysc opened this issue Dec 17, 2021 · 3 comments
Assignees

Comments

@roysc
Copy link
Contributor

roysc commented Dec 17, 2021

Summary

We need to provide a command for users to migrate data from the existing IAVL-based state to the new SMT-based store/v2.

Problem Definition

ADR-040 introduces a new state storage format using SMT as the commitment scheme, with a new internal storage format. In order to use it with an existing app, data will have to be migrated from the v1 store/MultiStore. This will need to happen at a predetermined block height like all StoreUpgrades.

Data can be dumped and read back as JSON. From discussions in vulcanize#7, this should not require new tooling, but it probably cannot be done internally and automatically by modules. Assuming it cannot, we need to create a script and command to ensure it is done gracefully, and is convenient and well documented for SDK users.

Steps:

  • iterate over all store keys and save them (without Cache layer) to store/v2
  • send an IBC UpgradeClient request with the new client state

Proposal

  • Implement an app command which is to be manually run on an offline chain.
  • Upon next running the chain, the UpgradeClient event is emitted.
  • The original database contents are not deleted or modified until the migration successfully completes.
    • Deletion could be left to an additional manual command.
  • TODO: additional steps or considerations?

(TODO)


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@roysc
Copy link
Contributor Author

roysc commented Dec 17, 2021

@robert-zaremba could you add any existing notes/thoughts to the description?

@roysc roysc mentioned this issue Dec 17, 2021
38 tasks
@i-norden i-norden changed the title Migrate storage command/script for store v2 ADR-040 Implementation: Migrate storage command/script for store v2 Dec 17, 2021
@robert-zaremba
Copy link
Collaborator

I think this is not needed: let's chat about it today. Migration will be "on fly" or through genesis export-import

@robert-zaremba
Copy link
Collaborator

So instead of a user stopping an app and calling the store migration command, this will be handled in on fly migration #10891.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants