Skip to content

Commit

Permalink
Add QMS for online migration (#1870)
Browse files Browse the repository at this point in the history
* Add QMS for online migration

* Fix lint

---------

Co-authored-by: kbhat1 <kartikbhatri@gmail.com>
  • Loading branch information
yzang2019 and Kbhat1 committed Sep 25, 2024
1 parent c28c783 commit 3ac501f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/seidb.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const (

// Other configs
FlagSnapshotInterval = "state-sync.snapshot-interval"
FlagMigrateIAVL = "migrate-iavl"
FlagMigrateHeight = "migrate-height"
)

func SetupSeiDB(
Expand All @@ -58,8 +60,15 @@ func SetupSeiDB(
// cms must be overridden before the other options, because they may use the cms,
// make sure the cms aren't be overridden by the other options later on.
cms := rootmulti.NewStore(homePath, logger, scConfig, ssConfig)
migrationEnabled := cast.ToBool(appOpts.Get(FlagMigrateIAVL))
migrationHeight := cast.ToInt64(appOpts.Get(FlagMigrateHeight))
baseAppOptions = append([]func(*baseapp.BaseApp){
func(baseApp *baseapp.BaseApp) {
if migrationEnabled {
originalCMS := baseApp.CommitMultiStore()
baseApp.SetQueryMultiStore(originalCMS)

Check failure on line 69 in app/seidb.go

View workflow job for this annotation

GitHub Actions / forward-compatibility

baseApp.SetQueryMultiStore undefined (type *baseapp.BaseApp has no field or method SetQueryMultiStore)
baseApp.SetMigrationHeight(migrationHeight)

Check failure on line 70 in app/seidb.go

View workflow job for this annotation

GitHub Actions / forward-compatibility

baseApp.SetMigrationHeight undefined (type *baseapp.BaseApp has no field or method SetMigrationHeight)
}
baseApp.SetCMS(cms)
},
}, baseAppOptions...)
Expand Down

0 comments on commit 3ac501f

Please sign in to comment.