Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b95fb06
pallet-dap: treasury burns / slashing into DAP
sigurpol Nov 25, 2025
e7ee10a
prdoc
sigurpol Dec 8, 2025
565c6b8
clippy
sigurpol Dec 8, 2025
b948817
pallet-dap: make user-initiated burns burn token
sigurpol Dec 9, 2025
e6f6243
clippy
sigurpol Dec 9, 2025
8216f8b
pallet-dap: make PalletId configurable by runtime
sigurpol Dec 9, 2025
708685e
pallet-dap: fix warning
sigurpol Dec 9, 2025
b7fab2e
pallet-dap: make return_funds infallible
sigurpol Dec 9, 2025
1203b8f
pallet-dap: rename return_funds into fill
sigurpol Dec 9, 2025
b4d2125
Improve prdoc
sigurpol Dec 9, 2025
73b1fcc
ahm-test: verify that slashed funds are sent to DAP and not burned.
sigurpol Dec 9, 2025
3a62099
pallet-treasury: test burn to DAP scenario
sigurpol Dec 9, 2025
164732f
westend runtimes: remove treasury burn
sigurpol Dec 9, 2025
acd52bb
zepter
sigurpol Dec 9, 2025
2ff0830
Merge branch 'master' into sigurpol-dap-no-treasury-burn
sigurpol Dec 10, 2025
03b602c
Fix typo in documentation
sigurpol Dec 10, 2025
3471b46
Merge branch 'master' into sigurpol-dap-no-treasury-burn
sigurpol Dec 10, 2025
32e5583
asset-hub-westend: cleaner way to remove treasury burns
sigurpol Dec 10, 2025
b8e8645
Introduce dap-satellite + BurnDestination in pallet-balances's Config
sigurpol Dec 10, 2025
29a228d
prdoc
sigurpol Dec 10, 2025
ec647a7
pallet-dap-satellite: add more tests
sigurpol Dec 10, 2025
264da35
coretime-westend: integrate OnRevenue with DAP satellite
sigurpol Dec 10, 2025
c2f1fc2
Fix couple of test runtimes
sigurpol Dec 10, 2025
e39b961
Fix nis mock runtime
sigurpol Dec 10, 2025
ae02893
fix CI
sigurpol Dec 10, 2025
5025686
pallet-balances: introduce BurnHandler trait for configurable burn be…
sigurpol Dec 10, 2025
ebc0ce3
asset-conversion: fix tests
sigurpol Dec 11, 2025
8a47d50
fix parachain mock runtime
sigurpol Dec 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ members = [
"substrate/frame/contracts/uapi",
"substrate/frame/conviction-voting",
"substrate/frame/core-fellowship",
"substrate/frame/dap",
"substrate/frame/dap-satellite",
"substrate/frame/delegated-staking",
"substrate/frame/democracy",
"substrate/frame/derivatives",
Expand Down Expand Up @@ -984,6 +986,8 @@ pallet-contracts-proc-macro = { path = "substrate/frame/contracts/proc-macro", d
pallet-contracts-uapi = { path = "substrate/frame/contracts/uapi", default-features = false }
pallet-conviction-voting = { path = "substrate/frame/conviction-voting", default-features = false }
pallet-core-fellowship = { path = "substrate/frame/core-fellowship", default-features = false }
pallet-dap = { path = "substrate/frame/dap", default-features = false }
pallet-dap-satellite = { path = "substrate/frame/dap-satellite", default-features = false }
pallet-default-config-example = { path = "substrate/frame/examples/default-config", default-features = false }
pallet-delegated-staking = { path = "substrate/frame/delegated-staking", default-features = false }
pallet-democracy = { path = "substrate/frame/democracy", default-features = false }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ impl pallet_balances::Config for Runtime {
type FreezeIdentifier = RuntimeFreezeReason;
type MaxFreezes = ConstU32<50>;
type DoneSlashHandler = ();
type BurnDestination = pallet_balances::DirectBurn<Balances, AccountId>;
}

parameter_types! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ cumulus-primitives-aura = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-utility = { workspace = true }
pallet-collator-selection = { workspace = true }
pallet-dap = { workspace = true }
pallet-message-queue = { workspace = true }
parachain-info = { workspace = true }
parachains-common = { workspace = true }
Expand Down Expand Up @@ -174,6 +175,7 @@ runtime-benchmarks = [
"pallet-balances/runtime-benchmarks",
"pallet-collator-selection/runtime-benchmarks",
"pallet-conviction-voting/runtime-benchmarks",
"pallet-dap/runtime-benchmarks",
"pallet-delegated-staking/runtime-benchmarks",
"pallet-election-provider-multi-block/runtime-benchmarks",
"pallet-fast-unstake/runtime-benchmarks",
Expand Down Expand Up @@ -248,6 +250,7 @@ try-runtime = [
"pallet-balances/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-conviction-voting/try-runtime",
"pallet-dap/try-runtime",
"pallet-delegated-staking/try-runtime",
"pallet-election-provider-multi-block/try-runtime",
"pallet-fast-unstake/try-runtime",
Expand Down Expand Up @@ -329,6 +332,7 @@ std = [
"pallet-balances/std",
"pallet-collator-selection/std",
"pallet-conviction-voting/std",
"pallet-dap/std",
"pallet-delegated-staking/std",
"pallet-election-provider-multi-block/std",
"pallet-fast-unstake/std",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ impl pallet_referenda::Config for Runtime {

parameter_types! {
pub const SpendPeriod: BlockNumber = 6 * DAYS;
pub const Burn: Permill = Permill::from_perthousand(2);
pub const TreasuryPalletId: PalletId = PalletId(*b"py/trsry");
pub const PayoutSpendPeriod: BlockNumber = 30 * DAYS;

Expand Down Expand Up @@ -139,7 +138,7 @@ impl pallet_treasury::Config for Runtime {
type RejectOrigin = EitherOfDiverse<EnsureRoot<AccountId>, Treasurer>;
type RuntimeEvent = RuntimeEvent;
type SpendPeriod = SpendPeriod;
type Burn = Burn;
type Burn = ();
type BurnDestination = ();
type MaxApprovals = MaxApprovals;
type WeightInfo = weights::pallet_treasury::WeightInfo<Runtime>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ impl pallet_balances::Config for Runtime {
type FreezeIdentifier = RuntimeFreezeReason;
type MaxFreezes = frame_support::traits::VariantCountOf<RuntimeFreezeReason>;
type DoneSlashHandler = ();
type BurnDestination = pallet_dap::ReturnToDap<Runtime>;
}

parameter_types! {
Expand Down Expand Up @@ -1399,6 +1400,9 @@ construct_runtime!(
AssetRate: pallet_asset_rate = 95,
MultiAssetBounties: pallet_multi_asset_bounties = 96,

// Dynamic Allocation Pool / Issuance Buffer
Dap: pallet_dap = 100,

// TODO: the pallet instance should be removed once all pools have migrated
// to the new account IDs.
AssetConversionMigration: pallet_asset_conversion_ops = 200,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ impl pallet_staking_async::Config for Runtime {
type RuntimeHoldReason = RuntimeHoldReason;
type CurrencyToVote = sp_staking::currency_to_vote::SaturatingCurrencyToVote;
type RewardRemainder = ();
type Slash = ();
type Slash = pallet_dap::SlashToDap<Runtime>;
type Reward = ();
type SessionsPerEra = SessionsPerEra;
type BondingDuration = BondingDuration;
Expand Down Expand Up @@ -311,6 +311,15 @@ impl pallet_staking_async_rc_client::Config for Runtime {
type ValidatorSetExportSession = ConstU32<4>;
}

parameter_types! {
pub const DapPalletId: frame_support::PalletId = frame_support::PalletId(*b"dap/buff");
}

impl pallet_dap::Config for Runtime {
type Currency = Balances;
type PalletId = DapPalletId;
}

#[derive(Encode, Decode)]
// Call indices taken from westend-next runtime.
pub enum RelayChainRuntimePallets {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ impl pallet_balances::Config for Runtime {
type FreezeIdentifier = ();
type MaxFreezes = ConstU32<0>;
type DoneSlashHandler = ();
type BurnDestination = pallet_balances::DirectBurn<Balances, AccountId>;
}

parameter_types! {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ frame-try-runtime = { optional = true, workspace = true }
pallet-aura = { workspace = true }
pallet-authorship = { workspace = true }
pallet-balances = { workspace = true }
pallet-dap-satellite = { workspace = true }
pallet-message-queue = { workspace = true }
pallet-multisig = { workspace = true }
pallet-session = { workspace = true }
Expand Down Expand Up @@ -174,6 +175,7 @@ std = [
"pallet-bridge-parachains/std",
"pallet-bridge-relayers/std",
"pallet-collator-selection/std",
"pallet-dap-satellite/std",
"pallet-message-queue/std",
"pallet-multisig/std",
"pallet-session/std",
Expand Down Expand Up @@ -254,6 +256,7 @@ runtime-benchmarks = [
"pallet-bridge-parachains/runtime-benchmarks",
"pallet-bridge-relayers/runtime-benchmarks",
"pallet-collator-selection/runtime-benchmarks",
"pallet-dap-satellite/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
"pallet-session/runtime-benchmarks",
Expand Down Expand Up @@ -304,6 +307,7 @@ try-runtime = [
"pallet-bridge-parachains/try-runtime",
"pallet-bridge-relayers/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-dap-satellite/try-runtime",
"pallet-message-queue/try-runtime",
"pallet-multisig/try-runtime",
"pallet-session/try-runtime",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,17 +354,24 @@ impl pallet_balances::Config for Runtime {
type FreezeIdentifier = ();
type MaxFreezes = ConstU32<0>;
type DoneSlashHandler = ();
type BurnDestination = pallet_dap_satellite::AccumulateInSatellite<Runtime>;
}

parameter_types! {
/// Relay Chain `TransactionByteFee` / 10
pub const TransactionByteFee: Balance = MILLICENTS;
/// Percentage of fees to send to DAP satellite (0 = all to staking pot, 100 = all to DAP).
pub const DapSatelliteFeePercent: u32 = 0;
}

/// Fee handler that splits fees between DAP satellite and staking pot.
type DealWithFeesSatellite =
pallet_dap_satellite::DealWithFeesSplit<Runtime, DapSatelliteFeePercent, DealWithFees<Runtime>>;

impl pallet_transaction_payment::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type OnChargeTransaction =
pallet_transaction_payment::FungibleAdapter<Balances, DealWithFees<Runtime>>;
pallet_transaction_payment::FungibleAdapter<Balances, DealWithFeesSatellite>;
type OperationalFeeMultiplier = ConstU8<5>;
type WeightToFee = WeightToFee;
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
Expand Down Expand Up @@ -552,6 +559,15 @@ impl pallet_utility::Config for Runtime {
type WeightInfo = weights::pallet_utility::WeightInfo<Runtime>;
}

parameter_types! {
pub const DapSatellitePalletId: frame_support::PalletId = frame_support::PalletId(*b"dap/satl");
}

impl pallet_dap_satellite::Config for Runtime {
type Currency = Balances;
type PalletId = DapSatellitePalletId;
}

// Create the runtime by composing the FRAME pallets that were previously configured.
construct_runtime!(
pub enum Runtime
Expand Down Expand Up @@ -590,6 +606,9 @@ construct_runtime!(
BridgeRococoMessages: pallet_bridge_messages::<Instance1> = 44,
XcmOverBridgeHubRococo: pallet_xcm_bridge_hub::<Instance1> = 45,

// DAP Satellite - collects funds for eventual transfer to DAP on AssetHub.
DapSatellite: pallet_dap_satellite = 60,

EthereumInboundQueue: snowbridge_pallet_inbound_queue = 80,
EthereumOutboundQueue: snowbridge_pallet_outbound_queue = 81,
EthereumBeaconClient: snowbridge_pallet_ethereum_client = 82,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pallet-authorship = { workspace = true }
pallet-balances = { workspace = true }
pallet-collective = { workspace = true }
pallet-core-fellowship = { workspace = true }
pallet-dap-satellite = { workspace = true }
pallet-multisig = { workspace = true }
pallet-preimage = { workspace = true }
pallet-proxy = { workspace = true }
Expand Down Expand Up @@ -120,6 +121,7 @@ runtime-benchmarks = [
"pallet-collective-content/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
"pallet-core-fellowship/runtime-benchmarks",
"pallet-dap-satellite/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
"pallet-preimage/runtime-benchmarks",
Expand Down Expand Up @@ -165,6 +167,7 @@ try-runtime = [
"pallet-collective-content/try-runtime",
"pallet-collective/try-runtime",
"pallet-core-fellowship/try-runtime",
"pallet-dap-satellite/try-runtime",
"pallet-message-queue/try-runtime",
"pallet-multisig/try-runtime",
"pallet-preimage/try-runtime",
Expand Down Expand Up @@ -213,6 +216,7 @@ std = [
"pallet-collective-content/std",
"pallet-collective/std",
"pallet-core-fellowship/std",
"pallet-dap-satellite/std",
"pallet-message-queue/std",
"pallet-multisig/std",
"pallet-preimage/std",
Expand Down
Loading
Loading