Skip to content

Conversation

@sigurpol
Copy link
Contributor

@sigurpol sigurpol commented Dec 8, 2025

📝 Summary

This PR introduces the foundation for the Dynamic Allocation Pool (DAP) system:

  1. FundingSink trait (frame-support): A new trait for returning funds to an issuance system.
    Implementations can either burn directly (DirectBurn) or return to a buffer for reuse.

  2. pallet-dap: A new pallet that implements FundingSink by collecting funds into a buffer
    account instead of burning them. The buffer account is created via inc_providers at genesis
    or on runtime upgrade, ensuring it can receive any amount including those below ED.

  3. AssetHub Westend integration: The runtime now uses pallet-dap to redirect dtaking slashes to the DAP buffer (via SlashToDap)

Treasury burns are now disabled so no need to integrate with DAP: treasury Burn parameter is set
to zero in Westend RC, AssetHub and collective runtimes. This means no treasury funds are burned at
the end of spend periods, preserving total issuance.

NOTE: User-initiated burns (via pallet_balances::burn extrinsic) do NOT go through DAP currently but they burn directly instead, reducing total issuance immediately. This is because pallet_balances::BurnDestination in the related pallet's Config is commented out.
In the moment we uncomment it, we will introduce a breaking change forcing:

  • Runtimes integrating with DAP to specify DAP as BurnDestination (this makes the burn extrinsic redirect to DAP).
  • All other runtimes will use BurnDestination = DirectBurn<Runtime> (this makes the burn extrinsic actually burn tokens so same behavior as before).
    This was not included in this PR to keep the scope limited, especially since user-initiated burns are rare events.

🔜 Coming soon

This is the first deliverable of the DAP system. Future PRs will include:

  • A configurable destination for user-initiated burns
  • A pallet-dap-satellite for system chains
  • Integration with other Westend system chains
  • XCM-based fund transfers from satellites to the DAP buffer
  • A FundingSource trait to pull funds from DAP, enabling the replacement of direct minting with requests for funds from the DAP buffer
  • DAP's responsibility to mint according to the issuance curve defined for each chain
  • The ability to configure the percentage of funds redirected from DAP to various destinations (validators, nominators, treasury, collators, etc.)
  • Support for multiple assets in DAP, including native tokens and stablecoins

🐛 Related issue

Close #10485 .

📖 Related links

Introduce an initial version of the Dynamic Allocation Pool (DAP).
It makes possible  to collect funds that would otherwise be burned, into
the DAP buffer on AssetHub.

On Westend AssetHub:
- Treasury unspent and staking slashes are now redirected to the DAP buffer
instead of being burned.
- All user-initiated burns also go to the DAP buffer instead of reducing
total issuance.

Events:
- FundsReturned is emitted only for explicit user actions (e.g., burn extrinsic
via FundingSink).
Automatic system operations like fee handling and slashes via OnUnbalanced do
NOT emit events to avoid bloating blocks with tons of events per block.
@sigurpol sigurpol requested a review from a team as a code owner December 8, 2025 22:28
@sigurpol sigurpol added the T2-pallets This PR/Issue is related to a particular pallet. label Dec 8, 2025
This is done in order to reduce the scope of the initial changes. We
comment out the BurnDestination from pallet-balances config so that we
avoid to introduce a breaking change for all runtimes.
This is initially acceptable since burn extrinsic is rarely used.
@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/20057722693
Failed job name: test-linux-stable-no-try-runtime

@sigurpol sigurpol added A4-backport-stable2509 Pull request must be backported to the stable2509 release branch A4-backport-stable2512 Pull request must be backported to the stable2512 release branch labels Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A4-backport-stable2509 Pull request must be backported to the stable2509 release branch A4-backport-stable2512 Pull request must be backported to the stable2512 release branch T2-pallets This PR/Issue is related to a particular pallet.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pallet-dap: Initial basic support for returning funds + treasury burning / staking slashing to DAP

2 participants