@@ -161,10 +161,16 @@ pub mod currency {
161161 }
162162}
163163
164+ /// Maximum PoV size we support right now.
165+ // Kusama relay already supports 10Mb maximum PoV
166+ // Reference: https://github.com/polkadot-fellows/runtimes/pull/553
167+ pub const MAX_POV_SIZE : u32 = 10 * 1024 * 1024 ;
168+
164169/// Maximum weight per block
165- pub const MAXIMUM_BLOCK_WEIGHT : Weight = Weight :: from_parts ( WEIGHT_REF_TIME_PER_SECOND , u64:: MAX )
166- . saturating_mul ( 2 )
167- . set_proof_size ( relay_chain:: MAX_POV_SIZE as u64 ) ;
170+ pub const MAXIMUM_BLOCK_WEIGHT : Weight = Weight :: from_parts (
171+ WEIGHT_REF_TIME_PER_SECOND . saturating_mul ( 2 ) ,
172+ MAX_POV_SIZE as u64 ,
173+ ) ;
168174
169175pub const MILLISECS_PER_BLOCK : u64 = 6_000 ;
170176pub const MINUTES : BlockNumber = 60_000 / ( MILLISECS_PER_BLOCK as BlockNumber ) ;
@@ -386,6 +392,11 @@ pub const GAS_PER_SECOND: u64 = 40_000_000;
386392/// u64 works for approximations because Weight is a very small unit compared to gas.
387393pub const WEIGHT_PER_GAS : u64 = WEIGHT_REF_TIME_PER_SECOND / GAS_PER_SECOND ;
388394
395+ /// The highest amount of new storage that can be created in a block (160KB).
396+ /// Originally 40KB, then multiplied by 4 when the block deadline was increased from 500ms to 2000ms.
397+ /// Reference: https://github.com/moonbeam-foundation/moonbeam/blob/master/MBIPS/MBIP-5.md#specification
398+ pub const BLOCK_STORAGE_LIMIT : u64 = 160 * 1024 ;
399+
389400parameter_types ! {
390401 pub BlockGasLimit : U256
391402 = U256 :: from( NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT . ref_time( ) / WEIGHT_PER_GAS ) ;
@@ -406,13 +417,13 @@ parameter_types! {
406417 pub MaximumMultiplier : Multiplier = Multiplier :: from( 100_000u128 ) ;
407418 pub PrecompilesValue : MoonriverPrecompiles <Runtime > = MoonriverPrecompiles :: <_>:: new( ) ;
408419 pub WeightPerGas : Weight = Weight :: from_parts( WEIGHT_PER_GAS , 0 ) ;
409- /// The amount of gas per pov. A ratio of 16 if we convert ref_time to gas and we compare
420+ /// The amount of gas per pov. A ratio of 8 if we convert ref_time to gas and we compare
410421 /// it with the pov_size for a block. E.g.
411422 /// ceil(
412423 /// (max_extrinsic.ref_time() / max_extrinsic.proof_size()) / WEIGHT_PER_GAS
413424 /// )
414425 /// We should re-check `xcm_config::Erc20XcmBridgeTransferGasLimit` when changing this value
415- pub const GasLimitPovSizeRatio : u64 = 16 ;
426+ pub const GasLimitPovSizeRatio : u64 = 8 ;
416427 /// The amount of gas per storage (in bytes): BLOCK_GAS_LIMIT / BLOCK_STORAGE_LIMIT
417428 /// The current definition of BLOCK_STORAGE_LIMIT is 160 KB, resulting in a value of 366.
418429 pub GasLimitStorageGrowthRatio : u64 = 366 ;
@@ -689,6 +700,7 @@ impl pallet_ethereum_xcm::Config for Runtime {
689700}
690701
691702parameter_types ! {
703+ // Reserved weight is 1/4 of MAXIMUM_BLOCK_WEIGHT
692704 pub const ReservedXcmpWeight : Weight = MAXIMUM_BLOCK_WEIGHT . saturating_div( 4 ) ;
693705 pub const ReservedDmpWeight : Weight = MAXIMUM_BLOCK_WEIGHT . saturating_div( 4 ) ;
694706 pub const RelayOrigin : AggregateMessageOrigin = AggregateMessageOrigin :: Parent ;
0 commit comments