Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into at-storage-deposit
Browse files Browse the repository at this point in the history
  • Loading branch information
athei committed Nov 28, 2021
2 parents 38bb5c2 + de6033a commit a997978
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 94 deletions.
17 changes: 0 additions & 17 deletions frame/balances/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())]
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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>,
Expand Down
46 changes: 0 additions & 46 deletions frame/scheduler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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>,
Expand All @@ -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())?;
Expand All @@ -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>,
Expand All @@ -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())?;
Expand Down
2 changes: 1 addition & 1 deletion frame/staking/src/slashing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
//! has multiple misbehaviors. However, accounting for such cases is necessary
//! to deter a class of "rage-quit" attacks.
//!
//! Based on research at <https://w3f-research.readthedocs.io/en/latest/polkadot/slashing/npos.html>
//! Based on research at <https://research.web3.foundation/en/latest/polkadot/slashing/npos.html>
use crate::{
BalanceOf, Config, EraIndex, Error, Exposure, NegativeImbalanceOf, Pallet, Perbill,
Expand Down
29 changes: 0 additions & 29 deletions frame/system/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion frame/transaction-payment/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ type BalanceOf<T> = <<T as Config>::OnChargeTransaction as OnChargeTransaction<T
/// Meaning that fees can change by around ~23% per day, given extreme congestion.
///
/// More info can be found at:
/// <https://w3f-research.readthedocs.io/en/latest/polkadot/Token%20Economics.html>
/// <https://research.web3.foundation/en/latest/polkadot/overview/2-token-economics.html>
pub struct TargetedFeeAdjustment<T, S, V, M>(sp_std::marker::PhantomData<(T, S, V, M)>);

/// Something that can convert the current multiplier to the next one.
Expand Down

0 comments on commit a997978

Please sign in to comment.