@@ -49,7 +49,7 @@ use sp_api::impl_runtime_apis;
49
49
use sp_core:: { OpaqueMetadata , H160 , H256 , U256 } ;
50
50
use sp_runtime:: {
51
51
create_runtime_str, generic, impl_opaque_keys,
52
- traits:: { BlakeTwo256 , Block as BlockT , IdentifyAccount , IdentityLookup , Saturating , Verify } ,
52
+ traits:: { BlakeTwo256 , Block as BlockT , IdentifyAccount , IdentityLookup , Verify } ,
53
53
transaction_validity:: { TransactionSource , TransactionValidity } ,
54
54
ApplyExtrinsicResult ,
55
55
} ;
@@ -100,7 +100,7 @@ pub type Hash = sp_core::H256;
100
100
/// Digest item type.
101
101
pub type DigestItem = generic:: DigestItem < Hash > ;
102
102
103
- /// Minimum time between blocks.
103
+ /// Minimum time between blocks. Slot duration is double this.
104
104
pub const MINIMUM_PERIOD : u64 = 3000 ;
105
105
106
106
/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know
@@ -140,17 +140,12 @@ const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
140
140
141
141
parameter_types ! {
142
142
pub const BlockHashCount : BlockNumber = 250 ;
143
- pub const MaximumBlockWeight : Weight = 2 * WEIGHT_PER_SECOND ;
144
- /// Assume 10% of weight for average on_initialize calls.
145
- pub MaximumExtrinsicWeight : Weight = AvailableBlockRatio :: get( )
146
- . saturating_sub( Perbill :: from_percent( 10 ) ) * MaximumBlockWeight :: get( ) ;
147
- pub const AvailableBlockRatio : Perbill = Perbill :: from_percent( 75 ) ;
148
143
pub const Version : RuntimeVersion = VERSION ;
149
- pub const ExtrinsicBaseWeight : Weight = 10_000_000 ;
150
-
151
-
144
+ /// We allow for one half second of compute with a 6 second average block time.
145
+ /// These values are dictated by Polkadot for the parachain.
152
146
pub BlockWeights : frame_system:: limits:: BlockWeights = frame_system:: limits:: BlockWeights
153
- :: with_sensible_defaults( 2 * WEIGHT_PER_SECOND , NORMAL_DISPATCH_RATIO ) ;
147
+ :: with_sensible_defaults( WEIGHT_PER_SECOND / 2 , NORMAL_DISPATCH_RATIO ) ;
148
+ /// We allow for 5 MB blocks.
154
149
pub BlockLength : frame_system:: limits:: BlockLength = frame_system:: limits:: BlockLength
155
150
:: max_with_normal_ratio( 5 * 1024 * 1024 , NORMAL_DISPATCH_RATIO ) ;
156
151
}
@@ -195,8 +190,10 @@ impl frame_system::Config for Runtime {
195
190
196
191
parameter_types ! {
197
192
// When running in standalone mode, this controls the block time.
198
- // Block time is double the minimum period.
193
+ // Slot duration is double the minimum period.
199
194
// https://github.com/paritytech/substrate/blob/e4803bd/frame/aura/src/lib.rs#L197-L199
195
+ // We maintain a six second block time in standalone to imitate parachain-like performance
196
+ // This value is stored in a seperate constant because it is used in our mock timestamp provider
200
197
pub const MinimumPeriod : u64 = MINIMUM_PERIOD ;
201
198
}
202
199
0 commit comments