More backports from Cumulus subtree to polkadot-staging (#2283)

* more backports from Cumulus subtree

* spelling

* fmt

* trigger CI

* Revert "trigger CI"

This reverts commit b009d732aa26d006a7f2b48878ee864c338c49d5.

* Revert "Revert "trigger CI""

This reverts commit 715606a75948124962b14dbb260cf3aed01bc665.

* Revert "Revert "Revert "trigger CI"""

This reverts commit dc0d2233da86fd12a77216008e59bd38fcbb2fac.
This commit is contained in:
Svyatoslav Nikolsky
2023-07-20 14:23:36 +03:00
committed by Bastian Köcher
parent 4d42bb22f3
commit 57550eb867
12 changed files with 43 additions and 42 deletions
@@ -18,7 +18,7 @@
use crate::cli::bridge::{CliBridgeBase, ParachainToRelayHeadersCliBridge};
use relay_millau_client::Millau;
use relay_westend_client::{Westend, Westmint};
use relay_westend_client::{AssetHubWestend, Westend};
use substrate_relay_helper::parachains::{
DirectSubmitParachainHeadsCallBuilder, SubstrateParachainsPipeline,
};
@@ -28,7 +28,7 @@ use substrate_relay_helper::parachains::{
pub struct WestendParachainsToMillau;
impl SubstrateParachainsPipeline for WestendParachainsToMillau {
type SourceParachain = Westmint;
type SourceParachain = AssetHubWestend;
type SourceRelayChain = Westend;
type TargetChain = Millau;
@@ -44,16 +44,16 @@ pub type WestendParachainsToMillauSubmitParachainHeadsCallBuilder =
>;
//// `WestendParachain` to `Millau` bridge definition.
pub struct WestmintToMillauCliBridge {}
pub struct AssetHubWestendToMillauCliBridge {}
impl ParachainToRelayHeadersCliBridge for WestmintToMillauCliBridge {
impl ParachainToRelayHeadersCliBridge for AssetHubWestendToMillauCliBridge {
type SourceRelay = Westend;
type ParachainFinality = WestendParachainsToMillau;
type RelayFinality =
crate::bridges::westend_millau::westend_headers_to_millau::WestendFinalityToMillau;
}
impl CliBridgeBase for WestmintToMillauCliBridge {
type Source = Westmint;
impl CliBridgeBase for AssetHubWestendToMillauCliBridge {
type Source = AssetHubWestend;
type Target = Millau;
}
@@ -18,12 +18,12 @@
use crate::cli::CliChain;
use relay_substrate_client::SimpleRuntimeVersion;
use relay_westend_client::{Westend, Westmint};
use relay_westend_client::{AssetHubWestend, Westend};
impl CliChain for Westend {
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> = None;
}
impl CliChain for Westmint {
impl CliChain for AssetHubWestend {
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> = None;
}
@@ -24,7 +24,7 @@ use crate::bridges::{
rococo_parachains_to_bridge_hub_wococo::BridgeHubRococoToBridgeHubWococoCliBridge,
wococo_parachains_to_bridge_hub_rococo::BridgeHubWococoToBridgeHubRococoCliBridge,
},
westend_millau::westend_parachains_to_millau::WestmintToMillauCliBridge,
westend_millau::westend_parachains_to_millau::AssetHubWestendToMillauCliBridge,
};
use async_std::sync::Mutex;
use async_trait::async_trait;
@@ -115,7 +115,7 @@ where
}
impl ParachainsRelayer for RialtoParachainToMillauCliBridge {}
impl ParachainsRelayer for WestmintToMillauCliBridge {}
impl ParachainsRelayer for AssetHubWestendToMillauCliBridge {}
impl ParachainsRelayer for BridgeHubRococoToBridgeHubWococoCliBridge {}
impl ParachainsRelayer for BridgeHubWococoToBridgeHubRococoCliBridge {}
impl ParachainsRelayer for BridgeHubKusamaToBridgeHubPolkadotCliBridge {}
@@ -128,7 +128,7 @@ impl RelayParachains {
RelayParachainsBridge::RialtoToMillau =>
RialtoParachainToMillauCliBridge::relay_parachains(self),
RelayParachainsBridge::WestendToMillau =>
WestmintToMillauCliBridge::relay_parachains(self),
AssetHubWestendToMillauCliBridge::relay_parachains(self),
RelayParachainsBridge::RococoToBridgeHubWococo =>
BridgeHubRococoToBridgeHubWococoCliBridge::relay_parachains(self),
RelayParachainsBridge::WococoToBridgeHubRococo =>
+7 -7
View File
@@ -58,21 +58,21 @@ impl ChainWithBalances for Westend {
}
}
/// Westmint parachain definition
/// `AssetHubWestend` parachain definition
#[derive(Debug, Clone, Copy)]
pub struct Westmint;
pub struct AssetHubWestend;
impl UnderlyingChainProvider for Westmint {
type Chain = bp_westend::Westmint;
impl UnderlyingChainProvider for AssetHubWestend {
type Chain = bp_westend::AssetHubWestend;
}
// Westmint seems to use the same configuration as all Polkadot-like chains, so we'll use Westend
// primitives here.
impl Chain for Westmint {
const ID: ChainId = bp_runtime::WESTMINT_CHAIN_ID;
impl Chain for AssetHubWestend {
const ID: ChainId = bp_runtime::ASSET_HUB_WESTEND_CHAIN_ID;
const NAME: &'static str = "Westmint";
const BEST_FINALIZED_HEADER_ID_METHOD: &'static str =
bp_westend::BEST_FINALIZED_WESTMINT_HEADER_METHOD;
bp_westend::BEST_FINALIZED_ASSETHUBWESTEND_HEADER_METHOD;
const AVERAGE_BLOCK_INTERVAL: Duration = Duration::from_secs(6);
type SignedBlock = bp_westend::SignedBlock;