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:
Shawn Tabrizi
2020-04-25 10:04:35 +02:00
committed by GitHub
parent 5733869389
commit 0a10e37c99
12 changed files with 262 additions and 249 deletions
+3 -3
View File
@@ -30,7 +30,7 @@ use primitives::{
use runtime_common::{attestations, claims, parachains, registrar, slots,
impls::{CurrencyToVoteHandler, TargetedFeeAdjustment, ToAuthor},
NegativeImbalance, BlockHashCount, MaximumBlockWeight, AvailableBlockRatio,
MaximumBlockLength,
MaximumBlockLength, BlockExecutionWeight, ExtrinsicBaseWeight,
};
use sp_runtime::{
create_runtime_str, generic, impl_opaque_keys, ModuleId,
@@ -145,6 +145,8 @@ impl system::Trait for Runtime {
type BlockHashCount = BlockHashCount;
type MaximumBlockWeight = MaximumBlockWeight;
type DbWeight = ();
type BlockExecutionWeight = BlockExecutionWeight;
type ExtrinsicBaseWeight = ExtrinsicBaseWeight;
type MaximumBlockLength = MaximumBlockLength;
type AvailableBlockRatio = AvailableBlockRatio;
type Version = Version;
@@ -206,7 +208,6 @@ impl balances::Trait for Runtime {
}
parameter_types! {
pub const TransactionBaseFee: Balance = 1 * CENTS;
pub const TransactionByteFee: Balance = 10 * MILLICENTS;
// for a sane configuration, this should always be less than `AvailableBlockRatio`.
pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25);
@@ -215,7 +216,6 @@ parameter_types! {
impl transaction_payment::Trait for Runtime {
type Currency = Balances;
type OnTransactionPayment = DealWithFees;
type TransactionBaseFee = TransactionBaseFee;
type TransactionByteFee = TransactionByteFee;
type WeightToFee = WeightToFee;
type FeeMultiplierUpdate = TargetedFeeAdjustment<TargetBlockFullness, Self>;