diff --git a/runtime/moonbase/src/lib.rs b/runtime/moonbase/src/lib.rs index 6ca2ff7b240..7839ed512d0 100644 --- a/runtime/moonbase/src/lib.rs +++ b/runtime/moonbase/src/lib.rs @@ -118,7 +118,7 @@ pub mod currency { pub const UNIT: Balance = 1_000_000_000_000_000_000; pub const KILOUNIT: Balance = 1_000_000_000_000_000_000_000; - pub const TRANSACTION_BYTE_FEE: Balance = 10 * MICROUNIT * SUPPLY_FACTOR; + pub const TRANSACTION_BYTE_FEE: Balance = 1 * GIGAWEI * SUPPLY_FACTOR; // TODO: review pub const STORAGE_BYTE_FEE: Balance = 100 * MICROUNIT * SUPPLY_FACTOR; pub const WEIGHT_FEE: Balance = 50 * KILOWEI * SUPPLY_FACTOR; @@ -327,11 +327,32 @@ impl WeightToFeePolynomial for WeightToFee { } } +pub struct LengthToFee; +impl WeightToFeePolynomial for LengthToFee { + type Balance = Balance; + + fn polynomial() -> WeightToFeeCoefficients { + smallvec![ + WeightToFeeCoefficients { + degree: 1, + coeff_frac: Perbill::zero(), + coeff_integer: currency::TRANSACTION_BYTE_FEE, + negative: false, + }, + WeightToFeeCoefficients { + degree: 3, + coeff_frac: Perbill::zero(), + coeff_integer: 1, + negative: false, + }, + } +}; + impl pallet_transaction_payment::Config for Runtime { type OnChargeTransaction = CurrencyAdapter>; - type TransactionByteFee = TransactionByteFee; type OperationalFeeMultiplier = OperationalFeeMultiplier; type WeightToFee = IdentityFee; + type LengthToFee = LengthToFee; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; } diff --git a/runtime/moonbeam/src/lib.rs b/runtime/moonbeam/src/lib.rs index 21f8f5f5850..3bdd53fee22 100644 --- a/runtime/moonbeam/src/lib.rs +++ b/runtime/moonbeam/src/lib.rs @@ -39,7 +39,7 @@ use frame_support::{ }, weights::{ constants::{RocksDbWeight, WEIGHT_PER_SECOND}, - DispatchClass, GetDispatchInfo, IdentityFee, Weight, + DispatchClass, GetDispatchInfo, IdentityFee, ConstantModifierFee, Weight, }, PalletId, }; @@ -304,9 +304,9 @@ parameter_types! { impl pallet_transaction_payment::Config for Runtime { type OnChargeTransaction = CurrencyAdapter>; - type TransactionByteFee = TransactionByteFee; type OperationalFeeMultiplier = OperationalFeeMultiplier; type WeightToFee = IdentityFee; + type LengthToFee = ConstantModifierFee; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; } diff --git a/runtime/moonriver/src/lib.rs b/runtime/moonriver/src/lib.rs index 8420624313d..383491544a4 100644 --- a/runtime/moonriver/src/lib.rs +++ b/runtime/moonriver/src/lib.rs @@ -39,7 +39,7 @@ use frame_support::{ }, weights::{ constants::{RocksDbWeight, WEIGHT_PER_SECOND}, - DispatchClass, GetDispatchInfo, IdentityFee, Weight, WeightToFeeCoefficient, + DispatchClass, GetDispatchInfo, IdentityFee, ConstantModifierFee, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, }, PalletId, @@ -325,9 +325,9 @@ impl WeightToFeePolynomial for WeightToFee { impl pallet_transaction_payment::Config for Runtime { type OnChargeTransaction = CurrencyAdapter>; - type TransactionByteFee = TransactionByteFee; type OperationalFeeMultiplier = OperationalFeeMultiplier; type WeightToFee = IdentityFee; + type LengthToFee = ConstantModifierFee; type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; }