Backport latest PRs from polkadot sdk (#2824)

* backport https://github.com/paritytech/polkadot-sdk/pull/3034

* backport https://github.com/paritytech/polkadot-sdk/pull/3072

* backport https://github.com/paritytech/polkadot-sdk/pull/3175

* backport https://github.com/paritytech/polkadot-sdk/pull/2949

* Cargo.lock

* fix invalid copypaste
This commit is contained in:
Svyatoslav Nikolsky
2024-02-06 13:17:28 +03:00
committed by Bastian Köcher
parent d713ef174e
commit 67a1c9a9e6
31 changed files with 59 additions and 33 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "bridge-runtime-common" name = "bridge-runtime-common"
version = "0.1.0" version = "0.7.0"
description = "Common types and functions that may be used by substrate-based runtimes of all bridged chains" description = "Common types and functions that may be used by substrate-based runtimes of all bridged chains"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "pallet-bridge-grandpa" name = "pallet-bridge-grandpa"
version = "0.1.0" version = "0.7.0"
description = "Module implementing GRANDPA on-chain light client used for bridging consensus of substrate-based chains." description = "Module implementing GRANDPA on-chain light client used for bridging consensus of substrate-based chains."
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "pallet-bridge-messages" name = "pallet-bridge-messages"
description = "Module that allows bridged chains to exchange messages using lane concept." description = "Module that allows bridged chains to exchange messages using lane concept."
version = "0.1.0" version = "0.7.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "pallet-bridge-parachains" name = "pallet-bridge-parachains"
version = "0.1.0" version = "0.7.0"
description = "Module that allows bridged relay chains to exchange information on their parachains' heads." description = "Module that allows bridged relay chains to exchange information on their parachains' heads."
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "pallet-bridge-relayers" name = "pallet-bridge-relayers"
description = "Module used to store relayer rewards and coordinate relayers set." description = "Module used to store relayer rewards and coordinate relayers set."
version = "0.1.0" version = "0.7.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
@@ -1,7 +1,7 @@
[package] [package]
name = "pallet-xcm-bridge-hub-router" name = "pallet-xcm-bridge-hub-router"
description = "Bridge hub interface for sibling/parent chains with dynamic fees support." description = "Bridge hub interface for sibling/parent chains with dynamic fees support."
version = "0.1.0" version = "0.5.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "pallet-xcm-bridge-hub" name = "pallet-xcm-bridge-hub"
description = "Module that adds dynamic bridges/lanes support to XCM infrastucture at the bridge hub." description = "Module that adds dynamic bridges/lanes support to XCM infrastucture at the bridge hub."
version = "0.1.0" version = "0.2.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-asset-hub-rococo" name = "bp-asset-hub-rococo"
description = "Primitives of AssetHubRococo parachain runtime." description = "Primitives of AssetHubRococo parachain runtime."
version = "0.1.0" version = "0.4.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-asset-hub-westend" name = "bp-asset-hub-westend"
description = "Primitives of AssetHubWestend parachain runtime." description = "Primitives of AssetHubWestend parachain runtime."
version = "0.1.0" version = "0.3.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-bridge-hub-cumulus" name = "bp-bridge-hub-cumulus"
description = "Primitives for BridgeHub parachain runtimes." description = "Primitives for BridgeHub parachain runtimes."
version = "0.1.0" version = "0.7.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
@@ -57,6 +57,12 @@ const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(constants::WEIGHT_REF_TI
.saturating_div(2) .saturating_div(2)
.set_proof_size(polkadot_primitives::MAX_POV_SIZE as u64); .set_proof_size(polkadot_primitives::MAX_POV_SIZE as u64);
/// We allow for 2 seconds of compute with a 6 second average block.
const MAXIMUM_BLOCK_WEIGHT_FOR_ASYNC_BACKING: Weight = Weight::from_parts(
constants::WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2),
polkadot_primitives::MAX_POV_SIZE as u64,
);
/// All cumulus bridge hubs assume that about 5 percent of the block weight is consumed by /// All cumulus bridge hubs assume that about 5 percent of the block weight is consumed by
/// `on_initialize` handlers. This is used to limit the maximal weight of a single extrinsic. /// `on_initialize` handlers. This is used to limit the maximal weight of a single extrinsic.
/// ///
@@ -96,6 +102,26 @@ parameter_types! {
}) })
.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO) .avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
.build_or_panic(); .build_or_panic();
/// Weight limit of the Cumulus-based bridge hub blocks when async backing is enabled.
pub BlockWeightsForAsyncBacking: limits::BlockWeights = limits::BlockWeights::builder()
.base_block(BlockExecutionWeight::get())
.for_class(DispatchClass::all(), |weights| {
weights.base_extrinsic = ExtrinsicBaseWeight::get();
})
.for_class(DispatchClass::Normal, |weights| {
weights.max_total = Some(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT_FOR_ASYNC_BACKING);
})
.for_class(DispatchClass::Operational, |weights| {
weights.max_total = Some(MAXIMUM_BLOCK_WEIGHT_FOR_ASYNC_BACKING);
// Operational transactions have an extra reserved space, so that they
// are included even if block reached `MAXIMUM_BLOCK_WEIGHT_FOR_ASYNC_BACKING`.
weights.reserved = Some(
MAXIMUM_BLOCK_WEIGHT_FOR_ASYNC_BACKING - NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT_FOR_ASYNC_BACKING,
);
})
.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
.build_or_panic();
} }
/// Public key of the chain account that may be used to verify signatures. /// Public key of the chain account that may be used to verify signatures.
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-bridge-hub-kusama" name = "bp-bridge-hub-kusama"
description = "Primitives of BridgeHubKusama parachain runtime." description = "Primitives of BridgeHubKusama parachain runtime."
version = "0.1.0" version = "0.6.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-bridge-hub-polkadot" name = "bp-bridge-hub-polkadot"
description = "Primitives of BridgeHubPolkadot parachain runtime." description = "Primitives of BridgeHubPolkadot parachain runtime."
version = "0.1.0" version = "0.6.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-bridge-hub-rococo" name = "bp-bridge-hub-rococo"
description = "Primitives of BridgeHubRococo parachain runtime." description = "Primitives of BridgeHubRococo parachain runtime."
version = "0.1.0" version = "0.7.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
@@ -50,7 +50,7 @@ impl Chain for BridgeHubRococo {
} }
fn max_extrinsic_weight() -> Weight { fn max_extrinsic_weight() -> Weight {
BlockWeights::get() BlockWeightsForAsyncBacking::get()
.get(DispatchClass::Normal) .get(DispatchClass::Normal)
.max_extrinsic .max_extrinsic
.unwrap_or(Weight::MAX) .unwrap_or(Weight::MAX)
@@ -99,7 +99,7 @@ frame_support::parameter_types! {
/// The XCM fee that is paid for executing XCM program (with `ExportMessage` instruction) at the Rococo /// The XCM fee that is paid for executing XCM program (with `ExportMessage` instruction) at the Rococo
/// BridgeHub. /// BridgeHub.
/// (initially was calculated by test `BridgeHubRococo::can_calculate_weight_for_paid_export_message_with_reserve_transfer` + `33%`) /// (initially was calculated by test `BridgeHubRococo::can_calculate_weight_for_paid_export_message_with_reserve_transfer` + `33%`)
pub const BridgeHubRococoBaseXcmFeeInRocs: u128 = 1_640_102_205; pub const BridgeHubRococoBaseXcmFeeInRocs: u128 = 59_034_266;
/// Transaction fee that is paid at the Rococo BridgeHub for delivering single inbound message. /// 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%`) /// (initially was calculated by test `BridgeHubRococo::can_calculate_fee_for_complex_message_delivery_transaction` + `33%`)
@@ -107,5 +107,5 @@ frame_support::parameter_types! {
/// Transaction fee that is paid at the Rococo BridgeHub for delivering single outbound message confirmation. /// 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%`) /// (initially was calculated by test `BridgeHubRococo::can_calculate_fee_for_complex_message_confirmation_transaction` + `33%`)
pub const BridgeHubRococoBaseConfirmationFeeInRocs: u128 = 4_045_736_577; pub const BridgeHubRococoBaseConfirmationFeeInRocs: u128 = 5_380_829_647;
} }
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-bridge-hub-westend" name = "bp-bridge-hub-westend"
description = "Primitives of BridgeHubWestend parachain runtime." description = "Primitives of BridgeHubWestend parachain runtime."
version = "0.1.0" version = "0.3.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
@@ -49,7 +49,7 @@ impl Chain for BridgeHubWestend {
} }
fn max_extrinsic_weight() -> Weight { fn max_extrinsic_weight() -> Weight {
BlockWeights::get() BlockWeightsForAsyncBacking::get()
.get(DispatchClass::Normal) .get(DispatchClass::Normal)
.max_extrinsic .max_extrinsic
.unwrap_or(Weight::MAX) .unwrap_or(Weight::MAX)
@@ -90,7 +90,7 @@ frame_support::parameter_types! {
/// The XCM fee that is paid for executing XCM program (with `ExportMessage` instruction) at the Westend /// The XCM fee that is paid for executing XCM program (with `ExportMessage` instruction) at the Westend
/// BridgeHub. /// BridgeHub.
/// (initially was calculated by test `BridgeHubWestend::can_calculate_weight_for_paid_export_message_with_reserve_transfer` + `33%`) /// (initially was calculated by test `BridgeHubWestend::can_calculate_weight_for_paid_export_message_with_reserve_transfer` + `33%`)
pub const BridgeHubWestendBaseXcmFeeInWnds: u128 = 492_077_333_333; pub const BridgeHubWestendBaseXcmFeeInWnds: u128 = 17_756_830_000;
/// Transaction fee that is paid at the Westend BridgeHub for delivering single inbound message. /// 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%`) /// (initially was calculated by test `BridgeHubWestend::can_calculate_fee_for_complex_message_delivery_transaction` + `33%`)
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-kusama" name = "bp-kusama"
description = "Primitives of Kusama runtime." description = "Primitives of Kusama runtime."
version = "0.1.0" version = "0.5.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-polkadot-bulletin" name = "bp-polkadot-bulletin"
description = "Primitives of Polkadot Bulletin chain runtime." description = "Primitives of Polkadot Bulletin chain runtime."
version = "0.1.0" version = "0.4.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-polkadot" name = "bp-polkadot"
description = "Primitives of Polkadot runtime." description = "Primitives of Polkadot runtime."
version = "0.1.0" version = "0.5.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-rococo" name = "bp-rococo"
description = "Primitives of Rococo runtime." description = "Primitives of Rococo runtime."
version = "0.1.0" version = "0.6.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-westend" name = "bp-westend"
description = "Primitives of Westend runtime." description = "Primitives of Westend runtime."
version = "0.1.0" version = "0.3.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-header-chain" name = "bp-header-chain"
description = "A common interface for describing what a bridge pallet should be able to do." description = "A common interface for describing what a bridge pallet should be able to do."
version = "0.1.0" version = "0.7.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-messages" name = "bp-messages"
description = "Primitives of messages module." description = "Primitives of messages module."
version = "0.1.0" version = "0.7.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-parachains" name = "bp-parachains"
description = "Primitives of parachains module." description = "Primitives of parachains module."
version = "0.1.0" version = "0.7.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-polkadot-core" name = "bp-polkadot-core"
description = "Primitives of Polkadot-like runtime." description = "Primitives of Polkadot-like runtime."
version = "0.1.0" version = "0.7.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-relayers" name = "bp-relayers"
description = "Primitives of relayers module." description = "Primitives of relayers module."
version = "0.1.0" version = "0.7.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-runtime" name = "bp-runtime"
description = "Primitives that may be used at (bridges) runtime level." description = "Primitives that may be used at (bridges) runtime level."
version = "0.1.0" version = "0.7.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "bp-test-utils" name = "bp-test-utils"
version = "0.1.0" version = "0.7.0"
description = "Utilities for testing substrate-based runtime bridge code" description = "Utilities for testing substrate-based runtime bridge code"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-xcm-bridge-hub-router" name = "bp-xcm-bridge-hub-router"
description = "Primitives of the xcm-bridge-hub fee pallet." description = "Primitives of the xcm-bridge-hub fee pallet."
version = "0.1.0" version = "0.6.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "bp-xcm-bridge-hub" name = "bp-xcm-bridge-hub"
description = "Primitives of the xcm-bridge-hub pallet." description = "Primitives of the xcm-bridge-hub pallet."
version = "0.1.0" version = "0.2.0"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0" license = "GPL-3.0-or-later WITH Classpath-exception-2.0"