where
- Suffix: TransactionExtensionSchema,
+ Suffix: SignedExtensionSchema,
{
fn from_params(
spec_version: u32,
@@ -326,9 +321,9 @@ where
genesis_hash: Hash,
nonce: Nonce,
tip: Balance,
- extra: (Suffix::Payload, Suffix::Implicit),
+ extra: (Suffix::Payload, Suffix::AdditionalSigned),
) -> Self {
- GenericTransactionExtension::new(
+ GenericSignedExtension::new(
(
(
(), // non-zero sender
@@ -370,7 +365,7 @@ where
}
/// Signed extension that is used by most chains.
-pub type CommonTransactionExtension = SuffixedCommonTransactionExtension<()>;
+pub type CommonSignedExtension = SuffixedCommonSignedExtension<()>;
#[cfg(test)]
mod tests {
diff --git a/bridges/primitives/runtime/src/extensions.rs b/bridges/primitives/runtime/src/extensions.rs
index a31e7b5bb47a64ec2333bbaba3e9c520aa53ef5a..d896bc92efffc4e8fcb427ffa7057dece6f17241 100644
--- a/bridges/primitives/runtime/src/extensions.rs
+++ b/bridges/primitives/runtime/src/extensions.rs
@@ -20,138 +20,135 @@ use codec::{Compact, Decode, Encode};
use impl_trait_for_tuples::impl_for_tuples;
use scale_info::{StaticTypeInfo, TypeInfo};
use sp_runtime::{
- impl_tx_ext_default,
- traits::{Dispatchable, TransactionExtension, TransactionExtensionBase},
+ traits::{DispatchInfoOf, SignedExtension},
transaction_validity::TransactionValidityError,
};
use sp_std::{fmt::Debug, marker::PhantomData};
-/// 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
-{
+/// 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 {
/// 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 Implicit: Encode + Decode + Debug + Eq + Clone + StaticTypeInfo;
+ type AdditionalSigned: Encode + Debug + Eq + Clone + StaticTypeInfo;
}
-impl TransactionExtensionSchema for () {
+impl SignedExtensionSchema for () {
type Payload = ();
- type Implicit = ();
+ type AdditionalSigned = ();
}
-/// An implementation of `TransactionExtensionSchema` using generic params.
+/// An implementation of `SignedExtensionSchema` using generic params.
#[derive(Encode, Decode, Clone, Debug, PartialEq, Eq, TypeInfo)]
-pub struct GenericTransactionExtensionSchema(PhantomData<(P, S)>);
+pub struct GenericSignedExtensionSchema
(PhantomData<(P, S)>);
-impl
TransactionExtensionSchema for GenericTransactionExtensionSchema
+impl
SignedExtensionSchema for GenericSignedExtensionSchema
where
P: Encode + Decode + Debug + Eq + Clone + StaticTypeInfo,
- S: Encode + Decode + Debug + Eq + Clone + StaticTypeInfo,
+ S: Encode + Debug + Eq + Clone + StaticTypeInfo,
{
type Payload = P;
- type Implicit = S;
+ type AdditionalSigned = S;
}
-/// The `TransactionExtensionSchema` for `frame_system::CheckNonZeroSender`.
-pub type CheckNonZeroSender = GenericTransactionExtensionSchema<(), ()>;
+/// The `SignedExtensionSchema` for `frame_system::CheckNonZeroSender`.
+pub type CheckNonZeroSender = GenericSignedExtensionSchema<(), ()>;
-/// The `TransactionExtensionSchema` for `frame_system::CheckSpecVersion`.
-pub type CheckSpecVersion = GenericTransactionExtensionSchema<(), u32>;
+/// The `SignedExtensionSchema` for `frame_system::CheckSpecVersion`.
+pub type CheckSpecVersion = GenericSignedExtensionSchema<(), u32>;
-/// The `TransactionExtensionSchema` for `frame_system::CheckTxVersion`.
-pub type CheckTxVersion = GenericTransactionExtensionSchema<(), u32>;
+/// The `SignedExtensionSchema` for `frame_system::CheckTxVersion`.
+pub type CheckTxVersion = GenericSignedExtensionSchema<(), u32>;
-/// The `TransactionExtensionSchema` for `frame_system::CheckGenesis`.
-pub type CheckGenesis = GenericTransactionExtensionSchema<(), Hash>;
+/// The `SignedExtensionSchema` for `frame_system::CheckGenesis`.
+pub type CheckGenesis = GenericSignedExtensionSchema<(), Hash>;
-/// The `TransactionExtensionSchema` for `frame_system::CheckEra`.
-pub type CheckEra = GenericTransactionExtensionSchema;
+/// The `SignedExtensionSchema` for `frame_system::CheckEra`.
+pub type CheckEra = GenericSignedExtensionSchema;
-/// The `TransactionExtensionSchema` for `frame_system::CheckNonce`.
-pub type CheckNonce = GenericTransactionExtensionSchema, ()>;
+/// The `SignedExtensionSchema` for `frame_system::CheckNonce`.
+pub type CheckNonce = GenericSignedExtensionSchema, ()>;
-/// The `TransactionExtensionSchema` for `frame_system::CheckWeight`.
-pub type CheckWeight = GenericTransactionExtensionSchema<(), ()>;
+/// The `SignedExtensionSchema` for `frame_system::CheckWeight`.
+pub type CheckWeight = GenericSignedExtensionSchema<(), ()>;
-/// The `TransactionExtensionSchema` for `pallet_transaction_payment::ChargeTransactionPayment`.
-pub type ChargeTransactionPayment =
- GenericTransactionExtensionSchema, ()>;
+/// The `SignedExtensionSchema` for `pallet_transaction_payment::ChargeTransactionPayment`.
+pub type ChargeTransactionPayment = GenericSignedExtensionSchema, ()>;
-/// The `TransactionExtensionSchema` for `polkadot-runtime-common::PrevalidateAttests`.
-pub type PrevalidateAttests = GenericTransactionExtensionSchema<(), ()>;
+/// The `SignedExtensionSchema` for `polkadot-runtime-common::PrevalidateAttests`.
+pub type PrevalidateAttests = GenericSignedExtensionSchema<(), ()>;
-/// The `TransactionExtensionSchema` for `BridgeRejectObsoleteHeadersAndMessages`.
-pub type BridgeRejectObsoleteHeadersAndMessages = GenericTransactionExtensionSchema<(), ()>;
+/// The `SignedExtensionSchema` for `BridgeRejectObsoleteHeadersAndMessages`.
+pub type BridgeRejectObsoleteHeadersAndMessages = GenericSignedExtensionSchema<(), ()>;
-/// The `TransactionExtensionSchema` for `RefundBridgedParachainMessages`.
+/// The `SignedExtensionSchema` 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 = GenericTransactionExtensionSchema<(), ()>;
+pub type RefundBridgedParachainMessagesSchema = GenericSignedExtensionSchema<(), ()>;
#[impl_for_tuples(1, 12)]
-impl TransactionExtensionSchema for Tuple {
+impl SignedExtensionSchema for Tuple {
for_tuples!( type Payload = ( #( Tuple::Payload ),* ); );
- for_tuples!( type Implicit = ( #( Tuple::Implicit ),* ); );
+ for_tuples!( type AdditionalSigned = ( #( Tuple::AdditionalSigned ),* ); );
}
/// 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 GenericTransactionExtension {
+pub struct GenericSignedExtension {
/// 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 `TransactionExtensions` is only
- // used to read fields of the `payload`. And when resigning transaction, we're reconstructing
- // `TransactionExtensions` from scratch.
- implicit: Option,
+ // (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,
}
-impl GenericTransactionExtension {
- /// Create new `GenericTransactionExtension` object.
- pub fn new(payload: S::Payload, implicit: Option) -> Self {
- Self { payload, implicit }
+impl GenericSignedExtension {
+ /// Create new `GenericSignedExtension` object.
+ pub fn new(payload: S::Payload, additional_signed: Option) -> Self {
+ Self { payload, additional_signed }
}
}
-impl TransactionExtensionBase for GenericTransactionExtension
+impl SignedExtension for GenericSignedExtension
where
- S: TransactionExtensionSchema,
+ S: SignedExtensionSchema,
S::Payload: Send + Sync,
- S::Implicit: Send + Sync,
+ S::AdditionalSigned: Send + Sync,
{
const IDENTIFIER: &'static str = "Not needed.";
- type Implicit = S::Implicit;
+ type AccountId = ();
+ type Call = ();
+ type AdditionalSigned = S::AdditionalSigned;
+ type Pre = ();
- fn implicit(&self) -> Result {
+ fn additional_signed(&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.implicit
- .clone()
- .ok_or(frame_support::unsigned::TransactionValidityError::Unknown(
+ self.additional_signed.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 = ();
- impl_tx_ext_default!(C; Context; validate prepare);
+ fn pre_dispatch(
+ self,
+ _who: &Self::AccountId,
+ _call: &Self::Call,
+ _info: &DispatchInfoOf,
+ _len: usize,
+ ) -> Result {
+ Ok(())
+ }
}
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/src/mock.rs b/bridges/snowbridge/pallets/ethereum-client/src/mock.rs
index 3ce34eee191ac48fa95789e03d88e54ff017a2d7..799b14f4773e421a37b75d226d7829ce8bb7dcf6 100644
--- a/bridges/snowbridge/pallets/ethereum-client/src/mock.rs
+++ b/bridges/snowbridge/pallets/ethereum-client/src/mock.rs
@@ -95,7 +95,7 @@ frame_support::construct_runtime!(
}
);
-#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
+#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Test {
type Block = Block;
}
diff --git a/bridges/snowbridge/pallets/inbound-queue/src/mock.rs b/bridges/snowbridge/pallets/inbound-queue/src/mock.rs
index 749fb0367f332d743b01ad9d56238106ced36e72..086b27cb8280a5357b56e50065124c0d20f0e5a7 100644
--- a/bridges/snowbridge/pallets/inbound-queue/src/mock.rs
+++ b/bridges/snowbridge/pallets/inbound-queue/src/mock.rs
@@ -47,7 +47,7 @@ parameter_types! {
type Balance = u128;
-#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
+#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = Everything;
type RuntimeOrigin = RuntimeOrigin;
diff --git a/bridges/snowbridge/pallets/outbound-queue/src/mock.rs b/bridges/snowbridge/pallets/outbound-queue/src/mock.rs
index 6e78fb4467210e3cb5e1eb581b377cbbfeac74ad..850b13dcf310e0b5660f5d80685787761380bd2f 100644
--- a/bridges/snowbridge/pallets/outbound-queue/src/mock.rs
+++ b/bridges/snowbridge/pallets/outbound-queue/src/mock.rs
@@ -37,7 +37,7 @@ parameter_types! {
pub const BlockHashCount: u64 = 250;
}
-#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
+#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = Everything;
type RuntimeOrigin = RuntimeOrigin;
diff --git a/bridges/snowbridge/pallets/system/src/mock.rs b/bridges/snowbridge/pallets/system/src/mock.rs
index de2970dd550ba75fe42de08dc4d297cd5cccdf1f..a711eab5d3d4ea5068af634fedbbc173f8186395 100644
--- a/bridges/snowbridge/pallets/system/src/mock.rs
+++ b/bridges/snowbridge/pallets/system/src/mock.rs
@@ -95,7 +95,7 @@ frame_support::construct_runtime!(
}
);
-#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
+#[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
diff --git a/bridges/snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs b/bridges/snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs
index 77b5c1aa631db89a986837f258ee7dea45a580d0..d2cca373e92bd1a70f2ee68a7913214967b2dec0 100644
--- a/bridges/snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs
+++ b/bridges/snowbridge/parachain/pallets/ethereum-beacon-client/src/mock.rs
@@ -34,7 +34,7 @@ pub mod minimal {
pub const SS58Prefix: u8 = 42;
}
- #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
+ #[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
@@ -195,7 +195,7 @@ pub mod mainnet {
pub const SS58Prefix: u8 = 42;
}
- #[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)]
+ #[derive_impl(frame_system::config_preludes::TestDefaultConfig)]
impl frame_system::Config for Test {
type BaseCallFilter = frame_support::traits::Everything;
type RuntimeOrigin = RuntimeOrigin;
diff --git a/bridges/snowbridge/runtime/test-common/Cargo.toml b/bridges/snowbridge/runtime/test-common/Cargo.toml
index 5f169e82f49346742bd97028da583105bf02335d..4e8b311cb97812bb94140aa02405b3a174064a8f 100644
--- a/bridges/snowbridge/runtime/test-common/Cargo.toml
+++ b/bridges/snowbridge/runtime/test-common/Cargo.toml
@@ -181,7 +181,6 @@ 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/testing/environments/rococo-westend/bridges_rococo_westend.sh b/bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh
index 479ab833abfc38dd978c7b7d3abdd4c1fe37ad64..66c9ddc037b8efb005d2239b174eb5710dddaf53 100755
--- a/bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh
+++ b/bridges/testing/environments/rococo-westend/bridges_rococo_westend.sh
@@ -24,12 +24,6 @@ source "$FRAMEWORK_PATH/utils/bridges.sh"
# &MultiLocation { parents: 2, interior: X1(GlobalConsensus(Rococo)) }).unwrap()
# ).to_ss58check_with_version(42_u16.into())
# );
-# println!("GLOBAL_CONSENSUS_ROCOCO_ASSET_HUB_ROCOCO_1000_SOVEREIGN_ACCOUNT=\"{}\"",
-# frame_support::sp_runtime::AccountId32::new(
-# GlobalConsensusParachainConvertsFor::::convert_location(
-# &MultiLocation { parents: 2, interior: X2(GlobalConsensus(Rococo), Parachain(1000)) }).unwrap()
-# ).to_ss58check_with_version(42_u16.into())
-# );
# println!("ASSET_HUB_WESTEND_SOVEREIGN_ACCOUNT_AT_BRIDGE_HUB_WESTEND=\"{}\"",
# frame_support::sp_runtime::AccountId32::new(
# SiblingParachainConvertsVia::::convert_location(
@@ -44,12 +38,6 @@ source "$FRAMEWORK_PATH/utils/bridges.sh"
# &MultiLocation { parents: 2, interior: X1(GlobalConsensus(Westend)) }).unwrap()
# ).to_ss58check_with_version(42_u16.into())
# );
-# println!("GLOBAL_CONSENSUS_WESTEND_ASSET_HUB_WESTEND_1000_SOVEREIGN_ACCOUNT=\"{}\"",
-# frame_support::sp_runtime::AccountId32::new(
-# GlobalConsensusParachainConvertsFor::::convert_location(
-# &MultiLocation { parents: 2, interior: X2(GlobalConsensus(Westend), Parachain(1000)) }).unwrap()
-# ).to_ss58check_with_version(42_u16.into())
-# );
# println!("ASSET_HUB_ROCOCO_SOVEREIGN_ACCOUNT_AT_BRIDGE_HUB_ROCOCO=\"{}\"",
# frame_support::sp_runtime::AccountId32::new(
# SiblingParachainConvertsVia::::convert_location(
@@ -58,10 +46,8 @@ source "$FRAMEWORK_PATH/utils/bridges.sh"
# );
# }
GLOBAL_CONSENSUS_ROCOCO_SOVEREIGN_ACCOUNT="5GxRGwT8bU1JeBPTUXc7LEjZMxNrK8MyL2NJnkWFQJTQ4sii"
-GLOBAL_CONSENSUS_ROCOCO_ASSET_HUB_ROCOCO_1000_SOVEREIGN_ACCOUNT="5CfNu7eH3SJvqqPt3aJh38T8dcFvhGzEohp9tsd41ANhXDnQ"
ASSET_HUB_WESTEND_SOVEREIGN_ACCOUNT_AT_BRIDGE_HUB_WESTEND="5Eg2fntNprdN3FgH4sfEaaZhYtddZQSQUqvYJ1f2mLtinVhV"
GLOBAL_CONSENSUS_WESTEND_SOVEREIGN_ACCOUNT="5He2Qdztyxxa4GoagY6q1jaiLMmKy1gXS7PdZkhfj8ZG9hk5"
-GLOBAL_CONSENSUS_WESTEND_ASSET_HUB_WESTEND_1000_SOVEREIGN_ACCOUNT="5GUD9X494SnhfBTNReHwhV1599McpyVrAqFY6WnTfVQVYNUM"
ASSET_HUB_ROCOCO_SOVEREIGN_ACCOUNT_AT_BRIDGE_HUB_ROCOCO="5Eg2fntNprdN3FgH4sfEaaZhYtddZQSQUqvYJ1f2mLtinVhV"
# Expected sovereign accounts for rewards on BridgeHubs.
@@ -201,12 +187,6 @@ case "$1" in
"$GLOBAL_CONSENSUS_WESTEND_SOVEREIGN_ACCOUNT" \
10000000000 \
true
- # drip SA which holds reserves
- transfer_balance \
- "ws://127.0.0.1:9910" \
- "//Alice" \
- "$GLOBAL_CONSENSUS_WESTEND_ASSET_HUB_WESTEND_1000_SOVEREIGN_ACCOUNT" \
- $((1000000000000 + 50000000000 * 20))
# HRMP
open_hrmp_channels \
"ws://127.0.0.1:9942" \
@@ -266,12 +246,6 @@ case "$1" in
"$GLOBAL_CONSENSUS_ROCOCO_SOVEREIGN_ACCOUNT" \
10000000000 \
true
- # drip SA which holds reserves
- transfer_balance \
- "ws://127.0.0.1:9010" \
- "//Alice" \
- "$GLOBAL_CONSENSUS_ROCOCO_ASSET_HUB_ROCOCO_1000_SOVEREIGN_ACCOUNT" \
- $((1000000000000000 + 50000000000 * 20))
# HRMP
open_hrmp_channels \
"ws://127.0.0.1:9945" \
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 a58520ccea65b50dd0db1f67a72f6f8a4c5cdb38..cdb7d28e940cf1ac90562e761cdbad00e95e1748 100644
--- a/bridges/testing/tests/0001-asset-transfer/roc-reaches-westend.zndsl
+++ b/bridges/testing/tests/0001-asset-transfer/roc-reaches-westend.zndsl
@@ -6,7 +6,7 @@ Creds: config
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 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
+asset-hub-westend-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/wrapped-assets-balance.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,4800000000000,Rococo" within 600 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 fedb78cc2103555a1d15c446dd2f08fca94643e1..dbc03864e2b6e5e10636532ad965860b381fa8f2 100644
--- a/bridges/testing/tests/0001-asset-transfer/wnd-reaches-rococo.zndsl
+++ b/bridges/testing/tests/0001-asset-transfer/wnd-reaches-rococo.zndsl
@@ -6,7 +6,7 @@ Creds: config
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 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
+asset-hub-rococo-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/wrapped-assets-balance.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,4800000000000,Westend" within 600 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 68b888b6858e86b8fe846b887bc101e221b2f21d..9967732cabe15e020060eb0a53fd8ce1440180e5 100644
--- a/bridges/testing/tests/0001-asset-transfer/wroc-reaches-rococo.zndsl
+++ b/bridges/testing/tests/0001-asset-transfer/wroc-reaches-rococo.zndsl
@@ -7,4 +7,4 @@ asset-hub-rococo-collator1: run {{ENV_PATH}}/helper.sh with "withdraw-reserve-as
# 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,2800000000000" within 300 seconds
+asset-hub-rococo-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/native-assets-balance-increased.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,2800000000000" within 600 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 1a8a161819542e281094aed0681d52167aaea8e6..2037b0baf3c0aac2a0e1a8f297c6baa155ac680f 100644
--- a/bridges/testing/tests/0001-asset-transfer/wwnd-reaches-westend.zndsl
+++ b/bridges/testing/tests/0001-asset-transfer/wwnd-reaches-westend.zndsl
@@ -7,4 +7,4 @@ asset-hub-westend-collator1: run {{ENV_PATH}}/helper.sh with "withdraw-reserve-a
# 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,2800000000000" within 300 seconds
+asset-hub-westend-collator1: js-script {{FRAMEWORK_PATH}}/js-helpers/native-assets-balance-increased.js with "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY,2800000000000" within 600 seconds
diff --git a/cumulus/client/cli/Cargo.toml b/cumulus/client/cli/Cargo.toml
index eaf0d5d5d7f78e578644bf35f83d9543ad9af4bd..0b2edb593c405bef266fa7e389a996fe3a2fcec1 100644
--- a/cumulus/client/cli/Cargo.toml
+++ b/cumulus/client/cli/Cargo.toml
@@ -10,7 +10,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
workspace = true
[dependencies]
-clap = { version = "4.5.1", features = ["derive"] }
+clap = { version = "4.5.3", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0" }
url = "2.4.0"
diff --git a/cumulus/client/network/src/tests.rs b/cumulus/client/network/src/tests.rs
index d986635f961c914c9ec6fa970b20170f9f8b9cbc..3f5757d5eac13cd751a89e77545a937b3223c9a0 100644
--- a/cumulus/client/network/src/tests.rs
+++ b/cumulus/client/network/src/tests.rs
@@ -144,7 +144,7 @@ impl RelayChainInterface for DummyRelayChainInterface {
persisted_validation_data_hash: PHash::random(),
pov_hash: PHash::random(),
erasure_root: PHash::random(),
- signature: sp_core::sr25519::Signature([0u8; 64]).into(),
+ signature: sp_core::sr25519::Signature::default().into(),
validation_code_hash: ValidationCodeHash::from(PHash::random()),
},
commitments: CandidateCommitments {
@@ -325,7 +325,7 @@ async fn make_gossip_message_and_header(
persisted_validation_data_hash: PHash::random(),
pov_hash: PHash::random(),
erasure_root: PHash::random(),
- signature: sp_core::sr25519::Signature([0u8; 64]).into(),
+ signature: sp_core::sr25519::Signature::default().into(),
para_head: polkadot_parachain_primitives::primitives::HeadData(header.encode()).hash(),
validation_code_hash: ValidationCodeHash::from(PHash::random()),
},
@@ -516,7 +516,7 @@ async fn check_statement_seconded() {
persisted_validation_data_hash: PHash::random(),
pov_hash: PHash::random(),
erasure_root: PHash::random(),
- signature: sp_core::sr25519::Signature([0u8; 64]).into(),
+ signature: sp_core::sr25519::Signature::default().into(),
validation_code_hash: ValidationCodeHash::from(PHash::random()),
},
},
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/src/blockchain_rpc_client.rs b/cumulus/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs
index ab56b62c4ca59b3058e9724032e2e09264a45640..8d8a2920b4efaa70a9b59ba42ccd26a2e4cb64d5 100644
--- a/cumulus/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs
+++ b/cumulus/client/relay-chain-minimal-node/src/blockchain_rpc_client.rs
@@ -14,7 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see .
-use std::pin::Pin;
+use std::{
+ collections::{BTreeMap, VecDeque},
+ pin::Pin,
+};
use cumulus_relay_chain_interface::{RelayChainError, RelayChainResult};
use cumulus_relay_chain_rpc_interface::RelayChainRpcClient;
@@ -25,6 +28,7 @@ use polkadot_primitives::{
async_backing::{AsyncBackingParams, BackingState},
slashing,
vstaging::{ApprovalVotingParams, NodeFeatures},
+ CoreIndex,
};
use sc_authority_discovery::{AuthorityDiscovery, Error as AuthorityDiscoveryError};
use sc_client_api::AuxStore;
@@ -442,6 +446,13 @@ impl RuntimeApiSubsystemClient for BlockChainRpcClient {
async fn node_features(&self, at: Hash) -> Result {
Ok(self.rpc_client.parachain_host_node_features(at).await?)
}
+
+ async fn claim_queue(
+ &self,
+ at: Hash,
+ ) -> Result>, ApiError> {
+ Ok(self.rpc_client.parachain_host_claim_queue(at).await?)
+ }
}
#[async_trait::async_trait]
diff --git a/cumulus/client/relay-chain-rpc-interface/src/rpc_client.rs b/cumulus/client/relay-chain-rpc-interface/src/rpc_client.rs
index 6578210a259c956b1c817f579f66e84258a8ab3e..8cf5ccf0c707e5f8e3529462041f75a17ea6c117 100644
--- a/cumulus/client/relay-chain-rpc-interface/src/rpc_client.rs
+++ b/cumulus/client/relay-chain-rpc-interface/src/rpc_client.rs
@@ -24,6 +24,7 @@ use jsonrpsee::{
};
use serde::de::DeserializeOwned;
use serde_json::Value as JsonValue;
+use std::collections::VecDeque;
use tokio::sync::mpsc::Sender as TokioSender;
use parity_scale_codec::{Decode, Encode};
@@ -34,10 +35,10 @@ use cumulus_primitives_core::{
slashing,
vstaging::{ApprovalVotingParams, NodeFeatures},
BlockNumber, CandidateCommitments, CandidateEvent, CandidateHash,
- CommittedCandidateReceipt, CoreState, DisputeState, ExecutorParams, GroupRotationInfo,
- Hash as RelayHash, Header as RelayHeader, InboundHrmpMessage, OccupiedCoreAssumption,
- PvfCheckStatement, ScrapedOnChainVotes, SessionIndex, SessionInfo, ValidationCode,
- ValidationCodeHash, ValidatorId, ValidatorIndex, ValidatorSignature,
+ CommittedCandidateReceipt, CoreIndex, CoreState, DisputeState, ExecutorParams,
+ GroupRotationInfo, Hash as RelayHash, Header as RelayHeader, InboundHrmpMessage,
+ OccupiedCoreAssumption, PvfCheckStatement, ScrapedOnChainVotes, SessionIndex, SessionInfo,
+ ValidationCode, ValidationCodeHash, ValidatorId, ValidatorIndex, ValidatorSignature,
},
InboundDownwardMessage, ParaId, PersistedValidationData,
};
@@ -647,6 +648,14 @@ impl RelayChainRpcClient {
.await
}
+ pub async fn parachain_host_claim_queue(
+ &self,
+ at: RelayHash,
+ ) -> Result>, RelayChainError> {
+ self.call_remote_runtime_function("ParachainHost_claim_queue", at, None::<()>)
+ .await
+ }
+
pub async fn validation_code_hash(
&self,
at: RelayHash,
diff --git a/cumulus/pallets/aura-ext/src/consensus_hook.rs b/cumulus/pallets/aura-ext/src/consensus_hook.rs
index 089ab5c3198b98129e53e155dc4fcc009bf0e6d8..592029803391179785bb3b5606079d1bee6b553f 100644
--- a/cumulus/pallets/aura-ext/src/consensus_hook.rs
+++ b/cumulus/pallets/aura-ext/src/consensus_hook.rs
@@ -54,8 +54,8 @@ where
let velocity = V.max(1);
let relay_chain_slot = state_proof.read_slot().expect("failed to read relay chain slot");
- let (slot, authored) = pallet::Pallet::::slot_info()
- .expect("slot info is inserted on block initialization");
+ let (slot, authored) =
+ pallet::SlotInfo::::get().expect("slot info is inserted on block initialization");
// Convert relay chain timestamp.
let relay_chain_timestamp =
@@ -100,7 +100,7 @@ impl<
/// is more recent than the included block itself.
pub fn can_build_upon(included_hash: T::Hash, new_slot: Slot) -> bool {
let velocity = V.max(1);
- let (last_slot, authored_so_far) = match pallet::Pallet::::slot_info() {
+ let (last_slot, authored_so_far) = match pallet::SlotInfo::::get() {
None => return true,
Some(x) => x,
};
diff --git a/cumulus/pallets/aura-ext/src/lib.rs b/cumulus/pallets/aura-ext/src/lib.rs
index 31b571816a0c15837c6175ab233204565cc7eb36..7ca84dff7c513c2406d3c0de7b9c0ac26048f508 100644
--- a/cumulus/pallets/aura-ext/src/lib.rs
+++ b/cumulus/pallets/aura-ext/src/lib.rs
@@ -63,14 +63,14 @@ pub mod pallet {
impl Hooks> for Pallet {
fn on_finalize(_: BlockNumberFor) {
// Update to the latest AuRa authorities.
- Authorities::::put(Aura::::authorities());
+ Authorities::::put(pallet_aura::Authorities::::get());
}
fn on_initialize(_: BlockNumberFor) -> Weight {
// Fetch the authorities once to get them into the storage proof of the PoV.
Authorities::::get();
- let new_slot = Aura::::current_slot();
+ let new_slot = pallet_aura::CurrentSlot::::get();
let (new_slot, authored) = match SlotInfo::::get() {
Some((slot, authored)) if slot == new_slot => (slot, authored + 1),
@@ -103,7 +103,6 @@ pub mod pallet {
///
/// Updated on each block initialization.
#[pallet::storage]
- #[pallet::getter(fn slot_info)]
pub(crate) type SlotInfo = StorageValue<_, (Slot, u32), OptionQuery>;
#[pallet::genesis_config]
@@ -116,7 +115,7 @@ pub mod pallet {
#[pallet::genesis_build]
impl BuildGenesisConfig for GenesisConfig {
fn build(&self) {
- let authorities = Aura::::authorities();
+ let authorities = pallet_aura::Authorities::::get();
Authorities::::put(authorities);
}
}
diff --git a/cumulus/pallets/collator-selection/Cargo.toml b/cumulus/pallets/collator-selection/Cargo.toml
index 20f048b97d558962ea270ef51399f6d2905ab1a0..241a78466d61be3969930e031e1a52f4f3478482 100644
--- a/cumulus/pallets/collator-selection/Cargo.toml
+++ b/cumulus/pallets/collator-selection/Cargo.toml
@@ -77,5 +77,3 @@ try-runtime = [
"pallet-timestamp/try-runtime",
"sp-runtime/try-runtime",
]
-
-experimental = ["pallet-aura/experimental"]
diff --git a/cumulus/pallets/collator-selection/src/benchmarking.rs b/cumulus/pallets/collator-selection/src/benchmarking.rs
index 2c40f4dd0eac4a8a2ad3aed7f162a4379ccdbc93..c6b600445282534951b2c63a6c2a87181688acd1 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;
@@ -88,23 +86,23 @@ fn register_validators(count: u32) -> Vec(count: u32) {
let candidates = (0..count).map(|c| account("candidate", c, SEED)).collect::>();
- assert!(>::get() > 0u32.into(), "Bond cannot be zero!");
+ assert!(CandidacyBond::::get() > 0u32.into(), "Bond cannot be zero!");
for who in candidates {
- T::Currency::make_free_balance_be(&who, >::get() * 3u32.into());
+ T::Currency::make_free_balance_be(&who, CandidacyBond::::get() * 3u32.into());
>::register_as_candidate(RawOrigin::Signed(who).into()).unwrap();
}
}
fn min_candidates() -> u32 {
let min_collators = T::MinEligibleCollators::get();
- let invulnerable_length = >::get().len();
+ let invulnerable_length = Invulnerables::::get().len();
min_collators.saturating_sub(invulnerable_length.try_into().unwrap())
}
fn min_invulnerables() -> u32 {
let min_collators = T::MinEligibleCollators::get();
- let candidates_length = >::decode_len()
+ let candidates_length = CandidateList::::decode_len()
.unwrap_or_default()
.try_into()
.unwrap_or_default();
@@ -145,8 +143,8 @@ mod benchmarks {
T::UpdateOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
// need to fill up candidates
- >::put(T::Currency::minimum_balance());
- >::put(c);
+ CandidacyBond::::put(T::Currency::minimum_balance());
+ DesiredCandidates::::put(c);
// get accounts and keys for the `c` candidates
let mut candidates = (0..c).map(|cc| validator::(cc)).collect::>();
// add one more to the list. should not be in `b` (invulnerables) because it's the account
@@ -161,15 +159,15 @@ mod benchmarks {
}
// ... and register them.
for (who, _) in candidates.iter() {
- let deposit = >::get();
+ let deposit = CandidacyBond::::get();
T::Currency::make_free_balance_be(who, deposit * 1000_u32.into());
- >::try_mutate(|list| {
+ CandidateList::::try_mutate(|list| {
list.try_push(CandidateInfo { who: who.clone(), deposit }).unwrap();
Ok::<(), BenchmarkError>(())
})
.unwrap();
T::Currency::reserve(who, deposit)?;
- >::insert(
+ LastAuthoredBlock::::insert(
who.clone(),
frame_system::Pallet::::block_number() + T::KickThreshold::get(),
);
@@ -180,7 +178,7 @@ mod benchmarks {
invulnerables.sort();
let invulnerables: frame_support::BoundedVec<_, T::MaxInvulnerables> =
frame_support::BoundedVec::try_from(invulnerables).unwrap();
- >::put(invulnerables);
+ Invulnerables::::put(invulnerables);
#[extrinsic_call]
_(origin as T::RuntimeOrigin, new_invulnerable.clone());
@@ -199,8 +197,8 @@ mod benchmarks {
invulnerables.sort();
let invulnerables: frame_support::BoundedVec<_, T::MaxInvulnerables> =
frame_support::BoundedVec::try_from(invulnerables).unwrap();
- >::put(invulnerables);
- let to_remove = >::get().first().unwrap().clone();
+ Invulnerables::::put(invulnerables);
+ let to_remove = Invulnerables::::get().first().unwrap().clone();
#[extrinsic_call]
_(origin as T::RuntimeOrigin, to_remove.clone());
@@ -228,14 +226,14 @@ mod benchmarks {
k: Linear<0, { T::MaxCandidates::get() }>,
) -> Result<(), BenchmarkError> {
let initial_bond_amount: BalanceOf = T::Currency::minimum_balance() * 2u32.into();
- >::put(initial_bond_amount);
+ CandidacyBond::::put(initial_bond_amount);
register_validators::(c);
register_candidates::(c);
let kicked = cmp::min(k, c);
let origin =
T::UpdateOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
let bond_amount = if k > 0 {
- >::mutate(|candidates| {
+ CandidateList::::mutate(|candidates| {
for info in candidates.iter_mut().skip(kicked as usize) {
info.deposit = T::Currency::minimum_balance() * 3u32.into();
}
@@ -256,13 +254,13 @@ mod benchmarks {
fn update_bond(
c: Linear<{ min_candidates::() + 1 }, { T::MaxCandidates::get() }>,
) -> Result<(), BenchmarkError> {
- >::put(T::Currency::minimum_balance());
- >::put(c);
+ CandidacyBond::::put(T::Currency::minimum_balance());
+ DesiredCandidates::::put(c);
register_validators::(c);
register_candidates::(c);
- let caller = >::get()[0].who.clone();
+ let caller = CandidateList::::get()[0].who.clone();
v2::whitelist!(caller);
let bond_amount: BalanceOf =
@@ -275,7 +273,7 @@ mod benchmarks {
Event::CandidateBondUpdated { account_id: caller, deposit: bond_amount }.into(),
);
assert!(
- >::get().iter().last().unwrap().deposit ==
+ CandidateList::::get().iter().last().unwrap().deposit ==
T::Currency::minimum_balance() * 2u32.into()
);
Ok(())
@@ -285,8 +283,8 @@ mod benchmarks {
// one.
#[benchmark]
fn register_as_candidate(c: Linear<1, { T::MaxCandidates::get() - 1 }>) {
- >::put(T::Currency::minimum_balance());
- >::put(c + 1);
+ CandidacyBond::::put(T::Currency::minimum_balance());
+ DesiredCandidates::::put(c + 1);
register_validators::(c);
register_candidates::(c);
@@ -312,8 +310,8 @@ mod benchmarks {
#[benchmark]
fn take_candidate_slot(c: Linear<{ min_candidates::() + 1 }, { T::MaxCandidates::get() }>) {
- >::put(T::Currency::minimum_balance());
- >::put(1);
+ CandidacyBond::::put(T::Currency::minimum_balance());
+ DesiredCandidates::::put(1);
register_validators::(c);
register_candidates::(c);
@@ -329,7 +327,7 @@ mod benchmarks {
)
.unwrap();
- let target = >::get().iter().last().unwrap().who.clone();
+ let target = CandidateList::::get().iter().last().unwrap().who.clone();
#[extrinsic_call]
_(RawOrigin::Signed(caller.clone()), bond / 2u32.into(), target.clone());
@@ -343,13 +341,13 @@ mod benchmarks {
// worse case is the last candidate leaving.
#[benchmark]
fn leave_intent(c: Linear<{ min_candidates::() + 1 }, { T::MaxCandidates::get() }>) {
- >::put(T::Currency::minimum_balance());
- >::put(c);
+ CandidacyBond::::put(T::Currency::minimum_balance());
+ DesiredCandidates::::put(c);
register_validators::(c);
register_candidates::(c);
- let leaving = >::get().iter().last().unwrap().who.clone();
+ let leaving = CandidateList::::get().iter().last().unwrap().who.clone();
v2::whitelist!(leaving);
#[extrinsic_call]
@@ -361,7 +359,7 @@ mod benchmarks {
// worse case is paying a non-existing candidate account.
#[benchmark]
fn note_author() {
- >::put(T::Currency::minimum_balance());
+ CandidacyBond::::put(T::Currency::minimum_balance());
T::Currency::make_free_balance_be(
&>::account_id(),
T::Currency::minimum_balance() * 4u32.into(),
@@ -387,8 +385,8 @@ mod benchmarks {
r: Linear<1, { T::MaxCandidates::get() }>,
c: Linear<1, { T::MaxCandidates::get() }>,
) {
- >::put(T::Currency::minimum_balance());
- >::put(c);
+ CandidacyBond::::put(T::Currency::minimum_balance());
+ DesiredCandidates::::put(c);
frame_system::Pallet::::set_block_number(0u32.into());
register_validators::