Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Update Reference Hardware Specs (#13317)
Browse files Browse the repository at this point in the history
* Remove Polkadot Wiki

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update requirements for new ref hardware

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Add test

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: parity-processbot <>
  • Loading branch information
ggwpez committed Jun 28, 2023
1 parent ee89006 commit fe2d513
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
27 changes: 23 additions & 4 deletions utils/frame/benchmarking-cli/src/machine/hardware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:
/// <https://wiki.polkadot.network/docs/maintain-guides-how-to-validate-polkadot>
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")
Expand All @@ -37,13 +34,35 @@ 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();
let decoded: Requirements = serde_json::from_str(&raw).unwrap();

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) },
])
);
}
}
10 changes: 5 additions & 5 deletions utils/frame/benchmarking-cli/src/machine/reference_hardware.json
Original file line number Diff line number Diff line change
@@ -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
}
]

0 comments on commit fe2d513

Please sign in to comment.