Skip to content

Commit

Permalink
Reduce the base fee on Polkadot System Chains (polkadot-fellows#398)
Browse files Browse the repository at this point in the history
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 <[email protected]>
Co-authored-by: joe petrowski <[email protected]>
  • Loading branch information
3 people authored Jul 25, 2024
1 parent afe696b commit 7c69345
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 20 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 { .. }) => {},
]
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 { .. }) => {},
]
);
}
Expand Down
10 changes: 5 additions & 5 deletions system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
4 changes: 2 additions & 2 deletions system-parachains/collectives/collectives-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
12 changes: 6 additions & 6 deletions system-parachains/constants/src/polkadot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -122,9 +122,9 @@ pub mod fee {
type Balance = Balance;
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
// 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,
Expand All @@ -140,9 +140,9 @@ pub mod fee {
impl WeightToFeePolynomial for ProofSizeToFee {
type Balance = Balance;
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
// 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,
Expand Down

0 comments on commit 7c69345

Please sign in to comment.