Skip to content

fix: distribution precompile 32-byte withdraw address inflates native…#15

Closed
matteyu wants to merge 1 commit into
feat/v0.6.0from
fix/distribution-32byte-withdraw
Closed

fix: distribution precompile 32-byte withdraw address inflates native…#15
matteyu wants to merge 1 commit into
feat/v0.6.0from
fix/distribution-32byte-withdraw

Conversation

@matteyu

@matteyu matteyu commented Jun 11, 2026

Copy link
Copy Markdown

Description

Fixes the distribution-precompile 32-byte withdraw address supply-inflation bug. When a balance event's account is not exactly 20 bytes (e.g. a 32-byte bech32 withdraw, module, or CosmWasm contract account), common.BytesToAddress truncates it to the trailing 20 bytes, causing the StateDB commit to mint a duplicate balance and inflate native supply.

AfterBalanceChange now skips mirroring any non-20-byte account (isMirrorableEVMAddress guard) in the CoinSpent, CoinReceived, and FractionalBalanceChange cases, so only bijective SDK↔EVM accounts are mirrored.

Most critical to review: precompiles/common/balance_handler.go


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch — N/A: targets feat/v0.6.0 (the v0.6.0-fork.1 release lineage kiichain pins); a v0.6.0-fork.2 tag will follow

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8808e47f-690e-4177-a319-ae3783a2695e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/distribution-32byte-withdraw

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 and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants