diff --git a/Cargo.lock b/Cargo.lock index 74fb36634eb..60634180d8e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1013,6 +1013,7 @@ dependencies = [ "bp-messages", "bp-parachains", "bp-polkadot-core", + "bp-relayers", "bp-rococo", "bp-runtime", "bp-wococo", @@ -1089,6 +1090,7 @@ dependencies = [ "bp-messages", "bp-polkadot-core", "bp-runtime", + "bp-test-utils", "cumulus-pallet-parachain-system", "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", diff --git a/Cargo.toml b/Cargo.toml index ed6e6478e90..87050f03b7f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,6 +8,7 @@ members = [ "bridges/modules/parachains", "bridges/modules/relayers", "bridges/primitives/messages", + "bridges/primitives/relayers", "bridges/primitives/runtime", "bridges/primitives/chain-bridge-hub-rococo", "bridges/primitives/chain-bridge-hub-wococo", diff --git a/docs/release.md b/docs/release.md index 2b7c79c50be..9c0a6acc0e9 100644 --- a/docs/release.md +++ b/docs/release.md @@ -123,7 +123,7 @@ for `release-parachains-v0.9.270` 5. Clone `it/release--fast-sudo` from Polkadot In case the branch does not exists (it is a manual process): cherry pick paritytech/polkadot@791c8b8 and run `find . -type f -name "*.toml" -print0 | xargs -0 sed -i '' -e 's/polkadot-vX.X.X/polkadot-v/g'` -6. `cargo build --release features --fast-runtime` +6. `cargo build --release --features fast-runtime` 7. Copy `./target/polkadot` into `./bin` (in Cumulus) 8. Run the tests: - Statemint: `yarn zombienet-test -c ./examples/statemint/config.toml -t ./examples/statemint` diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml index 45e782643ba..7e32cdcf585 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/Cargo.toml @@ -77,6 +77,7 @@ bp-bridge-hub-wococo = { path = "../../../../bridges/primitives/chain-bridge-hub bp-messages = { path = "../../../../bridges/primitives/messages", default-features = false } bp-parachains = { path = "../../../../bridges/primitives/parachains", default-features = false } bp-polkadot-core = { path = "../../../../bridges/primitives/polkadot-core", default-features = false } +bp-relayers = { path = "../../../../bridges/primitives/relayers", default-features = false } bp-runtime = { path = "../../../../bridges/primitives/runtime", default-features = false } bp-rococo = { path = "../../../../bridges/primitives/chain-rococo", default-features = false } bp-wococo = { path = "../../../../bridges/primitives/chain-wococo", default-features = false } @@ -101,6 +102,7 @@ std = [ "bp-messages/std", "bp-parachains/std", "bp-polkadot-core/std", + "bp-relayers/std", "bp-runtime/std", "bp-rococo/std", "bp-wococo/std", diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_rococo_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_rococo_config.rs index 41efbcb031e..9df6d5a782d 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_rococo_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_rococo_config.rs @@ -28,6 +28,10 @@ use bridge_runtime_common::{ source::FromBridgedChainMessagesDeliveryProof, target::FromBridgedChainMessagesProof, MessageBridge, ThisChainWithMessages, UnderlyingChainProvider, }, + refund_relayer_extension::{ + ActualFeeRefund, RefundBridgedParachainMessages, RefundableMessagesLane, + RefundableParachain, + }, }; use frame_support::{parameter_types, RuntimeDebug}; use xcm::{ @@ -87,7 +91,7 @@ const DEFAULT_XCM_LANE_TO_BRIDGE_HUB_WOCOCO: LaneId = LaneId([0, 0, 0, 1]); pub struct WithBridgeHubWococoMessageBridge; impl MessageBridge for WithBridgeHubWococoMessageBridge { const THIS_CHAIN_ID: ChainId = bp_runtime::BRIDGE_HUB_ROCOCO_CHAIN_ID; - const BRIDGED_CHAIN_ID: ChainId = bp_runtime::BRIDGE_HUB_WOCOCO_CHAIN_ID; + const BRIDGED_CHAIN_ID: ChainId = BridgeHubWococoChainId::get(); const BRIDGED_MESSAGES_PALLET_NAME: &'static str = bp_bridge_hub_rococo::WITH_BRIDGE_HUB_ROCOCO_MESSAGES_PALLET_NAME; type ThisChain = BridgeHubRococo; @@ -147,6 +151,24 @@ impl ThisChainWithMessages for BridgeHubRococo { } } +/// Signed extension that refunds relayers that are delivering messages from the Wococo parachain. +pub type BridgeRefundBridgeHubWococoMessages = RefundBridgedParachainMessages< + Runtime, + RefundableParachain, + RefundableMessagesLane, + ActualFeeRefund, + StrBridgeRefundBridgeHubWococoMessages, +>; +bp_runtime::generate_static_str_provider!(BridgeRefundBridgeHubWococoMessages); + +parameter_types! { + pub const BridgeHubWococoMessagesLane: bp_messages::LaneId = DEFAULT_XCM_LANE_TO_BRIDGE_HUB_WOCOCO; + pub const BridgeHubWococoParachainId: u32 = { + use bp_runtime::Parachain; + BridgeHubWococo::PARACHAIN_ID + }; +} + #[cfg(test)] mod tests { use super::*; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_wococo_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_wococo_config.rs index cc18d510a43..3c574c9040f 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_wococo_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_hub_wococo_config.rs @@ -28,6 +28,10 @@ use bridge_runtime_common::{ source::FromBridgedChainMessagesDeliveryProof, target::FromBridgedChainMessagesProof, MessageBridge, ThisChainWithMessages, UnderlyingChainProvider, }, + refund_relayer_extension::{ + ActualFeeRefund, RefundBridgedParachainMessages, RefundableMessagesLane, + RefundableParachain, + }, }; use frame_support::{parameter_types, RuntimeDebug}; use xcm::{ @@ -87,7 +91,7 @@ const DEFAULT_XCM_LANE_TO_BRIDGE_HUB_ROCOCO: LaneId = LaneId([0, 0, 0, 1]); pub struct WithBridgeHubRococoMessageBridge; impl MessageBridge for WithBridgeHubRococoMessageBridge { const THIS_CHAIN_ID: ChainId = bp_runtime::BRIDGE_HUB_WOCOCO_CHAIN_ID; - const BRIDGED_CHAIN_ID: ChainId = bp_runtime::BRIDGE_HUB_ROCOCO_CHAIN_ID; + const BRIDGED_CHAIN_ID: ChainId = BridgeHubRococoChainId::get(); const BRIDGED_MESSAGES_PALLET_NAME: &'static str = bp_bridge_hub_wococo::WITH_BRIDGE_HUB_WOCOCO_MESSAGES_PALLET_NAME; type ThisChain = BridgeHubWococo; @@ -147,6 +151,24 @@ impl ThisChainWithMessages for BridgeHubWococo { } } +/// Signed extension that refunds relayers that are delivering messages from the Rococo parachain. +pub type BridgeRefundBridgeHubRococoMessages = RefundBridgedParachainMessages< + Runtime, + RefundableParachain, + RefundableMessagesLane, + ActualFeeRefund, + StrBridgeRefundBridgeHubRococoMessages, +>; +bp_runtime::generate_static_str_provider!(BridgeRefundBridgeHubRococoMessages); + +parameter_types! { + pub const BridgeHubRococoMessagesLane: bp_messages::LaneId = DEFAULT_XCM_LANE_TO_BRIDGE_HUB_ROCOCO; + pub const BridgeHubRococoParachainId: u32 = { + use bp_runtime::Parachain; + BridgeHubRococo::PARACHAIN_ID + }; +} + #[cfg(test)] mod tests { use super::*; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs index 8f8dadfd1d4..c768477c8bb 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs @@ -73,8 +73,14 @@ use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate}; use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight}; use crate::{ - bridge_hub_rococo_config::{OnBridgeHubRococoBlobDispatcher, WithBridgeHubWococoMessageBridge}, - bridge_hub_wococo_config::{OnBridgeHubWococoBlobDispatcher, WithBridgeHubRococoMessageBridge}, + bridge_hub_rococo_config::{ + BridgeRefundBridgeHubWococoMessages, OnBridgeHubRococoBlobDispatcher, + WithBridgeHubWococoMessageBridge, + }, + bridge_hub_wococo_config::{ + BridgeRefundBridgeHubRococoMessages, OnBridgeHubWococoBlobDispatcher, + WithBridgeHubRococoMessageBridge, + }, constants::fee::WeightToFee, xcm_config::XcmRouter, }; @@ -113,6 +119,7 @@ pub type SignedExtra = ( frame_system::CheckWeight, pallet_transaction_payment::ChargeTransactionPayment, BridgeRejectObsoleteHeadersAndMessages, + (BridgeRefundBridgeHubRococoMessages, BridgeRefundBridgeHubWococoMessages), ); /// Unchecked extrinsic type as expected by this runtime. @@ -398,7 +405,7 @@ impl pallet_bridge_grandpa::Config for Runtime { type WeightInfo = weights::pallet_bridge_grandpa_bridge_wococo_grandpa::WeightInfo; } -/// Add granda bridge pallet to track Rococo relay chain +/// Add granda bridge pallet to track Rococo relay chain on Wococo BridgeHub pub type BridgeGrandpaRococoInstance = pallet_bridge_grandpa::Instance2; impl pallet_bridge_grandpa::Config for Runtime { type BridgedChain = bp_rococo::Rococo; @@ -407,17 +414,19 @@ impl pallet_bridge_grandpa::Config for Runtime { type WeightInfo = weights::pallet_bridge_grandpa_bridge_rococo_grandpa::WeightInfo; } -pub const ROCOCO_BRIDGE_PARA_PALLET_NAME: &str = "Paras"; -pub const WOCOCO_BRIDGE_PARA_PALLET_NAME: &str = "Paras"; parameter_types! { pub const RelayChainHeadersToKeep: u32 = 1024; pub const ParachainHeadsToKeep: u32 = 64; pub const MaxRequests: u32 = 64; - pub const RococoBridgeParachainPalletName: &'static str = ROCOCO_BRIDGE_PARA_PALLET_NAME; - pub const WococoBridgeParachainPalletName: &'static str = WOCOCO_BRIDGE_PARA_PALLET_NAME; + pub const RococoBridgeParachainPalletName: &'static str = "Paras"; + pub const WococoBridgeParachainPalletName: &'static str = "Paras"; pub const MaxRococoParaHeadDataSize: u32 = bp_rococo::MAX_NESTED_PARACHAIN_HEAD_DATA_SIZE; pub const MaxWococoParaHeadDataSize: u32 = bp_wococo::MAX_NESTED_PARACHAIN_HEAD_DATA_SIZE; + + // TODO:check-parameter - setup initial values https://github.com/paritytech/parity-bridges-common/issues/1677 + pub storage DeliveryRewardInBalance: u64 = 1_000_000; + pub storage ConfirmationRewardInBalance: u64 = 100_000; } /// Add parachain bridge pallet to track Wococo bridge hub parachain @@ -464,13 +473,15 @@ impl pallet_bridge_messages::Config for Run type InboundPayload = XcmAsPlainPayload; type InboundRelayer = AccountId; - // TODO:check-parameter - check delivery type DeliveryPayments = (); type TargetHeaderChain = TargetHeaderChainAdapter; type LaneMessageVerifier = bridge_hub_rococo_config::ToBridgeHubWococoMessageVerifier; - // TODO:check-parameter - check delivery - type DeliveryConfirmationPayments = (); + type DeliveryConfirmationPayments = pallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter< + Runtime, + DeliveryRewardInBalance, + ConfirmationRewardInBalance, + >; type SourceHeaderChain = SourceHeaderChainAdapter; type MessageDispatch = XcmBlobMessageDispatch< @@ -498,13 +509,15 @@ impl pallet_bridge_messages::Config for Run type InboundPayload = XcmAsPlainPayload; type InboundRelayer = AccountId; - // TODO:check-parameter - check delivery type DeliveryPayments = (); type TargetHeaderChain = TargetHeaderChainAdapter; type LaneMessageVerifier = bridge_hub_wococo_config::ToBridgeHubRococoMessageVerifier; - // TODO:check-parameter - check delivery - type DeliveryConfirmationPayments = (); + type DeliveryConfirmationPayments = pallet_bridge_relayers::DeliveryConfirmationPaymentsAdapter< + Runtime, + DeliveryRewardInBalance, + ConfirmationRewardInBalance, + >; type SourceHeaderChain = SourceHeaderChainAdapter; type MessageDispatch = XcmBlobMessageDispatch< @@ -514,6 +527,15 @@ impl pallet_bridge_messages::Config for Run >; } +/// Allows collect and claim rewards for relayers +impl pallet_bridge_relayers::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type Reward = Balance; + type PaymentProcedure = + bp_relayers::PayLaneRewardFromAccount, AccountId>; + type WeightInfo = weights::pallet_bridge_relayers::WeightInfo; +} + // Create the runtime by composing the FRAME pallets that were previously configured. construct_runtime!( pub enum Runtime where @@ -564,6 +586,8 @@ construct_runtime!( BridgeRococoGrandpa: pallet_bridge_grandpa::::{Pallet, Call, Storage, Config} = 43, BridgeRococoParachain: pallet_bridge_parachains::::{Pallet, Call, Storage, Event} = 44, BridgeRococoMessages: pallet_bridge_messages::::{Pallet, Call, Storage, Event, Config} = 45, + + BridgeRelayers: pallet_bridge_relayers::{Pallet, Call, Storage, Event} = 47, } ); @@ -606,6 +630,8 @@ mod benches { [pallet_bridge_grandpa, BridgeRococoGrandpa] [pallet_bridge_parachains, BridgeParachainsBench::] [pallet_bridge_messages, BridgeMessagesBench::] + // Bridge relayer pallets + [pallet_bridge_relayers, BridgeRelayersBench::] ); } @@ -841,6 +867,7 @@ impl_runtime_apis! { use pallet_bridge_parachains::benchmarking::Pallet as BridgeParachainsBench; use pallet_bridge_messages::benchmarking::Pallet as BridgeMessagesBench; + use pallet_bridge_relayers::benchmarking::Pallet as BridgeRelayersBench; let mut list = Vec::::new(); list_benchmarks!(list, extra); @@ -950,9 +977,9 @@ impl_runtime_apis! { }; impl BridgeMessagesConfig for Runtime { - fn is_relayer_rewarded(_: &Self::AccountId) -> bool { - // TODO: implement me properly - true + fn is_relayer_rewarded(relayer: &Self::AccountId) -> bool { + let bench_lane_id = >::bench_lane_id(); + pallet_bridge_relayers::Pallet::::relayer_reward(relayer, &bench_lane_id).is_some() } fn prepare_message_proof( @@ -977,9 +1004,9 @@ impl_runtime_apis! { } impl BridgeMessagesConfig for Runtime { - fn is_relayer_rewarded(_: &Self::AccountId) -> bool { - // TODO: implement me properly - true + fn is_relayer_rewarded(relayer: &Self::AccountId) -> bool { + let bench_lane_id = >::bench_lane_id(); + pallet_bridge_relayers::Pallet::::relayer_reward(relayer, &bench_lane_id).is_some() } fn prepare_message_proof( @@ -1008,6 +1035,10 @@ impl_runtime_apis! { Config as BridgeParachainsConfig, Pallet as BridgeParachainsBench, }; + use pallet_bridge_relayers::benchmarking::{ + Pallet as BridgeRelayersBench, + Config as BridgeRelayersConfig, + }; impl BridgeParachainsConfig for Runtime { fn parachains() -> Vec { @@ -1057,6 +1088,20 @@ impl_runtime_apis! { } } + impl BridgeRelayersConfig for Runtime { + fn prepare_environment( + lane: bp_messages::LaneId, + reward: Balance, + ) { + use frame_support::traits::fungible::Mutate; + let lane_rewards_account = bp_relayers::PayLaneRewardFromAccount::< + Balances, + AccountId + >::lane_rewards_account(lane); + Balances::mint_into(&lane_rewards_account, reward).unwrap(); + } + } + let whitelist: Vec = vec![ // Block Number hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(), @@ -1111,37 +1156,48 @@ cumulus_pallet_parachain_system::register_validate_block! { #[cfg(test)] mod tests { use super::*; - use bridge_runtime_common::integrity::check_additional_signed; + use bp_runtime::TransactionEra; + use bridge_hub_test_utils::test_header; use codec::Encode; - use sp_runtime::generic::Era; #[test] - fn ensure_signed_extension_definition_is_correct() { + fn ensure_signed_extension_definition_is_compatible_with_relay() { let payload: SignedExtra = ( frame_system::CheckNonZeroSender::new(), frame_system::CheckSpecVersion::new(), frame_system::CheckTxVersion::new(), frame_system::CheckGenesis::new(), - frame_system::CheckEra::from(Era::Immortal), + frame_system::CheckEra::from(sp_runtime::generic::Era::Immortal), frame_system::CheckNonce::from(10), frame_system::CheckWeight::new(), pallet_transaction_payment::ChargeTransactionPayment::from(10), BridgeRejectObsoleteHeadersAndMessages {}, + ( + BridgeRefundBridgeHubRococoMessages::default(), + BridgeRefundBridgeHubWococoMessages::default(), + ), ); - let bhr_indirect_payload = bp_bridge_hub_rococo::SignedExtension::new( - ((), (), (), (), Era::Immortal, 10.into(), (), 10.into(), ()), - None, - ); + let bhr_indirect_payload = + bp_bridge_hub_rococo::rewarding_bridge_signed_extension::from_params( + 10, + 10, + TransactionEra::Immortal, + test_header::(1).hash(), + 10, + 10, + ); assert_eq!(payload.encode(), bhr_indirect_payload.encode()); - let bhw_indirect_payload = bp_bridge_hub_wococo::SignedExtension::new( - ((), (), (), (), Era::Immortal, 10.into(), (), 10.into(), ()), - None, - ); + let bhw_indirect_payload = + bp_bridge_hub_wococo::rewarding_bridge_signed_extension::from_params( + 10, + 10, + TransactionEra::Immortal, + test_header::(1).hash(), + 10, + 10, + ); assert_eq!(payload.encode(), bhw_indirect_payload.encode()); - - check_additional_signed::(); - check_additional_signed::(); } } diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs index 1eec4e5c18a..59f3932ad2b 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/mod.rs @@ -28,6 +28,7 @@ pub mod pallet_bridge_messages_bridge_messages_bench_runtime_with_bridge_hub_roc pub mod pallet_bridge_messages_bridge_messages_bench_runtime_with_bridge_hub_wococo_messages_instance; pub mod pallet_bridge_parachains_bridge_parachains_bench_runtime_bridge_parachain_rococo_instance; pub mod pallet_bridge_parachains_bridge_parachains_bench_runtime_bridge_parachain_wococo_instance; +pub mod pallet_bridge_relayers; pub mod pallet_collator_selection; pub mod pallet_multisig; pub mod pallet_session; diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_relayers.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_relayers.rs new file mode 100644 index 00000000000..c81dfbc14c8 --- /dev/null +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/pallet_bridge_relayers.rs @@ -0,0 +1,65 @@ +// Copyright 2021 Parity Technologies (UK) Ltd. +// This file is part of Cumulus. + +// Cumulus is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Cumulus is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Cumulus. If not, see . + +//! Autogenerated weights for `pallet_bridge_relayers` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2023-02-16, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `runner-osnnfcqu-project-238-concurrent-0`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz` +//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("bridge-hub-rococo-dev"), DB CACHE: 1024 + +// Executed Command: +// target/production/polkadot-parachain +// benchmark +// pallet +// --steps=50 +// --repeat=20 +// --extrinsic=* +// --execution=wasm +// --wasm-execution=compiled +// --heap-pages=4096 +// --json-file=/builds/parity/mirrors/cumulus/.git/.artifacts/bench.json +// --pallet=pallet_bridge_relayers +// --chain=bridge-hub-rococo-dev +// --header=./file_header.txt +// --output=./parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/weights/ + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] + +use frame_support::{traits::Get, weights::Weight}; +use sp_std::marker::PhantomData; + +/// Weight functions for `pallet_bridge_relayers`. +pub struct WeightInfo(PhantomData); +impl pallet_bridge_relayers::WeightInfo for WeightInfo { + /// Storage: BridgeRelayers RelayerRewards (r:1 w:1) + /// Proof: BridgeRelayers RelayerRewards (max_values: None, max_size: Some(68), added: 2543, mode: MaxEncodedLen) + /// Storage: System Account (r:1 w:1) + /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) + fn claim_rewards() -> Weight { + // Proof Size summary in bytes: + // Measured: `271` + // Estimated: `5146` + // Minimum execution time: 37_598 nanoseconds. + Weight::from_ref_time(38_726_000) + .saturating_add(Weight::from_proof_size(5146)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(2)) + } +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs index 8885641a57e..da3e6634434 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/tests/tests.rs @@ -265,3 +265,5 @@ fn can_govornance_call_xcm_transact_with_initialize_bridge_on_bridge_hub_wococo( ); }) } + +// TODO:check-parameter - add test for DeliveryConfirmationPayments when receive_messages_delivery_proof diff --git a/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml b/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml index fb2126d6192..123bbfb501a 100644 --- a/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml +++ b/parachains/runtimes/bridge-hubs/test-utils/Cargo.toml @@ -33,6 +33,7 @@ bp-header-chain = { path = "../../../../bridges/primitives/header-chain", defaul bp-messages = { path = "../../../../bridges/primitives/messages", default-features = false } bp-polkadot-core = { path = "../../../../bridges/primitives/polkadot-core", default-features = false } bp-runtime = { path = "../../../../bridges/primitives/runtime", default-features = false } +bp-test-utils = { path = "../../../../bridges/primitives/test-utils", default-features = false } [features] default = [ "std" ] @@ -43,6 +44,7 @@ std = [ "bp-polkadot-core/std", "bp-header-chain/std", "bp-runtime/std", + "bp-test-utils/std", "parachains-common/std", "parachain-info/std", "cumulus-primitives-core/std", diff --git a/parachains/runtimes/bridge-hubs/test-utils/src/lib.rs b/parachains/runtimes/bridge-hubs/test-utils/src/lib.rs index a95b54ea62e..0605677c4df 100644 --- a/parachains/runtimes/bridge-hubs/test-utils/src/lib.rs +++ b/parachains/runtimes/bridge-hubs/test-utils/src/lib.rs @@ -33,6 +33,8 @@ use xcm::{latest::prelude::*, prelude::XcmVersion}; use xcm_builder::{HaulBlob, HaulBlobError, HaulBlobExporter}; use xcm_executor::traits::{validate_export, ExportXcm}; +pub use bp_test_utils::test_header; + /// Dummy xcm pub fn dummy_xcm() -> Xcm<()> { vec![Trap(42)].into() diff --git a/scripts/benchmarks-ci.sh b/scripts/benchmarks-ci.sh index bf08522c7c1..f283c678345 100755 --- a/scripts/benchmarks-ci.sh +++ b/scripts/benchmarks-ci.sh @@ -67,6 +67,7 @@ elif [[ $runtimeName == "bridge-hub-rococo" ]]; then pallet_bridge_grandpa pallet_bridge_parachains pallet_bridge_messages + pallet_bridge_relayers ) else echo "$runtimeName pallet list not found in benchmarks-ci.sh"