Skip to content

Commit

Permalink
feat: remove provider migration for CV 3 to 6 (#2211)
Browse files Browse the repository at this point in the history
* remove migrations to CV < 7

* add changelog entry

* fix version name
  • Loading branch information
mpoke authored Sep 4, 2024
1 parent 3cc9ba2 commit 68f0ab4
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 191 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Remove provider migrations to consensus versions lower than 7.
To migrate the provider module from consensus version 3, 4, or 5 to consensus version 7 or higher,
users should use v4.3.x in production to migrate to consensus version 6.
([\#2211](https://github.com/cosmos/interchain-security/pull/2211))
16 changes: 6 additions & 10 deletions x/ccv/provider/migrations/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import (
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"

providerkeeper "github.com/cosmos/interchain-security/v5/x/ccv/provider/keeper"
v4 "github.com/cosmos/interchain-security/v5/x/ccv/provider/migrations/v4"
v5 "github.com/cosmos/interchain-security/v5/x/ccv/provider/migrations/v5"
v6 "github.com/cosmos/interchain-security/v5/x/ccv/provider/migrations/v6"
v7 "github.com/cosmos/interchain-security/v5/x/ccv/provider/migrations/v7"
v8 "github.com/cosmos/interchain-security/v5/x/ccv/provider/migrations/v8"
)
Expand Down Expand Up @@ -55,24 +52,23 @@ func (m Migrator) Migrate2to3(ctx sdktypes.Context) error {
// Migrate3to4 migrates x/ccvprovider state from consensus version 3 to 4.
// The migration consists of provider chain params additions.
func (m Migrator) Migrate3to4(ctx sdktypes.Context) error {
v4.MigrateParams(ctx, m.paramSpace)
return nil
return fmt.Errorf("state migration failed: " +
"first run [email protected] in production to migrate from consensus version 3 to 4")
}

// Migrate4to5 migrates x/ccvprovider state from consensus version 4 to 5.
// The migration consists of setting a top N of 95 for all registered consumer chains.
func (m Migrator) Migrate4to5(ctx sdktypes.Context) error {
v5.MigrateTopNForRegisteredChains(ctx, m.providerKeeper)
return nil
return fmt.Errorf("state migration failed: " +
"first run [email protected] in production to migrate from consensus version 4 to 5")
}

// Migrate5to6 migrates x/ccvprovider state from consensus version 5 to 6.
// It consists of setting the `NumberOfEpochsToStartReceivingRewards` param, as well as
// computing and storing the minimal power in the top N for all registered consumer chains.
func (m Migrator) Migrate5to6(ctx sdktypes.Context) error {
v6.MigrateParams(ctx, m.paramSpace)
v6.MigrateMinPowerInTopN(ctx, m.providerKeeper)
return nil
return fmt.Errorf("state migration failed: " +
"first run [email protected] in production to migrate from consensus version 5 to 6")
}

// Migrate6to7 migrates x/ccvprovider state from consensus version 6 to 7.
Expand Down
27 changes: 0 additions & 27 deletions x/ccv/provider/migrations/v4/migration_test.go

This file was deleted.

18 changes: 0 additions & 18 deletions x/ccv/provider/migrations/v4/migrations.go

This file was deleted.

32 changes: 0 additions & 32 deletions x/ccv/provider/migrations/v5/migration_test.go

This file was deleted.

28 changes: 0 additions & 28 deletions x/ccv/provider/migrations/v5/migrations.go

This file was deleted.

27 changes: 0 additions & 27 deletions x/ccv/provider/migrations/v6/migration_test.go

This file was deleted.

49 changes: 0 additions & 49 deletions x/ccv/provider/migrations/v6/migrations.go

This file was deleted.

0 comments on commit 68f0ab4

Please sign in to comment.