mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
Introduce BlockExecutionWeight and ExtrinsicBaseWeight (#1023)
* Update to changes in Substrate * Fix trait * Remove `TransactionBaseFee` * add temporary values for extrinsic base weight and block execution weight * Update Cargo.lock
This commit is contained in:
Generated
+219
-218
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@ use frame_support::{
|
|||||||
decl_storage, decl_module, decl_error, ensure,
|
decl_storage, decl_module, decl_error, ensure,
|
||||||
dispatch::DispatchResult,
|
dispatch::DispatchResult,
|
||||||
traits::Get,
|
traits::Get,
|
||||||
weights::{MINIMUM_WEIGHT, DispatchClass},
|
weights::DispatchClass,
|
||||||
};
|
};
|
||||||
|
|
||||||
use primitives::{Hash, parachain::{AttestedCandidate, AbridgedCandidateReceipt, Id as ParaId}};
|
use primitives::{Hash, parachain::{AttestedCandidate, AbridgedCandidateReceipt, Id as ParaId}};
|
||||||
@@ -134,7 +134,7 @@ decl_module! {
|
|||||||
type Error = Error<T>;
|
type Error = Error<T>;
|
||||||
|
|
||||||
/// Provide candidate receipts for parachains, in ascending order by id.
|
/// Provide candidate receipts for parachains, in ascending order by id.
|
||||||
#[weight = (MINIMUM_WEIGHT, DispatchClass::Mandatory)]
|
#[weight = (0, DispatchClass::Mandatory)]
|
||||||
fn more_attestations(origin, _more: MoreAttestations) -> DispatchResult {
|
fn more_attestations(origin, _more: MoreAttestations) -> DispatchResult {
|
||||||
ensure_none(origin)?;
|
ensure_none(origin)?;
|
||||||
ensure!(!DidUpdate::exists(), Error::<T>::TooManyAttestations);
|
ensure!(!DidUpdate::exists(), Error::<T>::TooManyAttestations);
|
||||||
|
|||||||
@@ -390,6 +390,8 @@ mod tests {
|
|||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
type MaximumBlockWeight = MaximumBlockWeight;
|
||||||
type DbWeight = ();
|
type DbWeight = ();
|
||||||
|
type BlockExecutionWeight = ();
|
||||||
|
type ExtrinsicBaseWeight = ();
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
type MaximumBlockLength = MaximumBlockLength;
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = ();
|
type Version = ();
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ use frame_support::{
|
|||||||
traits::{
|
traits::{
|
||||||
Currency, Get, OnUnbalanced, WithdrawReason, ExistenceRequirement::AllowDeath
|
Currency, Get, OnUnbalanced, WithdrawReason, ExistenceRequirement::AllowDeath
|
||||||
},
|
},
|
||||||
weights::MINIMUM_WEIGHT,
|
|
||||||
};
|
};
|
||||||
use system::ensure_signed;
|
use system::ensure_signed;
|
||||||
use sp_runtime::{ModuleId,
|
use sp_runtime::{ModuleId,
|
||||||
@@ -297,7 +296,7 @@ decl_module! {
|
|||||||
/// Contribute to a crowd sale. This will transfer some balance over to fund a parachain
|
/// Contribute to a crowd sale. This will transfer some balance over to fund a parachain
|
||||||
/// slot. It will be withdrawable in two instances: the parachain becomes retired; or the
|
/// slot. It will be withdrawable in two instances: the parachain becomes retired; or the
|
||||||
/// slot is unable to be purchased and the timeout expires.
|
/// slot is unable to be purchased and the timeout expires.
|
||||||
#[weight = MINIMUM_WEIGHT]
|
#[weight = 0]
|
||||||
fn contribute(origin, #[compact] index: FundIndex, #[compact] value: BalanceOf<T>) {
|
fn contribute(origin, #[compact] index: FundIndex, #[compact] value: BalanceOf<T>) {
|
||||||
let who = ensure_signed(origin)?;
|
let who = ensure_signed(origin)?;
|
||||||
|
|
||||||
@@ -356,7 +355,7 @@ decl_module! {
|
|||||||
/// - `index` is the fund index that `origin` owns and whose deploy data will be set.
|
/// - `index` is the fund index that `origin` owns and whose deploy data will be set.
|
||||||
/// - `code_hash` is the hash of the parachain's Wasm validation function.
|
/// - `code_hash` is the hash of the parachain's Wasm validation function.
|
||||||
/// - `initial_head_data` is the parachain's initial head data.
|
/// - `initial_head_data` is the parachain's initial head data.
|
||||||
#[weight = MINIMUM_WEIGHT]
|
#[weight = 0]
|
||||||
fn fix_deploy_data(origin,
|
fn fix_deploy_data(origin,
|
||||||
#[compact] index: FundIndex,
|
#[compact] index: FundIndex,
|
||||||
code_hash: T::Hash,
|
code_hash: T::Hash,
|
||||||
@@ -382,7 +381,7 @@ decl_module! {
|
|||||||
///
|
///
|
||||||
/// - `index` is the fund index that `origin` owns and whose deploy data will be set.
|
/// - `index` is the fund index that `origin` owns and whose deploy data will be set.
|
||||||
/// - `para_id` is the parachain index that this fund won.
|
/// - `para_id` is the parachain index that this fund won.
|
||||||
#[weight = MINIMUM_WEIGHT]
|
#[weight = 0]
|
||||||
fn onboard(origin,
|
fn onboard(origin,
|
||||||
#[compact] index: FundIndex,
|
#[compact] index: FundIndex,
|
||||||
#[compact] para_id: ParaId
|
#[compact] para_id: ParaId
|
||||||
@@ -411,7 +410,7 @@ decl_module! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Note that a successful fund has lost its parachain slot, and place it into retirement.
|
/// Note that a successful fund has lost its parachain slot, and place it into retirement.
|
||||||
#[weight = MINIMUM_WEIGHT]
|
#[weight = 0]
|
||||||
fn begin_retirement(origin, #[compact] index: FundIndex) {
|
fn begin_retirement(origin, #[compact] index: FundIndex) {
|
||||||
let _ = ensure_signed(origin)?;
|
let _ = ensure_signed(origin)?;
|
||||||
|
|
||||||
@@ -433,7 +432,7 @@ decl_module! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Withdraw full balance of a contributor to an unsuccessful or off-boarded fund.
|
/// Withdraw full balance of a contributor to an unsuccessful or off-boarded fund.
|
||||||
#[weight = MINIMUM_WEIGHT]
|
#[weight = 0]
|
||||||
fn withdraw(origin, #[compact] index: FundIndex) {
|
fn withdraw(origin, #[compact] index: FundIndex) {
|
||||||
let who = ensure_signed(origin)?;
|
let who = ensure_signed(origin)?;
|
||||||
|
|
||||||
@@ -464,7 +463,7 @@ decl_module! {
|
|||||||
/// Remove a fund after either: it was unsuccessful and it timed out; or it was successful
|
/// Remove a fund after either: it was unsuccessful and it timed out; or it was successful
|
||||||
/// but it has been retired from its parachain slot. This places any deposits that were not
|
/// but it has been retired from its parachain slot. This places any deposits that were not
|
||||||
/// withdrawn into the treasury.
|
/// withdrawn into the treasury.
|
||||||
#[weight = MINIMUM_WEIGHT]
|
#[weight = 0]
|
||||||
fn dissolve(origin, #[compact] index: FundIndex) {
|
fn dissolve(origin, #[compact] index: FundIndex) {
|
||||||
let _ = ensure_signed(origin)?;
|
let _ = ensure_signed(origin)?;
|
||||||
|
|
||||||
@@ -607,6 +606,8 @@ mod tests {
|
|||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
type MaximumBlockWeight = MaximumBlockWeight;
|
||||||
type DbWeight = ();
|
type DbWeight = ();
|
||||||
|
type BlockExecutionWeight = ();
|
||||||
|
type ExtrinsicBaseWeight = ();
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
type MaximumBlockLength = MaximumBlockLength;
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = ();
|
type Version = ();
|
||||||
|
|||||||
@@ -53,4 +53,6 @@ parameter_types! {
|
|||||||
pub const MaximumBlockWeight: Weight = 2_000_000_000_000;
|
pub const MaximumBlockWeight: Weight = 2_000_000_000_000;
|
||||||
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
|
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
|
||||||
pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
|
pub const MaximumBlockLength: u32 = 5 * 1024 * 1024;
|
||||||
|
pub const ExtrinsicBaseWeight: Weight = 100_000_000; // TODO: Confirm/Update
|
||||||
|
pub const BlockExecutionWeight: Weight = 1_000_000_000; // TODO: Confirm/Update
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ use sp_staking::{
|
|||||||
use frame_support::{
|
use frame_support::{
|
||||||
traits::KeyOwnerProofSystem,
|
traits::KeyOwnerProofSystem,
|
||||||
dispatch::{IsSubType},
|
dispatch::{IsSubType},
|
||||||
weights::{DispatchClass, Weight, MINIMUM_WEIGHT},
|
weights::{DispatchClass, Weight},
|
||||||
};
|
};
|
||||||
use primitives::{
|
use primitives::{
|
||||||
Balance,
|
Balance,
|
||||||
@@ -556,7 +556,7 @@ decl_module! {
|
|||||||
Self::do_old_code_pruning(now);
|
Self::do_old_code_pruning(now);
|
||||||
|
|
||||||
// TODO https://github.com/paritytech/polkadot/issues/977: set correctly
|
// TODO https://github.com/paritytech/polkadot/issues/977: set correctly
|
||||||
MINIMUM_WEIGHT
|
0
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_finalize() {
|
fn on_finalize() {
|
||||||
@@ -1633,6 +1633,8 @@ mod tests {
|
|||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
type MaximumBlockWeight = MaximumBlockWeight;
|
||||||
type DbWeight = ();
|
type DbWeight = ();
|
||||||
|
type BlockExecutionWeight = ();
|
||||||
|
type ExtrinsicBaseWeight = ();
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
type MaximumBlockLength = MaximumBlockLength;
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = ();
|
type Version = ();
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ use sp_runtime::{
|
|||||||
use frame_support::{
|
use frame_support::{
|
||||||
decl_storage, decl_module, decl_event, decl_error, ensure,
|
decl_storage, decl_module, decl_event, decl_error, ensure,
|
||||||
dispatch::{DispatchResult, IsSubType}, traits::{Get, Currency, ReservableCurrency},
|
dispatch::{DispatchResult, IsSubType}, traits::{Get, Currency, ReservableCurrency},
|
||||||
weights::{DispatchClass, Weight, MINIMUM_WEIGHT},
|
weights::{DispatchClass, Weight},
|
||||||
};
|
};
|
||||||
use system::{self, ensure_root, ensure_signed};
|
use system::{self, ensure_root, ensure_signed};
|
||||||
use primitives::parachain::{
|
use primitives::parachain::{
|
||||||
@@ -300,7 +300,7 @@ decl_module! {
|
|||||||
/// - `count`: The number of parathreads.
|
/// - `count`: The number of parathreads.
|
||||||
///
|
///
|
||||||
/// Must be called from Root origin.
|
/// Must be called from Root origin.
|
||||||
#[weight = MINIMUM_WEIGHT]
|
#[weight = 0]
|
||||||
fn set_thread_count(origin, count: u32) {
|
fn set_thread_count(origin, count: u32) {
|
||||||
ensure_root(origin)?;
|
ensure_root(origin)?;
|
||||||
ThreadCount::put(count);
|
ThreadCount::put(count);
|
||||||
@@ -314,7 +314,7 @@ decl_module! {
|
|||||||
/// Unlike `register_para`, this function does check that the maximum code size
|
/// Unlike `register_para`, this function does check that the maximum code size
|
||||||
/// and head data size are respected, as parathread registration is an atomic
|
/// and head data size are respected, as parathread registration is an atomic
|
||||||
/// action.
|
/// action.
|
||||||
#[weight = MINIMUM_WEIGHT]
|
#[weight = 0]
|
||||||
fn register_parathread(origin,
|
fn register_parathread(origin,
|
||||||
code: ValidationCode,
|
code: ValidationCode,
|
||||||
initial_head_data: HeadData,
|
initial_head_data: HeadData,
|
||||||
@@ -354,7 +354,7 @@ decl_module! {
|
|||||||
/// This is a kind of special transaction that should be heavily prioritized in the
|
/// This is a kind of special transaction that should be heavily prioritized in the
|
||||||
/// transaction pool according to the `value`; only `ThreadCount` of them may be presented
|
/// transaction pool according to the `value`; only `ThreadCount` of them may be presented
|
||||||
/// in any single block.
|
/// in any single block.
|
||||||
#[weight = MINIMUM_WEIGHT]
|
#[weight = 0]
|
||||||
fn select_parathread(origin,
|
fn select_parathread(origin,
|
||||||
#[compact] _id: ParaId,
|
#[compact] _id: ParaId,
|
||||||
_collator: CollatorId,
|
_collator: CollatorId,
|
||||||
@@ -371,7 +371,7 @@ decl_module! {
|
|||||||
/// Ensure that before calling this that any funds you want emptied from the parathread's
|
/// Ensure that before calling this that any funds you want emptied from the parathread's
|
||||||
/// account is moved out; after this it will be impossible to retrieve them (without
|
/// account is moved out; after this it will be impossible to retrieve them (without
|
||||||
/// governance intervention).
|
/// governance intervention).
|
||||||
#[weight = MINIMUM_WEIGHT]
|
#[weight = 0]
|
||||||
fn deregister_parathread(origin) {
|
fn deregister_parathread(origin) {
|
||||||
let id = parachains::ensure_parachain(<T as Trait>::Origin::from(origin))?;
|
let id = parachains::ensure_parachain(<T as Trait>::Origin::from(origin))?;
|
||||||
|
|
||||||
@@ -395,7 +395,7 @@ decl_module! {
|
|||||||
/// `ParaId` to be a long-term identifier of a notional "parachain". However, their
|
/// `ParaId` to be a long-term identifier of a notional "parachain". However, their
|
||||||
/// scheduling info (i.e. whether they're a parathread or parachain), auction information
|
/// scheduling info (i.e. whether they're a parathread or parachain), auction information
|
||||||
/// and the auction deposit are switched.
|
/// and the auction deposit are switched.
|
||||||
#[weight = MINIMUM_WEIGHT]
|
#[weight = 0]
|
||||||
fn swap(origin, #[compact] other: ParaId) {
|
fn swap(origin, #[compact] other: ParaId) {
|
||||||
let id = parachains::ensure_parachain(<T as Trait>::Origin::from(origin))?;
|
let id = parachains::ensure_parachain(<T as Trait>::Origin::from(origin))?;
|
||||||
|
|
||||||
@@ -466,7 +466,7 @@ decl_module! {
|
|||||||
|
|
||||||
Active::put(paras);
|
Active::put(paras);
|
||||||
|
|
||||||
MINIMUM_WEIGHT
|
0
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_finalize() {
|
fn on_finalize() {
|
||||||
@@ -736,6 +736,8 @@ mod tests {
|
|||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
type MaximumBlockWeight = MaximumBlockWeight;
|
||||||
type DbWeight = ();
|
type DbWeight = ();
|
||||||
|
type BlockExecutionWeight = ();
|
||||||
|
type ExtrinsicBaseWeight = ();
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
type MaximumBlockLength = MaximumBlockLength;
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = ();
|
type Version = ();
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ use codec::{Encode, Decode, Codec};
|
|||||||
use frame_support::{
|
use frame_support::{
|
||||||
decl_module, decl_storage, decl_event, decl_error, ensure, dispatch::DispatchResult,
|
decl_module, decl_storage, decl_event, decl_error, ensure, dispatch::DispatchResult,
|
||||||
traits::{Currency, ReservableCurrency, WithdrawReason, ExistenceRequirement, Get, Randomness},
|
traits::{Currency, ReservableCurrency, WithdrawReason, ExistenceRequirement, Get, Randomness},
|
||||||
weights::{MINIMUM_WEIGHT, DispatchClass, Weight},
|
weights::{DispatchClass, Weight},
|
||||||
};
|
};
|
||||||
use primitives::parachain::{
|
use primitives::parachain::{
|
||||||
SwapAux, PARACHAIN_INFO, Id as ParaId, ValidationCode, HeadData,
|
SwapAux, PARACHAIN_INFO, Id as ParaId, ValidationCode, HeadData,
|
||||||
@@ -286,7 +286,7 @@ decl_module! {
|
|||||||
Self::manage_lease_period_start(lease_period_index);
|
Self::manage_lease_period_start(lease_period_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
MINIMUM_WEIGHT
|
0
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_finalize(now: T::BlockNumber) {
|
fn on_finalize(now: T::BlockNumber) {
|
||||||
@@ -922,6 +922,8 @@ mod tests {
|
|||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
type MaximumBlockWeight = MaximumBlockWeight;
|
||||||
type DbWeight = ();
|
type DbWeight = ();
|
||||||
|
type BlockExecutionWeight = ();
|
||||||
|
type ExtrinsicBaseWeight = ();
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
type MaximumBlockLength = MaximumBlockLength;
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = ();
|
type Version = ();
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ use primitives::{
|
|||||||
use runtime_common::{attestations, claims, parachains, registrar, slots,
|
use runtime_common::{attestations, claims, parachains, registrar, slots,
|
||||||
impls::{CurrencyToVoteHandler, TargetedFeeAdjustment, ToAuthor},
|
impls::{CurrencyToVoteHandler, TargetedFeeAdjustment, ToAuthor},
|
||||||
NegativeImbalance, BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
|
NegativeImbalance, BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
|
||||||
MaximumBlockLength,
|
MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight,
|
||||||
};
|
};
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
create_runtime_str, generic, impl_opaque_keys, ModuleId,
|
create_runtime_str, generic, impl_opaque_keys, ModuleId,
|
||||||
@@ -145,6 +145,8 @@ impl system::Trait for Runtime {
|
|||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
type MaximumBlockWeight = MaximumBlockWeight;
|
||||||
type DbWeight = ();
|
type DbWeight = ();
|
||||||
|
type BlockExecutionWeight = BlockExecutionWeight;
|
||||||
|
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
type MaximumBlockLength = MaximumBlockLength;
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = Version;
|
type Version = Version;
|
||||||
@@ -206,7 +208,6 @@ impl balances::Trait for Runtime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const TransactionBaseFee: Balance = 1 * CENTS;
|
|
||||||
pub const TransactionByteFee: Balance = 10 * MILLICENTS;
|
pub const TransactionByteFee: Balance = 10 * MILLICENTS;
|
||||||
// for a sane configuration, this should always be less than `AvailableBlockRatio`.
|
// for a sane configuration, this should always be less than `AvailableBlockRatio`.
|
||||||
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
|
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
|
||||||
@@ -215,7 +216,6 @@ parameter_types! {
|
|||||||
impl transaction_payment::Trait for Runtime {
|
impl transaction_payment::Trait for Runtime {
|
||||||
type Currency = Balances;
|
type Currency = Balances;
|
||||||
type OnTransactionPayment = DealWithFees;
|
type OnTransactionPayment = DealWithFees;
|
||||||
type TransactionBaseFee = TransactionBaseFee;
|
|
||||||
type TransactionByteFee = TransactionByteFee;
|
type TransactionByteFee = TransactionByteFee;
|
||||||
type WeightToFee = WeightToFee;
|
type WeightToFee = WeightToFee;
|
||||||
type FeeMultiplierUpdate = TargetedFeeAdjustment<TargetBlockFullness, Self>;
|
type FeeMultiplierUpdate = TargetedFeeAdjustment<TargetBlockFullness, Self>;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
use runtime_common::{attestations, claims, parachains, registrar, slots,
|
use runtime_common::{attestations, claims, parachains, registrar, slots,
|
||||||
impls::{CurrencyToVoteHandler, TargetedFeeAdjustment, ToAuthor},
|
impls::{CurrencyToVoteHandler, TargetedFeeAdjustment, ToAuthor},
|
||||||
NegativeImbalance, BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
|
NegativeImbalance, BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
|
||||||
MaximumBlockLength,
|
MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight,
|
||||||
};
|
};
|
||||||
|
|
||||||
use sp_std::prelude::*;
|
use sp_std::prelude::*;
|
||||||
@@ -151,6 +151,8 @@ impl system::Trait for Runtime {
|
|||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
type MaximumBlockWeight = MaximumBlockWeight;
|
||||||
type DbWeight = ();
|
type DbWeight = ();
|
||||||
|
type BlockExecutionWeight = BlockExecutionWeight;
|
||||||
|
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
type MaximumBlockLength = MaximumBlockLength;
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = Version;
|
type Version = Version;
|
||||||
@@ -212,7 +214,6 @@ impl balances::Trait for Runtime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const TransactionBaseFee: Balance = 1 * CENTS;
|
|
||||||
pub const TransactionByteFee: Balance = 10 * MILLICENTS;
|
pub const TransactionByteFee: Balance = 10 * MILLICENTS;
|
||||||
// for a sane configuration, this should always be less than `AvailableBlockRatio`.
|
// for a sane configuration, this should always be less than `AvailableBlockRatio`.
|
||||||
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
|
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
|
||||||
@@ -221,7 +222,6 @@ parameter_types! {
|
|||||||
impl transaction_payment::Trait for Runtime {
|
impl transaction_payment::Trait for Runtime {
|
||||||
type Currency = Balances;
|
type Currency = Balances;
|
||||||
type OnTransactionPayment = DealWithFees;
|
type OnTransactionPayment = DealWithFees;
|
||||||
type TransactionBaseFee = TransactionBaseFee;
|
|
||||||
type TransactionByteFee = TransactionByteFee;
|
type TransactionByteFee = TransactionByteFee;
|
||||||
type WeightToFee = WeightToFee;
|
type WeightToFee = WeightToFee;
|
||||||
type FeeMultiplierUpdate = TargetedFeeAdjustment<TargetBlockFullness, Self>;
|
type FeeMultiplierUpdate = TargetedFeeAdjustment<TargetBlockFullness, Self>;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ use primitives::{
|
|||||||
use runtime_common::{attestations, claims, parachains, registrar, slots,
|
use runtime_common::{attestations, claims, parachains, registrar, slots,
|
||||||
impls::{CurrencyToVoteHandler, TargetedFeeAdjustment},
|
impls::{CurrencyToVoteHandler, TargetedFeeAdjustment},
|
||||||
BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
|
BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
|
||||||
MaximumBlockLength,
|
MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight,
|
||||||
};
|
};
|
||||||
use sp_core::sr25519;
|
use sp_core::sr25519;
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
@@ -143,6 +143,8 @@ impl system::Trait for Runtime {
|
|||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
type MaximumBlockWeight = MaximumBlockWeight;
|
||||||
type DbWeight = ();
|
type DbWeight = ();
|
||||||
|
type BlockExecutionWeight = BlockExecutionWeight;
|
||||||
|
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
type MaximumBlockLength = MaximumBlockLength;
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = Version;
|
type Version = Version;
|
||||||
@@ -196,7 +198,6 @@ impl balances::Trait for Runtime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const TransactionBaseFee: Balance = 1 * CENTS;
|
|
||||||
pub const TransactionByteFee: Balance = 10 * MILLICENTS;
|
pub const TransactionByteFee: Balance = 10 * MILLICENTS;
|
||||||
// for a sane configuration, this should always be less than `AvailableBlockRatio`.
|
// for a sane configuration, this should always be less than `AvailableBlockRatio`.
|
||||||
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
|
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
|
||||||
@@ -205,7 +206,6 @@ parameter_types! {
|
|||||||
impl transaction_payment::Trait for Runtime {
|
impl transaction_payment::Trait for Runtime {
|
||||||
type Currency = Balances;
|
type Currency = Balances;
|
||||||
type OnTransactionPayment = ();
|
type OnTransactionPayment = ();
|
||||||
type TransactionBaseFee = TransactionBaseFee;
|
|
||||||
type TransactionByteFee = TransactionByteFee;
|
type TransactionByteFee = TransactionByteFee;
|
||||||
type WeightToFee = WeightToFee;
|
type WeightToFee = WeightToFee;
|
||||||
type FeeMultiplierUpdate = TargetedFeeAdjustment<TargetBlockFullness, Self>;
|
type FeeMultiplierUpdate = TargetedFeeAdjustment<TargetBlockFullness, Self>;
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ use primitives::{
|
|||||||
use runtime_common::{attestations, parachains, registrar,
|
use runtime_common::{attestations, parachains, registrar,
|
||||||
impls::{CurrencyToVoteHandler, TargetedFeeAdjustment, ToAuthor},
|
impls::{CurrencyToVoteHandler, TargetedFeeAdjustment, ToAuthor},
|
||||||
BlockHashCount, MaximumBlockWeight, AvailableBlockRatio, MaximumBlockLength,
|
BlockHashCount, MaximumBlockWeight, AvailableBlockRatio, MaximumBlockLength,
|
||||||
|
BlockExecutionWeight, ExtrinsicBaseWeight
|
||||||
};
|
};
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
create_runtime_str, generic, impl_opaque_keys,
|
create_runtime_str, generic, impl_opaque_keys,
|
||||||
@@ -144,6 +145,8 @@ impl system::Trait for Runtime {
|
|||||||
type BlockHashCount = BlockHashCount;
|
type BlockHashCount = BlockHashCount;
|
||||||
type MaximumBlockWeight = MaximumBlockWeight;
|
type MaximumBlockWeight = MaximumBlockWeight;
|
||||||
type DbWeight = ();
|
type DbWeight = ();
|
||||||
|
type BlockExecutionWeight = BlockExecutionWeight;
|
||||||
|
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
|
||||||
type MaximumBlockLength = MaximumBlockLength;
|
type MaximumBlockLength = MaximumBlockLength;
|
||||||
type AvailableBlockRatio = AvailableBlockRatio;
|
type AvailableBlockRatio = AvailableBlockRatio;
|
||||||
type Version = Version;
|
type Version = Version;
|
||||||
@@ -197,7 +200,6 @@ impl balances::Trait for Runtime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
pub const TransactionBaseFee: Balance = 1 * CENTS;
|
|
||||||
pub const TransactionByteFee: Balance = 10 * MILLICENTS;
|
pub const TransactionByteFee: Balance = 10 * MILLICENTS;
|
||||||
// for a sane configuration, this should always be less than `AvailableBlockRatio`.
|
// for a sane configuration, this should always be less than `AvailableBlockRatio`.
|
||||||
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
|
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
|
||||||
@@ -206,7 +208,6 @@ parameter_types! {
|
|||||||
impl transaction_payment::Trait for Runtime {
|
impl transaction_payment::Trait for Runtime {
|
||||||
type Currency = Balances;
|
type Currency = Balances;
|
||||||
type OnTransactionPayment = ToAuthor<Runtime>;
|
type OnTransactionPayment = ToAuthor<Runtime>;
|
||||||
type TransactionBaseFee = TransactionBaseFee;
|
|
||||||
type TransactionByteFee = TransactionByteFee;
|
type TransactionByteFee = TransactionByteFee;
|
||||||
type WeightToFee = WeightToFee;
|
type WeightToFee = WeightToFee;
|
||||||
type FeeMultiplierUpdate = TargetedFeeAdjustment<TargetBlockFullness, Self>;
|
type FeeMultiplierUpdate = TargetedFeeAdjustment<TargetBlockFullness, Self>;
|
||||||
|
|||||||
Reference in New Issue
Block a user