Skip to content

Commit

Permalink
Backport latest PRs from polkadot sdk (paritytech#2824)
Browse files Browse the repository at this point in the history
* backport paritytech#3034

* backport paritytech#3072

* backport paritytech#3175

* backport paritytech#2949

* Cargo.lock

* fix invalid copypaste
  • Loading branch information
svyatonik authored Feb 6, 2024
1 parent d099107 commit 555866b
Show file tree
Hide file tree
Showing 47 changed files with 495 additions and 109 deletions.
56 changes: 28 additions & 28 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 bin/runtime-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
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"
authors.workspace = true
edition.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion modules/grandpa/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
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."
authors.workspace = true
edition.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion modules/messages/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "pallet-bridge-messages"
description = "Module that allows bridged chains to exchange messages using lane concept."
version = "0.1.0"
version = "0.7.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
Expand Down
2 changes: 1 addition & 1 deletion modules/parachains/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
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."
authors.workspace = true
edition.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion modules/relayers/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "pallet-bridge-relayers"
description = "Module used to store relayer rewards and coordinate relayers set."
version = "0.1.0"
version = "0.7.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
Expand Down
2 changes: 1 addition & 1 deletion modules/xcm-bridge-hub-router/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "pallet-xcm-bridge-hub-router"
description = "Bridge hub interface for sibling/parent chains with dynamic fees support."
version = "0.1.0"
version = "0.5.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
Expand Down
2 changes: 1 addition & 1 deletion modules/xcm-bridge-hub/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "pallet-xcm-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
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
Expand Down
2 changes: 1 addition & 1 deletion primitives/chain-asset-hub-rococo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bp-asset-hub-rococo"
description = "Primitives of AssetHubRococo parachain runtime."
version = "0.1.0"
version = "0.4.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
Expand Down
2 changes: 1 addition & 1 deletion primitives/chain-asset-hub-westend/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bp-asset-hub-westend"
description = "Primitives of AssetHubWestend parachain runtime."
version = "0.1.0"
version = "0.3.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
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,7 +1,7 @@
[package]
name = "bp-bridge-hub-cumulus"
description = "Primitives for BridgeHub parachain runtimes."
version = "0.1.0"
version = "0.7.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
Expand Down
26 changes: 26 additions & 0 deletions primitives/chain-bridge-hub-cumulus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(constants::WEIGHT_REF_TI
.saturating_div(2)
.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
/// `on_initialize` handlers. This is used to limit the maximal weight of a single extrinsic.
///
Expand Down Expand Up @@ -96,6 +102,26 @@ parameter_types! {
})
.avg_block_initialization(AVERAGE_ON_INITIALIZE_RATIO)
.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.
Expand Down
2 changes: 1 addition & 1 deletion primitives/chain-bridge-hub-kusama/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bp-bridge-hub-kusama"
description = "Primitives of BridgeHubKusama parachain runtime."
version = "0.1.0"
version = "0.6.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
Expand Down
2 changes: 1 addition & 1 deletion primitives/chain-bridge-hub-polkadot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bp-bridge-hub-polkadot"
description = "Primitives of BridgeHubPolkadot parachain runtime."
version = "0.1.0"
version = "0.6.0"
authors.workspace = true
edition.workspace = true
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
Expand Down
Loading

0 comments on commit 555866b

Please sign in to comment.