Skip to content

Commit 9986451

Browse files
committed
shiden: enable async backing
1 parent 50ed03d commit 9986451

File tree

3 files changed

+27
-17
lines changed

3 files changed

+27
-17
lines changed

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runtime/shiden/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ pallet-inflation = { workspace = true }
123123
pallet-price-aggregator = { workspace = true }
124124
pallet-xc-asset-config = { workspace = true }
125125
pallet-xcm = { workspace = true }
126+
vesting-mbm = { workspace = true }
126127

127128
dapp-staking-runtime-api = { workspace = true }
128129

@@ -243,6 +244,7 @@ std = [
243244
"pallet-xcm-benchmarks?/std",
244245
"precompile-utils/std",
245246
"scale-info/std",
247+
"vesting-mbm/std"
246248
]
247249
runtime-benchmarks = [
248250
"log",
@@ -294,6 +296,7 @@ runtime-benchmarks = [
294296
"pallet-message-queue/runtime-benchmarks",
295297
"parachains-common/runtime-benchmarks",
296298
"orml-oracle/runtime-benchmarks",
299+
"vesting-mbm/runtime-benchmarks"
297300
]
298301
try-runtime = [
299302
"astar-primitives/try-runtime",
@@ -341,6 +344,7 @@ try-runtime = [
341344
"pallet-chain-extension-assets/try-runtime",
342345
"polkadot-runtime-common/try-runtime",
343346
"sp-runtime/try-runtime",
347+
"vesting-mbm/try-runtime"
344348
]
345349
evm-tracing = [
346350
"moonbeam-evm-tracer",

runtime/shiden/src/lib.rs

+22-17
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pub const fn contracts_deposit(items: u32, bytes: u32) -> Balance {
140140
}
141141

142142
/// Change this to adjust the block time.
143-
pub const MILLISECS_PER_BLOCK: u64 = 12000;
143+
pub const MILLISECS_PER_BLOCK: u64 = 6000;
144144
pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;
145145

146146
// Time is measured by number of blocks.
@@ -150,7 +150,7 @@ pub const DAYS: BlockNumber = HOURS * 24;
150150

151151
/// Maximum number of blocks simultaneously accepted by the Runtime, not yet included into the
152152
/// relay chain.
153-
pub const UNINCLUDED_SEGMENT_CAPACITY: u32 = 1;
153+
pub const UNINCLUDED_SEGMENT_CAPACITY: u32 = 3;
154154
/// How many parachain blocks are processed by the relay chain per parent. Limits the number of
155155
/// blocks authored per slot.
156156
pub const BLOCK_PROCESSING_VELOCITY: u32 = 1;
@@ -205,9 +205,9 @@ const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);
205205
/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used
206206
/// by Operational extrinsics.
207207
const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
208-
/// We allow for 0.5 seconds of compute with a 6 second average block time.
208+
/// We allow for 2 seconds of compute with a 6 second average block time.
209209
const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(
210-
WEIGHT_REF_TIME_PER_SECOND.saturating_div(2),
210+
WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2),
211211
polkadot_primitives::MAX_POV_SIZE as u64,
212212
);
213213

@@ -300,15 +300,10 @@ impl frame_system::Config for Runtime {
300300
type PostTransactions = ();
301301
}
302302

303-
parameter_types! {
304-
pub const MinimumPeriod: u64 = MILLISECS_PER_BLOCK / 2;
305-
}
306-
307303
impl pallet_timestamp::Config for Runtime {
308-
/// A timestamp: milliseconds since the unix epoch.
309304
type Moment = u64;
310-
type OnTimestampSet = ();
311-
type MinimumPeriod = MinimumPeriod;
305+
type OnTimestampSet = Aura;
306+
type MinimumPeriod = ConstU64<0>;
312307
type WeightInfo = pallet_timestamp::weights::SubstrateWeight<Runtime>;
313308
}
314309

@@ -538,7 +533,7 @@ impl pallet_aura::Config for Runtime {
538533
type AuthorityId = AuraId;
539534
type DisabledValidators = ();
540535
type MaxAuthorities = ConstU32<250>;
541-
type AllowMultipleBlocksPerSlot = ConstBool<false>;
536+
type AllowMultipleBlocksPerSlot = ConstBool<true>;
542537
type SlotDuration = ConstU64<SLOT_DURATION>;
543538
}
544539

@@ -907,8 +902,8 @@ parameter_types! {
907902
/// max_gas_limit = max_tx_ref_time / WEIGHT_PER_GAS = max_pov_size * gas_limit_pov_size_ratio
908903
/// gas_limit_pov_size_ratio = ceil((max_tx_ref_time / WEIGHT_PER_GAS) / max_pov_size)
909904
///
910-
/// Equals 4 for values used by Shiden runtime.
911-
pub const GasLimitPovSizeRatio: u64 = 4;
905+
/// Equals 16 for values used by Shiden runtime.
906+
pub const GasLimitPovSizeRatio: u64 = 16;
912907
}
913908

914909
impl pallet_evm::Config for Runtime {
@@ -1106,7 +1101,7 @@ impl pallet_proxy::Config for Runtime {
11061101
parameter_types! {
11071102
pub const NativeCurrencyId: CurrencyId = CurrencyId::SDN;
11081103
// Aggregate values for one day.
1109-
pub const AggregationDuration: BlockNumber = 7200;
1104+
pub const AggregationDuration: BlockNumber = DAYS;
11101105
}
11111106

11121107
impl pallet_price_aggregator::Config for Runtime {
@@ -1199,7 +1194,13 @@ parameter_types! {
11991194
impl pallet_migrations::Config for Runtime {
12001195
type RuntimeEvent = RuntimeEvent;
12011196
#[cfg(not(feature = "runtime-benchmarks"))]
1202-
type Migrations = ();
1197+
type Migrations = (
1198+
pallet_dapp_staking::migration::LazyMigration<
1199+
Runtime,
1200+
pallet_dapp_staking::weights::SubstrateWeight<Runtime>,
1201+
>,
1202+
vesting_mbm::LazyMigration<Runtime, vesting_mbm::weights::SubstrateWeight<Runtime>>,
1203+
);
12031204
// Benchmarks need mocked migrations to guarantee that they succeed.
12041205
#[cfg(feature = "runtime-benchmarks")]
12051206
type Migrations = pallet_migrations::mock_helpers::MockedMigrations;
@@ -1338,7 +1339,11 @@ parameter_types! {
13381339
pub type Migrations = (Unreleased, Permanent);
13391340

13401341
/// Unreleased migrations. Add new ones here:
1341-
pub type Unreleased = (cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5<Runtime>,);
1342+
pub type Unreleased = (
1343+
cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5<Runtime>,
1344+
pallet_dapp_staking::migration::AdjustEraMigration<Runtime>,
1345+
pallet_inflation::migration::AdjustBlockRewardMigration<Runtime>,
1346+
);
13421347

13431348
/// Migrations/checks that do not need to be versioned and can run on every upgrade.
13441349
pub type Permanent = (pallet_xcm::migration::MigrateToLatestXcmVersion<Runtime>,);

0 commit comments

Comments
 (0)