mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 08:47:57 +00:00
Companion for Weight v1.5 (#1581)
* cargo test -p cumulus-primitives-utility
* cargo test -p cumulus-pallet-xcmp-queue
* cargo test -p cumulus-pallet-xcm
* cargo test -p cumulus-pallet-dmp-queue
* cargo test -p pallet-template
* cargo test -p cumulus-test-runtime
* fix weights
* fix more weights
* cargo test -p parachains-common
* cargo test -p parachain-template-runtime
* fix weights import
* cargo test -p collectives-polkadot-runtime
* cargo test -p contracts-rococo-runtime
* more
* unused
* fixes
* Update benchmarking.rs
* Update lib.rs
* Update lib.rs
* fix
* fix bug in conversion
* update lockfile for {"polkadot", "substrate"}
Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -135,7 +135,7 @@ impl WeightToFeePolynomial for WeightToFee {
|
||||
// in Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1 MILLIUNIT:
|
||||
// in our template, we map to 1/10 of that, or 1/10 MILLIUNIT
|
||||
let p = MILLIUNIT / 10;
|
||||
let q = 100 * Balance::from(ExtrinsicBaseWeight::get());
|
||||
let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time());
|
||||
smallvec![WeightToFeeCoefficient {
|
||||
degree: 1,
|
||||
negative: false,
|
||||
@@ -214,7 +214,7 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(5);
|
||||
const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
|
||||
|
||||
/// We allow for 0.5 of a second of compute with a 12 second average block time.
|
||||
const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2;
|
||||
const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.scalar_div(2);
|
||||
|
||||
/// The version information used to identify this runtime when compiled natively.
|
||||
#[cfg(feature = "std")]
|
||||
@@ -363,8 +363,8 @@ impl pallet_transaction_payment::Config for Runtime {
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4;
|
||||
pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT / 4;
|
||||
pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.scalar_div(4);
|
||||
pub const ReservedDmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.scalar_div(4);
|
||||
}
|
||||
|
||||
impl cumulus_pallet_parachain_system::Config for Runtime {
|
||||
|
||||
@@ -23,7 +23,7 @@ pub mod constants {
|
||||
|
||||
parameter_types! {
|
||||
/// Importing a block with 0 Extrinsics.
|
||||
pub const BlockExecutionWeight: Weight = 5_000_000 * constants::WEIGHT_PER_NANOS;
|
||||
pub const BlockExecutionWeight: Weight = constants::WEIGHT_PER_NANOS.scalar_saturating_mul(5_000_000);
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -23,7 +23,7 @@ pub mod constants {
|
||||
|
||||
parameter_types! {
|
||||
/// Executing a NO-OP `System::remarks` Extrinsic.
|
||||
pub const ExtrinsicBaseWeight: Weight = 125_000 * constants::WEIGHT_PER_NANOS;
|
||||
pub const ExtrinsicBaseWeight: Weight = constants::WEIGHT_PER_NANOS.scalar_saturating_mul(125_000);
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -25,8 +25,8 @@ pub mod constants {
|
||||
/// `ParityDB` can be enabled with a feature flag, but is still experimental. These weights
|
||||
/// are available for brave runtime engineers who may want to try this out as default.
|
||||
pub const ParityDbWeight: RuntimeDbWeight = RuntimeDbWeight {
|
||||
read: 8_000 * constants::WEIGHT_PER_NANOS,
|
||||
write: 50_000 * constants::WEIGHT_PER_NANOS,
|
||||
read: 8_000 * constants::WEIGHT_PER_NANOS.ref_time(),
|
||||
write: 50_000 * constants::WEIGHT_PER_NANOS.ref_time(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ pub mod constants {
|
||||
/// By default, Substrate uses `RocksDB`, so this will be the weight used throughout
|
||||
/// the runtime.
|
||||
pub const RocksDbWeight: RuntimeDbWeight = RuntimeDbWeight {
|
||||
read: 25_000 * constants::WEIGHT_PER_NANOS,
|
||||
write: 100_000 * constants::WEIGHT_PER_NANOS,
|
||||
read: 25_000 * constants::WEIGHT_PER_NANOS.ref_time(),
|
||||
write: 100_000 * constants::WEIGHT_PER_NANOS.ref_time(),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,12 +6,11 @@ use core::marker::PhantomData;
|
||||
use frame_support::{
|
||||
log, match_types, parameter_types,
|
||||
traits::{Everything, Nothing},
|
||||
weights::Weight,
|
||||
};
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
use polkadot_parachain::primitives::Sibling;
|
||||
use polkadot_runtime_common::impls::ToAuthor;
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm::latest::{prelude::*, Weight as XCMWeight};
|
||||
use xcm_builder::{
|
||||
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter,
|
||||
EnsureXcmOrigin, FixedWeightBounds, IsConcrete, LocationInverter, NativeAsset, ParentIsPreset,
|
||||
@@ -77,7 +76,7 @@ pub type XcmOriginToTransactDispatchOrigin = (
|
||||
|
||||
parameter_types! {
|
||||
// One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate.
|
||||
pub UnitWeightCost: Weight = 1_000_000_000;
|
||||
pub UnitWeightCost: u64 = 1_000_000_000;
|
||||
pub const MaxInstructions: u32 = 100;
|
||||
}
|
||||
|
||||
@@ -104,8 +103,8 @@ where
|
||||
fn should_execute<Call>(
|
||||
origin: &MultiLocation,
|
||||
message: &mut Xcm<Call>,
|
||||
max_weight: Weight,
|
||||
weight_credit: &mut Weight,
|
||||
max_weight: XCMWeight,
|
||||
weight_credit: &mut XCMWeight,
|
||||
) -> Result<(), ()> {
|
||||
Deny::should_execute(origin, message, max_weight, weight_credit)?;
|
||||
Allow::should_execute(origin, message, max_weight, weight_credit)
|
||||
@@ -118,8 +117,8 @@ impl ShouldExecute for DenyReserveTransferToRelayChain {
|
||||
fn should_execute<Call>(
|
||||
origin: &MultiLocation,
|
||||
message: &mut Xcm<Call>,
|
||||
_max_weight: Weight,
|
||||
_weight_credit: &mut Weight,
|
||||
_max_weight: XCMWeight,
|
||||
_weight_credit: &mut XCMWeight,
|
||||
) -> Result<(), ()> {
|
||||
if message.0.iter().any(|inst| {
|
||||
matches!(
|
||||
|
||||
Reference in New Issue
Block a user