Fix consensus failure on SDK 0.47→0.50 binary upgrade - #32
Merged
Conversation
Integrate SDK 0.50 AutoCLI to generate query commands for all core modules (auth, bank, staking, distribution, gov, slashing, mint, params, feegrant, authz, evidence, upgrade). Uses ModuleOptions with static proto descriptors from zero-value AppModule instances to avoid nil keeper panics. Wasm module uses Modules map for custom command detection. All 19 query subcommands now available. Co-authored-by: vNodesV <100853686+vNodesV@users.noreply.github.com>
Co-authored-by: vNodesV <100853686+vNodesV@users.noreply.github.com>
Enable all module query commands via AutoCLI integration
…ler for SDK 0.47→0.50 migration The consensus failure occurred because the chain database was in SDK 0.47 format (params in x/params subspaces) but SDK 0.50 reads from collections storage. Changes: - Add consensus module to module manager for proper registration - Add PreBlocker (required by SDK 0.50 upgrade module) - Create upgrade handler (v2-sdk50) that migrates consensus params from x/params baseapp subspace to x/consensus collections store, and runs all module migrations (mint, staking, slashing, etc.) - Add store loader for new store keys (Consensus, crisis) - Add missing crisis store key to NewKVStoreKeys - Register baseapp Paramspace in initParamsKeeper for consensus params migration Co-authored-by: vNodesV <100853686+vNodesV@users.noreply.github.com>
Co-authored-by: vNodesV <100853686+vNodesV@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Investigate and fix the consensus failure issue
Fix consensus failure on SDK 0.47→0.50 binary upgrade
Feb 11, 2026
vNodesV
changed the base branch from
copilot/investigate-command-module-loss
to
main
February 11, 2026 20:53
vNodesV
marked this pull request as ready for review
February 11, 2026 20:54
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Chain panics with
CONSENSUS FAILUREwhen swapping the 0.47.x binary for 0.50.x because module params (consensus, mint, etc.) are still inx/paramssubspaces but SDK 0.50 reads fromcollectionsstorage, which is empty.Changes
app/app.goconsensus.NewAppModulein module manager — was initialized but never registered, so its gRPC services and migration hooks were inactivePreBlockercallingmm.PreBlock()— required by SDK 0.50 for the upgrade module to detect and execute upgrade planscrisistypes.StoreKeytoNewKVStoreKeys— was used by crisis keeper but never allocatedbaseapp.Paramspacesubspace withConsensusParamsKeyTableininitParamsKeeper— enables reading legacy consensus params during migrationRegisterUpgradeHandlers()beforeLoadLatestVersionapp/upgrades.go(new)v2-sdk50that:x/params"baseapp" subspace →x/consensuscollections viabaseapp.MigrateParams()mm.RunMigrations()(mint v1→v2, staking v4→v5, slashing v3→v4, etc.)UpgradeStoreLoaderwithAdded: ["Consensus", "crisis"]for store keys new in SDK 0.50Upgrade procedure
The
PreBlockerdetects the plan, runs the handler, migrates all params, and the chain continues.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.