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

feat: remove provider migration for CV 3 to 6 #2211

Merged
merged 4 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

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

This file was deleted.

26 changes: 0 additions & 26 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.

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

This file was deleted.

Loading