Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Maximum value for MultiplierUpdate #6021

Merged
merged 6 commits into from
Oct 6, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion runtime/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub use pallet_timestamp::Call as TimestampCall;
use pallet_transaction_payment::{Multiplier, TargetedFeeAdjustment};
#[cfg(any(feature = "std", test))]
pub use sp_runtime::BuildStorage;
pub use sp_runtime::traits::Bounded;

/// Implementations of some helper traits passed into runtime modules as associated types.
pub use impls::ToAuthor;
Expand Down Expand Up @@ -86,6 +87,8 @@ parameter_types! {
/// that combined with `AdjustmentVariable`, we can recover from the minimum.
/// See `multiplier_can_grow_from_zero`.
pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 10u128);
/// The maximum amouf of the multiplier.
Szegoo marked this conversation as resolved.
Show resolved Hide resolved
pub MaximumMultiplier: Multiplier = Bounded::max_value();
/// Maximum length of block. Up to 5MB.
pub BlockLength: limits::BlockLength =
limits::BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);
Expand All @@ -94,7 +97,7 @@ parameter_types! {
/// Parameterized slow adjusting fee updated based on
/// https://research.web3.foundation/en/latest/polkadot/overview/2-token-economics.html#-2.-slow-adjusting-mechanism
pub type SlowAdjustingFeeUpdate<R> =
TargetedFeeAdjustment<R, TargetBlockFullness, AdjustmentVariable, MinimumMultiplier>;
TargetedFeeAdjustment<R, TargetBlockFullness, AdjustmentVariable, MinimumMultiplier, MaximumMultiplier>;

/// Implements the weight types for a runtime.
/// It expects the passed runtime constants to contain a `weights` module.
Expand Down