diff --git a/Cargo.lock b/Cargo.lock index 9dfd69462..deac8db7c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2591,7 +2591,6 @@ dependencies = [ "pallet-balances", "pallet-identity", "pallet-timestamp", - "pallet-vesting", "parity-scale-codec", "scale-info", "sp-core", @@ -8768,7 +8767,6 @@ dependencies = [ "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", "pallet-utility", - "pallet-vesting", "pallet-xcm", "parachain-info", "parity-scale-codec", @@ -8876,7 +8874,6 @@ dependencies = [ "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", "pallet-utility", - "pallet-vesting", "pallet-xcm", "parachain-info", "parity-scale-codec", diff --git a/node/src/chain_spec/pangolin.rs b/node/src/chain_spec/pangolin.rs index 57b846906..f0bcd0017 100644 --- a/node/src/chain_spec/pangolin.rs +++ b/node/src/chain_spec/pangolin.rs @@ -166,7 +166,6 @@ pub fn genesis_config() -> ChainSpec { )], ..Default::default() }, - vesting: Default::default(), // Consensus stuff. darwinia_staking: DarwiniaStakingConfig { @@ -294,7 +293,6 @@ fn testnet_genesis( )], ..Default::default() }, - vesting: Default::default(), // Consensus stuff. darwinia_staking: DarwiniaStakingConfig { diff --git a/node/src/chain_spec/pangoro.rs b/node/src/chain_spec/pangoro.rs index d7b0ec024..82f88035a 100644 --- a/node/src/chain_spec/pangoro.rs +++ b/node/src/chain_spec/pangoro.rs @@ -166,7 +166,6 @@ pub fn genesis_config() -> ChainSpec { )], ..Default::default() }, - vesting: Default::default(), // Consensus stuff. darwinia_staking: DarwiniaStakingConfig { @@ -294,7 +293,6 @@ fn testnet_genesis( )], ..Default::default() }, - vesting: Default::default(), // Consensus stuff. darwinia_staking: DarwiniaStakingConfig { diff --git a/pallet/account-migration/Cargo.toml b/pallet/account-migration/Cargo.toml index 03c722143..6babec373 100644 --- a/pallet/account-migration/Cargo.toml +++ b/pallet/account-migration/Cargo.toml @@ -23,7 +23,6 @@ frame-system = { workspace = true } pallet-assets = { workspace = true } pallet-balances = { workspace = true } pallet-identity = { workspace = true } -pallet-vesting = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } sp-runtime = { workspace = true } @@ -54,7 +53,6 @@ std = [ "pallet-assets/std", "pallet-balances/std", "pallet-identity/std", - "pallet-vesting/std", "sp-core/std", "sp-io/std", "sp-runtime/std", diff --git a/pallet/account-migration/src/benchmarking.rs b/pallet/account-migration/src/benchmarking.rs index f10ce113f..96f1d300c 100644 --- a/pallet/account-migration/src/benchmarking.rs +++ b/pallet/account-migration/src/benchmarking.rs @@ -66,13 +66,6 @@ mod benchmarks { extra: Default::default(), }, ); - >::insert( - from, - vec![ - VestingInfo::new(1, Default::default(), Default::default()); - ::MAX_VESTING_SCHEDULES as usize - ], - ); >::insert( from, Registration { diff --git a/pallet/account-migration/src/lib.rs b/pallet/account-migration/src/lib.rs index ce04c1759..e6bde2562 100644 --- a/pallet/account-migration/src/lib.rs +++ b/pallet/account-migration/src/lib.rs @@ -63,13 +63,12 @@ use dc_primitives::{AccountId as AccountId20, AssetId, Balance, BlockNumber, Ind use frame_support::{ migration, pallet_prelude::*, - traits::{Currency, ExistenceRequirement::AllowDeath, LockableCurrency, WithdrawReasons}, + traits::{Currency, ExistenceRequirement::AllowDeath}, StorageHasher, }; use frame_system::{pallet_prelude::*, AccountInfo, RawOrigin}; use pallet_balances::AccountData; use pallet_identity::{Judgement, Registration}; -use pallet_vesting::VestingInfo; use sp_core::{ ed25519::{Public as Ep, Signature as Es}, sr25519::{Public as Sp, Signature as Ss}, @@ -111,7 +110,6 @@ pub mod pallet { Lookup = IdentityLookup, > + pallet_assets::Config + pallet_balances::Config - + pallet_vesting::Config> + pallet_identity::Config> + darwinia_deposit::Config + darwinia_staking::Config @@ -160,15 +158,6 @@ pub mod pallet { #[pallet::getter(fn kton_account_of)] pub type KtonAccounts = StorageMap<_, Blake2_128Concat, AccountId32, AssetAccount>; - /// [`pallet_vesting::Vesting`] data. - /// - /// - #[pallet::storage] - #[pallet::unbounded] - #[pallet::getter(fn vesting_of)] - pub type Vestings = - StorageMap<_, Blake2_128Concat, AccountId32, Vec>>; - /// [`darwinia_deposit::Deposits`] data. #[pallet::storage] #[pallet::unbounded] @@ -448,20 +437,6 @@ pub mod pallet { ); } } - if let Some(v) = >::take(from) { - let locked = v.iter().map(|v| v.locked()).sum(); - - >::insert( - to, - BoundedVec::try_from(v).map_err(|_| >::ExceedMaxVestings)?, - ); - - // https://github.dev/paritytech/substrate/blob/19162e43be45817b44c7d48e50d03f074f60fbf4/frame/vesting/src/lib.rs#L248 - let reasons = WithdrawReasons::TRANSFER | WithdrawReasons::RESERVE; - - // https://github.dev/paritytech/substrate/blob/19162e43be45817b44c7d48e50d03f074f60fbf4/frame/vesting/src/lib.rs#L86 - >::set_lock(*b"vesting ", to, locked, reasons); - } if let Some(mut i) = >::take(from) { i.deposit = 0; i.judgements.iter_mut().for_each(|(_, j)| { diff --git a/pallet/account-migration/src/mock.rs b/pallet/account-migration/src/mock.rs index b6f3500b9..b88677c0c 100644 --- a/pallet/account-migration/src/mock.rs +++ b/pallet/account-migration/src/mock.rs @@ -159,16 +159,6 @@ frame_support::parameter_types! { frame_support::traits::WithdrawReasons::TRANSFER | frame_support::traits::WithdrawReasons::RESERVE ); } -impl pallet_vesting::Config for Runtime { - type BlockNumberToBalance = sp_runtime::traits::ConvertInto; - type Currency = Balances; - type MinVestedTransfer = (); - type RuntimeEvent = RuntimeEvent; - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; - type WeightInfo = (); - - const MAX_VESTING_SCHEDULES: u32 = 1; -} impl darwinia_deposit::Config for Runtime { type Kton = Dummy; @@ -226,7 +216,6 @@ frame_support::construct_runtime! { Timestamp: pallet_timestamp, Balances: pallet_balances, Assets: pallet_assets, - Vesting: pallet_vesting, Deposit: darwinia_deposit, Staking: darwinia_staking, Identity: pallet_identity, diff --git a/runtime/common/src/test.rs b/runtime/common/src/test.rs index c5f2f0f48..76d25a051 100644 --- a/runtime/common/src/test.rs +++ b/runtime/common/src/test.rs @@ -95,14 +95,6 @@ macro_rules! impl_account_migration_tests { Destroying, } - // This struct is private in `pallet-vesting`. - #[derive(Encode)] - struct VestingInfo { - locked: u128, - per_block: u128, - starting_block: u32, - } - fn alice() -> (Pair, AccountId32) { let pair = Keyring::Alice.pair(); let public_key = AccountId32::new(pair.public().0); @@ -281,32 +273,6 @@ macro_rules! impl_account_migration_tests { }); } - #[test] - fn vesting_should_work() { - let (from, from_pk) = alice(); - let to = H160::from_low_u64_be(255).into(); - - ExtBuilder::default().build().execute_with(|| { - preset_state_of(&from); - - migration::put_storage_value( - b"AccountMigration", - b"Vestings", - &Blake2_128Concat::hash(from_pk.as_ref()), - vec![ - VestingInfo { locked: 100, per_block: 5, starting_block: 0 }, - VestingInfo { locked: 100, per_block: 5, starting_block: 0 }, - ], - ); - assert!(Vesting::vesting(to).is_none()); - assert!(Balances::locks(to).is_empty()); - - assert_ok!(migrate(from, to)); - assert_eq!(Vesting::vesting(to).unwrap().len(), 2); - assert_eq!(Balances::locks(to).len(), 1); - }); - } - #[test] fn staking_should_work() { let (from, from_pk) = alice(); diff --git a/runtime/pangolin/Cargo.toml b/runtime/pangolin/Cargo.toml index 3c36a9fcb..ec7bb4431 100644 --- a/runtime/pangolin/Cargo.toml +++ b/runtime/pangolin/Cargo.toml @@ -110,7 +110,6 @@ pallet-transaction-payment = { workspace = true } pallet-transaction-payment-rpc-runtime-api = { workspace = true } pallet-treasury = { workspace = true } pallet-utility = { workspace = true } -pallet-vesting = { workspace = true } sp-api = { workspace = true } sp-block-builder = { workspace = true } sp-consensus-aura = { workspace = true } @@ -237,7 +236,6 @@ std = [ "pallet-transaction-payment/std", "pallet-treasury/std", "pallet-utility/std", - "pallet-vesting/std", "sp-api/std", "sp-block-builder/std", "sp-consensus-aura/std", @@ -329,7 +327,6 @@ runtime-benchmarks = [ "pallet-tips/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", "pallet-utility/runtime-benchmarks", - "pallet-vesting/runtime-benchmarks", "sp-runtime/runtime-benchmarks", # substrate optional "frame-benchmarking/runtime-benchmarks", @@ -395,7 +392,6 @@ try-runtime = [ "pallet-transaction-payment/try-runtime", "pallet-treasury/try-runtime", "pallet-utility/try-runtime", - "pallet-vesting/try-runtime", "sp-runtime/try-runtime", # substrate optional "frame-try-runtime/try-runtime", diff --git a/runtime/pangolin/src/lib.rs b/runtime/pangolin/src/lib.rs index c06935da0..858f65dae 100644 --- a/runtime/pangolin/src/lib.rs +++ b/runtime/pangolin/src/lib.rs @@ -131,7 +131,7 @@ frame_support::construct_runtime! { Balances: pallet_balances = 5, TransactionPayment: pallet_transaction_payment = 6, Assets: pallet_assets = 7, - Vesting: pallet_vesting = 8, + // Vesting: pallet_vesting = 8, Deposit: darwinia_deposit = 9, AccountMigration: darwinia_account_migration = 10, @@ -211,7 +211,6 @@ frame_benchmarking::define_benchmarks! { [pallet_tips, Tips] [pallet_treasury, Treasury] [pallet_utility, Utility] - [pallet_vesting, Vesting] [pallet_session, SessionBench::] [pallet_timestamp, Timestamp] } diff --git a/runtime/pangolin/src/pallets.rs b/runtime/pangolin/src/pallets.rs index 48b527a42..19a6c45a8 100644 --- a/runtime/pangolin/src/pallets.rs +++ b/runtime/pangolin/src/pallets.rs @@ -42,8 +42,6 @@ mod transaction_payment; mod assets; pub use assets::*; -mod vesting; - mod deposit; #[cfg(feature = "runtime-benchmarks")] pub use deposit::*; diff --git a/runtime/pangolin/src/pallets/evm.rs b/runtime/pangolin/src/pallets/evm.rs index 095be6f8a..c130fd6d5 100644 --- a/runtime/pangolin/src/pallets/evm.rs +++ b/runtime/pangolin/src/pallets/evm.rs @@ -188,7 +188,6 @@ impl DispatchValidateT for DarwiniaDispatchValidator { if matches!( call, RuntimeCall::Assets(..) - | RuntimeCall::Vesting(..) | RuntimeCall::Ethereum(..) | RuntimeCall::EVM(..) | RuntimeCall::MessageTransact(..) diff --git a/runtime/pangolin/src/pallets/proxy.rs b/runtime/pangolin/src/pallets/proxy.rs index 8ef14799a..b606cc9a1 100644 --- a/runtime/pangolin/src/pallets/proxy.rs +++ b/runtime/pangolin/src/pallets/proxy.rs @@ -55,7 +55,6 @@ impl frame_support::traits::InstanceFilter for ProxyType { c, RuntimeCall::Balances(..) | RuntimeCall::Assets(..) - | RuntimeCall::Vesting(pallet_vesting::Call::vested_transfer { .. }) | RuntimeCall::Deposit(..) | RuntimeCall::DarwiniaStaking(..) // Might contains transfer { diff --git a/runtime/pangolin/src/pallets/vesting.rs b/runtime/pangolin/src/pallets/vesting.rs deleted file mode 100644 index f13db8ccc..000000000 --- a/runtime/pangolin/src/pallets/vesting.rs +++ /dev/null @@ -1,40 +0,0 @@ -// This file is part of Darwinia. -// -// Copyright (C) 2018-2023 Darwinia Network -// SPDX-License-Identifier: GPL-3.0 -// -// Darwinia 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. -// -// Darwinia 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 Darwinia. If not, see . - -// darwinia -use crate::*; - -frame_support::parameter_types! { - pub UnvestedFundsAllowedWithdrawReasons: frame_support::traits::WithdrawReasons = - frame_support::traits::WithdrawReasons::except( - frame_support::traits::WithdrawReasons::TRANSFER | frame_support::traits::WithdrawReasons::RESERVE - ); -} - -impl pallet_vesting::Config for Runtime { - type BlockNumberToBalance = sp_runtime::traits::ConvertInto; - type Currency = Balances; - type MinVestedTransfer = ConstU128; - type RuntimeEvent = RuntimeEvent; - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; - type WeightInfo = weights::pallet_vesting::WeightInfo; - - // `VestingInfo` encode length is 36bytes. 28 schedules gets encoded as 1009 bytes, which is the - // highest number of schedules that encodes less than 2^10. - const MAX_VESTING_SCHEDULES: u32 = 28; -} diff --git a/runtime/pangolin/src/weights.rs b/runtime/pangolin/src/weights.rs index d7dbd9626..ad11c49dd 100644 --- a/runtime/pangolin/src/weights.rs +++ b/runtime/pangolin/src/weights.rs @@ -50,4 +50,3 @@ pub mod pallet_timestamp; pub mod pallet_tips; pub mod pallet_treasury; pub mod pallet_utility; -pub mod pallet_vesting; diff --git a/runtime/pangolin/src/weights/pallet_vesting.rs b/runtime/pangolin/src/weights/pallet_vesting.rs deleted file mode 100644 index 2476a4fb7..000000000 --- a/runtime/pangolin/src/weights/pallet_vesting.rs +++ /dev/null @@ -1,232 +0,0 @@ -// This file is part of Darwinia. -// -// Copyright (C) 2018-2023 Darwinia Network -// SPDX-License-Identifier: GPL-3.0 -// -// Darwinia 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. -// -// Darwinia 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 Darwinia. If not, see . - -//! Autogenerated weights for `pallet_vesting` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `inv.cafe`, CPU: `13th Gen Intel(R) Core(TM) i9-13900K` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("pangolin-local"), DB CACHE: 1024 - -// Executed Command: -// target/release/darwinia -// benchmark -// pallet -// --header -// .maintain/license-header -// --execution -// wasm -// --heap-pages -// 4096 -// --chain -// pangolin-local -// --output -// runtime/pangolin/src/weights -// --extrinsic -// * -// --pallet -// * -// --steps -// 50 -// --repeat -// 20 - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for `pallet_vesting`. -pub struct WeightInfo(PhantomData); -impl pallet_vesting::WeightInfo for WeightInfo { - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1045), added: 3520, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[1, 28]`. - fn vest_locked(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `246 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `9262` - // Minimum execution time: 20_119_000 picoseconds. - Weight::from_parts(19_857_787, 0) - .saturating_add(Weight::from_parts(0, 9262)) - // Standard Error: 4_186 - .saturating_add(Weight::from_parts(53_690, 0).saturating_mul(l.into())) - // Standard Error: 7_448 - .saturating_add(Weight::from_parts(134_042, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1045), added: 3520, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[1, 28]`. - fn vest_unlocked(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `246 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `9262` - // Minimum execution time: 19_701_000 picoseconds. - Weight::from_parts(20_672_134, 0) - .saturating_add(Weight::from_parts(0, 9262)) - // Standard Error: 4_029 - .saturating_add(Weight::from_parts(31_165, 0).saturating_mul(l.into())) - // Standard Error: 7_169 - .saturating_add(Weight::from_parts(91_104, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1045), added: 3520, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[1, 28]`. - fn vest_other_locked(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `408 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `12843` - // Minimum execution time: 22_508_000 picoseconds. - Weight::from_parts(23_501_468, 0) - .saturating_add(Weight::from_parts(0, 12843)) - // Standard Error: 5_071 - .saturating_add(Weight::from_parts(29_913, 0).saturating_mul(l.into())) - // Standard Error: 9_022 - .saturating_add(Weight::from_parts(131_805, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1045), added: 3520, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[1, 28]`. - fn vest_other_unlocked(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `408 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `12843` - // Minimum execution time: 21_736_000 picoseconds. - Weight::from_parts(22_608_258, 0) - .saturating_add(Weight::from_parts(0, 12843)) - // Standard Error: 4_294 - .saturating_add(Weight::from_parts(31_209, 0).saturating_mul(l.into())) - // Standard Error: 7_640 - .saturating_add(Weight::from_parts(111_737, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1045), added: 3520, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[0, 27]`. - fn vested_transfer(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `374 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `12843` - // Minimum execution time: 33_914_000 picoseconds. - Weight::from_parts(34_798_232, 0) - .saturating_add(Weight::from_parts(0, 12843)) - // Standard Error: 6_845 - .saturating_add(Weight::from_parts(43_787, 0).saturating_mul(l.into())) - // Standard Error: 12_179 - .saturating_add(Weight::from_parts(123_455, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1045), added: 3520, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[0, 27]`. - fn force_vested_transfer(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `536 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `15434` - // Minimum execution time: 34_944_000 picoseconds. - Weight::from_parts(36_226_510, 0) - .saturating_add(Weight::from_parts(0, 15434)) - // Standard Error: 6_402 - .saturating_add(Weight::from_parts(54_304, 0).saturating_mul(l.into())) - // Standard Error: 11_390 - .saturating_add(Weight::from_parts(134_820, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1045), added: 3520, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[2, 28]`. - fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `412 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `12843` - // Minimum execution time: 23_913_000 picoseconds. - Weight::from_parts(22_433_278, 0) - .saturating_add(Weight::from_parts(0, 12843)) - // Standard Error: 4_218 - .saturating_add(Weight::from_parts(67_931, 0).saturating_mul(l.into())) - // Standard Error: 7_789 - .saturating_add(Weight::from_parts(159_308, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1045), added: 3520, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[2, 28]`. - fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `412 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `12843` - // Minimum execution time: 23_929_000 picoseconds. - Weight::from_parts(23_555_074, 0) - .saturating_add(Weight::from_parts(0, 12843)) - // Standard Error: 5_794 - .saturating_add(Weight::from_parts(44_805, 0).saturating_mul(l.into())) - // Standard Error: 10_700 - .saturating_add(Weight::from_parts(164_641, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } -} diff --git a/runtime/pangoro/Cargo.toml b/runtime/pangoro/Cargo.toml index cf12e6750..ae49bbd17 100644 --- a/runtime/pangoro/Cargo.toml +++ b/runtime/pangoro/Cargo.toml @@ -110,7 +110,6 @@ pallet-transaction-payment = { workspace = true } pallet-transaction-payment-rpc-runtime-api = { workspace = true } pallet-treasury = { workspace = true } pallet-utility = { workspace = true } -pallet-vesting = { workspace = true } sp-api = { workspace = true } sp-block-builder = { workspace = true } sp-consensus-aura = { workspace = true } @@ -237,7 +236,6 @@ std = [ "pallet-transaction-payment/std", "pallet-treasury/std", "pallet-utility/std", - "pallet-vesting/std", "sp-api/std", "sp-block-builder/std", "sp-consensus-aura/std", @@ -329,7 +327,6 @@ runtime-benchmarks = [ "pallet-tips/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", "pallet-utility/runtime-benchmarks", - "pallet-vesting/runtime-benchmarks", "sp-runtime/runtime-benchmarks", # substrate optional "frame-benchmarking/runtime-benchmarks", @@ -395,7 +392,6 @@ try-runtime = [ "pallet-transaction-payment/try-runtime", "pallet-treasury/try-runtime", "pallet-utility/try-runtime", - "pallet-vesting/try-runtime", "sp-runtime/try-runtime", # substrate optional "frame-try-runtime/try-runtime", diff --git a/runtime/pangoro/src/lib.rs b/runtime/pangoro/src/lib.rs index 5196d0561..f14a5c2e3 100644 --- a/runtime/pangoro/src/lib.rs +++ b/runtime/pangoro/src/lib.rs @@ -130,7 +130,7 @@ frame_support::construct_runtime! { Balances: pallet_balances = 5, TransactionPayment: pallet_transaction_payment = 6, Assets: pallet_assets = 7, - Vesting: pallet_vesting = 8, + // Vesting: pallet_vesting = 8, Deposit: darwinia_deposit = 9, AccountMigration: darwinia_account_migration = 10, @@ -210,7 +210,6 @@ frame_benchmarking::define_benchmarks! { [pallet_tips, Tips] [pallet_treasury, Treasury] [pallet_utility, Utility] - [pallet_vesting, Vesting] [pallet_session, SessionBench::] [pallet_timestamp, Timestamp] } diff --git a/runtime/pangoro/src/pallets.rs b/runtime/pangoro/src/pallets.rs index 48b527a42..19a6c45a8 100644 --- a/runtime/pangoro/src/pallets.rs +++ b/runtime/pangoro/src/pallets.rs @@ -42,8 +42,6 @@ mod transaction_payment; mod assets; pub use assets::*; -mod vesting; - mod deposit; #[cfg(feature = "runtime-benchmarks")] pub use deposit::*; diff --git a/runtime/pangoro/src/pallets/evm.rs b/runtime/pangoro/src/pallets/evm.rs index 7596949da..5664306e0 100644 --- a/runtime/pangoro/src/pallets/evm.rs +++ b/runtime/pangoro/src/pallets/evm.rs @@ -188,7 +188,6 @@ impl DispatchValidateT for DarwiniaDispatchValidator { if matches!( call, RuntimeCall::Assets(..) - | RuntimeCall::Vesting(..) | RuntimeCall::Ethereum(..) | RuntimeCall::EVM(..) | RuntimeCall::MessageTransact(..) diff --git a/runtime/pangoro/src/pallets/proxy.rs b/runtime/pangoro/src/pallets/proxy.rs index 8ef14799a..b606cc9a1 100644 --- a/runtime/pangoro/src/pallets/proxy.rs +++ b/runtime/pangoro/src/pallets/proxy.rs @@ -55,7 +55,6 @@ impl frame_support::traits::InstanceFilter for ProxyType { c, RuntimeCall::Balances(..) | RuntimeCall::Assets(..) - | RuntimeCall::Vesting(pallet_vesting::Call::vested_transfer { .. }) | RuntimeCall::Deposit(..) | RuntimeCall::DarwiniaStaking(..) // Might contains transfer { diff --git a/runtime/pangoro/src/pallets/vesting.rs b/runtime/pangoro/src/pallets/vesting.rs deleted file mode 100644 index f13db8ccc..000000000 --- a/runtime/pangoro/src/pallets/vesting.rs +++ /dev/null @@ -1,40 +0,0 @@ -// This file is part of Darwinia. -// -// Copyright (C) 2018-2023 Darwinia Network -// SPDX-License-Identifier: GPL-3.0 -// -// Darwinia 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. -// -// Darwinia 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 Darwinia. If not, see . - -// darwinia -use crate::*; - -frame_support::parameter_types! { - pub UnvestedFundsAllowedWithdrawReasons: frame_support::traits::WithdrawReasons = - frame_support::traits::WithdrawReasons::except( - frame_support::traits::WithdrawReasons::TRANSFER | frame_support::traits::WithdrawReasons::RESERVE - ); -} - -impl pallet_vesting::Config for Runtime { - type BlockNumberToBalance = sp_runtime::traits::ConvertInto; - type Currency = Balances; - type MinVestedTransfer = ConstU128; - type RuntimeEvent = RuntimeEvent; - type UnvestedFundsAllowedWithdrawReasons = UnvestedFundsAllowedWithdrawReasons; - type WeightInfo = weights::pallet_vesting::WeightInfo; - - // `VestingInfo` encode length is 36bytes. 28 schedules gets encoded as 1009 bytes, which is the - // highest number of schedules that encodes less than 2^10. - const MAX_VESTING_SCHEDULES: u32 = 28; -} diff --git a/runtime/pangoro/src/weights.rs b/runtime/pangoro/src/weights.rs index d7dbd9626..ad11c49dd 100644 --- a/runtime/pangoro/src/weights.rs +++ b/runtime/pangoro/src/weights.rs @@ -50,4 +50,3 @@ pub mod pallet_timestamp; pub mod pallet_tips; pub mod pallet_treasury; pub mod pallet_utility; -pub mod pallet_vesting; diff --git a/runtime/pangoro/src/weights/pallet_vesting.rs b/runtime/pangoro/src/weights/pallet_vesting.rs deleted file mode 100644 index afc5d2f44..000000000 --- a/runtime/pangoro/src/weights/pallet_vesting.rs +++ /dev/null @@ -1,232 +0,0 @@ -// This file is part of Darwinia. -// -// Copyright (C) 2018-2023 Darwinia Network -// SPDX-License-Identifier: GPL-3.0 -// -// Darwinia 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. -// -// Darwinia 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 Darwinia. If not, see . - -//! Autogenerated weights for `pallet_vesting` -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-06-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! WORST CASE MAP SIZE: `1000000` -//! HOSTNAME: `inv.cafe`, CPU: `13th Gen Intel(R) Core(TM) i9-13900K` -//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("pangoro-local"), DB CACHE: 1024 - -// Executed Command: -// target/release/darwinia -// benchmark -// pallet -// --header -// .maintain/license-header -// --execution -// wasm -// --heap-pages -// 4096 -// --chain -// pangoro-local -// --output -// runtime/pangoro/src/weights -// --extrinsic -// * -// --pallet -// * -// --steps -// 50 -// --repeat -// 20 - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::Weight}; -use sp_std::marker::PhantomData; - -/// Weight functions for `pallet_vesting`. -pub struct WeightInfo(PhantomData); -impl pallet_vesting::WeightInfo for WeightInfo { - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1045), added: 3520, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[1, 28]`. - fn vest_locked(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `213 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `9262` - // Minimum execution time: 20_532_000 picoseconds. - Weight::from_parts(19_928_140, 0) - .saturating_add(Weight::from_parts(0, 9262)) - // Standard Error: 5_804 - .saturating_add(Weight::from_parts(57_026, 0).saturating_mul(l.into())) - // Standard Error: 10_326 - .saturating_add(Weight::from_parts(133_499, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1045), added: 3520, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[1, 28]`. - fn vest_unlocked(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `213 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `9262` - // Minimum execution time: 19_720_000 picoseconds. - Weight::from_parts(20_462_844, 0) - .saturating_add(Weight::from_parts(0, 9262)) - // Standard Error: 5_068 - .saturating_add(Weight::from_parts(41_306, 0).saturating_mul(l.into())) - // Standard Error: 9_017 - .saturating_add(Weight::from_parts(98_180, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(2)) - .saturating_add(T::DbWeight::get().writes(2)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1045), added: 3520, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[1, 28]`. - fn vest_other_locked(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `375 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `12843` - // Minimum execution time: 22_599_000 picoseconds. - Weight::from_parts(22_563_098, 0) - .saturating_add(Weight::from_parts(0, 12843)) - // Standard Error: 5_507 - .saturating_add(Weight::from_parts(42_144, 0).saturating_mul(l.into())) - // Standard Error: 9_798 - .saturating_add(Weight::from_parts(138_526, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1045), added: 3520, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[1, 28]`. - fn vest_other_unlocked(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `375 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `12843` - // Minimum execution time: 21_713_000 picoseconds. - Weight::from_parts(21_843_417, 0) - .saturating_add(Weight::from_parts(0, 12843)) - // Standard Error: 5_338 - .saturating_add(Weight::from_parts(43_591, 0).saturating_mul(l.into())) - // Standard Error: 9_497 - .saturating_add(Weight::from_parts(125_093, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1045), added: 3520, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[0, 27]`. - fn vested_transfer(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `341 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `12843` - // Minimum execution time: 33_771_000 picoseconds. - Weight::from_parts(33_047_721, 0) - .saturating_add(Weight::from_parts(0, 12843)) - // Standard Error: 9_744 - .saturating_add(Weight::from_parts(67_322, 0).saturating_mul(l.into())) - // Standard Error: 17_337 - .saturating_add(Weight::from_parts(163_366, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1045), added: 3520, mode: MaxEncodedLen) - /// Storage: System Account (r:2 w:2) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[0, 27]`. - fn force_vested_transfer(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `503 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `15434` - // Minimum execution time: 35_219_000 picoseconds. - Weight::from_parts(34_846_240, 0) - .saturating_add(Weight::from_parts(0, 15434)) - // Standard Error: 6_351 - .saturating_add(Weight::from_parts(74_283, 0).saturating_mul(l.into())) - // Standard Error: 11_300 - .saturating_add(Weight::from_parts(143_475, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(4)) - .saturating_add(T::DbWeight::get().writes(4)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1045), added: 3520, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[2, 28]`. - fn not_unlocking_merge_schedules(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `379 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `12843` - // Minimum execution time: 23_623_000 picoseconds. - Weight::from_parts(23_705_984, 0) - .saturating_add(Weight::from_parts(0, 12843)) - // Standard Error: 4_824 - .saturating_add(Weight::from_parts(33_634, 0).saturating_mul(l.into())) - // Standard Error: 8_909 - .saturating_add(Weight::from_parts(143_217, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } - /// Storage: Vesting Vesting (r:1 w:1) - /// Proof: Vesting Vesting (max_values: None, max_size: Some(1045), added: 3520, mode: MaxEncodedLen) - /// Storage: Balances Locks (r:1 w:1) - /// Proof: Balances Locks (max_values: None, max_size: Some(1287), added: 3762, mode: MaxEncodedLen) - /// Storage: System Account (r:1 w:1) - /// Proof: System Account (max_values: None, max_size: Some(116), added: 2591, mode: MaxEncodedLen) - /// The range of component `l` is `[0, 49]`. - /// The range of component `s` is `[2, 28]`. - fn unlocking_merge_schedules(l: u32, s: u32, ) -> Weight { - // Proof Size summary in bytes: - // Measured: `379 + l * (25 ±0) + s * (36 ±0)` - // Estimated: `12843` - // Minimum execution time: 23_469_000 picoseconds. - Weight::from_parts(23_247_203, 0) - .saturating_add(Weight::from_parts(0, 12843)) - // Standard Error: 4_374 - .saturating_add(Weight::from_parts(51_947, 0).saturating_mul(l.into())) - // Standard Error: 8_079 - .saturating_add(Weight::from_parts(125_882, 0).saturating_mul(s.into())) - .saturating_add(T::DbWeight::get().reads(3)) - .saturating_add(T::DbWeight::get().writes(3)) - } -}