git.delta.rocks / unique-network / refs/commits / 4dd148686c6b

difftreelog

source

primitives/common/src/constants.rs3.1 KiBsourcehistory
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617use cumulus_primitives_core::relay_chain::MAX_POV_SIZE;18use frame_support::{19	parameter_types,20	weights::{constants::WEIGHT_REF_TIME_PER_SECOND, Weight},21};22use sp_runtime::Perbill;2324use crate::types::{Balance, BlockNumber};2526pub const MILLISECS_PER_BLOCK: u64 = 12000;27pub const MILLISECS_PER_RELAY_BLOCK: u64 = 6000;2829pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;3031// These time units are defined in number of blocks.32pub const MINUTES: u32 = 60_000 / (MILLISECS_PER_BLOCK as u32);33pub const HOURS: u32 = MINUTES * 60;34pub const DAYS: u32 = HOURS * 24;3536// These time units are defined in number of relay blocks.37pub const RELAY_MINUTES: u32 = 60_000 / (MILLISECS_PER_RELAY_BLOCK as u32);38pub const RELAY_HOURS: u32 = RELAY_MINUTES * 60;39pub const RELAY_DAYS: u32 = RELAY_HOURS * 24;4041pub const MICROUNIQUE: Balance = 1_000_000_000_000;42pub const MILLIUNIQUE: Balance = 1_000 * MICROUNIQUE;43pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE;44pub const UNIQUE: Balance = 100 * CENTIUNIQUE;4546/// Minimum balance required to create or keep an account open.47pub const EXISTENTIAL_DEPOSIT: u128 = 0;48/// Amount of Balance reserved for candidate registration.49pub const GENESIS_LICENSE_BOND: u128 = 1_000_000_000_000 * UNIQUE;50/// Amount of maximum collators for Collator Selection.51pub const MAX_COLLATORS: u32 = 10;52/// How long a periodic session lasts in blocks.53pub const SESSION_LENGTH: BlockNumber = HOURS;5455// Targeting 0.1 UNQ per transfer56pub const WEIGHT_TO_FEE_COEFF: u64 = /*<weight2fee>*/77_334_604_063_436_322/*</weight2fee>*/;5758// Targeting 0.15 UNQ per transfer via ETH59pub const MIN_GAS_PRICE: u64 = /*<mingasprice>*/1_920_639_188_722/*</mingasprice>*/;6061/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers.62/// This is used to limit the maximal weight of a single extrinsic.63pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);64/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used65/// by  Operational  extrinsics.66pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);67/// We allow for 2 seconds of compute with a 6 second average block time.68pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(69	WEIGHT_REF_TIME_PER_SECOND.saturating_div(2),70	MAX_POV_SIZE as u64,71);7273parameter_types! {74	pub const TransactionByteFee: Balance = 501 * MICROUNIQUE / 2;75}