mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 19:11:02 +00:00
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:
committed by
Bastian Köcher
parent
d713ef174e
commit
67a1c9a9e6
@@ -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"
|
||||
|
||||
@@ -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.
|
||||
///
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user