Skip to content

feat: Revert "feat: Removed Gaia Liquid staking module"#429

Merged
pbukva merged 1 commit intofeat/cosmos_sdk_update_0_20_0from
revert-426-feat/remove_liquid_module
Mar 30, 2026
Merged

feat: Revert "feat: Removed Gaia Liquid staking module"#429
pbukva merged 1 commit intofeat/cosmos_sdk_update_0_20_0from
revert-426-feat/remove_liquid_module

Conversation

@pbukva
Copy link
Copy Markdown
Collaborator

@pbukva pbukva commented Mar 30, 2026

Reverts #426

@pbukva pbukva self-assigned this Mar 30, 2026
@pbukva pbukva merged commit 056f938 into feat/cosmos_sdk_update_0_20_0 Mar 30, 2026
2 checks passed
Comment on lines +132 to +135
return false
}
return false
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@pbukva pbukva deleted the revert-426-feat/remove_liquid_module branch March 30, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant