From 7c69345c75910006d56e60e2f9a93c9d0f44f280 Mon Sep 17 00:00:00 2001 From: Valery Gantchev Date: Thu, 25 Jul 2024 09:45:30 +0200 Subject: [PATCH] Reduce the base fee on Polkadot System Chains (#398) This PR reduces the base fee on all Polkadot system chains by half. As a result, the base fee will be roughly 1/20 of the base fee on the Polkadot relay chain. This will make all transactions on (non-congested) system chains cheaper and stimulate usage. Among others, the change will push the transaction fees for transfers on Asset Hub below $0.01 which is an important psychological threshold. An initiative by ecosystem agents. --------- Co-authored-by: Adrian Catangiu Co-authored-by: joe petrowski <25483142+joepetrowski@users.noreply.github.com> --- CHANGELOG.md | 1 + .../assets/asset-hub-kusama/src/tests/teleport.rs | 2 +- .../assets/asset-hub-polkadot/src/tests/teleport.rs | 2 +- .../asset-hubs/asset-hub-polkadot/src/lib.rs | 10 +++++----- .../bridge-hub-polkadot/primitives/src/lib.rs | 6 +++--- .../bridge-hubs/bridge-hub-polkadot/src/lib.rs | 4 ++-- .../collectives/collectives-polkadot/src/lib.rs | 4 ++-- system-parachains/constants/src/polkadot.rs | 12 ++++++------ 8 files changed, 21 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb6c377848..68ac8fc1de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Changed - Bounties: Remove payout delay ([polkadot-fellows/runtimes#386](https://github.com/polkadot-fellows/runtimes/pull/386)) +- Polkadot System Chains: Reduce the base transaction fee by half ## [1.2.8] 03.07.2024 diff --git a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs index a258f15371..e24c443265 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-kusama/src/tests/teleport.rs @@ -166,7 +166,7 @@ fn penpal_to_ah_foreign_assets_receiver_assertions(t: ParaToSystemParaTest) { owner: *owner == t.receiver.account_id, amount: *amount == expected_foreign_asset_amount, }, - RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {}, + RuntimeEvent::Balances(pallet_balances::Event::Issued { .. }) => {}, ] ); } diff --git a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs index 2f87daa87e..66fd4f3bff 100644 --- a/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs +++ b/integration-tests/emulated/tests/assets/asset-hub-polkadot/src/tests/teleport.rs @@ -165,7 +165,7 @@ fn penpal_to_ah_foreign_assets_receiver_assertions(t: ParaToSystemParaTest) { owner: *owner == t.receiver.account_id, amount: *amount == expected_foreign_asset_amount, }, - RuntimeEvent::Balances(pallet_balances::Event::Deposit { .. }) => {}, + RuntimeEvent::Balances(pallet_balances::Event::Issued { .. }) => {}, ] ); } diff --git a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs index ad04c2dec6..3f4935396e 100644 --- a/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs +++ b/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs @@ -1811,11 +1811,11 @@ mod tests { /// Weight is being charged for both dimensions. #[test] fn weight_charged_for_both_components() { - let fee: Balance = fee::WeightToFee::weight_to_fee(&Weight::from_parts(10_000, 0)); + let fee: Balance = fee::WeightToFee::weight_to_fee(&Weight::from_parts(20_000, 0)); assert!(!fee.is_zero(), "Charges for ref time"); - let fee: Balance = fee::WeightToFee::weight_to_fee(&Weight::from_parts(0, 10_000)); - assert_eq!(fee, CENTS, "10kb maps to CENT"); + let fee: Balance = fee::WeightToFee::weight_to_fee(&Weight::from_parts(0, 20_000)); + assert_eq!(fee, CENTS, "20kb maps to CENT"); } /// Filling up a block by proof size is at most 30 times more expensive than ref time. @@ -1836,10 +1836,10 @@ mod tests { } #[test] - fn test_transasction_byte_fee_is_one_tenth_of_relay() { + fn test_transasction_byte_fee_is_one_twentieth_of_relay() { let relay_tbf = polkadot_runtime_constants::fee::TRANSACTION_BYTE_FEE; let parachain_tbf = TransactionByteFee::get(); - assert_eq!(relay_tbf / 10, parachain_tbf); + assert_eq!(relay_tbf / 20, parachain_tbf); } #[test] diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/primitives/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/primitives/src/lib.rs index 40947b410a..85b3570d2c 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/primitives/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/primitives/src/lib.rs @@ -90,15 +90,15 @@ frame_support::parameter_types! { /// The XCM fee that is paid for executing XCM program (with `ExportMessage` instruction) at the Polkadot /// BridgeHub. /// (initially was calculated by test `BridgeHubPolkadot::can_calculate_weight_for_paid_export_message_with_reserve_transfer` + `33%`) - pub const BridgeHubPolkadotBaseXcmFeeInDots: Balance = 177_594_900; + pub const BridgeHubPolkadotBaseXcmFeeInDots: Balance = 88_797_450; /// Transaction fee that is paid at the Polkadot BridgeHub for delivering single inbound message. /// (initially was calculated by test `BridgeHubPolkadot::can_calculate_fee_for_standalone_message_delivery_transaction` + `33%`) - pub const BridgeHubPolkadotBaseDeliveryFeeInDots: Balance = 942_248_365; + pub const BridgeHubPolkadotBaseDeliveryFeeInDots: Balance = 471_124_182; /// Transaction fee that is paid at the Polkadot BridgeHub for delivering single outbound message confirmation. /// (initially was calculated by test `BridgeHubPolkadot::can_calculate_fee_for_standalone_message_confirmation_transaction` + `33%`) - pub const BridgeHubPolkadotBaseConfirmationFeeInDots: Balance = 172_377_865; + pub const BridgeHubPolkadotBaseConfirmationFeeInDots: Balance = 86_188_932; } /// Compute the total estimated fee that needs to be paid in DOTs by the sender when sending diff --git a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs index 62298e79ba..57e6e765f3 100644 --- a/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs +++ b/system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs @@ -1281,9 +1281,9 @@ mod tests { use super::*; #[test] - fn test_transasction_byte_fee_is_one_tenth_of_relay() { + fn test_transasction_byte_fee_is_one_twentieth_of_relay() { let relay_tbf = polkadot_runtime_constants::fee::TRANSACTION_BYTE_FEE; let parachain_tbf = TransactionByteFee::get(); - assert_eq!(relay_tbf / 10, parachain_tbf); + assert_eq!(relay_tbf / 20, parachain_tbf); } } diff --git a/system-parachains/collectives/collectives-polkadot/src/lib.rs b/system-parachains/collectives/collectives-polkadot/src/lib.rs index b650b26db1..63cbcfcd97 100644 --- a/system-parachains/collectives/collectives-polkadot/src/lib.rs +++ b/system-parachains/collectives/collectives-polkadot/src/lib.rs @@ -1194,8 +1194,8 @@ fn test_ed_is_one_tenth_of_relay() { } #[test] -fn test_transasction_byte_fee_is_one_tenth_of_relay() { +fn test_transasction_byte_fee_is_one_twentieth_of_relay() { let relay_tbf = polkadot_runtime_constants::fee::TRANSACTION_BYTE_FEE; let parachain_tbf = TransactionByteFee::get(); - assert_eq!(relay_tbf / 10, parachain_tbf); + assert_eq!(relay_tbf / 20, parachain_tbf); } diff --git a/system-parachains/constants/src/polkadot.rs b/system-parachains/constants/src/polkadot.rs index e8e71c265b..d42ca84d82 100644 --- a/system-parachains/constants/src/polkadot.rs +++ b/system-parachains/constants/src/polkadot.rs @@ -90,8 +90,8 @@ pub mod fee { /// Cost of every transaction byte at Polkadot system parachains. /// - /// It is the Relay Chain (Polkadot) `TransactionByteFee` / 10. - pub const TRANSACTION_BYTE_FEE: Balance = super::currency::MILLICENTS; + /// It is the Relay Chain (Polkadot) `TransactionByteFee` / 20. + pub const TRANSACTION_BYTE_FEE: Balance = super::currency::MILLICENTS / 2; /// Handles converting a weight scalar to a fee value, based on the scale and granularity of the /// node's balance type. @@ -122,9 +122,9 @@ pub mod fee { type Balance = Balance; fn polynomial() -> WeightToFeeCoefficients { // In Polkadot, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT: - // The standard system parachain configuration is 1/10 of that, as in 1/100 CENT. + // The standard system parachain configuration is 1/20 of that, as in 1/200 CENT. let p = super::currency::CENTS; - let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); + let q = 200 * Balance::from(ExtrinsicBaseWeight::get().ref_time()); smallvec![WeightToFeeCoefficient { degree: 1, @@ -140,9 +140,9 @@ pub mod fee { impl WeightToFeePolynomial for ProofSizeToFee { type Balance = Balance; fn polynomial() -> WeightToFeeCoefficients { - // Map 10kb proof to 1 CENT. + // Map 20kb proof to 1 CENT. let p = super::currency::CENTS; - let q = 10_000; + let q = 20_000; smallvec![WeightToFeeCoefficient { degree: 1,