fix: guard v47 upgrade fee bypass#13
Open
jamilahmadzai wants to merge 1 commit into
Open
Conversation
abubakaradamusadiq848-glitch
approved these changes
Jun 21, 2026
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.
Summary
Closes #11.
Related: openmetaearth/me-hub#1237.
This patch closes the practical exploit chain around the v47 balance reset and the free-gas ante handler:
resetExponent()only mints the precision-adjustment balances onceMsgCheckIn+ paid-message case that previously bypassed feesWhy
The previous ante logic looked only at the first message and then stopped. A transaction could put
MsgCheckInfirst and append a fee-bearing message behind it, causing the whole transaction to skip fee checks and fee deduction.The v47 upgrade balance reset also had no committed on-chain completion marker. If the handler were re-entered after the original upgrade completed, the minting portion could run again. The new marker makes that portion idempotent while still allowing the first legitimate v47 run to complete normally.
This intentionally does not change governance timing or the broader ante decorator stack in the same PR, since those are policy-level changes with a larger compatibility surface.
Validation
gofmt -w app/fee_deduct.go app/fee_deduct_test.go app/upgrade_v47.gogit diff --checkgo test ./appwas attempted locally. The repo requires sibling replacements forst-chain/cosmos-sdk-0.46.0andst-chain/wasmd-v0.41.0as documented in.github/workflows/build_me.yaml, but those forks are not publicly accessible from my environment, so local compilation cannot reach project code.Bounty payout
Meta Earth / OpenMetaEarth bug bounty payout:
$MECvia ME Pass.Wallet:
me1ya82w6cjflk9r2qeyfeu64sm7gxtfr7mu62w9j