ADR-040 Implementation: Migrate storage command/script for store v2 #10803
Description
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 StoreUpgrade
s.
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
Activity