git.delta.rocks / unique-network / refs/commits / 3151280b2e6d

difftreelog

Merge pull request #376 from UniqueNetwork/fix/scheduler-benchmarks

kozyrevdev2022-06-10parents: #030f1f6 #35be72c.patch.diff
in: master
Fix/scheduler benchmarks

14 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5356,7 +5356,7 @@
  "pallet-transaction-payment-rpc-runtime-api",
  "pallet-treasury",
  "pallet-unique",
- "pallet-unq-scheduler",
+ "pallet-unique-scheduler",
  "pallet-xcm",
  "parachain-info",
  "parity-scale-codec 3.1.2",
@@ -6646,7 +6646,7 @@
 ]
 
 [[package]]
-name = "pallet-unq-scheduler"
+name = "pallet-unique-scheduler"
 version = "0.1.0"
 dependencies = [
  "frame-benchmarking",
@@ -8590,7 +8590,7 @@
  "pallet-transaction-payment-rpc-runtime-api",
  "pallet-treasury",
  "pallet-unique",
- "pallet-unq-scheduler",
+ "pallet-unique-scheduler",
  "pallet-xcm",
  "parachain-info",
  "parity-scale-codec 3.1.2",
@@ -12643,7 +12643,7 @@
  "pallet-transaction-payment-rpc-runtime-api",
  "pallet-treasury",
  "pallet-unique",
- "pallet-unq-scheduler",
+ "pallet-unique-scheduler",
  "pallet-xcm",
  "parachain-info",
  "parity-scale-codec 3.1.2",
@@ -12688,6 +12688,7 @@
  "pallet-nonfungible",
  "pallet-refungible",
  "pallet-unique",
+ "pallet-unique-scheduler",
  "parity-scale-codec 3.1.2",
  "rmrk-rpc",
  "scale-info",
modifiedMakefilediffbeforeafterboth
--- a/Makefile
+++ b/Makefile
@@ -65,6 +65,14 @@
 	--template .maintain/frame-weight-template.hbs --steps=50 --repeat=200 --heap-pages=4096 \
 	--output=./pallets/$(PALLET)/src/weights.rs
 
+.PHONY: _bench2
+_bench2:
+	cargo run --release --features runtime-benchmarks,unique-runtime -- \
+	benchmark pallet --pallet pallet-$(PALLET) \
+	--wasm-execution compiled --extrinsic '*' \
+	--template .maintain/frame-weight-template.hbs --steps=50 --repeat=200 --heap-pages=4096 \
+	--output=./pallets/$(PALLET_DIR)/src/weights.rs
+
 .PHONY: bench-evm-migration
 bench-evm-migration:
 	make _bench PALLET=evm-migration
@@ -93,9 +101,13 @@
 bench-structure:
 	make _bench PALLET=structure
 
+.PHONY: bench-scheduler
+bench-scheduler:
+	make _bench2 PALLET=unique-scheduler PALLET_DIR=scheduler
+
 .PHONY: bench-rmrk-core
 bench-rmrk-core:
 	make _bench PALLET=proxy-rmrk-core
 
 .PHONY: bench
-bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-rmrk-core
+bench: bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-scheduler bench-rmrk-core
modifiedpallets/scheduler/Cargo.tomldiffbeforeafterboth
--- a/pallets/scheduler/Cargo.toml
+++ b/pallets/scheduler/Cargo.toml
@@ -1,5 +1,5 @@
 [package]
-name = "pallet-unq-scheduler"
+name = "pallet-unique-scheduler"
 version = "0.1.0"
 authors = ["Unique Network <support@uniquenetwork.io>"]
 edition = "2021"
modifiedpallets/scheduler/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/scheduler/src/benchmarking.rs
+++ b/pallets/scheduler/src/benchmarking.rs
@@ -34,35 +34,57 @@
 
 //! Scheduler pallet benchmarking.
 
-#![cfg(feature = "runtime-benchmarks")]
-
 use super::*;
-use sp_std::{vec, prelude::*};
+use frame_benchmarking::{benchmarks, account};
+use frame_support::{
+	ensure,
+	traits::{OnInitialize},
+};
 use frame_system::RawOrigin;
-use frame_support::{ensure, traits::OnInitialize};
-use frame_benchmarking::{benchmarks, impl_benchmark_test_suite};
+use sp_runtime::traits::Hash;
+use sp_std::{prelude::*, vec};
 
-use crate::Module as Scheduler;
+use crate::Pallet as Scheduler;
 use frame_system::Pallet as System;
+use frame_support::traits::Currency;
 
 const BLOCK_NUMBER: u32 = 2;
 
-// Add `n` named items to the schedule
-fn fill_schedule<T: Config>(when: T::BlockNumber, n: u32) -> Result<(), &'static str> {
-	// Essentially a no-op call.
-	let call = frame_system::Call::set_storage { items: vec![] };
+/// Add `n` named items to the schedule.
+///
+/// For `resolved`:
+/// - `None`: aborted (hash without preimage)
+/// - `Some(true)`: hash resolves into call if possible, plain call otherwise
+/// - `Some(false)`: plain call
+fn fill_schedule<T: Config>(
+	when: T::BlockNumber,
+	n: u32,
+	periodic: bool,
+	resolved: Option<bool>,
+) -> Result<(), &'static str> {
+	let t = DispatchTime::At(when);
+	let caller = account("user", 0, 1);
+
+	// Give the sender account max funds for transfer (their account will never reasonably be killed).
+	T::Currency::make_free_balance_be(&caller, T::Currency::minimum_balance());
+
 	for i in 0..n {
-		// Named schedule is strictly heavier than anonymous
-		Scheduler::<T>::do_schedule_named(
-			i.encode(),
-			DispatchTime::At(when),
-			// Add periodicity
-			Some((T::BlockNumber::one(), 100)),
-			// HARD_DEADLINE priority means it gets executed no matter what
-			0,
-			frame_system::RawOrigin::Root.into(),
-			call.clone().into(),
-		)?;
+		let (call, hash) = call_and_hash::<T>(i);
+		let call_or_hash = match resolved {
+			Some(_) => call.into(),
+			None => CallOrHashOf::<T>::Hash(hash),
+		};
+		let period = match periodic {
+			true => Some(((i + 100).into(), 100)),
+			false => None,
+		};
+
+		let slice_id: [u8; 4] = i.encode().try_into().unwrap();
+		let mut id: [u8; 16] = [0; 16];
+		id[..4].clone_from_slice(&slice_id);
+
+		let origin = frame_system::RawOrigin::Signed(caller.clone()).into();
+		Scheduler::<T>::do_schedule_named(id, t, period, 0, origin, call_or_hash)?;
 	}
 	ensure!(
 		Agenda::<T>::get(when).len() == n as usize,
@@ -71,54 +93,121 @@
 	Ok(())
 }
 
+fn call_and_hash<T: Config>(i: u32) -> (<T as Config>::Call, T::Hash) {
+	// Essentially a no-op call.
+	let call: <T as Config>::Call = frame_system::Call::remark { remark: i.encode() }.into();
+	let hash = T::Hashing::hash_of(&call);
+	(call, hash)
+}
+
 benchmarks! {
-	schedule {
-		let s in 0 .. T::MaxScheduledPerBlock::get();
+	on_initialize_periodic_named_resolved {
+		let s in 1 .. T::MaxScheduledPerBlock::get();
 		let when = BLOCK_NUMBER.into();
-		let periodic = Some((T::BlockNumber::one(), 100));
-		let priority = 0;
-		// Essentially a no-op call.
-		let call = Box::new(frame_system::Call::set_storage { items: vec![] }.into());
+		fill_schedule::<T>(when, s, true, Some(true))?;
+	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
+	verify {
+		assert_eq!(System::<T>::event_count(), s);
+		for i in 0..s {
+			assert_eq!(Agenda::<T>::get(when + (i + 100).into()).len(), 1 as usize);
+		}
+	}
 
-		fill_schedule::<T>(when, s)?;
-	}: _(RawOrigin::Root, when, periodic, priority, call)
+	on_initialize_named_resolved {
+		let s in 1 .. T::MaxScheduledPerBlock::get();
+		let when = BLOCK_NUMBER.into();
+		fill_schedule::<T>(when, s, false, Some(true))?;
+	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
 	verify {
-		ensure!(
-			Agenda::<T>::get(when).len() == (s + 1) as usize,
-			"didn't add to schedule"
-		);
+		assert_eq!(System::<T>::event_count(), s);
+		assert!(Agenda::<T>::iter().count() == 0);
 	}
 
-	cancel {
+	on_initialize_periodic {
 		let s in 1 .. T::MaxScheduledPerBlock::get();
 		let when = BLOCK_NUMBER.into();
+		fill_schedule::<T>(when, s, true, Some(false))?;
+	}: { Scheduler::<T>::on_initialize(when); }
+	verify {
+		assert_eq!(System::<T>::event_count(), s);
+		for i in 0..s {
+			assert_eq!(Agenda::<T>::get(when + (i + 100).into()).len(), 1 as usize);
+		}
+	}
 
-		fill_schedule::<T>(when, s)?;
-		assert_eq!(Agenda::<T>::get(when).len(), s as usize);
-	}: _(RawOrigin::Root, when, 0)
+	on_initialize_periodic_resolved {
+		let s in 1 .. T::MaxScheduledPerBlock::get();
+		let when = BLOCK_NUMBER.into();
+		fill_schedule::<T>(when, s, true, Some(true))?;
+	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
 	verify {
-		ensure!(
-			Lookup::<T>::get(0.encode()).is_none(),
-			"didn't remove from lookup"
-		);
-		// Removed schedule is NONE
-		ensure!(
-			Agenda::<T>::get(when)[0].is_none(),
-			"didn't remove from schedule"
-		);
+		assert_eq!(System::<T>::event_count(), s );
+		for i in 0..s {
+			assert_eq!(Agenda::<T>::get(when + (i + 100).into()).len(), 1 as usize);
+		}
 	}
 
+	on_initialize_aborted {
+		let s in 1 .. T::MaxScheduledPerBlock::get();
+		let when = BLOCK_NUMBER.into();
+		fill_schedule::<T>(when, s, false, None)?;
+	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
+	verify {
+		assert_eq!(System::<T>::event_count(), 0);
+	}
+
+	on_initialize_named_aborted {
+		let s in 1 .. T::MaxScheduledPerBlock::get();
+		let when = BLOCK_NUMBER.into();
+		fill_schedule::<T>(when, s, false, Some(false))?;
+	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
+	verify {
+	}
+
+	on_initialize_named {
+		let s in 1 .. T::MaxScheduledPerBlock::get();
+		let when = BLOCK_NUMBER.into();
+		fill_schedule::<T>(when, s, false, None)?;
+	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
+	verify {
+		assert_eq!(System::<T>::event_count(), 0);
+	}
+
+	on_initialize {
+		let s in 1 .. T::MaxScheduledPerBlock::get();
+		let when = BLOCK_NUMBER.into();
+		fill_schedule::<T>(when, s, false, Some(false))?;
+	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
+	verify {
+		assert_eq!(System::<T>::event_count(), s);
+		assert!(Agenda::<T>::iter().count() == 0);
+	}
+
+	on_initialize_resolved {
+		let s in 1 .. T::MaxScheduledPerBlock::get();
+		let when = BLOCK_NUMBER.into();
+		fill_schedule::<T>(when, s, false, Some(true))?;
+	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
+	verify {
+		assert_eq!(System::<T>::event_count(), s);
+		assert!(Agenda::<T>::iter().count() == 0);
+	}
+
 	schedule_named {
+		let caller: T::AccountId = account("user", 0, 1);
+		let origin: RawOrigin<T::AccountId> = frame_system::RawOrigin::Signed(caller.clone());
 		let s in 0 .. T::MaxScheduledPerBlock::get();
-		let id = s.encode();
+		let slice_id: [u8; 4] = s.encode().try_into().unwrap();
+		let mut id: [u8; 16] =  [0; 16];
+		id[..4].clone_from_slice(&slice_id);
 		let when = BLOCK_NUMBER.into();
 		let periodic = Some((T::BlockNumber::one(), 100));
 		let priority = 0;
 		// Essentially a no-op call.
-		let call = Box::new(frame_system::Call::set_storage { items: vec![] }.into());
-
-		fill_schedule::<T>(when, s)?;
-	}: _(RawOrigin::Root, id, when, periodic, priority, call)
+		let inner_call = frame_system::Call::set_storage { items: vec![] }.into();
+		let call = Box::new(CallOrHashOf::<T>::Value(inner_call));
+		fill_schedule::<T>(when, s, true, Some(false))?;
+	}: _(origin, id, when, periodic, priority, call)
 	verify {
 		ensure!(
 			Agenda::<T>::get(when).len() == (s + 1) as usize,
@@ -127,14 +216,16 @@
 	}
 
 	cancel_named {
+		let caller: T::AccountId = account("user", 0, 1);
+		let origin: RawOrigin<T::AccountId> = frame_system::RawOrigin::Signed(caller.clone());
 		let s in 1 .. T::MaxScheduledPerBlock::get();
 		let when = BLOCK_NUMBER.into();
-
-		fill_schedule::<T>(when, s)?;
-	}: _(RawOrigin::Root, 0.encode())
+		let id = 0.encode().try_into().unwrap_or([0; MAX_TASK_ID_LENGTH_IN_BYTES as usize]);
+		fill_schedule::<T>(when, s, true, Some(false))?;
+	}: _(origin, id)
 	verify {
 		ensure!(
-			Lookup::<T>::get(0.encode()).is_none(),
+			Lookup::<T>::get(id).is_none(),
 			"didn't remove from lookup"
 		);
 		// Removed schedule is NONE
@@ -144,21 +235,5 @@
 		);
 	}
 
-	// TODO [#7141]: Make this more complex and flexible so it can be used in automation.
-	#[extra]
-	on_initialize {
-		let s in 0 .. T::MaxScheduledPerBlock::get();
-		let when = BLOCK_NUMBER.into();
-		fill_schedule::<T>(when, s)?;
-	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
-	verify {
-		assert_eq!(System::<T>::event_count(), s);
-		// Next block should have all the schedules again
-		ensure!(
-			Agenda::<T>::get(when + T::BlockNumber::one()).len() == s as usize,
-			"didn't append schedule"
-		);
-	}
+	impl_benchmark_test_suite!(Scheduler, crate::mock::new_test_ext(), crate::mock::Test);
 }
-
-impl_benchmark_test_suite!(Scheduler, crate::tests::new_test_ext(), crate::tests::Test,);
modifiedpallets/scheduler/src/lib.rsdiffbeforeafterboth
60// Ensure we're `no_std` when compiling for Wasm.60// Ensure we're `no_std` when compiling for Wasm.
61#![cfg_attr(not(feature = "std"), no_std)]61#![cfg_attr(not(feature = "std"), no_std)]
6262
63// FIXME
64// #[cfg(feature = "runtime-benchmarks")]63#[cfg(feature = "runtime-benchmarks")]
65// mod benchmarking;64mod benchmarking;
6665
67pub mod weights;66pub mod weights;
6867
159 Self::on_initialize_periodic(2) - Self::on_initialize_periodic(1)158 Self::on_initialize_periodic(2) - Self::on_initialize_periodic(1)
160 }159 }
161 (true, true, Some(false)) => {160 (true, true, Some(false)) => {
162 Self::on_initialize_periodic_named(2) - Self::on_initialize_periodic_named(1)161 Self::on_initialize_periodic_named_resolved(2)
162 - Self::on_initialize_periodic_named_resolved(1)
163 }163 }
164 (false, false, Some(true)) => {164 (false, false, Some(true)) => Self::on_initialize(2) - Self::on_initialize(1),
165 Self::on_initialize_resolved(2) - Self::on_initialize_resolved(1)
166 }
167 (false, true, Some(true)) => {165 (false, true, Some(true)) => {
168 Self::on_initialize_named_resolved(2) - Self::on_initialize_named_resolved(1)166 Self::on_initialize_named_resolved(2) - Self::on_initialize_named_resolved(1)
169 }167 }
610 Ok(when)608 Ok(when)
611 }609 }
612610
613 fn do_schedule(
614 when: DispatchTime<T::BlockNumber>,
615 maybe_periodic: Option<schedule::Period<T::BlockNumber>>,
616 priority: schedule::Priority,
617 origin: T::PalletsOrigin,
618 call: CallOrHashOf<T>,
619 ) -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
620 let when = Self::resolve_time(when)?;
621 call.ensure_requested::<T::PreimageProvider>();
622
623 // sanitize maybe_periodic
624 let maybe_periodic = maybe_periodic
625 .filter(|p| p.1 > 1 && !p.0.is_zero())
626 // Remove one from the number of repetitions since we will schedule one now.
627 .map(|(p, c)| (p, c - 1));
628 let s = Some(Scheduled {
629 maybe_id: None,
630 priority,
631 call,
632 maybe_periodic,
633 origin,
634 _phantom: PhantomData::<T::AccountId>::default(),
635 });
636 Agenda::<T>::append(when, s);
637 let index = Agenda::<T>::decode_len(when).unwrap_or(1) as u32 - 1;
638 Self::deposit_event(Event::Scheduled { when, index });
639
640 Ok((when, index))
641 }
642
643 fn do_cancel(
644 origin: Option<T::PalletsOrigin>,
645 (when, index): TaskAddress<T::BlockNumber>,
646 ) -> Result<(), DispatchError> {
647 let scheduled = Agenda::<T>::try_mutate(when, |agenda| {
648 agenda.get_mut(index as usize).map_or(
649 Ok(None),
650 |s| -> Result<Option<Scheduled<_, _, _, _>>, DispatchError> {
651 if let (Some(ref o), Some(ref s)) = (origin, s.borrow()) {
652 if matches!(
653 T::OriginPrivilegeCmp::cmp_privilege(o, &s.origin),
654 Some(Ordering::Less) | None
655 ) {
656 return Err(BadOrigin.into());
657 }
658 };
659 Ok(s.take())
660 },
661 )
662 })?;
663 if let Some(s) = scheduled {
664 s.call.ensure_unrequested::<T::PreimageProvider>();
665 if let Some(id) = s.maybe_id {
666 Lookup::<T>::remove(id);
667 }
668 Self::deposit_event(Event::Canceled { when, index });
669 Ok(())
670 } else {
671 Err(Error::<T>::NotFound)?
672 }
673 }
674
675 fn do_reschedule(
676 (when, index): TaskAddress<T::BlockNumber>,
677 new_time: DispatchTime<T::BlockNumber>,
678 ) -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
679 let new_time = Self::resolve_time(new_time)?;
680
681 if new_time == when {
682 return Err(Error::<T>::RescheduleNoChange.into());
683 }
684
685 Agenda::<T>::try_mutate(when, |agenda| -> DispatchResult {
686 let task = agenda.get_mut(index as usize).ok_or(Error::<T>::NotFound)?;
687 let task = task.take().ok_or(Error::<T>::NotFound)?;
688 Agenda::<T>::append(new_time, Some(task));
689 Ok(())
690 })?;
691
692 let new_index = Agenda::<T>::decode_len(new_time).unwrap_or(1) as u32 - 1;
693 Self::deposit_event(Event::Canceled { when, index });
694 Self::deposit_event(Event::Scheduled {
695 when: new_time,
696 index: new_index,
697 });
698
699 Ok((new_time, new_index))
700 }
701
702 fn do_schedule_named(611 fn do_schedule_named(
703 id: ScheduledId,612 id: ScheduledId,
789 Err(Error::<T>::NotFound)?698 Err(Error::<T>::NotFound)?
790 }699 }
791 })700 })
792 }
793
794 fn do_reschedule_named(
795 id: ScheduledId,
796 new_time: DispatchTime<T::BlockNumber>,
797 ) -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
798 let new_time = Self::resolve_time(new_time)?;
799
800 Lookup::<T>::try_mutate_exists(
801 id,
802 |lookup| -> Result<TaskAddress<T::BlockNumber>, DispatchError> {
803 let (when, index) = lookup.ok_or(Error::<T>::NotFound)?;
804
805 if new_time == when {
806 return Err(Error::<T>::RescheduleNoChange.into());
807 }
808
809 Agenda::<T>::try_mutate(when, |agenda| -> DispatchResult {
810 let task = agenda.get_mut(index as usize).ok_or(Error::<T>::NotFound)?;
811 let task = task.take().ok_or(Error::<T>::NotFound)?;
812 Agenda::<T>::append(new_time, Some(task));
813
814 Ok(())
815 })?;
816
817 let new_index = Agenda::<T>::decode_len(new_time).unwrap_or(1) as u32 - 1;
818 Self::deposit_event(Event::Canceled { when, index });
819 Self::deposit_event(Event::Scheduled {
820 when: new_time,
821 index: new_index,
822 });
823
824 *lookup = Some((new_time, new_index));
825
826 Ok((new_time, new_index))
827 },
828 )
829 }
830}
831
832impl<T: Config> schedule::v2::Anon<T::BlockNumber, <T as Config>::Call, T::PalletsOrigin>
833 for Pallet<T>
834{
835 type Address = TaskAddress<T::BlockNumber>;
836 type Hash = T::Hash;
837
838 fn schedule(
839 when: DispatchTime<T::BlockNumber>,
840 maybe_periodic: Option<schedule::Period<T::BlockNumber>>,
841 priority: schedule::Priority,
842 origin: T::PalletsOrigin,
843 call: CallOrHashOf<T>,
844 ) -> Result<Self::Address, DispatchError> {
845 Self::do_schedule(when, maybe_periodic, priority, origin, call)
846 }
847
848 fn cancel((when, index): Self::Address) -> Result<(), ()> {
849 Self::do_cancel(None, (when, index)).map_err(|_| ())
850 }
851
852 fn reschedule(
853 address: Self::Address,
854 when: DispatchTime<T::BlockNumber>,
855 ) -> Result<Self::Address, DispatchError> {
856 Self::do_reschedule(address, when)
857 }
858
859 fn next_dispatch_time((when, index): Self::Address) -> Result<T::BlockNumber, ()> {
860 Agenda::<T>::get(when)
861 .get(index as usize)
862 .ok_or(())
863 .map(|_| when)
864 }
865}
866
867impl<T: Config> schedule::v2::Named<T::BlockNumber, <T as Config>::Call, T::PalletsOrigin>
868 for Pallet<T>
869{
870 type Address = TaskAddress<T::BlockNumber>;
871 type Hash = T::Hash;
872
873 fn schedule_named(
874 id: Vec<u8>,
875 when: DispatchTime<T::BlockNumber>,
876 maybe_periodic: Option<schedule::Period<T::BlockNumber>>,
877 priority: schedule::Priority,
878 origin: T::PalletsOrigin,
879 call: CallOrHashOf<T>,
880 ) -> Result<Self::Address, ()> {
881 let inner_id: ScheduledId = id
882 .try_into()
883 .unwrap_or([0; MAX_TASK_ID_LENGTH_IN_BYTES as usize]);
884 Self::do_schedule_named(inner_id, when, maybe_periodic, priority, origin, call)
885 .map_err(|_| ())
886 }
887
888 fn cancel_named(id: Vec<u8>) -> Result<(), ()> {
889 let inner_id: ScheduledId = id
890 .try_into()
891 .unwrap_or([0; MAX_TASK_ID_LENGTH_IN_BYTES as usize]);
892 Self::do_cancel_named(None, inner_id).map_err(|_| ())
893 }
894
895 fn reschedule_named(
896 id: Vec<u8>,
897 when: DispatchTime<T::BlockNumber>,
898 ) -> Result<Self::Address, DispatchError> {
899 let inner_id: ScheduledId = id
900 .try_into()
901 .unwrap_or([0; MAX_TASK_ID_LENGTH_IN_BYTES as usize]);
902 Self::do_reschedule_named(inner_id, when)
903 }
904
905 fn next_dispatch_time(id: Vec<u8>) -> Result<T::BlockNumber, ()> {
906 let inner_id: ScheduledId = id
907 .try_into()
908 .unwrap_or([0; MAX_TASK_ID_LENGTH_IN_BYTES as usize]);
909 Lookup::<T>::get(inner_id)
910 .and_then(|(when, index)| Agenda::<T>::get(when).get(index as usize).map(|_| when))
911 .ok_or(())
912 }701 }
913}702}
914703
modifiedpallets/scheduler/src/weights.rsdiffbeforeafterboth
--- a/pallets/scheduler/src/weights.rs
+++ b/pallets/scheduler/src/weights.rs
@@ -1,213 +1,183 @@
-// This file is part of Substrate.
-
-// Copyright (C) 2022 Parity Technologies (UK) Ltd.
-// SPDX-License-Identifier: Apache-2.0
-
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs
 
-//! Autogenerated weights for pallet_scheduler
+//! Autogenerated weights for pallet_unique_scheduler
 //!
 //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2022-01-31, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
-//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 1024
+//! DATE: 2022-06-09, STEPS: `50`, REPEAT: 200, LOW RANGE: `[]`, HIGH RANGE: `[]`
+//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
 
 // Executed Command:
-// ./target/production/substrate
+// target/release/unique-collator
 // benchmark
-// --chain=dev
+// pallet
+// --pallet
+// pallet-unique-scheduler
+// --wasm-execution
+// compiled
+// --extrinsic
+// *
+// --template
+// .maintain/frame-weight-template.hbs
 // --steps=50
-// --repeat=20
-// --pallet=pallet_scheduler
-// --extrinsic=*
-// --execution=wasm
-// --wasm-execution=compiled
+// --repeat=200
 // --heap-pages=4096
-// --output=./frame/scheduler/src/weights.rs
-// --template=.maintain/frame-weight-template.hbs
-// --header=HEADER-APACHE2
-// --raw
+// --output=./pallets/scheduler/src/weights.rs
 
 #![cfg_attr(rustfmt, rustfmt_skip)]
 #![allow(unused_parens)]
 #![allow(unused_imports)]
+#![allow(clippy::unnecessary_cast)]
 
 use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
 use sp_std::marker::PhantomData;
 
-/// Weight functions needed for pallet_scheduler.
+/// Weight functions needed for pallet_unique_scheduler.
 pub trait WeightInfo {
 	fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight;
 	fn on_initialize_named_resolved(s: u32, ) -> Weight;
+	fn on_initialize_periodic(s: u32, ) -> Weight;
 	fn on_initialize_periodic_resolved(s: u32, ) -> Weight;
-	fn on_initialize_resolved(s: u32, ) -> Weight;
+	fn on_initialize_aborted(s: u32, ) -> Weight;
 	fn on_initialize_named_aborted(s: u32, ) -> Weight;
-	fn on_initialize_aborted(s: u32, ) -> Weight;
-	fn on_initialize_periodic_named(s: u32, ) -> Weight;
-	fn on_initialize_periodic(s: u32, ) -> Weight;
 	fn on_initialize_named(s: u32, ) -> Weight;
 	fn on_initialize(s: u32, ) -> Weight;
-	fn schedule(s: u32, ) -> Weight;
-	fn cancel(s: u32, ) -> Weight;
+	fn on_initialize_resolved(s: u32, ) -> Weight;
 	fn schedule_named(s: u32, ) -> Weight;
 	fn cancel_named(s: u32, ) -> Weight;
 }
 
-/// Weights for pallet_scheduler using the Substrate node and recommended hardware.
+/// Weights for pallet_unique_scheduler using the Substrate node and recommended hardware.
 pub struct SubstrateWeight<T>(PhantomData<T>);
 impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
 	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Preimage PreimageFor (r:1 w:1)
-	// Storage: Preimage StatusFor (r:1 w:1)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
 	fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight {
-		(11_587_000 as Weight)
-			// Standard Error: 17_000
-			.saturating_add((17_428_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes((4 as Weight).saturating_mul(s as Weight)))
+		(35_999_000 as Weight)
+			// Standard Error: 3_000
+			.saturating_add((32_234_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(T::DbWeight::get().reads(4 as Weight))
+			.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
+			.saturating_add(T::DbWeight::get().writes(4 as Weight))
+			.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: Preimage PreimageFor (r:1 w:1)
-	// Storage: Preimage StatusFor (r:1 w:1)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
 	fn on_initialize_named_resolved(s: u32, ) -> Weight {
-		(8_965_000 as Weight)
-			// Standard Error: 11_000
-			.saturating_add((13_410_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))
+		(34_874_000 as Weight)
+			// Standard Error: 2_000
+			.saturating_add((23_114_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(T::DbWeight::get().reads(4 as Weight))
+			.saturating_add(T::DbWeight::get().writes(4 as Weight))
+			.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Preimage PreimageFor (r:1 w:1)
-	// Storage: Preimage StatusFor (r:1 w:1)
-	fn on_initialize_periodic_resolved(s: u32, ) -> Weight {
-		(8_654_000 as Weight)
-			// Standard Error: 17_000
-			.saturating_add((14_990_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: Preimage PreimageFor (r:1 w:1)
-	// Storage: Preimage StatusFor (r:1 w:1)
-	fn on_initialize_resolved(s: u32, ) -> Weight {
-		(9_303_000 as Weight)
-			// Standard Error: 10_000
-			.saturating_add((12_244_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
+	// Storage: Scheduler Lookup (r:0 w:1)
+	fn on_initialize_periodic(s: u32, ) -> Weight {
+		(36_469_000 as Weight)
+			// Standard Error: 3_000
+			.saturating_add((32_202_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(T::DbWeight::get().reads(4 as Weight))
+			.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
+			.saturating_add(T::DbWeight::get().writes(4 as Weight))
 			.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Preimage PreimageFor (r:1 w:0)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_named_aborted(s: u32, ) -> Weight {
-		(7_506_000 as Weight)
+	fn on_initialize_periodic_resolved(s: u32, ) -> Weight {
+		(35_352_000 as Weight)
 			// Standard Error: 3_000
-			.saturating_add((5_208_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(2 as Weight))
+			.saturating_add((32_309_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(T::DbWeight::get().reads(4 as Weight))
 			.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(T::DbWeight::get().writes(2 as Weight))
-			.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
+			.saturating_add(T::DbWeight::get().writes(4 as Weight))
+			.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Preimage PreimageFor (r:1 w:0)
+	// Storage: Scheduler Lookup (r:0 w:1)
 	fn on_initialize_aborted(s: u32, ) -> Weight {
-		(8_046_000 as Weight)
-			// Standard Error: 3_000
-			.saturating_add((2_914_000 as Weight).saturating_mul(s as Weight))
+		(11_267_000 as Weight)
+			// Standard Error: 1_000
+			.saturating_add((9_368_000 as Weight).saturating_mul(s as Weight))
 			.saturating_add(T::DbWeight::get().reads(2 as Weight))
-			.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
 			.saturating_add(T::DbWeight::get().writes(2 as Weight))
+			.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
 	}
-	// Storage: Scheduler Agenda (r:2 w:2)
+	// Storage: Scheduler Agenda (r:1 w:1)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_periodic_named(s: u32, ) -> Weight {
-		(13_704_000 as Weight)
-			// Standard Error: 4_000
-			.saturating_add((8_186_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	fn on_initialize_periodic(s: u32, ) -> Weight {
-		(12_668_000 as Weight)
-			// Standard Error: 5_000
-			.saturating_add((5_868_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
+	fn on_initialize_named_aborted(s: u32, ) -> Weight {
+		(35_937_000 as Weight)
+			// Standard Error: 3_000
+			.saturating_add((23_037_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(T::DbWeight::get().reads(4 as Weight))
+			.saturating_add(T::DbWeight::get().writes(4 as Weight))
 			.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
 	}
-	// Storage: Scheduler Agenda (r:1 w:1)
+	// Storage: Scheduler Agenda (r:2 w:2)
 	// Storage: Scheduler Lookup (r:0 w:1)
 	fn on_initialize_named(s: u32, ) -> Weight {
-		(13_946_000 as Weight)
-			// Standard Error: 4_000
-			.saturating_add((4_367_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
+		(10_338_000 as Weight)
+			// Standard Error: 2_000
+			.saturating_add((9_422_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(T::DbWeight::get().reads(2 as Weight))
+			.saturating_add(T::DbWeight::get().writes(2 as Weight))
 			.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:1 w:1)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
+	// Storage: Scheduler Lookup (r:0 w:1)
 	fn on_initialize(s: u32, ) -> Weight {
-		(13_151_000 as Weight)
-			// Standard Error: 4_000
-			.saturating_add((3_455_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
+		(37_448_000 as Weight)
+			// Standard Error: 7_000
+			.saturating_add((22_907_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(T::DbWeight::get().reads(4 as Weight))
+			.saturating_add(T::DbWeight::get().writes(4 as Weight))
+			.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:1 w:1)
-	fn schedule(s: u32, ) -> Weight {
-		(14_040_000 as Weight)
-			// Standard Error: 1_000
-			.saturating_add((89_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes(1 as Weight))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
-	fn cancel(s: u32, ) -> Weight {
-		(14_376_000 as Weight)
-			// Standard Error: 1_000
-			.saturating_add((576_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(T::DbWeight::get().reads(1 as Weight))
-			.saturating_add(T::DbWeight::get().writes(2 as Weight))
+	fn on_initialize_resolved(s: u32, ) -> Weight {
+		(34_841_000 as Weight)
+			// Standard Error: 7_000
+			.saturating_add((22_966_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(T::DbWeight::get().reads(4 as Weight))
+			.saturating_add(T::DbWeight::get().writes(4 as Weight))
+			.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Lookup (r:1 w:1)
 	// Storage: Scheduler Agenda (r:1 w:1)
 	fn schedule_named(s: u32, ) -> Weight {
-		(16_806_000 as Weight)
-			// Standard Error: 1_000
-			.saturating_add((102_000 as Weight).saturating_mul(s as Weight))
+		(33_845_000 as Weight)
+			// Standard Error: 0
+			.saturating_add((168_000 as Weight).saturating_mul(s as Weight))
 			.saturating_add(T::DbWeight::get().reads(2 as Weight))
 			.saturating_add(T::DbWeight::get().writes(2 as Weight))
 	}
 	// Storage: Scheduler Lookup (r:1 w:1)
 	// Storage: Scheduler Agenda (r:1 w:1)
 	fn cancel_named(s: u32, ) -> Weight {
-		(15_852_000 as Weight)
-			// Standard Error: 2_000
-			.saturating_add((590_000 as Weight).saturating_mul(s as Weight))
+		(31_169_000 as Weight)
+			// Standard Error: 1_000
+			.saturating_add((1_565_000 as Weight).saturating_mul(s as Weight))
 			.saturating_add(T::DbWeight::get().reads(2 as Weight))
 			.saturating_add(T::DbWeight::get().writes(2 as Weight))
 	}
@@ -216,148 +186,134 @@
 // For backwards compatibility and tests
 impl WeightInfo for () {
 	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Preimage PreimageFor (r:1 w:1)
-	// Storage: Preimage StatusFor (r:1 w:1)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
 	fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight {
-		(11_587_000 as Weight)
-			// Standard Error: 17_000
-			.saturating_add((17_428_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes((4 as Weight).saturating_mul(s as Weight)))
+		(35_999_000 as Weight)
+			// Standard Error: 3_000
+			.saturating_add((32_234_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(RocksDbWeight::get().reads(4 as Weight))
+			.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
+			.saturating_add(RocksDbWeight::get().writes(4 as Weight))
+			.saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: Preimage PreimageFor (r:1 w:1)
-	// Storage: Preimage StatusFor (r:1 w:1)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
 	fn on_initialize_named_resolved(s: u32, ) -> Weight {
-		(8_965_000 as Weight)
-			// Standard Error: 11_000
-			.saturating_add((13_410_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))
+		(34_874_000 as Weight)
+			// Standard Error: 2_000
+			.saturating_add((23_114_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(RocksDbWeight::get().reads(4 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(4 as Weight))
+			.saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Preimage PreimageFor (r:1 w:1)
-	// Storage: Preimage StatusFor (r:1 w:1)
-	fn on_initialize_periodic_resolved(s: u32, ) -> Weight {
-		(8_654_000 as Weight)
-			// Standard Error: 17_000
-			.saturating_add((14_990_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().reads((3 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes((3 as Weight).saturating_mul(s as Weight)))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: Preimage PreimageFor (r:1 w:1)
-	// Storage: Preimage StatusFor (r:1 w:1)
-	fn on_initialize_resolved(s: u32, ) -> Weight {
-		(9_303_000 as Weight)
-			// Standard Error: 10_000
-			.saturating_add((12_244_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().reads((2 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
+	// Storage: Scheduler Lookup (r:0 w:1)
+	fn on_initialize_periodic(s: u32, ) -> Weight {
+		(36_469_000 as Weight)
+			// Standard Error: 3_000
+			.saturating_add((32_202_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(RocksDbWeight::get().reads(4 as Weight))
+			.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
+			.saturating_add(RocksDbWeight::get().writes(4 as Weight))
 			.saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Preimage PreimageFor (r:1 w:0)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_named_aborted(s: u32, ) -> Weight {
-		(7_506_000 as Weight)
+	fn on_initialize_periodic_resolved(s: u32, ) -> Weight {
+		(35_352_000 as Weight)
 			// Standard Error: 3_000
-			.saturating_add((5_208_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(2 as Weight))
+			.saturating_add((32_309_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(RocksDbWeight::get().reads(4 as Weight))
 			.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(RocksDbWeight::get().writes(2 as Weight))
-			.saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
+			.saturating_add(RocksDbWeight::get().writes(4 as Weight))
+			.saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Preimage PreimageFor (r:1 w:0)
+	// Storage: Scheduler Lookup (r:0 w:1)
 	fn on_initialize_aborted(s: u32, ) -> Weight {
-		(8_046_000 as Weight)
-			// Standard Error: 3_000
-			.saturating_add((2_914_000 as Weight).saturating_mul(s as Weight))
+		(11_267_000 as Weight)
+			// Standard Error: 1_000
+			.saturating_add((9_368_000 as Weight).saturating_mul(s as Weight))
 			.saturating_add(RocksDbWeight::get().reads(2 as Weight))
-			.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
 			.saturating_add(RocksDbWeight::get().writes(2 as Weight))
+			.saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
 	}
-	// Storage: Scheduler Agenda (r:2 w:2)
+	// Storage: Scheduler Agenda (r:1 w:1)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_periodic_named(s: u32, ) -> Weight {
-		(13_704_000 as Weight)
-			// Standard Error: 4_000
-			.saturating_add((8_186_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes((2 as Weight).saturating_mul(s as Weight)))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	fn on_initialize_periodic(s: u32, ) -> Weight {
-		(12_668_000 as Weight)
-			// Standard Error: 5_000
-			.saturating_add((5_868_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().reads((1 as Weight).saturating_mul(s as Weight)))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
+	fn on_initialize_named_aborted(s: u32, ) -> Weight {
+		(35_937_000 as Weight)
+			// Standard Error: 3_000
+			.saturating_add((23_037_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(RocksDbWeight::get().reads(4 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(4 as Weight))
 			.saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
 	}
-	// Storage: Scheduler Agenda (r:1 w:1)
+	// Storage: Scheduler Agenda (r:2 w:2)
 	// Storage: Scheduler Lookup (r:0 w:1)
 	fn on_initialize_named(s: u32, ) -> Weight {
-		(13_946_000 as Weight)
-			// Standard Error: 4_000
-			.saturating_add((4_367_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
+		(10_338_000 as Weight)
+			// Standard Error: 2_000
+			.saturating_add((9_422_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(RocksDbWeight::get().reads(2 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(2 as Weight))
 			.saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:1 w:1)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
+	// Storage: Scheduler Lookup (r:0 w:1)
 	fn on_initialize(s: u32, ) -> Weight {
-		(13_151_000 as Weight)
-			// Standard Error: 4_000
-			.saturating_add((3_455_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
+		(37_448_000 as Weight)
+			// Standard Error: 7_000
+			.saturating_add((22_907_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(RocksDbWeight::get().reads(4 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(4 as Weight))
+			.saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Agenda (r:1 w:1)
-	fn schedule(s: u32, ) -> Weight {
-		(14_040_000 as Weight)
-			// Standard Error: 1_000
-			.saturating_add((89_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes(1 as Weight))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
+	// Storage: System Account (r:1 w:1)
+	// Storage: System AllExtrinsicsLen (r:1 w:1)
+	// Storage: System BlockWeight (r:1 w:1)
 	// Storage: Scheduler Lookup (r:0 w:1)
-	fn cancel(s: u32, ) -> Weight {
-		(14_376_000 as Weight)
-			// Standard Error: 1_000
-			.saturating_add((576_000 as Weight).saturating_mul(s as Weight))
-			.saturating_add(RocksDbWeight::get().reads(1 as Weight))
-			.saturating_add(RocksDbWeight::get().writes(2 as Weight))
+	fn on_initialize_resolved(s: u32, ) -> Weight {
+		(34_841_000 as Weight)
+			// Standard Error: 7_000
+			.saturating_add((22_966_000 as Weight).saturating_mul(s as Weight))
+			.saturating_add(RocksDbWeight::get().reads(4 as Weight))
+			.saturating_add(RocksDbWeight::get().writes(4 as Weight))
+			.saturating_add(RocksDbWeight::get().writes((1 as Weight).saturating_mul(s as Weight)))
 	}
 	// Storage: Scheduler Lookup (r:1 w:1)
 	// Storage: Scheduler Agenda (r:1 w:1)
 	fn schedule_named(s: u32, ) -> Weight {
-		(16_806_000 as Weight)
-			// Standard Error: 1_000
-			.saturating_add((102_000 as Weight).saturating_mul(s as Weight))
+		(33_845_000 as Weight)
+			// Standard Error: 0
+			.saturating_add((168_000 as Weight).saturating_mul(s as Weight))
 			.saturating_add(RocksDbWeight::get().reads(2 as Weight))
 			.saturating_add(RocksDbWeight::get().writes(2 as Weight))
 	}
 	// Storage: Scheduler Lookup (r:1 w:1)
 	// Storage: Scheduler Agenda (r:1 w:1)
 	fn cancel_named(s: u32, ) -> Weight {
-		(15_852_000 as Weight)
-			// Standard Error: 2_000
-			.saturating_add((590_000 as Weight).saturating_mul(s as Weight))
+		(31_169_000 as Weight)
+			// Standard Error: 1_000
+			.saturating_add((1_565_000 as Weight).saturating_mul(s as Weight))
 			.saturating_add(RocksDbWeight::get().reads(2 as Weight))
 			.saturating_add(RocksDbWeight::get().writes(2 as Weight))
 	}
modifiedruntime/common/Cargo.tomldiffbeforeafterboth
--- a/runtime/common/Cargo.toml
+++ b/runtime/common/Cargo.toml
@@ -89,6 +89,10 @@
 default-features = false
 path = "../../pallets/refungible"
 
+[dependencies.pallet-unique-scheduler]
+default-features = false
+path = "../../pallets/scheduler"
+
 [dependencies.up-data-structs]
 default-features = false
 path = "../../primitives/data-structs"
modifiedruntime/common/src/runtime_apis.rsdiffbeforeafterboth
--- a/runtime/common/src/runtime_apis.rs
+++ b/runtime/common/src/runtime_apis.rs
@@ -843,6 +843,7 @@
                     list_benchmark!(list, extra, pallet_fungible, Fungible);
                     list_benchmark!(list, extra, pallet_refungible, Refungible);
                     list_benchmark!(list, extra, pallet_nonfungible, Nonfungible);
+                    list_benchmark!(list, extra, pallet_unique_scheduler, Scheduler);
                     list_benchmark!(list, extra, pallet_proxy_rmrk_core, RmrkCore);
                     // list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate);
 
@@ -887,6 +888,7 @@
                     add_benchmark!(params, batches, pallet_fungible, Fungible);
                     add_benchmark!(params, batches, pallet_refungible, Refungible);
                     add_benchmark!(params, batches, pallet_nonfungible, Nonfungible);
+                    add_benchmark!(params, batches, pallet_unique_scheduler, Scheduler);
                     add_benchmark!(params, batches, pallet_proxy_rmrk_core, RmrkCore);
                     // add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate);
 
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -36,6 +36,7 @@
     'pallet-proxy-rmrk-core/runtime-benchmarks',
     'pallet-unique/runtime-benchmarks',
     'pallet-inflation/runtime-benchmarks',
+    'pallet-unique-scheduler/runtime-benchmarks',
     'pallet-xcm/runtime-benchmarks',
     'sp-runtime/runtime-benchmarks',
     'xcm-builder/runtime-benchmarks',
@@ -93,7 +94,7 @@
     'pallet-proxy-rmrk-core/std',
     'pallet-proxy-rmrk-equip/std',
     'pallet-unique/std',
-    'pallet-unq-scheduler/std',
+    'pallet-unique-scheduler/std',
     'pallet-charge-transaction/std',
     'up-data-structs/std',
     'sp-api/std',
@@ -412,7 +413,7 @@
 pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
 pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
 pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
-pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }
+pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }
 # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
 pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.22", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
 pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -68,7 +68,7 @@
 		WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, ConstantMultiplier,
 	},
 };
-use pallet_unq_scheduler::DispatchCall;
+use pallet_unique_scheduler::DispatchCall;
 use up_data_structs::{
 	CollectionId, TokenId, TokenData, Property, PropertyKeyPermission, CollectionLimits,
 	CollectionStats, RpcCollection,
@@ -969,7 +969,7 @@
 }
 
 pub struct SchedulerPaymentExecutor;
-impl<T: frame_system::Config + pallet_unq_scheduler::Config, SelfContainedSignedInfo>
+impl<T: frame_system::Config + pallet_unique_scheduler::Config, SelfContainedSignedInfo>
 	DispatchCall<T, SelfContainedSignedInfo> for SchedulerPaymentExecutor
 where
 	<T as frame_system::Config>::Call: Member
@@ -979,13 +979,13 @@
 		+ From<frame_system::Call<Runtime>>,
 	SelfContainedSignedInfo: Send + Sync + 'static,
 	Call: From<<T as frame_system::Config>::Call>
-		+ From<<T as pallet_unq_scheduler::Config>::Call>
+		+ From<<T as pallet_unique_scheduler::Config>::Call>
 		+ SelfContainedCall<SignedInfo = SelfContainedSignedInfo>,
 	sp_runtime::AccountId32: From<<T as frame_system::Config>::AccountId>,
 {
 	fn dispatch_call(
 		signer: <T as frame_system::Config>::AccountId,
-		call: <T as pallet_unq_scheduler::Config>::Call,
+		call: <T as pallet_unique_scheduler::Config>::Call,
 	) -> Result<
 		Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>,
 		TransactionValidityError,
@@ -1011,7 +1011,7 @@
 	fn reserve_balance(
 		id: [u8; 16],
 		sponsor: <T as frame_system::Config>::AccountId,
-		call: <T as pallet_unq_scheduler::Config>::Call,
+		call: <T as pallet_unique_scheduler::Config>::Call,
 		count: u32,
 	) -> Result<(), DispatchError> {
 		let dispatch_info = call.get_dispatch_info();
@@ -1028,7 +1028,7 @@
 	fn pay_for_call(
 		id: [u8; 16],
 		sponsor: <T as frame_system::Config>::AccountId,
-		call: <T as pallet_unq_scheduler::Config>::Call,
+		call: <T as pallet_unique_scheduler::Config>::Call,
 	) -> Result<u128, DispatchError> {
 		let dispatch_info = call.get_dispatch_info();
 		let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0);
@@ -1069,7 +1069,7 @@
 	}
 }
 
-impl pallet_unq_scheduler::Config for Runtime {
+impl pallet_unique_scheduler::Config for Runtime {
 	type Event = Event;
 	type Origin = Origin;
 	type Currency = Balances;
@@ -1158,7 +1158,7 @@
 		// Unique Pallets
 		Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
 		Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,
-		Scheduler: pallet_unq_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
+		Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
 		// free = 63
 		Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,
 		// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -37,6 +37,7 @@
     'pallet-proxy-rmrk-equip/runtime-benchmarks',
     'pallet-unique/runtime-benchmarks',
     'pallet-inflation/runtime-benchmarks',
+    'pallet-unique-scheduler/runtime-benchmarks',
     'pallet-xcm/runtime-benchmarks',
     'sp-runtime/runtime-benchmarks',
     'xcm-builder/runtime-benchmarks',
@@ -94,7 +95,7 @@
     'pallet-proxy-rmrk-core/std',
     'pallet-proxy-rmrk-equip/std',
     'pallet-unique/std',
-    'pallet-unq-scheduler/std',
+    'pallet-unique-scheduler/std',
     'pallet-charge-transaction/std',
     'up-data-structs/std',
     'sp-api/std',
@@ -419,7 +420,7 @@
 pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
 pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
 pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
-pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }
+pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }
 # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
 pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.22", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
 pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
modifiedruntime/quartz/src/lib.rsdiffbeforeafterboth
--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -68,7 +68,7 @@
 		WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, ConstantMultiplier,
 	},
 };
-use pallet_unq_scheduler::DispatchCall;
+use pallet_unique_scheduler::DispatchCall;
 use up_data_structs::{
 	CollectionId, TokenId, TokenData, Property, PropertyKeyPermission, CollectionLimits,
 	CollectionStats, RpcCollection,
@@ -968,7 +968,7 @@
 }
 
 pub struct SchedulerPaymentExecutor;
-impl<T: frame_system::Config + pallet_unq_scheduler::Config, SelfContainedSignedInfo>
+impl<T: frame_system::Config + pallet_unique_scheduler::Config, SelfContainedSignedInfo>
 	DispatchCall<T, SelfContainedSignedInfo> for SchedulerPaymentExecutor
 where
 	<T as frame_system::Config>::Call: Member
@@ -978,13 +978,13 @@
 		+ From<frame_system::Call<Runtime>>,
 	SelfContainedSignedInfo: Send + Sync + 'static,
 	Call: From<<T as frame_system::Config>::Call>
-		+ From<<T as pallet_unq_scheduler::Config>::Call>
+		+ From<<T as pallet_unique_scheduler::Config>::Call>
 		+ SelfContainedCall<SignedInfo = SelfContainedSignedInfo>,
 	sp_runtime::AccountId32: From<<T as frame_system::Config>::AccountId>,
 {
 	fn dispatch_call(
 		signer: <T as frame_system::Config>::AccountId,
-		call: <T as pallet_unq_scheduler::Config>::Call,
+		call: <T as pallet_unique_scheduler::Config>::Call,
 	) -> Result<
 		Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>,
 		TransactionValidityError,
@@ -1010,7 +1010,7 @@
 	fn reserve_balance(
 		id: [u8; 16],
 		sponsor: <T as frame_system::Config>::AccountId,
-		call: <T as pallet_unq_scheduler::Config>::Call,
+		call: <T as pallet_unique_scheduler::Config>::Call,
 		count: u32,
 	) -> Result<(), DispatchError> {
 		let dispatch_info = call.get_dispatch_info();
@@ -1027,7 +1027,7 @@
 	fn pay_for_call(
 		id: [u8; 16],
 		sponsor: <T as frame_system::Config>::AccountId,
-		call: <T as pallet_unq_scheduler::Config>::Call,
+		call: <T as pallet_unique_scheduler::Config>::Call,
 	) -> Result<u128, DispatchError> {
 		let dispatch_info = call.get_dispatch_info();
 		let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0);
@@ -1068,7 +1068,7 @@
 	}
 }
 
-impl pallet_unq_scheduler::Config for Runtime {
+impl pallet_unique_scheduler::Config for Runtime {
 	type Event = Event;
 	type Origin = Origin;
 	type Currency = Balances;
@@ -1156,7 +1156,7 @@
 		// Unique Pallets
 		Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
 		Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,
-		Scheduler: pallet_unq_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
+		Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
 		// free = 63
 		Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,
 		// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -37,6 +37,7 @@
     'pallet-proxy-rmrk-equip/runtime-benchmarks',
     'pallet-unique/runtime-benchmarks',
     'pallet-inflation/runtime-benchmarks',
+    'pallet-unique-scheduler/runtime-benchmarks',
     'pallet-xcm/runtime-benchmarks',
     'sp-runtime/runtime-benchmarks',
     'xcm-builder/runtime-benchmarks',
@@ -95,7 +96,7 @@
     'pallet-proxy-rmrk-core/std',
     'pallet-proxy-rmrk-equip/std',
     'pallet-unique/std',
-    'pallet-unq-scheduler/std',
+    'pallet-unique-scheduler/std',
     'pallet-charge-transaction/std',
     'up-data-structs/std',
     'sp-api/std',
@@ -412,7 +413,7 @@
 pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
 pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
 pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
-pallet-unq-scheduler = { path = '../../pallets/scheduler', default-features = false }
+pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }
 # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
 pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.22", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
 pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
modifiedruntime/unique/src/lib.rsdiffbeforeafterboth
--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -68,7 +68,7 @@
 		WeightToFeePolynomial, WeightToFeeCoefficient, WeightToFeeCoefficients, ConstantMultiplier,
 	},
 };
-use pallet_unq_scheduler::DispatchCall;
+use pallet_unique_scheduler::DispatchCall;
 use up_data_structs::{
 	CollectionId, TokenId, TokenData, Property, PropertyKeyPermission, CollectionLimits,
 	CollectionStats, RpcCollection,
@@ -967,7 +967,7 @@
 }
 
 pub struct SchedulerPaymentExecutor;
-impl<T: frame_system::Config + pallet_unq_scheduler::Config, SelfContainedSignedInfo>
+impl<T: frame_system::Config + pallet_unique_scheduler::Config, SelfContainedSignedInfo>
 	DispatchCall<T, SelfContainedSignedInfo> for SchedulerPaymentExecutor
 where
 	<T as frame_system::Config>::Call: Member
@@ -977,13 +977,13 @@
 		+ From<frame_system::Call<Runtime>>,
 	SelfContainedSignedInfo: Send + Sync + 'static,
 	Call: From<<T as frame_system::Config>::Call>
-		+ From<<T as pallet_unq_scheduler::Config>::Call>
+		+ From<<T as pallet_unique_scheduler::Config>::Call>
 		+ SelfContainedCall<SignedInfo = SelfContainedSignedInfo>,
 	sp_runtime::AccountId32: From<<T as frame_system::Config>::AccountId>,
 {
 	fn dispatch_call(
 		signer: <T as frame_system::Config>::AccountId,
-		call: <T as pallet_unq_scheduler::Config>::Call,
+		call: <T as pallet_unique_scheduler::Config>::Call,
 	) -> Result<
 		Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>,
 		TransactionValidityError,
@@ -1009,7 +1009,7 @@
 	fn reserve_balance(
 		id: [u8; 16],
 		sponsor: <T as frame_system::Config>::AccountId,
-		call: <T as pallet_unq_scheduler::Config>::Call,
+		call: <T as pallet_unique_scheduler::Config>::Call,
 		count: u32,
 	) -> Result<(), DispatchError> {
 		let dispatch_info = call.get_dispatch_info();
@@ -1026,7 +1026,7 @@
 	fn pay_for_call(
 		id: [u8; 16],
 		sponsor: <T as frame_system::Config>::AccountId,
-		call: <T as pallet_unq_scheduler::Config>::Call,
+		call: <T as pallet_unique_scheduler::Config>::Call,
 	) -> Result<u128, DispatchError> {
 		let dispatch_info = call.get_dispatch_info();
 		let weight: Balance = ChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0);
@@ -1067,7 +1067,7 @@
 	}
 }
 
-impl pallet_unq_scheduler::Config for Runtime {
+impl pallet_unique_scheduler::Config for Runtime {
 	type Event = Event;
 	type Origin = Origin;
 	type Currency = Balances;
@@ -1155,7 +1155,7 @@
 		// Unique Pallets
 		Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
 		Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,
-		Scheduler: pallet_unq_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
+		Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
 		// free = 63
 		Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,
 		// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,