SignedExtensionSchema for GenericSignedExtensionSchema
+impl
TransactionExtensionSchema for GenericTransactionExtensionSchema
where
P: Encode + Decode + Debug + Eq + Clone + StaticTypeInfo,
- S: Encode + Debug + Eq + Clone + StaticTypeInfo,
+ S: Encode + Decode + Debug + Eq + Clone + StaticTypeInfo,
{
type Payload = P;
- type AdditionalSigned = S;
+ type Implicit = S;
}
-/// The `SignedExtensionSchema` for `frame_system::CheckNonZeroSender`.
-pub type CheckNonZeroSender = GenericSignedExtensionSchema<(), ()>;
+/// The `TransactionExtensionSchema` for `frame_system::CheckNonZeroSender`.
+pub type CheckNonZeroSender = GenericTransactionExtensionSchema<(), ()>;
-/// The `SignedExtensionSchema` for `frame_system::CheckSpecVersion`.
-pub type CheckSpecVersion = GenericSignedExtensionSchema<(), u32>;
+/// The `TransactionExtensionSchema` for `frame_system::CheckSpecVersion`.
+pub type CheckSpecVersion = GenericTransactionExtensionSchema<(), u32>;
-/// The `SignedExtensionSchema` for `frame_system::CheckTxVersion`.
-pub type CheckTxVersion = GenericSignedExtensionSchema<(), u32>;
+/// The `TransactionExtensionSchema` for `frame_system::CheckTxVersion`.
+pub type CheckTxVersion = GenericTransactionExtensionSchema<(), u32>;
-/// The `SignedExtensionSchema` for `frame_system::CheckGenesis`.
-pub type CheckGenesis = GenericSignedExtensionSchema<(), Hash>;
+/// The `TransactionExtensionSchema` for `frame_system::CheckGenesis`.
+pub type CheckGenesis = GenericTransactionExtensionSchema<(), Hash>;
-/// The `SignedExtensionSchema` for `frame_system::CheckEra`.
-pub type CheckEra = GenericSignedExtensionSchema;
+/// The `TransactionExtensionSchema` for `frame_system::CheckEra`.
+pub type CheckEra = GenericTransactionExtensionSchema;
-/// The `SignedExtensionSchema` for `frame_system::CheckNonce`.
-pub type CheckNonce = GenericSignedExtensionSchema, ()>;
+/// The `TransactionExtensionSchema` for `frame_system::CheckNonce`.
+pub type CheckNonce = GenericTransactionExtensionSchema, ()>;
-/// The `SignedExtensionSchema` for `frame_system::CheckWeight`.
-pub type CheckWeight = GenericSignedExtensionSchema<(), ()>;
+/// The `TransactionExtensionSchema` for `frame_system::CheckWeight`.
+pub type CheckWeight = GenericTransactionExtensionSchema<(), ()>;
-/// The `SignedExtensionSchema` for `pallet_transaction_payment::ChargeTransactionPayment`.
-pub type ChargeTransactionPayment = GenericSignedExtensionSchema, ()>;
+/// The `TransactionExtensionSchema` for `pallet_transaction_payment::ChargeTransactionPayment`.
+pub type ChargeTransactionPayment =
+ GenericTransactionExtensionSchema, ()>;
-/// The `SignedExtensionSchema` for `polkadot-runtime-common::PrevalidateAttests`.
-pub type PrevalidateAttests = GenericSignedExtensionSchema<(), ()>;
+/// The `TransactionExtensionSchema` for `polkadot-runtime-common::PrevalidateAttests`.
+pub type PrevalidateAttests = GenericTransactionExtensionSchema<(), ()>;
-/// The `SignedExtensionSchema` for `BridgeRejectObsoleteHeadersAndMessages`.
-pub type BridgeRejectObsoleteHeadersAndMessages = GenericSignedExtensionSchema<(), ()>;
+/// The `TransactionExtensionSchema` for `BridgeRejectObsoleteHeadersAndMessages`.
+pub type BridgeRejectObsoleteHeadersAndMessages = GenericTransactionExtensionSchema<(), ()>;
-/// The `SignedExtensionSchema` for `RefundBridgedParachainMessages`.
+/// The `TransactionExtensionSchema` for `RefundBridgedParachainMessages`.
/// This schema is dedicated for `RefundBridgedParachainMessages` signed extension as
/// wildcard/placeholder, which relies on the scale encoding for `()` or `((), ())`, or `((), (),
/// ())` is the same. So runtime can contains any kind of tuple:
/// `(BridgeRefundBridgeHubRococoMessages)`
/// `(BridgeRefundBridgeHubRococoMessages, BridgeRefundBridgeHubWestendMessages)`
/// `(BridgeRefundParachainMessages1, ..., BridgeRefundParachainMessagesN)`
-pub type RefundBridgedParachainMessagesSchema = GenericSignedExtensionSchema<(), ()>;
+pub type RefundBridgedParachainMessagesSchema = GenericTransactionExtensionSchema<(), ()>;
#[impl_for_tuples(1, 12)]
-impl SignedExtensionSchema for Tuple {
+impl TransactionExtensionSchema for Tuple {
for_tuples!( type Payload = ( #( Tuple::Payload ),* ); );
- for_tuples!( type AdditionalSigned = ( #( Tuple::AdditionalSigned ),* ); );
+ for_tuples!( type Implicit = ( #( Tuple::Implicit ),* ); );
}
/// A simplified version of signed extensions meant for producing signed transactions
/// and signed payloads in the client code.
#[derive(Encode, Decode, Debug, PartialEq, Eq, Clone, TypeInfo)]
-pub struct GenericSignedExtension {
+pub struct GenericTransactionExtension {
/// A payload that is included in the transaction.
pub payload: S::Payload,
#[codec(skip)]
// It may be set to `None` if extensions are decoded. We are never reconstructing transactions
- // (and it makes no sense to do that) => decoded version of `SignedExtensions` is only used to
- // read fields of the `payload`. And when resigning transaction, we're reconstructing
- // `SignedExtensions` from scratch.
- additional_signed: Option,
+ // (and it makes no sense to do that) => decoded version of `TransactionExtensions` is only
+ // used to read fields of the `payload`. And when resigning transaction, we're reconstructing
+ // `TransactionExtensions` from scratch.
+ implicit: Option,
}
-impl GenericSignedExtension {
- /// Create new `GenericSignedExtension` object.
- pub fn new(payload: S::Payload, additional_signed: Option) -> Self {
- Self { payload, additional_signed }
+impl GenericTransactionExtension {
+ /// Create new `GenericTransactionExtension` object.
+ pub fn new(payload: S::Payload, implicit: Option) -> Self {
+ Self { payload, implicit }
}
}
-impl SignedExtension for GenericSignedExtension
+impl TransactionExtension for GenericTransactionExtension
where
- S: SignedExtensionSchema,
+ C: Dispatchable,
+ S: TransactionExtensionSchema,
S::Payload: Send + Sync,
- S::AdditionalSigned: Send + Sync,
+ S::Implicit: Send + Sync,
{
const IDENTIFIER: &'static str = "Not needed.";
- type AccountId = ();
- type Call = ();
- type AdditionalSigned = S::AdditionalSigned;
- type Pre = ();
+ type Implicit = S::Implicit;
- fn additional_signed(&self) -> Result {
+ fn implicit(&self) -> Result {
// we shall not ever see this error in relay, because we are never signing decoded
// transactions. Instead we're constructing and signing new transactions. So the error code
// is kinda random here
- self.additional_signed.clone().ok_or(
- frame_support::unsigned::TransactionValidityError::Unknown(
+ self.implicit
+ .clone()
+ .ok_or(frame_support::unsigned::TransactionValidityError::Unknown(
frame_support::unsigned::UnknownTransaction::Custom(0xFF),
- ),
- )
+ ))
}
+ type Pre = ();
+ type Val = ();
- fn pre_dispatch(
- self,
- _who: &Self::AccountId,
- _call: &Self::Call,
- _info: &DispatchInfoOf,
- _len: usize,
- ) -> Result {
- Ok(())
- }
+ impl_tx_ext_default!(C; weight validate prepare);
}
diff --git a/bridges/relays/lib-substrate-relay/src/messages/mod.rs b/bridges/relays/lib-substrate-relay/src/messages/mod.rs
index f7031648bc35..b4ee57ed7742 100644
--- a/bridges/relays/lib-substrate-relay/src/messages/mod.rs
+++ b/bridges/relays/lib-substrate-relay/src/messages/mod.rs
@@ -428,7 +428,7 @@ where
"Prepared {} -> {} messages delivery call. Weight: {}/{}, size: {}/{}",
P::SourceChain::NAME,
P::TargetChain::NAME,
- call.get_dispatch_info().weight,
+ call.get_dispatch_info().call_weight,
P::TargetChain::max_extrinsic_weight(),
call.encode().len(),
P::TargetChain::max_extrinsic_size(),
@@ -521,7 +521,7 @@ where
"Prepared {} -> {} delivery confirmation transaction. Weight: {}/{}, size: {}/{}",
P::TargetChain::NAME,
P::SourceChain::NAME,
- call.get_dispatch_info().weight,
+ call.get_dispatch_info().call_weight,
P::SourceChain::max_extrinsic_weight(),
call.encode().len(),
P::SourceChain::max_extrinsic_size(),
diff --git a/bridges/snowbridge/pallets/ethereum-client/Cargo.toml b/bridges/snowbridge/pallets/ethereum-client/Cargo.toml
index 666ac3fbc8a2..262d9a7f380d 100644
--- a/bridges/snowbridge/pallets/ethereum-client/Cargo.toml
+++ b/bridges/snowbridge/pallets/ethereum-client/Cargo.toml
@@ -49,13 +49,7 @@ serde = { workspace = true, default-features = true }
[features]
default = ["std"]
-fuzzing = [
- "hex-literal",
- "pallet-timestamp",
- "serde",
- "serde_json",
- "sp-io",
-]
+fuzzing = ["hex-literal", "pallet-timestamp", "serde", "serde_json", "sp-io"]
std = [
"codec/std",
"frame-support/std",
diff --git a/bridges/snowbridge/pallets/ethereum-client/fixtures/Cargo.toml b/bridges/snowbridge/pallets/ethereum-client/fixtures/Cargo.toml
index bd4176875733..87f0cf9a5513 100644
--- a/bridges/snowbridge/pallets/ethereum-client/fixtures/Cargo.toml
+++ b/bridges/snowbridge/pallets/ethereum-client/fixtures/Cargo.toml
@@ -29,6 +29,4 @@ std = [
"sp-core/std",
"sp-std/std",
]
-runtime-benchmarks = [
- "snowbridge-core/runtime-benchmarks",
-]
+runtime-benchmarks = ["snowbridge-core/runtime-benchmarks"]
diff --git a/bridges/snowbridge/pallets/inbound-queue/fixtures/Cargo.toml b/bridges/snowbridge/pallets/inbound-queue/fixtures/Cargo.toml
index b66b57c3620a..6162a17728b6 100644
--- a/bridges/snowbridge/pallets/inbound-queue/fixtures/Cargo.toml
+++ b/bridges/snowbridge/pallets/inbound-queue/fixtures/Cargo.toml
@@ -29,6 +29,4 @@ std = [
"sp-core/std",
"sp-std/std",
]
-runtime-benchmarks = [
- "snowbridge-core/runtime-benchmarks",
-]
+runtime-benchmarks = ["snowbridge-core/runtime-benchmarks"]
diff --git a/bridges/snowbridge/pallets/outbound-queue/merkle-tree/Cargo.toml b/bridges/snowbridge/pallets/outbound-queue/merkle-tree/Cargo.toml
index 9d4cffc98d78..16241428df80 100644
--- a/bridges/snowbridge/pallets/outbound-queue/merkle-tree/Cargo.toml
+++ b/bridges/snowbridge/pallets/outbound-queue/merkle-tree/Cargo.toml
@@ -30,9 +30,4 @@ sp-tracing = { workspace = true, default-features = true }
[features]
default = ["std"]
-std = [
- "codec/std",
- "scale-info/std",
- "sp-core/std",
- "sp-runtime/std",
-]
+std = ["codec/std", "scale-info/std", "sp-core/std", "sp-runtime/std"]
diff --git a/bridges/snowbridge/primitives/router/src/inbound/mod.rs b/bridges/snowbridge/primitives/router/src/inbound/mod.rs
index fbfc52d01c83..357f77f831cc 100644
--- a/bridges/snowbridge/primitives/router/src/inbound/mod.rs
+++ b/bridges/snowbridge/primitives/router/src/inbound/mod.rs
@@ -253,7 +253,7 @@ where
let bridge_location = Location::new(2, GlobalConsensus(network));
- let owner = GlobalConsensusEthereumConvertsFor::<[u8; 32]>::from_chain_id(&chain_id);
+ let owner = EthereumLocationsConverterFor::<[u8; 32]>::from_chain_id(&chain_id);
let asset_id = Self::convert_token_address(network, token);
let create_call_index: [u8; 2] = CreateAssetCall::get();
let inbound_queue_pallet_index = InboundQueuePalletInstance::get();
@@ -416,6 +416,8 @@ where
// Final destination is a 32-byte account on AssetHub
Destination::AccountId32 { id } =>
Ok(Location::new(0, [AccountId32 { network: None, id }])),
+ // Forwarding to a destination parachain is not allowed for PNA and is validated on the
+ // Ethereum side. https://github.com/Snowfork/snowbridge/blob/e87ddb2215b513455c844463a25323bb9c01ff36/contracts/src/Assets.sol#L216-L224
_ => Err(ConvertMessageError::InvalidDestination),
}?;
@@ -452,22 +454,27 @@ where
}
}
-pub struct GlobalConsensusEthereumConvertsFor(PhantomData);
-impl ConvertLocation for GlobalConsensusEthereumConvertsFor
+pub struct EthereumLocationsConverterFor(PhantomData);
+impl ConvertLocation for EthereumLocationsConverterFor
where
AccountId: From<[u8; 32]> + Clone,
{
fn convert_location(location: &Location) -> Option {
match location.unpack() {
- (_, [GlobalConsensus(Ethereum { chain_id })]) =>
+ (2, [GlobalConsensus(Ethereum { chain_id })]) =>
Some(Self::from_chain_id(chain_id).into()),
+ (2, [GlobalConsensus(Ethereum { chain_id }), AccountKey20 { network: _, key }]) =>
+ Some(Self::from_chain_id_with_key(chain_id, *key).into()),
_ => None,
}
}
}
-impl GlobalConsensusEthereumConvertsFor {
+impl EthereumLocationsConverterFor {
pub fn from_chain_id(chain_id: &u64) -> [u8; 32] {
(b"ethereum-chain", chain_id).using_encoded(blake2_256)
}
+ pub fn from_chain_id_with_key(chain_id: &u64, key: [u8; 20]) -> [u8; 32] {
+ (b"ethereum-chain", chain_id, key).using_encoded(blake2_256)
+ }
}
diff --git a/bridges/snowbridge/primitives/router/src/inbound/tests.rs b/bridges/snowbridge/primitives/router/src/inbound/tests.rs
index e0e90e516be1..786aa594f653 100644
--- a/bridges/snowbridge/primitives/router/src/inbound/tests.rs
+++ b/bridges/snowbridge/primitives/router/src/inbound/tests.rs
@@ -1,4 +1,4 @@
-use super::GlobalConsensusEthereumConvertsFor;
+use super::EthereumLocationsConverterFor;
use crate::inbound::CallIndex;
use frame_support::{assert_ok, parameter_types};
use hex_literal::hex;
@@ -17,14 +17,28 @@ parameter_types! {
}
#[test]
-fn test_contract_location_with_network_converts_successfully() {
+fn test_ethereum_network_converts_successfully() {
let expected_account: [u8; 32] =
hex!("ce796ae65569a670d0c1cc1ac12515a3ce21b5fbf729d63d7b289baad070139d");
let contract_location = Location::new(2, [GlobalConsensus(NETWORK)]);
let account =
- GlobalConsensusEthereumConvertsFor::<[u8; 32]>::convert_location(&contract_location)
- .unwrap();
+ EthereumLocationsConverterFor::<[u8; 32]>::convert_location(&contract_location).unwrap();
+
+ assert_eq!(account, expected_account);
+}
+
+#[test]
+fn test_contract_location_with_network_converts_successfully() {
+ let expected_account: [u8; 32] =
+ hex!("9038d35aba0e78e072d29b2d65be9df5bb4d7d94b4609c9cf98ea8e66e544052");
+ let contract_location = Location::new(
+ 2,
+ [GlobalConsensus(NETWORK), AccountKey20 { network: None, key: [123u8; 20] }],
+ );
+
+ let account =
+ EthereumLocationsConverterFor::<[u8; 32]>::convert_location(&contract_location).unwrap();
assert_eq!(account, expected_account);
}
@@ -34,7 +48,7 @@ fn test_contract_location_with_incorrect_location_fails_convert() {
let contract_location = Location::new(2, [GlobalConsensus(Polkadot), Parachain(1000)]);
assert_eq!(
- GlobalConsensusEthereumConvertsFor::<[u8; 32]>::convert_location(&contract_location),
+ EthereumLocationsConverterFor::<[u8; 32]>::convert_location(&contract_location),
None,
);
}
diff --git a/bridges/snowbridge/primitives/router/src/outbound/mod.rs b/bridges/snowbridge/primitives/router/src/outbound/mod.rs
index efc1ef56f304..3b5dbdb77c89 100644
--- a/bridges/snowbridge/primitives/router/src/outbound/mod.rs
+++ b/bridges/snowbridge/primitives/router/src/outbound/mod.rs
@@ -207,9 +207,9 @@ where
fn convert(&mut self) -> Result<(Command, [u8; 32]), XcmConverterError> {
let result = match self.peek() {
- Ok(ReserveAssetDeposited { .. }) => self.send_native_tokens_message(),
+ Ok(ReserveAssetDeposited { .. }) => self.make_mint_foreign_token_command(),
// Get withdraw/deposit and make native tokens create message.
- Ok(WithdrawAsset { .. }) => self.send_tokens_message(),
+ Ok(WithdrawAsset { .. }) => self.make_unlock_native_token_command(),
Err(e) => Err(e),
_ => return Err(XcmConverterError::UnexpectedInstruction),
}?;
@@ -222,7 +222,9 @@ where
Ok(result)
}
- fn send_tokens_message(&mut self) -> Result<(Command, [u8; 32]), XcmConverterError> {
+ fn make_unlock_native_token_command(
+ &mut self,
+ ) -> Result<(Command, [u8; 32]), XcmConverterError> {
use XcmConverterError::*;
// Get the reserve assets from WithdrawAsset.
@@ -271,7 +273,12 @@ where
ensure!(reserve_assets.len() == 1, TooManyAssets);
let reserve_asset = reserve_assets.get(0).ok_or(AssetResolutionFailed)?;
- // If there was a fee specified verify it.
+ // Fees are collected on AH, up front and directly from the user, to cover the
+ // complete cost of the transfer. Any additional fees provided in the XCM program are
+ // refunded to the beneficiary. We only validate the fee here if its provided to make sure
+ // the XCM program is well formed. Another way to think about this from an XCM perspective
+ // would be that the user offered to pay X amount in fees, but we charge 0 of that X amount
+ // (no fee) and refund X to the user.
if let Some(fee_asset) = fee_asset {
// The fee asset must be the same as the reserve asset.
if fee_asset.id != reserve_asset.id || fee_asset.fun > reserve_asset.fun {
@@ -328,7 +335,9 @@ where
/// # BuyExecution
/// # DepositAsset
/// # SetTopic
- fn send_native_tokens_message(&mut self) -> Result<(Command, [u8; 32]), XcmConverterError> {
+ fn make_mint_foreign_token_command(
+ &mut self,
+ ) -> Result<(Command, [u8; 32]), XcmConverterError> {
use XcmConverterError::*;
// Get the reserve assets.
@@ -377,7 +386,12 @@ where
ensure!(reserve_assets.len() == 1, TooManyAssets);
let reserve_asset = reserve_assets.get(0).ok_or(AssetResolutionFailed)?;
- // If there was a fee specified verify it.
+ // Fees are collected on AH, up front and directly from the user, to cover the
+ // complete cost of the transfer. Any additional fees provided in the XCM program are
+ // refunded to the beneficiary. We only validate the fee here if its provided to make sure
+ // the XCM program is well formed. Another way to think about this from an XCM perspective
+ // would be that the user offered to pay X amount in fees, but we charge 0 of that X amount
+ // (no fee) and refund X to the user.
if let Some(fee_asset) = fee_asset {
// The fee asset must be the same as the reserve asset.
if fee_asset.id != reserve_asset.id || fee_asset.fun > reserve_asset.fun {
diff --git a/bridges/testing/environments/rococo-westend/rococo.zndsl b/bridges/testing/environments/rococo-westend/rococo-bridge.zndsl
similarity index 100%
rename from bridges/testing/environments/rococo-westend/rococo.zndsl
rename to bridges/testing/environments/rococo-westend/rococo-bridge.zndsl
diff --git a/bridges/testing/environments/rococo-westend/rococo-start.zndsl b/bridges/testing/environments/rococo-westend/rococo-start.zndsl
new file mode 100644
index 000000000000..8c719b010df6
--- /dev/null
+++ b/bridges/testing/environments/rococo-westend/rococo-start.zndsl
@@ -0,0 +1,8 @@
+Description: Check if the Rococo parachains started producing blocks reliably
+Network: ./bridge_hub_westend_local_network.toml
+Creds: config
+
+# ensure that initialization has completed
+asset-hub-rococo-collator1: reports block height is at least 10 within 180 seconds
+bridge-hub-rococo-collator1: reports block height is at least 10 within 180 seconds
+
diff --git a/bridges/testing/environments/rococo-westend/spawn.sh b/bridges/testing/environments/rococo-westend/spawn.sh
index a0ab00be1444..83b3b0720bb8 100755
--- a/bridges/testing/environments/rococo-westend/spawn.sh
+++ b/bridges/testing/environments/rococo-westend/spawn.sh
@@ -35,9 +35,11 @@ start_zombienet $TEST_DIR $westend_def westend_dir westend_pid
echo
if [[ $init -eq 1 ]]; then
+ run_zndsl ${BASH_SOURCE%/*}/rococo-start.zndsl $rococo_dir
+ run_zndsl ${BASH_SOURCE%/*}/westend-start.zndsl $westend_dir
+
rococo_init_log=$logs_dir/rococo-init.log
echo -e "Setting up the rococo side of the bridge. Logs available at: $rococo_init_log\n"
-
westend_init_log=$logs_dir/westend-init.log
echo -e "Setting up the westend side of the bridge. Logs available at: $westend_init_log\n"
@@ -47,7 +49,6 @@ if [[ $init -eq 1 ]]; then
westend_init_pid=$!
wait -n $rococo_init_pid $westend_init_pid
-
$helper_script init-bridge-hub-rococo-local >> $rococo_init_log 2>&1 &
rococo_init_pid=$!
$helper_script init-bridge-hub-westend-local >> $westend_init_log 2>&1 &
diff --git a/bridges/testing/environments/rococo-westend/start_relayer.sh b/bridges/testing/environments/rococo-westend/start_relayer.sh
index 9c57e4a6ab6e..150fce035071 100755
--- a/bridges/testing/environments/rococo-westend/start_relayer.sh
+++ b/bridges/testing/environments/rococo-westend/start_relayer.sh
@@ -29,8 +29,8 @@ messages_relayer_log=$logs_dir/relayer_messages.log
echo -e "Starting rococo-westend messages relayer. Logs available at: $messages_relayer_log\n"
start_background_process "$helper_script run-messages-relay" $messages_relayer_log messages_relayer_pid
-run_zndsl ${BASH_SOURCE%/*}/rococo.zndsl $rococo_dir
-run_zndsl ${BASH_SOURCE%/*}/westend.zndsl $westend_dir
+run_zndsl ${BASH_SOURCE%/*}/rococo-bridge.zndsl $rococo_dir
+run_zndsl ${BASH_SOURCE%/*}/westend-bridge.zndsl $westend_dir
eval $__finality_relayer_pid="'$finality_relayer_pid'"
eval $__parachains_relayer_pid="'$parachains_relayer_pid'"
diff --git a/bridges/testing/environments/rococo-westend/westend.zndsl b/bridges/testing/environments/rococo-westend/westend-bridge.zndsl
similarity index 100%
rename from bridges/testing/environments/rococo-westend/westend.zndsl
rename to bridges/testing/environments/rococo-westend/westend-bridge.zndsl
diff --git a/bridges/testing/environments/rococo-westend/westend-start.zndsl b/bridges/testing/environments/rococo-westend/westend-start.zndsl
new file mode 100644
index 000000000000..fe587322edb6
--- /dev/null
+++ b/bridges/testing/environments/rococo-westend/westend-start.zndsl
@@ -0,0 +1,8 @@
+Description: Check if the Westend parachains started producing blocks reliably
+Network: ./bridge_hub_westend_local_network.toml
+Creds: config
+
+# ensure that initialization has completed
+asset-hub-westend-collator1: reports block height is at least 10 within 180 seconds
+bridge-hub-westend-collator1: reports block height is at least 10 within 180 seconds
+
diff --git a/cumulus/client/consensus/aura/src/collators/lookahead.rs b/cumulus/client/consensus/aura/src/collators/lookahead.rs
index 8ac43fbd116e..2dbcf5eb58e9 100644
--- a/cumulus/client/consensus/aura/src/collators/lookahead.rs
+++ b/cumulus/client/consensus/aura/src/collators/lookahead.rs
@@ -36,17 +36,15 @@ use cumulus_client_collator::service::ServiceInterface as CollatorServiceInterfa
use cumulus_client_consensus_common::{self as consensus_common, ParachainBlockImportMarker};
use cumulus_client_consensus_proposer::ProposerInterface;
use cumulus_primitives_aura::AuraUnincludedSegmentApi;
-use cumulus_primitives_core::{
- ClaimQueueOffset, CollectCollationInfo, PersistedValidationData, DEFAULT_CLAIM_QUEUE_OFFSET,
-};
+use cumulus_primitives_core::{ClaimQueueOffset, CollectCollationInfo, PersistedValidationData};
use cumulus_relay_chain_interface::RelayChainInterface;
use polkadot_node_primitives::{PoV, SubmitCollationParams};
use polkadot_node_subsystem::messages::CollationGenerationMessage;
use polkadot_overseer::Handle as OverseerHandle;
use polkadot_primitives::{
- BlockNumber as RBlockNumber, CollatorPair, Hash as RHash, HeadData, Id as ParaId,
- OccupiedCoreAssumption,
+ vstaging::DEFAULT_CLAIM_QUEUE_OFFSET, BlockNumber as RBlockNumber, CollatorPair, Hash as RHash,
+ HeadData, Id as ParaId, OccupiedCoreAssumption,
};
use futures::prelude::*;
diff --git a/cumulus/client/consensus/aura/src/collators/slot_based/block_builder_task.rs b/cumulus/client/consensus/aura/src/collators/slot_based/block_builder_task.rs
index e75b52aeebd3..425151230704 100644
--- a/cumulus/client/consensus/aura/src/collators/slot_based/block_builder_task.rs
+++ b/cumulus/client/consensus/aura/src/collators/slot_based/block_builder_task.rs
@@ -20,13 +20,11 @@ use cumulus_client_collator::service::ServiceInterface as CollatorServiceInterfa
use cumulus_client_consensus_common::{self as consensus_common, ParachainBlockImportMarker};
use cumulus_client_consensus_proposer::ProposerInterface;
use cumulus_primitives_aura::AuraUnincludedSegmentApi;
-use cumulus_primitives_core::{
- GetCoreSelectorApi, PersistedValidationData, DEFAULT_CLAIM_QUEUE_OFFSET,
-};
+use cumulus_primitives_core::{GetCoreSelectorApi, PersistedValidationData};
use cumulus_relay_chain_interface::RelayChainInterface;
use polkadot_primitives::{
- vstaging::{ClaimQueueOffset, CoreSelector},
+ vstaging::{ClaimQueueOffset, CoreSelector, DEFAULT_CLAIM_QUEUE_OFFSET},
BlockId, CoreIndex, Hash as RelayHash, Header as RelayHeader, Id as ParaId,
OccupiedCoreAssumption,
};
diff --git a/cumulus/client/consensus/common/src/tests.rs b/cumulus/client/consensus/common/src/tests.rs
index 94e2304011be..79e620db3bfa 100644
--- a/cumulus/client/consensus/common/src/tests.rs
+++ b/cumulus/client/consensus/common/src/tests.rs
@@ -20,7 +20,7 @@ use async_trait::async_trait;
use codec::Encode;
use cumulus_client_pov_recovery::RecoveryKind;
use cumulus_primitives_core::{
- relay_chain::{BlockId, BlockNumber, CoreState},
+ relay_chain::{vstaging::CoreState, BlockId, BlockNumber},
CumulusDigestItem, InboundDownwardMessage, InboundHrmpMessage,
};
use cumulus_relay_chain_interface::{
diff --git a/cumulus/client/network/src/lib.rs b/cumulus/client/network/src/lib.rs
index 01ad15bed4da..3b9c0fc81ece 100644
--- a/cumulus/client/network/src/lib.rs
+++ b/cumulus/client/network/src/lib.rs
@@ -32,8 +32,8 @@ use polkadot_node_primitives::{CollationSecondedSignal, Statement};
use polkadot_node_subsystem::messages::RuntimeApiRequest;
use polkadot_parachain_primitives::primitives::HeadData;
use polkadot_primitives::{
- CandidateReceipt, CompactStatement, Hash as PHash, Id as ParaId, OccupiedCoreAssumption,
- SigningContext, UncheckedSigned,
+ vstaging::CandidateReceiptV2 as CandidateReceipt, CompactStatement, Hash as PHash,
+ Id as ParaId, OccupiedCoreAssumption, SigningContext, UncheckedSigned,
};
use codec::{Decode, DecodeAll, Encode};
@@ -79,7 +79,7 @@ impl Decode for BlockAnnounceData {
let relay_parent = match PHash::decode(input) {
Ok(p) => p,
// For being backwards compatible, we support missing relay-chain parent.
- Err(_) => receipt.descriptor.relay_parent,
+ Err(_) => receipt.descriptor.relay_parent(),
};
Ok(Self { receipt, statement, relay_parent })
@@ -108,7 +108,7 @@ impl BlockAnnounceData {
return Err(Validation::Failure { disconnect: true })
}
- if HeadData(encoded_header).hash() != self.receipt.descriptor.para_head {
+ if HeadData(encoded_header).hash() != self.receipt.descriptor.para_head() {
tracing::debug!(
target: LOG_TARGET,
"Receipt para head hash doesn't match the hash of the header in the block announcement",
@@ -302,7 +302,7 @@ where
}
.map_err(|e| Box::new(BlockAnnounceError(format!("{:?}", e))) as Box<_>)?;
- Ok(candidate_receipts.into_iter().map(|cr| cr.descriptor.para_head))
+ Ok(candidate_receipts.into_iter().map(|cr| cr.descriptor.para_head()))
}
/// Handle a block announcement with empty data (no statement) attached to it.
@@ -399,7 +399,7 @@ where
return Ok(e)
}
- let relay_parent = block_announce_data.receipt.descriptor.relay_parent;
+ let relay_parent = block_announce_data.receipt.descriptor.relay_parent();
relay_chain_interface
.wait_for_block(relay_parent)
diff --git a/cumulus/client/network/src/tests.rs b/cumulus/client/network/src/tests.rs
index 4b3473645210..009f922008b1 100644
--- a/cumulus/client/network/src/tests.rs
+++ b/cumulus/client/network/src/tests.rs
@@ -26,10 +26,11 @@ use futures::{executor::block_on, poll, task::Poll, FutureExt, Stream, StreamExt
use parking_lot::Mutex;
use polkadot_node_primitives::{SignedFullStatement, Statement};
use polkadot_primitives::{
+ vstaging::{CommittedCandidateReceiptV2, CoreState},
BlockNumber, CandidateCommitments, CandidateDescriptor, CollatorPair,
- CommittedCandidateReceipt, CoreState, Hash as PHash, HeadData, InboundDownwardMessage,
- InboundHrmpMessage, OccupiedCoreAssumption, PersistedValidationData, SessionIndex,
- SigningContext, ValidationCodeHash, ValidatorId,
+ CommittedCandidateReceipt, Hash as PHash, HeadData, InboundDownwardMessage, InboundHrmpMessage,
+ OccupiedCoreAssumption, PersistedValidationData, SessionIndex, SigningContext,
+ ValidationCodeHash, ValidatorId,
};
use polkadot_test_client::{
Client as PClient, ClientBlockImportExt, DefaultTestClientBuilderExt, FullBackend as PBackend,
@@ -166,7 +167,7 @@ impl RelayChainInterface for DummyRelayChainInterface {
&self,
_: PHash,
_: ParaId,
- ) -> RelayChainResult