mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 01:11:10 +00:00
weight adjustments for identity and timestamp pallets (#5946)
This commit is contained in:
@@ -152,12 +152,12 @@ decl_module! {
|
||||
/// - `O(T)` where `T` complexity of `on_timestamp_set`
|
||||
/// - 1 storage read and 1 storage mutation (codec `O(1)`). (because of `DidUpdate::take` in `on_finalize`)
|
||||
/// - 1 event handler `on_timestamp_set` `O(T)`.
|
||||
/// - Benchmark: 8.523 (min squares analysis)
|
||||
/// - Benchmark: 7.678 (min squares analysis)
|
||||
/// - NOTE: This benchmark was done for a runtime with insignificant `on_timestamp_set` handlers.
|
||||
/// New benchmarking is needed when adding new handlers.
|
||||
/// # </weight>
|
||||
#[weight = (
|
||||
T::DbWeight::get().reads_writes(2, 1) + 9_000_000,
|
||||
T::DbWeight::get().reads_writes(2, 1) + 8_000_000,
|
||||
DispatchClass::Mandatory
|
||||
)]
|
||||
fn set(origin, #[compact] now: T::Moment) {
|
||||
@@ -177,13 +177,13 @@ decl_module! {
|
||||
/// dummy `on_initialize` to return the weight used in `on_finalize`.
|
||||
fn on_initialize() -> Weight {
|
||||
// weight of `on_finalize`
|
||||
6_000_000
|
||||
5_000_000
|
||||
}
|
||||
|
||||
/// # <weight>
|
||||
/// - `O(1)`
|
||||
/// - 1 storage deletion (codec `O(1)`).
|
||||
/// - Benchmark: 5.105 µs (min squares analysis)
|
||||
/// - Benchmark: 4.928 µs (min squares analysis)
|
||||
/// # </weight>
|
||||
fn on_finalize() {
|
||||
assert!(<Self as Store>::DidUpdate::take(), "Timestamp must be updated once in the block");
|
||||
|
||||
Reference in New Issue
Block a user