Skip to content

fix(ante): replace panic with safe return in GovVoteDecorator delegation loop - #358

Open
amathxbt wants to merge 1 commit into
KiiChain:mainfrom
amathxbt:fix/gov-vote-ante-panic-to-error
Open

fix(ante): replace panic with safe return in GovVoteDecorator delegation loop#358
amathxbt wants to merge 1 commit into
KiiChain:mainfrom
amathxbt:fix/gov-vote-ante-panic-to-error

Conversation

@amathxbt

@amathxbt amathxbt commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Bug: GovVoteDecorator.ValidateVoteMsgs called panic(err) when sdk.ValAddressFromBech32 failed inside the IterateDelegatorDelegations callback. If a single malformed validator address ends up in staking state, every governance vote transaction crashes the node, making governance permanently unusable — a denial-of-service via state corruption.

Fix: Return false from the iteration callback to skip the bad delegation and continue evaluating the rest.

Files changed

  • ante/gov_vote_ante.go

ValidateVoteMsgs panicked on sdk.ValAddressFromBech32 failure inside
IterateDelegatorDelegations. A single malformed validator address in state
would crash the node for every governance vote.

Fix: return false from the callback to skip the bad delegation.
@amathxbt
amathxbt requested a review from jhelison as a code owner July 6, 2026 12:10
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@amathxbt, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6e7f28d4-1164-452b-8b0a-983df96a4f23

📥 Commits

Reviewing files that changed from the base of the PR and between e0d3113 and f8563e9.

📒 Files selected for processing (1)
  • ante/gov_vote_ante.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ante/gov_vote_ante.go 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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