pub trait DefaultConfig: DefaultConfig {
type RuntimeEvent;
type FeeMultiplierUpdate: MultiplierUpdate;
type OperationalFeeMultiplier: Get<u8>;
}
Expand description
Based on Config
. Auto-generated by
#[pallet::config(with_default)]
.
Can be used in tandem with
#[register_default_config]
and
#[derive_impl]
to derive test config traits
based on existing pallet config traits in a safe and developer-friendly way.
See here for more information and caveats about
the auto-generated DefaultConfig
trait and how it is generated.
Required Associated Types§
sourcetype RuntimeEvent
type RuntimeEvent
The overarching event type.
sourcetype FeeMultiplierUpdate: MultiplierUpdate
type FeeMultiplierUpdate: MultiplierUpdate
Update the multiplier of the next block, based on the previous block’s weight.
sourcetype OperationalFeeMultiplier: Get<u8>
type OperationalFeeMultiplier: Get<u8>
A fee multiplier for Operational
extrinsics to compute “virtual tip” to boost their
priority
This value is multiplied 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.