git.delta.rocks / unique-network / refs/commits / 150e9b0efa3f

difftreelog

chore update target weight2fee

Igor Kozyrev2022-06-21parent: #503034b.patch.diff
in: master

4 files changed

modifiedruntime/common/src/constants.rsdiffbeforeafterboth
before · runtime/common/src/constants.rs
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 sp_runtime::Perbill;18use frame_support::{19	parameter_types,20	weights::{Weight, constants::WEIGHT_PER_SECOND},21};22use crate::types::{BlockNumber, Balance};2324pub const MILLISECS_PER_BLOCK: u64 = 12000;2526pub const SLOT_DURATION: u64 = MILLISECS_PER_BLOCK;2728// These time units are defined in number of blocks.29pub const MINUTES: BlockNumber = 60_000 / (MILLISECS_PER_BLOCK as BlockNumber);30pub const HOURS: BlockNumber = MINUTES * 60;31pub const DAYS: BlockNumber = HOURS * 24;3233pub const MICROUNIQUE: Balance = 1_000_000_000_000;34pub const MILLIUNIQUE: Balance = 1_000 * MICROUNIQUE;35pub const CENTIUNIQUE: Balance = 10 * MILLIUNIQUE;36pub const UNIQUE: Balance = 100 * CENTIUNIQUE;3738pub const WEIGHT_TO_FEE_COEFF: u32 = 142_688_000;3940// Targeting 0.15 UNQ per transfer41pub const MIN_GAS_PRICE: u64 = 1_019_493_469_850;4243/// We assume that ~10% of the block weight is consumed by `on_initalize` handlers.44/// This is used to limit the maximal weight of a single extrinsic.45pub const AVERAGE_ON_INITIALIZE_RATIO: Perbill = Perbill::from_percent(10);46/// We allow `Normal` extrinsics to fill up the block up to 75%, the rest can be used47/// by  Operational  extrinsics.48pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);49/// We allow for 2 seconds of compute with a 6 second average block time.50pub const MAXIMUM_BLOCK_WEIGHT: Weight = WEIGHT_PER_SECOND / 2;5152parameter_types! {53	pub const DefaultSponsoringRateLimit: BlockNumber = 1 * DAYS;5455	pub const TransactionByteFee: Balance = 501 * MICROUNIQUE; // Targeting 0.1 Unique per NFT transfer56}
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -508,7 +508,6 @@
 
 	fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
 		smallvec!(WeightToFeeCoefficient {
-			// Targeting 0.1 Unique per NFT transfer
 			coeff_integer: WEIGHT_TO_FEE_COEFF.into(),
 			coeff_frac: Perbill::zero(),
 			negative: false,
modifiedruntime/quartz/src/lib.rsdiffbeforeafterboth
--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -507,7 +507,6 @@
 
 	fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
 		smallvec!(WeightToFeeCoefficient {
-			// Targeting 0.1 Unique per NFT transfer
 			coeff_integer: WEIGHT_TO_FEE_COEFF.into(),
 			coeff_frac: Perbill::zero(),
 			negative: false,
@@ -805,13 +804,8 @@
 	type LocationInverter = LocationInverter<Ancestry>;
 	type Barrier = Barrier;
 	type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
-	type Trader = UsingOnlySelfCurrencyComponents<
-		LinearFee<Balance>,
-		RelayLocation,
-		AccountId,
-		Balances,
-		(),
-	>;
+	type Trader =
+		UsingOnlySelfCurrencyComponents<LinearFee<Balance>, RelayLocation, AccountId, Balances, ()>;
 	type ResponseHandler = (); // Don't handle responses for now.
 	type SubscriptionService = PolkadotXcm;
 
modifiedruntime/unique/src/lib.rsdiffbeforeafterboth
--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -506,7 +506,6 @@
 
 	fn polynomial() -> WeightToFeeCoefficients<Self::Balance> {
 		smallvec!(WeightToFeeCoefficient {
-			// Targeting 0.1 Unique per NFT transfer
 			coeff_integer: WEIGHT_TO_FEE_COEFF.into(),
 			coeff_frac: Perbill::zero(),
 			negative: false,
@@ -804,13 +803,8 @@
 	type LocationInverter = LocationInverter<Ancestry>;
 	type Barrier = Barrier;
 	type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
-	type Trader = UsingOnlySelfCurrencyComponents<
-		LinearFee<Balance>,
-		RelayLocation,
-		AccountId,
-		Balances,
-		(),
-	>;
+	type Trader =
+		UsingOnlySelfCurrencyComponents<LinearFee<Balance>, RelayLocation, AccountId, Balances, ()>;
 	type ResponseHandler = (); // Don't handle responses for now.
 	type SubscriptionService = PolkadotXcm;