From a8d7e885090589a29e2731bc52d199504e5a9a7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Sun, 9 Oct 2022 21:43:27 +0200 Subject: [PATCH 1/3] Reduce session for contracts to 10 minutes --- parachains/runtimes/contracts/contracts-rococo/src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/parachains/runtimes/contracts/contracts-rococo/src/lib.rs b/parachains/runtimes/contracts/contracts-rococo/src/lib.rs index 92ddbaf7adb..88bc92ad4c0 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/lib.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/lib.rs @@ -58,7 +58,8 @@ use frame_system::limits::{BlockLength, BlockWeights}; pub use parachains_common as common; use parachains_common::{ impls::DealWithFees, opaque, AccountId, BlockNumber, Hash, Header, Index, Signature, - AVERAGE_ON_INITIALIZE_RATIO, HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION, + AVERAGE_ON_INITIALIZE_RATIO, MAXIMUM_BLOCK_WEIGHT, MINUTES, NORMAL_DISPATCH_RATIO, + SLOT_DURATION, }; pub use parachains_common::{AuraId, Balance}; use xcm_config::CollatorSelectionUpdateOrigin; @@ -269,7 +270,7 @@ impl parachain_info::Config for Runtime {} impl cumulus_pallet_aura_ext::Config for Runtime {} parameter_types! { - pub const Period: u32 = 6 * HOURS; + pub const Period: u32 = 10 * MINUTES; pub const Offset: u32 = 0; } From 037c2209c6464751b0ea9afb70a2dca7b7a496c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Sun, 9 Oct 2022 21:45:37 +0200 Subject: [PATCH 2/3] Build pallet-contracts with unstable interface --- parachains/runtimes/contracts/contracts-rococo/Cargo.toml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/parachains/runtimes/contracts/contracts-rococo/Cargo.toml b/parachains/runtimes/contracts/contracts-rococo/Cargo.toml index 4bd3715fe49..2e6f65ceacb 100644 --- a/parachains/runtimes/contracts/contracts-rococo/Cargo.toml +++ b/parachains/runtimes/contracts/contracts-rococo/Cargo.toml @@ -47,7 +47,7 @@ pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-utility = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } pallet-sudo = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } -pallet-contracts = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } +pallet-contracts = { git = "https://github.com/paritytech/substrate", default-features = false, features = ["unstable-interface"], branch = "master" } pallet-contracts-primitives = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" } # Polkadot @@ -131,12 +131,6 @@ std = [ "cumulus-primitives-utility/std", ] -# Make contract callable functions marked as __unstable__ available. Do not enable -# on live chains as those are subject to change. -contracts-unstable-interface = [ - "pallet-contracts/unstable-interface" -] - runtime-benchmarks = [ "hex-literal", "frame-benchmarking/runtime-benchmarks", From c2502338109245f96ea682ef2a5b71602d179330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?= Date: Wed, 12 Oct 2022 00:06:58 +0200 Subject: [PATCH 3/3] Set `MinCandidates` to 0 to allow only invulnerables as collators --- parachains/runtimes/contracts/contracts-rococo/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parachains/runtimes/contracts/contracts-rococo/src/lib.rs b/parachains/runtimes/contracts/contracts-rococo/src/lib.rs index 88bc92ad4c0..579801078a4 100644 --- a/parachains/runtimes/contracts/contracts-rococo/src/lib.rs +++ b/parachains/runtimes/contracts/contracts-rococo/src/lib.rs @@ -304,7 +304,7 @@ impl pallet_collator_selection::Config for Runtime { type UpdateOrigin = CollatorSelectionUpdateOrigin; type PotId = PotId; type MaxCandidates = ConstU32<1000>; - type MinCandidates = ConstU32<5>; + type MinCandidates = ConstU32<0>; type MaxInvulnerables = ConstU32<100>; // should be a multiple of session or things will get inconsistent type KickThreshold = Period;