git.delta.rocks / unique-network / refs/commits / a931d82a9899

difftreelog

feat(collator-selection) opal only

Fahrrader2022-10-28parent: #3858e94.patch.diff
in: master

10 files changed

modifiednode/cli/src/chain_spec.rsdiffbeforeafterboth
--- a/node/cli/src/chain_spec.rs
+++ b/node/cli/src/chain_spec.rs
@@ -24,7 +24,7 @@
 use serde_json::map::Map;
 
 use up_common::types::opaque::*;
-use up_common::constants::EXISTENTIAL_DEPOSIT;
+use up_common::constants::CANDIDACY_BOND;
 
 #[cfg(feature = "unique-runtime")]
 pub use unique_runtime as default_runtime;
@@ -151,6 +151,7 @@
 	AccountPublic::from(get_from_seed::<TPublic>(seed)).into_account()
 }
 
+#[cfg(not(any(feature = "unique-runtime", feature = "quartz-runtime")))]
 macro_rules! testnet_genesis {
 	(
 		$runtime:path,
@@ -191,7 +192,7 @@
 					.cloned()
 					.map(|(acc, _)| acc)
 					.collect(),
-				candidacy_bond: EXISTENTIAL_DEPOSIT * 16,
+				candidacy_bond: CANDIDACY_BOND,
 				..Default::default()
 			},
 			session: SessionConfig {
@@ -207,9 +208,6 @@
 					.collect(),
 			},
 			aura: Default::default(),
-			/*aura: AuraConfig {
-				authorities: $initial_authorities,
-			},*/
 			aura_ext: Default::default(),
 			evm: EVMConfig {
 				accounts: BTreeMap::new(),
@@ -219,6 +217,56 @@
 	}};
 }
 
+#[cfg(any(feature = "unique-runtime", feature = "quartz-runtime"))]
+macro_rules! testnet_genesis {
+	(
+		$runtime:path,
+		$root_key:expr,
+		$initial_invulnerables:expr,
+		$endowed_accounts:expr,
+		$id:expr
+	) => {{
+		use $runtime::*;
+
+		GenesisConfig {
+			system: SystemConfig {
+				code: WASM_BINARY
+					.expect("WASM binary was not build, please build it!")
+					.to_vec(),
+			},
+			balances: BalancesConfig {
+				balances: $endowed_accounts
+					.iter()
+					.cloned()
+					// 1e13 UNQ
+					.map(|k| (k, 1 << 100))
+					.collect(),
+			},
+			treasury: Default::default(),
+			tokens: TokensConfig { balances: vec![] },
+			sudo: SudoConfig {
+				key: Some($root_key),
+			},
+			vesting: VestingConfig { vesting: vec![] },
+			parachain_info: ParachainInfoConfig {
+				parachain_id: $id.into(),
+			},
+			parachain_system: Default::default(),
+			aura: AuraConfig {
+				authorities: $initial_invulnerables
+					.into_iter()
+					.map(|(_, aura)| aura)
+					.collect(),
+			},
+			aura_ext: Default::default(),
+			evm: EVMConfig {
+				accounts: BTreeMap::new(),
+			},
+			ethereum: EthereumConfig {},
+		}
+	}};
+}
+
 pub fn development_config() -> DefaultChainSpec {
 	let mut properties = Map::new();
 	properties.insert("tokenSymbol".into(), default_runtime::TOKEN_SYMBOL.into());
modifiedprimitives/common/src/constants.rsdiffbeforeafterboth
--- a/primitives/common/src/constants.rs
+++ b/primitives/common/src/constants.rs
@@ -41,7 +41,10 @@
 pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE;
 pub const UNIQUE: Balance = 100 * CENTIUNIQUE;
 
+/// Minimum balance required to create or keep an account open.
 pub const EXISTENTIAL_DEPOSIT: u128 = 0;
+/// Amount of Balance reserved for candidate registration.
+pub const CANDIDACY_BOND: u128 = EXISTENTIAL_DEPOSIT;
 
 // Targeting 0.1 UNQ per transfer
 pub const WEIGHT_TO_FEE_COEFF: u32 = /*<weight2fee>*/207_163_598/*</weight2fee>*/;
addedruntime/common/config/pallets/collator_selection.rsdiffbeforeafterboth
--- /dev/null
+++ b/runtime/common/config/pallets/collator_selection.rs
@@ -0,0 +1,78 @@
+// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
+// This file is part of Unique Network.
+
+// Unique Network is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+
+// Unique Network is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License
+// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
+
+use frame_support::{parameter_types, PalletId};
+use frame_system::EnsureRoot;
+use crate::{
+	AccountId, BlockNumber, Runtime, RuntimeEvent, Balances, Aura, Session, SessionKeys,
+	CollatorSelection,
+};
+use up_common::constants::*;
+
+parameter_types! {
+	pub const SessionPeriod: BlockNumber = HOURS;
+	pub const SessionOffset: BlockNumber = 0;
+}
+
+impl pallet_session::Config for Runtime {
+	type RuntimeEvent = RuntimeEvent;
+	type ValidatorId = <Self as frame_system::Config>::AccountId;
+	// we don't have stash and controller, thus we don't need the convert as well.
+	type ValidatorIdOf = pallet_collator_selection::IdentityCollator;
+	type ShouldEndSession = pallet_session::PeriodicSessions<SessionPeriod, SessionOffset>;
+	type NextSessionRotation = pallet_session::PeriodicSessions<SessionPeriod, SessionOffset>;
+	type SessionManager = CollatorSelection;
+	// Essentially just Aura, but lets be pedantic.
+	type SessionHandler = <SessionKeys as sp_runtime::traits::OpaqueKeys>::KeyTypeIdProviders;
+	type Keys = SessionKeys;
+	type WeightInfo = pallet_session::weights::SubstrateWeight<Self>; // ();
+}
+
+parameter_types! {
+	pub const UncleGenerations: u32 = 0;
+}
+
+impl pallet_authorship::Config for Runtime {
+	type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Aura>;
+	type UncleGenerations = UncleGenerations;
+	type FilterUncle = ();
+	type EventHandler = CollatorSelection;
+}
+
+parameter_types! {
+	pub const PotId: PalletId = PalletId(*b"PotStake");
+	pub const MaxCandidates: u32 = 1000;
+	pub const MinCandidates: u32 = 5;
+	pub const MaxInvulnerables: u32 = 100;
+}
+
+impl pallet_collator_selection::Config for Runtime {
+	type RuntimeEvent = RuntimeEvent;
+	type Currency = Balances;
+	// We allow root only to execute privileged collator selection operations.
+	type UpdateOrigin = EnsureRoot<AccountId>;
+	type PotId = PotId;
+	type MaxCandidates = MaxCandidates;
+	type MinCandidates = MinCandidates;
+	type MaxInvulnerables = MaxInvulnerables;
+	// todo:collator kick threshold should be in storage and configured only by root -- or rather UpdateOrigin
+	// Should be a multiple of session or things will get inconsistent.
+	type KickThreshold = SessionPeriod;
+	type ValidatorId = <Self as frame_system::Config>::AccountId;
+	type ValidatorIdOf = pallet_collator_selection::IdentityCollator;
+	type ValidatorRegistration = Session;
+	type WeightInfo = ();
+}
modifiedruntime/common/config/pallets/mod.rsdiffbeforeafterboth
--- a/runtime/common/config/pallets/mod.rs
+++ b/runtime/common/config/pallets/mod.rs
@@ -46,6 +46,9 @@
 #[cfg(feature = "app-promotion")]
 pub mod app_promotion;
 
+#[cfg(feature = "collator-selection")]
+pub mod collator_selection;
+
 parameter_types! {
 	pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account_truncating();
 	pub const CollectionCreationPrice: Balance = 2 * UNIQUE;
modifiedruntime/common/config/substrate.rsdiffbeforeafterboth
--- a/runtime/common/config/substrate.rs
+++ b/runtime/common/config/substrate.rs
@@ -34,7 +34,7 @@
 };
 use crate::{
 	runtime_common::DealWithFees, Runtime, RuntimeEvent, RuntimeCall, RuntimeOrigin, PalletInfo,
-	System, Balances, Treasury, SS58Prefix, Aura, Session, SessionKeys, CollatorSelection, Version,
+	System, Balances, Treasury, SS58Prefix, Version,
 };
 use up_common::{types::*, constants::*};
 
@@ -215,58 +215,4 @@
 	type AuthorityId = AuraId;
 	type DisabledValidators = ();
 	type MaxAuthorities = MaxAuthorities;
-}
-
-parameter_types! {
-	pub const SessionPeriod: BlockNumber = HOURS;
-	pub const SessionOffset: BlockNumber = 0;
-}
-
-impl pallet_session::Config for Runtime {
-	type RuntimeEvent = RuntimeEvent;
-	type ValidatorId = <Self as frame_system::Config>::AccountId;
-	// we don't have stash and controller, thus we don't need the convert as well.
-	type ValidatorIdOf = pallet_collator_selection::IdentityCollator;
-	type ShouldEndSession = pallet_session::PeriodicSessions<SessionPeriod, SessionOffset>;
-	type NextSessionRotation = pallet_session::PeriodicSessions<SessionPeriod, SessionOffset>;
-	type SessionManager = CollatorSelection;
-	// Essentially just Aura, but lets be pedantic.
-	type SessionHandler = <SessionKeys as sp_runtime::traits::OpaqueKeys>::KeyTypeIdProviders;
-	type Keys = SessionKeys;
-	type WeightInfo = pallet_session::weights::SubstrateWeight<Self>; // ();
-}
-
-parameter_types! {
-	pub const UncleGenerations: u32 = 0;
-}
-
-impl pallet_authorship::Config for Runtime {
-	type FindAuthor = pallet_session::FindAccountFromAuthorIndex<Self, Aura>;
-	type UncleGenerations = UncleGenerations;
-	type FilterUncle = ();
-	type EventHandler = CollatorSelection;
-}
-
-parameter_types! {
-	pub const PotId: PalletId = PalletId(*b"PotStake");
-	pub const MaxCandidates: u32 = 1000;
-	pub const MinCandidates: u32 = 5;
-	pub const MaxInvulnerables: u32 = 100;
-}
-
-impl pallet_collator_selection::Config for Runtime {
-	type RuntimeEvent = RuntimeEvent;
-	type Currency = Balances;
-	// We allow root only to execute privileged collator selection operations.
-	type UpdateOrigin = EnsureRoot<AccountId>;
-	type PotId = PotId;
-	type MaxCandidates = MaxCandidates;
-	type MinCandidates = MinCandidates;
-	type MaxInvulnerables = MaxInvulnerables;
-	// Should be a multiple of session or things will get inconsistent.
-	type KickThreshold = SessionPeriod;
-	type ValidatorId = <Self as frame_system::Config>::AccountId;
-	type ValidatorIdOf = pallet_collator_selection::IdentityCollator;
-	type ValidatorRegistration = Session;
-	type WeightInfo = ();
 }
modifiedruntime/common/construct_runtime/mod.rsdiffbeforeafterboth
--- a/runtime/common/construct_runtime/mod.rs
+++ b/runtime/common/construct_runtime/mod.rs
@@ -32,9 +32,15 @@
                 ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,
                 ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,
 
+                #[runtimes(opal)]
                 Authorship: pallet_authorship::{Pallet, Call, Storage} = 22,
+
+                #[runtimes(opal)]
                 CollatorSelection: pallet_collator_selection::{Pallet, Call, Storage, Event<T>, Config<T>} = 23,
+
+                #[runtimes(opal)]
                 Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>} = 24,
+
                 Aura: pallet_aura::{Pallet, Config<T>} = 25,
                 AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 26,
 
modifiedruntime/common/mod.rsdiffbeforeafterboth
--- a/runtime/common/mod.rs
+++ b/runtime/common/mod.rs
@@ -180,154 +180,166 @@
 pub struct AuraToCollatorSelection;
 impl frame_support::traits::OnRuntimeUpgrade for AuraToCollatorSelection {
 	fn on_runtime_upgrade() -> Weight {
-		use frame_support::{BoundedVec, storage::migration};
-		use sp_runtime::{
-			traits::{OpaqueKeys, Saturating},
-			RuntimeAppPublic,
-		};
-		use pallet_session::SessionManager;
-		use up_common::constants::EXISTENTIAL_DEPOSIT;
-		use crate::config::substrate::MaxInvulnerables;
-
-		let mut weight = <Runtime as frame_system::Config>::DbWeight::get().reads(1);
+		#[cfg(feature = "collator-selection")]
+		{
+			use frame_support::{BoundedVec, storage::migration};
+			use sp_runtime::{
+				traits::{OpaqueKeys, Saturating},
+				RuntimeAppPublic,
+			};
+			use pallet_session::SessionManager;
+			use up_common::constants::CANDIDACY_BOND;
+			use crate::config::pallets::collator_selection::MaxInvulnerables;
 
-		let version =
-			migration::get_storage_value::<()>(b"AuraToCollatorSelection", b"StorageVersion", &[]);
-
-		let should_upgrade = match version {
-			None => true,
-			Some(_) => false,
-		};
+			let mut weight = <Runtime as frame_system::Config>::DbWeight::get().reads(1);
 
-		if should_upgrade {
-			log::info!(
-				target: "runtime::aura_to_collator_selection",
-				"Running migration of Aura authorities to Collator Selection invulnerables"
+			let version = migration::get_storage_value::<()>(
+				b"AuraToCollatorSelection",
+				b"StorageVersion",
+				&[],
 			);
 
-			let invulnerables = pallet_aura::Pallet::<Runtime>::authorities()
-				.iter()
-				.cloned()
-				.filter_map(|authority_id| {
-					weight.saturating_accrue(<Runtime as frame_system::Config>::DbWeight::get().reads_writes(1, 1));
-					let vec = authority_id.clone().to_raw_vec();
-					let slice = vec.as_slice();
-					let array: Option<[u8; 32]> = match slice.try_into() {
-						Ok(a) => Some(a),
-						Err(_) => {
-							log::error!("Failed to convert an Aura authority to a Collator Selection invulnerable: {:?}", authority_id);
-							None
-						},
-					};
-					array.map(|a| (AccountId::from(a), authority_id))
-				})
-				.collect::<Vec<_>>();
+			let should_upgrade = match version {
+				None => true,
+				Some(_) => false,
+			};
+
+			if should_upgrade {
+				log::info!(
+					target: "runtime::aura_to_collator_selection",
+					"Running migration of Aura authorities to Collator Selection invulnerables"
+				);
 
-			let bounded_invulnerables = BoundedVec::<_, MaxInvulnerables>::try_from(
-				invulnerables
+				let invulnerables = pallet_aura::Pallet::<Runtime>::authorities()
 					.iter()
 					.cloned()
-					.map(|(acc, _)| acc)
-					.collect::<Vec<_>>(),
-			)
-			.expect("Existing collators/invulnerables are more than MaxInvulnerables");
+					.filter_map(|authority_id| {
+						weight.saturating_accrue(<Runtime as frame_system::Config>::DbWeight::get().reads_writes(1, 1));
+						let vec = authority_id.clone().to_raw_vec();
+						let slice = vec.as_slice();
+						let array: Option<[u8; 32]> = match slice.try_into() {
+							Ok(a) => Some(a),
+							Err(_) => {
+								log::error!("Failed to convert an Aura authority to a Collator Selection invulnerable: {:?}", authority_id);
+								None
+							},
+						};
+						array.map(|a| (AccountId::from(a), authority_id))
+					})
+					.collect::<Vec<_>>();
 
-			<pallet_collator_selection::Invulnerables<Runtime>>::put(bounded_invulnerables);
-			<pallet_collator_selection::DesiredCandidates<Runtime>>::put(0);
-			<pallet_collator_selection::CandidacyBond<Runtime>>::put(EXISTENTIAL_DEPOSIT * 16);
+				let bounded_invulnerables = BoundedVec::<_, MaxInvulnerables>::try_from(
+					invulnerables
+						.iter()
+						.cloned()
+						.map(|(acc, _)| acc)
+						.collect::<Vec<_>>(),
+				)
+				.expect("Existing collators/invulnerables are more than MaxInvulnerables");
+
+				<pallet_collator_selection::Invulnerables<Runtime>>::put(bounded_invulnerables);
+				<pallet_collator_selection::DesiredCandidates<Runtime>>::put(0);
+				<pallet_collator_selection::CandidacyBond<Runtime>>::put(CANDIDACY_BOND);
 
-			let keys = invulnerables
-				.into_iter()
-				.map(|(acc, aura)| {
-					(
-						acc.clone(),                        // account id
-						acc,                                // validator id
-						SessionKeys { aura: aura.clone() }, // session keys
-					)
-				})
-				.collect::<Vec<_>>();
+				let keys = invulnerables
+					.into_iter()
+					.map(|(acc, aura)| {
+						(
+							acc.clone(),                        // account id
+							acc,                                // validator id
+							SessionKeys { aura: aura.clone() }, // session keys
+						)
+					})
+					.collect::<Vec<_>>();
 
-			for (account, val, keys) in keys.iter().cloned() {
-				for id in <Runtime as pallet_session::Config>::Keys::key_ids() {
-					<pallet_session::KeyOwner<Runtime>>::insert((*id, keys.get_raw(*id)), &val)
-				}
-				<pallet_session::NextKeys<Runtime>>::insert(&val, &keys);
-				// todo exercise caution, the following is taken from genesis
-				if frame_system::Pallet::<Runtime>::inc_consumers_without_limit(&account).is_err() {
-					log::warn!(
-						"We have entered an error with incrementing consumers without limit during the migration"
-					);
-					// This will leak a provider reference, however it only happens once (at
-					// genesis) so it's really not a big deal and we assume that the user wants to
-					// do this since it's the only way a non-endowed account can contain a session
-					// key.
-					frame_system::Pallet::<Runtime>::inc_providers(&account);
+				for (account, val, keys) in keys.iter().cloned() {
+					for id in <Runtime as pallet_session::Config>::Keys::key_ids() {
+						<pallet_session::KeyOwner<Runtime>>::insert((*id, keys.get_raw(*id)), &val)
+					}
+					<pallet_session::NextKeys<Runtime>>::insert(&val, &keys);
+					// todo exercise caution, the following is taken from genesis
+					if frame_system::Pallet::<Runtime>::inc_consumers_without_limit(&account)
+						.is_err()
+					{
+						log::warn!(
+							"We have entered an error with incrementing consumers without limit during the migration"
+						);
+						// This will leak a provider reference, however it only happens once (at
+						// genesis) so it's really not a big deal and we assume that the user wants to
+						// do this since it's the only way a non-endowed account can contain a session
+						// key.
+						frame_system::Pallet::<Runtime>::inc_providers(&account);
+					}
 				}
-			}
 
-			let initial_validators_0 =
-				<Runtime as pallet_session::Config>::SessionManager::new_session(0).unwrap_or_else(
-					|| {
-						frame_support::print(
-							"No initial validator provided by `SessionManager`, use \
-						session config keys to generate initial validator set.",
-						);
-						keys.iter().map(|x| x.1.clone()).collect()
-					},
-				);
-			/*assert!(
-				!initial_validators_0.is_empty(),
-				"Empty validator set for session 0 in (pseudo) genesis block!"
-			);*/
+				let initial_validators_0 =
+					<Runtime as pallet_session::Config>::SessionManager::new_session(0)
+						.unwrap_or_else(|| {
+							frame_support::print(
+								"No initial validator provided by `SessionManager`, use \
+							session config keys to generate initial validator set.",
+							);
+							keys.iter().map(|x| x.1.clone()).collect()
+						});
+				/*assert!(
+					!initial_validators_0.is_empty(),
+					"Empty validator set for session 0 in (pseudo) genesis block!"
+				);*/
 
-			let initial_validators_1 =
-				<Runtime as pallet_session::Config>::SessionManager::new_session(1)
-					.unwrap_or_else(|| initial_validators_0.clone());
-			/*assert!(
-				!initial_validators_1.is_empty(),
-				"Empty validator set for session 1 in (pseudo) genesis block!"
-			);*/
+				let initial_validators_1 =
+					<Runtime as pallet_session::Config>::SessionManager::new_session(1)
+						.unwrap_or_else(|| initial_validators_0.clone());
+				/*assert!(
+					!initial_validators_1.is_empty(),
+					"Empty validator set for session 1 in (pseudo) genesis block!"
+				);*/
 
-			let queued_keys: Vec<_> = initial_validators_1
-				.iter()
-				.cloned()
-				.map(|v| {
-					(
-						v.clone(),
-						<pallet_session::NextKeys<Runtime>>::get(&v)
-							.expect("Validator in session 1 missing keys!"),
-					)
-				})
-				.collect();
+				let queued_keys: Vec<_> = initial_validators_1
+					.iter()
+					.cloned()
+					.map(|v| {
+						(
+							v.clone(),
+							<pallet_session::NextKeys<Runtime>>::get(&v)
+								.expect("Validator in session 1 missing keys!"),
+						)
+					})
+					.collect();
 
-			// Tell everyone about the genesis session keys -- Aura must've already initialized it
-			//<Runtime as pallet_session::Config>::SessionHandler::on_genesis_session::<<Runtime as pallet_session::Config>::Keys>(&queued_keys);
+				// Tell everyone about the genesis session keys -- Aura must've already initialized it
+				//<Runtime as pallet_session::Config>::SessionHandler::on_genesis_session::<<Runtime as pallet_session::Config>::Keys>(&queued_keys);
+
+				<pallet_session::Validators<Runtime>>::put(initial_validators_0);
+				<pallet_session::QueuedKeys<Runtime>>::put(queued_keys);
 
-			<pallet_session::Validators<Runtime>>::put(initial_validators_0);
-			<pallet_session::QueuedKeys<Runtime>>::put(queued_keys);
+				<Runtime as pallet_session::Config>::SessionManager::start_session(0);
 
-			<Runtime as pallet_session::Config>::SessionManager::start_session(0);
+				log::info!(
+					target: "runtime::aura_to_collator_selection",
+					"Migration of Aura authorities to Collator Selection invulnerables is complete."
+				);
 
-			log::info!(
-				target: "runtime::aura_to_collator_selection",
-				"Migration of Aura authorities to Collator Selection invulnerables is complete."
-			);
+				migration::put_storage_value::<()>(
+					b"AuraToCollatorSelection",
+					b"StorageVersion",
+					&[],
+					(),
+				);
 
-			migration::put_storage_value::<()>(
-				b"AuraToCollatorSelection",
-				b"StorageVersion",
-				&[],
-				(),
-			);
+				weight += <Runtime as frame_system::Config>::DbWeight::get().writes(1)
+			} else {
+				log::info!(
+					target: "runtime::aura_to_collator_selection",
+					"The storage migration has already been flagged as complete. No migration needs to be done.",
+				);
+			}
 
-			weight += <Runtime as frame_system::Config>::DbWeight::get().writes(1)
-		} else {
-			log::info!(
-				target: "runtime::aura_to_collator_selection",
-				"The storage migration has already been flagged as complete. No migration needs to be done.",
-			);
+			weight
 		}
 
-		weight
+		#[cfg(not(feature = "collator-selection"))]
+		{
+			Weight::zero()
+		}
 	}
 }
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -173,13 +173,14 @@
     "pallet-foreign-assets/std",
 ]
 limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-opal-runtime = ['refungible', 'rmrk', 'app-promotion', 'foreign-assets']
+opal-runtime = ['refungible', 'rmrk', 'app-promotion', 'foreign-assets', 'collator-selection']
 
 refungible = []
 scheduler = []
 rmrk = []
 foreign-assets = []
 app-promotion = []
+collator-selection = []
 
 ################################################################################
 # Substrate Dependencies
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
before · runtime/quartz/Cargo.toml
1################################################################################2# Package34cargo-features = ["workspace-inheritance"]56[package]7authors = ['Unique Network <support@uniquenetwork.io>']8build = 'build.rs'9description = 'Quartz Runtime'10edition = '2021'11homepage = 'https://unique.network'12license = 'GPLv3'13name = 'quartz-runtime'14repository = 'https://github.com/UniqueNetwork/unique-chain'15version = '0.9.30'1617[package.metadata.docs.rs]18targets = ['x86_64-unknown-linux-gnu']1920[features]21default = ['std', 'quartz-runtime']22runtime-benchmarks = [23    'hex-literal',24    'frame-benchmarking',25    'frame-support/runtime-benchmarks',26    'frame-system-benchmarking',27    'frame-system/runtime-benchmarks',28    'pallet-ethereum/runtime-benchmarks',29    'pallet-evm-migration/runtime-benchmarks',30    'pallet-evm-coder-substrate/runtime-benchmarks',31    'pallet-balances/runtime-benchmarks',32	"pallet-collator-selection/runtime-benchmarks",33    'pallet-timestamp/runtime-benchmarks',34    'pallet-common/runtime-benchmarks',35    'pallet-structure/runtime-benchmarks',36    'pallet-fungible/runtime-benchmarks',37    'pallet-refungible/runtime-benchmarks',38    'pallet-nonfungible/runtime-benchmarks',39    'pallet-proxy-rmrk-core/runtime-benchmarks',40    'pallet-proxy-rmrk-equip/runtime-benchmarks',41    'pallet-unique/runtime-benchmarks',42    'pallet-foreign-assets/runtime-benchmarks',43    'pallet-inflation/runtime-benchmarks',44    'pallet-unique-scheduler/runtime-benchmarks',45    'pallet-xcm/runtime-benchmarks',46    'sp-runtime/runtime-benchmarks',47    'xcm-builder/runtime-benchmarks',48]49try-runtime = [50    'frame-try-runtime',51    'frame-executive/try-runtime',52    'frame-support/try-runtime',53    'frame-system/try-runtime',54    'cumulus-pallet-parachain-system/try-runtime',55    'parachain-info/try-runtime',56    'pallet-aura/try-runtime',57    'cumulus-pallet-aura-ext/try-runtime',58    'pallet-balances/try-runtime',59    'pallet-randomness-collective-flip/try-runtime',60    'pallet-timestamp/try-runtime',61    'pallet-transaction-payment/try-runtime',62    'pallet-treasury/try-runtime',63    'pallet-sudo/try-runtime',64    'orml-vesting/try-runtime',65    'orml-xtokens/try-runtime',66    'orml-tokens/try-runtime',67    'cumulus-pallet-xcmp-queue/try-runtime',68    'pallet-xcm/try-runtime',69    'cumulus-pallet-xcm/try-runtime',70    'cumulus-pallet-dmp-queue/try-runtime',71    'pallet-inflation/try-runtime',72    'pallet-unique/try-runtime',73    'pallet-unique-scheduler/try-runtime',74    'pallet-configuration/try-runtime',75    'pallet-charge-transaction/try-runtime',76    'pallet-common/try-runtime',77    'pallet-fungible/try-runtime',78    'pallet-refungible/try-runtime',79    'pallet-nonfungible/try-runtime',80    'pallet-structure/try-runtime',81    'pallet-proxy-rmrk-core/try-runtime',82    'pallet-proxy-rmrk-equip/try-runtime',83    'pallet-app-promotion/try-runtime',84    'pallet-foreign-assets/try-runtime',85    'pallet-evm/try-runtime',86    'pallet-ethereum/try-runtime',87    'pallet-evm-coder-substrate/try-runtime',88    'pallet-evm-contract-helpers/try-runtime',89    'pallet-evm-transaction-payment/try-runtime',90    'pallet-evm-migration/try-runtime',91]92std = [93    'codec/std',94    'cumulus-pallet-aura-ext/std',95    'cumulus-pallet-parachain-system/std',96    'cumulus-pallet-xcm/std',97    'cumulus-pallet-xcmp-queue/std',98    'cumulus-primitives-core/std',99    'cumulus-primitives-utility/std',100    'frame-try-runtime/std',101    'frame-executive/std',102    'frame-support/std',103    'frame-system/std',104    'frame-system-rpc-runtime-api/std',105    'pallet-aura/std',106    'pallet-balances/std',107    # 'pallet-contracts/std',108    # 'pallet-contracts-primitives/std',109    # 'pallet-contracts-rpc-runtime-api/std',110    # 'pallet-contract-helpers/std',111	"pallet-authorship/std",112	'pallet-collator-selection/std',113	"pallet-session/std",114    'pallet-randomness-collective-flip/std',115    'pallet-sudo/std',116    'pallet-timestamp/std',117    'pallet-transaction-payment/std',118    'pallet-transaction-payment-rpc-runtime-api/std',119    'pallet-treasury/std',120    'pallet-evm/std',121    'pallet-evm-migration/std',122    'pallet-evm-contract-helpers/std',123    'pallet-evm-transaction-payment/std',124    'pallet-evm-coder-substrate/std',125    'pallet-ethereum/std',126    'pallet-base-fee/std',127    'fp-rpc/std',128    'up-rpc/std',129    'app-promotion-rpc/std',130    'fp-evm-mapping/std',131    'fp-self-contained/std',132    'parachain-info/std',133    'serde',134    'pallet-inflation/std',135    'pallet-configuration/std',136    'pallet-common/std',137    'pallet-structure/std',138    'pallet-fungible/std',139    'pallet-refungible/std',140    'pallet-nonfungible/std',141    'pallet-proxy-rmrk-core/std',142    'pallet-proxy-rmrk-equip/std',143    'pallet-unique/std',144    'pallet-unique-scheduler/std',145    'pallet-charge-transaction/std',146    'up-data-structs/std',147    'sp-api/std',148    'sp-block-builder/std',149    "sp-consensus-aura/std",150    'sp-core/std',151    'sp-inherents/std',152    'sp-io/std',153    'sp-offchain/std',154    'sp-runtime/std',155    'sp-session/std',156    'sp-std/std',157    'sp-transaction-pool/std',158    'sp-version/std',159    'xcm/std',160    'xcm-builder/std',161    'xcm-executor/std',162    'up-common/std',163    'rmrk-rpc/std',164    'evm-coder/std',165    'up-sponsorship/std',166167    "orml-vesting/std",168    "orml-tokens/std",169    "orml-xtokens/std",170    "orml-traits/std",171    "pallet-foreign-assets/std",172]173limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']174quartz-runtime = ['refungible']175176refungible = []177scheduler = []178rmrk = []179foreign-assets = []180181################################################################################182# Substrate Dependencies183184[dependencies.codec]185default-features = false186features = ['derive']187package = 'parity-scale-codec'188version = '3.1.2'189190[dependencies.frame-benchmarking]191default-features = false192git = "https://github.com/paritytech/substrate"193optional = true194branch = "polkadot-v0.9.30"195196[dependencies.frame-try-runtime]197default-features = false198git = "https://github.com/paritytech/substrate"199optional = true200branch = "polkadot-v0.9.30"201202[dependencies.frame-executive]203default-features = false204git = "https://github.com/paritytech/substrate"205branch = "polkadot-v0.9.30"206207[dependencies.frame-support]208default-features = false209git = "https://github.com/paritytech/substrate"210branch = "polkadot-v0.9.30"211212[dependencies.frame-system]213default-features = false214git = "https://github.com/paritytech/substrate"215branch = "polkadot-v0.9.30"216217[dependencies.frame-system-benchmarking]218default-features = false219git = "https://github.com/paritytech/substrate"220optional = true221branch = "polkadot-v0.9.30"222223[dependencies.frame-system-rpc-runtime-api]224default-features = false225git = "https://github.com/paritytech/substrate"226branch = "polkadot-v0.9.30"227228[dependencies.hex-literal]229optional = true230version = '0.3.3'231232[dependencies.serde]233default-features = false234features = ['derive']235optional = true236version = '1.0.130'237238[dependencies.pallet-aura]239default-features = false240git = "https://github.com/paritytech/substrate"241branch = "polkadot-v0.9.30"242243[dependencies.pallet-collator-selection]244default-features = false245git = 'https://github.com/paritytech/cumulus'246branch = 'polkadot-v0.9.30'247248[dependencies.pallet-authorship]249default-features = false250git = 'https://github.com/paritytech/substrate'251branch = 'polkadot-v0.9.30'252253[dependencies.pallet-session]254default-features = false255git = 'https://github.com/paritytech/substrate'256branch = 'polkadot-v0.9.30'257258[dependencies.pallet-balances]259default-features = false260git = "https://github.com/paritytech/substrate"261branch = "polkadot-v0.9.30"262263# Contracts specific packages264# [dependencies.pallet-contracts]265# git = 'https://github.com/paritytech/substrate'266# default-features = false267# branch = 'master'268# version = '4.0.0-dev'269270# [dependencies.pallet-contracts-primitives]271# git = 'https://github.com/paritytech/substrate'272# default-features = false273# branch = 'master'274# version = '4.0.0-dev'275276# [dependencies.pallet-contracts-rpc-runtime-api]277# git = 'https://github.com/paritytech/substrate'278# default-features = false279# branch = 'master'280# version = '4.0.0-dev'281282[dependencies.pallet-randomness-collective-flip]283default-features = false284git = "https://github.com/paritytech/substrate"285branch = "polkadot-v0.9.30"286287[dependencies.pallet-sudo]288default-features = false289git = "https://github.com/paritytech/substrate"290branch = "polkadot-v0.9.30"291292[dependencies.pallet-timestamp]293default-features = false294git = "https://github.com/paritytech/substrate"295branch = "polkadot-v0.9.30"296297[dependencies.pallet-transaction-payment]298default-features = false299git = "https://github.com/paritytech/substrate"300branch = "polkadot-v0.9.30"301302[dependencies.pallet-transaction-payment-rpc-runtime-api]303default-features = false304git = "https://github.com/paritytech/substrate"305branch = "polkadot-v0.9.30"306307[dependencies.pallet-treasury]308default-features = false309git = "https://github.com/paritytech/substrate"310branch = "polkadot-v0.9.30"311312[dependencies.sp-arithmetic]313default-features = false314git = "https://github.com/paritytech/substrate"315branch = "polkadot-v0.9.30"316317[dependencies.sp-api]318default-features = false319git = "https://github.com/paritytech/substrate"320branch = "polkadot-v0.9.30"321322[dependencies.sp-block-builder]323default-features = false324git = "https://github.com/paritytech/substrate"325branch = "polkadot-v0.9.30"326327[dependencies.sp-core]328default-features = false329git = "https://github.com/paritytech/substrate"330branch = "polkadot-v0.9.30"331332[dependencies.sp-consensus-aura]333default-features = false334git = "https://github.com/paritytech/substrate"335branch = "polkadot-v0.9.30"336337[dependencies.sp-inherents]338default-features = false339git = "https://github.com/paritytech/substrate"340branch = "polkadot-v0.9.30"341342[dependencies.sp-io]343default-features = false344git = "https://github.com/paritytech/substrate"345branch = "polkadot-v0.9.30"346347[dependencies.sp-offchain]348default-features = false349git = "https://github.com/paritytech/substrate"350branch = "polkadot-v0.9.30"351352[dependencies.sp-runtime]353default-features = false354git = "https://github.com/paritytech/substrate"355branch = "polkadot-v0.9.30"356357[dependencies.sp-session]358default-features = false359git = "https://github.com/paritytech/substrate"360branch = "polkadot-v0.9.30"361362[dependencies.sp-std]363default-features = false364git = "https://github.com/paritytech/substrate"365branch = "polkadot-v0.9.30"366367[dependencies.sp-transaction-pool]368default-features = false369git = "https://github.com/paritytech/substrate"370branch = "polkadot-v0.9.30"371372[dependencies.sp-version]373default-features = false374git = "https://github.com/paritytech/substrate"375branch = "polkadot-v0.9.30"376377[dependencies.smallvec]378version = '1.6.1'379380################################################################################381# Cumulus dependencies382383[dependencies.parachain-info]384default-features = false385git = "https://github.com/paritytech/cumulus"386branch = "polkadot-v0.9.30"387388[dependencies.cumulus-pallet-aura-ext]389git = "https://github.com/paritytech/cumulus"390branch = "polkadot-v0.9.30"391default-features = false392393[dependencies.cumulus-pallet-parachain-system]394git = "https://github.com/paritytech/cumulus"395branch = "polkadot-v0.9.30"396default-features = false397398[dependencies.cumulus-primitives-core]399git = "https://github.com/paritytech/cumulus"400branch = "polkadot-v0.9.30"401default-features = false402403[dependencies.cumulus-pallet-xcm]404git = "https://github.com/paritytech/cumulus"405branch = "polkadot-v0.9.30"406default-features = false407408[dependencies.cumulus-pallet-dmp-queue]409git = "https://github.com/paritytech/cumulus"410branch = "polkadot-v0.9.30"411default-features = false412413[dependencies.cumulus-pallet-xcmp-queue]414git = "https://github.com/paritytech/cumulus"415branch = "polkadot-v0.9.30"416default-features = false417418[dependencies.cumulus-primitives-utility]419git = "https://github.com/paritytech/cumulus"420branch = "polkadot-v0.9.30"421default-features = false422423[dependencies.cumulus-primitives-timestamp]424git = "https://github.com/paritytech/cumulus"425branch = "polkadot-v0.9.30"426default-features = false427428################################################################################429# Polkadot dependencies430431[dependencies.polkadot-parachain]432git = "https://github.com/paritytech/polkadot"433branch = "release-v0.9.30"434default-features = false435436[dependencies.xcm]437git = "https://github.com/paritytech/polkadot"438branch = "release-v0.9.30"439default-features = false440441[dependencies.xcm-builder]442git = "https://github.com/paritytech/polkadot"443branch = "release-v0.9.30"444default-features = false445446[dependencies.xcm-executor]447git = "https://github.com/paritytech/polkadot"448branch = "release-v0.9.30"449default-features = false450451[dependencies.pallet-xcm]452git = "https://github.com/paritytech/polkadot"453branch = "release-v0.9.30"454default-features = false455456################################################################################457# RMRK dependencies458459# todo git460[dependencies.rmrk-rpc]461default-features = false462path = "../../primitives/rmrk-rpc"463464################################################################################465# local dependencies466467[dependencies]468orml-vesting.workspace = true469orml-xtokens.workspace = true470orml-tokens.workspace = true471orml-traits.workspace = true472473log = { version = "0.4.16", default-features = false }474up-common = { path = "../../primitives/common", default-features = false }475scale-info = { version = "2.0.1", default-features = false, features = [476    "derive",477] }478derivative = "2.2.0"479pallet-unique = { path = '../../pallets/unique', default-features = false }480up-rpc = { path = "../../primitives/rpc", default-features = false }481app-promotion-rpc = { path = "../../primitives/app_promotion_rpc", default-features = false }482fp-evm-mapping = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }483pallet-inflation = { path = '../../pallets/inflation', default-features = false }484pallet-app-promotion = { path = '../../pallets/app-promotion', default-features = false }485up-data-structs = { path = '../../primitives/data-structs', default-features = false }486pallet-configuration = { default-features = false, path = "../../pallets/configuration" }487pallet-common = { default-features = false, path = "../../pallets/common" }488pallet-structure = { default-features = false, path = "../../pallets/structure" }489pallet-fungible = { default-features = false, path = "../../pallets/fungible" }490pallet-refungible = { default-features = false, path = "../../pallets/refungible" }491pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }492pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }493pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }494pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }495# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }496pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.30", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }497pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }498pallet-evm-contract-helpers = { path = '../../pallets/evm-contract-helpers', default-features = false }499pallet-evm-transaction-payment = { path = '../../pallets/evm-transaction-payment', default-features = false }500pallet-evm-coder-substrate = { default-features = false, path = "../../pallets/evm-coder-substrate" }501pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }502pallet-ethereum = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }503pallet-base-fee = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }504fp-rpc = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }505fp-self-contained = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }506evm-coder = { default-features = false, path = '../../crates/evm-coder' }507up-sponsorship = { default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = 'polkadot-v0.9.30' }508pallet-foreign-assets = { default-features = false, path = "../../pallets/foreign-assets" }509510################################################################################511# Other Dependencies512513impl-trait-for-tuples = "0.2.2"514515################################################################################516# Dev Dependencies517518[dev-dependencies.logtest]519version = "2.0.0"520521################################################################################522# Build Dependencies523524[build-dependencies.substrate-wasm-builder]525git = "https://github.com/paritytech/substrate"526branch = "polkadot-v0.9.30"
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -178,6 +178,7 @@
 scheduler = []
 rmrk = []
 foreign-assets = []
+collator-selection = []
 
 ################################################################################
 # Substrate Dependencies