Skip to content

Commit 558be63

Browse files
deps: Upgrade sdk 53 (#3773)
* Bump version to 25 * Change configured upgrade * First bit of upgrades * Update upgrade test versions * typo * Fixes * Fix test failures * Update changelog * Fix time issue in sim test
1 parent ccaa120 commit 558be63

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+982
-2725
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
## UNRELEASED
44

5+
### DEPENDENCIES
6+
- Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.53.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.53.0) (#3773)
7+
8+
### STATE BREAKING
9+
- Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.53.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.53.0) (#3773)
10+
11+
## v24.0.0
12+
13+
*May 30, 2025*
14+
515
### DEPENDENCIES
616
- Bump [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 2.0.9 ([#3710](https://github.com/cosmos/gaia/pull/3710))
717
- Bump [golang.org/x/crypto](https://github.com/golang/crypto) from 0.32.0 to 0.35.0 ([#3709](https://github.com/cosmos/gaia/pull/3709))

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ start-localnet-ci: build
356356
./build/gaiad genesis gentx val 1000000000stake --home ~/.gaiad-liveness --chain-id liveness --keyring-backend test
357357
./build/gaiad genesis collect-gentxs --home ~/.gaiad-liveness
358358
sed -i.bak'' 's/minimum-gas-prices = ""/minimum-gas-prices = "0uatom"/' ~/.gaiad-liveness/config/app.toml
359-
./build/gaiad start --home ~/.gaiad-liveness --x-crisis-skip-assert-invariants
359+
./build/gaiad start --home ~/.gaiad-liveness
360360

361361
.PHONY: start-localnet-ci
362362

ante/ante.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
sdk "github.com/cosmos/cosmos-sdk/types"
1717
"github.com/cosmos/cosmos-sdk/types/tx/signing"
1818
"github.com/cosmos/cosmos-sdk/x/auth/ante"
19+
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
1920
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
2021
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
2122

@@ -36,7 +37,7 @@ type HandlerOptions struct {
3637
SignModeHandler *txsigning.HandlerMap
3738
SigGasConsumer func(meter storetypes.GasMeter, sig signing.SignatureV2, params authtypes.Params) error
3839

39-
AccountKeeper feemarketante.AccountKeeper
40+
AccountKeeper *authkeeper.AccountKeeper
4041
BankKeeper feemarketante.BankKeeper
4142
Codec codec.BinaryCodec
4243
IBCkeeper *ibckeeper.Keeper

app/app.go

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,9 @@ import (
1010
"github.com/gorilla/mux"
1111
"github.com/rakyll/statik/fs"
1212
feemarketkeeper "github.com/skip-mev/feemarket/x/feemarket/keeper"
13-
"github.com/spf13/cast"
1413

1514
abci "github.com/cometbft/cometbft/abci/types"
1615
tmjson "github.com/cometbft/cometbft/libs/json"
17-
tmos "github.com/cometbft/cometbft/libs/os"
1816
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
1917

2018
dbm "github.com/cosmos/cosmos-db"
@@ -62,7 +60,6 @@ import (
6260
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
6361
txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
6462
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
65-
"github.com/cosmos/cosmos-sdk/x/crisis"
6663
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
6764
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
6865

@@ -101,8 +98,6 @@ type GaiaApp struct { //nolint: revive
10198
txConfig client.TxConfig
10299
interfaceRegistry types.InterfaceRegistry
103100

104-
invCheckPeriod uint
105-
106101
// the module manager
107102
mm *module.Manager
108103
ModuleBasics module.BasicManager
@@ -154,10 +149,6 @@ func NewGaiaApp(
154149
std.RegisterLegacyAminoCodec(legacyAmino)
155150
std.RegisterInterfaces(interfaceRegistry)
156151

157-
// App Opts
158-
skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants))
159-
invCheckPeriod := cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod))
160-
161152
bApp := baseapp.NewBaseApp(
162153
appName,
163154
logger,
@@ -176,7 +167,6 @@ func NewGaiaApp(
176167
txConfig: txConfig,
177168
appCodec: appCodec,
178169
interfaceRegistry: interfaceRegistry,
179-
invCheckPeriod: invCheckPeriod,
180170
}
181171

182172
moduleAccountAddresses := app.ModuleAccountAddrs()
@@ -191,7 +181,6 @@ func NewGaiaApp(
191181
app.BlockedModuleAccountAddrs(moduleAccountAddresses),
192182
skipUpgradeHeights,
193183
homePath,
194-
invCheckPeriod,
195184
logger,
196185
appOpts,
197186
wasmOpts,
@@ -208,7 +197,7 @@ func NewGaiaApp(
208197

209198
// NOTE: Any module instantiated in the module manager that is later modified
210199
// must be passed by reference here.
211-
app.mm = module.NewManager(appModules(app, appCodec, txConfig, skipGenesisInvariants, tmLightClientModule)...)
200+
app.mm = module.NewManager(appModules(app, appCodec, txConfig, tmLightClientModule)...)
212201
app.ModuleBasics = newBasicManagerFromManager(app)
213202

214203
enabledSignModes := append([]sigtypes.SignMode(nil), authtx.DefaultSignModes...)
@@ -230,6 +219,7 @@ func NewGaiaApp(
230219
// NOTE: upgrade module is required to be prioritized
231220
app.mm.SetOrderPreBlockers(
232221
upgradetypes.ModuleName,
222+
authtypes.ModuleName,
233223
)
234224
// During begin block slashing happens after distr.BeginBlocker so that
235225
// there is nothing left over in the validator fee pool, so as to keep the
@@ -248,7 +238,6 @@ func NewGaiaApp(
248238
// Uncomment if you want to set a custom migration order here.
249239
// app.mm.SetOrderMigrations(custom order)
250240

251-
app.mm.RegisterInvariants(app.CrisisKeeper)
252241
app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())
253242
err = app.mm.RegisterServices(app.configurator)
254243
if err != nil {
@@ -270,7 +259,7 @@ func NewGaiaApp(
270259
//
271260
// NOTE: this is not required apps that don't use the simulator for fuzz testing
272261
// transactions
273-
app.sm = module.NewSimulationManager(simulationModules(app, appCodec, skipGenesisInvariants)...)
262+
app.sm = module.NewSimulationManager(simulationModules(app, appCodec)...)
274263

275264
app.sm.RegisterStoreDecoders()
276265

@@ -286,7 +275,7 @@ func NewGaiaApp(
286275

287276
anteHandler, err := gaiaante.NewAnteHandler(
288277
gaiaante.HandlerOptions{
289-
AccountKeeper: app.AccountKeeper,
278+
AccountKeeper: &app.AccountKeeper,
290279
BankKeeper: app.BankKeeper,
291280
FeegrantKeeper: app.FeeGrantKeeper,
292281
SignModeHandler: txConfig.SignModeHandler(),
@@ -354,13 +343,13 @@ func NewGaiaApp(
354343

355344
if loadLatest {
356345
if err := app.LoadLatestVersion(); err != nil {
357-
tmos.Exit(fmt.Sprintf("failed to load latest version: %s", err))
346+
panic(fmt.Sprintf("failed to load latest version: %s", err))
358347
}
359348

360349
ctx := app.NewUncachedContext(true, tmproto.Header{})
361350

362351
if err := app.WasmKeeper.InitializePinnedCodes(ctx); err != nil {
363-
tmos.Exit(fmt.Sprintf("WasmKeeper failed initialize pinned codes %s", err))
352+
panic(fmt.Sprintf("WasmKeeper failed initialize pinned codes %s", err))
364353
}
365354

366355
if err := app.WasmClientKeeper.InitializePinnedCodes(ctx); err != nil {

app/export.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
8181
allowedAddrsMap[addr] = true
8282
}
8383

84-
/* Just to be safe, assert the invariants on current state. */
85-
app.CrisisKeeper.AssertInvariants(ctx)
86-
8784
/* Handle fee distribution state. */
8885

8986
// withdraw all validator commission

app/keepers/keepers.go

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ import (
6666
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
6767
consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
6868
consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
69-
crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper"
70-
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
7169
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
7270
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
7371
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
@@ -109,9 +107,8 @@ type AppKeepers struct {
109107
DistrKeeper distrkeeper.Keeper
110108
LiquidKeeper *liquidkeeper.Keeper
111109
GovKeeper *govkeeper.Keeper
112-
CrisisKeeper *crisiskeeper.Keeper
113110
UpgradeKeeper *upgradekeeper.Keeper
114-
ParamsKeeper paramskeeper.Keeper
111+
ParamsKeeper paramskeeper.Keeper //nolint:staticcheck
115112
WasmKeeper wasmkeeper.Keeper
116113
// IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
117114
IBCKeeper *ibckeeper.Keeper
@@ -148,7 +145,6 @@ func NewAppKeeper(
148145
blockedAddress map[string]bool,
149146
skipUpgradeHeights map[int64]bool,
150147
homePath string,
151-
invCheckPeriod uint,
152148
logger log.Logger,
153149
appOpts servertypes.AppOptions,
154150
wasmOpts []wasmkeeper.Option,
@@ -205,16 +201,6 @@ func NewAppKeeper(
205201
logger,
206202
)
207203

208-
appKeepers.CrisisKeeper = crisiskeeper.NewKeeper(
209-
appCodec,
210-
runtime.NewKVStoreService(appKeepers.keys[crisistypes.StoreKey]),
211-
invCheckPeriod,
212-
appKeepers.BankKeeper,
213-
authtypes.FeeCollectorName,
214-
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
215-
appKeepers.AccountKeeper.AddressCodec(),
216-
)
217-
218204
appKeepers.AuthzKeeper = authzkeeper.NewKeeper(
219205
runtime.NewKVStoreService(appKeepers.keys[authzkeeper.StoreKey]),
220206
appCodec,
@@ -596,8 +582,10 @@ func (appKeepers *AppKeepers) GetSubspace(moduleName string) paramstypes.Subspac
596582
}
597583

598584
// initParamsKeeper init params keeper and its subspaces
599-
func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper {
600-
paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey)
585+
func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key,
586+
tkey storetypes.StoreKey,
587+
) paramskeeper.Keeper { //nolint:staticcheck
588+
paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) //nolint:staticcheck
601589

602590
// register the key tables for legacy param subspaces
603591
keyTable := ibcclienttypes.ParamKeyTable()
@@ -609,7 +597,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
609597
paramsKeeper.Subspace(distrtypes.ModuleName).WithKeyTable(distrtypes.ParamKeyTable()) //nolint: staticcheck // SA1019
610598
paramsKeeper.Subspace(slashingtypes.ModuleName).WithKeyTable(slashingtypes.ParamKeyTable()) //nolint: staticcheck // SA1019
611599
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) //nolint: staticcheck // SA1019
612-
paramsKeeper.Subspace(crisistypes.ModuleName).WithKeyTable(crisistypes.ParamKeyTable()) //nolint: staticcheck // SA1019
613600
paramsKeeper.Subspace(ibcexported.ModuleName).WithKeyTable(keyTable)
614601
paramsKeeper.Subspace(ibctransfertypes.ModuleName).WithKeyTable(ibctransfertypes.ParamKeyTable())
615602
paramsKeeper.Subspace(icacontrollertypes.SubModuleName).WithKeyTable(icacontrollertypes.ParamKeyTable())

app/keepers/keys.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
2222
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
2323
consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
24-
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
2524
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
2625
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
2726
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
@@ -41,7 +40,6 @@ func (appKeepers *AppKeepers) GenerateKeys() {
4140
authtypes.StoreKey,
4241
banktypes.StoreKey,
4342
stakingtypes.StoreKey,
44-
crisistypes.StoreKey,
4543
minttypes.StoreKey,
4644
distrtypes.StoreKey,
4745
slashingtypes.StoreKey,

app/modules.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import (
3838
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
3939
"github.com/cosmos/cosmos-sdk/x/consensus"
4040
consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
41-
"github.com/cosmos/cosmos-sdk/x/crisis"
4241
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
4342
distr "github.com/cosmos/cosmos-sdk/x/distribution"
4443
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
@@ -86,7 +85,6 @@ func appModules(
8685
app *GaiaApp,
8786
appCodec codec.Codec,
8887
txConfig client.TxEncodingConfig,
89-
skipGenesisInvariants bool,
9088
tmLightClientModule tendermint.LightClientModule,
9189
) []module.AppModule {
9290
return []module.AppModule{
@@ -99,7 +97,6 @@ func appModules(
9997
auth.NewAppModule(appCodec, app.AccountKeeper, nil, app.GetSubspace(authtypes.ModuleName)),
10098
vesting.NewAppModule(app.AccountKeeper, app.BankKeeper),
10199
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)),
102-
crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)),
103100
gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(govtypes.ModuleName)),
104101
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, nil, app.GetSubspace(minttypes.ModuleName)),
105102
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry),
@@ -111,7 +108,7 @@ func appModules(
111108
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
112109
ibc.NewAppModule(app.IBCKeeper),
113110
ibcwasm.NewAppModule(app.WasmClientKeeper),
114-
sdkparams.NewAppModule(app.ParamsKeeper),
111+
sdkparams.NewAppModule(app.ParamsKeeper), //nolint:staticcheck
115112
consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),
116113
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)),
117114
app.TransferModule,
@@ -150,7 +147,6 @@ func newBasicManagerFromManager(app *GaiaApp) module.BasicManager {
150147
func simulationModules(
151148
app *GaiaApp,
152149
appCodec codec.Codec,
153-
_ bool,
154150
) []module.AppModuleSimulation {
155151
return []module.AppModuleSimulation{
156152
auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
@@ -161,7 +157,6 @@ func simulationModules(
161157
staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)),
162158
distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(distrtypes.ModuleName)),
163159
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, app.GetSubspace(slashingtypes.ModuleName), app.interfaceRegistry),
164-
sdkparams.NewAppModule(app.ParamsKeeper),
165160
evidence.NewAppModule(app.EvidenceKeeper),
166161
authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry),
167162
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)),

app/sim_bench_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"github.com/stretchr/testify/require"
88

99
"github.com/cosmos/cosmos-sdk/baseapp"
10-
"github.com/cosmos/cosmos-sdk/server"
1110
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
1211
simulation2 "github.com/cosmos/cosmos-sdk/types/simulation"
1312
"github.com/cosmos/cosmos-sdk/x/simulation"
@@ -25,7 +24,8 @@ func BenchmarkFullAppSimulation(b *testing.B) {
2524
config := simcli.NewConfigFromFlags()
2625
config.ChainID = AppChainID
2726

28-
db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "goleveldb-app-sim", "Simulation", simcli.FlagVerboseValue, simcli.FlagEnabledValue)
27+
db, dir, logger, skip, err := simtestutil.SetupSimulation(config, "goleveldb-app-sim", "Simulation",
28+
simcli.FlagVerboseValue, false)
2929
if err != nil {
3030
b.Fatalf("simulation setup failed: %s", err.Error())
3131
}
@@ -40,7 +40,6 @@ func BenchmarkFullAppSimulation(b *testing.B) {
4040
}()
4141

4242
appOptions := make(simtestutil.AppOptionsMap, 0)
43-
appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue
4443

4544
app := gaia.NewGaiaApp(
4645
logger,

app/sim_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"math/rand"
77
"os"
88
"testing"
9+
"time"
910

1011
"github.com/stretchr/testify/require"
1112

@@ -54,8 +55,9 @@ func TestAppStateDeterminism(t *testing.T) {
5455
config := sim.NewConfigFromFlags()
5556
config.InitialBlockHeight = 1
5657
config.ExportParamsPath = ""
57-
config.OnOperation = false
58-
config.AllInvariants = false
58+
config.OnOperation = false //nolint:staticcheck
59+
config.AllInvariants = false //nolint:staticcheck
60+
config.GenesisTime = time.Now().UTC().Unix()
5961
config.ChainID = AppChainID
6062

6163
numSeeds := 3

0 commit comments

Comments
 (0)