feat: Revert "feat: Removed Gaia Liquid staking module"#429
Merged
pbukva merged 1 commit intofeat/cosmos_sdk_update_0_20_0from Mar 30, 2026
Merged
Conversation
This reverts commit eb39fe4.
Comment on lines
+132
to
+135
| return false | ||
| } | ||
| return false | ||
| }) |
There was a problem hiding this comment.
Bug: Variable shadowing with := inside the IterateValidators callback causes errors from SetLiquidValidator to be silently ignored during the upgrade migration.
Severity: HIGH
Suggested Fix
To ensure errors are handled, either panic on error within the callback by using panic(err), which matches patterns elsewhere in the codebase, or capture the error in a closure variable declared outside the callback. This captured error can then be checked after the iteration completes.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: app/upgrades.go#L132-L135
Potential issue: In the v0.53 upgrade handler, a new `err` variable is declared within
the `IterateValidators` callback using `:=`, shadowing the outer `err` variable.
Consequently, any error returned from `app.LiquidKeeper.SetLiquidValidator` is assigned
to this inner variable and then discarded, as the callback does not propagate errors.
This causes the error to be silently swallowed. If `SetLiquidValidator` fails for any
validator during the one-time migration, that validator will lack a `LiquidValidator`
record, leading to incomplete data for the liquid staking module and potential runtime
issues post-upgrade.
Did we get this right? 👍 / 👎 to inform future reviews.
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.
Reverts #426