Skip to content

Remove crisis module code and store#3510

Open
codchen wants to merge 3 commits into
mainfrom
codex/remove-crisis-app-module
Open

Remove crisis module code and store#3510
codchen wants to merge 3 commits into
mainfrom
codex/remove-crisis-app-module

Conversation

@codchen
Copy link
Copy Markdown
Collaborator

@codchen codchen commented May 27, 2026

Summary

  • remove x/crisis from the Sei app wiring and delete the sei-cosmos/x/crisis module plus its crisis protobuf definitions
  • keep only the literal crisis store key in the upgrade store loader and delete the crisis KVStore at the v6.6.0 upgrade height
  • remove stale crisis wiring from wasmd/simapp test harnesses, local genesis setup, state-dump tooling, and module lists

Test Plan

  • go test ./app
  • go test ./app ./app/legacyabci ./cmd/seid/cmd ./sei-wasmd/app ./sei-wasmd/x/wasm/keeper ./sei-ibc-go/testing/simapp/... ./sei-db/tools/cmd/seidb/operations
  • 4-node Docker upgrade test: started the pre-removal parent binary 5ac709d, let the chain run, passed the software upgrade at height 306, restarted all validators on the crisis-deletion binary, and verified all nodes reached height 366 with catching_up=false and matching app hash 60C93CD1D72AD425D3FD862D115D722B098FEC48A28FD795C466807403F4648A

Drop x/crisis from the Sei app module manager, init-genesis order, end blocker, invariant registration, init flags, and app-owned keeper state. Crisis has no dedicated mounted KV store in app/app.go, so the rootmulti store key list is unchanged.

Also decouple crisis package tests from the full app now that App no longer exposes CrisisKeeper.

Tested with: go test ./app ./app/legacyabci ./cmd/seid/cmd ./sei-cosmos/x/crisis/...

Upgrade tested with a 4-node Docker cluster: started from the pre-removal binary, passed software upgrade v99.0.1-crisis-removal at height 342, restarted all validators on the removal binary, and verified all nodes reached height 514 with catching_up=false and matching app hash A53F9F78B05C8F6C07247186EF5BFB89D5BCFE7535AE52E54895B57E1844485E.
@cursor
Copy link
Copy Markdown

cursor Bot commented May 27, 2026

PR Summary

High Risk
Dropping a Cosmos module and deleting its KV store at upgrade height is consensus-critical; a bad upgrade height or store key would halt or corrupt nodes.

Overview
This PR removes the Cosmos x/crisis module from Sei and related apps: the keeper, module manager wiring, end-block invariant checks, genesis/export invariant assertions, params subspace, CLI init flags, and the entire sei-cosmos/x/crisis tree (including protos and docs).

On-chain cleanup is scheduled for upgrade v6.6.0, which deletes the crisis KV store via StoreUpgrades.Deleted (same pattern as prior store removals). The invCheckPeriod argument to New is retained in signatures but ignored.

Harness and ops updates drop crisis from local genesis overrides, state dump / seidb module lists, and wasmd / IBC simapp wiring so tests and tooling match the main app.

Reviewed by Cursor Bugbot for commit 4972f18. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 28, 2026, 5:24 AM

@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

❌ Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.25%. Comparing base (5ac709d) to head (4972f18).
⚠️ Report is 45 commits behind head on main.

Files with missing lines Patch % Lines
app/app.go 20.00% 3 Missing and 1 partial ⚠️
cmd/seid/cmd/root.go 0.00% 1 Missing ⚠️
sei-ibc-go/testing/simapp/app.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3510      +/-   ##
==========================================
- Coverage   59.30%   59.25%   -0.06%     
==========================================
  Files        2127     2129       +2     
  Lines      175876   176696     +820     
==========================================
+ Hits       104305   104700     +395     
- Misses      62473    62868     +395     
- Partials     9098     9128      +30     
Flag Coverage Δ
sei-chain-pr 49.47% <25.00%> (?)
sei-db 70.62% <ø> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
app/export.go 0.00% <ø> (ø)
app/legacyabci/end_block.go 100.00% <ø> (ø)
sei-ibc-go/testing/simapp/export.go 0.00% <ø> (ø)
sei-ibc-go/testing/simapp/simd/cmd/root.go 66.87% <100.00%> (-0.21%) ⬇️
sei-wasmd/app/app.go 84.07% <ø> (-0.51%) ⬇️
sei-wasmd/app/export.go 12.24% <ø> (+0.12%) ⬆️
cmd/seid/cmd/root.go 25.09% <0.00%> (+0.09%) ⬆️
sei-ibc-go/testing/simapp/app.go 76.31% <0.00%> (-1.08%) ⬇️
app/app.go 64.59% <20.00%> (-4.81%) ⬇️

... and 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codchen codchen changed the title Remove crisis module from app wiring Remove crisis module code and store May 28, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f76f011. Configure here.

Comment thread app/app.go
@@ -170,8 +169,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
rootCmd.AddCommand(server.RosettaCommand(encodingConfig.InterfaceRegistry, encodingConfig.Marshaler))
}

func addModuleInitFlags(startCmd *cobra.Command) {
crisis.AddModuleInitFlags(startCmd)
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.

This would break the startup for anyone setting the flag.

Perhaps a more graceful approach is to print a WARNING saying this is noop, and flag will be removed in the next release.

Alternatively a more meaningful fatal error to point them to some TBD comms (e.g. release notes) that would explain the module removal).

Comment thread app/app.go
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) {

Comment thread app/app.go
}
}
app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
return app.mm.InitGenesis(ctx, app.appCodec, genesisState, app.genesisImportConfig)
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.

Genesis JSON import skips over unknown module names. but streaming genesis would i think panic because it seem to directly index modules by name and proceed to initialise.

If I haven't missed anything, we would then need to skip over removed modules here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants