Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
  • Loading branch information
Guantong committed Jan 28, 2023
commit 20c357bfc4c64f30dc3a4ce65fa179ca1b4ee1bf
6 changes: 4 additions & 2 deletions primitives/darwinia-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mod copy_paste_from_darwinia {
use frame_support::{
dispatch::DispatchClass,
weights::{
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, WEIGHT_PER_SECOND},
constants::{BlockExecutionWeight, ExtrinsicBaseWeight, WEIGHT_REF_TIME_PER_SECOND},
Weight,
},
};
Expand All @@ -52,7 +52,9 @@ mod copy_paste_from_darwinia {
pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_perthousand(25);
pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
// TODO: https://github.com/paritytech/parity-bridges-common/issues/1543 - remove `set_proof_size`
pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_mul(2);
pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_ref_time(WEIGHT_REF_TIME_PER_SECOND)
.set_proof_size(1_000)
.saturating_mul(2);

frame_support::parameter_types! {
pub RuntimeBlockLength: BlockLength =
Expand Down
7 changes: 4 additions & 3 deletions primitives/polkadot-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use frame_support::{
dispatch::{DispatchClass, Dispatchable},
parameter_types,
weights::{
constants::{BlockExecutionWeight, WEIGHT_PER_SECOND},
constants::{BlockExecutionWeight, WEIGHT_REF_TIME_PER_SECOND},
Weight,
},
RuntimeDebug,
Expand Down Expand Up @@ -130,8 +130,9 @@ const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
///
/// This is a copy-paste from the Polkadot repo's `polkadot-runtime-common` crate.
// TODO: https://github.com/paritytech/parity-bridges-common/issues/1543 - remove `set_proof_size`
pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND.saturating_mul(2);

pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_ref_time(WEIGHT_REF_TIME_PER_SECOND)
.set_proof_size(1_000)
.saturating_mul(2);
/// All Polkadot-like chains assume that an on-initialize consumes 1 percent of the weight on
/// average, hence a single extrinsic will not be allowed to consume more than
/// `AvailableBlockRatio - 1 percent`.
Expand Down
4 changes: 1 addition & 3 deletions primitives/runtime/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use frame_support::{weights::Weight, Parameter};
use sp_runtime::{
traits::{
AtLeast32Bit, AtLeast32BitUnsigned, Hash as HashT, Header as HeaderT, MaybeDisplay,
MaybeMallocSizeOf, MaybeSerialize, MaybeSerializeDeserialize, Member, SimpleBitOps, Verify,
MaybeSerialize, MaybeSerializeDeserialize, Member, SimpleBitOps, Verify,
},
FixedPointOperand,
};
Expand Down Expand Up @@ -78,7 +78,6 @@ pub trait Chain: Send + Sync + 'static {
+ MaybeDisplay
+ AtLeast32BitUnsigned
+ FromStr
+ MaybeMallocSizeOf
+ AsPrimitive<usize>
+ Default
+ Saturating
Expand All @@ -102,7 +101,6 @@ pub trait Chain: Send + Sync + 'static {
+ SimpleBitOps
+ AsRef<[u8]>
+ AsMut<[u8]>
+ MaybeMallocSizeOf
+ MaxEncodedLen;

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