cosmos / cosmos-sdk

:chains: A Framework for Building High Value Public Blockchains :sparkles:
https://cosmos.network/
Apache License 2.0
6.28k stars 3.64k forks source link

[Feature]: Add configuration flag to support migration from store/v1 -> store/v2 #22180

Open kocubinski opened 1 month ago

kocubinski commented 1 month ago

Summary

There is no out of the box migration support from store/v1 -> store/v2 for a server/2 app.

Problem Definition

The store/v2 root store factory does not support migration manager set up, the argument is always set as nil.

https://github.com/cosmos/cosmos-sdk/blob/325728a9fd6c162b762b402470e8416a54bf0d7f/store/v2/root/factory.go#L180

Proposed Feature

Extend the store/v2/root.Config options with a boolean flag to enable migration if set.

https://github.com/cosmos/cosmos-sdk/blob/325728a9fd6c162b762b402470e8416a54bf0d7f/store/v2/root/config.go#L10-L14

This flag should be ignored in TOML, but settable from simapp/v2/app_di.go so that the feature is configuration is chain wide by default, not node specific.

julienrbrt commented 1 month ago

From last API review call, it was said it would be nice to improve the migration UX by not requiring to turn on/set migrator manually.