feat: Rebrand Polkadot/Substrate references to PezkuwiChain
This commit systematically rebrands various references from Parity Technologies' Polkadot/Substrate ecosystem to PezkuwiChain within the kurdistan-sdk. Key changes include: - Updated external repository URLs (zombienet-sdk, parity-db, parity-scale-codec, wasm-instrument) to point to pezkuwichain forks. - Modified internal documentation and code comments to reflect PezkuwiChain naming and structure. - Replaced direct references to with or specific paths within the for XCM, Pezkuwi, and other modules. - Cleaned up deprecated issue and PR references in various and files, particularly in and modules. - Adjusted image and logo URLs in documentation to point to PezkuwiChain assets. - Removed or rephrased comments related to external Polkadot/Substrate PRs and issues. This is a significant step towards fully customizing the SDK for the PezkuwiChain ecosystem.
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
[package]
|
||||
name = "pezpallet-scheduler"
|
||||
version = "29.0.0"
|
||||
authors.workspace = true
|
||||
edition.workspace = true
|
||||
license = "Apache-2.0"
|
||||
homepage.workspace = true
|
||||
repository.workspace = true
|
||||
description = "FRAME Scheduler pallet"
|
||||
readme = "README.md"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
codec = { features = ["derive"], workspace = true }
|
||||
docify = { workspace = true }
|
||||
pezframe-benchmarking = { optional = true, workspace = true }
|
||||
pezframe-support = { workspace = true }
|
||||
pezframe-system = { workspace = true }
|
||||
log = { workspace = true }
|
||||
scale-info = { features = ["derive"], workspace = true }
|
||||
pezsp-io = { workspace = true }
|
||||
pezsp-runtime = { workspace = true }
|
||||
pezsp-weights = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
pezpallet-preimage = { workspace = true, default-features = true }
|
||||
pezsp-core = { workspace = true, default-features = true }
|
||||
bizinikiwi-test-utils = { workspace = true }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
runtime-benchmarks = [
|
||||
"pezframe-benchmarking",
|
||||
"pezframe-benchmarking/runtime-benchmarks",
|
||||
"pezframe-support/runtime-benchmarks",
|
||||
"pezframe-system/runtime-benchmarks",
|
||||
"pezpallet-preimage/runtime-benchmarks",
|
||||
"pezsp-io/runtime-benchmarks",
|
||||
"pezsp-runtime/runtime-benchmarks",
|
||||
]
|
||||
std = [
|
||||
"codec/std",
|
||||
"pezframe-benchmarking?/std",
|
||||
"pezframe-support/std",
|
||||
"pezframe-system/std",
|
||||
"log/std",
|
||||
"pezpallet-preimage/std",
|
||||
"scale-info/std",
|
||||
"pezsp-core/std",
|
||||
"pezsp-io/std",
|
||||
"pezsp-runtime/std",
|
||||
"pezsp-weights/std",
|
||||
]
|
||||
try-runtime = [
|
||||
"pezframe-support/try-runtime",
|
||||
"pezframe-system/try-runtime",
|
||||
"pezpallet-preimage/try-runtime",
|
||||
"pezsp-runtime/try-runtime",
|
||||
]
|
||||
@@ -0,0 +1,34 @@
|
||||
# Scheduler
|
||||
A module for scheduling dispatches.
|
||||
|
||||
- [`scheduler::Config`](https://docs.rs/pezpallet-scheduler/latest/pallet_scheduler/trait.Config.html)
|
||||
- [`Call`](https://docs.rs/pezpallet-scheduler/latest/pallet_scheduler/enum.Call.html)
|
||||
- [`Module`](https://docs.rs/pezpallet-scheduler/latest/pallet_scheduler/struct.Module.html)
|
||||
|
||||
## Overview
|
||||
|
||||
This module exposes capabilities for scheduling dispatches to occur at a
|
||||
specified block number or at a specified period. These scheduled dispatches
|
||||
may be named or anonymous and may be canceled.
|
||||
|
||||
**NOTE:** The scheduled calls will be dispatched with the default filter
|
||||
for the origin: namely `frame_system::Config::BaseCallFilter` for all origin
|
||||
except root which will get no filter. And not the filter contained in origin
|
||||
use to call `fn schedule`.
|
||||
|
||||
If a call is scheduled using proxy or whatever mechanism which adds filter,
|
||||
then those filter will not be used when dispatching the schedule call.
|
||||
|
||||
## Interface
|
||||
|
||||
### Dispatchable Functions
|
||||
|
||||
- `schedule` - schedule a dispatch, which may be periodic, to occur at a
|
||||
specified block and with a specified priority.
|
||||
- `cancel` - cancel a scheduled dispatch, specified by block number and
|
||||
index.
|
||||
- `schedule_named` - augments the `schedule` interface with an additional
|
||||
`Vec<u8>` parameter that can be used for identification.
|
||||
- `cancel_named` - the named complement to the cancel function.
|
||||
|
||||
License: Apache 2.0
|
||||
@@ -0,0 +1,514 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) 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.
|
||||
|
||||
//! Scheduler pallet benchmarking.
|
||||
|
||||
use alloc::vec;
|
||||
use pezframe_benchmarking::v2::*;
|
||||
use pezframe_support::{
|
||||
ensure,
|
||||
traits::{schedule::Priority, BoundedInline},
|
||||
weights::WeightMeter,
|
||||
};
|
||||
use pezframe_system::{EventRecord, RawOrigin};
|
||||
|
||||
use crate::*;
|
||||
|
||||
type SystemCall<T> = pezframe_system::Call<T>;
|
||||
type SystemOrigin<T> = <T as pezframe_system::Config>::RuntimeOrigin;
|
||||
|
||||
const SEED: u32 = 0;
|
||||
const BLOCK_NUMBER: u32 = 2;
|
||||
|
||||
fn assert_last_event<T: Config>(generic_event: <T as Config>::RuntimeEvent) {
|
||||
let events = pezframe_system::Pallet::<T>::events();
|
||||
let system_event: <T as pezframe_system::Config>::RuntimeEvent = generic_event.into();
|
||||
// compare to the last event record
|
||||
let EventRecord { event, .. } = &events[events.len() - 1];
|
||||
assert_eq!(event, &system_event);
|
||||
}
|
||||
|
||||
/// Add `n` 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: BlockNumberFor<T>, n: u32) -> Result<(), &'static str> {
|
||||
let t = DispatchTime::At(when);
|
||||
let origin: <T as Config>::PalletsOrigin = pezframe_system::RawOrigin::Root.into();
|
||||
for i in 0..n {
|
||||
let call = make_call::<T>(None);
|
||||
let period = Some(((i + 100).into(), 100));
|
||||
let name = u32_to_name(i);
|
||||
Pallet::<T>::do_schedule_named(name, t, period, 0, origin.clone(), call)?;
|
||||
}
|
||||
ensure!(Agenda::<T>::get(when).len() == n as usize, "didn't fill schedule");
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn u32_to_name(i: u32) -> TaskName {
|
||||
i.using_encoded(blake2_256)
|
||||
}
|
||||
|
||||
fn make_task<T: Config>(
|
||||
periodic: bool,
|
||||
named: bool,
|
||||
signed: bool,
|
||||
maybe_lookup_len: Option<u32>,
|
||||
priority: Priority,
|
||||
) -> ScheduledOf<T> {
|
||||
let call = make_call::<T>(maybe_lookup_len);
|
||||
let maybe_periodic = match periodic {
|
||||
true => Some((100u32.into(), 100)),
|
||||
false => None,
|
||||
};
|
||||
let maybe_id = match named {
|
||||
true => Some(u32_to_name(0)),
|
||||
false => None,
|
||||
};
|
||||
let origin = make_origin::<T>(signed);
|
||||
Scheduled { maybe_id, priority, call, maybe_periodic, origin, _phantom: PhantomData }
|
||||
}
|
||||
|
||||
fn bounded<T: Config>(len: u32) -> Option<BoundedCallOf<T>> {
|
||||
let call =
|
||||
<<T as Config>::RuntimeCall>::from(SystemCall::remark { remark: vec![0; len as usize] });
|
||||
T::Preimages::bound(call).ok()
|
||||
}
|
||||
|
||||
fn make_call<T: Config>(maybe_lookup_len: Option<u32>) -> BoundedCallOf<T> {
|
||||
let bound = BoundedInline::bound() as u32;
|
||||
let mut len = match maybe_lookup_len {
|
||||
Some(len) => len.min(T::Preimages::MAX_LENGTH as u32 - 2).max(bound) - 3,
|
||||
None => bound.saturating_sub(4),
|
||||
};
|
||||
|
||||
loop {
|
||||
let c = match bounded::<T>(len) {
|
||||
Some(x) => x,
|
||||
None => {
|
||||
len -= 1;
|
||||
continue;
|
||||
},
|
||||
};
|
||||
if c.lookup_needed() == maybe_lookup_len.is_some() {
|
||||
break c;
|
||||
}
|
||||
if maybe_lookup_len.is_some() {
|
||||
len += 1;
|
||||
} else {
|
||||
if len > 0 {
|
||||
len -= 1;
|
||||
} else {
|
||||
break c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn make_origin<T: Config>(signed: bool) -> <T as Config>::PalletsOrigin {
|
||||
match signed {
|
||||
true => pezframe_system::RawOrigin::Signed(account("origin", 0, SEED)).into(),
|
||||
false => pezframe_system::RawOrigin::Root.into(),
|
||||
}
|
||||
}
|
||||
|
||||
#[benchmarks]
|
||||
mod benchmarks {
|
||||
use super::*;
|
||||
|
||||
// `service_agendas` when no work is done.
|
||||
#[benchmark]
|
||||
fn service_agendas_base() {
|
||||
let now = BLOCK_NUMBER.into();
|
||||
IncompleteSince::<T>::put(now - One::one());
|
||||
|
||||
#[block]
|
||||
{
|
||||
Pallet::<T>::service_agendas(&mut WeightMeter::new(), now, 0);
|
||||
}
|
||||
|
||||
assert_eq!(IncompleteSince::<T>::get(), Some(now - One::one()));
|
||||
}
|
||||
|
||||
// `service_agenda` when no work is done.
|
||||
#[benchmark]
|
||||
fn service_agenda_base(
|
||||
s: Linear<0, { T::MaxScheduledPerBlock::get() }>,
|
||||
) -> Result<(), BenchmarkError> {
|
||||
let now = BLOCK_NUMBER.into();
|
||||
fill_schedule::<T>(now, s)?;
|
||||
assert_eq!(Agenda::<T>::get(now).len() as u32, s);
|
||||
|
||||
#[block]
|
||||
{
|
||||
Pallet::<T>::service_agenda(&mut WeightMeter::new(), true, now, now, 0);
|
||||
}
|
||||
|
||||
assert_eq!(Agenda::<T>::get(now).len() as u32, s);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// `service_task` when the task is a non-periodic, non-named, non-fetched call which is not
|
||||
// dispatched (e.g. due to being overweight).
|
||||
#[benchmark]
|
||||
fn service_task_base() {
|
||||
let now = BLOCK_NUMBER.into();
|
||||
let task = make_task::<T>(false, false, false, None, 0);
|
||||
// prevent any tasks from actually being executed as we only want the surrounding weight.
|
||||
let mut counter = WeightMeter::with_limit(Weight::zero());
|
||||
let _result;
|
||||
|
||||
#[block]
|
||||
{
|
||||
_result = Pallet::<T>::service_task(&mut counter, now, now, 0, true, task);
|
||||
}
|
||||
|
||||
// assert!(_result.is_ok());
|
||||
}
|
||||
|
||||
// `service_task` when the task is a non-periodic, non-named, fetched call (with a known
|
||||
// preimage length) and which is not dispatched (e.g. due to being overweight).
|
||||
#[benchmark(pov_mode = MaxEncodedLen {
|
||||
// Use measured PoV size for the Preimages since we pass in a length witness.
|
||||
Preimage::PreimageFor: Measured
|
||||
})]
|
||||
fn service_task_fetched(
|
||||
s: Linear<{ BoundedInline::bound() as u32 }, { T::Preimages::MAX_LENGTH as u32 }>,
|
||||
) {
|
||||
let now = BLOCK_NUMBER.into();
|
||||
let task = make_task::<T>(false, false, false, Some(s), 0);
|
||||
// prevent any tasks from actually being executed as we only want the surrounding weight.
|
||||
let mut counter = WeightMeter::with_limit(Weight::zero());
|
||||
let _result;
|
||||
|
||||
#[block]
|
||||
{
|
||||
_result = Pallet::<T>::service_task(&mut counter, now, now, 0, true, task);
|
||||
}
|
||||
|
||||
// assert!(result.is_ok());
|
||||
}
|
||||
|
||||
// `service_task` when the task is a non-periodic, named, non-fetched call which is not
|
||||
// dispatched (e.g. due to being overweight).
|
||||
#[benchmark]
|
||||
fn service_task_named() {
|
||||
let now = BLOCK_NUMBER.into();
|
||||
let task = make_task::<T>(false, true, false, None, 0);
|
||||
// prevent any tasks from actually being executed as we only want the surrounding weight.
|
||||
let mut counter = WeightMeter::with_limit(Weight::zero());
|
||||
let _result;
|
||||
|
||||
#[block]
|
||||
{
|
||||
_result = Pallet::<T>::service_task(&mut counter, now, now, 0, true, task);
|
||||
}
|
||||
|
||||
// assert!(result.is_ok());
|
||||
}
|
||||
|
||||
// `service_task` when the task is a periodic, non-named, non-fetched call which is not
|
||||
// dispatched (e.g. due to being overweight).
|
||||
#[benchmark]
|
||||
fn service_task_periodic() {
|
||||
let now = BLOCK_NUMBER.into();
|
||||
let task = make_task::<T>(true, false, false, None, 0);
|
||||
// prevent any tasks from actually being executed as we only want the surrounding weight.
|
||||
let mut counter = WeightMeter::with_limit(Weight::zero());
|
||||
let _result;
|
||||
|
||||
#[block]
|
||||
{
|
||||
_result = Pallet::<T>::service_task(&mut counter, now, now, 0, true, task);
|
||||
}
|
||||
|
||||
// assert!(result.is_ok());
|
||||
}
|
||||
|
||||
// `execute_dispatch` when the origin is `Signed`, not counting the dispatchable's weight.
|
||||
#[benchmark]
|
||||
fn execute_dispatch_signed() -> Result<(), BenchmarkError> {
|
||||
let mut counter = WeightMeter::new();
|
||||
let origin = make_origin::<T>(true);
|
||||
let call = T::Preimages::realize(&make_call::<T>(None))?.0;
|
||||
let result;
|
||||
|
||||
#[block]
|
||||
{
|
||||
result = Pallet::<T>::execute_dispatch(&mut counter, origin, call);
|
||||
}
|
||||
|
||||
assert!(result.is_ok());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// `execute_dispatch` when the origin is not `Signed`, not counting the dispatchable's weight.
|
||||
#[benchmark]
|
||||
fn execute_dispatch_unsigned() -> Result<(), BenchmarkError> {
|
||||
let mut counter = WeightMeter::new();
|
||||
let origin = make_origin::<T>(false);
|
||||
let call = T::Preimages::realize(&make_call::<T>(None))?.0;
|
||||
let result;
|
||||
|
||||
#[block]
|
||||
{
|
||||
result = Pallet::<T>::execute_dispatch(&mut counter, origin, call);
|
||||
}
|
||||
|
||||
assert!(result.is_ok());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark]
|
||||
fn schedule(
|
||||
s: Linear<0, { T::MaxScheduledPerBlock::get() - 1 }>,
|
||||
) -> Result<(), BenchmarkError> {
|
||||
let when = BLOCK_NUMBER.into();
|
||||
let periodic = Some((BlockNumberFor::<T>::one(), 100));
|
||||
let priority = 0;
|
||||
// Essentially a no-op call.
|
||||
let call = Box::new(SystemCall::set_storage { items: vec![] }.into());
|
||||
|
||||
fill_schedule::<T>(when, s)?;
|
||||
|
||||
#[extrinsic_call]
|
||||
_(RawOrigin::Root, when, periodic, priority, call);
|
||||
|
||||
ensure!(Agenda::<T>::get(when).len() == s as usize + 1, "didn't add to schedule");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark]
|
||||
fn cancel(s: Linear<1, { T::MaxScheduledPerBlock::get() }>) -> Result<(), BenchmarkError> {
|
||||
let when = BLOCK_NUMBER.into();
|
||||
|
||||
fill_schedule::<T>(when, s)?;
|
||||
assert_eq!(Agenda::<T>::get(when).len(), s as usize);
|
||||
let schedule_origin =
|
||||
T::ScheduleOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
|
||||
|
||||
#[extrinsic_call]
|
||||
_(schedule_origin as SystemOrigin<T>, when, 0);
|
||||
|
||||
ensure!(
|
||||
s == 1 || Lookup::<T>::get(u32_to_name(0)).is_none(),
|
||||
"didn't remove from lookup if more than 1 task scheduled for `when`"
|
||||
);
|
||||
// Removed schedule is NONE
|
||||
ensure!(
|
||||
s == 1 || Agenda::<T>::get(when)[0].is_none(),
|
||||
"didn't remove from schedule if more than 1 task scheduled for `when`"
|
||||
);
|
||||
ensure!(
|
||||
s > 1 || Agenda::<T>::get(when).len() == 0,
|
||||
"remove from schedule if only 1 task scheduled for `when`"
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark]
|
||||
fn schedule_named(
|
||||
s: Linear<0, { T::MaxScheduledPerBlock::get() - 1 }>,
|
||||
) -> Result<(), BenchmarkError> {
|
||||
let id = u32_to_name(s);
|
||||
let when = BLOCK_NUMBER.into();
|
||||
let periodic = Some((BlockNumberFor::<T>::one(), 100));
|
||||
let priority = 0;
|
||||
// Essentially a no-op call.
|
||||
let call = Box::new(SystemCall::set_storage { items: vec![] }.into());
|
||||
|
||||
fill_schedule::<T>(when, s)?;
|
||||
|
||||
#[extrinsic_call]
|
||||
_(RawOrigin::Root, id, when, periodic, priority, call);
|
||||
|
||||
ensure!(Agenda::<T>::get(when).len() == s as usize + 1, "didn't add to schedule");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark]
|
||||
fn cancel_named(
|
||||
s: Linear<1, { T::MaxScheduledPerBlock::get() }>,
|
||||
) -> Result<(), BenchmarkError> {
|
||||
let when = BLOCK_NUMBER.into();
|
||||
|
||||
fill_schedule::<T>(when, s)?;
|
||||
|
||||
#[extrinsic_call]
|
||||
_(RawOrigin::Root, u32_to_name(0));
|
||||
|
||||
ensure!(
|
||||
s == 1 || Lookup::<T>::get(u32_to_name(0)).is_none(),
|
||||
"didn't remove from lookup if more than 1 task scheduled for `when`"
|
||||
);
|
||||
// Removed schedule is NONE
|
||||
ensure!(
|
||||
s == 1 || Agenda::<T>::get(when)[0].is_none(),
|
||||
"didn't remove from schedule if more than 1 task scheduled for `when`"
|
||||
);
|
||||
ensure!(
|
||||
s > 1 || Agenda::<T>::get(when).len() == 0,
|
||||
"remove from schedule if only 1 task scheduled for `when`"
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark]
|
||||
fn schedule_retry(
|
||||
s: Linear<1, { T::MaxScheduledPerBlock::get() }>,
|
||||
) -> Result<(), BenchmarkError> {
|
||||
let when = BLOCK_NUMBER.into();
|
||||
|
||||
fill_schedule::<T>(when, s)?;
|
||||
let name = u32_to_name(s - 1);
|
||||
let address = Lookup::<T>::get(name).unwrap();
|
||||
let period: BlockNumberFor<T> = 1_u32.into();
|
||||
let retry_config = RetryConfig { total_retries: 10, remaining: 10, period };
|
||||
Retries::<T>::insert(address, retry_config);
|
||||
let (mut when, index) = address;
|
||||
let task = Agenda::<T>::get(when)[index as usize].clone().unwrap();
|
||||
let mut weight_counter = WeightMeter::with_limit(T::MaximumWeight::get());
|
||||
|
||||
#[block]
|
||||
{
|
||||
Pallet::<T>::schedule_retry(
|
||||
&mut weight_counter,
|
||||
when,
|
||||
when,
|
||||
index,
|
||||
&task,
|
||||
retry_config,
|
||||
);
|
||||
}
|
||||
|
||||
when = when + BlockNumberFor::<T>::one();
|
||||
assert_eq!(
|
||||
Retries::<T>::get((when, 0)),
|
||||
Some(RetryConfig { total_retries: 10, remaining: 9, period })
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark]
|
||||
fn set_retry() -> Result<(), BenchmarkError> {
|
||||
let s = T::MaxScheduledPerBlock::get();
|
||||
let when = BLOCK_NUMBER.into();
|
||||
|
||||
fill_schedule::<T>(when, s)?;
|
||||
let name = u32_to_name(s - 1);
|
||||
let address = Lookup::<T>::get(name).unwrap();
|
||||
let (when, index) = address;
|
||||
let period = BlockNumberFor::<T>::one();
|
||||
|
||||
#[extrinsic_call]
|
||||
_(RawOrigin::Root, (when, index), 10, period);
|
||||
|
||||
assert_eq!(
|
||||
Retries::<T>::get((when, index)),
|
||||
Some(RetryConfig { total_retries: 10, remaining: 10, period })
|
||||
);
|
||||
assert_last_event::<T>(
|
||||
Event::RetrySet { task: address, id: None, period, retries: 10 }.into(),
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark]
|
||||
fn set_retry_named() -> Result<(), BenchmarkError> {
|
||||
let s = T::MaxScheduledPerBlock::get();
|
||||
let when = BLOCK_NUMBER.into();
|
||||
|
||||
fill_schedule::<T>(when, s)?;
|
||||
let name = u32_to_name(s - 1);
|
||||
let address = Lookup::<T>::get(name).unwrap();
|
||||
let (when, index) = address;
|
||||
let period = BlockNumberFor::<T>::one();
|
||||
|
||||
#[extrinsic_call]
|
||||
_(RawOrigin::Root, name, 10, period);
|
||||
|
||||
assert_eq!(
|
||||
Retries::<T>::get((when, index)),
|
||||
Some(RetryConfig { total_retries: 10, remaining: 10, period })
|
||||
);
|
||||
assert_last_event::<T>(
|
||||
Event::RetrySet { task: address, id: Some(name), period, retries: 10 }.into(),
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark]
|
||||
fn cancel_retry() -> Result<(), BenchmarkError> {
|
||||
let s = T::MaxScheduledPerBlock::get();
|
||||
let when = BLOCK_NUMBER.into();
|
||||
|
||||
fill_schedule::<T>(when, s)?;
|
||||
let name = u32_to_name(s - 1);
|
||||
let address = Lookup::<T>::get(name).unwrap();
|
||||
let (when, index) = address;
|
||||
let period = BlockNumberFor::<T>::one();
|
||||
assert!(Pallet::<T>::set_retry(RawOrigin::Root.into(), (when, index), 10, period).is_ok());
|
||||
|
||||
#[extrinsic_call]
|
||||
_(RawOrigin::Root, (when, index));
|
||||
|
||||
assert!(!Retries::<T>::contains_key((when, index)));
|
||||
assert_last_event::<T>(Event::RetryCancelled { task: address, id: None }.into());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[benchmark]
|
||||
fn cancel_retry_named() -> Result<(), BenchmarkError> {
|
||||
let s = T::MaxScheduledPerBlock::get();
|
||||
let when = BLOCK_NUMBER.into();
|
||||
|
||||
fill_schedule::<T>(when, s)?;
|
||||
let name = u32_to_name(s - 1);
|
||||
let address = Lookup::<T>::get(name).unwrap();
|
||||
let (when, index) = address;
|
||||
let period = BlockNumberFor::<T>::one();
|
||||
assert!(Pallet::<T>::set_retry_named(RawOrigin::Root.into(), name, 10, period).is_ok());
|
||||
|
||||
#[extrinsic_call]
|
||||
_(RawOrigin::Root, name);
|
||||
|
||||
assert!(!Retries::<T>::contains_key((when, index)));
|
||||
assert_last_event::<T>(Event::RetryCancelled { task: address, id: Some(name) }.into());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
impl_benchmark_test_suite! {
|
||||
Pallet,
|
||||
mock::new_test_ext(),
|
||||
mock::Test
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,562 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) 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.
|
||||
|
||||
//! Migrations for the scheduler pallet.
|
||||
|
||||
use super::*;
|
||||
use pezframe_support::traits::OnRuntimeUpgrade;
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
use pezsp_runtime::TryRuntimeError;
|
||||
|
||||
/// The log target.
|
||||
const TARGET: &'static str = "runtime::scheduler::migration";
|
||||
|
||||
pub mod v1 {
|
||||
use super::*;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(crate) type Agenda<T: Config> = StorageMap<
|
||||
Pallet<T>,
|
||||
Twox64Concat,
|
||||
BlockNumberFor<T>,
|
||||
Vec<Option<ScheduledV1<<T as Config>::RuntimeCall, BlockNumberFor<T>>>>,
|
||||
ValueQuery,
|
||||
>;
|
||||
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(crate) type Lookup<T: Config> =
|
||||
StorageMap<Pallet<T>, Twox64Concat, Vec<u8>, TaskAddress<BlockNumberFor<T>>>;
|
||||
}
|
||||
|
||||
pub mod v2 {
|
||||
use super::*;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(crate) type Agenda<T: Config> = StorageMap<
|
||||
Pallet<T>,
|
||||
Twox64Concat,
|
||||
BlockNumberFor<T>,
|
||||
Vec<Option<ScheduledV2Of<T>>>,
|
||||
ValueQuery,
|
||||
>;
|
||||
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(crate) type Lookup<T: Config> =
|
||||
StorageMap<Pallet<T>, Twox64Concat, Vec<u8>, TaskAddress<BlockNumberFor<T>>>;
|
||||
}
|
||||
|
||||
pub mod v3 {
|
||||
use super::*;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(crate) type Agenda<T: Config> = StorageMap<
|
||||
Pallet<T>,
|
||||
Twox64Concat,
|
||||
BlockNumberFor<T>,
|
||||
Vec<Option<ScheduledV3Of<T>>>,
|
||||
ValueQuery,
|
||||
>;
|
||||
|
||||
#[pezframe_support::storage_alias]
|
||||
pub(crate) type Lookup<T: Config> =
|
||||
StorageMap<Pallet<T>, Twox64Concat, Vec<u8>, TaskAddress<BlockNumberFor<T>>>;
|
||||
|
||||
/// Migrate the scheduler pallet from V3 to V4.
|
||||
pub struct MigrateToV4<T>(core::marker::PhantomData<T>);
|
||||
|
||||
impl<T: Config> OnRuntimeUpgrade for MigrateToV4<T> {
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn pre_upgrade() -> Result<Vec<u8>, TryRuntimeError> {
|
||||
ensure!(StorageVersion::get::<Pallet<T>>() == 3, "Can only upgrade from version 3");
|
||||
|
||||
let agendas = Agenda::<T>::iter_keys().count() as u32;
|
||||
let decodable_agendas = Agenda::<T>::iter_values().count() as u32;
|
||||
if agendas != decodable_agendas {
|
||||
// This is not necessarily an error, but can happen when there are Calls
|
||||
// in an Agenda that are not valid anymore with the new runtime.
|
||||
log::error!(
|
||||
target: TARGET,
|
||||
"Can only decode {} of {} agendas - others will be dropped",
|
||||
decodable_agendas,
|
||||
agendas
|
||||
);
|
||||
}
|
||||
log::info!(target: TARGET, "Trying to migrate {} agendas...", decodable_agendas);
|
||||
|
||||
// Check that no agenda overflows `MaxScheduledPerBlock`.
|
||||
let max_scheduled_per_block = T::MaxScheduledPerBlock::get() as usize;
|
||||
for (block_number, agenda) in Agenda::<T>::iter() {
|
||||
if agenda.iter().cloned().flatten().count() > max_scheduled_per_block {
|
||||
log::error!(
|
||||
target: TARGET,
|
||||
"Would truncate agenda of block {:?} from {} items to {} items.",
|
||||
block_number,
|
||||
agenda.len(),
|
||||
max_scheduled_per_block,
|
||||
);
|
||||
return Err("Agenda would overflow `MaxScheduledPerBlock`.".into());
|
||||
}
|
||||
}
|
||||
// Check that bounding the calls will not overflow `MAX_LENGTH`.
|
||||
let max_length = T::Preimages::MAX_LENGTH as usize;
|
||||
for (block_number, agenda) in Agenda::<T>::iter() {
|
||||
for schedule in agenda.iter().cloned().flatten() {
|
||||
match schedule.call {
|
||||
pezframe_support::traits::schedule::MaybeHashed::Value(call) => {
|
||||
let l = call.using_encoded(|c| c.len());
|
||||
if l > max_length {
|
||||
log::error!(
|
||||
target: TARGET,
|
||||
"Call in agenda of block {:?} is too large: {} byte",
|
||||
block_number,
|
||||
l,
|
||||
);
|
||||
return Err("Call is too large.".into());
|
||||
}
|
||||
},
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok((decodable_agendas as u32).encode())
|
||||
}
|
||||
|
||||
fn on_runtime_upgrade() -> Weight {
|
||||
let version = StorageVersion::get::<Pallet<T>>();
|
||||
if version != 3 {
|
||||
log::warn!(
|
||||
target: TARGET,
|
||||
"skipping v3 to v4 migration: executed on wrong storage version.\
|
||||
Expected version 3, found {:?}",
|
||||
version,
|
||||
);
|
||||
return T::DbWeight::get().reads(1);
|
||||
}
|
||||
|
||||
crate::Pallet::<T>::migrate_v3_to_v4()
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn post_upgrade(state: Vec<u8>) -> Result<(), TryRuntimeError> {
|
||||
ensure!(StorageVersion::get::<Pallet<T>>() == 4, "Must upgrade");
|
||||
|
||||
// Check that everything decoded fine.
|
||||
for k in crate::Agenda::<T>::iter_keys() {
|
||||
ensure!(crate::Agenda::<T>::try_get(k).is_ok(), "Cannot decode V4 Agenda");
|
||||
}
|
||||
|
||||
let old_agendas: u32 =
|
||||
Decode::decode(&mut &state[..]).expect("pre_upgrade provides a valid state; qed");
|
||||
let new_agendas = crate::Agenda::<T>::iter_keys().count() as u32;
|
||||
if old_agendas != new_agendas {
|
||||
// This is not necessarily an error, but can happen when there are Calls
|
||||
// in an Agenda that are not valid anymore in the new runtime.
|
||||
log::error!(
|
||||
target: TARGET,
|
||||
"Did not migrate all Agendas. Previous {}, Now {}",
|
||||
old_agendas,
|
||||
new_agendas,
|
||||
);
|
||||
} else {
|
||||
log::info!(target: TARGET, "Migrated {} agendas.", new_agendas);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub mod v4 {
|
||||
use super::*;
|
||||
use pezframe_support::pezpallet_prelude::*;
|
||||
|
||||
/// This migration cleans up empty agendas of the V4 scheduler.
|
||||
///
|
||||
/// This should be run on a scheduler that does not have
|
||||
/// <https://github.com/pezkuwichain/kurdistan-sdk/issues/41> since it piles up `None`-only agendas. This does not modify the pallet version.
|
||||
pub struct CleanupAgendas<T>(core::marker::PhantomData<T>);
|
||||
|
||||
impl<T: Config> OnRuntimeUpgrade for CleanupAgendas<T> {
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn pre_upgrade() -> Result<Vec<u8>, TryRuntimeError> {
|
||||
assert_eq!(
|
||||
StorageVersion::get::<Pallet<T>>(),
|
||||
4,
|
||||
"Can only cleanup agendas of the V4 scheduler"
|
||||
);
|
||||
|
||||
let agendas = Agenda::<T>::iter_keys().count();
|
||||
let non_empty_agendas =
|
||||
Agenda::<T>::iter_values().filter(|a| a.iter().any(|s| s.is_some())).count();
|
||||
log::info!(
|
||||
target: TARGET,
|
||||
"There are {} total and {} non-empty agendas",
|
||||
agendas,
|
||||
non_empty_agendas
|
||||
);
|
||||
|
||||
Ok((agendas as u32, non_empty_agendas as u32).encode())
|
||||
}
|
||||
|
||||
fn on_runtime_upgrade() -> Weight {
|
||||
let version = StorageVersion::get::<Pallet<T>>();
|
||||
if version != 4 {
|
||||
log::warn!(target: TARGET, "Skipping CleanupAgendas migration since it was run on the wrong version: {:?} != 4", version);
|
||||
return T::DbWeight::get().reads(1);
|
||||
}
|
||||
|
||||
let keys = Agenda::<T>::iter_keys().collect::<Vec<_>>();
|
||||
let mut writes = 0;
|
||||
for k in &keys {
|
||||
let mut schedules = Agenda::<T>::get(k);
|
||||
let all_schedules = schedules.len();
|
||||
let suffix_none_schedules =
|
||||
schedules.iter().rev().take_while(|s| s.is_none()).count();
|
||||
|
||||
match all_schedules.checked_sub(suffix_none_schedules) {
|
||||
Some(0) => {
|
||||
log::info!(
|
||||
"Deleting None-only agenda {:?} with {} entries",
|
||||
k,
|
||||
all_schedules
|
||||
);
|
||||
Agenda::<T>::remove(k);
|
||||
writes.saturating_inc();
|
||||
},
|
||||
Some(ne) if ne > 0 => {
|
||||
log::info!(
|
||||
"Removing {} schedules of {} from agenda {:?}, now {:?}",
|
||||
suffix_none_schedules,
|
||||
all_schedules,
|
||||
ne,
|
||||
k
|
||||
);
|
||||
schedules.truncate(ne);
|
||||
Agenda::<T>::insert(k, schedules);
|
||||
writes.saturating_inc();
|
||||
},
|
||||
Some(_) => {
|
||||
pezframe_support::defensive!(
|
||||
// Bad but let's not panic.
|
||||
"Cannot have more None suffix schedules that schedules in total"
|
||||
);
|
||||
},
|
||||
None => {
|
||||
log::info!("Agenda {:?} does not have any None suffix schedules", k);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// We don't modify the pallet version.
|
||||
|
||||
T::DbWeight::get().reads_writes(1 + keys.len().saturating_mul(2) as u64, writes)
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn post_upgrade(state: Vec<u8>) -> Result<(), TryRuntimeError> {
|
||||
ensure!(StorageVersion::get::<Pallet<T>>() == 4, "Version must not change");
|
||||
|
||||
let (old_agendas, non_empty_agendas): (u32, u32) =
|
||||
Decode::decode(&mut state.as_ref()).expect("Must decode pre_upgrade state");
|
||||
let new_agendas = Agenda::<T>::iter_keys().count() as u32;
|
||||
|
||||
match old_agendas.checked_sub(new_agendas) {
|
||||
Some(0) => log::warn!(
|
||||
target: TARGET,
|
||||
"Did not clean up any agendas. v4::CleanupAgendas can be removed."
|
||||
),
|
||||
Some(n) => {
|
||||
log::info!(target: TARGET, "Cleaned up {} agendas, now {}", n, new_agendas)
|
||||
},
|
||||
None => unreachable!(
|
||||
"Number of agendas cannot increase, old {} new {}",
|
||||
old_agendas, new_agendas
|
||||
),
|
||||
}
|
||||
ensure!(new_agendas == non_empty_agendas, "Expected to keep all non-empty agendas");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(feature = "try-runtime")]
|
||||
mod test {
|
||||
use super::*;
|
||||
use crate::mock::*;
|
||||
use alloc::borrow::Cow;
|
||||
use pezframe_support::Hashable;
|
||||
use bizinikiwi_test_utils::assert_eq_uvec;
|
||||
|
||||
#[test]
|
||||
#[allow(deprecated)]
|
||||
fn migration_v3_to_v4_works() {
|
||||
new_test_ext().execute_with(|| {
|
||||
// Assume that we are at V3.
|
||||
StorageVersion::new(3).put::<Scheduler>();
|
||||
|
||||
// Call that will be bounded to a `Lookup`.
|
||||
let large_call =
|
||||
RuntimeCall::System(pezframe_system::Call::remark { remark: vec![0; 1024] });
|
||||
// Call that can be inlined.
|
||||
let small_call =
|
||||
RuntimeCall::System(pezframe_system::Call::remark { remark: vec![0; 10] });
|
||||
// Call that is already hashed and can will be converted to `Legacy`.
|
||||
let hashed_call =
|
||||
RuntimeCall::System(pezframe_system::Call::remark { remark: vec![0; 2048] });
|
||||
let bound_hashed_call = Preimage::bound(hashed_call.clone()).unwrap();
|
||||
assert!(bound_hashed_call.lookup_needed());
|
||||
// A Call by hash that will fail to decode becomes `None`.
|
||||
let trash_data = vec![255u8; 1024];
|
||||
let undecodable_hash = Preimage::note(Cow::Borrowed(&trash_data)).unwrap();
|
||||
|
||||
for i in 0..2u64 {
|
||||
let k = i.twox_64_concat();
|
||||
let old = vec![
|
||||
Some(ScheduledV3Of::<Test> {
|
||||
maybe_id: None,
|
||||
priority: i as u8 + 10,
|
||||
call: small_call.clone().into(),
|
||||
maybe_periodic: None, // 1
|
||||
origin: root(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
}),
|
||||
None,
|
||||
Some(ScheduledV3Of::<Test> {
|
||||
maybe_id: Some(vec![i as u8; 32]),
|
||||
priority: 123,
|
||||
call: large_call.clone().into(),
|
||||
maybe_periodic: Some((4u64, 20)),
|
||||
origin: signed(i),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
}),
|
||||
Some(ScheduledV3Of::<Test> {
|
||||
maybe_id: Some(vec![255 - i as u8; 320]),
|
||||
priority: 123,
|
||||
call: MaybeHashed::Hash(bound_hashed_call.hash()),
|
||||
maybe_periodic: Some((8u64, 10)),
|
||||
origin: signed(i),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
}),
|
||||
Some(ScheduledV3Of::<Test> {
|
||||
maybe_id: Some(vec![i as u8; 320]),
|
||||
priority: 123,
|
||||
call: MaybeHashed::Hash(undecodable_hash),
|
||||
maybe_periodic: Some((4u64, 20)),
|
||||
origin: root(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
}),
|
||||
];
|
||||
pezframe_support::migration::put_storage_value(b"Scheduler", b"Agenda", &k, old);
|
||||
}
|
||||
|
||||
let state = v3::MigrateToV4::<Test>::pre_upgrade().unwrap();
|
||||
let _w = v3::MigrateToV4::<Test>::on_runtime_upgrade();
|
||||
v3::MigrateToV4::<Test>::post_upgrade(state).unwrap();
|
||||
|
||||
let mut x = Agenda::<Test>::iter().map(|x| (x.0, x.1.into_inner())).collect::<Vec<_>>();
|
||||
x.sort_by_key(|x| x.0);
|
||||
|
||||
let bound_large_call = Preimage::bound(large_call).unwrap();
|
||||
assert!(bound_large_call.lookup_needed());
|
||||
let bound_small_call = Preimage::bound(small_call).unwrap();
|
||||
assert!(!bound_small_call.lookup_needed());
|
||||
|
||||
let expected = vec![
|
||||
(
|
||||
0,
|
||||
vec![
|
||||
Some(ScheduledOf::<Test> {
|
||||
maybe_id: None,
|
||||
priority: 10,
|
||||
call: bound_small_call.clone(),
|
||||
maybe_periodic: None,
|
||||
origin: root(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
}),
|
||||
None,
|
||||
Some(ScheduledOf::<Test> {
|
||||
maybe_id: Some(blake2_256(&[0u8; 32])),
|
||||
priority: 123,
|
||||
call: bound_large_call.clone(),
|
||||
maybe_periodic: Some((4u64, 20)),
|
||||
origin: signed(0),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
}),
|
||||
Some(ScheduledOf::<Test> {
|
||||
maybe_id: Some(blake2_256(&[255u8; 320])),
|
||||
priority: 123,
|
||||
call: Bounded::from_legacy_hash(bound_hashed_call.hash()),
|
||||
maybe_periodic: Some((8u64, 10)),
|
||||
origin: signed(0),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
}),
|
||||
None,
|
||||
],
|
||||
),
|
||||
(
|
||||
1,
|
||||
vec![
|
||||
Some(ScheduledOf::<Test> {
|
||||
maybe_id: None,
|
||||
priority: 11,
|
||||
call: bound_small_call.clone(),
|
||||
maybe_periodic: None,
|
||||
origin: root(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
}),
|
||||
None,
|
||||
Some(ScheduledOf::<Test> {
|
||||
maybe_id: Some(blake2_256(&[1u8; 32])),
|
||||
priority: 123,
|
||||
call: bound_large_call.clone(),
|
||||
maybe_periodic: Some((4u64, 20)),
|
||||
origin: signed(1),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
}),
|
||||
Some(ScheduledOf::<Test> {
|
||||
maybe_id: Some(blake2_256(&[254u8; 320])),
|
||||
priority: 123,
|
||||
call: Bounded::from_legacy_hash(bound_hashed_call.hash()),
|
||||
maybe_periodic: Some((8u64, 10)),
|
||||
origin: signed(1),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
}),
|
||||
None,
|
||||
],
|
||||
),
|
||||
];
|
||||
for (outer, (i, j)) in x.iter().zip(expected.iter()).enumerate() {
|
||||
assert_eq!(i.0, j.0);
|
||||
for (inner, (x, y)) in i.1.iter().zip(j.1.iter()).enumerate() {
|
||||
assert_eq!(x, y, "at index: outer {} inner {}", outer, inner);
|
||||
}
|
||||
}
|
||||
assert_eq_uvec!(x, expected);
|
||||
|
||||
assert_eq!(StorageVersion::get::<Scheduler>(), 4);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(deprecated)]
|
||||
fn migration_v3_to_v4_too_large_calls_are_ignored() {
|
||||
new_test_ext().execute_with(|| {
|
||||
// Assume that we are at V3.
|
||||
StorageVersion::new(3).put::<Scheduler>();
|
||||
|
||||
let too_large_call = RuntimeCall::System(pezframe_system::Call::remark {
|
||||
remark: vec![0; <Test as Config>::Preimages::MAX_LENGTH + 1],
|
||||
});
|
||||
|
||||
let i = 0u64;
|
||||
let k = i.twox_64_concat();
|
||||
let old = vec![Some(ScheduledV3Of::<Test> {
|
||||
maybe_id: None,
|
||||
priority: 1,
|
||||
call: too_large_call.clone().into(),
|
||||
maybe_periodic: None,
|
||||
origin: root(),
|
||||
_phantom: PhantomData::<u64>::default(),
|
||||
})];
|
||||
pezframe_support::migration::put_storage_value(b"Scheduler", b"Agenda", &k, old);
|
||||
|
||||
// The pre_upgrade hook fails:
|
||||
let err = v3::MigrateToV4::<Test>::pre_upgrade().unwrap_err();
|
||||
assert_eq!(DispatchError::from("Call is too large."), err);
|
||||
// But the migration itself works:
|
||||
let _w = v3::MigrateToV4::<Test>::on_runtime_upgrade();
|
||||
|
||||
let mut x = Agenda::<Test>::iter().map(|x| (x.0, x.1.into_inner())).collect::<Vec<_>>();
|
||||
x.sort_by_key(|x| x.0);
|
||||
// The call becomes `None`.
|
||||
let expected = vec![(0, vec![None])];
|
||||
assert_eq_uvec!(x, expected);
|
||||
|
||||
assert_eq!(StorageVersion::get::<Scheduler>(), 4);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cleanup_agendas_works() {
|
||||
use pezsp_core::bounded_vec;
|
||||
new_test_ext().execute_with(|| {
|
||||
StorageVersion::new(4).put::<Scheduler>();
|
||||
|
||||
let call = RuntimeCall::System(pezframe_system::Call::remark { remark: vec![] });
|
||||
let bounded_call = Preimage::bound(call).unwrap();
|
||||
let some = Some(ScheduledOf::<Test> {
|
||||
maybe_id: None,
|
||||
priority: 1,
|
||||
call: bounded_call,
|
||||
maybe_periodic: None,
|
||||
origin: root(),
|
||||
_phantom: Default::default(),
|
||||
});
|
||||
|
||||
// Put some empty, and some non-empty agendas in there.
|
||||
let test_data: Vec<(
|
||||
BoundedVec<Option<ScheduledOf<Test>>, <Test as Config>::MaxScheduledPerBlock>,
|
||||
Option<
|
||||
BoundedVec<Option<ScheduledOf<Test>>, <Test as Config>::MaxScheduledPerBlock>,
|
||||
>,
|
||||
)> = vec![
|
||||
(bounded_vec![some.clone()], Some(bounded_vec![some.clone()])),
|
||||
(bounded_vec![None, some.clone()], Some(bounded_vec![None, some.clone()])),
|
||||
(bounded_vec![None, some.clone(), None], Some(bounded_vec![None, some.clone()])),
|
||||
(bounded_vec![some.clone(), None, None], Some(bounded_vec![some.clone()])),
|
||||
(bounded_vec![None, None], None),
|
||||
(bounded_vec![None, None, None], None),
|
||||
(bounded_vec![], None),
|
||||
];
|
||||
|
||||
// Insert all the agendas.
|
||||
for (i, test) in test_data.iter().enumerate() {
|
||||
Agenda::<Test>::insert(i as u64, test.0.clone());
|
||||
}
|
||||
|
||||
// Run the migration.
|
||||
let data = v4::CleanupAgendas::<Test>::pre_upgrade().unwrap();
|
||||
let _w = v4::CleanupAgendas::<Test>::on_runtime_upgrade();
|
||||
v4::CleanupAgendas::<Test>::post_upgrade(data).unwrap();
|
||||
|
||||
// Check that the post-state is correct.
|
||||
for (i, test) in test_data.iter().enumerate() {
|
||||
match test.1.clone() {
|
||||
None => assert!(
|
||||
!Agenda::<Test>::contains_key(i as u64),
|
||||
"Agenda {} should be removed",
|
||||
i
|
||||
),
|
||||
Some(new) => {
|
||||
assert_eq!(Agenda::<Test>::get(i as u64), new, "Agenda wrong {}", i)
|
||||
},
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
fn signed(i: u64) -> OriginCaller {
|
||||
system::RawOrigin::Signed(i).into()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,245 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) 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.
|
||||
|
||||
//! # Scheduler test environment.
|
||||
|
||||
use super::*;
|
||||
|
||||
use crate as scheduler;
|
||||
use pezframe_support::{
|
||||
derive_impl, ord_parameter_types, parameter_types,
|
||||
traits::{ConstU32, Contains, EitherOfDiverse, EqualPrivilegeOnly},
|
||||
};
|
||||
use pezframe_system::{EnsureRoot, EnsureSignedBy};
|
||||
use pezsp_runtime::{BuildStorage, Perbill};
|
||||
use pezsp_weights::constants::WEIGHT_REF_TIME_PER_SECOND;
|
||||
|
||||
// Logger module to track execution.
|
||||
#[pezframe_support::pallet]
|
||||
pub mod logger {
|
||||
use super::{OriginCaller, OriginTrait};
|
||||
use pezframe_support::{pezpallet_prelude::*, parameter_types};
|
||||
use pezframe_system::pezpallet_prelude::*;
|
||||
|
||||
parameter_types! {
|
||||
static Log: Vec<(OriginCaller, u32)> = Vec::new();
|
||||
}
|
||||
pub fn log() -> Vec<(OriginCaller, u32)> {
|
||||
Log::get().clone()
|
||||
}
|
||||
|
||||
#[pallet::pallet]
|
||||
pub struct Pallet<T>(_);
|
||||
|
||||
#[pallet::storage]
|
||||
pub type Threshold<T: Config> = StorageValue<_, (BlockNumberFor<T>, BlockNumberFor<T>)>;
|
||||
|
||||
#[pallet::error]
|
||||
pub enum Error<T> {
|
||||
/// Under the threshold.
|
||||
TooEarly,
|
||||
/// Over the threshold.
|
||||
TooLate,
|
||||
}
|
||||
|
||||
#[pallet::hooks]
|
||||
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
|
||||
|
||||
#[pallet::config]
|
||||
pub trait Config: pezframe_system::Config {
|
||||
#[allow(deprecated)]
|
||||
type RuntimeEvent: From<Event<Self>> + IsType<<Self as pezframe_system::Config>::RuntimeEvent>;
|
||||
}
|
||||
|
||||
#[pallet::event]
|
||||
#[pallet::generate_deposit(pub(super) fn deposit_event)]
|
||||
pub enum Event<T: Config> {
|
||||
Logged(u32, Weight),
|
||||
}
|
||||
|
||||
#[pallet::call]
|
||||
impl<T: Config> Pallet<T>
|
||||
where
|
||||
<T as pezframe_system::Config>::RuntimeOrigin: OriginTrait<PalletsOrigin = OriginCaller>,
|
||||
{
|
||||
#[pallet::call_index(0)]
|
||||
#[pallet::weight(*weight)]
|
||||
pub fn log(origin: OriginFor<T>, i: u32, weight: Weight) -> DispatchResult {
|
||||
Self::deposit_event(Event::Logged(i, weight));
|
||||
Log::mutate(|log| {
|
||||
log.push((origin.caller().clone(), i));
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[pallet::call_index(1)]
|
||||
#[pallet::weight(*weight)]
|
||||
pub fn log_without_filter(origin: OriginFor<T>, i: u32, weight: Weight) -> DispatchResult {
|
||||
Self::deposit_event(Event::Logged(i, weight));
|
||||
Log::mutate(|log| {
|
||||
log.push((origin.caller().clone(), i));
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[pallet::call_index(2)]
|
||||
#[pallet::weight(*weight)]
|
||||
pub fn timed_log(origin: OriginFor<T>, i: u32, weight: Weight) -> DispatchResult {
|
||||
let now = pezframe_system::Pallet::<T>::block_number();
|
||||
let (start, end) = Threshold::<T>::get().unwrap_or((0u32.into(), u32::MAX.into()));
|
||||
ensure!(now >= start, Error::<T>::TooEarly);
|
||||
ensure!(now <= end, Error::<T>::TooLate);
|
||||
Self::deposit_event(Event::Logged(i, weight));
|
||||
Log::mutate(|log| {
|
||||
log.push((origin.caller().clone(), i));
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type Block = pezframe_system::mocking::MockBlock<Test>;
|
||||
|
||||
pezframe_support::construct_runtime!(
|
||||
pub enum Test
|
||||
{
|
||||
System: pezframe_system,
|
||||
Logger: logger,
|
||||
Scheduler: scheduler,
|
||||
Preimage: pezpallet_preimage,
|
||||
}
|
||||
);
|
||||
|
||||
// Scheduler must dispatch with root and no filter, this tests base filter is indeed not used.
|
||||
pub struct BaseFilter;
|
||||
impl Contains<RuntimeCall> for BaseFilter {
|
||||
fn contains(call: &RuntimeCall) -> bool {
|
||||
!matches!(call, RuntimeCall::Logger(LoggerCall::log { .. }))
|
||||
}
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub BlockWeights: pezframe_system::limits::BlockWeights =
|
||||
pezframe_system::limits::BlockWeights::simple_max(
|
||||
Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND * 2, u64::MAX),
|
||||
);
|
||||
}
|
||||
|
||||
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
|
||||
impl system::Config for Test {
|
||||
type BaseCallFilter = BaseFilter;
|
||||
type Block = Block;
|
||||
type BlockWeights = BlockWeights;
|
||||
}
|
||||
impl logger::Config for Test {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
}
|
||||
ord_parameter_types! {
|
||||
pub const One: u64 = 1;
|
||||
}
|
||||
|
||||
impl pezpallet_preimage::Config for Test {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type WeightInfo = ();
|
||||
type Currency = ();
|
||||
type ManagerOrigin = EnsureRoot<u64>;
|
||||
type Consideration = ();
|
||||
}
|
||||
|
||||
pub struct TestWeightInfo;
|
||||
impl WeightInfo for TestWeightInfo {
|
||||
fn service_agendas_base() -> Weight {
|
||||
Weight::from_parts(0b0000_0001, 0)
|
||||
}
|
||||
fn service_agenda_base(i: u32) -> Weight {
|
||||
Weight::from_parts((i << 8) as u64 + 0b0000_0010, 0)
|
||||
}
|
||||
fn service_task_base() -> Weight {
|
||||
Weight::from_parts(0b0000_0100, 0)
|
||||
}
|
||||
fn service_task_periodic() -> Weight {
|
||||
Weight::from_parts(0b0000_1100, 0)
|
||||
}
|
||||
fn service_task_named() -> Weight {
|
||||
Weight::from_parts(0b0001_0100, 0)
|
||||
}
|
||||
fn service_task_fetched(s: u32) -> Weight {
|
||||
Weight::from_parts((s << 8) as u64 + 0b0010_0100, 0)
|
||||
}
|
||||
fn execute_dispatch_signed() -> Weight {
|
||||
Weight::from_parts(0b0100_0000, 0)
|
||||
}
|
||||
fn execute_dispatch_unsigned() -> Weight {
|
||||
Weight::from_parts(0b1000_0000, 0)
|
||||
}
|
||||
fn schedule(_s: u32) -> Weight {
|
||||
Weight::from_parts(50, 0)
|
||||
}
|
||||
fn cancel(_s: u32) -> Weight {
|
||||
Weight::from_parts(50, 0)
|
||||
}
|
||||
fn schedule_named(_s: u32) -> Weight {
|
||||
Weight::from_parts(50, 0)
|
||||
}
|
||||
fn cancel_named(_s: u32) -> Weight {
|
||||
Weight::from_parts(50, 0)
|
||||
}
|
||||
fn schedule_retry(_s: u32) -> Weight {
|
||||
Weight::from_parts(100000, 0)
|
||||
}
|
||||
fn set_retry() -> Weight {
|
||||
Weight::from_parts(50, 0)
|
||||
}
|
||||
fn set_retry_named() -> Weight {
|
||||
Weight::from_parts(50, 0)
|
||||
}
|
||||
fn cancel_retry() -> Weight {
|
||||
Weight::from_parts(50, 0)
|
||||
}
|
||||
fn cancel_retry_named() -> Weight {
|
||||
Weight::from_parts(50, 0)
|
||||
}
|
||||
}
|
||||
parameter_types! {
|
||||
pub storage MaximumSchedulerWeight: Weight = Perbill::from_percent(80) *
|
||||
BlockWeights::get().max_block;
|
||||
}
|
||||
|
||||
impl Config for Test {
|
||||
type RuntimeEvent = RuntimeEvent;
|
||||
type RuntimeOrigin = RuntimeOrigin;
|
||||
type PalletsOrigin = OriginCaller;
|
||||
type RuntimeCall = RuntimeCall;
|
||||
type MaximumWeight = MaximumSchedulerWeight;
|
||||
type ScheduleOrigin = EitherOfDiverse<EnsureRoot<u64>, EnsureSignedBy<One, u64>>;
|
||||
type OriginPrivilegeCmp = EqualPrivilegeOnly;
|
||||
type MaxScheduledPerBlock = ConstU32<10>;
|
||||
type WeightInfo = TestWeightInfo;
|
||||
type Preimages = Preimage;
|
||||
type BlockNumberProvider = pezframe_system::Pallet<Self>;
|
||||
}
|
||||
|
||||
pub type LoggerCall = logger::Call<Test>;
|
||||
|
||||
pub fn new_test_ext() -> pezsp_io::TestExternalities {
|
||||
let t = system::GenesisConfig::<Test>::default().build_storage().unwrap();
|
||||
t.into()
|
||||
}
|
||||
|
||||
pub fn root() -> OriginCaller {
|
||||
system::RawOrigin::Root.into()
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,551 @@
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) 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.
|
||||
|
||||
// This file is part of Bizinikiwi.
|
||||
|
||||
// Copyright (C) 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.
|
||||
|
||||
//! Autogenerated weights for `pezpallet_scheduler`
|
||||
//!
|
||||
//! THIS FILE WAS AUTO-GENERATED USING THE BIZINIKIWI BENCHMARK CLI VERSION 32.0.0
|
||||
//! DATE: 2025-02-21, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
|
||||
//! WORST CASE MAP SIZE: `1000000`
|
||||
//! HOSTNAME: `4563561839a5`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
|
||||
//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
|
||||
|
||||
// Executed Command:
|
||||
// frame-omni-bencher
|
||||
// v1
|
||||
// benchmark
|
||||
// pallet
|
||||
// --extrinsic=*
|
||||
// --runtime=target/production/wbuild/kitchensink-runtime/kitchensink_runtime.wasm
|
||||
// --pallet=pezpallet_scheduler
|
||||
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
|
||||
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/scheduler/src/weights.rs
|
||||
// --wasm-execution=compiled
|
||||
// --steps=50
|
||||
// --repeat=20
|
||||
// --heap-pages=4096
|
||||
// --template=bizinikiwi/.maintain/frame-weight-template.hbs
|
||||
// --no-storage-info
|
||||
// --no-min-squares
|
||||
// --no-median-slopes
|
||||
// --genesis-builder-policy=none
|
||||
// --exclude-pallets=pezpallet_xcm,pezpallet_xcm_benchmarks::fungible,pezpallet_xcm_benchmarks::generic,pezpallet_nomination_pools,pezpallet_remark,pezpallet_transaction_storage,pezpallet_election_provider_multi_block,pezpallet_election_provider_multi_block::signed,pezpallet_election_provider_multi_block::unsigned,pezpallet_election_provider_multi_block::verifier
|
||||
|
||||
#![cfg_attr(rustfmt, rustfmt_skip)]
|
||||
#![allow(unused_parens)]
|
||||
#![allow(unused_imports)]
|
||||
#![allow(missing_docs)]
|
||||
#![allow(dead_code)]
|
||||
|
||||
use pezframe_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
|
||||
use core::marker::PhantomData;
|
||||
|
||||
/// Weight functions needed for `pezpallet_scheduler`.
|
||||
pub trait WeightInfo {
|
||||
fn service_agendas_base() -> Weight;
|
||||
fn service_agenda_base(s: u32, ) -> Weight;
|
||||
fn service_task_base() -> Weight;
|
||||
fn service_task_fetched(s: u32, ) -> Weight;
|
||||
fn service_task_named() -> Weight;
|
||||
fn service_task_periodic() -> Weight;
|
||||
fn execute_dispatch_signed() -> Weight;
|
||||
fn execute_dispatch_unsigned() -> Weight;
|
||||
fn schedule(s: u32, ) -> Weight;
|
||||
fn cancel(s: u32, ) -> Weight;
|
||||
fn schedule_named(s: u32, ) -> Weight;
|
||||
fn cancel_named(s: u32, ) -> Weight;
|
||||
fn schedule_retry(s: u32, ) -> Weight;
|
||||
fn set_retry() -> Weight;
|
||||
fn set_retry_named() -> Weight;
|
||||
fn cancel_retry() -> Weight;
|
||||
fn cancel_retry_named() -> Weight;
|
||||
}
|
||||
|
||||
/// Weights for `pezpallet_scheduler` using the Bizinikiwi node and recommended hardware.
|
||||
pub struct BizinikiwiWeight<T>(PhantomData<T>);
|
||||
impl<T: pezframe_system::Config> WeightInfo for BizinikiwiWeight<T> {
|
||||
/// Storage: `Scheduler::IncompleteSince` (r:1 w:1)
|
||||
/// Proof: `Scheduler::IncompleteSince` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
|
||||
fn service_agendas_base() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `1489`
|
||||
// Minimum execution time: 1_275_000 picoseconds.
|
||||
Weight::from_parts(1_335_000, 1489)
|
||||
.saturating_add(T::DbWeight::get().reads(1_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:1)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// The range of component `s` is `[0, 512]`.
|
||||
fn service_agenda_base(s: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `5 + s * (177 ±0)`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 2_379_000 picoseconds.
|
||||
Weight::from_parts(2_409_000, 110487)
|
||||
// Standard Error: 990
|
||||
.saturating_add(Weight::from_parts(486_046, 0).saturating_mul(s.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(1_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
fn service_task_base() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `0`
|
||||
// Minimum execution time: 2_889_000 picoseconds.
|
||||
Weight::from_parts(2_991_000, 0)
|
||||
}
|
||||
/// Storage: `Preimage::PreimageFor` (r:1 w:1)
|
||||
/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `Measured`)
|
||||
/// Storage: `Preimage::StatusFor` (r:1 w:0)
|
||||
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
|
||||
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
|
||||
/// The range of component `s` is `[128, 4194304]`.
|
||||
fn service_task_fetched(s: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `66 + s * (1 ±0)`
|
||||
// Estimated: `3556 + s * (1 ±0)`
|
||||
// Minimum execution time: 16_320_000 picoseconds.
|
||||
Weight::from_parts(16_792_000, 3556)
|
||||
// Standard Error: 263
|
||||
.saturating_add(Weight::from_parts(23_402, 0).saturating_mul(s.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(3_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(2_u64))
|
||||
.saturating_add(Weight::from_parts(0, 1).saturating_mul(s.into()))
|
||||
}
|
||||
/// Storage: `Scheduler::Lookup` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
|
||||
fn service_task_named() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `0`
|
||||
// Minimum execution time: 4_107_000 picoseconds.
|
||||
Weight::from_parts(4_292_000, 0)
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
fn service_task_periodic() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `0`
|
||||
// Minimum execution time: 2_895_000 picoseconds.
|
||||
Weight::from_parts(2_974_000, 0)
|
||||
}
|
||||
/// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
|
||||
/// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
|
||||
/// Storage: `TxPause::PausedCalls` (r:1 w:0)
|
||||
/// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`)
|
||||
fn execute_dispatch_signed() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `3997`
|
||||
// Minimum execution time: 4_008_000 picoseconds.
|
||||
Weight::from_parts(4_155_000, 3997)
|
||||
.saturating_add(T::DbWeight::get().reads(2_u64))
|
||||
}
|
||||
fn execute_dispatch_unsigned() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `0`
|
||||
// Minimum execution time: 1_776_000 picoseconds.
|
||||
Weight::from_parts(1_858_000, 0)
|
||||
}
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:1)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// The range of component `s` is `[0, 511]`.
|
||||
fn schedule(s: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `5 + s * (177 ±0)`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 7_853_000 picoseconds.
|
||||
Weight::from_parts(3_815_234, 110487)
|
||||
// Standard Error: 1_794
|
||||
.saturating_add(Weight::from_parts(538_417, 0).saturating_mul(s.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(1_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:1)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Retries` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Lookup` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
|
||||
/// The range of component `s` is `[1, 512]`.
|
||||
fn cancel(s: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `5 + s * (177 ±0)`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 13_972_000 picoseconds.
|
||||
Weight::from_parts(2_524_382, 110487)
|
||||
// Standard Error: 2_303
|
||||
.saturating_add(Weight::from_parts(777_710, 0).saturating_mul(s.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(1_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(3_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Lookup` (r:1 w:1)
|
||||
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:1)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// The range of component `s` is `[0, 511]`.
|
||||
fn schedule_named(s: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `521 + s * (178 ±0)`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 11_024_000 picoseconds.
|
||||
Weight::from_parts(8_965_037, 110487)
|
||||
// Standard Error: 1_998
|
||||
.saturating_add(Weight::from_parts(559_963, 0).saturating_mul(s.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(2_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(2_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Lookup` (r:1 w:1)
|
||||
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:1)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Retries` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
|
||||
/// The range of component `s` is `[1, 512]`.
|
||||
fn cancel_named(s: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `634 + s * (177 ±0)`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 16_476_000 picoseconds.
|
||||
Weight::from_parts(7_403_622, 110487)
|
||||
// Standard Error: 2_213
|
||||
.saturating_add(Weight::from_parts(778_228, 0).saturating_mul(s.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(2_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(3_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:1)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Retries` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
|
||||
/// The range of component `s` is `[1, 512]`.
|
||||
fn schedule_retry(s: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `31`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 8_844_000 picoseconds.
|
||||
Weight::from_parts(10_762_174, 110487)
|
||||
// Standard Error: 267
|
||||
.saturating_add(Weight::from_parts(16_285, 0).saturating_mul(s.into()))
|
||||
.saturating_add(T::DbWeight::get().reads(1_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(2_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:0)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Retries` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
|
||||
fn set_retry() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `90629`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 160_504_000 picoseconds.
|
||||
Weight::from_parts(169_783_000, 110487)
|
||||
.saturating_add(T::DbWeight::get().reads(1_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Lookup` (r:1 w:0)
|
||||
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:0)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Retries` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
|
||||
fn set_retry_named() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `91672`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 170_680_000 picoseconds.
|
||||
Weight::from_parts(186_544_000, 110487)
|
||||
.saturating_add(T::DbWeight::get().reads(2_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:0)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Retries` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
|
||||
fn cancel_retry() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `90630`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 161_130_000 picoseconds.
|
||||
Weight::from_parts(169_076_000, 110487)
|
||||
.saturating_add(T::DbWeight::get().reads(1_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Lookup` (r:1 w:0)
|
||||
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:0)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Retries` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
|
||||
fn cancel_retry_named() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `91672`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 170_742_000 picoseconds.
|
||||
Weight::from_parts(182_329_000, 110487)
|
||||
.saturating_add(T::DbWeight::get().reads(2_u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1_u64))
|
||||
}
|
||||
}
|
||||
|
||||
// For backwards compatibility and tests.
|
||||
impl WeightInfo for () {
|
||||
/// Storage: `Scheduler::IncompleteSince` (r:1 w:1)
|
||||
/// Proof: `Scheduler::IncompleteSince` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
|
||||
fn service_agendas_base() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `1489`
|
||||
// Minimum execution time: 1_275_000 picoseconds.
|
||||
Weight::from_parts(1_335_000, 1489)
|
||||
.saturating_add(RocksDbWeight::get().reads(1_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:1)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// The range of component `s` is `[0, 512]`.
|
||||
fn service_agenda_base(s: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `5 + s * (177 ±0)`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 2_379_000 picoseconds.
|
||||
Weight::from_parts(2_409_000, 110487)
|
||||
// Standard Error: 990
|
||||
.saturating_add(Weight::from_parts(486_046, 0).saturating_mul(s.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(1_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
fn service_task_base() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `0`
|
||||
// Minimum execution time: 2_889_000 picoseconds.
|
||||
Weight::from_parts(2_991_000, 0)
|
||||
}
|
||||
/// Storage: `Preimage::PreimageFor` (r:1 w:1)
|
||||
/// Proof: `Preimage::PreimageFor` (`max_values`: None, `max_size`: Some(4194344), added: 4196819, mode: `Measured`)
|
||||
/// Storage: `Preimage::StatusFor` (r:1 w:0)
|
||||
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
|
||||
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
|
||||
/// The range of component `s` is `[128, 4194304]`.
|
||||
fn service_task_fetched(s: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `66 + s * (1 ±0)`
|
||||
// Estimated: `3556 + s * (1 ±0)`
|
||||
// Minimum execution time: 16_320_000 picoseconds.
|
||||
Weight::from_parts(16_792_000, 3556)
|
||||
// Standard Error: 263
|
||||
.saturating_add(Weight::from_parts(23_402, 0).saturating_mul(s.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(3_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(2_u64))
|
||||
.saturating_add(Weight::from_parts(0, 1).saturating_mul(s.into()))
|
||||
}
|
||||
/// Storage: `Scheduler::Lookup` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
|
||||
fn service_task_named() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `0`
|
||||
// Minimum execution time: 4_107_000 picoseconds.
|
||||
Weight::from_parts(4_292_000, 0)
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
fn service_task_periodic() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `0`
|
||||
// Minimum execution time: 2_895_000 picoseconds.
|
||||
Weight::from_parts(2_974_000, 0)
|
||||
}
|
||||
/// Storage: `SafeMode::EnteredUntil` (r:1 w:0)
|
||||
/// Proof: `SafeMode::EnteredUntil` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
|
||||
/// Storage: `TxPause::PausedCalls` (r:1 w:0)
|
||||
/// Proof: `TxPause::PausedCalls` (`max_values`: None, `max_size`: Some(532), added: 3007, mode: `MaxEncodedLen`)
|
||||
fn execute_dispatch_signed() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `3997`
|
||||
// Minimum execution time: 4_008_000 picoseconds.
|
||||
Weight::from_parts(4_155_000, 3997)
|
||||
.saturating_add(RocksDbWeight::get().reads(2_u64))
|
||||
}
|
||||
fn execute_dispatch_unsigned() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `0`
|
||||
// Estimated: `0`
|
||||
// Minimum execution time: 1_776_000 picoseconds.
|
||||
Weight::from_parts(1_858_000, 0)
|
||||
}
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:1)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// The range of component `s` is `[0, 511]`.
|
||||
fn schedule(s: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `5 + s * (177 ±0)`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 7_853_000 picoseconds.
|
||||
Weight::from_parts(3_815_234, 110487)
|
||||
// Standard Error: 1_794
|
||||
.saturating_add(Weight::from_parts(538_417, 0).saturating_mul(s.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(1_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:1)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Retries` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Lookup` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
|
||||
/// The range of component `s` is `[1, 512]`.
|
||||
fn cancel(s: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `5 + s * (177 ±0)`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 13_972_000 picoseconds.
|
||||
Weight::from_parts(2_524_382, 110487)
|
||||
// Standard Error: 2_303
|
||||
.saturating_add(Weight::from_parts(777_710, 0).saturating_mul(s.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(1_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(3_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Lookup` (r:1 w:1)
|
||||
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:1)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// The range of component `s` is `[0, 511]`.
|
||||
fn schedule_named(s: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `521 + s * (178 ±0)`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 11_024_000 picoseconds.
|
||||
Weight::from_parts(8_965_037, 110487)
|
||||
// Standard Error: 1_998
|
||||
.saturating_add(Weight::from_parts(559_963, 0).saturating_mul(s.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(2_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(2_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Lookup` (r:1 w:1)
|
||||
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:1)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Retries` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
|
||||
/// The range of component `s` is `[1, 512]`.
|
||||
fn cancel_named(s: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `634 + s * (177 ±0)`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 16_476_000 picoseconds.
|
||||
Weight::from_parts(7_403_622, 110487)
|
||||
// Standard Error: 2_213
|
||||
.saturating_add(Weight::from_parts(778_228, 0).saturating_mul(s.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(2_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(3_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:1)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Retries` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
|
||||
/// The range of component `s` is `[1, 512]`.
|
||||
fn schedule_retry(s: u32, ) -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `31`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 8_844_000 picoseconds.
|
||||
Weight::from_parts(10_762_174, 110487)
|
||||
// Standard Error: 267
|
||||
.saturating_add(Weight::from_parts(16_285, 0).saturating_mul(s.into()))
|
||||
.saturating_add(RocksDbWeight::get().reads(1_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(2_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:0)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Retries` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
|
||||
fn set_retry() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `90629`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 160_504_000 picoseconds.
|
||||
Weight::from_parts(169_783_000, 110487)
|
||||
.saturating_add(RocksDbWeight::get().reads(1_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Lookup` (r:1 w:0)
|
||||
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:0)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Retries` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
|
||||
fn set_retry_named() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `91672`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 170_680_000 picoseconds.
|
||||
Weight::from_parts(186_544_000, 110487)
|
||||
.saturating_add(RocksDbWeight::get().reads(2_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:0)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Retries` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
|
||||
fn cancel_retry() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `90630`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 161_130_000 picoseconds.
|
||||
Weight::from_parts(169_076_000, 110487)
|
||||
.saturating_add(RocksDbWeight::get().reads(1_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
/// Storage: `Scheduler::Lookup` (r:1 w:0)
|
||||
/// Proof: `Scheduler::Lookup` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Agenda` (r:1 w:0)
|
||||
/// Proof: `Scheduler::Agenda` (`max_values`: None, `max_size`: Some(107022), added: 109497, mode: `MaxEncodedLen`)
|
||||
/// Storage: `Scheduler::Retries` (r:0 w:1)
|
||||
/// Proof: `Scheduler::Retries` (`max_values`: None, `max_size`: Some(30), added: 2505, mode: `MaxEncodedLen`)
|
||||
fn cancel_retry_named() -> Weight {
|
||||
// Proof Size summary in bytes:
|
||||
// Measured: `91672`
|
||||
// Estimated: `110487`
|
||||
// Minimum execution time: 170_742_000 picoseconds.
|
||||
Weight::from_parts(182_329_000, 110487)
|
||||
.saturating_add(RocksDbWeight::get().reads(2_u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1_u64))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user