Skip to content
Snippets Groups Projects
Commit e0c47c48 authored by dharjeezy's avatar dharjeezy Committed by GitHub
Browse files

remove base weight annotations (#10373)


* remove base weight annotations

* Update frame/scheduler/src/lib.rs

Co-authored-by: default avatarShawn Tabrizi <shawntabrizi@gmail.com>

Co-authored-by: default avatarDamilare <dakinlose@teamapt.com>
Co-authored-by: default avatarBastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: default avatarShawn Tabrizi <shawntabrizi@gmail.com>
parent f12e22a6
Branches
No related merge requests found
......@@ -271,8 +271,6 @@ pub mod pallet {
/// - `transfer_keep_alive` works the same way as `transfer`, but has an additional check
/// that the transfer will not kill the origin account.
/// ---------------------------------
/// - Base Weight: 73.64 µs, worst case scenario (account created, account removed)
/// - DB Weight: 1 Read and 1 Write to destination account
/// - Origin account is already in memory, so no DB operations for them.
/// # </weight>
#[pallet::weight(T::WeightInfo::transfer())]
......@@ -300,16 +298,6 @@ pub mod pallet {
/// it will reset the account nonce (`frame_system::AccountNonce`).
///
/// The dispatch origin for this call is `root`.
///
/// # <weight>
/// - Independent of the arguments.
/// - Contains a limited number of reads and writes.
/// ---------------------
/// - Base Weight:
/// - Creating: 27.56 µs
/// - Killing: 35.11 µs
/// - DB Weight: 1 Read, 1 Write to `who`
/// # </weight>
#[pallet::weight(
T::WeightInfo::set_balance_creating() // Creates a new account.
.max(T::WeightInfo::set_balance_killing()) // Kills an existing account.
......@@ -381,11 +369,6 @@ pub mod pallet {
/// 99% of the time you want [`transfer`] instead.
///
/// [`transfer`]: struct.Pallet.html#method.transfer
/// # <weight>
/// - Cheaper than transfer because account cannot be killed.
/// - Base Weight: 51.4 µs
/// - DB Weight: 1 Read and 1 Write to dest (sender is in overlay already)
/// #</weight>
#[pallet::weight(T::WeightInfo::transfer_keep_alive())]
pub fn transfer_keep_alive(
origin: OriginFor<T>,
......
......@@ -243,16 +243,6 @@ pub mod pallet {
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
/// Execute the scheduled calls
///
/// # <weight>
/// - S = Number of already scheduled calls
/// - N = Named scheduled calls
/// - P = Periodic Calls
/// - Base Weight: 9.243 + 23.45 * S µs
/// - DB Weight:
/// - Read: Agenda + Lookup * N + Agenda(Future) * P
/// - Write: Agenda + Lookup * N + Agenda(future) * P
/// # </weight>
fn on_initialize(now: T::BlockNumber) -> Weight {
let limit = T::MaximumWeight::get();
let mut queued = Agenda::<T>::take(now)
......@@ -352,15 +342,6 @@ pub mod pallet {
#[pallet::call]
impl<T: Config> Pallet<T> {
/// Anonymously schedule a task.
///
/// # <weight>
/// - S = Number of already scheduled calls
/// - Base Weight: 22.29 + .126 * S µs
/// - DB Weight:
/// - Read: Agenda
/// - Write: Agenda
/// - Will use base weight of 25 which should be good for up to 30 scheduled calls
/// # </weight>
#[pallet::weight(<T as Config>::WeightInfo::schedule(T::MaxScheduledPerBlock::get()))]
pub fn schedule(
origin: OriginFor<T>,
......@@ -382,15 +363,6 @@ pub mod pallet {
}
/// Cancel an anonymously scheduled task.
///
/// # <weight>
/// - S = Number of already scheduled calls
/// - Base Weight: 22.15 + 2.869 * S µs
/// - DB Weight:
/// - Read: Agenda
/// - Write: Agenda, Lookup
/// - Will use base weight of 100 which should be good for up to 30 scheduled calls
/// # </weight>
#[pallet::weight(<T as Config>::WeightInfo::cancel(T::MaxScheduledPerBlock::get()))]
pub fn cancel(origin: OriginFor<T>, when: T::BlockNumber, index: u32) -> DispatchResult {
T::ScheduleOrigin::ensure_origin(origin.clone())?;
......@@ -400,15 +372,6 @@ pub mod pallet {
}
/// Schedule a named task.
///
/// # <weight>
/// - S = Number of already scheduled calls
/// - Base Weight: 29.6 + .159 * S µs
/// - DB Weight:
/// - Read: Agenda, Lookup
/// - Write: Agenda, Lookup
/// - Will use base weight of 35 which should be good for more than 30 scheduled calls
/// # </weight>
#[pallet::weight(<T as Config>::WeightInfo::schedule_named(T::MaxScheduledPerBlock::get()))]
pub fn schedule_named(
origin: OriginFor<T>,
......@@ -432,15 +395,6 @@ pub mod pallet {
}
/// Cancel a named scheduled task.
///
/// # <weight>
/// - S = Number of already scheduled calls
/// - Base Weight: 24.91 + 2.907 * S µs
/// - DB Weight:
/// - Read: Agenda, Lookup
/// - Write: Agenda, Lookup
/// - Will use base weight of 100 which should be good for up to 30 scheduled calls
/// # </weight>
#[pallet::weight(<T as Config>::WeightInfo::cancel_named(T::MaxScheduledPerBlock::get()))]
pub fn cancel_named(origin: OriginFor<T>, id: Vec<u8>) -> DispatchResult {
T::ScheduleOrigin::ensure_origin(origin.clone())?;
......
......@@ -351,14 +351,6 @@ pub mod pallet {
}
/// Set the number of pages in the WebAssembly environment's heap.
///
/// # <weight>
/// - `O(1)`
/// - 1 storage write.
/// - Base Weight: 1.405 µs
/// - 1 write to HEAP_PAGES
/// - 1 digest item
/// # </weight>
#[pallet::weight((T::SystemWeightInfo::set_heap_pages(), DispatchClass::Operational))]
pub fn set_heap_pages(origin: OriginFor<T>, pages: u64) -> DispatchResultWithPostInfo {
ensure_root(origin)?;
......@@ -407,13 +399,6 @@ pub mod pallet {
}
/// Set some items of storage.
///
/// # <weight>
/// - `O(I)` where `I` length of `items`
/// - `I` storage writes (`O(1)`).
/// - Base Weight: 0.568 * i µs
/// - Writes: Number of items
/// # </weight>
#[pallet::weight((
T::SystemWeightInfo::set_storage(items.len() as u32),
DispatchClass::Operational,
......@@ -430,13 +415,6 @@ pub mod pallet {
}
/// Kill some items from storage.
///
/// # <weight>
/// - `O(IK)` where `I` length of `keys` and `K` length of one key
/// - `I` storage deletions.
/// - Base Weight: .378 * i µs
/// - Writes: Number of items
/// # </weight>
#[pallet::weight((
T::SystemWeightInfo::kill_storage(keys.len() as u32),
DispatchClass::Operational,
......@@ -453,13 +431,6 @@ pub mod pallet {
///
/// **NOTE:** We rely on the Root origin to provide us the number of subkeys under
/// the prefix we are removing to accurately calculate the weight of this function.
///
/// # <weight>
/// - `O(P)` where `P` amount of keys with prefix `prefix`
/// - `P` storage deletions.
/// - Base Weight: 0.834 * P µs
/// - Writes: Number of subkeys + 1
/// # </weight>
#[pallet::weight((
T::SystemWeightInfo::kill_prefix(_subkeys.saturating_add(1)),
DispatchClass::Operational,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment