Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit d074422

Browse files
author
Guantong
committed
1 parent 6644e25 commit d074422

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

primitives/darwinia-core/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mod copy_paste_from_darwinia {
2525
use frame_support::{
2626
dispatch::DispatchClass,
2727
weights::{
28-
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, WEIGHT_PER_SECOND},
28+
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, WEIGHT_REF_TIME_PER_SECOND},
2929
Weight,
3030
},
3131
};
@@ -52,7 +52,9 @@ mod copy_paste_from_darwinia {
5252
pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_perthousand(25);
5353
pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
5454
// TODO: https://github.com/paritytech/parity-bridges-common/issues/1543 - remove `set_proof_size`
55-
pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_mul(2);
55+
pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_ref_time(WEIGHT_REF_TIME_PER_SECOND)
56+
.set_proof_size(1_000)
57+
.saturating_mul(2);
5658

5759
frame_support::parameter_types! {
5860
pub RuntimeBlockLength: BlockLength =

primitives/polkadot-core/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use frame_support::{
4646
dispatch::{DispatchClass, Dispatchable},
4747
parameter_types,
4848
weights::{
49-
constants::{BlockExecutionWeight, WEIGHT_PER_SECOND},
49+
constants::{BlockExecutionWeight, WEIGHT_REF_TIME_PER_SECOND},
5050
Weight,
5151
},
5252
RuntimeDebug,
@@ -130,8 +130,9 @@ const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
130130
///
131131
/// This is a copy-paste from the Polkadot repo's `polkadot-runtime-common` crate.
132132
// TODO: https://github.com/paritytech/parity-bridges-common/issues/1543 - remove `set_proof_size`
133-
pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_mul(2);
134-
133+
pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_ref_time(WEIGHT_REF_TIME_PER_SECOND)
134+
.set_proof_size(1_000)
135+
.saturating_mul(2);
135136
/// All Polkadot-like chains assume that an on-initialize consumes 1 percent of the weight on
136137
/// average, hence a single extrinsic will not be allowed to consume more than
137138
/// `AvailableBlockRatio - 1 percent`.

primitives/runtime/src/chain.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use frame_support::{weights::Weight, Parameter};
2222
use sp_runtime::{
2323
traits::{
2424
AtLeast32Bit, AtLeast32BitUnsigned, Hash as HashT, Header as HeaderT, MaybeDisplay,
25-
MaybeMallocSizeOf, MaybeSerialize, MaybeSerializeDeserialize, Member, SimpleBitOps, Verify,
25+
MaybeSerialize, MaybeSerializeDeserialize, Member, SimpleBitOps, Verify,
2626
},
2727
FixedPointOperand,
2828
};
@@ -78,7 +78,6 @@ pub trait Chain: Send + Sync + 'static {
7878
+ MaybeDisplay
7979
+ AtLeast32BitUnsigned
8080
+ FromStr
81-
+ MaybeMallocSizeOf
8281
+ AsPrimitive<usize>
8382
+ Default
8483
+ Saturating
@@ -102,7 +101,6 @@ pub trait Chain: Send + Sync + 'static {
102101
+ SimpleBitOps
103102
+ AsRef<[u8]>
104103
+ AsMut<[u8]>
105-
+ MaybeMallocSizeOf
106104
+ MaxEncodedLen;
107105

108106
/// A type that fulfills the abstract idea of what a Substrate hasher (a type

0 commit comments

Comments
 (0)