Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 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
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,10 @@ jobs:
# the old gaiad binary version is hardcoded, need to be updated each major release.
- name: Install Old Gaiad
run: |
curl -LO https://github.com/cosmos/gaia/releases/download/v23.2.0/gaiad-v23.2.0-linux-amd64
chmod a+x gaiad-v23.2.0-linux-amd64
curl -LO https://github.com/cosmos/gaia/releases/download/v24.0.0/gaiad-v24.0.0-linux-amd64
chmod a+x gaiad-v24.0.0-linux-amd64
mkdir build
mv ./gaiad-v23.2.0-linux-amd64 ./build/gaiadold
mv ./gaiad-v24.0.0-linux-amd64 ./build/gaiadold
if: env.GIT_DIFF
- name: Install New Gaiad
run: |
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ start-localnet-ci: build
./build/gaiad genesis gentx val 1000000000stake --home ~/.gaiad-liveness --chain-id liveness --keyring-backend test
./build/gaiad genesis collect-gentxs --home ~/.gaiad-liveness
sed -i.bak'' 's/minimum-gas-prices = ""/minimum-gas-prices = "0uatom"/' ~/.gaiad-liveness/config/app.toml
./build/gaiad start --home ~/.gaiad-liveness --x-crisis-skip-assert-invariants
./build/gaiad start --home ~/.gaiad-liveness

.PHONY: start-localnet-ci

Expand Down
5 changes: 3 additions & 2 deletions ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

gaiaerrors "github.com/cosmos/gaia/v24/types/errors"
gaiaerrors "github.com/cosmos/gaia/v25/types/errors"
)

// UseFeeMarketDecorator to make the integration testing easier: we can switch off its ante and post decorators with this flag
Expand All @@ -36,7 +37,7 @@ type HandlerOptions struct {
SignModeHandler *txsigning.HandlerMap
SigGasConsumer func(meter storetypes.GasMeter, sig signing.SignatureV2, params authtypes.Params) error

AccountKeeper feemarketante.AccountKeeper
AccountKeeper *authkeeper.AccountKeeper
BankKeeper feemarketante.BankKeeper
Codec codec.BinaryCodec
IBCkeeper *ibckeeper.Keeper
Expand Down
2 changes: 1 addition & 1 deletion ante/gov_vote_ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

gaiaerrors "github.com/cosmos/gaia/v24/types/errors"
gaiaerrors "github.com/cosmos/gaia/v25/types/errors"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions ante/gov_vote_ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"

"github.com/cosmos/gaia/v24/ante"
"github.com/cosmos/gaia/v24/app/helpers"
"github.com/cosmos/gaia/v25/ante"
"github.com/cosmos/gaia/v25/app/helpers"
)

// Test that the GovVoteDecorator rejects votes too deeply wrapped by MsgExec
Expand Down
33 changes: 11 additions & 22 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ import (
"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
feemarketkeeper "github.com/skip-mev/feemarket/x/feemarket/keeper"
"github.com/spf13/cast"

abci "github.com/cometbft/cometbft/abci/types"
tmjson "github.com/cometbft/cometbft/libs/json"
tmos "github.com/cometbft/cometbft/libs/os"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"

dbm "github.com/cosmos/cosmos-db"
Expand Down Expand Up @@ -62,25 +60,24 @@ import (
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/crisis"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"

"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

gaiaante "github.com/cosmos/gaia/v24/ante"
"github.com/cosmos/gaia/v24/app/keepers"
"github.com/cosmos/gaia/v24/app/upgrades"
v24 "github.com/cosmos/gaia/v24/app/upgrades/v24"
gaiaante "github.com/cosmos/gaia/v25/ante"
"github.com/cosmos/gaia/v25/app/keepers"
"github.com/cosmos/gaia/v25/app/upgrades"
v25 "github.com/cosmos/gaia/v25/app/upgrades/v25"
)

var (
// DefaultNodeHome default home directories for the application daemon
DefaultNodeHome string

Upgrades = []upgrades.Upgrade{v24.Upgrade}
Upgrades = []upgrades.Upgrade{v25.Upgrade}
)

var (
Expand All @@ -101,8 +98,6 @@ type GaiaApp struct { //nolint: revive
txConfig client.TxConfig
interfaceRegistry types.InterfaceRegistry

invCheckPeriod uint

// the module manager
mm *module.Manager
ModuleBasics module.BasicManager
Expand Down Expand Up @@ -154,10 +149,6 @@ func NewGaiaApp(
std.RegisterLegacyAminoCodec(legacyAmino)
std.RegisterInterfaces(interfaceRegistry)

// App Opts
skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants))
invCheckPeriod := cast.ToUint(appOpts.Get(server.FlagInvCheckPeriod))

bApp := baseapp.NewBaseApp(
appName,
logger,
Expand All @@ -176,7 +167,6 @@ func NewGaiaApp(
txConfig: txConfig,
appCodec: appCodec,
interfaceRegistry: interfaceRegistry,
invCheckPeriod: invCheckPeriod,
}

moduleAccountAddresses := app.ModuleAccountAddrs()
Expand All @@ -191,7 +181,6 @@ func NewGaiaApp(
app.BlockedModuleAccountAddrs(moduleAccountAddresses),
skipUpgradeHeights,
homePath,
invCheckPeriod,
logger,
appOpts,
wasmOpts,
Expand All @@ -208,7 +197,7 @@ func NewGaiaApp(

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

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

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

app.sm.RegisterStoreDecoders()

Expand All @@ -286,7 +275,7 @@ func NewGaiaApp(

anteHandler, err := gaiaante.NewAnteHandler(
gaiaante.HandlerOptions{
AccountKeeper: app.AccountKeeper,
AccountKeeper: &app.AccountKeeper,
BankKeeper: app.BankKeeper,
FeegrantKeeper: app.FeeGrantKeeper,
SignModeHandler: txConfig.SignModeHandler(),
Expand Down Expand Up @@ -354,13 +343,13 @@ func NewGaiaApp(

if loadLatest {
if err := app.LoadLatestVersion(); err != nil {
tmos.Exit(fmt.Sprintf("failed to load latest version: %s", err))
panic(fmt.Sprintf("failed to load latest version: %s", err))
}

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

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

if err := app.WasmClientKeeper.InitializePinnedCodes(ctx); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"

gaia "github.com/cosmos/gaia/v24/app"
gaiahelpers "github.com/cosmos/gaia/v24/app/helpers"
gaia "github.com/cosmos/gaia/v25/app"
gaiahelpers "github.com/cosmos/gaia/v25/app/helpers"
)

type EmptyAppOptions struct{}
Expand Down
3 changes: 0 additions & 3 deletions app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ func (app *GaiaApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs [
allowedAddrsMap[addr] = true
}

/* Just to be safe, assert the invariants on current state. */
app.CrisisKeeper.AssertInvariants(ctx)

/* Handle fee distribution state. */

// withdraw all validator commission
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"

gaiaapp "github.com/cosmos/gaia/v24/app"
gaiaapp "github.com/cosmos/gaia/v25/app"
)

// SimAppChainID hardcoded chainID for simulation
Expand Down
29 changes: 8 additions & 21 deletions app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ import (
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper"
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
Expand All @@ -89,9 +87,9 @@ import (
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

gaiaparams "github.com/cosmos/gaia/v24/app/params"
liquidkeeper "github.com/cosmos/gaia/v24/x/liquid/keeper"
liquidtypes "github.com/cosmos/gaia/v24/x/liquid/types"
gaiaparams "github.com/cosmos/gaia/v25/app/params"
liquidkeeper "github.com/cosmos/gaia/v25/x/liquid/keeper"
liquidtypes "github.com/cosmos/gaia/v25/x/liquid/types"
)

type AppKeepers struct {
Expand All @@ -109,9 +107,8 @@ type AppKeepers struct {
DistrKeeper distrkeeper.Keeper
LiquidKeeper *liquidkeeper.Keeper
GovKeeper *govkeeper.Keeper
CrisisKeeper *crisiskeeper.Keeper
UpgradeKeeper *upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
ParamsKeeper paramskeeper.Keeper //nolint:staticcheck
WasmKeeper wasmkeeper.Keeper
// IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
IBCKeeper *ibckeeper.Keeper
Expand Down Expand Up @@ -148,7 +145,6 @@ func NewAppKeeper(
blockedAddress map[string]bool,
skipUpgradeHeights map[int64]bool,
homePath string,
invCheckPeriod uint,
logger log.Logger,
appOpts servertypes.AppOptions,
wasmOpts []wasmkeeper.Option,
Expand Down Expand Up @@ -205,16 +201,6 @@ func NewAppKeeper(
logger,
)

appKeepers.CrisisKeeper = crisiskeeper.NewKeeper(
appCodec,
runtime.NewKVStoreService(appKeepers.keys[crisistypes.StoreKey]),
invCheckPeriod,
appKeepers.BankKeeper,
authtypes.FeeCollectorName,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
appKeepers.AccountKeeper.AddressCodec(),
)

appKeepers.AuthzKeeper = authzkeeper.NewKeeper(
runtime.NewKVStoreService(appKeepers.keys[authzkeeper.StoreKey]),
appCodec,
Expand Down Expand Up @@ -596,8 +582,10 @@ func (appKeepers *AppKeepers) GetSubspace(moduleName string) paramstypes.Subspac
}

// initParamsKeeper init params keeper and its subspaces
func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key, tkey storetypes.StoreKey) paramskeeper.Keeper {
paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey)
func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino, key,
tkey storetypes.StoreKey,
) paramskeeper.Keeper { //nolint:staticcheck
paramsKeeper := paramskeeper.NewKeeper(appCodec, legacyAmino, key, tkey) //nolint:staticcheck

// register the key tables for legacy param subspaces
keyTable := ibcclienttypes.ParamKeyTable()
Expand All @@ -609,7 +597,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(distrtypes.ModuleName).WithKeyTable(distrtypes.ParamKeyTable()) //nolint: staticcheck // SA1019
paramsKeeper.Subspace(slashingtypes.ModuleName).WithKeyTable(slashingtypes.ParamKeyTable()) //nolint: staticcheck // SA1019
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) //nolint: staticcheck // SA1019
paramsKeeper.Subspace(crisistypes.ModuleName).WithKeyTable(crisistypes.ParamKeyTable()) //nolint: staticcheck // SA1019
paramsKeeper.Subspace(ibcexported.ModuleName).WithKeyTable(keyTable)
paramsKeeper.Subspace(ibctransfertypes.ModuleName).WithKeyTable(ibctransfertypes.ParamKeyTable())
paramsKeeper.Subspace(icacontrollertypes.SubModuleName).WithKeyTable(icacontrollertypes.ParamKeyTable())
Expand Down
4 changes: 1 addition & 3 deletions app/keepers/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
minttypes "github.com/cosmos/cosmos-sdk/x/mint/types"
Expand All @@ -31,7 +30,7 @@ import (

wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"

liquidtypes "github.com/cosmos/gaia/v24/x/liquid/types"
liquidtypes "github.com/cosmos/gaia/v25/x/liquid/types"
)

func (appKeepers *AppKeepers) GenerateKeys() {
Expand All @@ -41,7 +40,6 @@ func (appKeepers *AppKeepers) GenerateKeys() {
authtypes.StoreKey,
banktypes.StoreKey,
stakingtypes.StoreKey,
crisistypes.StoreKey,
minttypes.StoreKey,
distrtypes.StoreKey,
slashingtypes.StoreKey,
Expand Down
Loading
Loading