Skip to content

Commit

Permalink
Extended Kusama/Polkadot BridgeHub configuration with dynamic fees su…
Browse files Browse the repository at this point in the history
…pport

Squashed commit of the following:

commit fcb61370cd65b3579675b3a3d20c42475176756b
Merge: 8e21f41ca1 a7402efd77
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Sun Sep 3 11:31:18 2023 +0200

    Merge branch 'bridge-hub-kusama-polkadot' into bridge-hub-kusama-polkadot-with-dynamic-fees

commit 8e21f41ca1a69a60e4a0bf6d8e2f5238e4f81a07
Merge: ca288257c8 69db677180
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Thu Aug 17 09:55:18 2023 +0200

    Merge remote-tracking branch 'origin/bridge-hub-kusama-polkadot' into bridge-hub-kusama-polkadot-with-dynamic-fees

commit ca288257c8edb39453945267022c789e6d343a6a
Merge: 7824adb44c d701b6ad24
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Wed Aug 16 21:36:16 2023 +0200

    Merge remote-tracking branch 'origin/bridge-hub-kusama-polkadot' into bridge-hub-kusama-polkadot-with-dynamic-fees

commit 7824adb44c35aba4e8334496c5c1e8c7aab2d510
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Wed Aug 16 12:36:06 2023 +0200

    Added consts for base fee with sanity check

commit 47addc3fd6ab5518610c5a3c15a615b520def45f
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Wed Aug 16 12:28:46 2023 +0200

    Fix for BHRo/Wo

commit ad6f236fec91b04acb16a58c9eabb32a854be57b
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Wed Aug 16 11:50:06 2023 +0200

    Congestion messages as Optional to turn on/off `supports_congestion_detection`

commit 5931a57af12399ee400f2b31ccacfbdbf7d317b4
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Wed Aug 16 11:48:42 2023 +0200

    Introduced base delivery fee constants

commit 4c5e054b998e8d8d8f5df702300ad8ba84ef15fc
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Tue Aug 15 17:35:24 2023 +0200

    Adjusted `require_max_weight` with XcmBridgeHubRouterTransactCallMaxWeight

commit a9b4637d06e88f859c7dde23566e480d74234eec
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Tue Aug 15 17:26:59 2023 +0200

    Added const for `XcmBridgeHubRouterTransactCallMaxWeight`

commit 16ac9a1a0c38caee65c8f82531df4230158afcfe
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Tue Aug 15 12:49:03 2023 +0200

    Add impl for `CongestedMessage/UncongestedMessage` for BridgeHubs

commit 307654e59a491eb1a28e6c650181a7df6c336811
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Tue Aug 15 12:05:40 2023 +0200

    Added XcmBridgeHubRouterCall::report_bridge_status encodings for AHK/P

commit 9daeb8b87ea2a404ace4f4acba716d7a9a133a6f
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Mon Aug 14 22:41:38 2023 +0200

    Extended script for local run BHK/P

commit 983eb8d5990758857529de109282130f2db8ff13
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Mon Aug 14 16:34:02 2023 +0200

    Disabled `UnpaidExecution` for system parachains

commit 3a5dfe2fc154fc5e5df6ce1a51fdbe850c73a41e
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Mon Aug 14 16:15:55 2023 +0200

    Adjusted test `handle_export_message_from_system_parachain_to_outbound_queue_works` for Paid or Unpaid scenario

commit a701215a9b0bcacb151d5c72668f7acb74962d68
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Mon Aug 14 15:26:28 2023 +0200

    Test for calculating base delivery fee on BridgeHubs

commit ebc0ed144699ea6c03d43aa17b90458cce15e284
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Sat Aug 12 16:39:10 2023 +0200

    Update to new version with dynamic fees

commit 76115f6c759a851df3c837d3c0aa6ceb91aef2c8
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Fri Aug 11 22:19:45 2023 +0200

    [dynfees] Implemented `XcmChannelStatusProvider` for `XcmpQueue`

commit e5ac886647f732330defc2c681502a1540e96d98
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Fri Aug 11 10:03:21 2023 +0200

    [dynfees] Rococo/Wococo does not need congestion and dynamic fees (for now)

commit 4d60d0992c2da0ff5c84ff899123f3c9b33c3050
Merge: e1d0001ecf 02e00e6411
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Thu Aug 10 15:58:59 2023 +0200

    Merge commit '02e00e6411c56bc44497bcd05104b17cdfdc0862' into bridge-hub-kusama-polkadot-with-dynamic-fees

commit 02e00e6411c56bc44497bcd05104b17cdfdc0862
Author: Branislav Kontur <bkontur@gmail.com>
Date:   Thu Aug 10 15:58:59 2023 +0200

    Squashed 'bridges/' changes from edf33a2..8f86ec78b7

    8f86ec78b7 ".git/.scripts/commands/fmt/fmt.sh"
    ccf2f9483b Merge remote-tracking branch 'origin/polkadot-staging' into dynamic-fees-v1
    f822ebc450 Dynamic fees v1: report congestion status to sending chain (#2318)
    add9fb1d53 added/fixed some docs
    569a80f233 Rename LocalXcmChannel to XcmChannelStatusProvider (#2319)
    dc3618a4a5 Clippy
    e7cab6ab49 (Suggestion) Ability to externalize configuration for `ExporterFor` (#2313)
    c68467beff fmt
    5d76f25311 use saturated_len where possible
    7cc1470528 Update modules/xcm-bridge-hub-router/src/lib.rs
    8d7a38a409 change log target for xcm bridge router pallet
    773f93209f Revert "trigger CI"
    48f1ba0323 trigger CI
    b26aa98d1e fixing spellcheck, clippy and rustdoc
    c467911a37 add new pallet to verify-pallets-build.sh
    ed72ebe62b get rid of redundant storage value
    522bbc7ec4 benchmarks for pallet-xcm-bridge-hub-router
    958243564d extension_reject_call_when_dispatcher_is_inactive
    38cd8f3df3 fix other tests in the bridge-runtime-common
    b75e64fdf7 tests for new logic in the XcmBlobHaulerAdapter
    4c741714cb tests for LocalXcmQueueMessageProcessor
    d99420e14c tests for LocalXcmQueueSuspender
    084f551bb6 new tests for logic changes in messages pallet
    d9515f7317 use LocalXcmChannel in XcmBlobMessageDispatch
    d9a0c2e468 improvements and tests for palle-xcm-bridge-router
    c24301374a removed commented code
    eea610a875 pallet-xcm-bridge-hub-router
    1fdac85a14 forbid mesage delivery transactions when the channel between target bridge hub and target asset hub is suspended
    3c98c245ac OnMessageDelviered callback
    65787da038 LocalXcmQueueManager + more adapters
    74b48e2cc3 impl backpressure in the XcmBlobHaulerAdapter

    git-subtree-dir: bridges
    git-subtree-split: 8f86ec78b7747ba32807e8691f022edb4ad3040d

Co-authored-by: Branislav Kontur <bkontur@gmail.com>
Co-authored-by: Adrian Catangiu <adrian@parity.io>
Co-authored-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
Co-authored-by: Serban Iorga <serban@parity.io>

Signed-off-by: Branislav Kontur <bkontur@gmail.com>
Signed-off-by: Adrian Catangiu <adrian@parity.io>
Signed-off-by: Svyatoslav Nikolsky <svyatonik@gmail.com>
Signed-off-by: Serban Iorga <serban@parity.io>
  • Loading branch information
bkontur committed Sep 4, 2023
1 parent 6fec636 commit 1da09f0
Show file tree
Hide file tree
Showing 15 changed files with 299 additions and 53 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cumulus/pallets/xcmp-queue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ cumulus-pallet-parachain-system = { path = "../parachain-system" }
[features]
default = [ "std" ]
std = [
"bp-xcm-bridge-hub-router/std",
"bp-xcm-bridge-hub-router?/std",
"codec/std",
"cumulus-primitives-core/std",
"frame-benchmarking?/std",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,15 @@ cumulus-pallet-dmp-queue = { path = "../../../../pallets/dmp-queue", default-fea
cumulus-pallet-parachain-system = { path = "../../../../pallets/parachain-system", default-features = false, features = ["parameterized-consensus-hook",] }
cumulus-pallet-session-benchmarking = { path = "../../../../pallets/session-benchmarking", default-features = false}
cumulus-pallet-xcm = { path = "../../../../pallets/xcm", default-features = false }
cumulus-pallet-xcmp-queue = { path = "../../../../pallets/xcmp-queue", default-features = false }
cumulus-pallet-xcmp-queue = { path = "../../../../pallets/xcmp-queue", default-features = false, features = ["bridging"] }
cumulus-primitives-core = { path = "../../../../primitives/core", default-features = false }
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
parachain-info = { path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false }

# Bridges
bp-asset-hub-kusama = { path = "../../../../bridges/primitives/chain-asset-hub-kusama", default-features = false }
bp-bridge-hub-kusama = { path = "../../../../bridges/primitives/chain-bridge-hub-kusama", default-features = false }
bp-bridge-hub-polkadot = { path = "../../../../bridges/primitives/chain-bridge-hub-polkadot", default-features = false }
bp-header-chain = { path = "../../../../bridges/primitives/header-chain", default-features = false }
Expand All @@ -97,6 +98,7 @@ sp-keyring = { path = "../../../../../substrate/primitives/keyring" }
[features]
default = [ "std" ]
std = [
"bp-asset-hub-kusama/std",
"bp-bridge-hub-kusama/std",
"bp-bridge-hub-polkadot/std",
"bp-header-chain/std",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use bridge_runtime_common::{
RefundableParachain,
},
};
use codec::Encode;
use frame_support::{parameter_types, traits::PalletInfoAccess};
use sp_runtime::RuntimeDebug;
use xcm::{latest::prelude::*, prelude::NetworkId};
Expand All @@ -55,6 +56,28 @@ parameter_types! {
ParentThen(X1(Parachain(AssetHubKusamaParaId::get().into()))).into(),
ASSET_HUB_KUSAMA_TO_ASSET_HUB_POLKADOT_LANE_ID,
);

pub CongestedMessage: Xcm<()> = sp_std::vec![Transact {
origin_kind: OriginKind::Xcm,
require_weight_at_most: bp_asset_hub_kusama::XcmBridgeHubRouterTransactCallMaxWeight::get(),
call: bp_asset_hub_kusama::Call::ToPolkadotXcmRouter(
bp_asset_hub_kusama::XcmBridgeHubRouterCall::report_bridge_status {
bridge_id: Default::default(),
is_congested: true,
}
).encode().into(),
}].into();

pub UncongestedMessage: Xcm<()> = sp_std::vec![Transact {
origin_kind: OriginKind::Xcm,
require_weight_at_most: bp_asset_hub_kusama::XcmBridgeHubRouterTransactCallMaxWeight::get(),
call: bp_asset_hub_kusama::Call::ToPolkadotXcmRouter(
bp_asset_hub_kusama::XcmBridgeHubRouterCall::report_bridge_status {
bridge_id: Default::default(),
is_congested: false,
}
).encode().into(),
}].into();
}

/// Proof of messages, coming from BridgeHubPolkadot.
Expand All @@ -81,10 +104,13 @@ impl XcmBlobHauler for ToBridgeHubPolkadotXcmBlobHauler {
type SenderAndLane = FromAssetHubKusamaToAssetHubPolkadotRoute;

type ToSourceChainSender = crate::XcmRouter;
type CongestedMessage = ();
type UncongestedMessage = ();
type CongestedMessage = CongestedMessage;
type UncongestedMessage = UncongestedMessage;
}

/// On messages delivered callback.
pub type OnMessagesDelivered = XcmBlobHaulerAdapter<ToBridgeHubPolkadotXcmBlobHauler>;

/// Messaging Bridge configuration for ThisChain -> BridgeHubPolkadot
pub struct WithBridgeHubPolkadotMessageBridge;
impl MessageBridge for WithBridgeHubPolkadotMessageBridge {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,15 @@ impl pallet_bridge_messages::Config<WithBridgeHubPolkadotMessagesInstance> for R
DeliveryRewardInBalance,
>;
type SourceHeaderChain = SourceHeaderChainAdapter<WithBridgeHubPolkadotMessageBridge>;
type MessageDispatch =
XcmBlobMessageDispatch<OnThisChainBlobDispatcher<UniversalLocation>, Self::WeightInfo, ()>;
type OnMessagesDelivered = ();
type MessageDispatch = XcmBlobMessageDispatch<
OnThisChainBlobDispatcher<UniversalLocation>,
Self::WeightInfo,
cumulus_pallet_xcmp_queue::bridging::OutboundXcmpChannelCongestionStatusProvider<
bridge_hub_config::AssetHubKusamaParaId,
Runtime,
>,
>;
type OnMessagesDelivered = bridge_hub_config::OnMessagesDelivered;
}

/// Allows collect and claim rewards for relayers
Expand Down Expand Up @@ -942,7 +948,11 @@ impl_runtime_apis! {
type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::<Runtime>;
type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::<Runtime>;

use bridge_runtime_common::messages_benchmarking::{prepare_message_delivery_proof_from_parachain, prepare_message_proof_from_parachain};
use bridge_runtime_common::messages_benchmarking::{
generate_xcm_builder_bridge_message_sample,
prepare_message_delivery_proof_from_parachain,
prepare_message_proof_from_parachain
};
use pallet_bridge_messages::benchmarking::{
Config as BridgeMessagesConfig,
Pallet as BridgeMessagesBench,
Expand Down Expand Up @@ -972,7 +982,7 @@ impl_runtime_apis! {
Runtime,
BridgeGrandpaPolkadotInstance,
bridge_hub_config::WithBridgeHubPolkadotMessageBridge,
>(params, X2(GlobalConsensus(xcm_config::RelayNetwork::get().unwrap()), Parachain(42)))
>(params, generate_xcm_builder_bridge_message_sample(X2(GlobalConsensus(xcm_config::RelayNetwork::get().unwrap()), Parachain(42))))
}
fn prepare_message_delivery_proof(
params: MessageDeliveryProofParams<AccountId>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@ match_types! {
MultiLocation { parents: 1, interior: Here } |
MultiLocation { parents: 1, interior: X1(_) }
};
// TODO:check-parameter - (https://github.com/paritytech/parity-bridges-common/issues/2084)
// remove this and extend `AllowExplicitUnpaidExecutionFrom` with "or SystemParachains" once merged https://github.com/paritytech/polkadot/pull/7005
pub type SystemParachains: impl Contains<MultiLocation> = {
// Statemine
MultiLocation { parents: 1, interior: X1(Parachain(1000)) }
};
}

/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
Expand Down Expand Up @@ -191,9 +185,8 @@ pub type Barrier = TrailingSetTopicAsId<
// If the message is one that immediately attemps to pay for execution, then
// allow it.
AllowTopLevelPaidExecutionFrom<Everything>,
// Parent, its pluralities (i.e. governance bodies) and system parachains get
// free execution.
AllowExplicitUnpaidExecutionFrom<(ParentOrParentsPlurality, SystemParachains)>,
// Parent and its pluralities (i.e. governance bodies) get free execution.
AllowExplicitUnpaidExecutionFrom<(ParentOrParentsPlurality,)>,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom<ParentOrSiblings>,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use bp_polkadot_core::Signature;
pub use bridge_hub_kusama_runtime::{
bridge_hub_config,
constants::fee::WeightToFee,
xcm_config::{RelayNetwork, XcmConfig},
xcm_config::{KsmRelayLocation, RelayNetwork, XcmConfig},
AllPalletsWithoutSystem, Balances, BridgeGrandpaPolkadotInstance,
BridgeRejectObsoleteHeadersAndMessages, ExistentialDeposit, ParachainSystem, PolkadotXcm,
Runtime, RuntimeCall, RuntimeEvent, SessionKeys, WithBridgeHubPolkadotMessagesInstance,
Expand Down Expand Up @@ -184,7 +184,10 @@ fn handle_export_message_from_system_parachain_add_to_outbound_queue_works() {
}
}),
|| ExportMessage { network: Polkadot, destination: X1(Parachain(1234)), xcm: Xcm(vec![]) },
bridge_hub_config::ASSET_HUB_KUSAMA_TO_ASSET_HUB_POLKADOT_LANE_ID
bridge_hub_config::ASSET_HUB_KUSAMA_TO_ASSET_HUB_POLKADOT_LANE_ID,
Some((KsmRelayLocation::get(), ExistentialDeposit::get()).into()),
// value should be >= than value generated by `can_calculate_weight_for_paid_export_message_with_reserve_transfer`
Some((KsmRelayLocation::get(), bp_asset_hub_kusama::BridgeHubKusamaBaseFeeInDots::get()).into()),
)
}

Expand Down Expand Up @@ -263,3 +266,21 @@ pub fn complex_relay_extrinsic_works() {
construct_and_apply_extrinsic,
);
}

#[test]
pub fn can_calculate_weight_for_paid_export_message_with_reserve_transfer() {
let estimated = bridge_hub_test_utils::test_cases::can_calculate_weight_for_paid_export_message_with_reserve_transfer::<
Runtime,
XcmConfig,
WeightToFee,
>();

// check if estimated value is sane
let max_expected = bp_asset_hub_kusama::BridgeHubKusamaBaseFeeInDots::get();
assert!(
estimated <= max_expected,
"calculated: {:?}, max_expected: {:?}, please adjust `bp_asset_hub_kusama::BridgeHubKusamaBaseFeeInDots` value",
estimated,
max_expected
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,15 @@ cumulus-pallet-dmp-queue = { path = "../../../../pallets/dmp-queue", default-fea
cumulus-pallet-parachain-system = { path = "../../../../pallets/parachain-system", default-features = false, features = ["parameterized-consensus-hook",] }
cumulus-pallet-session-benchmarking = { path = "../../../../pallets/session-benchmarking", default-features = false}
cumulus-pallet-xcm = { path = "../../../../pallets/xcm", default-features = false }
cumulus-pallet-xcmp-queue = { path = "../../../../pallets/xcmp-queue", default-features = false }
cumulus-pallet-xcmp-queue = { path = "../../../../pallets/xcmp-queue", default-features = false, features = ["bridging"] }
cumulus-primitives-core = { path = "../../../../primitives/core", default-features = false }
cumulus-primitives-utility = { path = "../../../../primitives/utility", default-features = false }
pallet-collator-selection = { path = "../../../../pallets/collator-selection", default-features = false }
parachain-info = { path = "../../../pallets/parachain-info", default-features = false }
parachains-common = { path = "../../../common", default-features = false }

# Bridges
bp-asset-hub-polkadot = { path = "../../../../bridges/primitives/chain-asset-hub-polkadot", default-features = false }
bp-bridge-hub-kusama = { path = "../../../../bridges/primitives/chain-bridge-hub-kusama", default-features = false }
bp-bridge-hub-polkadot = { path = "../../../../bridges/primitives/chain-bridge-hub-polkadot", default-features = false }
bp-header-chain = { path = "../../../../bridges/primitives/header-chain", default-features = false }
Expand All @@ -97,6 +98,7 @@ sp-keyring = { path = "../../../../../substrate/primitives/keyring" }
[features]
default = [ "std" ]
std = [
"bp-asset-hub-polkadot/std",
"bp-bridge-hub-kusama/std",
"bp-bridge-hub-polkadot/std",
"bp-header-chain/std",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ use bridge_runtime_common::{
RefundableParachain,
},
};
use codec::Encode;
use frame_support::{parameter_types, traits::PalletInfoAccess};
use sp_runtime::RuntimeDebug;
use xcm::{latest::prelude::*, prelude::NetworkId};
Expand All @@ -55,6 +56,28 @@ parameter_types! {
ParentThen(X1(Parachain(AssetHubPolkadotParaId::get().into()))).into(),
ASSET_HUB_POLKADOT_TO_ASSET_HUB_KUSAMA_LANE_ID,
);

pub CongestedMessage: Xcm<()> = sp_std::vec![Transact {
origin_kind: OriginKind::Xcm,
require_weight_at_most: bp_asset_hub_polkadot::XcmBridgeHubRouterTransactCallMaxWeight::get(),
call: bp_asset_hub_polkadot::Call::ToKusamaXcmRouter(
bp_asset_hub_polkadot::XcmBridgeHubRouterCall::report_bridge_status {
bridge_id: Default::default(),
is_congested: true,
}
).encode().into(),
}].into();

pub UncongestedMessage: Xcm<()> = sp_std::vec![Transact {
origin_kind: OriginKind::Xcm,
require_weight_at_most: bp_asset_hub_polkadot::XcmBridgeHubRouterTransactCallMaxWeight::get(),
call: bp_asset_hub_polkadot::Call::ToKusamaXcmRouter(
bp_asset_hub_polkadot::XcmBridgeHubRouterCall::report_bridge_status {
bridge_id: Default::default(),
is_congested: false,
}
).encode().into(),
}].into();
}

/// Proof of messages, coming from BridgeHubKusama.
Expand All @@ -81,10 +104,13 @@ impl XcmBlobHauler for ToBridgeHubKusamaXcmBlobHauler {
type SenderAndLane = FromAssetHubPolkadotToAssetHubKusamaRoute;

type ToSourceChainSender = crate::XcmRouter;
type CongestedMessage = ();
type UncongestedMessage = ();
type CongestedMessage = CongestedMessage;
type UncongestedMessage = UncongestedMessage;
}

/// On messages delivered callback.
pub type OnMessagesDelivered = XcmBlobHaulerAdapter<ToBridgeHubKusamaXcmBlobHauler>;

/// Messaging Bridge configuration for ThisChain -> BridgeHubKusama
pub struct WithBridgeHubKusamaMessageBridge;
impl MessageBridge for WithBridgeHubKusamaMessageBridge {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,15 @@ impl pallet_bridge_messages::Config<WithBridgeHubKusamaMessagesInstance> for Run
DeliveryRewardInBalance,
>;
type SourceHeaderChain = SourceHeaderChainAdapter<WithBridgeHubKusamaMessageBridge>;
type MessageDispatch =
XcmBlobMessageDispatch<OnThisChainBlobDispatcher<UniversalLocation>, Self::WeightInfo, ()>;
type OnMessagesDelivered = ();
type MessageDispatch = XcmBlobMessageDispatch<
OnThisChainBlobDispatcher<UniversalLocation>,
Self::WeightInfo,
cumulus_pallet_xcmp_queue::bridging::OutboundXcmpChannelCongestionStatusProvider<
bridge_hub_config::AssetHubPolkadotParaId,
Runtime,
>,
>;
type OnMessagesDelivered = bridge_hub_config::OnMessagesDelivered;
}

/// Allows collect and claim rewards for relayers
Expand Down Expand Up @@ -943,7 +949,11 @@ impl_runtime_apis! {
type XcmBalances = pallet_xcm_benchmarks::fungible::Pallet::<Runtime>;
type XcmGeneric = pallet_xcm_benchmarks::generic::Pallet::<Runtime>;

use bridge_runtime_common::messages_benchmarking::{prepare_message_delivery_proof_from_parachain, prepare_message_proof_from_parachain};
use bridge_runtime_common::messages_benchmarking::{
generate_xcm_builder_bridge_message_sample,
prepare_message_delivery_proof_from_parachain,
prepare_message_proof_from_parachain
};
use pallet_bridge_messages::benchmarking::{
Config as BridgeMessagesConfig,
Pallet as BridgeMessagesBench,
Expand Down Expand Up @@ -973,7 +983,7 @@ impl_runtime_apis! {
Runtime,
BridgeGrandpaKusamaInstance,
bridge_hub_config::WithBridgeHubKusamaMessageBridge,
>(params, X2(GlobalConsensus(xcm_config::RelayNetwork::get().unwrap()), Parachain(42)))
>(params, generate_xcm_builder_bridge_message_sample(X2(GlobalConsensus(xcm_config::RelayNetwork::get().unwrap()), Parachain(42))))
}
fn prepare_message_delivery_proof(
params: MessageDeliveryProofParams<AccountId>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,6 @@ match_types! {
pub type FellowsPlurality: impl Contains<MultiLocation> = {
MultiLocation { parents: 1, interior: X2(Parachain(1001), Plurality { id: BodyId::Technical, ..}) }
};
// TODO:check-parameter - (https://github.com/paritytech/parity-bridges-common/issues/2084)
// remove this and extend `AllowExplicitUnpaidExecutionFrom` with "or SystemParachains" once merged https://github.com/paritytech/polkadot/pull/7005
pub type SystemParachains: impl Contains<MultiLocation> = {
// Statemint
MultiLocation { parents: 1, interior: X1(Parachain(1000)) } |
// Collectives
MultiLocation { parents: 1, interior: X1(Parachain(1001)) }
};
}

/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
Expand Down Expand Up @@ -196,13 +188,9 @@ pub type Barrier = TrailingSetTopicAsId<
// If the message is one that immediately attemps to pay for execution, then
// allow it.
AllowTopLevelPaidExecutionFrom<Everything>,
// Parent, its pluralities (i.e. governance bodies), the Fellows plurality
// and system parachains get free execution.
AllowExplicitUnpaidExecutionFrom<(
ParentOrParentsPlurality,
FellowsPlurality,
SystemParachains,
)>,
// Parent, its pluralities (i.e. governance bodies) and the Fellows plurality
// get free execution.
AllowExplicitUnpaidExecutionFrom<(ParentOrParentsPlurality, FellowsPlurality)>,
// Subscriptions for version tracking are OK.
AllowSubscriptionsFrom<ParentOrSiblings>,
),
Expand Down
Loading

0 comments on commit 1da09f0

Please sign in to comment.