mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 08:11:04 +00:00
Fixes - WeigthToFee + fmt
This commit is contained in:
@@ -42,11 +42,8 @@ pub struct XcmBlobMessageDispatch<SourceBridgeHubChain, TargetBridgeHubChain, Di
|
|||||||
sp_std::marker::PhantomData<(SourceBridgeHubChain, TargetBridgeHubChain, DispatchBlob)>,
|
sp_std::marker::PhantomData<(SourceBridgeHubChain, TargetBridgeHubChain, DispatchBlob)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<
|
impl<SourceBridgeHubChain: Chain, TargetBridgeHubChain: Chain, BlobDispatcher: DispatchBlob>
|
||||||
SourceBridgeHubChain: Chain,
|
MessageDispatch<AccountIdOf<SourceBridgeHubChain>, BalanceOf<TargetBridgeHubChain>>
|
||||||
TargetBridgeHubChain: Chain,
|
|
||||||
BlobDispatcher: DispatchBlob,
|
|
||||||
> MessageDispatch<AccountIdOf<SourceBridgeHubChain>, BalanceOf<TargetBridgeHubChain>>
|
|
||||||
for XcmBlobMessageDispatch<SourceBridgeHubChain, TargetBridgeHubChain, BlobDispatcher>
|
for XcmBlobMessageDispatch<SourceBridgeHubChain, TargetBridgeHubChain, BlobDispatcher>
|
||||||
{
|
{
|
||||||
type DispatchPayload = XcmAsPlainPayload;
|
type DispatchPayload = XcmAsPlainPayload;
|
||||||
@@ -79,13 +76,16 @@ impl<
|
|||||||
let dispatch_result = match BlobDispatcher::dispatch_blob(payload) {
|
let dispatch_result = match BlobDispatcher::dispatch_blob(payload) {
|
||||||
Ok(_) => true,
|
Ok(_) => true,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
let e= match e {
|
let e = match e {
|
||||||
DispatchBlobError::Unbridgable => "DispatchBlobError::Unbridgable",
|
DispatchBlobError::Unbridgable => "DispatchBlobError::Unbridgable",
|
||||||
DispatchBlobError::InvalidEncoding => "DispatchBlobError::InvalidEncoding",
|
DispatchBlobError::InvalidEncoding => "DispatchBlobError::InvalidEncoding",
|
||||||
DispatchBlobError::UnsupportedLocationVersion => "DispatchBlobError::UnsupportedLocationVersion",
|
DispatchBlobError::UnsupportedLocationVersion =>
|
||||||
DispatchBlobError::UnsupportedXcmVersion => "DispatchBlobError::UnsupportedXcmVersion",
|
"DispatchBlobError::UnsupportedLocationVersion",
|
||||||
|
DispatchBlobError::UnsupportedXcmVersion =>
|
||||||
|
"DispatchBlobError::UnsupportedXcmVersion",
|
||||||
DispatchBlobError::RoutingError => "DispatchBlobError::RoutingError",
|
DispatchBlobError::RoutingError => "DispatchBlobError::RoutingError",
|
||||||
DispatchBlobError::NonUniversalDestination => "DispatchBlobError::NonUniversalDestination",
|
DispatchBlobError::NonUniversalDestination =>
|
||||||
|
"DispatchBlobError::NonUniversalDestination",
|
||||||
DispatchBlobError::WrongGlobal => "DispatchBlobError::WrongGlobal",
|
DispatchBlobError::WrongGlobal => "DispatchBlobError::WrongGlobal",
|
||||||
};
|
};
|
||||||
log::error!(
|
log::error!(
|
||||||
@@ -142,9 +142,7 @@ impl<H: XcmBlobHauler> HaulBlob for XcmBlobHaulerAdapter<H> {
|
|||||||
let hash = (lane, artifacts.nonce).using_encoded(sp_io::hashing::blake2_256);
|
let hash = (lane, artifacts.nonce).using_encoded(sp_io::hashing::blake2_256);
|
||||||
hash
|
hash
|
||||||
})
|
})
|
||||||
.map_err(|e| {
|
.map_err(|e| e);
|
||||||
e
|
|
||||||
});
|
|
||||||
log::info!(target: "runtime::bridge-hub", "haul_blob result: {:?} on lane: {:?}", result, lane);
|
log::info!(target: "runtime::bridge-hub", "haul_blob result: {:?} on lane: {:?}", result, lane);
|
||||||
result.expect("failed to process: TODO:check-parameter - wait for origin/gav-xcm-v3, there is a comment about handliing errors for HaulBlob");
|
result.expect("failed to process: TODO:check-parameter - wait for origin/gav-xcm-v3, there is a comment about handliing errors for HaulBlob");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,10 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
|
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{ParachainInfo, Runtime, WithBridgeHubWococoMessagesInstance, XcmAsPlainPayload, XcmBlobHauler, XcmBlobHaulerAdapter, XcmRouter};
|
use crate::{
|
||||||
|
ParachainInfo, Runtime, WithBridgeHubWococoMessagesInstance, XcmAsPlainPayload, XcmBlobHauler,
|
||||||
|
XcmBlobHaulerAdapter, XcmRouter,
|
||||||
|
};
|
||||||
use bp_messages::{
|
use bp_messages::{
|
||||||
source_chain::TargetHeaderChain,
|
source_chain::TargetHeaderChain,
|
||||||
target_chain::{ProvedMessages, SourceHeaderChain},
|
target_chain::{ProvedMessages, SourceHeaderChain},
|
||||||
@@ -54,8 +57,11 @@ pub type OnBridgeHubRococoBlobDispatcher =
|
|||||||
BridgeBlobDispatcher<XcmRouter, BridgeHubRococoUniversalLocation>;
|
BridgeBlobDispatcher<XcmRouter, BridgeHubRococoUniversalLocation>;
|
||||||
|
|
||||||
/// Export XCM messages to be relayed to the otherside
|
/// Export XCM messages to be relayed to the otherside
|
||||||
pub type ToBridgeHubWococoHaulBlobExporter =
|
pub type ToBridgeHubWococoHaulBlobExporter = HaulBlobExporter<
|
||||||
HaulBlobExporter<XcmBlobHaulerAdapter<ToBridgeHubWococoXcmBlobHauler>, WococoGlobalConsensusNetwork, ()>;
|
XcmBlobHaulerAdapter<ToBridgeHubWococoXcmBlobHauler>,
|
||||||
|
WococoGlobalConsensusNetwork,
|
||||||
|
(),
|
||||||
|
>;
|
||||||
pub struct ToBridgeHubWococoXcmBlobHauler;
|
pub struct ToBridgeHubWococoXcmBlobHauler;
|
||||||
pub const DEFAULT_XCM_LANE_TO_BRIDGE_HUB_WOCOCO: LaneId = [0, 0, 0, 2];
|
pub const DEFAULT_XCM_LANE_TO_BRIDGE_HUB_WOCOCO: LaneId = [0, 0, 0, 2];
|
||||||
impl XcmBlobHauler for ToBridgeHubWococoXcmBlobHauler {
|
impl XcmBlobHauler for ToBridgeHubWococoXcmBlobHauler {
|
||||||
@@ -186,9 +192,7 @@ impl messages::BridgedChainWithMessages for BridgeHubWococo {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn transaction_payment(
|
fn transaction_payment(transaction: MessageTransaction<Weight>) -> messages::BalanceOf<Self> {
|
||||||
transaction: MessageTransaction<Weight>,
|
|
||||||
) -> messages::BalanceOf<Self> {
|
|
||||||
log::info!(
|
log::info!(
|
||||||
"[BridgeHubWococo::BridgedChainWithMessages] transaction_payment (returns 0 balance, TODO: fix) - transaction: {:?}",
|
"[BridgeHubWococo::BridgedChainWithMessages] transaction_payment (returns 0 balance, TODO: fix) - transaction: {:?}",
|
||||||
transaction
|
transaction
|
||||||
@@ -232,9 +236,7 @@ impl ThisChainWithMessages for BridgeHubRococo {
|
|||||||
MessageNonce::MAX / 2
|
MessageNonce::MAX / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
fn transaction_payment(
|
fn transaction_payment(transaction: MessageTransaction<Weight>) -> messages::BalanceOf<Self> {
|
||||||
transaction: MessageTransaction<Weight>,
|
|
||||||
) -> messages::BalanceOf<Self> {
|
|
||||||
log::info!(
|
log::info!(
|
||||||
"[BridgeHubRococo::ThisChainWithMessages] transaction_payment (returns 0 balance, TODO: fix) - transaction: {:?}",
|
"[BridgeHubRococo::ThisChainWithMessages] transaction_payment (returns 0 balance, TODO: fix) - transaction: {:?}",
|
||||||
transaction
|
transaction
|
||||||
|
|||||||
@@ -14,7 +14,10 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
|
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::{ParachainInfo, Runtime, WithBridgeHubRococoMessagesInstance, XcmAsPlainPayload, XcmBlobHauler, XcmBlobHaulerAdapter, XcmRouter};
|
use crate::{
|
||||||
|
ParachainInfo, Runtime, WithBridgeHubRococoMessagesInstance, XcmAsPlainPayload, XcmBlobHauler,
|
||||||
|
XcmBlobHaulerAdapter, XcmRouter,
|
||||||
|
};
|
||||||
use bp_messages::{
|
use bp_messages::{
|
||||||
source_chain::TargetHeaderChain,
|
source_chain::TargetHeaderChain,
|
||||||
target_chain::{ProvedMessages, SourceHeaderChain},
|
target_chain::{ProvedMessages, SourceHeaderChain},
|
||||||
@@ -54,8 +57,11 @@ pub type OnBridgeHubWococoBlobDispatcher =
|
|||||||
BridgeBlobDispatcher<XcmRouter, BridgeHubWococoUniversalLocation>;
|
BridgeBlobDispatcher<XcmRouter, BridgeHubWococoUniversalLocation>;
|
||||||
|
|
||||||
/// Export XCM messages to be relayed to the otherside
|
/// Export XCM messages to be relayed to the otherside
|
||||||
pub type ToBridgeHubRococoHaulBlobExporter =
|
pub type ToBridgeHubRococoHaulBlobExporter = HaulBlobExporter<
|
||||||
HaulBlobExporter<XcmBlobHaulerAdapter<ToBridgeHubRococoXcmBlobHauler>, RococoGlobalConsensusNetwork, ()>;
|
XcmBlobHaulerAdapter<ToBridgeHubRococoXcmBlobHauler>,
|
||||||
|
RococoGlobalConsensusNetwork,
|
||||||
|
(),
|
||||||
|
>;
|
||||||
pub struct ToBridgeHubRococoXcmBlobHauler;
|
pub struct ToBridgeHubRococoXcmBlobHauler;
|
||||||
pub const DEFAULT_XCM_LANE_TO_BRIDGE_HUB_ROCOCO: LaneId = [0, 0, 0, 1];
|
pub const DEFAULT_XCM_LANE_TO_BRIDGE_HUB_ROCOCO: LaneId = [0, 0, 0, 1];
|
||||||
impl XcmBlobHauler for ToBridgeHubRococoXcmBlobHauler {
|
impl XcmBlobHauler for ToBridgeHubRococoXcmBlobHauler {
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ pub mod fee {
|
|||||||
/// node's balance type.
|
/// node's balance type.
|
||||||
///
|
///
|
||||||
/// This should typically create a mapping between the following ranges:
|
/// This should typically create a mapping between the following ranges:
|
||||||
/// - [0, MAXIMUM_BLOCK_WEIGHT]
|
/// - `[0, MAXIMUM_BLOCK_WEIGHT]`
|
||||||
/// - [Balance::min, Balance::max]
|
/// - `[Balance::min, Balance::max]`
|
||||||
///
|
///
|
||||||
/// Yet, it can be used for any other sort of change to weight-fee. Some examples being:
|
/// Yet, it can be used for any other sort of change to weight-fee. Some examples being:
|
||||||
/// - Setting it to `0` will essentially disable the weight fee.
|
/// - Setting it to `0` will essentially disable the weight fee.
|
||||||
@@ -49,8 +49,8 @@ pub mod fee {
|
|||||||
impl WeightToFeePolynomial for WeightToFee {
|
impl WeightToFeePolynomial for WeightToFee {
|
||||||
type Balance = Balance;
|
type Balance = Balance;
|
||||||
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
|
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
|
||||||
// in Polkadot, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT:
|
// in Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1/10 CENT:
|
||||||
// in Statemint, we map to 1/10 of that, or 1/100 CENT
|
// in BridgeHub, we map to 1/10 of that, or 1/100 CENT
|
||||||
let p = super::currency::CENTS;
|
let p = super::currency::CENTS;
|
||||||
let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time());
|
let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time());
|
||||||
smallvec![WeightToFeeCoefficient {
|
smallvec![WeightToFeeCoefficient {
|
||||||
|
|||||||
@@ -29,11 +29,10 @@ pub mod constants;
|
|||||||
mod weights;
|
mod weights;
|
||||||
pub mod xcm_config;
|
pub mod xcm_config;
|
||||||
|
|
||||||
use codec::Decode;
|
|
||||||
use bridge_common_config::*;
|
use bridge_common_config::*;
|
||||||
|
use codec::Decode;
|
||||||
use constants::currency::*;
|
use constants::currency::*;
|
||||||
use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
|
use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases;
|
||||||
use smallvec::smallvec;
|
|
||||||
use sp_api::impl_runtime_apis;
|
use sp_api::impl_runtime_apis;
|
||||||
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
|
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
@@ -49,13 +48,11 @@ use sp_version::NativeVersion;
|
|||||||
use sp_version::RuntimeVersion;
|
use sp_version::RuntimeVersion;
|
||||||
|
|
||||||
use frame_support::{
|
use frame_support::{
|
||||||
construct_runtime, parameter_types,
|
construct_runtime,
|
||||||
dispatch::DispatchClass,
|
dispatch::DispatchClass,
|
||||||
|
parameter_types,
|
||||||
traits::Everything,
|
traits::Everything,
|
||||||
weights::{
|
weights::{ConstantMultiplier, Weight},
|
||||||
ConstantMultiplier, Weight,
|
|
||||||
WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial,
|
|
||||||
},
|
|
||||||
PalletId,
|
PalletId,
|
||||||
};
|
};
|
||||||
use frame_system::{
|
use frame_system::{
|
||||||
@@ -77,10 +74,12 @@ use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight};
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
bridge_hub_rococo_config::OnBridgeHubRococoBlobDispatcher,
|
bridge_hub_rococo_config::OnBridgeHubRococoBlobDispatcher,
|
||||||
bridge_hub_wococo_config::OnBridgeHubWococoBlobDispatcher,
|
bridge_hub_wococo_config::OnBridgeHubWococoBlobDispatcher, constants::fee::WeightToFee,
|
||||||
xcm_config::XcmRouter,
|
xcm_config::XcmRouter,
|
||||||
};
|
};
|
||||||
use parachains_common::{AccountId, Signature, AVERAGE_ON_INITIALIZE_RATIO, NORMAL_DISPATCH_RATIO, MAXIMUM_BLOCK_WEIGHT};
|
use parachains_common::{
|
||||||
|
AccountId, Signature, AVERAGE_ON_INITIALIZE_RATIO, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO,
|
||||||
|
};
|
||||||
use xcm::latest::prelude::BodyId;
|
use xcm::latest::prelude::BodyId;
|
||||||
use xcm_executor::XcmExecutor;
|
use xcm_executor::XcmExecutor;
|
||||||
|
|
||||||
@@ -126,7 +125,8 @@ pub type SignedExtra = (
|
|||||||
);
|
);
|
||||||
|
|
||||||
/// Unchecked extrinsic type as expected by this runtime.
|
/// Unchecked extrinsic type as expected by this runtime.
|
||||||
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
|
pub type UncheckedExtrinsic =
|
||||||
|
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
|
||||||
|
|
||||||
/// Extrinsic type that has already been checked.
|
/// Extrinsic type that has already been checked.
|
||||||
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;
|
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;
|
||||||
@@ -140,33 +140,6 @@ pub type Executive = frame_executive::Executive<
|
|||||||
AllPalletsWithSystem,
|
AllPalletsWithSystem,
|
||||||
>;
|
>;
|
||||||
|
|
||||||
/// Handles converting a weight scalar to a fee value, based on the scale and granularity of the
|
|
||||||
/// node's balance type.
|
|
||||||
///
|
|
||||||
/// This should typically create a mapping between the following ranges:
|
|
||||||
/// - `[0, MAXIMUM_BLOCK_WEIGHT]`
|
|
||||||
/// - `[Balance::min, Balance::max]`
|
|
||||||
///
|
|
||||||
/// Yet, it can be used for any other sort of change to weight-fee. Some examples being:
|
|
||||||
/// - Setting it to `0` will essentially disable the weight fee.
|
|
||||||
/// - Setting it to `1` will cause the literal `#[weight = x]` values to be charged.
|
|
||||||
pub struct WeightToFee;
|
|
||||||
impl WeightToFeePolynomial for WeightToFee {
|
|
||||||
type Balance = Balance;
|
|
||||||
fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
|
|
||||||
// in Rococo, extrinsic base weight (smallest non-zero weight) is mapped to 1 MILLIUNIT:
|
|
||||||
// in our template, we map to 1/10 of that, or 1/10 MILLIUNIT
|
|
||||||
let p = MILLIUNIT / 10;
|
|
||||||
let q = 100 * Balance::from(ExtrinsicBaseWeight::get().ref_time());
|
|
||||||
smallvec![WeightToFeeCoefficient {
|
|
||||||
degree: 1,
|
|
||||||
negative: false,
|
|
||||||
coeff_frac: Perbill::from_rational(p % q, q),
|
|
||||||
coeff_integer: p / q,
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know
|
/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know
|
||||||
/// the specifics of the runtime. They can then be made to be agnostic over specific formats
|
/// the specifics of the runtime. They can then be made to be agnostic over specific formats
|
||||||
/// of data like extrinsics, allowing for them to continue syncing the network through upgrades
|
/// of data like extrinsics, allowing for them to continue syncing the network through upgrades
|
||||||
@@ -226,7 +199,6 @@ pub const UNIT: Balance = 1_000_000_000_000;
|
|||||||
pub const MILLIUNIT: Balance = 1_000_000_000;
|
pub const MILLIUNIT: Balance = 1_000_000_000;
|
||||||
pub const MICROUNIT: Balance = 1_000_000;
|
pub const MICROUNIT: Balance = 1_000_000;
|
||||||
|
|
||||||
|
|
||||||
/// The version information used to identify this runtime when compiled natively.
|
/// The version information used to identify this runtime when compiled natively.
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
pub fn native_version() -> NativeVersion {
|
pub fn native_version() -> NativeVersion {
|
||||||
@@ -492,8 +464,9 @@ impl pallet_bridge_grandpa::Config<BridgeGrandpaWococoInstance> for Runtime {
|
|||||||
type BridgedChain = bp_wococo::Wococo;
|
type BridgedChain = bp_wococo::Wococo;
|
||||||
type MaxRequests = MaxRequests;
|
type MaxRequests = MaxRequests;
|
||||||
type HeadersToKeep = HeadersToKeep;
|
type HeadersToKeep = HeadersToKeep;
|
||||||
type MaxBridgedAuthorities = frame_support::traits::ConstU32<{bp_wococo::MAX_AUTHORITIES_COUNT}>;
|
type MaxBridgedAuthorities =
|
||||||
type MaxBridgedHeaderSize = frame_support::traits::ConstU32<{bp_wococo::MAX_HEADER_SIZE}>;
|
frame_support::traits::ConstU32<{ bp_wococo::MAX_AUTHORITIES_COUNT }>;
|
||||||
|
type MaxBridgedHeaderSize = frame_support::traits::ConstU32<{ bp_wococo::MAX_HEADER_SIZE }>;
|
||||||
type WeightInfo = pallet_bridge_grandpa::weights::BridgeWeight<Runtime>;
|
type WeightInfo = pallet_bridge_grandpa::weights::BridgeWeight<Runtime>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -503,8 +476,9 @@ impl pallet_bridge_grandpa::Config<BridgeGrandpaRococoInstance> for Runtime {
|
|||||||
type BridgedChain = bp_rococo::Rococo;
|
type BridgedChain = bp_rococo::Rococo;
|
||||||
type MaxRequests = MaxRequests;
|
type MaxRequests = MaxRequests;
|
||||||
type HeadersToKeep = HeadersToKeep;
|
type HeadersToKeep = HeadersToKeep;
|
||||||
type MaxBridgedAuthorities = frame_support::traits::ConstU32<{bp_rococo::MAX_AUTHORITIES_COUNT}>;
|
type MaxBridgedAuthorities =
|
||||||
type MaxBridgedHeaderSize = frame_support::traits::ConstU32<{bp_rococo::MAX_HEADER_SIZE}>;
|
frame_support::traits::ConstU32<{ bp_rococo::MAX_AUTHORITIES_COUNT }>;
|
||||||
|
type MaxBridgedHeaderSize = frame_support::traits::ConstU32<{ bp_rococo::MAX_HEADER_SIZE }>;
|
||||||
type WeightInfo = pallet_bridge_grandpa::weights::BridgeWeight<Runtime>;
|
type WeightInfo = pallet_bridge_grandpa::weights::BridgeWeight<Runtime>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -525,7 +499,8 @@ impl pallet_bridge_parachains::Config<BridgeParachainWococoInstance> for Runtime
|
|||||||
type ParasPalletName = WococoBridgeParachainPalletName;
|
type ParasPalletName = WococoBridgeParachainPalletName;
|
||||||
type TrackedParachains = Everything;
|
type TrackedParachains = Everything;
|
||||||
type HeadsToKeep = ParachainHeadsToKeep;
|
type HeadsToKeep = ParachainHeadsToKeep;
|
||||||
type MaxParaHeadSize = frame_support::traits::ConstU32<{bp_wococo::MAX_NESTED_PARACHAIN_HEAD_SIZE}>;
|
type MaxParaHeadSize =
|
||||||
|
frame_support::traits::ConstU32<{ bp_wococo::MAX_NESTED_PARACHAIN_HEAD_SIZE }>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add parachain bridge pallet to track Rococo bridge hub parachain
|
/// Add parachain bridge pallet to track Rococo bridge hub parachain
|
||||||
@@ -537,7 +512,8 @@ impl pallet_bridge_parachains::Config<BridgeParachainRococoInstance> for Runtime
|
|||||||
type ParasPalletName = RococoBridgeParachainPalletName;
|
type ParasPalletName = RococoBridgeParachainPalletName;
|
||||||
type TrackedParachains = Everything;
|
type TrackedParachains = Everything;
|
||||||
type HeadsToKeep = ParachainHeadsToKeep;
|
type HeadsToKeep = ParachainHeadsToKeep;
|
||||||
type MaxParaHeadSize = frame_support::traits::ConstU32<{bp_rococo::MAX_NESTED_PARACHAIN_HEAD_SIZE}>;
|
type MaxParaHeadSize =
|
||||||
|
frame_support::traits::ConstU32<{ bp_rococo::MAX_NESTED_PARACHAIN_HEAD_SIZE }>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Add XCM messages support for BrigdeHubRococo to support Rococo->Wococo XCM messages
|
/// Add XCM messages support for BrigdeHubRococo to support Rococo->Wococo XCM messages
|
||||||
@@ -553,7 +529,8 @@ impl pallet_bridge_messages::Config<WithBridgeHubWococoMessagesInstance> for Run
|
|||||||
type MaxUnconfirmedMessagesAtInboundLane =
|
type MaxUnconfirmedMessagesAtInboundLane =
|
||||||
bridge_hub_rococo_config::MaxUnconfirmedMessagesAtInboundLane;
|
bridge_hub_rococo_config::MaxUnconfirmedMessagesAtInboundLane;
|
||||||
|
|
||||||
type MaximalOutboundPayloadSize = bridge_hub_rococo_config::ToBridgeHubWococoMaximalOutboundPayloadSize;
|
type MaximalOutboundPayloadSize =
|
||||||
|
bridge_hub_rococo_config::ToBridgeHubWococoMaximalOutboundPayloadSize;
|
||||||
type OutboundPayload = XcmAsPlainPayload;
|
type OutboundPayload = XcmAsPlainPayload;
|
||||||
type OutboundMessageFee = Balance;
|
type OutboundMessageFee = Balance;
|
||||||
|
|
||||||
@@ -588,7 +565,8 @@ impl pallet_bridge_messages::Config<WithBridgeHubRococoMessagesInstance> for Run
|
|||||||
type MaxUnconfirmedMessagesAtInboundLane =
|
type MaxUnconfirmedMessagesAtInboundLane =
|
||||||
bridge_hub_wococo_config::MaxUnconfirmedMessagesAtInboundLane;
|
bridge_hub_wococo_config::MaxUnconfirmedMessagesAtInboundLane;
|
||||||
|
|
||||||
type MaximalOutboundPayloadSize = bridge_hub_wococo_config::ToBridgeHubRococoMaximalOutboundPayloadSize;
|
type MaximalOutboundPayloadSize =
|
||||||
|
bridge_hub_wococo_config::ToBridgeHubRococoMaximalOutboundPayloadSize;
|
||||||
type OutboundPayload = XcmAsPlainPayload;
|
type OutboundPayload = XcmAsPlainPayload;
|
||||||
type OutboundMessageFee = Balance;
|
type OutboundMessageFee = Balance;
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,8 @@
|
|||||||
pub mod block_weights;
|
pub mod block_weights;
|
||||||
pub mod cumulus_pallet_xcmp_queue;
|
pub mod cumulus_pallet_xcmp_queue;
|
||||||
pub mod extrinsic_weights;
|
pub mod extrinsic_weights;
|
||||||
pub mod paritydb_weights;
|
|
||||||
pub mod pallet_balances;
|
pub mod pallet_balances;
|
||||||
|
pub mod paritydb_weights;
|
||||||
pub mod rocksdb_weights;
|
pub mod rocksdb_weights;
|
||||||
pub mod xcm;
|
pub mod xcm;
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
|
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
AccountId, Balance, Balances, RuntimeCall, RuntimeEvent, RuntimeOrigin, ParachainInfo, ParachainSystem, PolkadotXcm,
|
AccountId, Balance, Balances, ParachainInfo, ParachainSystem, PolkadotXcm, Runtime,
|
||||||
Runtime, XcmpQueue,
|
RuntimeCall, RuntimeEvent, RuntimeOrigin, XcmpQueue,
|
||||||
};
|
};
|
||||||
use crate::{
|
use crate::{
|
||||||
bridge_hub_rococo_config::ToBridgeHubWococoHaulBlobExporter,
|
bridge_hub_rococo_config::ToBridgeHubWococoHaulBlobExporter,
|
||||||
@@ -30,7 +30,13 @@ use frame_support::{
|
|||||||
use pallet_xcm::XcmPassthrough;
|
use pallet_xcm::XcmPassthrough;
|
||||||
use polkadot_parachain::primitives::Sibling;
|
use polkadot_parachain::primitives::Sibling;
|
||||||
use xcm::latest::prelude::*;
|
use xcm::latest::prelude::*;
|
||||||
use xcm_builder::{AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, IsConcrete, NativeAsset, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents, WeightInfoBounds};
|
use xcm_builder::{
|
||||||
|
AccountId32Aliases, AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter,
|
||||||
|
EnsureXcmOrigin, IsConcrete, NativeAsset, ParentIsPreset, RelayChainAsNative,
|
||||||
|
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
|
||||||
|
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
|
||||||
|
WeightInfoBounds,
|
||||||
|
};
|
||||||
use xcm_executor::{traits::ExportXcm, XcmExecutor};
|
use xcm_executor::{traits::ExportXcm, XcmExecutor};
|
||||||
|
|
||||||
parameter_types! {
|
parameter_types! {
|
||||||
@@ -276,12 +282,22 @@ impl ExportXcm for BridgeHubRococoOrBridgeHubWococoSwitchExporter {
|
|||||||
message: &mut Option<Xcm<()>>,
|
message: &mut Option<Xcm<()>>,
|
||||||
) -> SendResult<Self::Ticket> {
|
) -> SendResult<Self::Ticket> {
|
||||||
match network {
|
match network {
|
||||||
Rococo =>
|
Rococo => ToBridgeHubRococoHaulBlobExporter::validate(
|
||||||
ToBridgeHubRococoHaulBlobExporter::validate(network, channel, universal_source, destination, message)
|
network,
|
||||||
.map(|result| ((Rococo, result.0), result.1)),
|
channel,
|
||||||
Wococo =>
|
universal_source,
|
||||||
ToBridgeHubWococoHaulBlobExporter::validate(network, channel, universal_source, destination, message)
|
destination,
|
||||||
.map(|result| ((Wococo, result.0), result.1)),
|
message,
|
||||||
|
)
|
||||||
|
.map(|result| ((Rococo, result.0), result.1)),
|
||||||
|
Wococo => ToBridgeHubWococoHaulBlobExporter::validate(
|
||||||
|
network,
|
||||||
|
channel,
|
||||||
|
universal_source,
|
||||||
|
destination,
|
||||||
|
message,
|
||||||
|
)
|
||||||
|
.map(|result| ((Wococo, result.0), result.1)),
|
||||||
_ => unimplemented!("Unsupported network: {:?}", network),
|
_ => unimplemented!("Unsupported network: {:?}", network),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user