mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +00:00
* Change branch. * Update runtime. * Revert "Change branch." This reverts commit 841c59f3398136c27cc235a29d7d459e8a4c8ce0. * Update substrate. * Fix tests. * Fix compilation. * Fix frame system imports. * Fix usages of system * Fix stuff. * Fix compilation. * Fixes. * Fix block_weight usage. * Bump substrate.
This commit is contained in:
Generated
+136
-136
File diff suppressed because it is too large
Load Diff
@@ -636,7 +636,7 @@ mod tests {
|
|||||||
use parity_scale_codec::Encode;
|
use parity_scale_codec::Encode;
|
||||||
// The testing primitives are very useful for avoiding having to work with signatures
|
// The testing primitives are very useful for avoiding having to work with signatures
|
||||||
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
|
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
|
||||||
use sp_runtime::{Perbill, traits::{BlakeTwo256, IdentityLookup, Identity}, testing::Header};
|
use sp_runtime::{traits::{BlakeTwo256, IdentityLookup, Identity}, testing::Header};
|
||||||
use frame_support::{
|
use frame_support::{
|
||||||
impl_outer_origin, impl_outer_dispatch, assert_ok, assert_err, assert_noop, parameter_types,
|
impl_outer_origin, impl_outer_dispatch, assert_ok, assert_err, assert_noop, parameter_types,
|
||||||
ord_parameter_types, weights::{Pays, GetDispatchInfo}, traits::ExistenceRequirement,
|
ord_parameter_types, weights::{Pays, GetDispatchInfo}, traits::ExistenceRequirement,
|
||||||
@@ -661,12 +661,12 @@ mod tests {
|
|||||||
pub struct Test;
|
pub struct Test;
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const BlockHashCount: u32 = 250;
|
pub const BlockHashCount: u32 = 250;
|
||||||
pub const MaximumBlockWeight: u32 = 4 * 1024 * 1024;
|
|
||||||
pub const MaximumBlockLength: u32 = 4 * 1024 * 1024;
|
|
||||||
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
|
|
||||||
}
|
}
|
||||||
impl frame_system::Config for Test {
|
impl frame_system::Config for Test {
|
||||||
type BaseCallFilter = ();
|
type BaseCallFilter = ();
|
||||||
|
type BlockWeights = ();
|
||||||
|
type BlockLength = ();
|
||||||
|
type DbWeight = ();
|
||||||
type Origin = Origin;
|
type Origin = Origin;
|
||||||
type Call = Call;
|
type Call = Call;
|
||||||
type Index = u64;
|
type Index = u64;
|
||||||
@@ -678,13 +678,6 @@ mod tests {
|
|||||||
type Header = Header;
|
type Header = Header;
|
||||||
type Event = ();
|
type Event = ();
|
||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
|
||||||
type DbWeight = ();
|
|
||||||
type BlockExecutionWeight = ();
|
|
||||||
type ExtrinsicBaseWeight = ();
|
|
||||||
type MaximumExtrinsicWeight = MaximumBlockWeight;
|
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
|
||||||
type Version = ();
|
type Version = ();
|
||||||
type PalletInfo = ();
|
type PalletInfo = ();
|
||||||
type AccountData = pallet_balances::AccountData<u64>;
|
type AccountData = pallet_balances::AccountData<u64>;
|
||||||
|
|||||||
@@ -579,7 +579,7 @@ mod tests {
|
|||||||
// The testing primitives are very useful for avoiding having to work with signatures
|
// The testing primitives are very useful for avoiding having to work with signatures
|
||||||
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
|
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are requried.
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
Perbill, Permill, Percent, testing::Header, DispatchResult,
|
Permill, Percent, testing::Header, DispatchResult,
|
||||||
traits::{BlakeTwo256, IdentityLookup},
|
traits::{BlakeTwo256, IdentityLookup},
|
||||||
};
|
};
|
||||||
use crate::slots::Registrar;
|
use crate::slots::Registrar;
|
||||||
@@ -595,12 +595,13 @@ mod tests {
|
|||||||
pub struct Test;
|
pub struct Test;
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const BlockHashCount: u32 = 250;
|
pub const BlockHashCount: u32 = 250;
|
||||||
pub const MaximumBlockWeight: u32 = 4 * 1024 * 1024;
|
|
||||||
pub const MaximumBlockLength: u32 = 4 * 1024 * 1024;
|
|
||||||
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl frame_system::Config for Test {
|
impl frame_system::Config for Test {
|
||||||
type BaseCallFilter = ();
|
type BaseCallFilter = ();
|
||||||
|
type BlockWeights = ();
|
||||||
|
type BlockLength = ();
|
||||||
|
type DbWeight = ();
|
||||||
type Origin = Origin;
|
type Origin = Origin;
|
||||||
type Call = ();
|
type Call = ();
|
||||||
type Index = u64;
|
type Index = u64;
|
||||||
@@ -612,13 +613,6 @@ mod tests {
|
|||||||
type Header = Header;
|
type Header = Header;
|
||||||
type Event = ();
|
type Event = ();
|
||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
|
||||||
type DbWeight = ();
|
|
||||||
type BlockExecutionWeight = ();
|
|
||||||
type ExtrinsicBaseWeight = ();
|
|
||||||
type MaximumExtrinsicWeight = MaximumBlockWeight;
|
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
|
||||||
type Version = ();
|
type Version = ();
|
||||||
type PalletInfo = ();
|
type PalletInfo = ();
|
||||||
type AccountData = pallet_balances::AccountData<u64>;
|
type AccountData = pallet_balances::AccountData<u64>;
|
||||||
|
|||||||
@@ -72,7 +72,8 @@ where
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use frame_support::{impl_outer_origin, parameter_types, weights::Weight};
|
use frame_system::limits;
|
||||||
|
use frame_support::{impl_outer_origin, parameter_types, weights::DispatchClass};
|
||||||
use frame_support::traits::FindAuthor;
|
use frame_support::traits::FindAuthor;
|
||||||
use sp_core::H256;
|
use sp_core::H256;
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
@@ -91,9 +92,15 @@ mod tests {
|
|||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const BlockHashCount: u64 = 250;
|
pub const BlockHashCount: u64 = 250;
|
||||||
pub const ExtrinsicBaseWeight: u64 = 100;
|
pub BlockWeights: limits::BlockWeights = limits::BlockWeights::builder()
|
||||||
pub const MaximumBlockWeight: Weight = 1024;
|
.for_class(DispatchClass::all(), |weight| {
|
||||||
pub const MaximumBlockLength: u32 = 2 * 1024;
|
weight.base_extrinsic = 100;
|
||||||
|
})
|
||||||
|
.for_class(DispatchClass::non_mandatory(), |weight| {
|
||||||
|
weight.max_total = Some(1024);
|
||||||
|
})
|
||||||
|
.build_or_panic();
|
||||||
|
pub BlockLength: limits::BlockLength = limits::BlockLength::max(2 * 1024);
|
||||||
pub const AvailableBlockRatio: Perbill = Perbill::one();
|
pub const AvailableBlockRatio: Perbill = Perbill::one();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,13 +117,9 @@ mod tests {
|
|||||||
type Header = Header;
|
type Header = Header;
|
||||||
type Event = ();
|
type Event = ();
|
||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
type BlockLength = BlockLength;
|
||||||
|
type BlockWeights = BlockWeights;
|
||||||
type DbWeight = ();
|
type DbWeight = ();
|
||||||
type BlockExecutionWeight = ();
|
|
||||||
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
|
|
||||||
type MaximumExtrinsicWeight = MaximumBlockWeight;
|
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
|
||||||
type Version = ();
|
type Version = ();
|
||||||
type PalletInfo = ();
|
type PalletInfo = ();
|
||||||
type AccountData = pallet_balances::AccountData<u64>;
|
type AccountData = pallet_balances::AccountData<u64>;
|
||||||
|
|||||||
@@ -28,10 +28,11 @@ pub mod paras_sudo_wrapper;
|
|||||||
pub mod paras_registrar;
|
pub mod paras_registrar;
|
||||||
|
|
||||||
use primitives::v1::{BlockNumber, ValidatorId};
|
use primitives::v1::{BlockNumber, ValidatorId};
|
||||||
use sp_runtime::{Perquintill, Perbill, FixedPointNumber, traits::Saturating};
|
use sp_runtime::{Perquintill, Perbill, FixedPointNumber};
|
||||||
|
use frame_system::limits;
|
||||||
use frame_support::{
|
use frame_support::{
|
||||||
parameter_types, traits::{Currency},
|
parameter_types, traits::{Currency},
|
||||||
weights::{Weight, constants::WEIGHT_PER_SECOND},
|
weights::{Weight, constants::WEIGHT_PER_SECOND, DispatchClass},
|
||||||
};
|
};
|
||||||
use pallet_transaction_payment::{TargetedFeeAdjustment, Multiplier};
|
use pallet_transaction_payment::{TargetedFeeAdjustment, Multiplier};
|
||||||
use static_assertions::const_assert;
|
use static_assertions::const_assert;
|
||||||
@@ -55,22 +56,19 @@ const WASM_MAGIC: &[u8] = &[0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00];
|
|||||||
|
|
||||||
/// We assume that an on-initialize consumes 2.5% of the weight on average, hence a single extrinsic
|
/// We assume that an on-initialize consumes 2.5% of the weight on average, hence a single extrinsic
|
||||||
/// will not be allowed to consume more than `AvailableBlockRatio - 2.5%`.
|
/// will not be allowed to consume more than `AvailableBlockRatio - 2.5%`.
|
||||||
pub const AVERAGE_ON_INITIALIZE_WEIGHT: Perbill = Perbill::from_perthousand(25);
|
pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_perthousand(25);
|
||||||
|
/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used
|
||||||
|
/// by Operational extrinsics.
|
||||||
|
const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
|
||||||
|
/// We allow for 2 seconds of compute with a 6 second average block time.
|
||||||
|
pub const MAXIMUM_BLOCK_WEIGHT: Weight = 2 * WEIGHT_PER_SECOND;
|
||||||
|
|
||||||
|
const_assert!(NORMAL_DISPATCH_RATIO.deconstruct() >= AVERAGE_ON_INITIALIZE_RATIO.deconstruct());
|
||||||
|
|
||||||
// Common constants used in all runtimes.
|
// Common constants used in all runtimes.
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const BlockHashCount: BlockNumber = 2400;
|
pub const BlockHashCount: BlockNumber = 2400;
|
||||||
/// Block time that can be used by weights.
|
/// The portion of the `NORMAL_DISPATCH_RATIO` that we adjust the fees with. Blocks filled less
|
||||||
pub const MaximumBlockWeight: Weight = 2 * WEIGHT_PER_SECOND;
|
|
||||||
/// Portion of the block available to normal class of dispatches.
|
|
||||||
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
|
|
||||||
/// Maximum weight that a _single_ extrinsic can take.
|
|
||||||
pub MaximumExtrinsicWeight: Weight =
|
|
||||||
AvailableBlockRatio::get().saturating_sub(AVERAGE_ON_INITIALIZE_WEIGHT)
|
|
||||||
* MaximumBlockWeight::get();
|
|
||||||
/// Maximum length of block. 5MB.
|
|
||||||
pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
|
|
||||||
/// The portion of the `AvailableBlockRatio` that we adjust the fees with. Blocks filled less
|
|
||||||
/// than this will decrease the weight and more will increase.
|
/// than this will decrease the weight and more will increase.
|
||||||
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
|
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
|
||||||
/// The adjustment variable of the runtime. Higher values will cause `TargetBlockFullness` to
|
/// The adjustment variable of the runtime. Higher values will cause `TargetBlockFullness` to
|
||||||
@@ -80,9 +78,41 @@ parameter_types! {
|
|||||||
/// that combined with `AdjustmentVariable`, we can recover from the minimum.
|
/// that combined with `AdjustmentVariable`, we can recover from the minimum.
|
||||||
/// See `multiplier_can_grow_from_zero`.
|
/// See `multiplier_can_grow_from_zero`.
|
||||||
pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000_000u128);
|
pub MinimumMultiplier: Multiplier = Multiplier::saturating_from_rational(1, 1_000_000_000u128);
|
||||||
|
/// Maximum length of block. Up to 5MB.
|
||||||
|
pub BlockLength: limits::BlockLength =
|
||||||
|
limits::BlockLength::max_with_normal_ratio(5 * 1024 * 1024, NORMAL_DISPATCH_RATIO);
|
||||||
|
/// Block weights base values and limits.
|
||||||
|
pub BlockWeights: limits::BlockWeights = limits::BlockWeights::builder()
|
||||||
|
.base_block(BlockExecutionWeight::get())
|
||||||
|
.for_class(DispatchClass::all(), |weights| {
|
||||||
|
weights.base_extrinsic = ExtrinsicBaseWeight::get();
|
||||||
|
})
|
||||||
|
.for_class(DispatchClass::Normal, |weights| {
|
||||||
|
weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT);
|
||||||
|
})
|
||||||
|
.for_class(DispatchClass::Operational, |weights| {
|
||||||
|
weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT);
|
||||||
|
// Operational transactions have an extra reserved space, so that they
|
||||||
|
// are included even if block reached `MAXIMUM_BLOCK_WEIGHT`.
|
||||||
|
weights.reserved = Some(
|
||||||
|
MAXIMUM_BLOCK_WEIGHT - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT,
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
|
||||||
|
.build_or_panic();
|
||||||
}
|
}
|
||||||
|
|
||||||
const_assert!(AvailableBlockRatio::get().deconstruct() >= AVERAGE_ON_INITIALIZE_WEIGHT.deconstruct());
|
parameter_types! {
|
||||||
|
/// A limit for off-chain phragmen unsigned solution submission.
|
||||||
|
///
|
||||||
|
/// We want to keep it as high as possible, but can't risk having it reject,
|
||||||
|
/// so we always subtract the base block execution weight.
|
||||||
|
pub OffchainSolutionWeightLimit: Weight = BlockWeights::get()
|
||||||
|
.get(DispatchClass::Normal)
|
||||||
|
.max_extrinsic
|
||||||
|
.expect("Normal extrinsics have weight limit configured by default; qed")
|
||||||
|
.saturating_sub(BlockExecutionWeight::get());
|
||||||
|
}
|
||||||
|
|
||||||
/// Parameterized slow adjusting fee updated based on
|
/// Parameterized slow adjusting fee updated based on
|
||||||
/// https://w3f-research.readthedocs.io/en/latest/polkadot/Token%20Economics.html#-2.-slow-adjusting-mechanism
|
/// https://w3f-research.readthedocs.io/en/latest/polkadot/Token%20Economics.html#-2.-slow-adjusting-mechanism
|
||||||
@@ -148,14 +178,18 @@ mod multiplier_tests {
|
|||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const BlockHashCount: u64 = 250;
|
pub const BlockHashCount: u64 = 250;
|
||||||
pub const ExtrinsicBaseWeight: u64 = 100;
|
|
||||||
pub const MaximumBlockWeight: Weight = 1024;
|
|
||||||
pub const MaximumBlockLength: u32 = 2 * 1024;
|
|
||||||
pub const AvailableBlockRatio: Perbill = Perbill::one();
|
pub const AvailableBlockRatio: Perbill = Perbill::one();
|
||||||
|
pub BlockLength: frame_system::limits::BlockLength =
|
||||||
|
frame_system::limits::BlockLength::max(2 * 1024);
|
||||||
|
pub BlockWeights: frame_system::limits::BlockWeights =
|
||||||
|
frame_system::limits::BlockWeights::simple_max(1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
impl frame_system::Config for Runtime {
|
impl frame_system::Config for Runtime {
|
||||||
type BaseCallFilter = ();
|
type BaseCallFilter = ();
|
||||||
|
type BlockWeights = BlockWeights;
|
||||||
|
type BlockLength = ();
|
||||||
|
type DbWeight = ();
|
||||||
type Origin = Origin;
|
type Origin = Origin;
|
||||||
type Index = u64;
|
type Index = u64;
|
||||||
type BlockNumber = u64;
|
type BlockNumber = u64;
|
||||||
@@ -167,13 +201,6 @@ mod multiplier_tests {
|
|||||||
type Header = Header;
|
type Header = Header;
|
||||||
type Event = ();
|
type Event = ();
|
||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
|
||||||
type DbWeight = ();
|
|
||||||
type BlockExecutionWeight = ();
|
|
||||||
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
|
|
||||||
type MaximumExtrinsicWeight = MaximumBlockWeight;
|
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
|
||||||
type Version = ();
|
type Version = ();
|
||||||
type PalletInfo = ();
|
type PalletInfo = ();
|
||||||
type AccountData = ();
|
type AccountData = ();
|
||||||
@@ -188,7 +215,7 @@ mod multiplier_tests {
|
|||||||
let mut t: sp_io::TestExternalities =
|
let mut t: sp_io::TestExternalities =
|
||||||
frame_system::GenesisConfig::default().build_storage::<Runtime>().unwrap().into();
|
frame_system::GenesisConfig::default().build_storage::<Runtime>().unwrap().into();
|
||||||
t.execute_with(|| {
|
t.execute_with(|| {
|
||||||
System::set_block_limits(w, 0);
|
System::set_block_consumed_resources(w, 0);
|
||||||
assertions()
|
assertions()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -196,7 +223,8 @@ mod multiplier_tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn multiplier_can_grow_from_zero() {
|
fn multiplier_can_grow_from_zero() {
|
||||||
let minimum_multiplier = MinimumMultiplier::get();
|
let minimum_multiplier = MinimumMultiplier::get();
|
||||||
let target = TargetBlockFullness::get() * (AvailableBlockRatio::get() * MaximumBlockWeight::get());
|
let target = TargetBlockFullness::get() *
|
||||||
|
BlockWeights::get().get(DispatchClass::Normal).max_total.unwrap();
|
||||||
// if the min is too small, then this will not change, and we are doomed forever.
|
// if the min is too small, then this will not change, and we are doomed forever.
|
||||||
// the weight is 1/10th bigger than target.
|
// the weight is 1/10th bigger than target.
|
||||||
run_with_system_weight(target * 101 / 100, || {
|
run_with_system_weight(target * 101 / 100, || {
|
||||||
|
|||||||
@@ -264,6 +264,7 @@ mod tests {
|
|||||||
use primitives::v1::{
|
use primitives::v1::{
|
||||||
Balance, BlockNumber, Header, Signature, AuthorityDiscoveryId,
|
Balance, BlockNumber, Header, Signature, AuthorityDiscoveryId,
|
||||||
};
|
};
|
||||||
|
use frame_system::limits;
|
||||||
use frame_support::{
|
use frame_support::{
|
||||||
traits::{Randomness, OnInitialize, OnFinalize},
|
traits::{Randomness, OnInitialize, OnFinalize},
|
||||||
impl_outer_origin, impl_outer_dispatch, assert_ok, parameter_types,
|
impl_outer_origin, impl_outer_dispatch, assert_ok, parameter_types,
|
||||||
@@ -299,11 +300,13 @@ mod tests {
|
|||||||
|
|
||||||
#[derive(Clone, Eq, PartialEq)]
|
#[derive(Clone, Eq, PartialEq)]
|
||||||
pub struct Test;
|
pub struct Test;
|
||||||
|
const NORMAL_RATIO: Perbill = Perbill::from_percent(75);
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const BlockHashCount: u32 = 250;
|
pub const BlockHashCount: u32 = 250;
|
||||||
pub const MaximumBlockWeight: u32 = 4 * 1024 * 1024;
|
pub BlockWeights: limits::BlockWeights =
|
||||||
pub const MaximumBlockLength: u32 = 4 * 1024 * 1024;
|
limits::BlockWeights::with_sensible_defaults(4 * 1024 * 1024, NORMAL_RATIO);
|
||||||
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
|
pub BlockLength: limits::BlockLength =
|
||||||
|
limits::BlockLength::max_with_normal_ratio(4 * 1024 * 1024, NORMAL_RATIO);
|
||||||
}
|
}
|
||||||
|
|
||||||
impl frame_system::Config for Test {
|
impl frame_system::Config for Test {
|
||||||
@@ -319,13 +322,9 @@ mod tests {
|
|||||||
type Header = Header;
|
type Header = Header;
|
||||||
type Event = ();
|
type Event = ();
|
||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
|
||||||
type DbWeight = ();
|
type DbWeight = ();
|
||||||
type BlockExecutionWeight = ();
|
type BlockWeights = BlockWeights;
|
||||||
type ExtrinsicBaseWeight = ();
|
type BlockLength = BlockLength;
|
||||||
type MaximumExtrinsicWeight = MaximumBlockWeight;
|
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
|
||||||
type Version = ();
|
type Version = ();
|
||||||
type PalletInfo = ();
|
type PalletInfo = ();
|
||||||
type AccountData = pallet_balances::AccountData<u128>;
|
type AccountData = pallet_balances::AccountData<u128>;
|
||||||
@@ -416,7 +415,7 @@ mod tests {
|
|||||||
type UnsignedPriority = StakingUnsignedPriority;
|
type UnsignedPriority = StakingUnsignedPriority;
|
||||||
type MaxIterations = ();
|
type MaxIterations = ();
|
||||||
type MinSolutionScoreBump = ();
|
type MinSolutionScoreBump = ();
|
||||||
type OffchainSolutionWeightLimit = MaximumBlockWeight;
|
type OffchainSolutionWeightLimit = ();
|
||||||
type WeightInfo = ();
|
type WeightInfo = ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ pub fn remove_pallet<T>() -> frame_support::weights::Weight
|
|||||||
remove_storage_prefix(b"Purchase", b"Statement", b"");
|
remove_storage_prefix(b"Purchase", b"Statement", b"");
|
||||||
remove_storage_prefix(b"Purchase", b"UnlockBlock", b"");
|
remove_storage_prefix(b"Purchase", b"UnlockBlock", b"");
|
||||||
|
|
||||||
T::MaximumBlockWeight::get()
|
<T as frame_system::Config>::BlockWeights::get().max_block
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
@@ -393,7 +393,7 @@ mod tests {
|
|||||||
// The testing primitives are very useful for avoiding having to work with signatures
|
// The testing primitives are very useful for avoiding having to work with signatures
|
||||||
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
|
// or public keys. `u64` is used as the `AccountId` and no `Signature`s are required.
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
Perbill, MultiSignature,
|
MultiSignature,
|
||||||
traits::{BlakeTwo256, IdentityLookup, Identity, Verify, IdentifyAccount, Dispatchable},
|
traits::{BlakeTwo256, IdentityLookup, Identity, Verify, IdentifyAccount, Dispatchable},
|
||||||
testing::Header
|
testing::Header
|
||||||
};
|
};
|
||||||
@@ -424,12 +424,12 @@ mod tests {
|
|||||||
pub struct Test;
|
pub struct Test;
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const BlockHashCount: u32 = 250;
|
pub const BlockHashCount: u32 = 250;
|
||||||
pub const MaximumBlockWeight: u32 = 4 * 1024 * 1024;
|
|
||||||
pub const MaximumBlockLength: u32 = 4 * 1024 * 1024;
|
|
||||||
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
|
|
||||||
}
|
}
|
||||||
impl frame_system::Config for Test {
|
impl frame_system::Config for Test {
|
||||||
type BaseCallFilter = ();
|
type BaseCallFilter = ();
|
||||||
|
type BlockWeights = ();
|
||||||
|
type BlockLength = ();
|
||||||
|
type DbWeight = ();
|
||||||
type Origin = Origin;
|
type Origin = Origin;
|
||||||
type Call = Call;
|
type Call = Call;
|
||||||
type Index = u64;
|
type Index = u64;
|
||||||
@@ -441,13 +441,6 @@ mod tests {
|
|||||||
type Header = Header;
|
type Header = Header;
|
||||||
type Event = ();
|
type Event = ();
|
||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
|
||||||
type DbWeight = ();
|
|
||||||
type BlockExecutionWeight = ();
|
|
||||||
type ExtrinsicBaseWeight = ();
|
|
||||||
type MaximumExtrinsicWeight = MaximumBlockWeight;
|
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
|
||||||
type Version = ();
|
type Version = ();
|
||||||
type PalletInfo = ();
|
type PalletInfo = ();
|
||||||
type AccountData = pallet_balances::AccountData<u64>;
|
type AccountData = pallet_balances::AccountData<u64>;
|
||||||
|
|||||||
@@ -942,10 +942,7 @@ mod tests {
|
|||||||
use std::{collections::HashMap, cell::RefCell};
|
use std::{collections::HashMap, cell::RefCell};
|
||||||
|
|
||||||
use sp_core::H256;
|
use sp_core::H256;
|
||||||
use sp_runtime::{
|
use sp_runtime::traits::{BlakeTwo256, Hash, IdentityLookup};
|
||||||
Perbill,
|
|
||||||
traits::{BlakeTwo256, Hash, IdentityLookup},
|
|
||||||
};
|
|
||||||
use frame_support::{
|
use frame_support::{
|
||||||
impl_outer_origin, parameter_types, assert_ok, assert_noop,
|
impl_outer_origin, parameter_types, assert_ok, assert_noop,
|
||||||
traits::{OnInitialize, OnFinalize}
|
traits::{OnInitialize, OnFinalize}
|
||||||
@@ -964,12 +961,12 @@ mod tests {
|
|||||||
pub struct Test;
|
pub struct Test;
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const BlockHashCount: u32 = 250;
|
pub const BlockHashCount: u32 = 250;
|
||||||
pub const MaximumBlockWeight: u32 = 4 * 1024 * 1024;
|
|
||||||
pub const MaximumBlockLength: u32 = 4 * 1024 * 1024;
|
|
||||||
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
|
|
||||||
}
|
}
|
||||||
impl frame_system::Config for Test {
|
impl frame_system::Config for Test {
|
||||||
type BaseCallFilter = ();
|
type BaseCallFilter = ();
|
||||||
|
type BlockWeights = ();
|
||||||
|
type BlockLength = ();
|
||||||
|
type DbWeight = ();
|
||||||
type Origin = Origin;
|
type Origin = Origin;
|
||||||
type Call = ();
|
type Call = ();
|
||||||
type Index = u64;
|
type Index = u64;
|
||||||
@@ -981,13 +978,6 @@ mod tests {
|
|||||||
type Header = Header;
|
type Header = Header;
|
||||||
type Event = ();
|
type Event = ();
|
||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
|
||||||
type DbWeight = ();
|
|
||||||
type BlockExecutionWeight = ();
|
|
||||||
type ExtrinsicBaseWeight = ();
|
|
||||||
type MaximumExtrinsicWeight = MaximumBlockWeight;
|
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
|
||||||
type Version = ();
|
type Version = ();
|
||||||
type PalletInfo = ();
|
type PalletInfo = ();
|
||||||
type AccountData = pallet_balances::AccountData<u64>;
|
type AccountData = pallet_balances::AccountData<u64>;
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ pub mod fee {
|
|||||||
/// node's balance type.
|
/// node's balance type.
|
||||||
///
|
///
|
||||||
/// This should typically create a mapping between the following ranges:
|
/// This should typically create a mapping between the following ranges:
|
||||||
/// - [0, frame_system::MaximumBlockWeight]
|
/// - [0, MAXIMUM_BLOCK_WEIGHT]
|
||||||
/// - [Balance::min, Balance::max]
|
/// - [Balance::min, Balance::max]
|
||||||
///
|
///
|
||||||
/// Yet, it can be used for any other sort of change to weight-fee. Some examples being:
|
/// Yet, it can be used for any other sort of change to weight-fee. Some examples being:
|
||||||
@@ -95,16 +95,16 @@ pub mod fee {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use frame_support::weights::WeightToFeePolynomial;
|
use frame_support::weights::WeightToFeePolynomial;
|
||||||
use runtime_common::{MaximumBlockWeight, ExtrinsicBaseWeight};
|
use runtime_common::{MAXIMUM_BLOCK_WEIGHT, ExtrinsicBaseWeight};
|
||||||
use super::fee::WeightToFee;
|
use super::fee::WeightToFee;
|
||||||
use super::currency::{CENTS, DOLLARS, MILLICENTS};
|
use super::currency::{CENTS, DOLLARS, MILLICENTS};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
// This function tests that the fee for `MaximumBlockWeight` of weight is correct
|
// This function tests that the fee for `MAXIMUM_BLOCK_WEIGHT` of weight is correct
|
||||||
fn full_block_fee_is_correct() {
|
fn full_block_fee_is_correct() {
|
||||||
// A full block should cost 16 DOLLARS
|
// A full block should cost 16 DOLLARS
|
||||||
println!("Base: {}", ExtrinsicBaseWeight::get());
|
println!("Base: {}", ExtrinsicBaseWeight::get());
|
||||||
let x = WeightToFee::calc(&MaximumBlockWeight::get());
|
let x = WeightToFee::calc(&MAXIMUM_BLOCK_WEIGHT);
|
||||||
let y = 16 * DOLLARS;
|
let y = 16 * DOLLARS;
|
||||||
assert!(x.max(y) - x.min(y) < MILLICENTS);
|
assert!(x.max(y) - x.min(y) < MILLICENTS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,9 +34,8 @@ use primitives::v1::{
|
|||||||
use runtime_common::{
|
use runtime_common::{
|
||||||
claims, SlowAdjustingFeeUpdate, CurrencyToVote,
|
claims, SlowAdjustingFeeUpdate, CurrencyToVote,
|
||||||
impls::DealWithFees,
|
impls::DealWithFees,
|
||||||
BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
|
BlockHashCount, RocksDbWeight, BlockWeights, BlockLength, OffchainSolutionWeightLimit,
|
||||||
MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight,
|
ParachainSessionKeyPlaceholder,
|
||||||
MaximumExtrinsicWeight, ParachainSessionKeyPlaceholder,
|
|
||||||
};
|
};
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
create_runtime_str, generic, impl_opaque_keys, ModuleId,
|
create_runtime_str, generic, impl_opaque_keys, ModuleId,
|
||||||
@@ -129,6 +128,8 @@ parameter_types! {
|
|||||||
|
|
||||||
impl frame_system::Config for Runtime {
|
impl frame_system::Config for Runtime {
|
||||||
type BaseCallFilter = BaseFilter;
|
type BaseCallFilter = BaseFilter;
|
||||||
|
type BlockWeights = BlockWeights;
|
||||||
|
type BlockLength = BlockLength;
|
||||||
type Origin = Origin;
|
type Origin = Origin;
|
||||||
type Call = Call;
|
type Call = Call;
|
||||||
type Index = Nonce;
|
type Index = Nonce;
|
||||||
@@ -140,13 +141,7 @@ impl frame_system::Config for Runtime {
|
|||||||
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
|
||||||
type DbWeight = RocksDbWeight;
|
type DbWeight = RocksDbWeight;
|
||||||
type BlockExecutionWeight = BlockExecutionWeight;
|
|
||||||
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
|
|
||||||
type MaximumExtrinsicWeight = MaximumExtrinsicWeight;
|
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
|
||||||
type Version = Version;
|
type Version = Version;
|
||||||
type PalletInfo = PalletInfo;
|
type PalletInfo = PalletInfo;
|
||||||
type AccountData = pallet_balances::AccountData<Balance>;
|
type AccountData = pallet_balances::AccountData<Balance>;
|
||||||
@@ -156,6 +151,8 @@ impl frame_system::Config for Runtime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
|
pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) *
|
||||||
|
BlockWeights::get().max_block;
|
||||||
pub const MaxScheduledPerBlock: u32 = 50;
|
pub const MaxScheduledPerBlock: u32 = 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,7 +161,7 @@ impl pallet_scheduler::Config for Runtime {
|
|||||||
type Origin = Origin;
|
type Origin = Origin;
|
||||||
type PalletsOrigin = OriginCaller;
|
type PalletsOrigin = OriginCaller;
|
||||||
type Call = Call;
|
type Call = Call;
|
||||||
type MaximumWeight = MaximumBlockWeight;
|
type MaximumWeight = MaximumSchedulerWeight;
|
||||||
type ScheduleOrigin = EnsureRoot<AccountId>;
|
type ScheduleOrigin = EnsureRoot<AccountId>;
|
||||||
type MaxScheduledPerBlock = MaxScheduledPerBlock;
|
type MaxScheduledPerBlock = MaxScheduledPerBlock;
|
||||||
type WeightInfo = weights::pallet_scheduler::WeightInfo<Runtime>;
|
type WeightInfo = weights::pallet_scheduler::WeightInfo<Runtime>;
|
||||||
@@ -326,9 +323,6 @@ parameter_types! {
|
|||||||
pub const ElectionLookahead: BlockNumber = EPOCH_DURATION_IN_BLOCKS / 4;
|
pub const ElectionLookahead: BlockNumber = EPOCH_DURATION_IN_BLOCKS / 4;
|
||||||
pub const MaxIterations: u32 = 10;
|
pub const MaxIterations: u32 = 10;
|
||||||
pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000);
|
pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000);
|
||||||
pub OffchainSolutionWeightLimit: Weight = MaximumExtrinsicWeight::get()
|
|
||||||
.saturating_sub(BlockExecutionWeight::get())
|
|
||||||
.saturating_sub(ExtrinsicBaseWeight::get());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type SlashCancelOrigin = EnsureOneOf<
|
type SlashCancelOrigin = EnsureOneOf<
|
||||||
@@ -557,7 +551,7 @@ impl pallet_treasury::Config for Runtime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get();
|
pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * BlockWeights::get().max_block;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl pallet_offences::Config for Runtime {
|
impl pallet_offences::Config for Runtime {
|
||||||
@@ -1107,7 +1101,7 @@ impl frame_support::traits::OnRuntimeUpgrade for FixCouncilHistoricalVotes {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
frame_support::debug::info!("Migration to fix voters happened. Accounts with inaccurate reserved amount: {}", failure);
|
frame_support::debug::info!("Migration to fix voters happened. Accounts with inaccurate reserved amount: {}", failure);
|
||||||
<Runtime as frame_system::Config>::MaximumBlockWeight::get()
|
<Runtime as frame_system::Config>::BlockWeights::get().max_block
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1534,11 +1528,12 @@ mod test_fees {
|
|||||||
#[test]
|
#[test]
|
||||||
#[ignore]
|
#[ignore]
|
||||||
fn block_cost() {
|
fn block_cost() {
|
||||||
let raw_fee = WeightToFee::calc(&MaximumBlockWeight::get());
|
let max_block_weight = BlockWeights::get().max_block;
|
||||||
|
let raw_fee = WeightToFee::calc(&max_block_weight);
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
"Full Block weight == {} // WeightToFee(full_block) == {} plank",
|
"Full Block weight == {} // WeightToFee(full_block) == {} plank",
|
||||||
MaximumBlockWeight::get(),
|
max_block_weight,
|
||||||
raw_fee.separated_string(),
|
raw_fee.separated_string(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,17 +17,14 @@
|
|||||||
//! Mocks for all the traits.
|
//! Mocks for all the traits.
|
||||||
|
|
||||||
use sp_io::TestExternalities;
|
use sp_io::TestExternalities;
|
||||||
use sp_core::{H256};
|
use sp_core::H256;
|
||||||
use sp_runtime::{
|
use sp_runtime::traits::{
|
||||||
Perbill,
|
|
||||||
traits::{
|
|
||||||
BlakeTwo256, IdentityLookup,
|
BlakeTwo256, IdentityLookup,
|
||||||
},
|
|
||||||
};
|
};
|
||||||
use primitives::v1::{AuthorityDiscoveryId, BlockNumber, Header};
|
use primitives::v1::{AuthorityDiscoveryId, BlockNumber, Header};
|
||||||
use frame_support::{
|
use frame_support::{
|
||||||
impl_outer_origin, impl_outer_dispatch, impl_outer_event, parameter_types,
|
impl_outer_origin, impl_outer_dispatch, impl_outer_event, parameter_types,
|
||||||
weights::Weight, traits::Randomness as RandomnessT,
|
traits::Randomness as RandomnessT,
|
||||||
};
|
};
|
||||||
use crate::inclusion;
|
use crate::inclusion;
|
||||||
use crate as parachains;
|
use crate as parachains;
|
||||||
@@ -65,13 +62,15 @@ impl RandomnessT<H256> for TestRandomness {
|
|||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const BlockHashCount: u32 = 250;
|
pub const BlockHashCount: u32 = 250;
|
||||||
pub const MaximumBlockWeight: Weight = 4 * 1024 * 1024;
|
pub BlockWeights: frame_system::limits::BlockWeights =
|
||||||
pub const MaximumBlockLength: u32 = 4 * 1024 * 1024;
|
frame_system::limits::BlockWeights::simple_max(4 * 1024 * 1024);
|
||||||
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl frame_system::Config for Test {
|
impl frame_system::Config for Test {
|
||||||
type BaseCallFilter = ();
|
type BaseCallFilter = ();
|
||||||
|
type BlockWeights = BlockWeights;
|
||||||
|
type BlockLength = ();
|
||||||
|
type DbWeight = ();
|
||||||
type Origin = Origin;
|
type Origin = Origin;
|
||||||
type Call = Call;
|
type Call = Call;
|
||||||
type Index = u64;
|
type Index = u64;
|
||||||
@@ -83,13 +82,6 @@ impl frame_system::Config for Test {
|
|||||||
type Header = Header;
|
type Header = Header;
|
||||||
type Event = TestEvent;
|
type Event = TestEvent;
|
||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
|
||||||
type DbWeight = ();
|
|
||||||
type BlockExecutionWeight = ();
|
|
||||||
type ExtrinsicBaseWeight = ();
|
|
||||||
type MaximumExtrinsicWeight = MaximumBlockWeight;
|
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
|
||||||
type Version = ();
|
type Version = ();
|
||||||
type PalletInfo = ();
|
type PalletInfo = ();
|
||||||
type AccountData = pallet_balances::AccountData<u128>;
|
type AccountData = pallet_balances::AccountData<u128>;
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ pub mod fee {
|
|||||||
/// node's balance type.
|
/// node's balance type.
|
||||||
///
|
///
|
||||||
/// This should typically create a mapping between the following ranges:
|
/// This should typically create a mapping between the following ranges:
|
||||||
/// - [0, frame_system::MaximumBlockWeight]
|
/// - [0, MAXIMUM_BLOCK_WEIGHT]
|
||||||
/// - [Balance::min, Balance::max]
|
/// - [Balance::min, Balance::max]
|
||||||
///
|
///
|
||||||
/// Yet, it can be used for any other sort of change to weight-fee. Some examples being:
|
/// Yet, it can be used for any other sort of change to weight-fee. Some examples being:
|
||||||
@@ -87,16 +87,16 @@ pub mod fee {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use frame_support::weights::WeightToFeePolynomial;
|
use frame_support::weights::WeightToFeePolynomial;
|
||||||
use runtime_common::{MaximumBlockWeight, ExtrinsicBaseWeight};
|
use runtime_common::{MAXIMUM_BLOCK_WEIGHT, ExtrinsicBaseWeight};
|
||||||
use super::fee::WeightToFee;
|
use super::fee::WeightToFee;
|
||||||
use super::currency::{CENTS, DOLLARS, MILLICENTS};
|
use super::currency::{CENTS, DOLLARS, MILLICENTS};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
// This function tests that the fee for `MaximumBlockWeight` of weight is correct
|
// This function tests that the fee for `MAXIMUM_BLOCK_WEIGHT` of weight is correct
|
||||||
fn full_block_fee_is_correct() {
|
fn full_block_fee_is_correct() {
|
||||||
// A full block should cost 16 DOLLARS
|
// A full block should cost 16 DOLLARS
|
||||||
println!("Base: {}", ExtrinsicBaseWeight::get());
|
println!("Base: {}", ExtrinsicBaseWeight::get());
|
||||||
let x = WeightToFee::calc(&MaximumBlockWeight::get());
|
let x = WeightToFee::calc(&MAXIMUM_BLOCK_WEIGHT);
|
||||||
let y = 16 * DOLLARS;
|
let y = 16 * DOLLARS;
|
||||||
assert!(x.max(y) - x.min(y) < MILLICENTS);
|
assert!(x.max(y) - x.min(y) < MILLICENTS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,9 +24,8 @@ use pallet_transaction_payment::CurrencyAdapter;
|
|||||||
use runtime_common::{
|
use runtime_common::{
|
||||||
claims, SlowAdjustingFeeUpdate, CurrencyToVote,
|
claims, SlowAdjustingFeeUpdate, CurrencyToVote,
|
||||||
impls::DealWithFees,
|
impls::DealWithFees,
|
||||||
BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
|
BlockHashCount, RocksDbWeight, BlockWeights, BlockLength, OffchainSolutionWeightLimit,
|
||||||
MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight,
|
ParachainSessionKeyPlaceholder,
|
||||||
MaximumExtrinsicWeight, ParachainSessionKeyPlaceholder,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use sp_std::prelude::*;
|
use sp_std::prelude::*;
|
||||||
@@ -142,6 +141,8 @@ parameter_types! {
|
|||||||
|
|
||||||
impl frame_system::Config for Runtime {
|
impl frame_system::Config for Runtime {
|
||||||
type BaseCallFilter = BaseFilter;
|
type BaseCallFilter = BaseFilter;
|
||||||
|
type BlockWeights = BlockWeights;
|
||||||
|
type BlockLength = BlockLength;
|
||||||
type Origin = Origin;
|
type Origin = Origin;
|
||||||
type Call = Call;
|
type Call = Call;
|
||||||
type Index = Nonce;
|
type Index = Nonce;
|
||||||
@@ -153,13 +154,7 @@ impl frame_system::Config for Runtime {
|
|||||||
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
|
||||||
type DbWeight = RocksDbWeight;
|
type DbWeight = RocksDbWeight;
|
||||||
type BlockExecutionWeight = BlockExecutionWeight;
|
|
||||||
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
|
|
||||||
type MaximumExtrinsicWeight = MaximumExtrinsicWeight;
|
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
|
||||||
type Version = Version;
|
type Version = Version;
|
||||||
type PalletInfo = PalletInfo;
|
type PalletInfo = PalletInfo;
|
||||||
type AccountData = pallet_balances::AccountData<Balance>;
|
type AccountData = pallet_balances::AccountData<Balance>;
|
||||||
@@ -169,6 +164,8 @@ impl frame_system::Config for Runtime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
|
pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) *
|
||||||
|
BlockWeights::get().max_block;
|
||||||
pub const MaxScheduledPerBlock: u32 = 50;
|
pub const MaxScheduledPerBlock: u32 = 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,7 +174,7 @@ impl pallet_scheduler::Config for Runtime {
|
|||||||
type Origin = Origin;
|
type Origin = Origin;
|
||||||
type PalletsOrigin = OriginCaller;
|
type PalletsOrigin = OriginCaller;
|
||||||
type Call = Call;
|
type Call = Call;
|
||||||
type MaximumWeight = MaximumBlockWeight;
|
type MaximumWeight = MaximumSchedulerWeight;
|
||||||
type ScheduleOrigin = EnsureRoot<AccountId>;
|
type ScheduleOrigin = EnsureRoot<AccountId>;
|
||||||
type MaxScheduledPerBlock = MaxScheduledPerBlock;
|
type MaxScheduledPerBlock = MaxScheduledPerBlock;
|
||||||
type WeightInfo = weights::pallet_scheduler::WeightInfo<Runtime>;
|
type WeightInfo = weights::pallet_scheduler::WeightInfo<Runtime>;
|
||||||
@@ -333,9 +330,6 @@ parameter_types! {
|
|||||||
pub const ElectionLookahead: BlockNumber = EPOCH_DURATION_IN_BLOCKS / 16;
|
pub const ElectionLookahead: BlockNumber = EPOCH_DURATION_IN_BLOCKS / 16;
|
||||||
pub const MaxIterations: u32 = 10;
|
pub const MaxIterations: u32 = 10;
|
||||||
pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000);
|
pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000);
|
||||||
pub OffchainSolutionWeightLimit: Weight = MaximumExtrinsicWeight::get()
|
|
||||||
.saturating_sub(BlockExecutionWeight::get())
|
|
||||||
.saturating_sub(ExtrinsicBaseWeight::get());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type SlashCancelOrigin = EnsureOneOf<
|
type SlashCancelOrigin = EnsureOneOf<
|
||||||
@@ -603,7 +597,7 @@ impl pallet_treasury::Config for Runtime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get();
|
pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * BlockWeights::get().max_block;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl pallet_offences::Config for Runtime {
|
impl pallet_offences::Config for Runtime {
|
||||||
|
|||||||
@@ -87,8 +87,8 @@ pub mod fee {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use frame_support::weights::WeightToFeePolynomial;
|
use frame_support::weights::{WeightToFeePolynomial, DispatchClass};
|
||||||
use runtime_common::{MaximumBlockWeight, ExtrinsicBaseWeight};
|
use runtime_common::BlockWeights;
|
||||||
use super::fee::WeightToFee;
|
use super::fee::WeightToFee;
|
||||||
use super::currency::{CENTS, DOLLARS, MILLICENTS};
|
use super::currency::{CENTS, DOLLARS, MILLICENTS};
|
||||||
|
|
||||||
@@ -96,8 +96,8 @@ mod tests {
|
|||||||
// This function tests that the fee for `MaximumBlockWeight` of weight is correct
|
// This function tests that the fee for `MaximumBlockWeight` of weight is correct
|
||||||
fn full_block_fee_is_correct() {
|
fn full_block_fee_is_correct() {
|
||||||
// A full block should cost 16 DOLLARS
|
// A full block should cost 16 DOLLARS
|
||||||
println!("Base: {}", ExtrinsicBaseWeight::get());
|
println!("Base: {}", BlockWeights::get().get(DispatchClass::Normal).base_extrinsic);
|
||||||
let x = WeightToFee::calc(&MaximumBlockWeight::get());
|
let x = WeightToFee::calc(&BlockWeights::get().max_block);
|
||||||
let y = 16 * DOLLARS;
|
let y = 16 * DOLLARS;
|
||||||
assert!(x.max(y) - x.min(y) < MILLICENTS);
|
assert!(x.max(y) - x.min(y) < MILLICENTS);
|
||||||
}
|
}
|
||||||
@@ -106,8 +106,9 @@ mod tests {
|
|||||||
// This function tests that the fee for `ExtrinsicBaseWeight` of weight is correct
|
// This function tests that the fee for `ExtrinsicBaseWeight` of weight is correct
|
||||||
fn extrinsic_base_fee_is_correct() {
|
fn extrinsic_base_fee_is_correct() {
|
||||||
// `ExtrinsicBaseWeight` should cost 1/10 of a CENT
|
// `ExtrinsicBaseWeight` should cost 1/10 of a CENT
|
||||||
println!("Base: {}", ExtrinsicBaseWeight::get());
|
let base_weight = BlockWeights::get().get(DispatchClass::Normal).base_extrinsic;
|
||||||
let x = WeightToFee::calc(&ExtrinsicBaseWeight::get());
|
println!("Base: {}", base_weight);
|
||||||
|
let x = WeightToFee::calc(&base_weight);
|
||||||
let y = CENTS / 10;
|
let y = CENTS / 10;
|
||||||
assert!(x.max(y) - x.min(y) < MILLICENTS);
|
assert!(x.max(y) - x.min(y) < MILLICENTS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,8 +33,7 @@ use primitives::v1::{
|
|||||||
use runtime_common::{
|
use runtime_common::{
|
||||||
SlowAdjustingFeeUpdate,
|
SlowAdjustingFeeUpdate,
|
||||||
impls::ToAuthor,
|
impls::ToAuthor,
|
||||||
BlockHashCount, MaximumBlockWeight, AvailableBlockRatio, MaximumBlockLength,
|
BlockHashCount, BlockWeights, BlockLength, RocksDbWeight, OffchainSolutionWeightLimit,
|
||||||
BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, MaximumExtrinsicWeight,
|
|
||||||
};
|
};
|
||||||
use runtime_parachains::{
|
use runtime_parachains::{
|
||||||
self,
|
self,
|
||||||
@@ -212,6 +211,9 @@ parameter_types! {
|
|||||||
|
|
||||||
impl frame_system::Config for Runtime {
|
impl frame_system::Config for Runtime {
|
||||||
type BaseCallFilter = BaseFilter;
|
type BaseCallFilter = BaseFilter;
|
||||||
|
type BlockWeights = BlockWeights;
|
||||||
|
type BlockLength = BlockLength;
|
||||||
|
type DbWeight = RocksDbWeight;
|
||||||
type Origin = Origin;
|
type Origin = Origin;
|
||||||
type Call = Call;
|
type Call = Call;
|
||||||
type Index = Nonce;
|
type Index = Nonce;
|
||||||
@@ -223,13 +225,6 @@ impl frame_system::Config for Runtime {
|
|||||||
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
|
||||||
type DbWeight = RocksDbWeight;
|
|
||||||
type BlockExecutionWeight = BlockExecutionWeight;
|
|
||||||
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
|
|
||||||
type MaximumExtrinsicWeight = MaximumExtrinsicWeight;
|
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
|
||||||
type Version = Version;
|
type Version = Version;
|
||||||
type PalletInfo = PalletInfo;
|
type PalletInfo = PalletInfo;
|
||||||
type AccountData = pallet_balances::AccountData<Balance>;
|
type AccountData = pallet_balances::AccountData<Balance>;
|
||||||
@@ -364,7 +359,7 @@ impl pallet_staking::Config for Runtime {
|
|||||||
type Call = Call;
|
type Call = Call;
|
||||||
type UnsignedPriority = StakingUnsignedPriority;
|
type UnsignedPriority = StakingUnsignedPriority;
|
||||||
type MaxIterations = MaxIterations;
|
type MaxIterations = MaxIterations;
|
||||||
type OffchainSolutionWeightLimit = MaximumBlockWeight;
|
type OffchainSolutionWeightLimit = OffchainSolutionWeightLimit;
|
||||||
type MinSolutionScoreBump = MinSolutionScoreBump;
|
type MinSolutionScoreBump = MinSolutionScoreBump;
|
||||||
type WeightInfo = ();
|
type WeightInfo = ();
|
||||||
}
|
}
|
||||||
@@ -398,7 +393,7 @@ parameter_types! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get();
|
pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * BlockWeights::get().max_block;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl pallet_offences::Config for Runtime {
|
impl pallet_offences::Config for Runtime {
|
||||||
|
|||||||
@@ -45,8 +45,7 @@ use primitives::v1::{
|
|||||||
};
|
};
|
||||||
use runtime_common::{
|
use runtime_common::{
|
||||||
claims, SlowAdjustingFeeUpdate, paras_sudo_wrapper,
|
claims, SlowAdjustingFeeUpdate, paras_sudo_wrapper,
|
||||||
BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
|
BlockHashCount, BlockWeights, BlockLength,
|
||||||
MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight,
|
|
||||||
};
|
};
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
create_runtime_str, generic, impl_opaque_keys,
|
create_runtime_str, generic, impl_opaque_keys,
|
||||||
@@ -125,6 +124,9 @@ parameter_types! {
|
|||||||
|
|
||||||
impl frame_system::Config for Runtime {
|
impl frame_system::Config for Runtime {
|
||||||
type BaseCallFilter = ();
|
type BaseCallFilter = ();
|
||||||
|
type BlockWeights = BlockWeights;
|
||||||
|
type BlockLength = BlockLength;
|
||||||
|
type DbWeight = ();
|
||||||
type Origin = Origin;
|
type Origin = Origin;
|
||||||
type Call = Call;
|
type Call = Call;
|
||||||
type Index = Nonce;
|
type Index = Nonce;
|
||||||
@@ -136,13 +138,6 @@ impl frame_system::Config for Runtime {
|
|||||||
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
|
||||||
type DbWeight = ();
|
|
||||||
type BlockExecutionWeight = BlockExecutionWeight;
|
|
||||||
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
|
|
||||||
type MaximumExtrinsicWeight = MaximumBlockWeight;
|
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
|
||||||
type Version = Version;
|
type Version = Version;
|
||||||
type PalletInfo = PalletInfo;
|
type PalletInfo = PalletInfo;
|
||||||
type AccountData = pallet_balances::AccountData<Balance>;
|
type AccountData = pallet_balances::AccountData<Balance>;
|
||||||
@@ -331,7 +326,7 @@ impl pallet_staking::Config for Runtime {
|
|||||||
type Call = Call;
|
type Call = Call;
|
||||||
type UnsignedPriority = StakingUnsignedPriority;
|
type UnsignedPriority = StakingUnsignedPriority;
|
||||||
type MaxIterations = MaxIterations;
|
type MaxIterations = MaxIterations;
|
||||||
type OffchainSolutionWeightLimit = MaximumBlockWeight;
|
type OffchainSolutionWeightLimit = ();
|
||||||
type MinSolutionScoreBump = MinSolutionScoreBump;
|
type MinSolutionScoreBump = MinSolutionScoreBump;
|
||||||
type WeightInfo = ();
|
type WeightInfo = ();
|
||||||
|
|
||||||
@@ -401,7 +396,7 @@ impl frame_system::offchain::SigningTypes for Runtime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub storage OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get();
|
pub storage OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * BlockWeights::get().max_block;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl pallet_offences::Config for Runtime {
|
impl pallet_offences::Config for Runtime {
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ pub mod fee {
|
|||||||
/// node's balance type.
|
/// node's balance type.
|
||||||
///
|
///
|
||||||
/// This should typically create a mapping between the following ranges:
|
/// This should typically create a mapping between the following ranges:
|
||||||
/// - [0, frame_system::MaximumBlockWeight]
|
/// - [0, MAXIMUM_BLOCK_WEIGHT]
|
||||||
/// - [Balance::min, Balance::max]
|
/// - [Balance::min, Balance::max]
|
||||||
///
|
///
|
||||||
/// Yet, it can be used for any other sort of change to weight-fee. Some examples being:
|
/// Yet, it can be used for any other sort of change to weight-fee. Some examples being:
|
||||||
@@ -87,16 +87,16 @@ pub mod fee {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use frame_support::weights::WeightToFeePolynomial;
|
use frame_support::weights::WeightToFeePolynomial;
|
||||||
use runtime_common::{MaximumBlockWeight, ExtrinsicBaseWeight};
|
use runtime_common::{MAXIMUM_BLOCK_WEIGHT, ExtrinsicBaseWeight};
|
||||||
use super::fee::WeightToFee;
|
use super::fee::WeightToFee;
|
||||||
use super::currency::{CENTS, DOLLARS, MILLICENTS};
|
use super::currency::{CENTS, DOLLARS, MILLICENTS};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
// This function tests that the fee for `MaximumBlockWeight` of weight is correct
|
// This function tests that the fee for `MAXIMUM_BLOCK_WEIGHT` of weight is correct
|
||||||
fn full_block_fee_is_correct() {
|
fn full_block_fee_is_correct() {
|
||||||
// A full block should cost 16 DOLLARS
|
// A full block should cost 16 DOLLARS
|
||||||
println!("Base: {}", ExtrinsicBaseWeight::get());
|
println!("Base: {}", ExtrinsicBaseWeight::get());
|
||||||
let x = WeightToFee::calc(&MaximumBlockWeight::get());
|
let x = WeightToFee::calc(&MAXIMUM_BLOCK_WEIGHT);
|
||||||
let y = 16 * DOLLARS;
|
let y = 16 * DOLLARS;
|
||||||
assert!(x.max(y) - x.min(y) < MILLICENTS);
|
assert!(x.max(y) - x.min(y) < MILLICENTS);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,8 +33,7 @@ use primitives::v1::{
|
|||||||
use runtime_common::{
|
use runtime_common::{
|
||||||
SlowAdjustingFeeUpdate, CurrencyToVote,
|
SlowAdjustingFeeUpdate, CurrencyToVote,
|
||||||
impls::ToAuthor,
|
impls::ToAuthor,
|
||||||
BlockHashCount, MaximumBlockWeight, AvailableBlockRatio, MaximumBlockLength,
|
BlockHashCount, BlockWeights, BlockLength, RocksDbWeight, OffchainSolutionWeightLimit,
|
||||||
BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, MaximumExtrinsicWeight,
|
|
||||||
ParachainSessionKeyPlaceholder,
|
ParachainSessionKeyPlaceholder,
|
||||||
};
|
};
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
@@ -120,6 +119,8 @@ parameter_types! {
|
|||||||
|
|
||||||
impl frame_system::Config for Runtime {
|
impl frame_system::Config for Runtime {
|
||||||
type BaseCallFilter = BaseFilter;
|
type BaseCallFilter = BaseFilter;
|
||||||
|
type BlockWeights = BlockWeights;
|
||||||
|
type BlockLength = BlockLength;
|
||||||
type Origin = Origin;
|
type Origin = Origin;
|
||||||
type Call = Call;
|
type Call = Call;
|
||||||
type Index = Nonce;
|
type Index = Nonce;
|
||||||
@@ -131,13 +132,7 @@ impl frame_system::Config for Runtime {
|
|||||||
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
type Header = generic::Header<BlockNumber, BlakeTwo256>;
|
||||||
type Event = Event;
|
type Event = Event;
|
||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
|
||||||
type DbWeight = RocksDbWeight;
|
type DbWeight = RocksDbWeight;
|
||||||
type BlockExecutionWeight = BlockExecutionWeight;
|
|
||||||
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
|
|
||||||
type MaximumExtrinsicWeight = MaximumExtrinsicWeight;
|
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
|
||||||
type Version = Version;
|
type Version = Version;
|
||||||
type PalletInfo = PalletInfo;
|
type PalletInfo = PalletInfo;
|
||||||
type AccountData = pallet_balances::AccountData<Balance>;
|
type AccountData = pallet_balances::AccountData<Balance>;
|
||||||
@@ -147,6 +142,8 @@ impl frame_system::Config for Runtime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
|
pub MaximumSchedulerWeight: Weight = Perbill::from_percent(80) *
|
||||||
|
BlockWeights::get().max_block;
|
||||||
pub const MaxScheduledPerBlock: u32 = 50;
|
pub const MaxScheduledPerBlock: u32 = 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,7 +152,7 @@ impl pallet_scheduler::Config for Runtime {
|
|||||||
type Origin = Origin;
|
type Origin = Origin;
|
||||||
type PalletsOrigin = OriginCaller;
|
type PalletsOrigin = OriginCaller;
|
||||||
type Call = Call;
|
type Call = Call;
|
||||||
type MaximumWeight = MaximumBlockWeight;
|
type MaximumWeight = MaximumSchedulerWeight;
|
||||||
type ScheduleOrigin = EnsureRoot<AccountId>;
|
type ScheduleOrigin = EnsureRoot<AccountId>;
|
||||||
type MaxScheduledPerBlock = MaxScheduledPerBlock;
|
type MaxScheduledPerBlock = MaxScheduledPerBlock;
|
||||||
type WeightInfo = weights::pallet_scheduler::WeightInfo<Runtime>;
|
type WeightInfo = weights::pallet_scheduler::WeightInfo<Runtime>;
|
||||||
@@ -312,9 +309,6 @@ parameter_types! {
|
|||||||
pub const ElectionLookahead: BlockNumber = EPOCH_DURATION_IN_BLOCKS / 4;
|
pub const ElectionLookahead: BlockNumber = EPOCH_DURATION_IN_BLOCKS / 4;
|
||||||
pub const MaxIterations: u32 = 10;
|
pub const MaxIterations: u32 = 10;
|
||||||
pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000);
|
pub MinSolutionScoreBump: Perbill = Perbill::from_rational_approximation(5u32, 10_000);
|
||||||
pub OffchainSolutionWeightLimit: Weight = MaximumExtrinsicWeight::get()
|
|
||||||
.saturating_sub(BlockExecutionWeight::get())
|
|
||||||
.saturating_sub(ExtrinsicBaseWeight::get());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl pallet_staking::Config for Runtime {
|
impl pallet_staking::Config for Runtime {
|
||||||
@@ -356,7 +350,7 @@ parameter_types! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * MaximumBlockWeight::get();
|
pub OffencesWeightSoftLimit: Weight = Perbill::from_percent(60) * BlockWeights::get().max_block;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl pallet_offences::Config for Runtime {
|
impl pallet_offences::Config for Runtime {
|
||||||
|
|||||||
Reference in New Issue
Block a user