Timestamp weights (#5775)

* calculate weight for timestamp::set

* reduce db count in kill_identity weight calculation

* return weight of on_finalize in on_initialize

* add comment

* import Weight

* address review comments to update db weight count

* fix full block import test

* update weights and benchmark info to latest benchmark data

* update identity pallet weights and benchmark info

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Alexander Popiak
2020-04-30 13:43:58 +02:00
committed by GitHub
parent a9261cf0ef
commit 71d7dc1dfc
3 changed files with 71 additions and 66 deletions
+5 -3
View File
@@ -18,7 +18,7 @@ use codec::{Encode, Decode, Joiner};
use frame_support::{
StorageValue, StorageMap,
traits::Currency,
weights::{GetDispatchInfo, DispatchInfo, DispatchClass, Pays},
weights::{GetDispatchInfo, DispatchInfo, DispatchClass},
};
use sp_core::{
NeverNativeValue, map, traits::Externalities, storage::{well_known_keys, Storage},
@@ -337,8 +337,9 @@ fn full_native_block_import_works() {
let events = vec![
EventRecord {
phase: Phase::ApplyExtrinsic(0),
// timestamp set call with weight 9_000_000 + 2 read + 1 write
event: Event::frame_system(frame_system::RawEvent::ExtrinsicSuccess(
DispatchInfo { weight: 0, class: DispatchClass::Mandatory, ..Default::default() }
DispatchInfo { weight: 9_000_000 + 2 * 60_000_000 + 1 * 200_000_000, class: DispatchClass::Mandatory, ..Default::default() }
)),
topics: vec![],
},
@@ -390,8 +391,9 @@ fn full_native_block_import_works() {
let events = vec![
EventRecord {
phase: Phase::ApplyExtrinsic(0),
// timestamp set call with weight 9_000_000 + 2 read + 1 write
event: Event::frame_system(frame_system::RawEvent::ExtrinsicSuccess(
DispatchInfo { weight: 0, class: DispatchClass::Mandatory, pays_fee: Pays::Yes }
DispatchInfo { weight: 9_000_000 + 2 * 60_000_000 + 1 * 200_000_000, class: DispatchClass::Mandatory, ..Default::default() }
)),
topics: vec![],
},