Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
35 changes: 11 additions & 24 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,6 @@ import (
"github.com/sei-protocol/sei-chain/sei-cosmos/x/capability"
capabilitykeeper "github.com/sei-protocol/sei-chain/sei-cosmos/x/capability/keeper"
capabilitytypes "github.com/sei-protocol/sei-chain/sei-cosmos/x/capability/types"
"github.com/sei-protocol/sei-chain/sei-cosmos/x/crisis"
crisiskeeper "github.com/sei-protocol/sei-chain/sei-cosmos/x/crisis/keeper"
crisistypes "github.com/sei-protocol/sei-chain/sei-cosmos/x/crisis/types"
distr "github.com/sei-protocol/sei-chain/sei-cosmos/x/distribution"
distrclient "github.com/sei-protocol/sei-chain/sei-cosmos/x/distribution/client"
distrkeeper "github.com/sei-protocol/sei-chain/sei-cosmos/x/distribution/keeper"
Expand Down Expand Up @@ -166,7 +163,6 @@ import (
tokenfactorymodule "github.com/sei-protocol/sei-chain/x/tokenfactory"
tokenfactorykeeper "github.com/sei-protocol/sei-chain/x/tokenfactory/keeper"
tokenfactorytypes "github.com/sei-protocol/sei-chain/x/tokenfactory/types"
"github.com/spf13/cast"
dbm "github.com/tendermint/tm-db"
"go.opentelemetry.io/otel/attribute"
otelmetric "go.opentelemetry.io/otel/metric"
Expand Down Expand Up @@ -229,7 +225,6 @@ var (
distr.AppModuleBasic{},
gov.NewAppModuleBasic(getGovProposalHandlers()...),
params.AppModuleBasic{},
crisis.AppModuleBasic{},
slashing.AppModuleBasic{},
feegrantmodule.AppModuleBasic{},
ibc.AppModuleBasic{},
Expand Down Expand Up @@ -389,8 +384,6 @@ type App struct {
appCodec codec.Codec
interfaceRegistry types.InterfaceRegistry

invCheckPeriod uint

// keys to access the substores
keys map[string]*sdk.KVStoreKey
tkeys map[string]*sdk.TransientStoreKey
Expand All @@ -407,7 +400,6 @@ type App struct {
MintKeeper mintkeeper.Keeper
DistrKeeper distrkeeper.Keeper
GovKeeper govkeeper.Keeper
CrisisKeeper crisiskeeper.Keeper
UpgradeKeeper upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
Expand Down Expand Up @@ -504,7 +496,7 @@ func New(
_ bool,
skipUpgradeHeights map[int64]bool,
homePath string,
invCheckPeriod uint,
_ uint,
enableCustomEVMPrecompiles bool,
tmConfig *tmcfg.Config,
encodingConfig appparams.EncodingConfig,
Expand Down Expand Up @@ -539,7 +531,6 @@ func New(
cdc: cdc,
appCodec: appCodec,
interfaceRegistry: interfaceRegistry,
invCheckPeriod: invCheckPeriod,
keys: keys,
tkeys: tkeys,
memKeys: memKeys,
Expand Down Expand Up @@ -597,9 +588,6 @@ func New(
app.SlashingKeeper = slashingkeeper.NewKeeper(
appCodec, keys[slashingtypes.StoreKey], &stakingKeeper, app.GetSubspace(slashingtypes.ModuleName),
)
app.CrisisKeeper = crisiskeeper.NewKeeper(
app.GetSubspace(crisistypes.ModuleName), invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName,
)

app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper)
app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp)
Expand Down Expand Up @@ -869,12 +857,6 @@ func New(
app.EvmKeeper.SetCustomPrecompiles(customPrecompiles, LatestUpgrade)
}

/**** Module Options ****/

// NOTE: we may consider parsing `appOpts` inside module constructors. For the moment
// we prefer to be more strict in what arguments the modules expect.
skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants))

// NOTE: Any module instantiated in the module manager that is later modified
// must be passed by reference here.

Expand All @@ -888,7 +870,6 @@ func New(
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper),
capability.NewAppModule(appCodec, *app.CapabilityKeeper),
feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
crisis.NewAppModule(&app.CrisisKeeper, skipGenesisInvariants),
gov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper),
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper),
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
Expand Down Expand Up @@ -920,7 +901,6 @@ func New(
EvmKeeper: &app.EvmKeeper,
}
app.EndBlockKeepers = legacyabci.EndBlockKeepers{
CrisisKeeper: &app.CrisisKeeper,
GovKeeper: &app.GovKeeper,
StakingKeeper: &app.StakingKeeper,
OracleKeeper: &app.OracleKeeper,
Expand Down Expand Up @@ -967,7 +947,6 @@ func New(
govtypes.ModuleName,
minttypes.ModuleName,
vestingtypes.ModuleName,
crisistypes.ModuleName,
ibchost.ModuleName,
genutiltypes.ModuleName,
evidencetypes.ModuleName,
Expand All @@ -982,7 +961,6 @@ func New(
// this line is used by starport scaffolding # stargate/app/initGenesis
)

app.mm.RegisterInvariants(&app.CrisisKeeper)
app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino)
app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter())
app.mm.RegisterServices(app.configurator)
Expand Down Expand Up @@ -1164,6 +1142,7 @@ func (app *App) SetStoreUpgradeHandlers() {
}

accesscontrolStoreKeyName := "aclaccesscontrol"
crisisStoreKeyName := "crisis"

if upgradeInfo.Name == "1.0.4beta" && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
storeUpgrades := storetypes.StoreUpgrades{
Expand Down Expand Up @@ -1235,6 +1214,15 @@ func (app *App) SetStoreUpgradeHandlers() {
// configure store loader that checks if version == upgradeHeight and applies store upgrades
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
}

if (upgradeInfo.Name == "v6.6.0") && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going forward since v6.5, upgrade names will follow v<major>.<minor> format. No more repetitive .0 suffix.

Suggested change
if (upgradeInfo.Name == "v6.6.0") && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
if (upgradeInfo.Name == "v6.6") && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {

storeUpgrades := storetypes.StoreUpgrades{
Deleted: []string{crisisStoreKeyName},
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But there is no such key name and this would result in an error i believe.

}

// configure store loader that checks if version == upgradeHeight and applies store upgrades
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
}
Comment thread
cursor[bot] marked this conversation as resolved.
}

// AppName returns the name of the App
Expand Down Expand Up @@ -2865,7 +2853,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(distrtypes.ModuleName)
paramsKeeper.Subspace(slashingtypes.ModuleName)
paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable())
paramsKeeper.Subspace(crisistypes.ModuleName)
paramsKeeper.Subspace(ibctransfertypes.ModuleName)
paramsKeeper.Subspace(ibchost.ModuleName)
paramsKeeper.Subspace(oracletypes.ModuleName)
Expand Down
3 changes: 0 additions & 3 deletions app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,6 @@ func (app *App) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []str
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
4 changes: 0 additions & 4 deletions app/legacyabci/end_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package legacyabci

import (
sdk "github.com/sei-protocol/sei-chain/sei-cosmos/types"
"github.com/sei-protocol/sei-chain/sei-cosmos/x/crisis"
crisiskeeper "github.com/sei-protocol/sei-chain/sei-cosmos/x/crisis/keeper"
"github.com/sei-protocol/sei-chain/sei-cosmos/x/gov"
govkeeper "github.com/sei-protocol/sei-chain/sei-cosmos/x/gov/keeper"
"github.com/sei-protocol/sei-chain/sei-cosmos/x/staking"
Expand All @@ -15,15 +13,13 @@ import (
)

type EndBlockKeepers struct {
CrisisKeeper *crisiskeeper.Keeper
GovKeeper *govkeeper.Keeper
StakingKeeper *stakingkeeper.Keeper
OracleKeeper *oraclekeeper.Keeper
EvmKeeper *evmkeeper.Keeper
}

func EndBlock(ctx sdk.Context, height int64, blockGasUsed int64, keepers EndBlockKeepers) []abci.ValidatorUpdate {
crisis.EndBlocker(ctx, *keepers.CrisisKeeper)
gov.EndBlocker(ctx, *keepers.GovKeeper)
vals := staking.EndBlocker(ctx, *keepers.StakingKeeper)
oracle.EndBlocker(ctx, *keepers.OracleKeeper)
Expand Down
5 changes: 1 addition & 4 deletions cmd/seid/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
authcmd "github.com/sei-protocol/sei-chain/sei-cosmos/x/auth/client/cli"
"github.com/sei-protocol/sei-chain/sei-cosmos/x/auth/types"
banktypes "github.com/sei-protocol/sei-chain/sei-cosmos/x/bank/types"
"github.com/sei-protocol/sei-chain/sei-cosmos/x/crisis"
genutilcli "github.com/sei-protocol/sei-chain/sei-cosmos/x/genutil/client/cli"
seidbconfig "github.com/sei-protocol/sei-chain/sei-db/config"
tmcfg "github.com/sei-protocol/sei-chain/sei-tendermint/config"
Expand Down Expand Up @@ -219,9 +218,7 @@ func txCommand() *cobra.Command {
return cmd
}

func addModuleInitFlags(startCmd *cobra.Command) {
crisis.AddModuleInitFlags(startCmd)
}
func addModuleInitFlags(_ *cobra.Command) {}

// newApp creates a new Cosmos SDK app
func newApp(
Expand Down
1 change: 0 additions & 1 deletion docker/localnode/scripts/step2_genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ override_genesis() {
cat ~/.sei/config/genesis.json | jq "$1" > ~/.sei/config/tmp_genesis.json && mv ~/.sei/config/tmp_genesis.json ~/.sei/config/genesis.json;
}

override_genesis '.app_state["crisis"]["constant_fee"]["denom"]="usei"'
override_genesis '.app_state["mint"]["params"]["mint_denom"]="usei"'
override_genesis '.app_state["staking"]["params"]["bond_denom"]="usei"'
override_genesis '.app_state["oracle"]["params"]["vote_period"]="2"'
Expand Down
2 changes: 1 addition & 1 deletion scripts/dump_app_state_for_height.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fi
cd $HOME
sudo rm -r state_$HEIGHT
mkdir state_$HEIGHT
for key in wasm oracle epoch mint acc bank crisis feegrant staking distribution slashing gov params ibc upgrade evidence transfer tokenfactory
for key in wasm oracle epoch mint acc bank feegrant staking distribution slashing gov params ibc upgrade evidence transfer tokenfactory
do
$HOME/go/bin/iaviewer data $HOME/.sei/data/application.db "s/k:"$key"/" $HEIGHT > $HOME/state_$HEIGHT/$key.data
$HOME/go/bin/iaviewer shape $HOME/.sei/data/application.db "s/k:"$key"/" $HEIGHT > $HOME/state_$HEIGHT/$key.shape
Expand Down
17 changes: 0 additions & 17 deletions sei-cosmos/proto/cosmos/crisis/v1beta1/genesis.proto

This file was deleted.

25 changes: 0 additions & 25 deletions sei-cosmos/proto/cosmos/crisis/v1beta1/tx.proto

This file was deleted.

1 change: 0 additions & 1 deletion sei-cosmos/x/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Here are some production-grade modules that can be used in Cosmos SDK applicatio
- [Authz](authz/spec/README.md) - Authorization for accounts to perform actions on behalf of other accounts.
- [Bank](bank/spec/README.md) - Token transfer functionalities.
- [Capability](capability/spec/README.md) - Object capability implementation.
- [Crisis](crisis/spec/README.md) - Halting the blockchain under certain circumstances (e.g. if an invariant is broken).
- [Distribution](distribution/spec/README.md) - Fee distribution, and staking token provision distribution.
- [Evidence](evidence/spec/README.md) - Evidence handling for double signing, misbehaviour, etc.
- [Governance](gov/spec/README.md) - On-chain proposals and voting.
Expand Down
21 changes: 0 additions & 21 deletions sei-cosmos/x/crisis/abci.go

This file was deleted.

60 changes: 0 additions & 60 deletions sei-cosmos/x/crisis/client/cli/tx.go

This file was deleted.

18 changes: 0 additions & 18 deletions sei-cosmos/x/crisis/client/testsuite/cli_test.go

This file was deleted.

Loading
Loading