pub trait Config: Config {
type OnChargeTransaction: OnChargeTransaction<Self>;
type TransactionByteFee: Get<<<Self as Config>::OnChargeTransaction as OnChargeTransaction<Self>>::Balance>;
type OperationalFeeMultiplier: Get<u8>;
type WeightToFee: WeightToFeePolynomial<Balance = <<Self as Config>::OnChargeTransaction as OnChargeTransaction<Self>>::Balance>;
type FeeMultiplierUpdate: MultiplierUpdate;
type Currency: Currency<Self::AccountId>;
type TransactionConverter: Convert<<<Self as Config>::OnChargeTransaction as OnChargeTransaction<Self>>::Balance, <<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>;
type Accounting: Posting<Self::AccountId, Self::Hash, Self::BlockNumber, <<Self as Config>::Currency as Currency<<Self as Config>::AccountId>>::Balance>;
}
Expand description
Configuration trait of this pallet.
Implement this type for a runtime in order to customize this pallet.
Associated Types
type OnChargeTransaction: OnChargeTransaction<Self>
type OnChargeTransaction: OnChargeTransaction<Self>
Handler for withdrawing, refunding and depositing the transaction fee. Transaction fees are withdrawn before the transaction is executed. After the transaction was executed the transaction weight can be adjusted, depending on the used resources by the transaction. If the transaction weight is lower than expected, parts of the transaction fee might be refunded. In the end the fees can be deposited.
type TransactionByteFee: Get<<<Self as Config>::OnChargeTransaction as OnChargeTransaction<Self>>::Balance>
type TransactionByteFee: Get<<<Self as Config>::OnChargeTransaction as OnChargeTransaction<Self>>::Balance>
The fee to be paid for making a transaction; the per-byte portion.
type OperationalFeeMultiplier: Get<u8>
type OperationalFeeMultiplier: Get<u8>
A fee mulitplier for Operational
extrinsics to compute “virtual tip” to boost their
priority
This value is multipled by the final_fee
to obtain a “virtual tip” that is later
added to a tip component in regular priority
calculations.
It means that a Normal
transaction can front-run a similarly-sized Operational
extrinsic (with no tip), by including a tip value greater than the virtual tip.
// For `Normal`
let priority = priority_calc(tip);
// For `Operational`
let virtual_tip = (inclusion_fee + tip) * OperationalFeeMultiplier;
let priority = priority_calc(tip + virtual_tip);
Note that since we use final_fee
the multiplier applies also to the regular tip
sent with the transaction. So, not only does the transaction get a priority bump based
on the inclusion_fee
, but we also amplify the impact of tips applied to Operational
transactions.
type WeightToFee: WeightToFeePolynomial<Balance = <<Self as Config>::OnChargeTransaction as OnChargeTransaction<Self>>::Balance>
type WeightToFee: WeightToFeePolynomial<Balance = <<Self as Config>::OnChargeTransaction as OnChargeTransaction<Self>>::Balance>
Convert a weight value into a deductible fee based on the currency type.
Update the multiplier of the next block, based on the previous block’s weight.