Skip to content

Commit fda87e5

Browse files
authored
chores: prepare v0.10.4 (#223)
* chores: prepare v0.10.4 Bump cosmos-sdk to v0.45.4 Bump tendermint to v0.34.19 Bump wasmvm to v1.0.0-beta10 Integrate and initialize x/upgrade module * chore: switch cosmos-sdk to proper tag
1 parent e7b7407 commit fda87e5

File tree

5 files changed

+67
-243
lines changed

5 files changed

+67
-243
lines changed

app/app.go

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import (
4747
"github.com/cosmos/cosmos-sdk/x/crisis"
4848
crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper"
4949
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
50-
distr "github.com/cosmos/cosmos-sdk/x/distribution"
50+
"github.com/cosmos/cosmos-sdk/x/distribution"
5151
distrclient "github.com/cosmos/cosmos-sdk/x/distribution/client"
5252
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
5353
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
@@ -104,9 +104,11 @@ import (
104104
const Name = "fetchd"
105105

106106
var (
107+
// ProposalsEnabled controls x/wasm Proposals
107108
// If EnabledSpecificProposals is "", and this is "true", then enable all x/wasm proposals.
108109
// If EnabledSpecificProposals is "", and this is not "true", then disable all x/wasm proposals.
109110
ProposalsEnabled = "false"
111+
// EnableSpecificProposals allows to enable only specific x/wasm proposals
110112
// If set to non-empty string it must be comma-separated list of values that are all a subset
111113
// of "EnableAllProposals" (takes precedence over ProposalsEnabled)
112114
// https://github.com/CosmWasm/wasmd/blob/02a54d33ff2c064f3539ae12d75d027d9c665f05/x/wasm/internal/types/proposal.go#L28-L34
@@ -144,7 +146,7 @@ var (
144146
capability.AppModuleBasic{},
145147
staking.AppModuleBasic{},
146148
mint.AppModuleBasic{},
147-
distr.AppModuleBasic{},
149+
distribution.AppModuleBasic{},
148150
gov.NewAppModuleBasic(
149151
append(
150152
wasmclient.ProposalHandlers,
@@ -239,8 +241,6 @@ type App struct {
239241

240242
// the module manager
241243
mm *module.Manager
242-
243-
configurator module.Configurator
244244
}
245245

246246
// New returns a reference to an initialized Gaia.
@@ -343,7 +343,7 @@ func New(
343343
govRouter := govtypes.NewRouter()
344344
govRouter.AddRoute(govtypes.RouterKey, govtypes.ProposalHandler).
345345
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
346-
AddRoute(distrtypes.RouterKey, distr.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)).
346+
AddRoute(distrtypes.RouterKey, distribution.NewCommunityPoolSpendProposalHandler(app.DistrKeeper)).
347347
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
348348
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper))
349349

@@ -434,7 +434,7 @@ func New(
434434
gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper),
435435
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper),
436436
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
437-
distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
437+
distribution.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
438438
staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper),
439439
upgrade.NewAppModule(app.UpgradeKeeper),
440440
evidence.NewAppModule(app.EvidenceKeeper),
@@ -446,7 +446,7 @@ func New(
446446
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper),
447447
)
448448

449-
// During begin block slashing happens after distr.BeginBlocker so that
449+
// During begin block slashing happens after distribution.BeginBlocker so that
450450
// there is nothing left over in the validator fee pool, so as to keep the
451451
// CanWithdrawInvariant invariant.
452452
// NOTE: staking module is required if HistoricalEntries param > 0
@@ -523,8 +523,10 @@ func New(
523523

524524
app.mm.RegisterInvariants(&app.CrisisKeeper)
525525
app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino)
526-
app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())
527-
app.mm.RegisterServices(app.configurator)
526+
cfg := module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())
527+
528+
app.RegisterUpgradeHandlers(cfg)
529+
app.mm.RegisterServices(cfg)
528530

529531
// initialize stores
530532
app.MountKVStores(keys)
@@ -599,6 +601,7 @@ func (app *App) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.Res
599601
if err := tmjson.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
600602
panic(err)
601603
}
604+
app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
602605
return app.mm.InitGenesis(ctx, app.appCodec, genesisState)
603606
}
604607

@@ -667,6 +670,32 @@ func (app *App) GetSubspace(moduleName string) paramstypes.Subspace {
667670
return subspace
668671
}
669672

673+
func (app *App) RegisterUpgradeHandlers(cfg module.Configurator) {
674+
app.UpgradeKeeper.SetUpgradeHandler("fetchd-v0.10.4", func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
675+
// manually add every existing modules to prevent the migration calling InitGenesis on them
676+
fromVM[authz.ModuleName] = authzmodule.AppModule{}.ConsensusVersion()
677+
fromVM[banktypes.ModuleName] = bank.AppModule{}.ConsensusVersion()
678+
fromVM[capabilitytypes.ModuleName] = capability.AppModule{}.ConsensusVersion()
679+
fromVM[crisistypes.ModuleName] = crisis.AppModule{}.ConsensusVersion()
680+
fromVM[distrtypes.ModuleName] = distribution.AppModule{}.ConsensusVersion()
681+
fromVM[stakingtypes.ModuleName] = staking.AppModule{}.ConsensusVersion()
682+
fromVM[evidencetypes.ModuleName] = evidence.AppModule{}.ConsensusVersion()
683+
fromVM[feegrant.ModuleName] = feegrantmodule.AppModule{}.ConsensusVersion()
684+
fromVM[genutiltypes.ModuleName] = genutil.AppModule{}.ConsensusVersion()
685+
fromVM[govtypes.ModuleName] = gov.AppModule{}.ConsensusVersion()
686+
fromVM[ibchost.ModuleName] = ibc.AppModule{}.ConsensusVersion()
687+
fromVM[minttypes.ModuleName] = mint.AppModule{}.ConsensusVersion()
688+
fromVM[paramstypes.ModuleName] = params.AppModule{}.ConsensusVersion()
689+
fromVM[slashingtypes.ModuleName] = slashing.AppModule{}.ConsensusVersion()
690+
fromVM[ibctransfertypes.ModuleName] = transfer.AppModule{}.ConsensusVersion()
691+
fromVM[authtypes.ModuleName] = auth.AppModule{}.ConsensusVersion()
692+
fromVM[upgradetypes.ModuleName] = upgrade.AppModule{}.ConsensusVersion()
693+
fromVM[vestingtypes.ModuleName] = vesting.AppModule{}.ConsensusVersion()
694+
fromVM[wasm.ModuleName] = wasm.AppModule{}.ConsensusVersion()
695+
return app.mm.RunMigrations(ctx, cfg, fromVM)
696+
})
697+
}
698+
670699
// RegisterAPIRoutes registers all application module routes with the provided
671700
// API server.
672701
func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {

cmd/fetchd/cmd/doradomigrate.go

Lines changed: 0 additions & 219 deletions
This file was deleted.

cmd/fetchd/cmd/root.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
127127
genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome),
128128
config.Cmd(),
129129
genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome),
130-
AddStakeReconciliationMigrateCmd(),
131-
AddDoradoMigrateCmd(),
130+
// AddStakeReconciliationMigrateCmd(),
132131
genutilcli.GenTxCmd(app.ModuleBasics, encodingConfig.TxConfig, banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome),
133132
genutilcli.ValidateGenesisCmd(app.ModuleBasics),
134133
AddGenesisAccountCmd(app.DefaultNodeHome),

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ go 1.17
44

55
require (
66
github.com/CosmWasm/wasmd v0.26.0
7-
github.com/cosmos/cosmos-sdk v0.45.1
7+
github.com/cosmos/cosmos-sdk v0.45.4
88
github.com/cosmos/ibc-go/v2 v2.2.0
99
github.com/gorilla/mux v1.8.0
1010
github.com/prometheus/client_golang v1.12.1
1111
github.com/rakyll/statik v0.1.7
1212
github.com/spf13/cast v1.4.1
13-
github.com/spf13/cobra v1.3.0
14-
github.com/tendermint/tendermint v0.34.16
13+
github.com/spf13/cobra v1.4.0
14+
github.com/tendermint/tendermint v0.34.19
1515
github.com/tendermint/tm-db v0.6.7
1616
)
1717

1818
require (
1919
filippo.io/edwards25519 v1.0.0-beta.2 // indirect
2020
github.com/99designs/keyring v1.1.6 // indirect
2121
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
22-
github.com/CosmWasm/wasmvm v1.0.0-beta8 // indirect
22+
github.com/CosmWasm/wasmvm v1.0.0-beta10 // indirect
2323
github.com/DataDog/zstd v1.4.5 // indirect
2424
github.com/Workiva/go-datastructures v1.0.53 // indirect
2525
github.com/armon/go-metrics v0.3.10 // indirect
@@ -114,7 +114,7 @@ require (
114114
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
115115
golang.org/x/text v0.3.7 // indirect
116116
google.golang.org/genproto v0.0.0-20220302033224-9aa15565e42a // indirect
117-
google.golang.org/grpc v1.44.0 // indirect
117+
google.golang.org/grpc v1.45.0 // indirect
118118
google.golang.org/protobuf v1.27.1 // indirect
119119
gopkg.in/ini.v1 v1.66.2 // indirect
120120
gopkg.in/yaml.v2 v2.4.0 // indirect
@@ -128,4 +128,4 @@ replace google.golang.org/grpc => google.golang.org/grpc v1.33.2
128128

129129
replace github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1
130130

131-
replace github.com/cosmos/cosmos-sdk => github.com/fetchai/cosmos-sdk v0.18.0
131+
replace github.com/cosmos/cosmos-sdk => github.com/fetchai/cosmos-sdk v0.18.1

0 commit comments

Comments
 (0)