Skip to content

Commit

Permalink
Backport from polkadot staging: more commits (#2698)
Browse files Browse the repository at this point in the history
* Adjusted constant because for measuring we used mistakenly rococo constants (#2664)

* Adjusted constant because for measuring we used mistakenly rococo constants

* typo

* Nit from `polkadot-sdk` (#2665)

* BHR/BHWE spec_version according to the `polkadot-sdk` (#2668)

* typo (#2690)

* removed unused PARACHAINS_FINALITY_PALLET_NAME constant (#2670)

* backport paritytech/polkadot-sdk#2139 (#2673)

---------

Co-authored-by: Branislav Kontur <[email protected]>
  • Loading branch information
svyatonik and bkontur authored Nov 14, 2023
1 parent 43fc387 commit c868a5e
Show file tree
Hide file tree
Showing 18 changed files with 57 additions and 34 deletions.
4 changes: 0 additions & 4 deletions primitives/chain-asset-hub-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ pub enum Call {
frame_support::parameter_types! {
/// Some sane weight to execute `xcm::Transact(pallet-xcm-bridge-hub-router::Call::report_bridge_status)`.
pub const XcmBridgeHubRouterTransactCallMaxWeight: frame_support::weights::Weight = frame_support::weights::Weight::from_parts(200_000_000, 6144);

/// Base delivery fee to `BridgeHubRococo`.
/// (initially was calculated by test `BridgeHubRococo::can_calculate_weight_for_paid_export_message_with_reserve_transfer` + `33%`)
pub const BridgeHubRococoBaseFeeInRocs: u128 = 1624803349;
}

/// Identifier of AssetHubRococo in the Rococo relay chain.
Expand Down
4 changes: 0 additions & 4 deletions primitives/chain-asset-hub-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ pub enum Call {
frame_support::parameter_types! {
/// Some sane weight to execute `xcm::Transact(pallet-xcm-bridge-hub-router::Call::report_bridge_status)`.
pub const XcmBridgeHubRouterTransactCallMaxWeight: frame_support::weights::Weight = frame_support::weights::Weight::from_parts(200_000_000, 6144);

/// Base delivery fee to `BridgeHubWestend`.
/// (initially was calculated by test `BridgeHubWestend::can_calculate_weight_for_paid_export_message_with_reserve_transfer` + `33%`)
pub const BridgeHubWestendBaseFeeInWocs: u128 = 1624803349;
}

/// Identifier of AssetHubWestend in the Westend relay chain.
Expand Down
4 changes: 0 additions & 4 deletions primitives/chain-asset-hub-wococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ pub enum Call {
frame_support::parameter_types! {
/// Some sane weight to execute `xcm::Transact(pallet-xcm-bridge-hub-router::Call::report_bridge_status)`.
pub const XcmBridgeHubRouterTransactCallMaxWeight: frame_support::weights::Weight = frame_support::weights::Weight::from_parts(200_000_000, 6144);

/// Base delivery fee to `BridgeHubWococo`.
/// (initially was calculated by test `BridgeHubWococo::can_calculate_weight_for_paid_export_message_with_reserve_transfer` + `33%`)
pub const BridgeHubWococoBaseFeeInWocs: u128 = 1624803349;
}

/// Identifier of AssetHubWococo in the Wococo relay chain.
Expand Down
2 changes: 1 addition & 1 deletion primitives/chain-bridge-hub-cumulus/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bp-bridge-hub-cumulus"
description = "Primitives of BridgeHubRococo parachain runtime."
description = "Primitives for BridgeHub parachain runtimes."
version = "0.1.0"
authors.workspace = true
edition.workspace = true
Expand Down
15 changes: 15 additions & 0 deletions primitives/chain-bridge-hub-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,18 @@ pub const WITH_BRIDGE_ROCOCO_TO_WESTEND_MESSAGES_PALLET_INDEX: u8 = 51;

decl_bridge_finality_runtime_apis!(bridge_hub_rococo);
decl_bridge_messages_runtime_apis!(bridge_hub_rococo);

frame_support::parameter_types! {
/// The XCM fee that is paid for executing XCM program (with `ExportMessage` instruction) at the Rococo
/// BridgeHub.
/// (initially was calculated by test `BridgeHubRococo::can_calculate_weight_for_paid_export_message_with_reserve_transfer` + `33%`)
pub const BridgeHubRococoBaseXcmFeeInRocs: u128 = 1628875538;

/// Transaction fee that is paid at the Rococo BridgeHub for delivering single inbound message.
/// (initially was calculated by test `BridgeHubRococo::can_calculate_fee_for_complex_message_delivery_transaction` + `33%`)
pub const BridgeHubRococoBaseDeliveryFeeInRocs: u128 = 6417262881;

/// Transaction fee that is paid at the Rococo BridgeHub for delivering single outbound message confirmation.
/// (initially was calculated by test `BridgeHubRococo::can_calculate_fee_for_complex_message_confirmation_transaction` + `33%`)
pub const BridgeHubRococoBaseConfirmationFeeInRocs: u128 = 6159996668;
}
15 changes: 15 additions & 0 deletions primitives/chain-bridge-hub-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,18 @@ pub const WITH_BRIDGE_WESTEND_TO_ROCOCO_MESSAGES_PALLET_INDEX: u8 = 44;

decl_bridge_finality_runtime_apis!(bridge_hub_westend);
decl_bridge_messages_runtime_apis!(bridge_hub_westend);

frame_support::parameter_types! {
/// The XCM fee that is paid for executing XCM program (with `ExportMessage` instruction) at the Westend
/// BridgeHub.
/// (initially was calculated by test `BridgeHubWestend::can_calculate_weight_for_paid_export_message_with_reserve_transfer` + `33%`)
pub const BridgeHubWestendBaseXcmFeeInWnds: u128 = 488662666666;

/// Transaction fee that is paid at the Westend BridgeHub for delivering single inbound message.
/// (initially was calculated by test `BridgeHubWestend::can_calculate_fee_for_complex_message_delivery_transaction` + `33%`)
pub const BridgeHubWestendBaseDeliveryFeeInWnds: u128 = 1925196628010;

/// Transaction fee that is paid at the Westend BridgeHub for delivering single outbound message confirmation.
/// (initially was calculated by test `BridgeHubWestend::can_calculate_fee_for_complex_message_confirmation_transaction` + `33%`)
pub const BridgeHubWestendBaseConfirmationFeeInWnds: u128 = 1848016628010;
}
15 changes: 15 additions & 0 deletions primitives/chain-bridge-hub-wococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,18 @@ pub const WITH_BRIDGE_WOCOCO_TO_ROCOCO_MESSAGES_PALLET_INDEX: u8 = 45;

decl_bridge_finality_runtime_apis!(bridge_hub_wococo);
decl_bridge_messages_runtime_apis!(bridge_hub_wococo);

frame_support::parameter_types! {
/// The XCM fee that is paid for executing XCM program (with `ExportMessage` instruction) at the Wococo
/// BridgeHub.
/// (initially was calculated by test `BridgeHubWococo::can_calculate_weight_for_paid_export_message_with_reserve_transfer` + `33%`)
pub const BridgeHubWococoBaseXcmFeeInWocs: u128 = 1624803349;

/// Transaction fee that is paid at the Wococo BridgeHub for delivering single inbound message.
/// (initially was calculated by test `BridgeHubWococo::can_calculate_fee_for_complex_message_delivery_transaction` + `33%`)
pub const BridgeHubWococoBaseDeliveryFeeInWocs: u128 = 6417262881;

/// Transaction fee that is paid at the Wococo BridgeHub for delivering single outbound message confirmation.
/// (initially was calculated by test `BridgeHubWococo::can_calculate_fee_for_complex_message_confirmation_transaction` + `33%`)
pub const BridgeHubWococoBaseConfirmationFeeInWocs: u128 = 6159996668;
}
5 changes: 3 additions & 2 deletions primitives/chain-polkadot-bulletin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name = "bp-polkadot-bulletin"
description = "Primitives of Polkadot Bulletin chain runtime."
version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
Expand Down Expand Up @@ -35,6 +35,7 @@ std = [
"codec/std",
"frame-support/std",
"frame-system/std",
"scale-info/std",
"sp-api/std",
"sp-runtime/std",
"sp-std/std",
Expand Down
4 changes: 2 additions & 2 deletions primitives/chain-westend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
name = "bp-westend"
description = "Primitives of Westend runtime."
version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion relays/bin-substrate/src/chains/rococo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ impl CliChain for Rococo {

impl CliChain for BridgeHubRococo {
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> =
Some(SimpleRuntimeVersion { spec_version: 9420, transaction_version: 3 });
Some(SimpleRuntimeVersion { spec_version: 1_003_000, transaction_version: 3 });
}
2 changes: 1 addition & 1 deletion relays/bin-substrate/src/chains/westend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ impl CliChain for Westend {

impl CliChain for BridgeHubWestend {
const RUNTIME_VERSION: Option<SimpleRuntimeVersion> =
Some(SimpleRuntimeVersion { spec_version: 10000, transaction_version: 3 });
Some(SimpleRuntimeVersion { spec_version: 1_003_000, transaction_version: 3 });
}
1 change: 0 additions & 1 deletion relays/client-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ impl ChainWithBalances for Kusama {

impl RelayChain for Kusama {
const PARAS_PALLET_NAME: &'static str = bp_kusama::PARAS_PALLET_NAME;
const PARACHAINS_FINALITY_PALLET_NAME: &'static str = "BridgeKusamaParachain";
}

impl ChainWithTransactions for Kusama {
Expand Down
1 change: 0 additions & 1 deletion relays/client-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ impl ChainWithBalances for Polkadot {

impl RelayChain for Polkadot {
const PARAS_PALLET_NAME: &'static str = bp_polkadot::PARAS_PALLET_NAME;
const PARACHAINS_FINALITY_PALLET_NAME: &'static str = "BridgePolkadotParachain";
}

impl ChainWithTransactions for Polkadot {
Expand Down
1 change: 0 additions & 1 deletion relays/client-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ impl ChainWithBalances for Rococo {

impl RelayChain for Rococo {
const PARAS_PALLET_NAME: &'static str = bp_rococo::PARAS_PALLET_NAME;
const PARACHAINS_FINALITY_PALLET_NAME: &'static str = "BridgeRococoParachains";
}

impl ChainWithTransactions for Rococo {
Expand Down
6 changes: 0 additions & 6 deletions relays/client-substrate/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,6 @@ pub trait Chain: ChainBase + Clone {
pub trait RelayChain: Chain {
/// Name of the `runtime_parachains::paras` pallet in the runtime of this chain.
const PARAS_PALLET_NAME: &'static str;
/// Name of the bridge parachains pallet (used in `construct_runtime` macro call) that is
/// deployed at the **bridged** chain.
///
/// We assume that all chains that are bridging with this `RelayChain` are using
/// the same name.
const PARACHAINS_FINALITY_PALLET_NAME: &'static str;
}

/// Substrate-based chain that is using direct GRANDPA finality from minimal relay-client point of
Expand Down
1 change: 0 additions & 1 deletion relays/client-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ impl ChainWithGrandpa for Westend {

impl RelayChain for Westend {
const PARAS_PALLET_NAME: &'static str = bp_westend::PARAS_PALLET_NAME;
const PARACHAINS_FINALITY_PALLET_NAME: &'static str = "BridgeWestendParachains";
}

impl ChainWithBalances for Westend {
Expand Down
1 change: 0 additions & 1 deletion relays/client-wococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ impl ChainWithBalances for Wococo {

impl RelayChain for Wococo {
const PARAS_PALLET_NAME: &'static str = bp_wococo::PARAS_PALLET_NAME;
const PARACHAINS_FINALITY_PALLET_NAME: &'static str = "BridgeWococoParachains";
}

impl ChainWithTransactions for Wococo {
Expand Down
8 changes: 4 additions & 4 deletions zombienet/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Bridges Tests for Local Rococo <> Wococo Bridge
# Bridges Tests for Local Rococo <> Wococo Bridge

This folder contains [zombienet](https://github.com/paritytech/zombienet/) based integration tests for both
onchain and offchain bridges code. Due to some
Expand All @@ -9,16 +9,16 @@ To start those tests, you need to:

- download latest [zombienet release](https://github.com/paritytech/zombienet/releases);

- build polkadot binary by running `cargo build -p polkadot --release` command in the
- build Polkadot binary by running `cargo build -p polkadot --release` command in the
[`polkadot-sdk`](https://github.com/paritytech/polkadot-sdk) repository clone;

- build polkadot binary by running `cargo build -p polkadot-parachain-bin --release` command in the
- build Polkadot Parachain binary by running `cargo build -p polkadot-parachain-bin --release` command in the
[`polkadot-sdk`](https://github.com/paritytech/polkadot-sdk) repository clone;

- ensure that you have [`node`](https://nodejs.org/en) installed. Additionally, we'll need globally installed
`polkadot/api-cli` package (use `npm install -g @polkadot/api-cli@beta` to install it);

- build substrate relay by running `cargo build -p substrate-relay --release` command in the
- build Substrate relay by running `cargo build -p substrate-relay --release` command in the
[`parity-bridges-common`](https://github.com/paritytech/parity-bridges-common) repository clone.

- copy fresh `substrate-relay` binary, built in previous point, to the `~/local_bridge_testing/bin/substrate-relay`;
Expand Down

0 comments on commit c868a5e

Please sign in to comment.