Skip to content

[pallet-assets] fix: decrement supply when refund burns balance#11441

Merged
bkchr merged 10 commits intoparitytech:masterfrom
clangenb:cl/do-refund-should-decrement-total-supply
Mar 24, 2026
Merged

[pallet-assets] fix: decrement supply when refund burns balance#11441
bkchr merged 10 commits intoparitytech:masterfrom
clangenb:cl/do-refund-should-decrement-total-supply

Conversation

@clangenb
Copy link
Copy Markdown
Contributor

@clangenb clangenb commented Mar 19, 2026

When a user calls refund with allow_burn = true, their token balance is destroyed, but the asset's total supply was never updated. This caused total_issuance() to overcount. The fix decrements supply and emits a Burned event, consistent with how every other burn path works.

In production, burning path is rarely triggered. The fungibles trait interface always passes allow_burn = false, so only users manually submitting the refund extrinsic with the burn flag would hit it.

Follow-up issue for migrating the discrepancy (observed on Westend): #11443.

Fixes #10412

@clangenb clangenb changed the title [assets] do refund should decrement the totatl suply if an account is… [pallet-assets] fix: decrement supply when refund burns balance Mar 19, 2026
@clangenb
Copy link
Copy Markdown
Contributor Author

/cmd label T1-frame T2-pallets

@clangenb
Copy link
Copy Markdown
Contributor Author

/cmd prdoc --audience runtime_dev --bump patch

@clangenb clangenb marked this pull request as ready for review March 19, 2026 12:42
@paritytech-cmd-bot-polkadot-sdk paritytech-cmd-bot-polkadot-sdk Bot added T1-FRAME This PR/Issue is related to core FRAME, the framework. T2-pallets This PR/Issue is related to a particular pallet. labels Mar 19, 2026
@clangenb
Copy link
Copy Markdown
Contributor Author

/cmd fmt

@clangenb clangenb marked this pull request as draft March 19, 2026 13:15
@clangenb
Copy link
Copy Markdown
Contributor Author

/cmd prdoc --audience runtime_dev --bump patch --force

@bkchr bkchr requested a review from ggwpez March 20, 2026 22:22
@clangenb
Copy link
Copy Markdown
Contributor Author

@ggwpez may I ask you to take a look at this. I think it is an important PR that should make it into the new release, and maybe even backported.

Copy link
Copy Markdown
Contributor

@sigurpol sigurpol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sigurpol sigurpol added the A4-backport-stable2603 Pull request must be backported to the stable2603 release branch label Mar 24, 2026
@sigurpol
Copy link
Copy Markdown
Contributor

@ggwpez may I ask you to take a look at this. I think it is an important PR that should make it into the new release, and maybe even backported.

I've added the backport to 2603 label, makes sense to backport imho.

@bkchr bkchr enabled auto-merge March 24, 2026 15:21
@bkchr bkchr added this pull request to the merge queue Mar 24, 2026
Merged via the queue into paritytech:master with commit 44f9788 Mar 24, 2026
249 of 250 checks passed
@paritytech-release-backport-bot
Copy link
Copy Markdown

Successfully created backport PR for stable2603:

paritytech-release-backport-bot Bot pushed a commit that referenced this pull request Mar 24, 2026
When a user calls `refund` with `allow_burn = true`, their token balance
is destroyed, but the asset's total supply was never updated. This
caused `total_issuance()` to overcount. The fix decrements supply and
emits a `Burned` event, consistent with how every other burn path works.

In production, burning path is rarely triggered. The fungibles trait
interface always passes `allow_burn = false`, so only users manually
submitting the refund extrinsic with the burn flag would hit it.

Follow-up issue for migrating the discrepancy (observed on Westend):
#11443.

Fixes #10412

---------

Co-authored-by: clangenb <clangenb@users.noreply.github.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 44f9788)
EgorPopelyaev pushed a commit that referenced this pull request Mar 25, 2026
Backport #11441 into `stable2603` from clangenb.

See the
[documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md)
on how to use this bot.

<!--
  # To be used by other automation, do not modify:
  original-pr-number: #${pull_number}
-->

Co-authored-by: clangenb <37865735+clangenb@users.noreply.github.com>
Co-authored-by: clangenb <clangenb@users.noreply.github.com>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A4-backport-stable2603 Pull request must be backported to the stable2603 release branch T1-FRAME This PR/Issue is related to core FRAME, the framework. T2-pallets This PR/Issue is related to a particular pallet.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

pallet-assets: do_refund destroys account balance without decrementing asset supply

4 participants