Conversation
Contributor
|
PR author is not in the allowed authors list. |
kriss39
force-pushed
the
fix/ante-fee-recipient-global
branch
from
September 13, 2026 20:12
0d8cbc0 to
9ad9d88
Compare
kriss39
force-pushed
the
fix/ante-fee-recipient-global
branch
from
September 14, 2026 08:46
9ad9d88 to
8f265eb
Compare
… module DeductFees sent fees to the package-level FeeRecipientModule, and every NewDeductFeeDecorator call reset that global to fee_collector. An app that builds more than one ante chain (a common pattern) therefore had the recipient of a decorator configured with WithFeeRecipientModule silently overwritten, either sending the fees to fee_collector (which the PoA module turns into a panic at height 1) or, in the other construction order, sending every chain's fees to the custom module. Route the decorator's own deduction through its feeRecipientModule field and stop resetting the global in the constructor; the global keeps its fee_collector default and is still updated by WithFeeRecipientModule so the exported DeductFees helper and the PoA startup check keep working.
Author
|
Replaced the commit with a signed one (0a4d4e1, same content) so it shows as Verified; the force-push briefly auto-closed the PR, reopened. |
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.
Description
DeductFeeDecoratordeducts fees through the exportedDeductFeeshelper, which sends them to the package-levelFeeRecipientModule, and everyNewDeductFeeDecoratorcall reset that global back tofee_collector. The decorator's ownfeeRecipientModulefield (set byWithFeeRecipientModule) was only used for the "module account exists" check, not for the actual transfer.Any app that constructs more than one
DeductFeeDecorator(a second ante chain, a separate chain for a tx type, tests) therefore had a decorator configured viaWithFeeRecipientModulesilently overridden:poafirst, plain decorator second → thepoadecorator sends fees tofee_collector. The PoA module turns this into a panic at height 1 (validateFeeRecipient), i.e. the chain cannot start.poadecorator second → every chain's fees go topoa.Changes
checkDeductFeenow deducts todfd.feeRecipientModule(new unexporteddeductFeesToModule).NewDeductFeeDecoratorno longer resetsFeeRecipientModule. The global keeps itsfee_collectordefault and is still updated byWithFeeRecipientModule, so the exportedDeductFeeshelper and the PoA startup check behave as before for correctly configured apps.TestDeductFees_RecipientNotClobberedByLaterDecorator: constructs a decorator withWithFeeRecipientModule("mint"), then a plain one, and asserts the first still deducts tomint. Fails onmainwithUnexpected call ... "fee_collector".x/auth/anteandenterprise/poatests pass.