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/bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh b/bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh
index de5be2e0af8861008781ca3eab81f0422dc81e91..479ab833abfc38dd978c7b7d3abdd4c1fe37ad64 100755
--- a/bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh
+++ b/bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh
@@ -319,6 +319,7 @@ case "$1" in
$XCM_VERSION
;;
reserve-transfer-assets-from-asset-hub-rococo-local)
+ amount=$2
ensure_polkadot_js_api
# send ROCs to Alice account on AHW
limited_reserve_transfer_assets \
@@ -326,11 +327,12 @@ case "$1" in
"//Alice" \
"$(jq --null-input '{ "V3": { "parents": 2, "interior": { "X2": [ { "GlobalConsensus": "Westend" }, { "Parachain": 1000 } ] } } }')" \
"$(jq --null-input '{ "V3": { "parents": 0, "interior": { "X1": { "AccountId32": { "id": [212, 53, 147, 199, 21, 253, 211, 28, 97, 20, 26, 189, 4, 169, 159, 214, 130, 44, 133, 88, 133, 76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125] } } } } }')" \
- "$(jq --null-input '{ "V3": [ { "id": { "Concrete": { "parents": 1, "interior": "Here" } }, "fun": { "Fungible": 5000000000000 } } ] }')" \
+ "$(jq --null-input '{ "V3": [ { "id": { "Concrete": { "parents": 1, "interior": "Here" } }, "fun": { "Fungible": '$amount' } } ] }')" \
0 \
"Unlimited"
;;
withdraw-reserve-assets-from-asset-hub-rococo-local)
+ amount=$2
ensure_polkadot_js_api
# send back only 100000000000 wrappedWNDs to Alice account on AHW
limited_reserve_transfer_assets \
@@ -338,11 +340,12 @@ case "$1" in
"//Alice" \
"$(jq --null-input '{ "V3": { "parents": 2, "interior": { "X2": [ { "GlobalConsensus": "Westend" }, { "Parachain": 1000 } ] } } }')" \
"$(jq --null-input '{ "V3": { "parents": 0, "interior": { "X1": { "AccountId32": { "id": [212, 53, 147, 199, 21, 253, 211, 28, 97, 20, 26, 189, 4, 169, 159, 214, 130, 44, 133, 88, 133, 76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125] } } } } }')" \
- "$(jq --null-input '{ "V3": [ { "id": { "Concrete": { "parents": 2, "interior": { "X1": { "GlobalConsensus": "Westend" } } } }, "fun": { "Fungible": 3000000000000 } } ] }')" \
+ "$(jq --null-input '{ "V3": [ { "id": { "Concrete": { "parents": 2, "interior": { "X1": { "GlobalConsensus": "Westend" } } } }, "fun": { "Fungible": '$amount' } } ] }')" \
0 \
"Unlimited"
;;
reserve-transfer-assets-from-asset-hub-westend-local)
+ amount=$2
ensure_polkadot_js_api
# send WNDs to Alice account on AHR
limited_reserve_transfer_assets \
@@ -350,11 +353,12 @@ case "$1" in
"//Alice" \
"$(jq --null-input '{ "V3": { "parents": 2, "interior": { "X2": [ { "GlobalConsensus": "Rococo" }, { "Parachain": 1000 } ] } } }')" \
"$(jq --null-input '{ "V3": { "parents": 0, "interior": { "X1": { "AccountId32": { "id": [212, 53, 147, 199, 21, 253, 211, 28, 97, 20, 26, 189, 4, 169, 159, 214, 130, 44, 133, 88, 133, 76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125] } } } } }')" \
- "$(jq --null-input '{ "V3": [ { "id": { "Concrete": { "parents": 1, "interior": "Here" } }, "fun": { "Fungible": 5000000000000 } } ] }')" \
+ "$(jq --null-input '{ "V3": [ { "id": { "Concrete": { "parents": 1, "interior": "Here" } }, "fun": { "Fungible": '$amount' } } ] }')" \
0 \
"Unlimited"
;;
withdraw-reserve-assets-from-asset-hub-westend-local)
+ amount=$2
ensure_polkadot_js_api
# send back only 100000000000 wrappedROCs to Alice account on AHR
limited_reserve_transfer_assets \
@@ -362,7 +366,7 @@ case "$1" in
"//Alice" \
"$(jq --null-input '{ "V3": { "parents": 2, "interior": { "X2": [ { "GlobalConsensus": "Rococo" }, { "Parachain": 1000 } ] } } }')" \
"$(jq --null-input '{ "V3": { "parents": 0, "interior": { "X1": { "AccountId32": { "id": [212, 53, 147, 199, 21, 253, 211, 28, 97, 20, 26, 189, 4, 169, 159, 214, 130, 44, 133, 88, 133, 76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125] } } } } }')" \
- "$(jq --null-input '{ "V3": [ { "id": { "Concrete": { "parents": 2, "interior": { "X1": { "GlobalConsensus": "Rococo" } } } }, "fun": { "Fungible": 3000000000000 } } ] }')" \
+ "$(jq --null-input '{ "V3": [ { "id": { "Concrete": { "parents": 2, "interior": { "X1": { "GlobalConsensus": "Rococo" } } } }, "fun": { "Fungible": '$amount' } } ] }')" \
0 \
"Unlimited"
;;
diff --git a/bridges/testing/framework/js-helpers/native-assets-balance-increased.js b/bridges/testing/framework/js-helpers/native-assets-balance-increased.js
index a35c753d97326d7b200c33844e9c5b8be22dfebc..749c3e2fec32ac0af4d244c53cb4ac1c6237817a 100644
--- a/bridges/testing/framework/js-helpers/native-assets-balance-increased.js
+++ b/bridges/testing/framework/js-helpers/native-assets-balance-increased.js
@@ -3,12 +3,13 @@ async function run(nodeName, networkInfo, args) {
const api = await zombie.connect(wsUri, userDefinedTypes);
const accountAddress = args[0];
+ const expectedIncrease = BigInt(args[1]);
const initialAccountData = await api.query.system.account(accountAddress);
const initialAccountBalance = initialAccountData.data['free'];
while (true) {
const accountData = await api.query.system.account(accountAddress);
const accountBalance = accountData.data['free'];
- if (accountBalance > initialAccountBalance) {
+ if (accountBalance > initialAccountBalance + expectedIncrease) {
return accountBalance;
}
@@ -17,4 +18,4 @@ async function run(nodeName, networkInfo, args) {
}
}
-module.exports = { run }
+module.exports = {run}
diff --git a/bridges/testing/tests/0001-asset-transfer/roc-reaches-westend.zndsl b/bridges/testing/tests/0001-asset-transfer/roc-reaches-westend.zndsl
index 4725362ae826ec6d8313ec45c0ce21f70f244ca6..a58520ccea65b50dd0db1f67a72f6f8a4c5cdb38 100644
--- a/bridges/testing/tests/0001-asset-transfer/roc-reaches-westend.zndsl
+++ b/bridges/testing/tests/0001-asset-transfer/roc-reaches-westend.zndsl
@@ -2,11 +2,11 @@ Description: User is able to transfer ROC from Rococo Asset Hub to Westend Asset
Network: {{ENV_PATH}}/bridge_hub_westend_local_network.toml
Creds: config
-# send ROC to //Alice from Rococo AH to Westend AH
-asset-hub-westend-collator1: run {{ENV_PATH}}/helper.sh with "reserve-transfer-assets-from-asset-hub-rococo-local" within 120 seconds
+# send 5 ROC to //Alice from Rococo AH to Westend AH
+asset-hub-westend-collator1: run {{ENV_PATH}}/helper.sh with "reserve-transfer-assets-from-asset-hub-rococo-local 5000000000000" within 120 seconds
-# check that //Alice received the ROC on Westend AH
-asset-hub-westend-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/wrapped-assets-balance.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,0,Rococo" within 300 seconds
+# check that //Alice received at least 4.8 ROC on Westend AH
+asset-hub-westend-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/wrapped-assets-balance.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,4800000000000,Rococo" within 300 seconds
# check that the relayer //Charlie is rewarded by Westend AH
bridge-hub-westend-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/relayer-rewards.js with "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,0x00000002,0x6268726F,ThisChain,0" within 30 seconds
diff --git a/bridges/testing/tests/0001-asset-transfer/wnd-reaches-rococo.zndsl b/bridges/testing/tests/0001-asset-transfer/wnd-reaches-rococo.zndsl
index 77267239c3b12bb1c3caf88f9bb01bfd98f2c121..fedb78cc2103555a1d15c446dd2f08fca94643e1 100644
--- a/bridges/testing/tests/0001-asset-transfer/wnd-reaches-rococo.zndsl
+++ b/bridges/testing/tests/0001-asset-transfer/wnd-reaches-rococo.zndsl
@@ -2,11 +2,11 @@ Description: User is able to transfer WND from Westend Asset Hub to Rococo Asset
Network: {{ENV_PATH}}/bridge_hub_rococo_local_network.toml
Creds: config
-# send WND to //Alice from Westend AH to Rococo AH
-asset-hub-rococo-collator1: run {{ENV_PATH}}/helper.sh with "reserve-transfer-assets-from-asset-hub-westend-local" within 120 seconds
+# send 5 WND to //Alice from Westend AH to Rococo AH
+asset-hub-rococo-collator1: run {{ENV_PATH}}/helper.sh with "reserve-transfer-assets-from-asset-hub-westend-local 5000000000000" within 120 seconds
-# check that //Alice received the WND on Rococo AH
-asset-hub-rococo-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/wrapped-assets-balance.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,0,Westend" within 300 seconds
+# check that //Alice received at least 4.8 WND on Rococo AH
+asset-hub-rococo-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/wrapped-assets-balance.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,4800000000000,Westend" within 300 seconds
# check that the relayer //Charlie is rewarded by Rococo AH
bridge-hub-rococo-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/relayer-rewards.js with "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y,0x00000002,0x62687764,ThisChain,0" within 30 seconds
diff --git a/bridges/testing/tests/0001-asset-transfer/wroc-reaches-rococo.zndsl b/bridges/testing/tests/0001-asset-transfer/wroc-reaches-rococo.zndsl
index f72b76e6026b6a0a24fa16fc4d08f79ba07f5e60..68b888b6858e86b8fe846b887bc101e221b2f21d 100644
--- a/bridges/testing/tests/0001-asset-transfer/wroc-reaches-rococo.zndsl
+++ b/bridges/testing/tests/0001-asset-transfer/wroc-reaches-rococo.zndsl
@@ -2,9 +2,9 @@ Description: User is able to transfer ROC from Rococo Asset Hub to Westend Asset
Network: {{ENV_PATH}}/bridge_hub_westend_local_network.toml
Creds: config
-# send wROC back to Alice from Westend AH to Rococo AH
-asset-hub-rococo-collator1: run {{ENV_PATH}}/helper.sh with "withdraw-reserve-assets-from-asset-hub-westend-local" within 120 seconds
+# send 3 wROC back to Alice from Westend AH to Rococo AH
+asset-hub-rococo-collator1: run {{ENV_PATH}}/helper.sh with "withdraw-reserve-assets-from-asset-hub-westend-local 3000000000000" within 120 seconds
-# check that //Alice received the wROC on Rococo AH
+# check that //Alice received at least 2.8 wROC on Rococo AH
# (we wait until //Alice account increases here - there are no other transactions that may increase it)
-asset-hub-rococo-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/native-assets-balance-increased.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" within 300 seconds
+asset-hub-rococo-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/native-assets-balance-increased.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,2800000000000" within 300 seconds
diff --git a/bridges/testing/tests/0001-asset-transfer/wwnd-reaches-westend.zndsl b/bridges/testing/tests/0001-asset-transfer/wwnd-reaches-westend.zndsl
index 9d893c8d90a80df97b33b7ff16297700c7a8253a..1a8a161819542e281094aed0681d52167aaea8e6 100644
--- a/bridges/testing/tests/0001-asset-transfer/wwnd-reaches-westend.zndsl
+++ b/bridges/testing/tests/0001-asset-transfer/wwnd-reaches-westend.zndsl
@@ -2,9 +2,9 @@ Description: User is able to transfer ROC from Rococo Asset Hub to Westend Asset
Network: {{ENV_PATH}}/bridge_hub_westend_local_network.toml
Creds: config
-# send wWND back to Alice from Rococo AH to Westend AH
-asset-hub-westend-collator1: run {{ENV_PATH}}/helper.sh with "withdraw-reserve-assets-from-asset-hub-rococo-local" within 120 seconds
+# send 3 wWND back to Alice from Rococo AH to Westend AH
+asset-hub-westend-collator1: run {{ENV_PATH}}/helper.sh with "withdraw-reserve-assets-from-asset-hub-rococo-local 3000000000000" within 120 seconds
-# check that //Alice received the wWND on Westend AH
+# check that //Alice received at least 2.8 wWND on Westend AH
# (we wait until //Alice account increases here - there are no other transactions that may increase it)
-asset-hub-westend-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/native-assets-balance-increased.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY" within 300 seconds
+asset-hub-westend-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/native-assets-balance-increased.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,2800000000000" within 300 seconds
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/client/relay-chain-minimal-node/Cargo.toml b/cumulus/client/relay-chain-minimal-node/Cargo.toml
index 0b1e001e007a493f521f10c2659653699da04d0c..98240c92adab38ea103f14699e1e49f7449b3d24 100644
--- a/cumulus/client/relay-chain-minimal-node/Cargo.toml
+++ b/cumulus/client/relay-chain-minimal-node/Cargo.toml
@@ -24,6 +24,7 @@ polkadot-node-collation-generation = { path = "../../../polkadot/node/collation-
polkadot-node-core-runtime-api = { path = "../../../polkadot/node/core/runtime-api" }
polkadot-node-core-chain-api = { path = "../../../polkadot/node/core/chain-api" }
polkadot-node-core-prospective-parachains = { path = "../../../polkadot/node/core/prospective-parachains" }
+polkadot-service = { path = "../../../polkadot/node/service" }
# substrate deps
sc-authority-discovery = { path = "../../../substrate/client/authority-discovery" }
diff --git a/cumulus/client/relay-chain-minimal-node/src/collator_overseer.rs b/cumulus/client/relay-chain-minimal-node/src/collator_overseer.rs
index 5f5bf338ef9907756adb1eab3f0541e870677fe5..f01ef8b05ecba77cf6458fdfe80e966b3a67e6a3 100644
--- a/cumulus/client/relay-chain-minimal-node/src/collator_overseer.rs
+++ b/cumulus/client/relay-chain-minimal-node/src/collator_overseer.rs
@@ -15,159 +15,29 @@
// along with Polkadot. If not, see .
use futures::{select, StreamExt};
-use parking_lot::Mutex;
-use std::{collections::HashMap, sync::Arc};
+use std::sync::Arc;
-use polkadot_availability_recovery::AvailabilityRecoverySubsystem;
-use polkadot_collator_protocol::{CollatorProtocolSubsystem, ProtocolSide};
-use polkadot_network_bridge::{
- Metrics as NetworkBridgeMetrics, NetworkBridgeRx as NetworkBridgeRxSubsystem,
- NetworkBridgeTx as NetworkBridgeTxSubsystem,
-};
-use polkadot_node_collation_generation::CollationGenerationSubsystem;
-use polkadot_node_core_chain_api::ChainApiSubsystem;
-use polkadot_node_core_prospective_parachains::ProspectiveParachainsSubsystem;
-use polkadot_node_core_runtime_api::RuntimeApiSubsystem;
-use polkadot_node_network_protocol::{
- peer_set::{PeerSet, PeerSetProtocolNames},
- request_response::{
- v1::{self, AvailableDataFetchingRequest},
- v2, IncomingRequestReceiver, ReqProtocolNames,
- },
-};
-use polkadot_node_subsystem_util::metrics::{prometheus::Registry, Metrics};
use polkadot_overseer::{
- BlockInfo, DummySubsystem, Handle, Overseer, OverseerConnector, OverseerHandle, SpawnGlue,
- UnpinHandle,
+ BlockInfo, Handle, Overseer, OverseerConnector, OverseerHandle, SpawnGlue, UnpinHandle,
};
-use polkadot_primitives::CollatorPair;
+use polkadot_service::overseer::{collator_overseer_builder, OverseerGenArgs};
-use sc_authority_discovery::Service as AuthorityDiscoveryService;
-use sc_network::{NetworkStateInfo, NotificationService};
use sc_service::TaskManager;
use sc_utils::mpsc::tracing_unbounded;
-use cumulus_primitives_core::relay_chain::{Block, Hash as PHash};
use cumulus_relay_chain_interface::RelayChainError;
use crate::BlockChainRpcClient;
-/// Arguments passed for overseer construction.
-pub(crate) struct CollatorOverseerGenArgs<'a> {
- /// Runtime client generic, providing the `ProvieRuntimeApi` trait besides others.
- pub runtime_client: Arc,
- /// Underlying network service implementation.
- pub network_service: Arc>,
- /// Syncing oracle.
- pub sync_oracle: Box,
- /// Underlying authority discovery service.
- pub authority_discovery_service: AuthorityDiscoveryService,
- /// Receiver for collation request protocol v1.
- pub collation_req_receiver_v1: IncomingRequestReceiver,
- /// Receiver for collation request protocol v2.
- pub collation_req_receiver_v2: IncomingRequestReceiver,
- /// Receiver for availability request protocol
- pub available_data_req_receiver: IncomingRequestReceiver,
- /// Prometheus registry, commonly used for production systems, less so for test.
- pub registry: Option<&'a Registry>,
- /// Task spawner to be used throughout the overseer and the APIs it provides.
- pub spawner: sc_service::SpawnTaskHandle,
- /// Determines the behavior of the collator.
- pub collator_pair: CollatorPair,
- /// Request response protocols
- pub req_protocol_names: ReqProtocolNames,
- /// Peerset protocols name mapping
- pub peer_set_protocol_names: PeerSetProtocolNames,
- /// Notification services for validation/collation protocols.
- pub notification_services: HashMap>,
-}
-
fn build_overseer(
connector: OverseerConnector,
- CollatorOverseerGenArgs {
- runtime_client,
- network_service,
- sync_oracle,
- authority_discovery_service,
- collation_req_receiver_v1,
- collation_req_receiver_v2,
- available_data_req_receiver,
- registry,
- spawner,
- collator_pair,
- req_protocol_names,
- peer_set_protocol_names,
- notification_services,
- }: CollatorOverseerGenArgs<'_>,
+ args: OverseerGenArgs,
) -> Result<
(Overseer, Arc>, OverseerHandle),
RelayChainError,
> {
- let spawner = SpawnGlue(spawner);
- let network_bridge_metrics: NetworkBridgeMetrics = Metrics::register(registry)?;
- let notification_sinks = Arc::new(Mutex::new(HashMap::new()));
-
- let builder = Overseer::builder()
- .availability_distribution(DummySubsystem)
- .availability_recovery(AvailabilityRecoverySubsystem::for_collator(
- available_data_req_receiver,
- Metrics::register(registry)?,
- ))
- .availability_store(DummySubsystem)
- .bitfield_distribution(DummySubsystem)
- .bitfield_signing(DummySubsystem)
- .candidate_backing(DummySubsystem)
- .candidate_validation(DummySubsystem)
- .pvf_checker(DummySubsystem)
- .chain_api(ChainApiSubsystem::new(runtime_client.clone(), Metrics::register(registry)?))
- .collation_generation(CollationGenerationSubsystem::new(Metrics::register(registry)?))
- .collator_protocol({
- let side = ProtocolSide::Collator {
- peer_id: network_service.local_peer_id(),
- collator_pair,
- request_receiver_v1: collation_req_receiver_v1,
- request_receiver_v2: collation_req_receiver_v2,
- metrics: Metrics::register(registry)?,
- };
- CollatorProtocolSubsystem::new(side)
- })
- .network_bridge_rx(NetworkBridgeRxSubsystem::new(
- network_service.clone(),
- authority_discovery_service.clone(),
- sync_oracle,
- network_bridge_metrics.clone(),
- peer_set_protocol_names.clone(),
- notification_services,
- notification_sinks.clone(),
- ))
- .network_bridge_tx(NetworkBridgeTxSubsystem::new(
- network_service,
- authority_discovery_service,
- network_bridge_metrics,
- req_protocol_names,
- peer_set_protocol_names,
- notification_sinks,
- ))
- .provisioner(DummySubsystem)
- .runtime_api(RuntimeApiSubsystem::new(
- runtime_client.clone(),
- Metrics::register(registry)?,
- spawner.clone(),
- ))
- .statement_distribution(DummySubsystem)
- .prospective_parachains(ProspectiveParachainsSubsystem::new(Metrics::register(registry)?))
- .approval_distribution(DummySubsystem)
- .approval_voting(DummySubsystem)
- .gossip_support(DummySubsystem)
- .dispute_coordinator(DummySubsystem)
- .dispute_distribution(DummySubsystem)
- .chain_selection(DummySubsystem)
- .activation_external_listeners(Default::default())
- .span_per_active_leaf(Default::default())
- .active_leaves(Default::default())
- .supports_parachains(runtime_client)
- .metrics(Metrics::register(registry)?)
- .spawner(spawner);
+ let builder =
+ collator_overseer_builder(args).map_err(|e| RelayChainError::Application(e.into()))?;
builder
.build_with_connector(connector)
@@ -175,7 +45,7 @@ fn build_overseer(
}
pub(crate) fn spawn_overseer(
- overseer_args: CollatorOverseerGenArgs,
+ overseer_args: OverseerGenArgs,
task_manager: &TaskManager,
relay_chain_rpc_client: Arc,
) -> Result {
diff --git a/cumulus/client/relay-chain-minimal-node/src/lib.rs b/cumulus/client/relay-chain-minimal-node/src/lib.rs
index d121d2d3356765d9327fdaa0a8c0563c3917266f..4bccca59fe3ea2eec816513778885f43c9504d51 100644
--- a/cumulus/client/relay-chain-minimal-node/src/lib.rs
+++ b/cumulus/client/relay-chain-minimal-node/src/lib.rs
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see .
-use collator_overseer::{CollatorOverseerGenArgs, NewMinimalNode};
+use collator_overseer::NewMinimalNode;
use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayChainResult};
use cumulus_relay_chain_rpc_interface::{RelayChainRpcClient, RelayChainRpcInterface, Url};
@@ -29,6 +29,7 @@ use polkadot_node_network_protocol::{
use polkadot_node_subsystem_util::metrics::prometheus::Registry;
use polkadot_primitives::CollatorPair;
+use polkadot_service::{overseer::OverseerGenArgs, IsParachainNode};
use sc_authority_discovery::Service as AuthorityDiscoveryService;
use sc_network::{config::FullNetworkConfiguration, Event, NetworkEventStream, NetworkService};
@@ -172,10 +173,10 @@ async fn new_minimal_relay_chain(
}
let genesis_hash = relay_chain_rpc_client.block_get_hash(Some(0)).await?.unwrap_or_default();
- let peer_set_protocol_names =
+ let peerset_protocol_names =
PeerSetProtocolNames::new(genesis_hash, config.chain_spec.fork_id());
let is_authority = if role.is_authority() { IsAuthority::Yes } else { IsAuthority::No };
- let notification_services = peer_sets_info(is_authority, &peer_set_protocol_names)
+ let notification_services = peer_sets_info(is_authority, &peerset_protocol_names)
.into_iter()
.map(|(config, (peerset, service))| {
net_config.add_notification_protocol(config);
@@ -184,14 +185,14 @@ async fn new_minimal_relay_chain(
.collect::>>();
let request_protocol_names = ReqProtocolNames::new(genesis_hash, config.chain_spec.fork_id());
- let (collation_req_receiver_v1, collation_req_receiver_v2, available_data_req_receiver) =
+ let (collation_req_v1_receiver, collation_req_v2_receiver, available_data_req_receiver) =
build_request_response_protocol_receivers(&request_protocol_names, &mut net_config);
let best_header = relay_chain_rpc_client
.chain_get_header(None)
.await?
.ok_or_else(|| RelayChainError::RpcCallError("Unable to fetch best header".to_string()))?;
- let (network, network_starter, sync_oracle) = build_collator_network(
+ let (network, network_starter, sync_service) = build_collator_network(
&config,
net_config,
task_manager.spawn_handle(),
@@ -208,19 +209,20 @@ async fn new_minimal_relay_chain(
prometheus_registry.cloned(),
);
- let overseer_args = CollatorOverseerGenArgs {
+ let overseer_args = OverseerGenArgs {
runtime_client: relay_chain_rpc_client.clone(),
network_service: network,
- sync_oracle,
+ sync_service,
authority_discovery_service,
- collation_req_receiver_v1,
- collation_req_receiver_v2,
+ collation_req_v1_receiver,
+ collation_req_v2_receiver,
available_data_req_receiver,
registry: prometheus_registry,
spawner: task_manager.spawn_handle(),
- collator_pair,
+ is_parachain_node: IsParachainNode::Collator(collator_pair),
+ overseer_message_channel_capacity_override: None,
req_protocol_names: request_protocol_names,
- peer_set_protocol_names,
+ peerset_protocol_names,
notification_services,
};
@@ -240,10 +242,10 @@ fn build_request_response_protocol_receivers(
IncomingRequestReceiver,
IncomingRequestReceiver,
) {
- let (collation_req_receiver_v1, cfg) =
+ let (collation_req_v1_receiver, cfg) =
IncomingRequest::get_config_receiver(request_protocol_names);
config.add_request_response_protocol(cfg);
- let (collation_req_receiver_v2, cfg) =
+ let (collation_req_v2_receiver, cfg) =
IncomingRequest::get_config_receiver(request_protocol_names);
config.add_request_response_protocol(cfg);
let (available_data_req_receiver, cfg) =
@@ -251,5 +253,5 @@ fn build_request_response_protocol_receivers(
config.add_request_response_protocol(cfg);
let cfg = Protocol::ChunkFetchingV1.get_outbound_only_config(request_protocol_names);
config.add_request_response_protocol(cfg);
- (collation_req_receiver_v1, collation_req_receiver_v2, available_data_req_receiver)
+ (collation_req_v1_receiver, collation_req_v2_receiver, available_data_req_receiver)
}
diff --git a/cumulus/client/relay-chain-minimal-node/src/network.rs b/cumulus/client/relay-chain-minimal-node/src/network.rs
index 95785063c1aeb6649d7154fa39e4e111e226def3..7286fab7907cb6d475b81a4dfd97c5d001180873 100644
--- a/cumulus/client/relay-chain-minimal-node/src/network.rs
+++ b/cumulus/client/relay-chain-minimal-node/src/network.rs
@@ -40,7 +40,11 @@ pub(crate) fn build_collator_network(
genesis_hash: Hash,
best_header: Header,
) -> Result<
- (Arc>, NetworkStarter, Box),
+ (
+ Arc>,
+ NetworkStarter,
+ Arc,
+ ),
Error,
> {
let protocol_id = config.protocol_id();
@@ -112,7 +116,7 @@ pub(crate) fn build_collator_network(
let network_starter = NetworkStarter::new(network_start_tx);
- Ok((network_service, network_starter, Box::new(SyncOracle {})))
+ Ok((network_service, network_starter, Arc::new(SyncOracle {})))
}
fn adjust_network_config_light_in_peers(config: &mut NetworkConfiguration) {
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/collator-selection/src/lib.rs b/cumulus/pallets/collator-selection/src/lib.rs
index 7449f4d68c7eacc8b07fa45f2f991c13f3d5713b..62c00737f91a4aac25f2e1972a0c5aade5e0eed2 100644
--- a/cumulus/pallets/collator-selection/src/lib.rs
+++ b/cumulus/pallets/collator-selection/src/lib.rs
@@ -118,7 +118,7 @@ pub mod pallet {
use sp_staking::SessionIndex;
use sp_std::vec::Vec;
- /// The current storage version.
+ /// The in-code storage version.
const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);
type BalanceOf =
@@ -495,7 +495,11 @@ pub mod pallet {
})
.unwrap_or_default();
Self::deposit_event(Event::NewCandidacyBond { bond_amount: bond });
- Ok(Some(T::WeightInfo::set_candidacy_bond(initial_len as u32, kicked as u32)).into())
+ Ok(Some(T::WeightInfo::set_candidacy_bond(
+ bond_increased.then(|| initial_len as u32).unwrap_or_default(),
+ kicked as u32,
+ ))
+ .into())
}
/// Register this account as a collator candidate. The account must (a) already have
diff --git a/cumulus/pallets/collator-selection/src/migration.rs b/cumulus/pallets/collator-selection/src/migration.rs
index 58b4cc5b06a1ab7da17b31ad3c457fd992c59136..f384981dbae8e034a4465ac0f226fb4422be8089 100644
--- a/cumulus/pallets/collator-selection/src/migration.rs
+++ b/cumulus/pallets/collator-selection/src/migration.rs
@@ -31,8 +31,8 @@ pub mod v1 {
pub struct MigrateToV1(sp_std::marker::PhantomData);
impl OnRuntimeUpgrade for MigrateToV1 {
fn on_runtime_upgrade() -> Weight {
- let onchain_version = Pallet::::on_chain_storage_version();
- if onchain_version == 0 {
+ let on_chain_version = Pallet::::on_chain_storage_version();
+ if on_chain_version == 0 {
let invulnerables_len = Invulnerables::::get().to_vec().len();
>::mutate(|invulnerables| {
invulnerables.sort();
@@ -45,7 +45,7 @@ pub mod v1 {
invulnerables_len,
);
// Similar complexity to `set_invulnerables` (put storage value)
- // Plus 1 read for length, 1 read for `onchain_version`, 1 write to put version
+ // Plus 1 read for length, 1 read for `on_chain_version`, 1 write to put version
T::WeightInfo::set_invulnerables(invulnerables_len as u32)
.saturating_add(T::DbWeight::get().reads_writes(2, 1))
} else {
@@ -83,8 +83,8 @@ pub mod v1 {
"after migration, there should be the same number of invulnerables"
);
- let onchain_version = Pallet::::on_chain_storage_version();
- frame_support::ensure!(onchain_version >= 1, "must_upgrade");
+ let on_chain_version = Pallet::::on_chain_storage_version();
+ frame_support::ensure!(on_chain_version >= 1, "must_upgrade");
Ok(())
}
diff --git a/cumulus/pallets/parachain-system/src/lib.rs b/cumulus/pallets/parachain-system/src/lib.rs
index d86a67e58f44713dfe7b1c9f5c0952c16d590986..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`.
@@ -840,6 +841,7 @@ pub mod pallet {
///
/// This data is also absent from the genesis.
#[pallet::storage]
+ #[pallet::disable_try_decode_storage]
#[pallet::getter(fn host_configuration)]
pub(super) type HostConfiguration = StorageValue<_, AbridgedHostConfiguration>;
diff --git a/cumulus/pallets/parachain-system/src/migration.rs b/cumulus/pallets/parachain-system/src/migration.rs
index a92f85b9cd420e9e1027d1f82c643d90fea8b97c..30106aceab5a442c34360563fdfb096fdc6ac9b1 100644
--- a/cumulus/pallets/parachain-system/src/migration.rs
+++ b/cumulus/pallets/parachain-system/src/migration.rs
@@ -21,7 +21,7 @@ use frame_support::{
weights::Weight,
};
-/// The current storage version.
+/// The in-code storage version.
pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(2);
/// Migrates the pallet storage to the most recent version.
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/migration.rs b/cumulus/pallets/xcmp-queue/src/migration.rs
index 6c86c3011d23807adfbde801ec6865b6731822df..c7fa61a3e3f0513e53d67fcee4efd6c3cecf29f6 100644
--- a/cumulus/pallets/xcmp-queue/src/migration.rs
+++ b/cumulus/pallets/xcmp-queue/src/migration.rs
@@ -24,7 +24,7 @@ use frame_support::{
weights::{constants::WEIGHT_REF_TIME_PER_MILLIS, Weight},
};
-/// The current storage version.
+/// The in-code storage version.
pub const STORAGE_VERSION: StorageVersion = StorageVersion::new(4);
pub const LOG: &str = "runtime::xcmp-queue-migration";
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/chain-specs/asset-hub-kusama.json b/cumulus/parachains/chain-specs/asset-hub-kusama.json
index fba74b17f9607f58bdb17d7a0b05c8b764a9c4e5..654275eade81e5379004e649e11eb7e4acb2ec1f 100644
--- a/cumulus/parachains/chain-specs/asset-hub-kusama.json
+++ b/cumulus/parachains/chain-specs/asset-hub-kusama.json
@@ -25,7 +25,9 @@
"/dns/statemine-bootnode.radiumblock.com/tcp/30336/wss/p2p/12D3KooWCKUrE5uaXQ288ko3Ex3zCyozyJLG47KEYTopinnXNtYL",
"/dns/mine14.rotko.net/tcp/33524/p2p/12D3KooWJUFnjR2PNbsJhudwPVaWCoZy1acPGKjM2cSuGj345BBu",
"/dns/mine14.rotko.net/tcp/34524/ws/p2p/12D3KooWJUFnjR2PNbsJhudwPVaWCoZy1acPGKjM2cSuGj345BBu",
- "/dns/mine14.rotko.net/tcp/35524/wss/p2p/12D3KooWJUFnjR2PNbsJhudwPVaWCoZy1acPGKjM2cSuGj345BBu"
+ "/dns/mine14.rotko.net/tcp/35524/wss/p2p/12D3KooWJUFnjR2PNbsJhudwPVaWCoZy1acPGKjM2cSuGj345BBu",
+ "/dns/asset-hub-kusama.bootnodes.polkadotters.com/tcp/30511/p2p/12D3KooWDpk7wVH7RgjErEvbvAZ2kY5VeaAwRJP5ojmn1e8b8UbU",
+ "/dns/asset-hub-kusama.bootnodes.polkadotters.com/tcp/30513/wss/p2p/12D3KooWDpk7wVH7RgjErEvbvAZ2kY5VeaAwRJP5ojmn1e8b8UbU"
],
"telemetryEndpoints": null,
"protocolId": null,
diff --git a/cumulus/parachains/chain-specs/asset-hub-polkadot.json b/cumulus/parachains/chain-specs/asset-hub-polkadot.json
index 685a00ddc7145ed650f7cb5496fe81cfb23f0ffb..454060d2a87afb84407323263eea97d2f12d5a68 100644
--- a/cumulus/parachains/chain-specs/asset-hub-polkadot.json
+++ b/cumulus/parachains/chain-specs/asset-hub-polkadot.json
@@ -25,7 +25,9 @@
"/dns/statemint-bootnode.radiumblock.com/tcp/30333/p2p/12D3KooWLKxHom7f3XawRJqrF8RwiKK5Sj3qZqz5c7hF6eJeXhTx",
"/dns/mint14.rotko.net/tcp/33514/p2p/12D3KooWKkzLjYF6M5eEs7nYiqEtRqY8SGVouoCwo3nCWsRnThDW",
"/dns/mint14.rotko.net/tcp/34514/ws/p2p/12D3KooWKkzLjYF6M5eEs7nYiqEtRqY8SGVouoCwo3nCWsRnThDW",
- "/dns/mint14.rotko.net/tcp/35514/wss/p2p/12D3KooWKkzLjYF6M5eEs7nYiqEtRqY8SGVouoCwo3nCWsRnThDW"
+ "/dns/mint14.rotko.net/tcp/35514/wss/p2p/12D3KooWKkzLjYF6M5eEs7nYiqEtRqY8SGVouoCwo3nCWsRnThDW",
+ "/dns/asset-hub-polkadot.bootnodes.polkadotters.com/tcp/30508/p2p/12D3KooWKbfY9a9oywxMJKiALmt7yhrdQkjXMtvxhhDDN23vG93R",
+ "/dns/asset-hub-polkadot.bootnodes.polkadotters.com/tcp/30510/wss/p2p/12D3KooWKbfY9a9oywxMJKiALmt7yhrdQkjXMtvxhhDDN23vG93R"
],
"telemetryEndpoints": null,
"protocolId": null,
diff --git a/cumulus/parachains/chain-specs/asset-hub-westend.json b/cumulus/parachains/chain-specs/asset-hub-westend.json
index 6f42b5f7d8bb4a76c7390b538a68b1bb0acc1613..670935c9d2474242307d691d8707030c70f49982 100644
--- a/cumulus/parachains/chain-specs/asset-hub-westend.json
+++ b/cumulus/parachains/chain-specs/asset-hub-westend.json
@@ -23,7 +23,9 @@
"/dns/westmint-bootnode.radiumblock.com/tcp/30333/p2p/12D3KooWDoq4PVdWm5nzRSvEz3DSSKjVgRhWVUaKyi5JMKwJKYbk",
"/dns/wmint14.rotko.net/tcp/33534/p2p/12D3KooWE4UDXqgtTcMCyUQ8S4uvaT8VMzzTBA6NWmKuYwTacWuN",
"/dns/wmint14.rotko.net/tcp/34534/ws/p2p/12D3KooWE4UDXqgtTcMCyUQ8S4uvaT8VMzzTBA6NWmKuYwTacWuN",
- "/dns/wmint14.rotko.net/tcp/35534/wss/p2p/12D3KooWE4UDXqgtTcMCyUQ8S4uvaT8VMzzTBA6NWmKuYwTacWuN"
+ "/dns/wmint14.rotko.net/tcp/35534/wss/p2p/12D3KooWE4UDXqgtTcMCyUQ8S4uvaT8VMzzTBA6NWmKuYwTacWuN",
+ "/dns/asset-hub-westend.bootnodes.polkadotters.com/tcp/30514/p2p/12D3KooWNFYysCqmojxqjjaTfD2VkWBNngfyUKWjcR4WFixfHNTk",
+ "/dns/asset-hub-westend.bootnodes.polkadotters.com/tcp/30516/wss/p2p/12D3KooWNFYysCqmojxqjjaTfD2VkWBNngfyUKWjcR4WFixfHNTk"
],
"telemetryEndpoints": null,
"protocolId": null,
diff --git a/cumulus/parachains/chain-specs/bridge-hub-kusama.json b/cumulus/parachains/chain-specs/bridge-hub-kusama.json
index 0ef81806cc5c08621f3c0a308425c72f836c3ef4..90b70b05016d52aeecaea4870f438bf980f7263b 100644
--- a/cumulus/parachains/chain-specs/bridge-hub-kusama.json
+++ b/cumulus/parachains/chain-specs/bridge-hub-kusama.json
@@ -25,7 +25,9 @@
"/dns/bridgehub-kusama-bootnode.radiumblock.com/tcp/30336/wss/p2p/12D3KooWQMWofXj8v3RroDNnrhv1iURqm8vnaG98AdGnCn2YoDcW",
"/dns/kbr13.rotko.net/tcp/33553/p2p/12D3KooWAmBp54mUEYtvsk2kxNEsDbAvdUMcaghxKXgUQxmPEQ66",
"/dns/kbr13.rotko.net/tcp/34553/ws/p2p/12D3KooWAmBp54mUEYtvsk2kxNEsDbAvdUMcaghxKXgUQxmPEQ66",
- "/dns/kbr13.rotko.net/tcp/35553/wss/p2p/12D3KooWAmBp54mUEYtvsk2kxNEsDbAvdUMcaghxKXgUQxmPEQ66"
+ "/dns/kbr13.rotko.net/tcp/35553/wss/p2p/12D3KooWAmBp54mUEYtvsk2kxNEsDbAvdUMcaghxKXgUQxmPEQ66",
+ "/dns/bridge-hub-kusama.bootnodes.polkadotters.com/tcp/30520/p2p/12D3KooWH3pucezRRS5esoYyzZsUkKWcPSByQxEvmM819QL1HPLV",
+ "/dns/bridge-hub-kusama.bootnodes.polkadotters.com/tcp/30522/wss/p2p/12D3KooWH3pucezRRS5esoYyzZsUkKWcPSByQxEvmM819QL1HPLV"
],
"telemetryEndpoints": null,
"protocolId": null,
diff --git a/cumulus/parachains/chain-specs/bridge-hub-polkadot.json b/cumulus/parachains/chain-specs/bridge-hub-polkadot.json
index 130bdf31ef211ba6d353fa97944b2bf80320997d..a9444b89e1e2cce9c79a367c4c561e910f1f28f7 100644
--- a/cumulus/parachains/chain-specs/bridge-hub-polkadot.json
+++ b/cumulus/parachains/chain-specs/bridge-hub-polkadot.json
@@ -21,7 +21,9 @@
"/dns/bridgehub-polkadot-bootnode.radiumblock.com/tcp/30333/p2p/12D3KooWPNZm78tWUmKbta3SXdkqTPsquRc8ekEbJjZsGGi7YiRi",
"/dns/pbr13.rotko.net/tcp/33543/p2p/12D3KooWMxZY7tDc2Rh454VaJJ7RexKAXVS6xSBEvTnXSGCnuGDw",
"/dns/pbr13.rotko.net/tcp/34543/ws/p2p/12D3KooWMxZY7tDc2Rh454VaJJ7RexKAXVS6xSBEvTnXSGCnuGDw",
- "/dns/pbr13.rotko.net/tcp/35543/wss/p2p/12D3KooWMxZY7tDc2Rh454VaJJ7RexKAXVS6xSBEvTnXSGCnuGDw"
+ "/dns/pbr13.rotko.net/tcp/35543/wss/p2p/12D3KooWMxZY7tDc2Rh454VaJJ7RexKAXVS6xSBEvTnXSGCnuGDw",
+ "/dns/bridge-hub-polkadot.bootnodes.polkadotters.com/tcp/30517/p2p/12D3KooWLUNE3LHPDa1WrrZaYT7ArK66CLM1bPv7kKz74UcLnQRB",
+ "/dns/bridge-hub-polkadot.bootnodes.polkadotters.com/tcp/30519/wss/p2p/12D3KooWLUNE3LHPDa1WrrZaYT7ArK66CLM1bPv7kKz74UcLnQRB"
],
"telemetryEndpoints": null,
"protocolId": null,
diff --git a/cumulus/parachains/chain-specs/bridge-hub-westend.json b/cumulus/parachains/chain-specs/bridge-hub-westend.json
index 018ab0ee6fd9810595c841237dd253b9463aed79..447207a58107a95bcd5fca173d9d5476a0ce9cab 100644
--- a/cumulus/parachains/chain-specs/bridge-hub-westend.json
+++ b/cumulus/parachains/chain-specs/bridge-hub-westend.json
@@ -19,7 +19,9 @@
"/dns/bridgehub-westend-bootnode.radiumblock.com/tcp/30336/wss/p2p/12D3KooWBsBArCMxmQyo3feCEqMWuwyhb2LTRK8hmCCJxgrNeMke",
"/dns/wbr13.rotko.net/tcp/33563/p2p/12D3KooWJyeRHpxZZbfBCNEgeUFzmRC5AMSAs2tJhjJS1k5hULkD",
"/dns/wbr13.rotko.net/tcp/34563/ws/p2p/12D3KooWJyeRHpxZZbfBCNEgeUFzmRC5AMSAs2tJhjJS1k5hULkD",
- "/dns/wbr13.rotko.net/tcp/35563/wss/p2p/12D3KooWJyeRHpxZZbfBCNEgeUFzmRC5AMSAs2tJhjJS1k5hULkD"
+ "/dns/wbr13.rotko.net/tcp/35563/wss/p2p/12D3KooWJyeRHpxZZbfBCNEgeUFzmRC5AMSAs2tJhjJS1k5hULkD",
+ "/dns/bridge-hub-westend.bootnodes.polkadotters.com/tcp/30523/p2p/12D3KooWPkwgJofp4GeeRwNgXqkp2aFwdLkCWv3qodpBJLwK43Jj",
+ "/dns/bridge-hub-westend.bootnodes.polkadotters.com/tcp/30525/wss/p2p/12D3KooWPkwgJofp4GeeRwNgXqkp2aFwdLkCWv3qodpBJLwK43Jj"
],
"telemetryEndpoints": null,
"protocolId": null,
diff --git a/cumulus/parachains/chain-specs/collectives-polkadot.json b/cumulus/parachains/chain-specs/collectives-polkadot.json
index e9f690234e4381f54377c7fe7174f25834a973a5..259669cf37a0643534eaa5d1776daf79ec402d75 100644
--- a/cumulus/parachains/chain-specs/collectives-polkadot.json
+++ b/cumulus/parachains/chain-specs/collectives-polkadot.json
@@ -25,7 +25,9 @@
"/dns/collectives-polkadot-bootnode.radiumblock.com/tcp/30336/wss/p2p/12D3KooWDumvnNwPbBg5inBEapgjKU7ECdMHHgwfYeGWUkzYUE1c",
"/dns/pch13.rotko.net/tcp/33573/p2p/12D3KooWRXudHoazPZ9osMfdY38e8CBxQLD4RhrVeHpRSNNpcDtH",
"/dns/pch13.rotko.net/tcp/34573/ws/p2p/12D3KooWRXudHoazPZ9osMfdY38e8CBxQLD4RhrVeHpRSNNpcDtH",
- "/dns/pch13.rotko.net/tcp/35573/wss/p2p/12D3KooWRXudHoazPZ9osMfdY38e8CBxQLD4RhrVeHpRSNNpcDtH"
+ "/dns/pch13.rotko.net/tcp/35573/wss/p2p/12D3KooWRXudHoazPZ9osMfdY38e8CBxQLD4RhrVeHpRSNNpcDtH",
+ "/dns/collectives-polkadot.bootnodes.polkadotters.com/tcp/30526/p2p/12D3KooWNohUjvJtGKUa8Vhy8C1ZBB5N8JATB6e7rdLVCioeb3ff",
+ "/dns/collectives-polkadot.bootnodes.polkadotters.com/tcp/30528/wss/p2p/12D3KooWNohUjvJtGKUa8Vhy8C1ZBB5N8JATB6e7rdLVCioeb3ff"
],
"telemetryEndpoints": null,
"protocolId": null,
diff --git a/cumulus/parachains/chain-specs/collectives-westend.json b/cumulus/parachains/chain-specs/collectives-westend.json
index ffe73b5a05a391cc1c5396c235460830c023297a..e459c631f8be9df7c5c52993c116f11ef619fefe 100644
--- a/cumulus/parachains/chain-specs/collectives-westend.json
+++ b/cumulus/parachains/chain-specs/collectives-westend.json
@@ -25,7 +25,9 @@
"/dns/westend-collectives-boot-ng.dwellir.com/tcp/443/wss/p2p/12D3KooWPFM93jgm4pgxx8PM8WJKAJF49qia8jRB95uciUQwYh7m",
"/dns/wch13.rotko.net/tcp/33593/p2p/12D3KooWPG85zhuSRoyptjLkFD4iJFistjiBmc15JgQ96B4fdXYr",
"/dns/wch13.rotko.net/tcp/34593/ws/p2p/12D3KooWPG85zhuSRoyptjLkFD4iJFistjiBmc15JgQ96B4fdXYr",
- "/dns/wch13.rotko.net/tcp/35593/wss/p2p/12D3KooWPG85zhuSRoyptjLkFD4iJFistjiBmc15JgQ96B4fdXYr"
+ "/dns/wch13.rotko.net/tcp/35593/wss/p2p/12D3KooWPG85zhuSRoyptjLkFD4iJFistjiBmc15JgQ96B4fdXYr",
+ "/dns/collectives-westend.bootnodes.polkadotters.com/tcp/30529/p2p/12D3KooWAFkXNSBfyPduZVgfS7pj5NuVpbU8Ee5gHeF8wvos7Yqn",
+ "/dns/collectives-westend.bootnodes.polkadotters.com/tcp/30531/wss/p2p/12D3KooWAFkXNSBfyPduZVgfS7pj5NuVpbU8Ee5gHeF8wvos7Yqn"
],
"telemetryEndpoints": null,
"protocolId": null,
diff --git a/cumulus/parachains/chain-specs/people-westend.json b/cumulus/parachains/chain-specs/people-westend.json
index fa29853c70b05e47df50445935be42a4637f240d..29fa0c9cde79c0daecbce029c8fa377ba1ff6918 100644
--- a/cumulus/parachains/chain-specs/people-westend.json
+++ b/cumulus/parachains/chain-specs/people-westend.json
@@ -10,7 +10,9 @@
"/dns/westend-people-collator-node-2.parity-testnet.parity.io/tcp/30333/p2p/12D3KooWGVYTVKW7tYe51JvetvGvVLDPXzqQX1mueJgz14FgkmHG",
"/dns/westend-people-collator-node-2.parity-testnet.parity.io/tcp/443/wss/p2p/12D3KooWGVYTVKW7tYe51JvetvGvVLDPXzqQX1mueJgz14FgkmHG",
"/dns/westend-people-collator-node-3.parity-testnet.parity.io/tcp/30333/p2p/12D3KooWCF1eA2Gap69zgXD7Df3e9DqDUsGoByocggTGejoHjK23",
- "/dns/westend-people-collator-node-3.parity-testnet.parity.io/tcp/443/wss/p2p/12D3KooWCF1eA2Gap69zgXD7Df3e9DqDUsGoByocggTGejoHjK23"
+ "/dns/westend-people-collator-node-3.parity-testnet.parity.io/tcp/443/wss/p2p/12D3KooWCF1eA2Gap69zgXD7Df3e9DqDUsGoByocggTGejoHjK23",
+ "/dns/identity-westend.bootnodes.polkadotters.com/tcp/30532/p2p/12D3KooWKr9San6KTM7REJ95cBaDoiciGcWnW8TTftEJgxGF5Ehb",
+ "/dns/identity-westend.bootnodes.polkadotters.com/tcp/30534/wss/p2p/12D3KooWKr9San6KTM7REJ95cBaDoiciGcWnW8TTftEJgxGF5Ehb"
],
"telemetryEndpoints": null,
"protocolId": null,
@@ -79,4 +81,4 @@
"childrenDefault": {}
}
}
-}
\ No newline at end of file
+}
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/pallets/collective-content/src/lib.rs b/cumulus/parachains/pallets/collective-content/src/lib.rs
index 7a685858accb67868837e734ba9808741a4f7ea1..b1c960ad6a0d337d6b84aaaba59f7fa0625a8124 100644
--- a/cumulus/parachains/pallets/collective-content/src/lib.rs
+++ b/cumulus/parachains/pallets/collective-content/src/lib.rs
@@ -59,7 +59,7 @@ pub mod pallet {
use frame_system::pallet_prelude::*;
use sp_runtime::{traits::BadOrigin, Saturating};
- /// The current storage version.
+ /// The in-code storage version.
const STORAGE_VERSION: StorageVersion = StorageVersion::new(0);
#[pallet::pallet]
diff --git a/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml b/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml
index 7381b5de1c896e50d98ef466f2de1b8aa6725bf8..9cd493f41734a0e109426829af200126542b8d19 100644
--- a/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml
+++ b/cumulus/parachains/runtimes/assets/asset-hub-rococo/Cargo.toml
@@ -121,6 +121,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/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
@@ -132,6 +133,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 85dffe832a9ea49e73d6b9e1da29f227cfb7103a..aeb617dee7f81130f5844acbaf6fa24cd3490401 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! {
@@ -782,6 +784,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! {
@@ -973,8 +978,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,
@@ -986,8 +991,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.
#[allow(deprecated)]
pub type Migrations = (
@@ -1013,37 +1017,37 @@ impl frame_support::traits::OnRuntimeUpgrade for InitStorageVersions {
let mut writes = 0;
if PolkadotXcm::on_chain_storage_version() == StorageVersion::new(0) {
- PolkadotXcm::current_storage_version().put::();
+ PolkadotXcm::in_code_storage_version().put::();
writes.saturating_inc();
}
if Multisig::on_chain_storage_version() == StorageVersion::new(0) {
- Multisig::current_storage_version().put::