From a2802bc9ea3f74a110e54940a8e4ea1a4aa3b977 Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Tue, 16 May 2023 17:56:36 +0900 Subject: [PATCH 01/11] Update x/bank's --- x/bank/module.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x/bank/module.go b/x/bank/module.go index adfa071d94..43fe038e22 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -25,6 +25,9 @@ import ( "github.com/Finschia/finschia-sdk/x/bank/types" ) +// ConsensusVersion defines the current x/bank module consensus version. +const ConsensusVersion = 2 + var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} @@ -158,7 +161,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 1 } +func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } // AppModuleSimulation functions From 7f197c0dd4c5ec01f408d8f546c86db499d2e27c Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Tue, 16 May 2023 18:58:00 +0900 Subject: [PATCH 02/11] Update x/auth's --- x/auth/module.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/x/auth/module.go b/x/auth/module.go index b228cd64a9..b0bfc34791 100644 --- a/x/auth/module.go +++ b/x/auth/module.go @@ -22,6 +22,9 @@ import ( "github.com/Finschia/finschia-sdk/x/auth/types" ) +// ConsensusVersion defines the current x/auth module consensus version. +const ConsensusVersion = 2 + var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} @@ -122,10 +125,10 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.accountKeeper) - // m := keeper.NewMigrator(am.accountKeeper) - // if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { - // panic(fmt.Sprintf("failed to migrate x/auth from version 1 to 2: %v", err)) - // } + m := keeper.NewMigrator(am.accountKeeper, cfg.QueryServer()) + if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { + panic(fmt.Sprintf("failed to migrate x/auth from version 1 to 2: %v", err)) + } } // InitGenesis performs genesis initialization for the auth module. It returns @@ -145,7 +148,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 1 } +func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } // AppModuleSimulation functions From 365fb81db95a4bd1cc0ff5d5b433fd6dc268c29c Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Tue, 16 May 2023 18:06:36 +0900 Subject: [PATCH 03/11] Update x/crisis's --- x/crisis/module.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/x/crisis/module.go b/x/crisis/module.go index 787320a404..61e6435e40 100644 --- a/x/crisis/module.go +++ b/x/crisis/module.go @@ -129,11 +129,6 @@ func (AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier { return n // RegisterServices registers module services. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), am.keeper) - - // m := keeper.NewMigrator(*am.keeper) - // if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { - // panic(fmt.Sprintf("failed to migrate x/crisis from version 1 to 2: %v", err)) - // } } // InitGenesis performs genesis initialization for the crisis module. It returns From 491e02dfcd048a35e5b7dc771104393f76ac6e1d Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Tue, 16 May 2023 18:11:09 +0900 Subject: [PATCH 04/11] Update x/distribution's --- x/distribution/module.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/x/distribution/module.go b/x/distribution/module.go index b5ab03481b..5916b073a9 100644 --- a/x/distribution/module.go +++ b/x/distribution/module.go @@ -22,6 +22,9 @@ import ( "github.com/Finschia/finschia-sdk/x/distribution/types" ) +// ConsensusVersion defines the current x/distribution module consensus version. +const ConsensusVersion = 2 + var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} @@ -136,10 +139,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) - // m := keeper.NewMigrator(am.keeper) - // if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { - // panic(fmt.Sprintf("failed to migrate x/distribution from version 1 to 2: %v", err)) - // } + m := keeper.NewMigrator(am.keeper) + if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { + panic(fmt.Sprintf("failed to migrate x/distribution from version 1 to 2: %v", err)) + } } // InitGenesis performs genesis initialization for the distribution module. It returns @@ -159,7 +162,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 1 } +func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } // BeginBlock returns the begin blocker for the distribution module. func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { From 59c68b4f93d57a190594dd366117e4d4c1bc5513 Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Tue, 16 May 2023 18:11:47 +0900 Subject: [PATCH 05/11] Update x/evidence's --- x/evidence/module.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/x/evidence/module.go b/x/evidence/module.go index 74c91b3650..dd091b7804 100644 --- a/x/evidence/module.go +++ b/x/evidence/module.go @@ -140,11 +140,6 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) - - // m := keeper.NewMigrator(am.keeper) - // if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { - // panic(fmt.Sprintf("failed to migrate x/evidence from version 1 to 2: %v", err)) - // } } // RegisterInvariants registers the evidence module's invariants. From 4a833a43e1a4889ee46b3ccaad3320f4fa4987c2 Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Tue, 16 May 2023 18:36:04 +0900 Subject: [PATCH 06/11] Update x/gov's --- x/gov/module.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/x/gov/module.go b/x/gov/module.go index 8ab13f287e..4fc810a513 100644 --- a/x/gov/module.go +++ b/x/gov/module.go @@ -146,11 +146,6 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) - - // m := keeper.NewMigrator(am.keeper) - // if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { - // panic(fmt.Sprintf("failed to migrate x/gov from version 1 to 2: %v", err)) - // } } // InitGenesis performs genesis initialization for the gov module. It returns From 7724f62f24d1a2afe5a0295ecd348f150f427d70 Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Tue, 16 May 2023 18:36:49 +0900 Subject: [PATCH 07/11] Update x/mint's --- x/mint/module.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/x/mint/module.go b/x/mint/module.go index d13d8024bd..2d3aee1d83 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -118,11 +118,6 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // module-specific gRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.keeper) - - /* m := keeper.NewMigrator(am.keeper) - if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { - panic(fmt.Sprintf("failed to migrate x/mint from version 1 to 2: %v", err)) - } */ } // InitGenesis performs genesis initialization for the mint module. It returns From cac6d9cdc5c7d6b94acb270907ab315ee4e2ee64 Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Tue, 16 May 2023 18:39:03 +0900 Subject: [PATCH 08/11] Update x/slashing's --- x/slashing/module.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/x/slashing/module.go b/x/slashing/module.go index 45d9bb95bb..9dc575d267 100644 --- a/x/slashing/module.go +++ b/x/slashing/module.go @@ -22,6 +22,9 @@ import ( "github.com/Finschia/finschia-sdk/x/slashing/types" ) +// ConsensusVersion defines the current x/slashing module consensus version. +const ConsensusVersion = 2 + var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} @@ -131,10 +134,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) types.RegisterQueryServer(cfg.QueryServer(), am.keeper) - // m := keeper.NewMigrator(am.keeper) - // if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { - // panic(fmt.Sprintf("failed to migrate x/slashing from version 1 to 2: %v", err)) - // } + m := keeper.NewMigrator(am.keeper) + if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { + panic(fmt.Sprintf("failed to migrate x/slashing from version 1 to 2: %v", err)) + } } // InitGenesis performs genesis initialization for the slashing module. It returns @@ -154,7 +157,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 1 } +func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } // BeginBlock returns the begin blocker for the slashing module. func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { From 589a6e1d1822044403ebfc49d963e74602dd92b6 Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Tue, 16 May 2023 18:47:53 +0900 Subject: [PATCH 09/11] Update x/staking's --- x/staking/module.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/x/staking/module.go b/x/staking/module.go index 81acce60b8..85ea5e39ce 100644 --- a/x/staking/module.go +++ b/x/staking/module.go @@ -22,6 +22,10 @@ import ( "github.com/Finschia/finschia-sdk/x/staking/types" ) +const ( + consensusVersion uint64 = 2 +) + var ( _ module.AppModule = AppModule{} _ module.AppModuleBasic = AppModuleBasic{} @@ -133,10 +137,10 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { querier := keeper.Querier{Keeper: am.keeper} types.RegisterQueryServer(cfg.QueryServer(), querier) - // m := keeper.NewMigrator(am.keeper) - // if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { - // panic(fmt.Sprintf("failed to migrate x/staking from version 1 to 2: %v", err)) - // } + m := keeper.NewMigrator(am.keeper) + if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { + panic(fmt.Sprintf("failed to migrate x/staking from version 1 to 2: %v", err)) + } } // InitGenesis performs genesis initialization for the staking module. It returns @@ -157,7 +161,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 1 } +func (AppModule) ConsensusVersion() uint64 { return consensusVersion } // BeginBlock returns the begin blocker for the staking module. func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { From d4839cc4c6cd413b636222a659d78420ad6dbff2 Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Tue, 16 May 2023 18:57:08 +0900 Subject: [PATCH 10/11] Update x/upgrade's --- x/upgrade/module.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/x/upgrade/module.go b/x/upgrade/module.go index 3da462e2b8..c1cb610278 100644 --- a/x/upgrade/module.go +++ b/x/upgrade/module.go @@ -94,11 +94,6 @@ func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sd // module-specific GRPC queries. func (am AppModule) RegisterServices(cfg module.Configurator) { types.RegisterQueryServer(cfg.QueryServer(), am.keeper) - - /* m := keeper.NewMigrator(am.keeper) - if err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2); err != nil { - panic(fmt.Sprintf("failed to migrate x/upgrade from version 1 to 2: %v", err)) - } */ } // InitGenesis is ignored, no sense in serializing future upgrades From 1519727b73ab0c5d566e8f57bfc84f645749d8f7 Mon Sep 17 00:00:00 2001 From: Youngtaek Yoon Date: Wed, 17 May 2023 12:52:39 +0900 Subject: [PATCH 11/11] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c5c5569f4..ba5678b8db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Breaking Changes * (consensus) [\#1178](https://github.com/Finschia/finschia-sdk/pull/1178) change the consensus from Ostracon to Tendermint v0.34.24 +* (all) [\#1007](https://github.com/Finschia/finschia-sdk/pull/1007) catch up with the upstream's module versions ### State Machine Breaking