2222#[ cfg( feature = "std" ) ]
2323include ! ( concat!( env!( "OUT_DIR" ) , "/wasm_binary.rs" ) ) ;
2424
25- use cumulus_pallet_parachain_system:: RelayNumberMonotonicallyIncreases ;
25+ use cumulus_pallet_parachain_system:: RelayNumberStrictlyIncreases ;
2626use polkadot_runtime_common:: xcm_sender:: NoPriceForMessageDelivery ;
2727use sp_api:: impl_runtime_apis;
2828use sp_core:: OpaqueMetadata ;
2929use sp_runtime:: {
3030 create_runtime_str, generic, impl_opaque_keys,
31- traits:: { AccountIdLookup , BlakeTwo256 , Block as BlockT , Hash as HashT } ,
31+ traits:: { AccountIdLookup , BlakeTwo256 , Block as BlockT } ,
3232 transaction_validity:: { TransactionSource , TransactionValidity } ,
3333 ApplyExtrinsicResult ,
3434} ;
@@ -113,7 +113,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
113113 state_version : 0 ,
114114} ;
115115
116- pub const MILLISECS_PER_BLOCK : u64 = 6000 ;
116+ pub const MILLISECS_PER_BLOCK : u64 = 12000 ;
117117
118118pub const SLOT_DURATION : u64 = MILLISECS_PER_BLOCK ;
119119
@@ -143,18 +143,18 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);
143143/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used
144144/// by Operational extrinsics.
145145const NORMAL_DISPATCH_RATIO : Perbill = Perbill :: from_percent ( 75 ) ;
146- /// We allow for 2 seconds of compute with a 6 second average block time.
146+ /// We allow for .5 seconds of compute with a 12 second average block time.
147147const MAXIMUM_BLOCK_WEIGHT : Weight = Weight :: from_parts (
148- WEIGHT_REF_TIME_PER_SECOND . saturating_mul ( 2 ) ,
148+ WEIGHT_REF_TIME_PER_SECOND . saturating_div ( 2 ) ,
149149 cumulus_primitives_core:: relay_chain:: MAX_POV_SIZE as u64 ,
150150) ;
151151
152152/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included
153153/// into the relay chain.
154- const UNINCLUDED_SEGMENT_CAPACITY : u32 = 3 ;
154+ const UNINCLUDED_SEGMENT_CAPACITY : u32 = 1 ;
155155/// How many parachain blocks are processed by the relay chain per parent. Limits the
156156/// number of blocks authored per slot.
157- const BLOCK_PROCESSING_VELOCITY : u32 = 2 ;
157+ const BLOCK_PROCESSING_VELOCITY : u32 = 1 ;
158158/// Relay chain slot duration, in milliseconds.
159159const RELAY_CHAIN_SLOT_DURATION_MILLIS : u32 = 6000 ;
160160
@@ -277,13 +277,6 @@ parameter_types! {
277277 pub const RelayOrigin : AggregateMessageOrigin = AggregateMessageOrigin :: Parent ;
278278}
279279
280- type ConsensusHook = cumulus_pallet_aura_ext:: FixedVelocityConsensusHook <
281- Runtime ,
282- RELAY_CHAIN_SLOT_DURATION_MILLIS ,
283- BLOCK_PROCESSING_VELOCITY ,
284- UNINCLUDED_SEGMENT_CAPACITY ,
285- > ;
286-
287280impl cumulus_pallet_parachain_system:: Config for Runtime {
288281 type WeightInfo = ( ) ;
289282 type RuntimeEvent = RuntimeEvent ;
@@ -294,8 +287,13 @@ impl cumulus_pallet_parachain_system::Config for Runtime {
294287 type ReservedDmpWeight = ReservedDmpWeight ;
295288 type XcmpMessageHandler = XcmpQueue ;
296289 type ReservedXcmpWeight = ReservedXcmpWeight ;
297- type CheckAssociatedRelayNumber = RelayNumberMonotonicallyIncreases ;
298- type ConsensusHook = ConsensusHook ;
290+ type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases ;
291+ type ConsensusHook = cumulus_pallet_aura_ext:: FixedVelocityConsensusHook <
292+ Runtime ,
293+ RELAY_CHAIN_SLOT_DURATION_MILLIS ,
294+ BLOCK_PROCESSING_VELOCITY ,
295+ UNINCLUDED_SEGMENT_CAPACITY ,
296+ > ;
299297}
300298
301299impl parachain_info:: Config for Runtime { }
@@ -586,9 +584,9 @@ impl pallet_aura::Config for Runtime {
586584 type AuthorityId = AuraId ;
587585 type DisabledValidators = ( ) ;
588586 type MaxAuthorities = ConstU32 < 100_000 > ;
589- type AllowMultipleBlocksPerSlot = ConstBool < true > ;
587+ type AllowMultipleBlocksPerSlot = ConstBool < false > ;
590588 #[ cfg( feature = "experimental" ) ]
591- type SlotDuration = ConstU64 < SLOT_DURATION > ;
589+ type SlotDuration = pallet_aura :: MinimumPeriodTimesTwo < Self > ;
592590}
593591
594592construct_runtime ! {
@@ -626,7 +624,7 @@ pub type Balance = u128;
626624/// Index of a transaction in the chain.
627625pub type Nonce = u32 ;
628626/// A hash of some data used by the chain.
629- pub type Hash = < BlakeTwo256 as HashT > :: Output ;
627+ pub type Hash = sp_core :: H256 ;
630628/// An index to a block.
631629pub type BlockNumber = u32 ;
632630/// The address format for describing accounts.
@@ -753,7 +751,7 @@ impl_runtime_apis! {
753751
754752 impl sp_consensus_aura:: AuraApi <Block , AuraId > for Runtime {
755753 fn slot_duration( ) -> sp_consensus_aura:: SlotDuration {
756- sp_consensus_aura:: SlotDuration :: from_millis( SLOT_DURATION )
754+ sp_consensus_aura:: SlotDuration :: from_millis( Aura :: slot_duration ( ) )
757755 }
758756
759757 fn authorities( ) -> Vec <AuraId > {
@@ -826,15 +824,6 @@ impl_runtime_apis! {
826824 build_config:: <RuntimeGenesisConfig >( config)
827825 }
828826 }
829-
830- impl cumulus_primitives_aura:: AuraUnincludedSegmentApi <Block > for Runtime {
831- fn can_build_upon(
832- included_hash: <Block as BlockT >:: Hash ,
833- slot: cumulus_primitives_aura:: Slot ,
834- ) -> bool {
835- ConsensusHook :: can_build_upon( included_hash, slot)
836- }
837- }
838827}
839828
840829cumulus_pallet_parachain_system:: register_validate_block! {
0 commit comments