::RuntimeCall,
diff --git a/bridges/primitives/runtime/src/extensions.rs b/bridges/primitives/runtime/src/extensions.rs
index d896bc92efff..25553f9c7b2e 100644
--- a/bridges/primitives/runtime/src/extensions.rs
+++ b/bridges/primitives/runtime/src/extensions.rs
@@ -20,135 +20,131 @@ use codec::{Compact, Decode, Encode};
use impl_trait_for_tuples::impl_for_tuples;
use scale_info::{StaticTypeInfo, TypeInfo};
use sp_runtime::{
- traits::{DispatchInfoOf, SignedExtension},
+ impl_tx_ext_default,
+ traits::{Dispatchable, TransactionExtension},
transaction_validity::TransactionValidityError,
};
use sp_std::{fmt::Debug, marker::PhantomData};
-/// Trait that describes some properties of a `SignedExtension` that are needed in order to send a
-/// transaction to the chain.
-pub trait SignedExtensionSchema: Encode + Decode + Debug + Eq + Clone + StaticTypeInfo {
+/// Trait that describes some properties of a `TransactionExtension` that are needed in order to
+/// send a transaction to the chain.
+pub trait TransactionExtensionSchema:
+ Encode + Decode + Debug + Eq + Clone + StaticTypeInfo
+{
/// A type of the data encoded as part of the transaction.
type Payload: Encode + Decode + Debug + Eq + Clone + StaticTypeInfo;
/// Parameters which are part of the payload used to produce transaction signature,
/// but don't end up in the transaction itself (i.e. inherent part of the runtime).
- type AdditionalSigned: Encode + Debug + Eq + Clone + StaticTypeInfo;
+ type Implicit: Encode + Decode + Debug + Eq + Clone + StaticTypeInfo;
}
-impl SignedExtensionSchema for () {
+impl TransactionExtensionSchema for () {
type Payload = ();
- type AdditionalSigned = ();
+ type Implicit = ();
}
-/// An implementation of `SignedExtensionSchema` using generic params.
+/// An implementation of `TransactionExtensionSchema` using generic params.
#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq, TypeInfo)]
-pub struct GenericSignedExtensionSchema(PhantomData<(P, S)>);
+pub struct GenericTransactionExtensionSchema
(PhantomData<(P, S)>);
-impl
SignedExtensionSchema for GenericSignedExtensionSchema
+impl
TransactionExtensionSchema for GenericTransactionExtensionSchema
where
P: Encode + Decode + Debug + Eq + Clone + StaticTypeInfo,
- S: Encode + Debug + Eq + Clone + StaticTypeInfo,
+ S: Encode + Decode + Debug + Eq + Clone + StaticTypeInfo,
{
type Payload = P;
- type AdditionalSigned = S;
+ type Implicit = S;
}
-/// The `SignedExtensionSchema` for `frame_system::CheckNonZeroSender`.
-pub type CheckNonZeroSender = GenericSignedExtensionSchema<(), ()>;
+/// The `TransactionExtensionSchema` for `frame_system::CheckNonZeroSender`.
+pub type CheckNonZeroSender = GenericTransactionExtensionSchema<(), ()>;
-/// The `SignedExtensionSchema` for `frame_system::CheckSpecVersion`.
-pub type CheckSpecVersion = GenericSignedExtensionSchema<(), u32>;
+/// The `TransactionExtensionSchema` for `frame_system::CheckSpecVersion`.
+pub type CheckSpecVersion = GenericTransactionExtensionSchema<(), u32>;
-/// The `SignedExtensionSchema` for `frame_system::CheckTxVersion`.
-pub type CheckTxVersion = GenericSignedExtensionSchema<(), u32>;
+/// The `TransactionExtensionSchema` for `frame_system::CheckTxVersion`.
+pub type CheckTxVersion = GenericTransactionExtensionSchema<(), u32>;
-/// The `SignedExtensionSchema` for `frame_system::CheckGenesis`.
-pub type CheckGenesis = GenericSignedExtensionSchema<(), Hash>;
+/// The `TransactionExtensionSchema` for `frame_system::CheckGenesis`.
+pub type CheckGenesis = GenericTransactionExtensionSchema<(), Hash>;
-/// The `SignedExtensionSchema` for `frame_system::CheckEra`.
-pub type CheckEra = GenericSignedExtensionSchema;
+/// The `TransactionExtensionSchema` for `frame_system::CheckEra`.
+pub type CheckEra = GenericTransactionExtensionSchema;
-/// The `SignedExtensionSchema` for `frame_system::CheckNonce`.
-pub type CheckNonce = GenericSignedExtensionSchema, ()>;
+/// The `TransactionExtensionSchema` for `frame_system::CheckNonce`.
+pub type CheckNonce = GenericTransactionExtensionSchema, ()>;
-/// The `SignedExtensionSchema` for `frame_system::CheckWeight`.
-pub type CheckWeight = GenericSignedExtensionSchema<(), ()>;
+/// The `TransactionExtensionSchema` for `frame_system::CheckWeight`.
+pub type CheckWeight = GenericTransactionExtensionSchema<(), ()>;
-/// The `SignedExtensionSchema` for `pallet_transaction_payment::ChargeTransactionPayment`.
-pub type ChargeTransactionPayment = GenericSignedExtensionSchema, ()>;
+/// The `TransactionExtensionSchema` for `pallet_transaction_payment::ChargeTransactionPayment`.
+pub type ChargeTransactionPayment =
+ GenericTransactionExtensionSchema, ()>;
-/// The `SignedExtensionSchema` for `polkadot-runtime-common::PrevalidateAttests`.
-pub type PrevalidateAttests = GenericSignedExtensionSchema<(), ()>;
+/// The `TransactionExtensionSchema` for `polkadot-runtime-common::PrevalidateAttests`.
+pub type PrevalidateAttests = GenericTransactionExtensionSchema<(), ()>;
-/// The `SignedExtensionSchema` for `BridgeRejectObsoleteHeadersAndMessages`.
-pub type BridgeRejectObsoleteHeadersAndMessages = GenericSignedExtensionSchema<(), ()>;
+/// The `TransactionExtensionSchema` for `BridgeRejectObsoleteHeadersAndMessages`.
+pub type BridgeRejectObsoleteHeadersAndMessages = GenericTransactionExtensionSchema<(), ()>;
-/// The `SignedExtensionSchema` for `RefundBridgedParachainMessages`.
+/// The `TransactionExtensionSchema` for `RefundBridgedParachainMessages`.
/// This schema is dedicated for `RefundBridgedParachainMessages` signed extension as
/// wildcard/placeholder, which relies on the scale encoding for `()` or `((), ())`, or `((), (),
/// ())` is the same. So runtime can contains any kind of tuple:
/// `(BridgeRefundBridgeHubRococoMessages)`
/// `(BridgeRefundBridgeHubRococoMessages, BridgeRefundBridgeHubWestendMessages)`
/// `(BridgeRefundParachainMessages1, ..., BridgeRefundParachainMessagesN)`
-pub type RefundBridgedParachainMessagesSchema = GenericSignedExtensionSchema<(), ()>;
+pub type RefundBridgedParachainMessagesSchema = GenericTransactionExtensionSchema<(), ()>;
#[impl_for_tuples(1, 12)]
-impl SignedExtensionSchema for Tuple {
+impl TransactionExtensionSchema for Tuple {
for_tuples!( type Payload = ( #( Tuple::Payload ),* ); );
- for_tuples!( type AdditionalSigned = ( #( Tuple::AdditionalSigned ),* ); );
+ for_tuples!( type Implicit = ( #( Tuple::Implicit ),* ); );
}
/// A simplified version of signed extensions meant for producing signed transactions
/// and signed payloads in the client code.
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
-pub struct GenericSignedExtension {
+pub struct GenericTransactionExtension {
/// A payload that is included in the transaction.
pub payload: S::Payload,
#[codec(skip)]
// It may be set to `None` if extensions are decoded. We are never reconstructing transactions
- // (and it makes no sense to do that) => decoded version of `SignedExtensions` is only used to
- // read fields of the `payload`. And when resigning transaction, we're reconstructing
- // `SignedExtensions` from scratch.
- additional_signed: Option,
+ // (and it makes no sense to do that) => decoded version of `TransactionExtensions` is only
+ // used to read fields of the `payload`. And when resigning transaction, we're reconstructing
+ // `TransactionExtensions` from scratch.
+ implicit: Option,
}
-impl GenericSignedExtension {
- /// Create new `GenericSignedExtension` object.
- pub fn new(payload: S::Payload, additional_signed: Option) -> Self {
- Self { payload, additional_signed }
+impl GenericTransactionExtension {
+ /// Create new `GenericTransactionExtension` object.
+ pub fn new(payload: S::Payload, implicit: Option) -> Self {
+ Self { payload, implicit }
}
}
-impl SignedExtension for GenericSignedExtension
+impl TransactionExtension for GenericTransactionExtension
where
- S: SignedExtensionSchema,
+ C: Dispatchable,
+ S: TransactionExtensionSchema,
S::Payload: Send + Sync,
- S::AdditionalSigned: Send + Sync,
+ S::Implicit: Send + Sync,
{
const IDENTIFIER: &'static str = "Not needed.";
- type AccountId = ();
- type Call = ();
- type AdditionalSigned = S::AdditionalSigned;
- type Pre = ();
+ type Implicit = S::Implicit;
- fn additional_signed(&self) -> Result {
+ fn implicit(&self) -> Result {
// we shall not ever see this error in relay, because we are never signing decoded
// transactions. Instead we're constructing and signing new transactions. So the error code
// is kinda random here
- self.additional_signed.clone().ok_or(
- frame_support::unsigned::TransactionValidityError::Unknown(
+ self.implicit
+ .clone()
+ .ok_or(frame_support::unsigned::TransactionValidityError::Unknown(
frame_support::unsigned::UnknownTransaction::Custom(0xFF),
- ),
- )
+ ))
}
+ type Pre = ();
+ type Val = ();
- fn pre_dispatch(
- self,
- _who: &Self::AccountId,
- _call: &Self::Call,
- _info: &DispatchInfoOf,
- _len: usize,
- ) -> Result {
- Ok(())
- }
+ impl_tx_ext_default!(C; weight validate prepare);
}
diff --git a/bridges/relays/lib-substrate-relay/src/messages/mod.rs b/bridges/relays/lib-substrate-relay/src/messages/mod.rs
index f7031648bc35..b4ee57ed7742 100644
--- a/bridges/relays/lib-substrate-relay/src/messages/mod.rs
+++ b/bridges/relays/lib-substrate-relay/src/messages/mod.rs
@@ -428,7 +428,7 @@ where
"Prepared {} -> {} messages delivery call. Weight: {}/{}, size: {}/{}",
P::SourceChain::NAME,
P::TargetChain::NAME,
- call.get_dispatch_info().weight,
+ call.get_dispatch_info().call_weight,
P::TargetChain::max_extrinsic_weight(),
call.encode().len(),
P::TargetChain::max_extrinsic_size(),
@@ -521,7 +521,7 @@ where
"Prepared {} -> {} delivery confirmation transaction. Weight: {}/{}, size: {}/{}",
P::TargetChain::NAME,
P::SourceChain::NAME,
- call.get_dispatch_info().weight,
+ call.get_dispatch_info().call_weight,
P::SourceChain::max_extrinsic_weight(),
call.encode().len(),
P::SourceChain::max_extrinsic_size(),
diff --git a/bridges/snowbridge/pallets/ethereum-client/Cargo.toml b/bridges/snowbridge/pallets/ethereum-client/Cargo.toml
index 666ac3fbc8a2..262d9a7f380d 100644
--- a/bridges/snowbridge/pallets/ethereum-client/Cargo.toml
+++ b/bridges/snowbridge/pallets/ethereum-client/Cargo.toml
@@ -49,13 +49,7 @@ serde = { workspace = true, default-features = true }
[features]
default = ["std"]
-fuzzing = [
- "hex-literal",
- "pallet-timestamp",
- "serde",
- "serde_json",
- "sp-io",
-]
+fuzzing = ["hex-literal", "pallet-timestamp", "serde", "serde_json", "sp-io"]
std = [
"codec/std",
"frame-support/std",
diff --git a/bridges/snowbridge/pallets/ethereum-client/fixtures/Cargo.toml b/bridges/snowbridge/pallets/ethereum-client/fixtures/Cargo.toml
index bd4176875733..87f0cf9a5513 100644
--- a/bridges/snowbridge/pallets/ethereum-client/fixtures/Cargo.toml
+++ b/bridges/snowbridge/pallets/ethereum-client/fixtures/Cargo.toml
@@ -29,6 +29,4 @@ std = [
"sp-core/std",
"sp-std/std",
]
-runtime-benchmarks = [
- "snowbridge-core/runtime-benchmarks",
-]
+runtime-benchmarks = ["snowbridge-core/runtime-benchmarks"]
diff --git a/bridges/snowbridge/pallets/inbound-queue/fixtures/Cargo.toml b/bridges/snowbridge/pallets/inbound-queue/fixtures/Cargo.toml
index b66b57c3620a..6162a17728b6 100644
--- a/bridges/snowbridge/pallets/inbound-queue/fixtures/Cargo.toml
+++ b/bridges/snowbridge/pallets/inbound-queue/fixtures/Cargo.toml
@@ -29,6 +29,4 @@ std = [
"sp-core/std",
"sp-std/std",
]
-runtime-benchmarks = [
- "snowbridge-core/runtime-benchmarks",
-]
+runtime-benchmarks = ["snowbridge-core/runtime-benchmarks"]
diff --git a/bridges/snowbridge/pallets/outbound-queue/merkle-tree/Cargo.toml b/bridges/snowbridge/pallets/outbound-queue/merkle-tree/Cargo.toml
index 9d4cffc98d78..16241428df80 100644
--- a/bridges/snowbridge/pallets/outbound-queue/merkle-tree/Cargo.toml
+++ b/bridges/snowbridge/pallets/outbound-queue/merkle-tree/Cargo.toml
@@ -30,9 +30,4 @@ sp-tracing = { workspace = true, default-features = true }
[features]
default = ["std"]
-std = [
- "codec/std",
- "scale-info/std",
- "sp-core/std",
- "sp-runtime/std",
-]
+std = ["codec/std", "scale-info/std", "sp-core/std", "sp-runtime/std"]
diff --git a/cumulus/pallets/parachain-system/src/validate_block/implementation.rs b/cumulus/pallets/parachain-system/src/validate_block/implementation.rs
index c4c8440e5187..2c531c39accd 100644
--- a/cumulus/pallets/parachain-system/src/validate_block/implementation.rs
+++ b/cumulus/pallets/parachain-system/src/validate_block/implementation.rs
@@ -33,7 +33,7 @@ use frame_support::traits::{ExecuteBlock, ExtrinsicCall, Get, IsSubType};
use sp_core::storage::{ChildInfo, StateVersion};
use sp_externalities::{set_and_run_with_externalities, Externalities};
use sp_io::KillStorageResult;
-use sp_runtime::traits::{Block as BlockT, Extrinsic, HashingFor, Header as HeaderT};
+use sp_runtime::traits::{Block as BlockT, ExtrinsicLike, HashingFor, Header as HeaderT};
use sp_trie::{MemoryDB, ProofSizeProvider};
use trie_recorder::SizeOnlyRecorderProvider;
@@ -96,7 +96,7 @@ pub fn validate_block<
) -> ValidationResult
where
B::Extrinsic: ExtrinsicCall,
- ::Call: IsSubType>,
+ ::Call: IsSubType>,
{
let block_data = codec::decode_from_bytes::>(block_data)
.expect("Invalid parachain block data");
@@ -240,16 +240,13 @@ fn extract_parachain_inherent_data(
) -> &ParachainInherentData
where
B::Extrinsic: ExtrinsicCall,
- ::Call: IsSubType>,
+ ::Call: IsSubType>,
{
block
.extrinsics()
.iter()
// Inherents are at the front of the block and are unsigned.
- //
- // If `is_signed` is returning `None`, we keep it safe and assume that it is "signed".
- // We are searching for unsigned transactions anyway.
- .take_while(|e| !e.is_signed().unwrap_or(true))
+ .take_while(|e| e.is_bare())
.filter_map(|e| e.call().is_sub_type())
.find_map(|c| match c {
crate::Call::set_validation_data { data: validation_data } => Some(validation_data),
diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml b/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml
index 00f2cf8f636f..42adaba7a27c 100644
--- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml
+++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml
@@ -117,6 +117,7 @@ runtime-benchmarks = [
"frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-asset-conversion-ops/runtime-benchmarks",
+ "pallet-asset-conversion-tx-payment/runtime-benchmarks",
"pallet-asset-conversion/runtime-benchmarks",
"pallet-assets-freezer/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
@@ -128,6 +129,7 @@ runtime-benchmarks = [
"pallet-nfts/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
+ "pallet-transaction-payment/runtime-benchmarks",
"pallet-uniques/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"pallet-xcm-benchmarks/runtime-benchmarks",
diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
index eb3e26764f69..64fdf4883720 100644
--- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
+++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
@@ -175,6 +175,7 @@ impl frame_system::Config for Runtime {
type Version = Version;
type AccountData = pallet_balances::AccountData;
type SystemWeightInfo = weights::frame_system::WeightInfo;
+ type ExtensionsWeightInfo = weights::frame_system_extensions::WeightInfo;
type SS58Prefix = SS58Prefix;
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode;
type MaxConsumers = frame_support::traits::ConstU32<16>;
@@ -229,6 +230,7 @@ impl pallet_transaction_payment::Config for Runtime {
type LengthToFee = ConstantMultiplier;
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate;
type OperationalFeeMultiplier = ConstU8<5>;
+ type WeightInfo = weights::pallet_transaction_payment::WeightInfo;
}
parameter_types! {
@@ -818,6 +820,9 @@ impl pallet_asset_conversion_tx_payment::Config for Runtime {
AssetConversion,
ResolveAssetTo,
>;
+ type WeightInfo = weights::pallet_asset_conversion_tx_payment::WeightInfo;
+ #[cfg(feature = "runtime-benchmarks")]
+ type BenchmarkHelper = AssetConversionTxHelper;
}
parameter_types! {
@@ -998,8 +1003,8 @@ pub type Block = generic::Block;
pub type SignedBlock = generic::SignedBlock;
/// BlockId type as expected by this runtime.
pub type BlockId = generic::BlockId;
-/// The SignedExtension to the basic transaction logic.
-pub type SignedExtra = (
+/// The extension to the basic transaction logic.
+pub type TxExtension = (
frame_system::CheckNonZeroSender,
frame_system::CheckSpecVersion,
frame_system::CheckTxVersion,
@@ -1013,7 +1018,7 @@ pub type SignedExtra = (
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
- generic::UncheckedExtrinsic;
+ generic::UncheckedExtrinsic;
/// Migrations to apply on runtime upgrade.
pub type Migrations = (
InitStorageVersions,
@@ -1100,14 +1105,81 @@ pub type Executive = frame_executive::Executive<
type XcmTrustedQueryResult = Result;
+#[cfg(feature = "runtime-benchmarks")]
+pub struct AssetConversionTxHelper;
+
+#[cfg(feature = "runtime-benchmarks")]
+impl
+ pallet_asset_conversion_tx_payment::BenchmarkHelperTrait<
+ AccountId,
+ cumulus_primitives_core::Location,
+ cumulus_primitives_core::Location,
+ > for AssetConversionTxHelper
+{
+ fn create_asset_id_parameter(seed: u32) -> (Location, Location) {
+ // Use a different parachain' foreign assets pallet so that the asset is indeed foreign.
+ let asset_id = Location::new(
+ 1,
+ [
+ cumulus_primitives_core::Junction::Parachain(3000),
+ cumulus_primitives_core::Junction::PalletInstance(53),
+ cumulus_primitives_core::Junction::GeneralIndex(seed.into()),
+ ],
+ );
+ (asset_id.clone(), asset_id)
+ }
+
+ fn setup_balances_and_pool(asset_id: cumulus_primitives_core::Location, account: AccountId) {
+ use frame_support::{assert_ok, traits::fungibles::Mutate};
+ assert_ok!(ForeignAssets::force_create(
+ RuntimeOrigin::root(),
+ asset_id.clone().into(),
+ account.clone().into(), /* owner */
+ true, /* is_sufficient */
+ 1,
+ ));
+
+ let lp_provider = account.clone();
+ use frame_support::traits::Currency;
+ let _ = Balances::deposit_creating(&lp_provider, u64::MAX.into());
+ assert_ok!(ForeignAssets::mint_into(
+ asset_id.clone().into(),
+ &lp_provider,
+ u64::MAX.into()
+ ));
+
+ let token_native = alloc::boxed::Box::new(TokenLocation::get());
+ let token_second = alloc::boxed::Box::new(asset_id);
+
+ assert_ok!(AssetConversion::create_pool(
+ RuntimeOrigin::signed(lp_provider.clone()),
+ token_native.clone(),
+ token_second.clone()
+ ));
+
+ assert_ok!(AssetConversion::add_liquidity(
+ RuntimeOrigin::signed(lp_provider.clone()),
+ token_native,
+ token_second,
+ (u32::MAX / 8).into(), // 1 desired
+ u32::MAX.into(), // 2 desired
+ 1, // 1 min
+ 1, // 2 min
+ lp_provider,
+ ));
+ }
+}
+
#[cfg(feature = "runtime-benchmarks")]
mod benches {
frame_benchmarking::define_benchmarks!(
[frame_system, SystemBench::]
+ [frame_system_extensions, SystemExtensionsBench::]
[pallet_assets, Local]
[pallet_assets, Foreign]
[pallet_assets, Pool]
[pallet_asset_conversion, AssetConversion]
+ [pallet_asset_conversion_tx_payment, AssetTxPayment]
[pallet_balances, Balances]
[pallet_message_queue, MessageQueue]
[pallet_multisig, Multisig]
@@ -1118,6 +1190,7 @@ mod benches {
[pallet_uniques, Uniques]
[pallet_utility, Utility]
[pallet_timestamp, Timestamp]
+ [pallet_transaction_payment, TransactionPayment]
[pallet_collator_selection, CollatorSelection]
[cumulus_pallet_parachain_system, ParachainSystem]
[cumulus_pallet_xcmp_queue, XcmpQueue]
@@ -1445,6 +1518,7 @@ impl_runtime_apis! {
use frame_benchmarking::{Benchmarking, BenchmarkList};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
+ use frame_system_benchmarking::extensions::Pallet as SystemExtensionsBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
use pallet_xcm_bridge_hub_router::benchmarking::Pallet as XcmBridgeHubRouterBench;
@@ -1479,6 +1553,7 @@ impl_runtime_apis! {
use sp_storage::TrackedStorageKey;
use frame_system_benchmarking::Pallet as SystemBench;
+ use frame_system_benchmarking::extensions::Pallet as SystemExtensionsBench;
impl frame_system_benchmarking::Config for Runtime {
fn setup_set_code_requirements(code: &alloc::vec::Vec) -> Result<(), BenchmarkError> {
ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32);
diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/frame_system_extensions.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/frame_system_extensions.rs
new file mode 100644
index 000000000000..182410f20fff
--- /dev/null
+++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/frame_system_extensions.rs
@@ -0,0 +1,132 @@
+// Copyright (C) Parity Technologies (UK) Ltd.
+// This file is part of Cumulus.
+
+// Cumulus is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Cumulus is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Cumulus. If not, see .
+
+//! Autogenerated weights for `frame_system_extensions`
+//!
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
+//! DATE: 2023-12-21, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! WORST CASE MAP SIZE: `1000000`
+//! HOSTNAME: `gleipnir`, CPU: `AMD Ryzen 9 7900X 12-Core Processor`
+//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024
+
+// Executed Command:
+// ./target/release/polkadot-parachain
+// benchmark
+// pallet
+// --wasm-execution=compiled
+// --pallet=frame_system_extensions
+// --no-storage-info
+// --no-median-slopes
+// --no-min-squares
+// --extrinsic=*
+// --steps=2
+// --repeat=2
+// --json
+// --header=./cumulus/file_header.txt
+// --output=./cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/
+// --chain=asset-hub-rococo-dev
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+#![allow(missing_docs)]
+
+use frame_support::{traits::Get, weights::Weight};
+use core::marker::PhantomData;
+
+/// Weight functions for `frame_system_extensions`.
+pub struct WeightInfo(PhantomData);
+impl frame_system::ExtensionsWeightInfo for WeightInfo {
+ /// Storage: `System::BlockHash` (r:1 w:0)
+ /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
+ fn check_genesis() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `54`
+ // Estimated: `3509`
+ // Minimum execution time: 3_637_000 picoseconds.
+ Weight::from_parts(6_382_000, 0)
+ .saturating_add(Weight::from_parts(0, 3509))
+ .saturating_add(T::DbWeight::get().reads(1))
+ }
+ /// Storage: `System::BlockHash` (r:1 w:0)
+ /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
+ fn check_mortality_mortal_transaction() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `92`
+ // Estimated: `3509`
+ // Minimum execution time: 5_841_000 picoseconds.
+ Weight::from_parts(8_776_000, 0)
+ .saturating_add(Weight::from_parts(0, 3509))
+ .saturating_add(T::DbWeight::get().reads(1))
+ }
+ /// Storage: `System::BlockHash` (r:1 w:0)
+ /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
+ fn check_mortality_immortal_transaction() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `92`
+ // Estimated: `3509`
+ // Minimum execution time: 5_841_000 picoseconds.
+ Weight::from_parts(8_776_000, 0)
+ .saturating_add(Weight::from_parts(0, 3509))
+ .saturating_add(T::DbWeight::get().reads(1))
+ }
+ fn check_non_zero_sender() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `0`
+ // Estimated: `0`
+ // Minimum execution time: 561_000 picoseconds.
+ Weight::from_parts(2_705_000, 0)
+ .saturating_add(Weight::from_parts(0, 0))
+ }
+ fn check_nonce() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `0`
+ // Estimated: `0`
+ // Minimum execution time: 3_316_000 picoseconds.
+ Weight::from_parts(5_771_000, 0)
+ .saturating_add(Weight::from_parts(0, 0))
+ }
+ fn check_spec_version() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `0`
+ // Estimated: `0`
+ // Minimum execution time: 511_000 picoseconds.
+ Weight::from_parts(2_575_000, 0)
+ .saturating_add(Weight::from_parts(0, 0))
+ }
+ fn check_tx_version() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `0`
+ // Estimated: `0`
+ // Minimum execution time: 501_000 picoseconds.
+ Weight::from_parts(2_595_000, 0)
+ .saturating_add(Weight::from_parts(0, 0))
+ }
+ /// Storage: `System::AllExtrinsicsLen` (r:1 w:1)
+ /// Proof: `System::AllExtrinsicsLen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
+ /// Storage: `System::BlockWeight` (r:1 w:1)
+ /// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`)
+ fn check_weight() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `24`
+ // Estimated: `1533`
+ // Minimum execution time: 3_687_000 picoseconds.
+ Weight::from_parts(6_192_000, 0)
+ .saturating_add(Weight::from_parts(0, 1533))
+ .saturating_add(T::DbWeight::get().reads(2))
+ .saturating_add(T::DbWeight::get().writes(2))
+ }
+}
diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/mod.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/mod.rs
index f20790cde39c..33f111009ed0 100644
--- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/mod.rs
+++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/mod.rs
@@ -19,8 +19,10 @@ pub mod cumulus_pallet_parachain_system;
pub mod cumulus_pallet_xcmp_queue;
pub mod extrinsic_weights;
pub mod frame_system;
+pub mod frame_system_extensions;
pub mod pallet_asset_conversion;
pub mod pallet_asset_conversion_ops;
+pub mod pallet_asset_conversion_tx_payment;
pub mod pallet_assets_foreign;
pub mod pallet_assets_local;
pub mod pallet_assets_pool;
@@ -33,6 +35,7 @@ pub mod pallet_nfts;
pub mod pallet_proxy;
pub mod pallet_session;
pub mod pallet_timestamp;
+pub mod pallet_transaction_payment;
pub mod pallet_uniques;
pub mod pallet_utility;
pub mod pallet_xcm;
diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_asset_conversion_tx_payment.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_asset_conversion_tx_payment.rs
new file mode 100644
index 000000000000..0a639b368af2
--- /dev/null
+++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_asset_conversion_tx_payment.rs
@@ -0,0 +1,92 @@
+// Copyright (C) Parity Technologies (UK) Ltd.
+// This file is part of Cumulus.
+
+// Cumulus is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Cumulus is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Cumulus. If not, see .
+
+//! Autogenerated weights for `pallet_asset_conversion_tx_payment`
+//!
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
+//! DATE: 2024-01-04, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! WORST CASE MAP SIZE: `1000000`
+//! HOSTNAME: `Georges-MacBook-Pro.local`, CPU: ``
+//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024
+
+// Executed Command:
+// ./target/debug/polkadot-parachain
+// benchmark
+// pallet
+// --wasm-execution=compiled
+// --pallet=pallet_asset_conversion_tx_payment
+// --no-storage-info
+// --no-median-slopes
+// --no-min-squares
+// --extrinsic=*
+// --steps=2
+// --repeat=2
+// --json
+// --header=./cumulus/file_header.txt
+// --output=./cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/
+// --chain=asset-hub-rococo-dev
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+#![allow(missing_docs)]
+
+use frame_support::{traits::Get, weights::Weight};
+use core::marker::PhantomData;
+
+/// Weight functions for `pallet_asset_conversion_tx_payment`.
+pub struct WeightInfo(PhantomData);
+impl pallet_asset_conversion_tx_payment::WeightInfo for WeightInfo {
+ fn charge_asset_tx_payment_zero() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `0`
+ // Estimated: `0`
+ // Minimum execution time: 7_000_000 picoseconds.
+ Weight::from_parts(10_000_000, 0)
+ .saturating_add(Weight::from_parts(0, 0))
+ }
+ /// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0)
+ /// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
+ /// Storage: `System::Account` (r:1 w:0)
+ /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
+ fn charge_asset_tx_payment_native() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `4`
+ // Estimated: `3593`
+ // Minimum execution time: 209_000_000 picoseconds.
+ Weight::from_parts(212_000_000, 0)
+ .saturating_add(Weight::from_parts(0, 3593))
+ .saturating_add(T::DbWeight::get().reads(2))
+ }
+ /// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0)
+ /// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
+ /// Storage: `ForeignAssets::Asset` (r:1 w:1)
+ /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
+ /// Storage: `ForeignAssets::Account` (r:2 w:2)
+ /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
+ /// Storage: `System::Account` (r:2 w:1)
+ /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
+ fn charge_asset_tx_payment_asset() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `631`
+ // Estimated: `7404`
+ // Minimum execution time: 1_228_000_000 picoseconds.
+ Weight::from_parts(1_268_000_000, 0)
+ .saturating_add(Weight::from_parts(0, 7404))
+ .saturating_add(T::DbWeight::get().reads(6))
+ .saturating_add(T::DbWeight::get().writes(4))
+ }
+}
diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_transaction_payment.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_transaction_payment.rs
new file mode 100644
index 000000000000..035f9a6dbe51
--- /dev/null
+++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_transaction_payment.rs
@@ -0,0 +1,67 @@
+// Copyright (C) Parity Technologies (UK) Ltd.
+// This file is part of Cumulus.
+
+// Cumulus is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Cumulus is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Cumulus. If not, see .
+
+//! Autogenerated weights for `pallet_transaction_payment`
+//!
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
+//! DATE: 2023-12-21, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! WORST CASE MAP SIZE: `1000000`
+//! HOSTNAME: `gleipnir`, CPU: `AMD Ryzen 9 7900X 12-Core Processor`
+//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024
+
+// Executed Command:
+// ./target/release/polkadot-parachain
+// benchmark
+// pallet
+// --wasm-execution=compiled
+// --pallet=pallet_transaction_payment
+// --no-storage-info
+// --no-median-slopes
+// --no-min-squares
+// --extrinsic=*
+// --steps=2
+// --repeat=2
+// --json
+// --header=./cumulus/file_header.txt
+// --output=./cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/
+// --chain=asset-hub-rococo-dev
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+#![allow(missing_docs)]
+
+use frame_support::{traits::Get, weights::Weight};
+use core::marker::PhantomData;
+
+/// Weight functions for `pallet_transaction_payment`.
+pub struct WeightInfo(PhantomData);
+impl pallet_transaction_payment::WeightInfo for WeightInfo {
+ /// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0)
+ /// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
+ /// Storage: `System::Account` (r:1 w:1)
+ /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
+ fn charge_transaction_payment() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `4`
+ // Estimated: `3593`
+ // Minimum execution time: 33_363_000 picoseconds.
+ Weight::from_parts(38_793_000, 0)
+ .saturating_add(Weight::from_parts(0, 3593))
+ .saturating_add(T::DbWeight::get().reads(2))
+ .saturating_add(T::DbWeight::get().writes(1))
+ }
+}
diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml b/cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml
index 72a125cee2ad..5fa48381b674 100644
--- a/cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml
+++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/Cargo.toml
@@ -118,6 +118,7 @@ runtime-benchmarks = [
"frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-asset-conversion-ops/runtime-benchmarks",
+ "pallet-asset-conversion-tx-payment/runtime-benchmarks",
"pallet-asset-conversion/runtime-benchmarks",
"pallet-assets-freezer/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
@@ -130,6 +131,7 @@ runtime-benchmarks = [
"pallet-proxy/runtime-benchmarks",
"pallet-state-trie-migration/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
+ "pallet-transaction-payment/runtime-benchmarks",
"pallet-uniques/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"pallet-xcm-benchmarks/runtime-benchmarks",
diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
index 74e75ebb4890..32d121749534 100644
--- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
+++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs
@@ -175,6 +175,7 @@ impl frame_system::Config for Runtime {
type Version = Version;
type AccountData = pallet_balances::AccountData;
type SystemWeightInfo = weights::frame_system::WeightInfo;
+ type ExtensionsWeightInfo = weights::frame_system_extensions::WeightInfo;
type SS58Prefix = SS58Prefix;
type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode;
type MaxConsumers = frame_support::traits::ConstU32<16>;
@@ -229,6 +230,7 @@ impl pallet_transaction_payment::Config for Runtime {
type LengthToFee = ConstantMultiplier;
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate;
type OperationalFeeMultiplier = ConstU8<5>;
+ type WeightInfo = weights::pallet_transaction_payment::WeightInfo;
}
parameter_types! {
@@ -811,6 +813,9 @@ impl pallet_asset_conversion_tx_payment::Config for Runtime {
AssetConversion,
ResolveAssetTo,
>;
+ type WeightInfo = weights::pallet_asset_conversion_tx_payment::WeightInfo;
+ #[cfg(feature = "runtime-benchmarks")]
+ type BenchmarkHelper = AssetConversionTxHelper;
}
parameter_types! {
@@ -994,8 +999,8 @@ pub type Block = generic::Block;
pub type SignedBlock = generic::SignedBlock;
/// BlockId type as expected by this runtime.
pub type BlockId = generic::BlockId;
-/// The SignedExtension to the basic transaction logic.
-pub type SignedExtra = (
+/// The extension to the basic transaction logic.
+pub type TxExtension = (
frame_system::CheckNonZeroSender,
frame_system::CheckSpecVersion,
frame_system::CheckTxVersion,
@@ -1009,7 +1014,7 @@ pub type SignedExtra = (
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
- generic::UncheckedExtrinsic;
+ generic::UncheckedExtrinsic;
/// Migrations to apply on runtime upgrade.
pub type Migrations = (
@@ -1148,14 +1153,86 @@ pub type Executive = frame_executive::Executive<
Migrations,
>;
+#[cfg(feature = "runtime-benchmarks")]
+pub struct AssetConversionTxHelper;
+
+#[cfg(feature = "runtime-benchmarks")]
+impl
+ pallet_asset_conversion_tx_payment::BenchmarkHelperTrait<
+ AccountId,
+ cumulus_primitives_core::Location,
+ cumulus_primitives_core::Location,
+ > for AssetConversionTxHelper
+{
+ fn create_asset_id_parameter(
+ seed: u32,
+ ) -> (cumulus_primitives_core::Location, cumulus_primitives_core::Location) {
+ // Use a different parachain' foreign assets pallet so that the asset is indeed foreign.
+ let asset_id = cumulus_primitives_core::Location::new(
+ 1,
+ [
+ cumulus_primitives_core::Junction::Parachain(3000),
+ cumulus_primitives_core::Junction::PalletInstance(53),
+ cumulus_primitives_core::Junction::GeneralIndex(seed.into()),
+ ],
+ );
+ (asset_id.clone(), asset_id)
+ }
+
+ fn setup_balances_and_pool(asset_id: cumulus_primitives_core::Location, account: AccountId) {
+ use frame_support::{assert_ok, traits::fungibles::Mutate};
+ assert_ok!(ForeignAssets::force_create(
+ RuntimeOrigin::root(),
+ asset_id.clone().into(),
+ account.clone().into(), /* owner */
+ true, /* is_sufficient */
+ 1,
+ ));
+
+ let lp_provider = account.clone();
+ use frame_support::traits::Currency;
+ let _ = Balances::deposit_creating(&lp_provider, u64::MAX.into());
+ assert_ok!(ForeignAssets::mint_into(
+ asset_id.clone().into(),
+ &lp_provider,
+ u64::MAX.into()
+ ));
+
+ let token_native = alloc::boxed::Box::new(cumulus_primitives_core::Location::new(
+ 1,
+ cumulus_primitives_core::Junctions::Here,
+ ));
+ let token_second = alloc::boxed::Box::new(asset_id);
+
+ assert_ok!(AssetConversion::create_pool(
+ RuntimeOrigin::signed(lp_provider.clone()),
+ token_native.clone(),
+ token_second.clone()
+ ));
+
+ assert_ok!(AssetConversion::add_liquidity(
+ RuntimeOrigin::signed(lp_provider.clone()),
+ token_native,
+ token_second,
+ (u32::MAX / 2).into(), // 1 desired
+ u32::MAX.into(), // 2 desired
+ 1, // 1 min
+ 1, // 2 min
+ lp_provider,
+ ));
+ }
+}
+
#[cfg(feature = "runtime-benchmarks")]
mod benches {
frame_benchmarking::define_benchmarks!(
[frame_system, SystemBench::]
+ [frame_system_extensions, SystemExtensionsBench::]
[pallet_assets, Local]
[pallet_assets, Foreign]
[pallet_assets, Pool]
[pallet_asset_conversion, AssetConversion]
+ [pallet_asset_conversion_tx_payment, AssetTxPayment]
[pallet_balances, Balances]
[pallet_message_queue, MessageQueue]
[pallet_multisig, Multisig]
@@ -1166,6 +1243,7 @@ mod benches {
[pallet_uniques, Uniques]
[pallet_utility, Utility]
[pallet_timestamp, Timestamp]
+ [pallet_transaction_payment, TransactionPayment]
[pallet_collator_selection, CollatorSelection]
[cumulus_pallet_parachain_system, ParachainSystem]
[cumulus_pallet_xcmp_queue, XcmpQueue]
@@ -1539,6 +1617,7 @@ impl_runtime_apis! {
use frame_benchmarking::{Benchmarking, BenchmarkList};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
+ use frame_system_benchmarking::extensions::Pallet as SystemExtensionsBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
use pallet_xcm_bridge_hub_router::benchmarking::Pallet as XcmBridgeHubRouterBench;
@@ -1573,6 +1652,7 @@ impl_runtime_apis! {
use sp_storage::TrackedStorageKey;
use frame_system_benchmarking::Pallet as SystemBench;
+ use frame_system_benchmarking::extensions::Pallet as SystemExtensionsBench;
impl frame_system_benchmarking::Config for Runtime {
fn setup_set_code_requirements(code: &alloc::vec::Vec) -> Result<(), BenchmarkError> {
ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32);
diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/frame_system_extensions.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/frame_system_extensions.rs
new file mode 100644
index 000000000000..e8dd9763c282
--- /dev/null
+++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/frame_system_extensions.rs
@@ -0,0 +1,132 @@
+// Copyright (C) Parity Technologies (UK) Ltd.
+// This file is part of Cumulus.
+
+// Cumulus is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Cumulus is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Cumulus. If not, see .
+
+//! Autogenerated weights for `frame_system_extensions`
+//!
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
+//! DATE: 2023-12-21, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! WORST CASE MAP SIZE: `1000000`
+//! HOSTNAME: `gleipnir`, CPU: `AMD Ryzen 9 7900X 12-Core Processor`
+//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-westend-dev")`, DB CACHE: 1024
+
+// Executed Command:
+// ./target/release/polkadot-parachain
+// benchmark
+// pallet
+// --wasm-execution=compiled
+// --pallet=frame_system_extensions
+// --no-storage-info
+// --no-median-slopes
+// --no-min-squares
+// --extrinsic=*
+// --steps=2
+// --repeat=2
+// --json
+// --header=./cumulus/file_header.txt
+// --output=./cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/
+// --chain=asset-hub-westend-dev
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+#![allow(missing_docs)]
+
+use frame_support::{traits::Get, weights::Weight};
+use core::marker::PhantomData;
+
+/// Weight functions for `frame_system_extensions`.
+pub struct WeightInfo(PhantomData);
+impl frame_system::ExtensionsWeightInfo for WeightInfo {
+ /// Storage: `System::BlockHash` (r:1 w:0)
+ /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
+ fn check_genesis() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `54`
+ // Estimated: `3509`
+ // Minimum execution time: 3_206_000 picoseconds.
+ Weight::from_parts(6_212_000, 0)
+ .saturating_add(Weight::from_parts(0, 3509))
+ .saturating_add(T::DbWeight::get().reads(1))
+ }
+ /// Storage: `System::BlockHash` (r:1 w:0)
+ /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
+ fn check_mortality_mortal_transaction() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `92`
+ // Estimated: `3509`
+ // Minimum execution time: 5_851_000 picoseconds.
+ Weight::from_parts(8_847_000, 0)
+ .saturating_add(Weight::from_parts(0, 3509))
+ .saturating_add(T::DbWeight::get().reads(1))
+ }
+ /// Storage: `System::BlockHash` (r:1 w:0)
+ /// Proof: `System::BlockHash` (`max_values`: None, `max_size`: Some(44), added: 2519, mode: `MaxEncodedLen`)
+ fn check_mortality_immortal_transaction() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `92`
+ // Estimated: `3509`
+ // Minimum execution time: 5_851_000 picoseconds.
+ Weight::from_parts(8_847_000, 0)
+ .saturating_add(Weight::from_parts(0, 3509))
+ .saturating_add(T::DbWeight::get().reads(1))
+ }
+ fn check_non_zero_sender() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `0`
+ // Estimated: `0`
+ // Minimum execution time: 631_000 picoseconds.
+ Weight::from_parts(3_086_000, 0)
+ .saturating_add(Weight::from_parts(0, 0))
+ }
+ fn check_nonce() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `0`
+ // Estimated: `0`
+ // Minimum execution time: 3_446_000 picoseconds.
+ Weight::from_parts(5_911_000, 0)
+ .saturating_add(Weight::from_parts(0, 0))
+ }
+ fn check_spec_version() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `0`
+ // Estimated: `0`
+ // Minimum execution time: 481_000 picoseconds.
+ Weight::from_parts(2_916_000, 0)
+ .saturating_add(Weight::from_parts(0, 0))
+ }
+ fn check_tx_version() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `0`
+ // Estimated: `0`
+ // Minimum execution time: 501_000 picoseconds.
+ Weight::from_parts(2_595_000, 0)
+ .saturating_add(Weight::from_parts(0, 0))
+ }
+ /// Storage: `System::AllExtrinsicsLen` (r:1 w:1)
+ /// Proof: `System::AllExtrinsicsLen` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
+ /// Storage: `System::BlockWeight` (r:1 w:1)
+ /// Proof: `System::BlockWeight` (`max_values`: Some(1), `max_size`: Some(48), added: 543, mode: `MaxEncodedLen`)
+ fn check_weight() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `24`
+ // Estimated: `1533`
+ // Minimum execution time: 3_927_000 picoseconds.
+ Weight::from_parts(6_613_000, 0)
+ .saturating_add(Weight::from_parts(0, 1533))
+ .saturating_add(T::DbWeight::get().reads(2))
+ .saturating_add(T::DbWeight::get().writes(2))
+ }
+}
diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs
index 4eebb1f8d786..b0f986768f40 100644
--- a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs
+++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/mod.rs
@@ -18,8 +18,10 @@ pub mod cumulus_pallet_parachain_system;
pub mod cumulus_pallet_xcmp_queue;
pub mod extrinsic_weights;
pub mod frame_system;
+pub mod frame_system_extensions;
pub mod pallet_asset_conversion;
pub mod pallet_asset_conversion_ops;
+pub mod pallet_asset_conversion_tx_payment;
pub mod pallet_assets_foreign;
pub mod pallet_assets_local;
pub mod pallet_assets_pool;
@@ -32,6 +34,7 @@ pub mod pallet_nfts;
pub mod pallet_proxy;
pub mod pallet_session;
pub mod pallet_timestamp;
+pub mod pallet_transaction_payment;
pub mod pallet_uniques;
pub mod pallet_utility;
pub mod pallet_xcm;
diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_asset_conversion_tx_payment.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_asset_conversion_tx_payment.rs
new file mode 100644
index 000000000000..8fe302630fb9
--- /dev/null
+++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_asset_conversion_tx_payment.rs
@@ -0,0 +1,92 @@
+// Copyright (C) Parity Technologies (UK) Ltd.
+// This file is part of Cumulus.
+
+// Cumulus is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Cumulus is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Cumulus. If not, see .
+
+//! Autogenerated weights for `pallet_asset_conversion_tx_payment`
+//!
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
+//! DATE: 2024-01-04, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! WORST CASE MAP SIZE: `1000000`
+//! HOSTNAME: `Georges-MacBook-Pro.local`, CPU: ``
+//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-westend-dev")`, DB CACHE: 1024
+
+// Executed Command:
+// ./target/debug/polkadot-parachain
+// benchmark
+// pallet
+// --wasm-execution=compiled
+// --pallet=pallet_asset_conversion_tx_payment
+// --no-storage-info
+// --no-median-slopes
+// --no-min-squares
+// --extrinsic=*
+// --steps=2
+// --repeat=2
+// --json
+// --header=./cumulus/file_header.txt
+// --output=./cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/
+// --chain=asset-hub-westend-dev
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+#![allow(missing_docs)]
+
+use frame_support::{traits::Get, weights::Weight};
+use core::marker::PhantomData;
+
+/// Weight functions for `pallet_asset_conversion_tx_payment`.
+pub struct WeightInfo(PhantomData);
+impl pallet_asset_conversion_tx_payment::WeightInfo for WeightInfo {
+ fn charge_asset_tx_payment_zero() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `0`
+ // Estimated: `0`
+ // Minimum execution time: 8_000_000 picoseconds.
+ Weight::from_parts(9_000_000, 0)
+ .saturating_add(Weight::from_parts(0, 0))
+ }
+ /// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0)
+ /// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
+ /// Storage: `System::Account` (r:1 w:0)
+ /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
+ fn charge_asset_tx_payment_native() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `4`
+ // Estimated: `3593`
+ // Minimum execution time: 214_000_000 picoseconds.
+ Weight::from_parts(219_000_000, 0)
+ .saturating_add(Weight::from_parts(0, 3593))
+ .saturating_add(T::DbWeight::get().reads(2))
+ }
+ /// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0)
+ /// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
+ /// Storage: `ForeignAssets::Asset` (r:1 w:1)
+ /// Proof: `ForeignAssets::Asset` (`max_values`: None, `max_size`: Some(808), added: 3283, mode: `MaxEncodedLen`)
+ /// Storage: `ForeignAssets::Account` (r:2 w:2)
+ /// Proof: `ForeignAssets::Account` (`max_values`: None, `max_size`: Some(732), added: 3207, mode: `MaxEncodedLen`)
+ /// Storage: `System::Account` (r:2 w:1)
+ /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
+ fn charge_asset_tx_payment_asset() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `631`
+ // Estimated: `7404`
+ // Minimum execution time: 1_211_000_000 picoseconds.
+ Weight::from_parts(1_243_000_000, 0)
+ .saturating_add(Weight::from_parts(0, 7404))
+ .saturating_add(T::DbWeight::get().reads(6))
+ .saturating_add(T::DbWeight::get().writes(4))
+ }
+}
diff --git a/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_transaction_payment.rs b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_transaction_payment.rs
new file mode 100644
index 000000000000..b4c78a78b489
--- /dev/null
+++ b/cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/pallet_transaction_payment.rs
@@ -0,0 +1,67 @@
+// Copyright (C) Parity Technologies (UK) Ltd.
+// This file is part of Cumulus.
+
+// Cumulus is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Cumulus is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Cumulus. If not, see .
+
+//! Autogenerated weights for `pallet_transaction_payment`
+//!
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
+//! DATE: 2023-12-21, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! WORST CASE MAP SIZE: `1000000`
+//! HOSTNAME: `gleipnir`, CPU: `AMD Ryzen 9 7900X 12-Core Processor`
+//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-westend-dev")`, DB CACHE: 1024
+
+// Executed Command:
+// ./target/release/polkadot-parachain
+// benchmark
+// pallet
+// --wasm-execution=compiled
+// --pallet=pallet_transaction_payment
+// --no-storage-info
+// --no-median-slopes
+// --no-min-squares
+// --extrinsic=*
+// --steps=2
+// --repeat=2
+// --json
+// --header=./cumulus/file_header.txt
+// --output=./cumulus/parachains/runtimes/assets/asset-hub-westend/src/weights/
+// --chain=asset-hub-westend-dev
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+#![allow(missing_docs)]
+
+use frame_support::{traits::Get, weights::Weight};
+use core::marker::PhantomData;
+
+/// Weight functions for `pallet_transaction_payment`.
+pub struct WeightInfo(PhantomData);
+impl pallet_transaction_payment::WeightInfo for WeightInfo {
+ /// Storage: `TransactionPayment::NextFeeMultiplier` (r:1 w:0)
+ /// Proof: `TransactionPayment::NextFeeMultiplier` (`max_values`: Some(1), `max_size`: Some(16), added: 511, mode: `MaxEncodedLen`)
+ /// Storage: `System::Account` (r:1 w:1)
+ /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
+ fn charge_transaction_payment() -> Weight {
+ // Proof Size summary in bytes:
+ // Measured: `4`
+ // Estimated: `3593`
+ // Minimum execution time: 40_847_000 picoseconds.
+ Weight::from_parts(49_674_000, 0)
+ .saturating_add(Weight::from_parts(0, 3593))
+ .saturating_add(T::DbWeight::get().reads(2))
+ .saturating_add(T::DbWeight::get().writes(1))
+ }
+}
diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml
index fd5782d68e43..4af8a9f43850 100644
--- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml
+++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml
@@ -241,6 +241,7 @@ runtime-benchmarks = [
"pallet-message-queue/runtime-benchmarks",
"pallet-multisig/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
+ "pallet-transaction-payment/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"pallet-xcm-benchmarks/runtime-benchmarks",
"pallet-xcm-bridge-hub/runtime-benchmarks",
diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_bulletin_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_bulletin_config.rs
index c971fa59c68d..c226ed9c4fa0 100644
--- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_bulletin_config.rs
+++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_bulletin_config.rs
@@ -38,7 +38,7 @@ use frame_support::{
use frame_system::{EnsureNever, EnsureRoot};
use pallet_bridge_messages::LaneIdOf;
use pallet_bridge_relayers::extension::{
- BridgeRelayersSignedExtension, WithMessagesExtensionConfig,
+ BridgeRelayersTransactionExtension, WithMessagesExtensionConfig,
};
use pallet_xcm_bridge_hub::XcmAsPlainPayload;
use polkadot_parachain_primitives::primitives::Sibling;
@@ -92,9 +92,9 @@ type FromRococoBulletinMessageBlobDispatcher = BridgeBlobDispatcher<
BridgeRococoToRococoBulletinMessagesPalletInstance,
>;
-/// Signed extension that refunds relayers that are delivering messages from the Rococo Bulletin
-/// chain.
-pub type OnBridgeHubRococoRefundRococoBulletinMessages = BridgeRelayersSignedExtension<
+/// Transaction extension that refunds relayers that are delivering messages from the Rococo
+/// Bulletin chain.
+pub type OnBridgeHubRococoRefundRococoBulletinMessages = BridgeRelayersTransactionExtension<
Runtime,
WithMessagesExtensionConfig<
StrOnBridgeHubRococoRefundRococoBulletinMessages,
diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_westend_config.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_westend_config.rs
index 8fe045723107..29ea4e05f29e 100644
--- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_westend_config.rs
+++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_to_westend_config.rs
@@ -37,7 +37,7 @@ use frame_support::{parameter_types, traits::PalletInfoAccess};
use frame_system::{EnsureNever, EnsureRoot};
use pallet_bridge_messages::LaneIdOf;
use pallet_bridge_relayers::extension::{
- BridgeRelayersSignedExtension, WithMessagesExtensionConfig,
+ BridgeRelayersTransactionExtension, WithMessagesExtensionConfig,
};
use parachains_common::xcm_config::{AllSiblingSystemParachains, RelayOrOtherSystemParachains};
use polkadot_parachain_primitives::primitives::Sibling;
@@ -84,8 +84,9 @@ pub type ToWestendBridgeHubMessagesDeliveryProof =
type FromWestendMessageBlobDispatcher =
BridgeBlobDispatcher;
-/// Signed extension that refunds relayers that are delivering messages from the Westend parachain.
-pub type OnBridgeHubRococoRefundBridgeHubWestendMessages = BridgeRelayersSignedExtension<
+/// Transaction extension that refunds relayers that are delivering messages from the Westend
+/// parachain.
+pub type OnBridgeHubRococoRefundBridgeHubWestendMessages = BridgeRelayersTransactionExtension<
Runtime,
WithMessagesExtensionConfig<
StrOnBridgeHubRococoRefundBridgeHubWestendMessages,
diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
index cafd2b33fa81..259b0355916e 100644
--- a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
+++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs
@@ -120,8 +120,8 @@ pub type SignedBlock = generic::SignedBlock;
/// BlockId type as expected by this runtime.
pub type BlockId = generic::BlockId;
-/// The SignedExtension to the basic transaction logic.
-pub type SignedExtra = (
+/// The TransactionExtension to the basic transaction logic.
+pub type TxExtension = (
frame_system::CheckNonZeroSender,
frame_system::CheckSpecVersion,
frame_system::CheckTxVersion,
@@ -132,13 +132,13 @@ pub type SignedExtra = (
pallet_transaction_payment::ChargeTransactionPayment,
BridgeRejectObsoleteHeadersAndMessages,
(bridge_to_westend_config::OnBridgeHubRococoRefundBridgeHubWestendMessages,),
- cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim,
frame_metadata_hash_extension::CheckMetadataHash,
+ cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic =
- generic::UncheckedExtrinsic;
+ generic::UncheckedExtrinsic;
/// Migrations to apply on runtime upgrade.
pub type Migrations = (
@@ -298,6 +298,8 @@ impl frame_system::Config for Runtime {
type DbWeight = RocksDbWeight;
/// Weight information for the extrinsics of this pallet.
type SystemWeightInfo = weights::frame_system::WeightInfo;
+ /// Weight information for the extensions of this pallet.
+ type ExtensionsWeightInfo = weights::frame_system_extensions::WeightInfo;
/// Block & extrinsics weights: base values and limits.
type BlockWeights = RuntimeBlockWeights;
/// The maximum length of a block (in bytes).
@@ -358,6 +360,7 @@ impl pallet_transaction_payment::Config for Runtime {
type WeightToFee = WeightToFee;
type LengthToFee = ConstantMultiplier;
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate;
+ type WeightInfo = weights::pallet_transaction_payment::WeightInfo;
}
parameter_types! {
@@ -650,12 +653,14 @@ bridge_runtime_common::generate_bridge_reject_obsolete_headers_and_messages! {
mod benches {
frame_benchmarking::define_benchmarks!(
[frame_system, SystemBench::]
+ [frame_system_extensions, SystemExtensionsBench::]
[pallet_balances, Balances]
[pallet_message_queue, MessageQueue]
[pallet_multisig, Multisig]
[pallet_session, SessionBench::]
[pallet_utility, Utility]
[pallet_timestamp, Timestamp]
+ [pallet_transaction_payment, TransactionPayment]
[pallet_collator_selection, CollatorSelection]
[cumulus_pallet_parachain_system, ParachainSystem]
[cumulus_pallet_xcmp_queue, XcmpQueue]
@@ -1037,6 +1042,7 @@ impl_runtime_apis! {
use frame_benchmarking::{Benchmarking, BenchmarkList};
use frame_support::traits::StorageInfoTrait;
use frame_system_benchmarking::Pallet as SystemBench;
+ use frame_system_benchmarking::extensions::Pallet as SystemExtensionsBench;
use cumulus_pallet_session_benchmarking::Pallet as SessionBench;
use pallet_xcm::benchmarking::Pallet as PalletXcmExtrinsicsBenchmark;
@@ -1069,6 +1075,7 @@ impl_runtime_apis! {
use sp_storage::TrackedStorageKey;
use frame_system_benchmarking::Pallet as SystemBench;
+ use frame_system_benchmarking::extensions::Pallet as SystemExtensionsBench;
impl frame_system_benchmarking::Config for Runtime {
fn setup_set_code_requirements(code: &alloc::vec::Vec) -> Result<(), BenchmarkError> {
ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32);
@@ -1538,16 +1545,16 @@ mod tests {
use codec::Encode;
use sp_runtime::{
generic::Era,
- traits::{SignedExtension, Zero},
+ traits::{TransactionExtension, Zero},
};
#[test]
- fn ensure_signed_extension_definition_is_compatible_with_relay() {
- use bp_polkadot_core::SuffixedCommonSignedExtensionExt;
+ fn ensure_transaction_extension_definition_is_compatible_with_relay() {
+ use bp_polkadot_core::SuffixedCommonTransactionExtensionExt;
sp_io::TestExternalities::default().execute_with(|| {
frame_system::BlockHash::::insert(BlockNumber::zero(), Hash::default());
- let payload: SignedExtra = (
+ let payload: TxExtension = (
frame_system::CheckNonZeroSender::new(),
frame_system::CheckSpecVersion::new(),
frame_system::CheckTxVersion::new(),
@@ -1560,13 +1567,13 @@ mod tests {
(
bridge_to_westend_config::OnBridgeHubRococoRefundBridgeHubWestendMessages::default(),
),
- cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim::new(),
frame_metadata_hash_extension::CheckMetadataHash::new(false),
+ cumulus_primitives_storage_weight_reclaim::StorageWeightReclaim::new(),
);
// for BridgeHubRococo
{
- let bhr_indirect_payload = bp_bridge_hub_rococo::SignedExtension::from_params(
+ let bhr_indirect_payload = bp_bridge_hub_rococo::TransactionExtension::from_params(
VERSION.spec_version,
VERSION.transaction_version,
bp_runtime::TransactionEra::Immortal,
@@ -1577,8 +1584,8 @@ mod tests {
);
assert_eq!(payload.encode().split_last().unwrap().1, bhr_indirect_payload.encode());
assert_eq!(
- payload.additional_signed().unwrap().encode().split_last().unwrap().1,
- bhr_indirect_payload.additional_signed().unwrap().encode()
+ TxExtension::implicit(&payload).unwrap().encode().split_last().unwrap().1,
+ sp_runtime::traits::TransactionExtension::::implicit(&bhr_indirect_payload).unwrap().encode()
)
}
});
diff --git a/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/frame_system_extensions.rs b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/frame_system_extensions.rs
new file mode 100644
index 000000000000..64eef1b4f740
--- /dev/null
+++ b/cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/frame_system_extensions.rs
@@ -0,0 +1,132 @@
+// Copyright (C) Parity Technologies (UK) Ltd.
+// This file is part of Cumulus.
+
+// Cumulus is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Cumulus is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Cumulus. If not, see .
+
+//! Autogenerated weights for `frame_system_extensions`
+//!
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
+//! DATE: 2023-12-21, STEPS: `2`, REPEAT: `2`, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! WORST CASE MAP SIZE: `1000000`
+//! HOSTNAME: `gleipnir`, CPU: `AMD Ryzen 9 7900X 12-Core Processor`
+//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("bridge-hub-rococo-dev")`, DB CACHE: 1024
+
+// Executed Command:
+// ./target/release/polkadot-parachain
+// benchmark
+// pallet
+// --wasm-execution=compiled
+// --pallet=frame_system_extensions
+// --no-storage-info
+// --no-median-slopes
+// --no-min-squares
+// --extrinsic=*
+// --steps=2
+// --repeat=2
+// --json
+// --header=./cumulus/file_header.txt
+// --output=./cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/
+// --chain=bridge-hub-rococo-dev
+
+#![cfg_attr(rustfmt, rustfmt_skip)]
+#![allow(unused_parens)]
+#![allow(unused_imports)]
+#![allow(missing_docs)]
+
+use frame_support::{traits::Get, weights::Weight};
+use core::marker::PhantomData;
+
+/// Weight functions for `frame_system_extensions`.
+pub struct WeightInfo(PhantomData);
+impl frame_system::ExtensionsWeightInfo for WeightInfo