where
- Suffix: SignedExtensionSchema,
+ Suffix: TransactionExtensionSchema,
{
fn from_params(
spec_version: u32,
@@ -321,9 +326,9 @@ where
genesis_hash: Hash,
nonce: Nonce,
tip: Balance,
- extra: (Suffix::Payload, Suffix::AdditionalSigned),
+ extra: (Suffix::Payload, Suffix::Implicit),
) -> Self {
- GenericSignedExtension::new(
+ GenericTransactionExtension::new(
(
(
(), // non-zero sender
@@ -365,7 +370,7 @@ where
}
/// Signed extension that is used by most chains.
-pub type CommonSignedExtension = SuffixedCommonSignedExtension<()>;
+pub type CommonTransactionExtension = SuffixedCommonTransactionExtension<()>;
#[cfg(test)]
mod tests {
diff --git a/bridges/primitives/runtime/src/extensions.rs b/bridges/primitives/runtime/src/extensions.rs
index d896bc92efffc4e8fcb427ffa7057dece6f17241..a31e7b5bb47a64ec2333bbaba3e9c520aa53ef5a 100644
--- a/bridges/primitives/runtime/src/extensions.rs
+++ b/bridges/primitives/runtime/src/extensions.rs
@@ -20,135 +20,138 @@ 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, TransactionExtensionBase},
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 TransactionExtensionBase for GenericTransactionExtension
where
- S: SignedExtensionSchema,
+ 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),
- ),
- )
+ ))
}
+}
+impl TransactionExtension for GenericTransactionExtension
+where
+ C: Dispatchable,
+ S: TransactionExtensionSchema,
+ S::Payload: Send + Sync,
+ S::Implicit: Send + Sync,
+{
+ 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; Context; validate prepare);
}
diff --git a/bridges/primitives/test-utils/src/lib.rs b/bridges/primitives/test-utils/src/lib.rs
index f23ddd1a10d3681900b024999aef279ea6fcb91d..1d80890779bf8310b393d585749e96f9577196a1 100644
--- a/bridges/primitives/test-utils/src/lib.rs
+++ b/bridges/primitives/test-utils/src/lib.rs
@@ -129,7 +129,7 @@ pub fn make_justification_for_header(
votes_ancestries.push(child.clone());
}
- // The header we need to use when pre-commiting is the one at the highest height
+ // The header we need to use when pre-committing is the one at the highest height
// on our chain.
let precommit_candidate = chain.last().map(|h| (h.hash(), *h.number())).unwrap();
unsigned_precommits.push(precommit_candidate);
diff --git a/bridges/snowbridge/pallets/ethereum-client/Cargo.toml b/bridges/snowbridge/pallets/ethereum-client/Cargo.toml
index 99b4290531145dba85521574a6d5004e7696cb08..c8999633c97abb00174e38e16ed5618e7baf0b59 100644
--- a/bridges/snowbridge/pallets/ethereum-client/Cargo.toml
+++ b/bridges/snowbridge/pallets/ethereum-client/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "snowbridge-pallet-ethereum-client"
description = "Snowbridge Ethereum Client Pallet"
-version = "0.0.0"
+version = "0.2.0"
authors = ["Snowfork "]
edition.workspace = true
repository.workspace = true
diff --git a/bridges/snowbridge/pallets/inbound-queue/Cargo.toml b/bridges/snowbridge/pallets/inbound-queue/Cargo.toml
index c26ef90a22dbeca766cb7064c1947b52c2e99794..b850496cd4e14cd906565d488450b339a29f463f 100644
--- a/bridges/snowbridge/pallets/inbound-queue/Cargo.toml
+++ b/bridges/snowbridge/pallets/inbound-queue/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "snowbridge-pallet-inbound-queue"
description = "Snowbridge Inbound Queue Pallet"
-version = "0.0.0"
+version = "0.2.0"
authors = ["Snowfork "]
edition.workspace = true
repository.workspace = true
diff --git a/bridges/snowbridge/pallets/inbound-queue/fixtures/Cargo.toml b/bridges/snowbridge/pallets/inbound-queue/fixtures/Cargo.toml
index 61f1421e056773c4f078390f9c48f7b8fa0420d3..64605a42f0d383d838429eb9b82b5f6cf238ab09 100644
--- a/bridges/snowbridge/pallets/inbound-queue/fixtures/Cargo.toml
+++ b/bridges/snowbridge/pallets/inbound-queue/fixtures/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "snowbridge-pallet-inbound-queue-fixtures"
description = "Snowbridge Inbound Queue Test Fixtures"
-version = "0.9.0"
+version = "0.10.0"
authors = ["Snowfork "]
edition.workspace = true
repository.workspace = true
diff --git a/bridges/snowbridge/pallets/inbound-queue/src/mock.rs b/bridges/snowbridge/pallets/inbound-queue/src/mock.rs
index 110f611c6766020039bd1f73def900914da8cae2..749fb0367f332d743b01ad9d56238106ced36e72 100644
--- a/bridges/snowbridge/pallets/inbound-queue/src/mock.rs
+++ b/bridges/snowbridge/pallets/inbound-queue/src/mock.rs
@@ -3,7 +3,7 @@
use super::*;
use frame_support::{
- parameter_types,
+ derive_impl, parameter_types,
traits::{ConstU128, ConstU32, Everything},
weights::IdentityFee,
};
@@ -47,10 +47,9 @@ parameter_types! {
type Balance = u128;
+#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = Everything;
- type BlockWeights = ();
- type BlockLength = ();
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeTask = RuntimeTask;
@@ -60,16 +59,8 @@ impl frame_system::Config for Test {
type Lookup = IdentityLookup;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
- type DbWeight = ();
- type Version = ();
type PalletInfo = PalletInfo;
type AccountData = pallet_balances::AccountData;
- type OnNewAccount = ();
- type OnKilledAccount = ();
- type SystemWeightInfo = ();
- type SS58Prefix = ();
- type OnSetCode = ();
- type MaxConsumers = frame_support::traits::ConstU32<16>;
type Nonce = u64;
type Block = Block;
}
diff --git a/bridges/snowbridge/pallets/outbound-queue/Cargo.toml b/bridges/snowbridge/pallets/outbound-queue/Cargo.toml
index 40e57db4bbd9e5d6e32cee84e586a8858b2222cf..f16a28cb1e457d9ebfb7804fa013e5b57858f79e 100644
--- a/bridges/snowbridge/pallets/outbound-queue/Cargo.toml
+++ b/bridges/snowbridge/pallets/outbound-queue/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "snowbridge-pallet-outbound-queue"
description = "Snowbridge Outbound Queue Pallet"
-version = "0.0.0"
+version = "0.2.0"
authors = ["Snowfork "]
edition.workspace = true
repository.workspace = true
diff --git a/bridges/snowbridge/pallets/outbound-queue/merkle-tree/Cargo.toml b/bridges/snowbridge/pallets/outbound-queue/merkle-tree/Cargo.toml
index c185d5af7062045f40946fcbd3c45cb62b932216..0606e9de33056c9dffae50befcc1da5e865dca44 100644
--- a/bridges/snowbridge/pallets/outbound-queue/merkle-tree/Cargo.toml
+++ b/bridges/snowbridge/pallets/outbound-queue/merkle-tree/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "snowbridge-outbound-queue-merkle-tree"
description = "Snowbridge Outbound Queue Merkle Tree"
-version = "0.1.1"
+version = "0.3.0"
authors = ["Snowfork "]
edition.workspace = true
repository.workspace = true
diff --git a/bridges/snowbridge/pallets/outbound-queue/runtime-api/Cargo.toml b/bridges/snowbridge/pallets/outbound-queue/runtime-api/Cargo.toml
index 347b3bae493b7491790854be7a28f82386d2ee4b..cb68fd0a250a92e7f6a6693f3aebf1c8553308aa 100644
--- a/bridges/snowbridge/pallets/outbound-queue/runtime-api/Cargo.toml
+++ b/bridges/snowbridge/pallets/outbound-queue/runtime-api/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "snowbridge-outbound-queue-runtime-api"
description = "Snowbridge Outbound Queue Runtime API"
-version = "0.0.0"
+version = "0.2.0"
authors = ["Snowfork "]
edition.workspace = true
repository.workspace = true
diff --git a/bridges/snowbridge/pallets/outbound-queue/src/mock.rs b/bridges/snowbridge/pallets/outbound-queue/src/mock.rs
index dd8fee4e2ed08ec0f3090b765fa882b063a98300..6e78fb4467210e3cb5e1eb581b377cbbfeac74ad 100644
--- a/bridges/snowbridge/pallets/outbound-queue/src/mock.rs
+++ b/bridges/snowbridge/pallets/outbound-queue/src/mock.rs
@@ -3,7 +3,7 @@
use super::*;
use frame_support::{
- parameter_types,
+ derive_impl, parameter_types,
traits::{Everything, Hooks},
weights::IdentityFee,
};
@@ -37,10 +37,9 @@ parameter_types! {
pub const BlockHashCount: u64 = 250;
}
+#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = Everything;
- type BlockWeights = ();
- type BlockLength = ();
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeTask = RuntimeTask;
@@ -50,16 +49,7 @@ impl frame_system::Config for Test {
type Lookup = IdentityLookup;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = BlockHashCount;
- type DbWeight = ();
- type Version = ();
type PalletInfo = PalletInfo;
- type AccountData = ();
- type OnNewAccount = ();
- type OnKilledAccount = ();
- type SystemWeightInfo = ();
- type SS58Prefix = ();
- type OnSetCode = ();
- type MaxConsumers = frame_support::traits::ConstU32<16>;
type Nonce = u64;
type Block = Block;
}
diff --git a/bridges/snowbridge/pallets/system/Cargo.toml b/bridges/snowbridge/pallets/system/Cargo.toml
index f6c642e7376f7f068af1fe3c2cf9b11a2c50f2cc..5ad04290de044a2c8ed13aa092f5ea033aaafb97 100644
--- a/bridges/snowbridge/pallets/system/Cargo.toml
+++ b/bridges/snowbridge/pallets/system/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "snowbridge-pallet-system"
description = "Snowbridge System Pallet"
-version = "0.0.0"
+version = "0.2.0"
authors = ["Snowfork "]
edition.workspace = true
repository.workspace = true
diff --git a/bridges/snowbridge/pallets/system/runtime-api/Cargo.toml b/bridges/snowbridge/pallets/system/runtime-api/Cargo.toml
index 355d2d29147f3cd84ae013363db874c9b9739b8e..eb02ae1db529730f51743e79a322e54db44fee51 100644
--- a/bridges/snowbridge/pallets/system/runtime-api/Cargo.toml
+++ b/bridges/snowbridge/pallets/system/runtime-api/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "snowbridge-system-runtime-api"
description = "Snowbridge System Runtime API"
-version = "0.0.0"
+version = "0.2.0"
authors = ["Snowfork "]
edition.workspace = true
repository.workspace = true
diff --git a/bridges/snowbridge/pallets/system/src/mock.rs b/bridges/snowbridge/pallets/system/src/mock.rs
index edc3f141b0735d7439b120c51da836fb8a77bd04..de2970dd550ba75fe42de08dc4d297cd5cccdf1f 100644
--- a/bridges/snowbridge/pallets/system/src/mock.rs
+++ b/bridges/snowbridge/pallets/system/src/mock.rs
@@ -2,8 +2,8 @@
// SPDX-FileCopyrightText: 2023 Snowfork
use crate as snowbridge_system;
use frame_support::{
- parameter_types,
- traits::{tokens::fungible::Mutate, ConstU128, ConstU16, ConstU64, ConstU8},
+ derive_impl, parameter_types,
+ traits::{tokens::fungible::Mutate, ConstU128, ConstU64, ConstU8},
weights::IdentityFee,
PalletId,
};
@@ -95,11 +95,9 @@ frame_support::construct_runtime!(
}
);
+#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
- type BlockWeights = ();
- type BlockLength = ();
- type DbWeight = ();
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;
type RuntimeTask = RuntimeTask;
@@ -109,15 +107,8 @@ impl frame_system::Config for Test {
type Lookup = IdentityLookup;
type RuntimeEvent = RuntimeEvent;
type BlockHashCount = ConstU64<250>;
- type Version = ();
type PalletInfo = PalletInfo;
type AccountData = pallet_balances::AccountData;
- type OnNewAccount = ();
- type OnKilledAccount = ();
- type SystemWeightInfo = ();
- type SS58Prefix = ConstU16<42>;
- type OnSetCode = ();
- type MaxConsumers = frame_support::traits::ConstU32<16>;
type Nonce = u64;
type Block = Block;
}
diff --git a/bridges/snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs b/bridges/snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs
new file mode 100644
index 0000000000000000000000000000000000000000..77b5c1aa631db89a986837f258ee7dea45a580d0
--- /dev/null
+++ b/bridges/snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs
@@ -0,0 +1,259 @@
+// SPDX-License-Identifier: Apache-2.0
+// SPDX-FileCopyrightText: 2023 Snowfork
+use crate as ethereum_beacon_client;
+use frame_support::parameter_types;
+use pallet_timestamp;
+use primitives::{Fork, ForkVersions};
+use sp_core::H256;
+use sp_runtime::traits::{BlakeTwo256, IdentityLookup};
+
+#[cfg(not(feature = "beacon-spec-mainnet"))]
+pub mod minimal {
+ use super::*;
+
+ use crate::config;
+ use frame_support::derive_impl;
+ use hex_literal::hex;
+ use primitives::CompactExecutionHeader;
+ use snowbridge_core::inbound::{Log, Proof};
+ use sp_runtime::BuildStorage;
+ use std::{fs::File, path::PathBuf};
+
+ type Block = frame_system::mocking::MockBlock;
+
+ frame_support::construct_runtime!(
+ pub enum Test {
+ System: frame_system::{Pallet, Call, Storage, Event},
+ Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
+ EthereumBeaconClient: ethereum_beacon_client::{Pallet, Call, Storage, Event},
+ }
+ );
+
+ parameter_types! {
+ pub const BlockHashCount: u64 = 250;
+ pub const SS58Prefix: u8 = 42;
+ }
+
+ #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
+ impl frame_system::Config for Test {
+ type BaseCallFilter = frame_support::traits::Everything;
+ type RuntimeOrigin = RuntimeOrigin;
+ type RuntimeCall = RuntimeCall;
+ type RuntimeTask = RuntimeTask;
+ type Hash = H256;
+ type Hashing = BlakeTwo256;
+ type AccountId = u64;
+ type Lookup = IdentityLookup;
+ type RuntimeEvent = RuntimeEvent;
+ type BlockHashCount = BlockHashCount;
+ type PalletInfo = PalletInfo;
+ type SS58Prefix = SS58Prefix;
+ type Nonce = u64;
+ type Block = Block;
+ }
+
+ impl pallet_timestamp::Config for Test {
+ type Moment = u64;
+ type OnTimestampSet = ();
+ type MinimumPeriod = ();
+ type WeightInfo = ();
+ }
+
+ parameter_types! {
+ pub const ExecutionHeadersPruneThreshold: u32 = 10;
+ pub const ChainForkVersions: ForkVersions = ForkVersions{
+ genesis: Fork {
+ version: [0, 0, 0, 1], // 0x00000001
+ epoch: 0,
+ },
+ altair: Fork {
+ version: [1, 0, 0, 1], // 0x01000001
+ epoch: 0,
+ },
+ bellatrix: Fork {
+ version: [2, 0, 0, 1], // 0x02000001
+ epoch: 0,
+ },
+ capella: Fork {
+ version: [3, 0, 0, 1], // 0x03000001
+ epoch: 0,
+ },
+ };
+ }
+
+ impl ethereum_beacon_client::Config for Test {
+ type RuntimeEvent = RuntimeEvent;
+ type ForkVersions = ChainForkVersions;
+ type MaxExecutionHeadersToKeep = ExecutionHeadersPruneThreshold;
+ type WeightInfo = ();
+ }
+
+ // Build genesis storage according to the mock runtime.
+ pub fn new_tester() -> sp_io::TestExternalities {
+ let t = frame_system::GenesisConfig::::default().build_storage().unwrap();
+ let mut ext = sp_io::TestExternalities::new(t);
+ let _ = ext.execute_with(|| Timestamp::set(RuntimeOrigin::signed(1), 30_000));
+ ext
+ }
+
+ fn load_fixture(basename: &str) -> Result
+ where
+ T: for<'de> serde::Deserialize<'de>,
+ {
+ let filepath: PathBuf =
+ [env!("CARGO_MANIFEST_DIR"), "tests", "fixtures", basename].iter().collect();
+ serde_json::from_reader(File::open(filepath).unwrap())
+ }
+
+ pub fn load_execution_header_update_fixture() -> primitives::ExecutionHeaderUpdate {
+ load_fixture("execution-header-update.minimal.json").unwrap()
+ }
+
+ pub fn load_checkpoint_update_fixture(
+ ) -> primitives::CheckpointUpdate<{ config::SYNC_COMMITTEE_SIZE }> {
+ load_fixture("initial-checkpoint.minimal.json").unwrap()
+ }
+
+ pub fn load_sync_committee_update_fixture(
+ ) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> {
+ load_fixture("sync-committee-update.minimal.json").unwrap()
+ }
+
+ pub fn load_finalized_header_update_fixture(
+ ) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> {
+ load_fixture("finalized-header-update.minimal.json").unwrap()
+ }
+
+ pub fn load_next_sync_committee_update_fixture(
+ ) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> {
+ load_fixture("next-sync-committee-update.minimal.json").unwrap()
+ }
+
+ pub fn load_next_finalized_header_update_fixture(
+ ) -> primitives::Update<{ config::SYNC_COMMITTEE_SIZE }, { config::SYNC_COMMITTEE_BITS_SIZE }> {
+ load_fixture("next-finalized-header-update.minimal.json").unwrap()
+ }
+
+ pub fn get_message_verification_payload() -> (Log, Proof) {
+ (
+ Log {
+ address: hex!("ee9170abfbf9421ad6dd07f6bdec9d89f2b581e0").into(),
+ topics: vec![
+ hex!("1b11dcf133cc240f682dab2d3a8e4cd35c5da8c9cf99adac4336f8512584c5ad").into(),
+ hex!("00000000000000000000000000000000000000000000000000000000000003e8").into(),
+ hex!("0000000000000000000000000000000000000000000000000000000000000001").into(),
+ ],
+ data: hex!("0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004b000f000000000000000100d184c103f7acc340847eee82a0b909e3358bc28d440edffa1352b13227e8ee646f3ea37456dec701345772617070656420457468657210574554481235003511000000000000000000000000000000000000000000").into(),
+ },
+ Proof {
+ block_hash: hex!("05aaa60b0f27cce9e71909508527264b77ee14da7b5bf915fcc4e32715333213").into(),
+ tx_index: 0,
+ data: (vec![
+ hex!("cf0d1c1ba57d1e0edfb59786c7e30c2b7e12bd54612b00cd21c4eaeecedf44fb").to_vec(),
+ hex!("d21fc4f68ab05bc4dcb23c67008e92c4d466437cdd6ed7aad0c008944c185510").to_vec(),
+ hex!("b9890f91ca0d77aa2a4adfaf9b9e40c94cac9e638b6d9797923865872944b646").to_vec(),
+ ], vec![
+ hex!("f90131a0b601337b3aa10a671caa724eba641e759399979856141d3aea6b6b4ac59b889ba00c7d5dd48be9060221a02fb8fa213860b4c50d47046c8fa65ffaba5737d569e0a094601b62a1086cd9c9cb71a7ebff9e718f3217fd6e837efe4246733c0a196f63a06a4b0dd0aefc37b3c77828c8f07d1b7a2455ceb5dbfd3c77d7d6aeeddc2f7e8ca0d6e8e23142cdd8ec219e1f5d8b56aa18e456702b195deeaa210327284d42ade4a08a313d4c87023005d1ab631bbfe3f5de1e405d0e66d0bef3e033f1e5711b5521a0bf09a5d9a48b10ade82b8d6a5362a15921c8b5228a3487479b467db97411d82fa0f95cccae2a7c572ef3c566503e30bac2b2feb2d2f26eebf6d870dcf7f8cf59cea0d21fc4f68ab05bc4dcb23c67008e92c4d466437cdd6ed7aad0c008944c1855108080808080808080").to_vec(),
+ hex!("f851a0b9890f91ca0d77aa2a4adfaf9b9e40c94cac9e638b6d9797923865872944b646a060a634b9280e3a23fb63375e7bbdd9ab07fd379ab6a67e2312bbc112195fa358808080808080808080808080808080").to_vec(),
+ hex!("f9030820b9030402f90300018301d6e2b9010000000000000800000000000020040008000000000000000000000000400000008000000000000000000000000000000000000000000000000000000000042010000000001000000000000000000000000000000000040000000000000000000000000000000000000000000000008000000000000000002000000000000000000000000200000000000000200000000000100000000040000001000200008000000000000200000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000000f901f5f87a942ffa5ecdbe006d30397c7636d3e015eee251369ff842a0c965575a00553e094ca7c5d14f02e107c258dda06867cbf9e0e69f80e71bbcc1a000000000000000000000000000000000000000000000000000000000000003e8a000000000000000000000000000000000000000000000000000000000000003e8f9011c94ee9170abfbf9421ad6dd07f6bdec9d89f2b581e0f863a01b11dcf133cc240f682dab2d3a8e4cd35c5da8c9cf99adac4336f8512584c5ada000000000000000000000000000000000000000000000000000000000000003e8a00000000000000000000000000000000000000000000000000000000000000001b8a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000004b000f000000000000000100d184c103f7acc340847eee82a0b909e3358bc28d440edffa1352b13227e8ee646f3ea37456dec701345772617070656420457468657210574554481235003511000000000000000000000000000000000000000000f858948cf6147918a5cbb672703f879f385036f8793a24e1a01449abf21e49fd025f33495e77f7b1461caefdd3d4bb646424a3f445c4576a5ba0000000000000000000000000440edffa1352b13227e8ee646f3ea37456dec701").to_vec(),
+ ]),
+ }
+ )
+ }
+
+ pub fn get_message_verification_header() -> CompactExecutionHeader {
+ CompactExecutionHeader {
+ parent_hash: hex!("04a7f6ab8282203562c62f38b0ab41d32aaebe2c7ea687702b463148a6429e04")
+ .into(),
+ block_number: 55,
+ state_root: hex!("894d968712976d613519f973a317cb0781c7b039c89f27ea2b7ca193f7befdb3")
+ .into(),
+ receipts_root: hex!("cf0d1c1ba57d1e0edfb59786c7e30c2b7e12bd54612b00cd21c4eaeecedf44fb")
+ .into(),
+ }
+ }
+}
+
+#[cfg(feature = "beacon-spec-mainnet")]
+pub mod mainnet {
+ use super::*;
+ use frame_support::derive_impl;
+
+ type Block = frame_system::mocking::MockBlock;
+ use sp_runtime::BuildStorage;
+
+ frame_support::construct_runtime!(
+ pub enum Test {
+ System: frame_system::{Pallet, Call, Storage, Event},
+ Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
+ EthereumBeaconClient: ethereum_beacon_client::{Pallet, Call, Storage, Event},
+ }
+ );
+
+ parameter_types! {
+ pub const BlockHashCount: u64 = 250;
+ pub const SS58Prefix: u8 = 42;
+ }
+
+ #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
+ impl frame_system::Config for Test {
+ type BaseCallFilter = frame_support::traits::Everything;
+ type RuntimeOrigin = RuntimeOrigin;
+ type RuntimeCall = RuntimeCall;
+ type RuntimeTask = RuntimeTask;
+ type Hash = H256;
+ type Hashing = BlakeTwo256;
+ type AccountId = u64;
+ type Lookup = IdentityLookup;
+ type RuntimeEvent = RuntimeEvent;
+ type BlockHashCount = BlockHashCount;
+ type PalletInfo = PalletInfo;
+ type SS58Prefix = SS58Prefix;
+ type Nonce = u64;
+ type Block = Block;
+ }
+
+ impl pallet_timestamp::Config for Test {
+ type Moment = u64;
+ type OnTimestampSet = ();
+ type MinimumPeriod = ();
+ type WeightInfo = ();
+ }
+
+ parameter_types! {
+ pub const ChainForkVersions: ForkVersions = ForkVersions{
+ genesis: Fork {
+ version: [0, 0, 16, 32], // 0x00001020
+ epoch: 0,
+ },
+ altair: Fork {
+ version: [1, 0, 16, 32], // 0x01001020
+ epoch: 36660,
+ },
+ bellatrix: Fork {
+ version: [2, 0, 16, 32], // 0x02001020
+ epoch: 112260,
+ },
+ capella: Fork {
+ version: [3, 0, 16, 32], // 0x03001020
+ epoch: 162304,
+ },
+ };
+ pub const ExecutionHeadersPruneThreshold: u32 = 10;
+ }
+
+ impl ethereum_beacon_client::Config for Test {
+ type RuntimeEvent = RuntimeEvent;
+ type ForkVersions = ChainForkVersions;
+ type MaxExecutionHeadersToKeep = ExecutionHeadersPruneThreshold;
+ type WeightInfo = ();
+ }
+
+ // Build genesis storage according to the mock runtime.
+ pub fn new_tester() -> sp_io::TestExternalities {
+ let t = frame_system::GenesisConfig::::default().build_storage().unwrap();
+ let mut ext = sp_io::TestExternalities::new(t);
+ let _ = ext.execute_with(|| Timestamp::set(RuntimeOrigin::signed(1), 30_000));
+ ext
+ }
+}
diff --git a/bridges/snowbridge/primitives/beacon/Cargo.toml b/bridges/snowbridge/primitives/beacon/Cargo.toml
index e021bb01071471b56d44f4a430c9ae5b7bdca57d..d181fa1d3945a704a3d1e1e28fea67b7dea0ee15 100644
--- a/bridges/snowbridge/primitives/beacon/Cargo.toml
+++ b/bridges/snowbridge/primitives/beacon/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "snowbridge-beacon-primitives"
description = "Snowbridge Beacon Primitives"
-version = "0.0.0"
+version = "0.2.0"
authors = ["Snowfork "]
edition.workspace = true
repository.workspace = true
diff --git a/bridges/snowbridge/primitives/core/Cargo.toml b/bridges/snowbridge/primitives/core/Cargo.toml
index 090c48c403fecf76b598abcc390ffa054a8281a3..9a299ad0ae92326a6d0bb0391baf81e6e5bad663 100644
--- a/bridges/snowbridge/primitives/core/Cargo.toml
+++ b/bridges/snowbridge/primitives/core/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "snowbridge-core"
description = "Snowbridge Core"
-version = "0.0.0"
+version = "0.2.0"
authors = ["Snowfork "]
edition.workspace = true
repository.workspace = true
diff --git a/bridges/snowbridge/primitives/ethereum/Cargo.toml b/bridges/snowbridge/primitives/ethereum/Cargo.toml
index 399139cef3816a2f840f4937a7449034aea9638d..9fa725a6c0565a5f42847d89149878f8997d07a0 100644
--- a/bridges/snowbridge/primitives/ethereum/Cargo.toml
+++ b/bridges/snowbridge/primitives/ethereum/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "snowbridge-ethereum"
description = "Snowbridge Ethereum"
-version = "0.1.0"
+version = "0.3.0"
authors = ["Snowfork "]
edition.workspace = true
repository.workspace = true
diff --git a/bridges/snowbridge/primitives/router/Cargo.toml b/bridges/snowbridge/primitives/router/Cargo.toml
index 750a2a73e6372c138cb4420d5f06f26d35b90ab4..ded773e0d38917b7834679b3e521dfbe9539e51b 100644
--- a/bridges/snowbridge/primitives/router/Cargo.toml
+++ b/bridges/snowbridge/primitives/router/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "snowbridge-router-primitives"
description = "Snowbridge Router Primitives"
-version = "0.0.0"
+version = "0.9.0"
authors = ["Snowfork "]
edition.workspace = true
repository.workspace = true
diff --git a/bridges/snowbridge/runtime/runtime-common/Cargo.toml b/bridges/snowbridge/runtime/runtime-common/Cargo.toml
index d4c86f8aa750134df8dfbe22a277a872e77f9175..bf5e9a8832dcf48113d5f74a92a060687da2fe4e 100644
--- a/bridges/snowbridge/runtime/runtime-common/Cargo.toml
+++ b/bridges/snowbridge/runtime/runtime-common/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "snowbridge-runtime-common"
description = "Snowbridge Runtime Common"
-version = "0.0.0"
+version = "0.2.0"
authors = ["Snowfork "]
edition.workspace = true
repository.workspace = true
diff --git a/bridges/snowbridge/runtime/test-common/Cargo.toml b/bridges/snowbridge/runtime/test-common/Cargo.toml
index ec4466b34265fd344e870f92f64eea014ad76b98..5f169e82f49346742bd97028da583105bf02335d 100644
--- a/bridges/snowbridge/runtime/test-common/Cargo.toml
+++ b/bridges/snowbridge/runtime/test-common/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "snowbridge-runtime-test-common"
description = "Snowbridge Runtime Tests"
-version = "0.0.0"
+version = "0.2.0"
authors = ["Snowfork "]
edition = "2021"
license = "Apache-2.0"
@@ -181,6 +181,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/runtime-benchmarks",
diff --git a/bridges/snowbridge/runtime/test-common/src/lib.rs b/bridges/snowbridge/runtime/test-common/src/lib.rs
index 29b0e738c182e3a9dd930fe8596fc5430470d5e0..7455adf76170acefd50f06e8a40ef1c79028f49f 100644
--- a/bridges/snowbridge/runtime/test-common/src/lib.rs
+++ b/bridges/snowbridge/runtime/test-common/src/lib.rs
@@ -40,6 +40,7 @@ where
}
pub fn send_transfer_token_message(
+ ethereum_chain_id: u64,
assethub_parachain_id: u32,
weth_contract_address: H160,
destination_address: H160,
@@ -89,7 +90,7 @@ where
WithdrawAsset(Assets::from(vec![fee.clone()])),
BuyExecution { fees: fee, weight_limit: Unlimited },
ExportMessage {
- network: Ethereum { chain_id: 11155111 },
+ network: Ethereum { chain_id: ethereum_chain_id },
destination: Here,
xcm: inner_xcm,
},
@@ -107,6 +108,7 @@ where
}
pub fn send_transfer_token_message_success(
+ ethereum_chain_id: u64,
collator_session_key: CollatorSessionKeys,
runtime_para_id: u32,
assethub_parachain_id: u32,
@@ -149,6 +151,7 @@ pub fn send_transfer_token_message_success(
initial_fund::(assethub_parachain_id, 5_000_000_000_000);
let outcome = send_transfer_token_message::(
+ ethereum_chain_id,
assethub_parachain_id,
weth_contract_address,
destination_address,
@@ -205,6 +208,7 @@ pub fn ethereum_outbound_queue_processes_messages_before_message_queue_works<
XcmConfig,
AllPalletsWithoutSystem,
>(
+ ethereum_chain_id: u64,
collator_session_key: CollatorSessionKeys,
runtime_para_id: u32,
assethub_parachain_id: u32,
@@ -249,6 +253,7 @@ pub fn ethereum_outbound_queue_processes_messages_before_message_queue_works<
initial_fund::(assethub_parachain_id, 5_000_000_000_000);
let outcome = send_transfer_token_message::(
+ ethereum_chain_id,
assethub_parachain_id,
weth_contract_address,
destination_address,
@@ -290,6 +295,7 @@ pub fn ethereum_outbound_queue_processes_messages_before_message_queue_works<
}
pub fn send_unpaid_transfer_token_message(
+ ethereum_chain_id: u64,
collator_session_key: CollatorSessionKeys,
runtime_para_id: u32,
assethub_parachain_id: u32,
@@ -353,7 +359,7 @@ pub fn send_unpaid_transfer_token_message(
let xcm = Xcm(vec![
UnpaidExecution { weight_limit: Unlimited, check_origin: None },
ExportMessage {
- network: Ethereum { chain_id: 11155111 },
+ network: Ethereum { chain_id: ethereum_chain_id },
destination: Here,
xcm: inner_xcm,
},
@@ -375,6 +381,7 @@ pub fn send_unpaid_transfer_token_message(
#[allow(clippy::too_many_arguments)]
pub fn send_transfer_token_message_failure(
+ ethereum_chain_id: u64,
collator_session_key: CollatorSessionKeys,
runtime_para_id: u32,
assethub_parachain_id: u32,
@@ -414,6 +421,7 @@ pub fn send_transfer_token_message_failure(
initial_fund::(assethub_parachain_id, initial_amount);
let outcome = send_transfer_token_message::(
+ ethereum_chain_id,
assethub_parachain_id,
weth_contract_address,
destination_address,
diff --git a/bridges/snowbridge/scripts/contribute-upstream.sh b/bridges/snowbridge/scripts/contribute-upstream.sh
index 8aa2d2a7035e2f213c0fc2090952b4b162739963..32005b770ecf44cb9af18c61f830243ed5287e68 100755
--- a/bridges/snowbridge/scripts/contribute-upstream.sh
+++ b/bridges/snowbridge/scripts/contribute-upstream.sh
@@ -40,10 +40,12 @@ git checkout "$branch_name"
# remove everything we think is not required for our needs
rm -rf rust-toolchain.toml
+rm -rf codecov.yml
rm -rf $SNOWBRIDGE_FOLDER/.cargo
rm -rf $SNOWBRIDGE_FOLDER/.github
rm -rf $SNOWBRIDGE_FOLDER/SECURITY.md
rm -rf $SNOWBRIDGE_FOLDER/.gitignore
+rm -rf $SNOWBRIDGE_FOLDER/rustfmt.toml
rm -rf $SNOWBRIDGE_FOLDER/templates
rm -rf $SNOWBRIDGE_FOLDER/pallets/ethereum-client/fuzz
diff --git a/cumulus/client/consensus/aura/src/lib.rs b/cumulus/client/consensus/aura/src/lib.rs
index 8e4bc658e44bfdc173f3fdb66518da883edcb05b..ed6f5bdd4d6984350c5f59a3753618c3a038f323 100644
--- a/cumulus/client/consensus/aura/src/lib.rs
+++ b/cumulus/client/consensus/aura/src/lib.rs
@@ -54,7 +54,10 @@ use std::{
mod import_queue;
pub use import_queue::{build_verifier, import_queue, BuildVerifierParams, ImportQueueParams};
-pub use sc_consensus_aura::{slot_duration, AuraVerifier, BuildAuraWorkerParams, SlotProportion};
+pub use sc_consensus_aura::{
+ slot_duration, standalone::slot_duration_at, AuraVerifier, BuildAuraWorkerParams,
+ SlotProportion,
+};
pub use sc_consensus_slots::InherentDataProviderExt;
pub mod collator;
diff --git a/cumulus/client/parachain-inherent/src/lib.rs b/cumulus/client/parachain-inherent/src/lib.rs
index 57353638e197acf255b73080c6802e94647c2090..051eb6764c8ce97a8305a07bdddb8f06f61fe4bc 100644
--- a/cumulus/client/parachain-inherent/src/lib.rs
+++ b/cumulus/client/parachain-inherent/src/lib.rs
@@ -159,7 +159,7 @@ impl ParachainInherentDataProvider {
target: LOG_TARGET,
relay_parent = ?relay_parent,
error = ?e,
- "An error occured during requesting the downward messages.",
+ "An error occurred during requesting the downward messages.",
);
})
.ok()?;
@@ -171,7 +171,7 @@ impl ParachainInherentDataProvider {
target: LOG_TARGET,
relay_parent = ?relay_parent,
error = ?e,
- "An error occured during requesting the inbound HRMP messages.",
+ "An error occurred during requesting the inbound HRMP messages.",
);
})
.ok()?;
diff --git a/cumulus/pallets/collator-selection/src/benchmarking.rs b/cumulus/pallets/collator-selection/src/benchmarking.rs
index 2c40f4dd0eac4a8a2ad3aed7f162a4379ccdbc93..e2af74a6e60ef00ca9d1111518d86df3fdfb0656 100644
--- a/cumulus/pallets/collator-selection/src/benchmarking.rs
+++ b/cumulus/pallets/collator-selection/src/benchmarking.rs
@@ -22,9 +22,7 @@ use super::*;
#[allow(unused)]
use crate::Pallet as CollatorSelection;
use codec::Decode;
-use frame_benchmarking::{
- account, impl_benchmark_test_suite, v2::*, whitelisted_caller, BenchmarkError,
-};
+use frame_benchmarking::{account, v2::*, whitelisted_caller, BenchmarkError};
use frame_support::traits::{Currency, EnsureOrigin, Get, ReservableCurrency};
use frame_system::{pallet_prelude::BlockNumberFor, EventRecord, RawOrigin};
use pallet_authorship::EventHandler;
diff --git a/cumulus/pallets/parachain-system/src/lib.rs b/cumulus/pallets/parachain-system/src/lib.rs
index 3439227bc5b0218f6eeddd34080f42f59babcae3..81965a2a313875fd8783cf9e22ca3dd652f688c3 100644
--- a/cumulus/pallets/parachain-system/src/lib.rs
+++ b/cumulus/pallets/parachain-system/src/lib.rs
@@ -205,6 +205,7 @@ pub mod pallet {
type OnSystemEvent: OnSystemEvent;
/// Returns the parachain ID we are running with.
+ #[pallet::constant]
type SelfParaId: Get;
/// The place where outbound XCMP messages come from. This is queried in `finalize_block`.
diff --git a/cumulus/pallets/xcmp-queue/src/lib.rs b/cumulus/pallets/xcmp-queue/src/lib.rs
index 5b900769622afa3cba2c47f493ebff1a279b182b..e92169be16b0b8466582f3dd143d9e3e1807a42d 100644
--- a/cumulus/pallets/xcmp-queue/src/lib.rs
+++ b/cumulus/pallets/xcmp-queue/src/lib.rs
@@ -600,7 +600,7 @@ impl Pallet {
let QueueConfigData { drop_threshold, .. } = >::get();
let fp = T::XcmpQueue::footprint(sender);
// Assume that it will not fit into the current page:
- let new_pages = fp.pages.saturating_add(1);
+ let new_pages = fp.ready_pages.saturating_add(1);
if new_pages > drop_threshold {
// This should not happen since the channel should have been suspended in
// [`on_queue_changed`].
@@ -663,12 +663,12 @@ impl OnQueueChanged for Pallet {
let mut suspended_channels = >::get();
let suspended = suspended_channels.contains(¶);
- if suspended && fp.pages <= resume_threshold {
+ if suspended && fp.ready_pages <= resume_threshold {
Self::send_signal(para, ChannelSignal::Resume);
suspended_channels.remove(¶);
>::put(suspended_channels);
- } else if !suspended && fp.pages >= suspend_threshold {
+ } else if !suspended && fp.ready_pages >= suspend_threshold {
log::warn!("XCMP queue for sibling {:?} is full; suspending channel.", para);
Self::send_signal(para, ChannelSignal::Suspend);
diff --git a/cumulus/pallets/xcmp-queue/src/mock.rs b/cumulus/pallets/xcmp-queue/src/mock.rs
index 08ab58ce816046336fcba0a2318bd2ff77227e5f..1fb88cafd93c425833d38c0904f59490cc479294 100644
--- a/cumulus/pallets/xcmp-queue/src/mock.rs
+++ b/cumulus/pallets/xcmp-queue/src/mock.rs
@@ -247,6 +247,7 @@ impl> EnqueueMessage for EnqueueToLocalStorage
}
}
footprint.pages = footprint.storage.size as u32 / 16; // Number does not matter
+ footprint.ready_pages = footprint.pages;
footprint
}
}
diff --git a/cumulus/parachain-template/pallets/template/README.md b/cumulus/parachain-template/pallets/template/README.md
deleted file mode 100644
index 5a6461233465c327d233fc5d97bdb3a6a85f8fd9..0000000000000000000000000000000000000000
--- a/cumulus/parachain-template/pallets/template/README.md
+++ /dev/null
@@ -1 +0,0 @@
-License: Unlicense
diff --git a/cumulus/parachain-template/pallets/template/src/benchmarking.rs b/cumulus/parachain-template/pallets/template/src/benchmarking.rs
deleted file mode 100644
index 8bba2a09867dea1d55e487661c01fd72acdf4dc9..0000000000000000000000000000000000000000
--- a/cumulus/parachain-template/pallets/template/src/benchmarking.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-//! Benchmarking setup for pallet-parachain-template
-
-use super::*;
-
-#[allow(unused)]
-use crate::Pallet as Template;
-use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, whitelisted_caller};
-use frame_system::RawOrigin;
-
-benchmarks! {
- do_something {
- let s in 0 .. 100;
- let caller: T::AccountId = whitelisted_caller();
- }: _(RawOrigin::Signed(caller), s)
- verify {
- assert_eq!(Something::::get(), Some(s));
- }
-}
-
-impl_benchmark_test_suite!(Template, crate::mock::new_test_ext(), crate::mock::Test,);
diff --git a/cumulus/parachains/integration-tests/emulated/chains/parachains/testing/penpal/src/lib.rs b/cumulus/parachains/integration-tests/emulated/chains/parachains/testing/penpal/src/lib.rs
index 8f586a46a75cb68a7ccdf62d2f23a1865dcf5d9c..c1e030466559e86f126640a3ee2a97e3fbf5a8a5 100644
--- a/cumulus/parachains/integration-tests/emulated/chains/parachains/testing/penpal/src/lib.rs
+++ b/cumulus/parachains/integration-tests/emulated/chains/parachains/testing/penpal/src/lib.rs
@@ -16,7 +16,8 @@
mod genesis;
pub use genesis::{genesis, ED, PARA_ID_A, PARA_ID_B};
pub use penpal_runtime::xcm_config::{
- LocalTeleportableToAssetHub, LocalTeleportableToAssetHubV3, XcmConfig,
+ CustomizableAssetFromSystemAssetHub, LocalTeleportableToAssetHub,
+ LocalTeleportableToAssetHubV3, XcmConfig,
};
// Substrate
diff --git a/cumulus/parachains/integration-tests/emulated/common/src/impls.rs b/cumulus/parachains/integration-tests/emulated/common/src/impls.rs
index 4bbb4701e43918f5f34b250a23c4c483f2b2d4d1..c93484829fe8193c69a4d9475e81201e3607796c 100644
--- a/cumulus/parachains/integration-tests/emulated/common/src/impls.rs
+++ b/cumulus/parachains/integration-tests/emulated/common/src/impls.rs
@@ -265,7 +265,7 @@ macro_rules! impl_assert_events_helpers_for_relay_chain {
$crate::impls::assert_expected_events!(
Self,
vec![
- // XCM is succesfully received and proccessed
+ // XCM is successfully received and proccessed
[<$chain RuntimeEvent>]::::MessageQueue($crate::impls::pallet_message_queue::Event::Processed {
origin: $crate::impls::AggregateMessageOrigin::Ump($crate::impls::UmpQueueId::Para(id)),
weight_used,
diff --git a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs
index a5957ee339306f580b7906b25d3adfff4a78deb1..ff069e2d3443ec13d8cb17a18c7127f48b6f34ef 100644
--- a/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs
+++ b/cumulus/parachains/integration-tests/emulated/tests/bridges/bridge-hub-rococo/src/tests/snowbridge.rs
@@ -18,6 +18,7 @@ use codec::{Decode, Encode};
use emulated_integration_tests_common::xcm_emulator::ConvertLocation;
use frame_support::pallet_prelude::TypeInfo;
use hex_literal::hex;
+use rococo_system_emulated_network::penpal_emulated_chain::CustomizableAssetFromSystemAssetHub;
use rococo_westend_system_emulated_network::BridgeHubRococoParaSender as BridgeHubRococoSender;
use snowbridge_core::outbound::OperatingMode;
use snowbridge_pallet_inbound_queue_fixtures::{
@@ -253,6 +254,16 @@ fn send_token_from_ethereum_to_penpal() {
(PenpalASender::get(), INITIAL_FUND),
]);
+ PenpalA::execute_with(|| {
+ assert_ok!(::System::set_storage(
+ ::RuntimeOrigin::root(),
+ vec![(
+ CustomizableAssetFromSystemAssetHub::key().to_vec(),
+ Location::new(2, [GlobalConsensus(Ethereum { chain_id: CHAIN_ID })]).encode(),
+ )],
+ ));
+ });
+
// The Weth asset location, identified by the contract address on Ethereum
let weth_asset_location: Location =
(Parent, Parent, EthereumNetwork::get(), AccountKey20 { network: None, key: WETH }).into();
diff --git a/cumulus/parachains/pallets/collective-content/src/benchmarking.rs b/cumulus/parachains/pallets/collective-content/src/benchmarking.rs
index 943386a842766129c2b5d429dc3a9648249ea73f..3d6bf073778a294e39287285ddb8379d57d36c8f 100644
--- a/cumulus/parachains/pallets/collective-content/src/benchmarking.rs
+++ b/cumulus/parachains/pallets/collective-content/src/benchmarking.rs
@@ -16,7 +16,7 @@
//! The pallet benchmarks.
use super::{Pallet as CollectiveContent, *};
-use frame_benchmarking::{impl_benchmark_test_suite, v2::*};
+use frame_benchmarking::v2::*;
use frame_support::traits::EnsureOrigin;
fn assert_last_event, I: 'static>(generic_event: >::RuntimeEvent) {
diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml b/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml
index 05936e93993231429d738edf15acc48150bcc542..3eb63a24b74e9eee4ded63cc591ec6ba8adb136b 100644
--- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml
+++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml
@@ -119,6 +119,7 @@ runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
+ "pallet-asset-conversion-tx-payment/runtime-benchmarks",
"pallet-asset-conversion/runtime-benchmarks",
"pallet-assets/runtime-benchmarks",
"pallet-balances/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-rococo/src/lib.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
index 6791dc4064ed7eb2ca780f75797d71d52bab3401..32966ab6341d7bf4b2efae0cf008cfa6dfb67275 100644
--- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
+++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs
@@ -113,7 +113,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("statemine"),
impl_name: create_runtime_str!("statemine"),
authoring_version: 1,
- spec_version: 1_007_000,
+ spec_version: 1_008_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 14,
@@ -126,7 +126,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("statemine"),
impl_name: create_runtime_str!("statemine"),
authoring_version: 1,
- spec_version: 1_007_000,
+ spec_version: 1_008_000,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 14,
@@ -178,6 +178,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>;
@@ -234,6 +235,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! {
@@ -761,6 +763,9 @@ impl pallet_asset_conversion_tx_payment::Config for Runtime {
type Fungibles = LocalAndForeignAssets;
type OnChargeAssetTransaction =
AssetConversionAdapter;
+ type WeightInfo = weights::pallet_asset_conversion_tx_payment::WeightInfo;
+ #[cfg(feature = "runtime-benchmarks")]
+ type BenchmarkHelper = AssetConversionTxHelper;
}
parameter_types! {
@@ -948,8 +953,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,
@@ -961,7 +966,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 = (
pallet_collator_selection::migration::v1::MigrateToV1,
@@ -1034,14 +1039,77 @@ 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,
+ xcm::v3::MultiLocation,
+ xcm::v3::MultiLocation,
+ > for AssetConversionTxHelper
+{
+ fn create_asset_id_parameter(seed: u32) -> (xcm::v3::MultiLocation, xcm::v3::MultiLocation) {
+ // Use a different parachain' foreign assets pallet so that the asset is indeed foreign.
+ let asset_id = xcm::v3::MultiLocation::new(
+ 1,
+ xcm::v3::Junctions::X3(
+ xcm::v3::Junction::Parachain(3000),
+ xcm::v3::Junction::PalletInstance(53),
+ xcm::v3::Junction::GeneralIndex(seed.into()),
+ ),
+ );
+ (asset_id, asset_id)
+ }
+
+ fn setup_balances_and_pool(asset_id: xcm::v3::MultiLocation, account: AccountId) {
+ use frame_support::{assert_ok, traits::fungibles::Mutate};
+ assert_ok!(ForeignAssets::force_create(
+ RuntimeOrigin::root(),
+ asset_id.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.into(), &lp_provider, u64::MAX.into()));
+
+ let token_native = Box::new(TokenLocationV3::get());
+ let token_second = 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]
@@ -1052,6 +1120,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]
@@ -1093,7 +1162,7 @@ impl_runtime_apis! {
Executive::execute_block(block)
}
- fn initialize_block(header: &::Header) {
+ fn initialize_block(header: &::Header) -> sp_runtime::ExtrinsicInclusionMode {
Executive::initialize_block(header)
}
}
@@ -1302,6 +1371,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;
@@ -1336,6 +1406,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: &sp_std::vec::Vec) -> Result<(), BenchmarkError> {
ParachainSystem::initialize_for_set_code_benchmark(code.len() as u32);
@@ -1454,6 +1525,13 @@ impl_runtime_apis! {
});
Some((assets, fee_index as u32, dest, verify))
}
+
+ fn get_asset() -> Asset {
+ Asset {
+ id: AssetId(Location::parent()),
+ fun: Fungible(ExistentialDeposit::get()),
+ }
+ }
}
impl XcmBridgeHubRouterConfig for Runtime {
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 0000000000000000000000000000000000000000..ed2c5f3056e3c44601fee945ccda3eab35444e12
--- /dev/null
+++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/frame_system_extensions.rs
@@ -0,0 +1,121 @@
+// 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() -> 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 fa9e86102c619c9ff68316cae2a27a7f79fea2e6..134b5341a401ca0f0918d3f04a79d2a4d1d9622d 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,7 +19,9 @@ 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_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-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 0000000000000000000000000000000000000000..0a639b368af2248bdaf1efa7538d58a935dbe2e0
--- /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 0000000000000000000000000000000000000000..035f9a6dbe5167cb651736f705b817d4ba9027c4
--- /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-rococo/src/weights/pallet_xcm.rs b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_xcm.rs
index f8820bbb58cb24afe1afe034e131414368089444..51b6543bae82ba496998706ab6c2aaf6e0ff604b 100644
--- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_xcm.rs
+++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/src/weights/pallet_xcm.rs
@@ -16,10 +16,10 @@
//! Autogenerated weights for `pallet_xcm`
//!
-//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2023-12-05, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0
+//! DATE: 2024-02-20, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
-//! HOSTNAME: `runner-r43aesjn-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
+//! HOSTNAME: `runner-bn-ce5rx-project-674-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("asset-hub-rococo-dev")`, DB CACHE: 1024
// Executed Command:
@@ -64,8 +64,8 @@ impl pallet_xcm::WeightInfo for WeightInfo {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
- // Minimum execution time: 25_003_000 picoseconds.
- Weight::from_parts(25_800_000, 0)
+ // Minimum execution time: 22_136_000 picoseconds.
+ Weight::from_parts(22_518_000, 0)
.saturating_add(Weight::from_parts(0, 3610))
.saturating_add(T::DbWeight::get().reads(6))
.saturating_add(T::DbWeight::get().writes(2))
@@ -90,8 +90,8 @@ impl pallet_xcm::WeightInfo for WeightInfo {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
- // Minimum execution time: 88_832_000 picoseconds.
- Weight::from_parts(90_491_000, 0)
+ // Minimum execution time: 92_277_000 picoseconds.
+ Weight::from_parts(94_843_000, 0)
.saturating_add(Weight::from_parts(0, 3610))
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(3))
@@ -118,8 +118,8 @@ impl pallet_xcm::WeightInfo for WeightInfo {
// Proof Size summary in bytes:
// Measured: `400`
// Estimated: `6196`
- // Minimum execution time: 138_911_000 picoseconds.
- Weight::from_parts(142_483_000, 0)
+ // Minimum execution time: 120_110_000 picoseconds.
+ Weight::from_parts(122_968_000, 0)
.saturating_add(Weight::from_parts(0, 6196))
.saturating_add(T::DbWeight::get().reads(9))
.saturating_add(T::DbWeight::get().writes(5))
@@ -148,8 +148,8 @@ impl pallet_xcm::WeightInfo for WeightInfo {
// Proof Size summary in bytes:
// Measured: `496`
// Estimated: `6208`
- // Minimum execution time: 146_932_000 picoseconds.
- Weight::from_parts(153_200_000, 0)
+ // Minimum execution time: 143_116_000 picoseconds.
+ Weight::from_parts(147_355_000, 0)
.saturating_add(Weight::from_parts(0, 6208))
.saturating_add(T::DbWeight::get().reads(12))
.saturating_add(T::DbWeight::get().writes(7))
@@ -170,8 +170,8 @@ impl pallet_xcm::WeightInfo for WeightInfo {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
- // Minimum execution time: 7_081_000 picoseconds.
- Weight::from_parts(7_397_000, 0)
+ // Minimum execution time: 6_517_000 picoseconds.
+ Weight::from_parts(6_756_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -181,8 +181,8 @@ impl pallet_xcm::WeightInfo for WeightInfo {
// Proof Size summary in bytes:
// Measured: `0`
// Estimated: `0`
- // Minimum execution time: 2_007_000 picoseconds.
- Weight::from_parts(2_183_000, 0)
+ // Minimum execution time: 1_894_000 picoseconds.
+ Weight::from_parts(2_024_000, 0)
.saturating_add(Weight::from_parts(0, 0))
.saturating_add(T::DbWeight::get().writes(1))
}
@@ -208,8 +208,8 @@ impl pallet_xcm::WeightInfo for WeightInfo {
// Proof Size summary in bytes:
// Measured: `145`
// Estimated: `3610`
- // Minimum execution time: 28_790_000 picoseconds.
- Weight::from_parts(29_767_000, 0)
+ // Minimum execution time: 27_314_000 picoseconds.
+ Weight::from_parts(28_787_000, 0)
.saturating_add(Weight::from_parts(0, 3610))
.saturating_add(T::DbWeight::get().reads(8))
.saturating_add(T::DbWeight::get().writes(5))
@@ -234,8 +234,8 @@ impl