mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-25 12:57:58 +00:00
Warn validators with slow hardware (#1863)
* Warn validators with slow hardware * update * fix * revert * Fix printing logic Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update polkadot-parachain/src/service.rs * import Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * update lockfile for {"substrate", "polkadot"} Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Co-authored-by: parity-processbot <> Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
@@ -256,14 +256,11 @@ pub fn run() -> Result<()> {
|
||||
let collator_options = cli.run.collator_options();
|
||||
|
||||
runner.run_node_until_exit(|config| async move {
|
||||
let hwbench = if !cli.no_hardware_benchmarks {
|
||||
let hwbench = (!cli.no_hardware_benchmarks).then_some(
|
||||
config.database.path().map(|database_path| {
|
||||
let _ = std::fs::create_dir_all(&database_path);
|
||||
sc_sysinfo::gather_hwbench(Some(database_path))
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
})).flatten();
|
||||
|
||||
let para_id = chain_spec::Extensions::try_get(&*config.chain_spec)
|
||||
.map(|e| e.para_id)
|
||||
|
||||
@@ -21,6 +21,7 @@ use cumulus_primitives_core::ParaId;
|
||||
use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface};
|
||||
|
||||
// Substrate Imports
|
||||
use frame_benchmarking_cli::SUBSTRATE_REFERENCE_HARDWARE;
|
||||
use sc_consensus::ImportQueue;
|
||||
use sc_executor::NativeElseWasmExecutor;
|
||||
use sc_network::NetworkService;
|
||||
@@ -229,6 +230,14 @@ async fn start_node_impl(
|
||||
|
||||
if let Some(hwbench) = hwbench {
|
||||
sc_sysinfo::print_hwbench(&hwbench);
|
||||
// Here you can check whether the hardware meets your chains' requirements. Putting a link
|
||||
// in there and swapping out the requirements for your own are probably a good idea. The
|
||||
// requirements for a para-chain are dictated by its relay-chain.
|
||||
if !SUBSTRATE_REFERENCE_HARDWARE.check_hardware(&hwbench) && validator {
|
||||
log::warn!(
|
||||
"⚠️ The hardware does not meet the minimal requirements for role 'Authority'."
|
||||
);
|
||||
}
|
||||
|
||||
if let Some(ref mut telemetry) = telemetry {
|
||||
let telemetry_handle = telemetry.handle();
|
||||
|
||||
Reference in New Issue
Block a user