Remove crisis module code and store#3510
Conversation
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.
PR SummaryHigh Risk Overview The main Operational impact: periodic and export-time invariant enforcement that could panic the chain is gone; operators lose Reviewed by Cursor Bugbot for commit 0001bf8. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3510 +/- ##
==========================================
- Coverage 59.30% 59.25% -0.06%
==========================================
Files 2127 2129 +2
Lines 175876 176767 +891
==========================================
+ Hits 104305 104745 +440
- Misses 62473 62888 +415
- Partials 9098 9134 +36
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
| @@ -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) | |||
There was a problem hiding this comment.
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).
| app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) | ||
| } | ||
|
|
||
| if (upgradeInfo.Name == "v6.6.0") && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { |
There was a problem hiding this comment.
Going forward since v6.5, upgrade names will follow v<major>.<minor> format. No more repetitive .0 suffix.
| if (upgradeInfo.Name == "v6.6.0") && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { | |
| if (upgradeInfo.Name == "v6.6") && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { |
| } | ||
| } | ||
| app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()) | ||
| return app.mm.InitGenesis(ctx, app.appCodec, genesisState, app.genesisImportConfig) |
There was a problem hiding this comment.
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.
|
|
||
| if (upgradeInfo.Name == "v6.6.0") && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { | ||
| storeUpgrades := storetypes.StoreUpgrades{ | ||
| Deleted: []string{crisisStoreKeyName}, |
There was a problem hiding this comment.
But there is no such key name and this would result in an error i believe.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0001bf8. Configure here.
| EvmKeeper: &app.EvmKeeper, | ||
| } | ||
| app.EndBlockKeepers = legacyabci.EndBlockKeepers{ | ||
| CrisisKeeper: &app.CrisisKeeper, |
There was a problem hiding this comment.
Streaming genesis panics on removed crisis module data
High Severity
Removing crisis from the module manager causes a nil-pointer panic in streaming genesis import. The streaming genesis path in the module manager directly indexes m.Modules[moduleName].InitGenesis(...) without checking existence. The existing chain genesis JSONs (arctic-1, atlantic-2, pacific-1) still contain "crisis" entries, so any node bootstrapping via streaming genesis from these files will panic when m.Modules["crisis"] returns nil. The non-streaming path safely skips unknown modules, but the streaming path does not.
Reviewed by Cursor Bugbot for commit 0001bf8. Configure here.
philipsu522
left a comment
There was a problem hiding this comment.
In the past, when updating some fields for modules I believe we saw some incompatibilities. For this particular PR, in the genesis file we see:
https://github.com/sei-protocol/chain-configs/blob/main/pacific-1/genesis.json#L715
We should probably test workflows like state sync'ing with the new binary and the genesis file


Summary
Test Plan