From 56eb32f0702d59ecde7ffbeb90656eedb9d060fd Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Wed, 28 Jun 2023 23:16:55 +0200 Subject: [PATCH] Update Reference Hardware Specs (#13317) * Remove Polkadot Wiki Signed-off-by: Oliver Tale-Yazdi * Update requirements for new ref hardware Signed-off-by: Oliver Tale-Yazdi * Add test Signed-off-by: Oliver Tale-Yazdi --------- Signed-off-by: Oliver Tale-Yazdi Co-authored-by: parity-processbot <> --- .../benchmarking-cli/src/machine/hardware.rs | 27 ++++++++++++++++--- .../src/machine/reference_hardware.json | 10 +++---- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/utils/frame/benchmarking-cli/src/machine/hardware.rs b/utils/frame/benchmarking-cli/src/machine/hardware.rs index b3cbc0053c3f5..5a4b7c797b6f1 100644 --- a/utils/frame/benchmarking-cli/src/machine/hardware.rs +++ b/utils/frame/benchmarking-cli/src/machine/hardware.rs @@ -25,9 +25,6 @@ lazy_static! { /// /// These values are provided by Parity, however it is possible /// to use your own requirements if you are running a custom chain. - /// - /// The reference hardware is describe here: - /// pub static ref SUBSTRATE_REFERENCE_HARDWARE: Requirements = { let raw = include_bytes!("reference_hardware.json").as_slice(); serde_json::from_slice(raw).expect("Hardcoded data is known good; qed") @@ -37,8 +34,9 @@ lazy_static! { #[cfg(test)] mod tests { use super::*; + use sc_sysinfo::{Metric, Requirement, Requirements, Throughput}; - /// `SUBSTRATE_REFERENCE_HARDWARE` can be en- and decoded. + /// `SUBSTRATE_REFERENCE_HARDWARE` can be decoded. #[test] fn json_static_data() { let raw = serde_json::to_string(&*SUBSTRATE_REFERENCE_HARDWARE).unwrap(); @@ -46,4 +44,25 @@ mod tests { assert_eq!(decoded, SUBSTRATE_REFERENCE_HARDWARE.clone()); } + + /// The hard-coded values are correct. + #[test] + fn json_static_data_is_correct() { + assert_eq!( + *SUBSTRATE_REFERENCE_HARDWARE, + Requirements(vec![ + Requirement { metric: Metric::Blake2256, minimum: Throughput::from_mibs(783.27) }, + Requirement { + metric: Metric::Sr25519Verify, + minimum: Throughput::from_kibs(560.670000128), + }, + Requirement { + metric: Metric::MemCopy, + minimum: Throughput::from_gibs(11.4925205078125003), + }, + Requirement { metric: Metric::DiskSeqWrite, minimum: Throughput::from_mibs(950.0) }, + Requirement { metric: Metric::DiskRndWrite, minimum: Throughput::from_mibs(420.0) }, + ]) + ); + } } diff --git a/utils/frame/benchmarking-cli/src/machine/reference_hardware.json b/utils/frame/benchmarking-cli/src/machine/reference_hardware.json index 2a451d31403f1..c2fb4c7d4a285 100644 --- a/utils/frame/benchmarking-cli/src/machine/reference_hardware.json +++ b/utils/frame/benchmarking-cli/src/machine/reference_hardware.json @@ -1,22 +1,22 @@ [ { "metric": "Blake2256", - "minimum": 1029.0 + "minimum": 783.27 }, { "metric": "Sr25519Verify", - "minimum": 0.650391 + "minimum": 0.547529297 }, { "metric": "MemCopy", - "minimum": 14666.752 + "minimum": 11768.341 }, { "metric": "DiskSeqWrite", - "minimum": 450.0 + "minimum": 950.0 }, { "metric": "DiskRndWrite", - "minimum": 200.0 + "minimum": 420.0 } ]