From 233af79f9f89e63908910d98704b5fd61d65ad20 Mon Sep 17 00:00:00 2001 From: Nikolaus Heger Date: Sat, 19 Sep 2026 14:00:18 +0800 Subject: [PATCH 1/2] fix: cut on-chain fees 10x via FEE_SCALE 1/10 --- runtime/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 2b02126b..f386bf94 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -116,7 +116,7 @@ pub const MAX_SUPPLY: Balance = 21_000_000 * UNIT; /// Percentage rates (wormhole bps, reversal/step factors), the existential /// deposit, and the 0.01-QTC circuit quanta are deliberately not scaled. pub const FEE_SCALE_NUM: Balance = 1; -pub const FEE_SCALE_DEN: Balance = 1; +pub const FEE_SCALE_DEN: Balance = 10; pub const fn scale_fee(base: Balance) -> Balance { base * FEE_SCALE_NUM / FEE_SCALE_DEN From ef54730a7dc6736433b42309cb1b1c781c57a791 Mon Sep 17 00:00:00 2001 From: Nikolaus Heger Date: Sat, 19 Sep 2026 14:06:16 +0800 Subject: [PATCH 2/2] test: scale the padded-dest fee floor with FEE_SCALE The 0.05 UNIT delta assumed FEE_SCALE 1. Use scale_fee so it holds at any numerator/denominator. --- runtime/tests/transactions/high_security_tip.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/tests/transactions/high_security_tip.rs b/runtime/tests/transactions/high_security_tip.rs index 98e82f22..6085fc50 100644 --- a/runtime/tests/transactions/high_security_tip.rs +++ b/runtime/tests/transactions/high_security_tip.rs @@ -17,8 +17,8 @@ use qp_dilithium_crypto::Dilithium65Pair; use qp_scheduler::BlockNumberOrTimestamp; use qp_wormhole::{derive_wormhole_address, POW_ENGINE_ID}; use quantus_runtime::{ - transaction_extensions::HIGH_SECURITY_TIP_FORBIDDEN, Balances, Executive, MiningRewards, - ReversibleTransfers, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, System, + scale_fee, transaction_extensions::HIGH_SECURITY_TIP_FORBIDDEN, Balances, Executive, + MiningRewards, ReversibleTransfers, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, System, UncheckedExtrinsic, EXISTENTIAL_DEPOSIT, MILLI_UNIT, UNIT, }; use sp_core::Pair; @@ -259,7 +259,7 @@ fn high_security_padded_dest_is_rejected_before_fees() { let id_xt = signed_call(&pair, account.clone(), schedule_small_transfer(), 0, 0); let raw_xt = signed_call(&pair, account.clone(), padded_schedule_transfer(PAD), 0, 0); assert!( - inclusion_fee(&raw_xt) > inclusion_fee(&id_xt) + 50 * MILLI_UNIT, + inclusion_fee(&raw_xt) > inclusion_fee(&id_xt) + scale_fee(50 * MILLI_UNIT), "padded dest must inflate the chain-decided inclusion fee, got id={} raw={}", inclusion_fee(&id_xt), inclusion_fee(&raw_xt)