Skip to content

OSMO taker fee dust can be stranded in the non-native path #9643

@sueun-dev

Description

@sueun-dev

Reproduction

On the current main branch, run:

GOTOOLCHAIN=go1.23.4 GOWORK=off go test ./x/txfees/keeper -run TestKeeperTestSuite/TestOsmoTakerFeeDustRemainsInCollector -count=1

Before the fix, this fails because 1 uosmo of truncation dust disappears from taker_fee_collector instead of remaining there for the next epoch:

--- FAIL: TestKeeperTestSuite/TestOsmoTakerFeeDustRemainsInCollector
Error: Not equal:
expected: 1
actual  : 0
Messages: dust OSMO should remain in the taker fee collector for the next epoch

Problem

calculateDistributeAndTrackTakerFees handles the initial OSMO split first, but any base-denom dust left behind by truncation is still included in the later "non-native" cleanup path.

That means the leftover OSMO can be moved into TakerFeeStakersName and skipped by swapNonNativeFeeToDenom, which strands the funds instead of leaving them in TakerFeeCollectorName for the next epoch's OSMO distribution.

Expected behavior

Any base-denom dust left after the OSMO taker fee split should remain in TakerFeeCollectorName and be included in the next epoch, not routed through the non-native distribution flow.

Proposed fix

Exclude the base denom from the non-native taker fee path and add a regression test that covers a 1 uosmo dust case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Needs Triage 🔍

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions