From 492e5fb68f990c5d1b40a7ca452401fd46708f31 Mon Sep 17 00:00:00 2001 From: ytqaljn <2716693942@qq.com> Date: Mon, 5 Aug 2024 16:28:19 +0800 Subject: [PATCH 1/2] update version --- Cargo.lock | 4 ++-- standalone/chain/node/Cargo.toml | 2 +- standalone/chain/runtime/Cargo.toml | 2 +- standalone/chain/runtime/src/lib.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0b9bef07..419c6f19 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1558,7 +1558,7 @@ dependencies = [ [[package]] name = "cess-node" -version = "0.7.7" +version = "0.7.8-Venus" dependencies = [ "array-bytes 6.2.3", "async-trait", @@ -1662,7 +1662,7 @@ dependencies = [ [[package]] name = "cess-node-runtime" -version = "0.8.0" +version = "0.8.1" dependencies = [ "ces-pallet-mq", "ces-pallet-mq-runtime-api", diff --git a/standalone/chain/node/Cargo.toml b/standalone/chain/node/Cargo.toml index d3349db6..d15f0046 100644 --- a/standalone/chain/node/Cargo.toml +++ b/standalone/chain/node/Cargo.toml @@ -6,7 +6,7 @@ edition = '2021' license = 'Unlicense' name = 'cess-node' repository = 'https://github.com/CESSProject/cess' -version = '0.7.7' +version = '0.7.8-Venus' [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/standalone/chain/runtime/Cargo.toml b/standalone/chain/runtime/Cargo.toml index 50a847cc..15bc9ecc 100644 --- a/standalone/chain/runtime/Cargo.toml +++ b/standalone/chain/runtime/Cargo.toml @@ -4,7 +4,7 @@ edition = "2021" license = "Unlicense" name = "cess-node-runtime" repository = "https://github.com/CESSProject/cess" -version = "0.8.0" +version = "0.8.1" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/standalone/chain/runtime/src/lib.rs b/standalone/chain/runtime/src/lib.rs index 7382bcee..988edbbe 100644 --- a/standalone/chain/runtime/src/lib.rs +++ b/standalone/chain/runtime/src/lib.rs @@ -136,7 +136,7 @@ pub fn wasm_binary_unwrap() -> &'static [u8] { ) } -/// Runtime version. +/// Runtime version. #[sp_version::runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("cess-node"), @@ -146,7 +146,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to 0. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 107, + spec_version: 108, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From e12b822610f4b3dcdb215820f176634cc7a9c75f Mon Sep 17 00:00:00 2001 From: ytqaljn <2716693942@qq.com> Date: Fri, 9 Aug 2024 16:54:37 +0800 Subject: [PATCH 2/2] fix: fix gas fee and territory rename bug --- pallets/storage-handler/src/lib.rs | 3 +++ standalone/chain/runtime/src/lib.rs | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pallets/storage-handler/src/lib.rs b/pallets/storage-handler/src/lib.rs index 122a502f..0ab6f929 100644 --- a/pallets/storage-handler/src/lib.rs +++ b/pallets/storage-handler/src/lib.rs @@ -254,6 +254,8 @@ pub mod pallet { OwnConsignment, /// When casting a territory, it must be at least 30 days BoundariesNotMet, + /// The redefined name is repeated and new_name cannot be used instead + DuplicateName, } #[pallet::storage] @@ -779,6 +781,7 @@ pub mod pallet { ) -> DispatchResult { let sender = ensure_signed(origin)?; let territory = >::try_get(&sender, &old_name).map_err(|_| Error::::NotHaveTerritory)?; + ensure!(!>::contains_key(&sender, &new_name), Error::::DuplicateName); ensure!(territory.state == TerritoryState::Active, Error::::NotActive); ensure!(territory.total_space == territory.remaining_space, Error::::ObjectNotZero); >::remove(&sender, &old_name); diff --git a/standalone/chain/runtime/src/lib.rs b/standalone/chain/runtime/src/lib.rs index 988edbbe..94766c8e 100644 --- a/standalone/chain/runtime/src/lib.rs +++ b/standalone/chain/runtime/src/lib.rs @@ -146,7 +146,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to 0. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 108, + spec_version: 115, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -432,7 +432,7 @@ impl pallet_balances::Config for Runtime { } parameter_types! { - pub const TransactionByteFee: Balance = 10 * MILLICENTS; + pub const TransactionByteFee: Balance = MILLICENTS; pub const OperationalFeeMultiplier: u8 = 5; pub const TargetBlockFullness: Perquintill = Perquintill::from_percent(25); pub AdjustmentVariable: Multiplier = Multiplier::saturating_from_rational(1, 100_000); @@ -444,7 +444,7 @@ impl pallet_transaction_payment::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = CurrencyAdapter; type OperationalFeeMultiplier = OperationalFeeMultiplier; - type WeightToFee = IdentityFee; + type WeightToFee = ConstantMultiplier>; type LengthToFee = ConstantMultiplier; type FeeMultiplierUpdate = TargetedFeeAdjustment;