Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,26 @@ A substrate-based node that maintains a registry of remote attested integritee-s
## Build and Run
Please see our [Integritee Book](https://book.integritee.network/howto_node.html) to learn how to build and run this.

## benchmarking of weights
## Benchmark the runtimes
In `./scripts` we have a script for benchmarking the runtimes.

```
cargo build --release --features=runtime-benchmarks
./scripts/benchmark_all_pallets.sh
```
### Current benchmark
The current weights have been benchmarked with the following reference hardware:

GenuineIntel CPU MHz: 2494.144
8GB of RAM
NVMe SSD

### Running benchmark
1. Compile the node with: `cargo build --release --features runtime-benchmarks`
2. run: `./scripts/benchmark_all_pallets.sh`.
3. If changed, update the reference hardware above.

### Adding new pallets to be benchmarked
Every pallet with a `type WeightInfo` parameter in its config must be benchmarked.

1. [Cargo.toml] add `<new_pallet>/runtime-benchmarks` in the `runtime-benchmarks` feature section.
2. [runtime] add the new pallet to the `list_benchmark!` and `add_benchmark!` list.
3. add the new pallet in the script `./scripts/benchmark_all_pallets.sh` and run it.
4. [runtime/src/weights] add the new file to the modules
5. [runtime] replace the placeholder `type WeightInfo = ()` with `type WeightInfo = weights::<new_pallet>::WeightInfo<Runtime>`
32 changes: 16 additions & 16 deletions runtime/src/weights/frame_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
//! Autogenerated weights for `frame_system`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-10-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2021-11-11, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("integritee-solo-fresh"), DB CACHE: 128

// Executed Command:
// target/release/integritee-node
// ./integritee-node
// benchmark
// --chain=integritee-solo-fresh
// --steps=50
Expand All @@ -30,46 +30,46 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> frame_system::WeightInfo for WeightInfo<T> {
fn remark(b: u32, ) -> Weight {
(574_000 as Weight)
(0 as Weight)
// Standard Error: 0
.saturating_add((1_000 as Weight).saturating_mul(b as Weight))
.saturating_add((2_000 as Weight).saturating_mul(b as Weight))
}
fn remark_with_event(b: u32, ) -> Weight {
(2_653_000 as Weight)
(0 as Weight)
// Standard Error: 0
.saturating_add((2_000 as Weight).saturating_mul(b as Weight))
.saturating_add((3_000 as Weight).saturating_mul(b as Weight))
}
// Storage: unknown [0x3a686561707061676573] (r:0 w:1)
fn set_heap_pages() -> Weight {
(1_567_000 as Weight)
(2_273_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Digest (r:1 w:1)
// Storage: unknown [0x3a6368616e6765735f74726965] (r:0 w:1)
fn set_changes_trie_config() -> Weight {
(6_236_000 as Weight)
(27_085_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Skipped Metadata (r:0 w:0)
fn set_storage(i: u32, ) -> Weight {
(0 as Weight)
// Standard Error: 0
.saturating_add((838_000 as Weight).saturating_mul(i as Weight))
// Standard Error: 5_000
.saturating_add((1_457_000 as Weight).saturating_mul(i as Weight))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
}
// Storage: Skipped Metadata (r:0 w:0)
fn kill_storage(i: u32, ) -> Weight {
(2_052_000 as Weight)
// Standard Error: 0
.saturating_add((556_000 as Weight).saturating_mul(i as Weight))
(6_118_000 as Weight)
// Standard Error: 5_000
.saturating_add((1_007_000 as Weight).saturating_mul(i as Weight))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(i as Weight)))
}
// Storage: Skipped Metadata (r:0 w:0)
fn kill_prefix(p: u32, ) -> Weight {
(3_140_000 as Weight)
// Standard Error: 0
.saturating_add((756_000 as Weight).saturating_mul(p as Weight))
(0 as Weight)
// Standard Error: 8_000
.saturating_add((3_208_000 as Weight).saturating_mul(p as Weight))
.saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight)))
}
}
6 changes: 3 additions & 3 deletions runtime/src/weights/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! The weights used in the runtime
//!
//! The current weights have been obtained with the following reference hardware:
//! * Intel(R) Xeon(R) E-2276G CPU @ 3.80 GHz
//! * 32GB of RAM
//! * 1TB SSD Samsung 860 EVO Basic, 2.5"
//! * GenuineIntel CPU MHz: 2494.144
//! * 8GB of RAM
//! * NVMe SSD

// the generated files to not pass clippy
#![allow(clippy::all)]
Expand Down
16 changes: 8 additions & 8 deletions runtime/src/weights/pallet_balances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
//! Autogenerated weights for `pallet_balances`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-10-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2021-11-11, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("integritee-solo-fresh"), DB CACHE: 128

// Executed Command:
// target/release/integritee-node
// ./integritee-node
// benchmark
// --chain=integritee-solo-fresh
// --steps=50
Expand All @@ -31,37 +31,37 @@ pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_balances::WeightInfo for WeightInfo<T> {
// Storage: System Account (r:1 w:1)
fn transfer() -> Weight {
(68_344_000 as Weight)
(134_486_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn transfer_keep_alive() -> Weight {
(50_479_000 as Weight)
(103_768_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn set_balance_creating() -> Weight {
(27_005_000 as Weight)
(70_179_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:1 w:1)
fn set_balance_killing() -> Weight {
(33_450_000 as Weight)
(77_886_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: System Account (r:2 w:2)
fn force_transfer() -> Weight {
(68_560_000 as Weight)
(135_123_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: System Account (r:1 w:1)
fn transfer_all() -> Weight {
(62_591_000 as Weight)
(120_544_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
Expand Down
14 changes: 7 additions & 7 deletions runtime/src/weights/pallet_claims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
//! Autogenerated weights for `pallet_claims`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-10-19, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2021-11-11, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("integritee-solo-fresh"), DB CACHE: 128

// Executed Command:
// target/release/integritee-node
// ./integritee-node
// benchmark
// --chain=integritee-solo-fresh
// --steps=50
Expand Down Expand Up @@ -37,7 +37,7 @@ impl<T: frame_system::Config> pallet_claims::WeightInfo for WeightInfo<T> {
// Storage: System Account (r:1 w:0)
// Storage: Balances Locks (r:1 w:1)
fn claim() -> Weight {
(430_312_000 as Weight)
(761_780_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(6 as Weight))
}
Expand All @@ -46,7 +46,7 @@ impl<T: frame_system::Config> pallet_claims::WeightInfo for WeightInfo<T> {
// Storage: Claims Claims (r:0 w:1)
// Storage: Claims Signing (r:0 w:1)
fn mint_claim() -> Weight {
(12_008_000 as Weight)
(27_006_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
Expand All @@ -58,7 +58,7 @@ impl<T: frame_system::Config> pallet_claims::WeightInfo for WeightInfo<T> {
// Storage: System Account (r:1 w:0)
// Storage: Balances Locks (r:1 w:1)
fn claim_attest() -> Weight {
(434_315_000 as Weight)
(775_524_000 as Weight)
.saturating_add(T::DbWeight::get().reads(7 as Weight))
.saturating_add(T::DbWeight::get().writes(6 as Weight))
}
Expand All @@ -71,7 +71,7 @@ impl<T: frame_system::Config> pallet_claims::WeightInfo for WeightInfo<T> {
// Storage: System Account (r:1 w:0)
// Storage: Balances Locks (r:1 w:1)
fn attest() -> Weight {
(106_371_000 as Weight)
(310_377_000 as Weight)
.saturating_add(T::DbWeight::get().reads(8 as Weight))
.saturating_add(T::DbWeight::get().writes(7 as Weight))
}
Expand All @@ -80,7 +80,7 @@ impl<T: frame_system::Config> pallet_claims::WeightInfo for WeightInfo<T> {
// Storage: Claims Signing (r:1 w:2)
// Storage: Claims Preclaims (r:1 w:1)
fn move_claim() -> Weight {
(25_219_000 as Weight)
(64_975_000 as Weight)
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(7 as Weight))
}
Expand Down
72 changes: 33 additions & 39 deletions runtime/src/weights/pallet_multisig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
//! Autogenerated weights for `pallet_multisig`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2021-10-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2021-11-11, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("integritee-solo-fresh"), DB CACHE: 128

// Executed Command:
// target/release/integritee-node
// ./integritee-node
// benchmark
// --chain=integritee-solo-fresh
// --steps=50
Expand All @@ -30,100 +30,94 @@ use sp_std::marker::PhantomData;
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> pallet_multisig::WeightInfo for WeightInfo<T> {
fn as_multi_threshold_1(z: u32, ) -> Weight {
(5_896_000 as Weight)
(9_050_000 as Weight)
// Standard Error: 0
.saturating_add((1_000 as Weight).saturating_mul(z as Weight))
.saturating_add((3_000 as Weight).saturating_mul(z as Weight))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
fn as_multi_create(s: u32, z: u32, ) -> Weight {
(47_432_000 as Weight)
// Standard Error: 7_000
.saturating_add((285_000 as Weight).saturating_mul(s as Weight))
(99_228_000 as Weight)
// Standard Error: 87_000
.saturating_add((793_000 as Weight).saturating_mul(s as Weight))
// Standard Error: 0
.saturating_add((2_000 as Weight).saturating_mul(z as Weight))
.saturating_add((3_000 as Weight).saturating_mul(z as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
fn as_multi_create_store(s: u32, z: u32, ) -> Weight {
(51_683_000 as Weight)
// Standard Error: 8_000
.saturating_add((408_000 as Weight).saturating_mul(s as Weight))
(111_754_000 as Weight)
// Standard Error: 282_000
.saturating_add((956_000 as Weight).saturating_mul(s as Weight))
// Standard Error: 0
.saturating_add((3_000 as Weight).saturating_mul(z as Weight))
.saturating_add((6_000 as Weight).saturating_mul(z as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Multisig Multisigs (r:1 w:1)
fn as_multi_approve(s: u32, z: u32, ) -> Weight {
(28_039_000 as Weight)
// Standard Error: 6_000
.saturating_add((236_000 as Weight).saturating_mul(s as Weight))
fn as_multi_approve(_s: u32, z: u32, ) -> Weight {
(70_439_000 as Weight)
// Standard Error: 0
.saturating_add((2_000 as Weight).saturating_mul(z as Weight))
.saturating_add((3_000 as Weight).saturating_mul(z as Weight))
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
fn as_multi_approve_store(s: u32, z: u32, ) -> Weight {
(50_363_000 as Weight)
// Standard Error: 9_000
.saturating_add((356_000 as Weight).saturating_mul(s as Weight))
(87_141_000 as Weight)
// Standard Error: 329_000
.saturating_add((2_115_000 as Weight).saturating_mul(s as Weight))
// Standard Error: 0
.saturating_add((3_000 as Weight).saturating_mul(z as Weight))
.saturating_add((7_000 as Weight).saturating_mul(z as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn as_multi_complete(s: u32, z: u32, ) -> Weight {
(65_416_000 as Weight)
// Standard Error: 9_000
.saturating_add((459_000 as Weight).saturating_mul(s as Weight))
(139_018_000 as Weight)
// Standard Error: 317_000
.saturating_add((629_000 as Weight).saturating_mul(s as Weight))
// Standard Error: 0
.saturating_add((4_000 as Weight).saturating_mul(z as Weight))
.saturating_add((9_000 as Weight).saturating_mul(z as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: unknown [0x3a65787472696e7369635f696e646578] (r:1 w:0)
fn approve_as_multi_create(s: u32, ) -> Weight {
(45_215_000 as Weight)
// Standard Error: 15_000
.saturating_add((484_000 as Weight).saturating_mul(s as Weight))
(93_678_000 as Weight)
// Standard Error: 75_000
.saturating_add((1_063_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:0)
fn approve_as_multi_approve(s: u32, ) -> Weight {
(27_906_000 as Weight)
// Standard Error: 28_000
.saturating_add((138_000 as Weight).saturating_mul(s as Weight))
fn approve_as_multi_approve(_s: u32, ) -> Weight {
(81_581_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
// Storage: System Account (r:1 w:1)
fn approve_as_multi_complete(s: u32, ) -> Weight {
(107_320_000 as Weight)
// Standard Error: 13_000
.saturating_add((483_000 as Weight).saturating_mul(s as Weight))
(235_769_000 as Weight)
// Standard Error: 197_000
.saturating_add((1_684_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
// Storage: Multisig Multisigs (r:1 w:1)
// Storage: Multisig Calls (r:1 w:1)
fn cancel_as_multi(s: u32, ) -> Weight {
(79_773_000 as Weight)
// Standard Error: 9_000
.saturating_add((383_000 as Weight).saturating_mul(s as Weight))
fn cancel_as_multi(_s: u32, ) -> Weight {
(194_725_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
Expand Down
Loading