mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 14:37:57 +00:00
Move slow hardware warning print logic to CLI (#13198)
* Move slow hardware warning print logic to CLI Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update client/sysinfo/src/sysinfo.rs Co-authored-by: Bastian Köcher <git@kchr.de> * fmt 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: Bastian Köcher <git@kchr.de>
This commit is contained in:
committed by
GitHub
parent
5d55d05ed7
commit
64b37b301d
@@ -318,18 +318,12 @@ pub fn new_full_base(
|
||||
&sc_consensus_babe::BabeLink<Block>,
|
||||
),
|
||||
) -> Result<NewFullBase, ServiceError> {
|
||||
let hwbench = if !disable_hardware_benchmarks {
|
||||
config.database.path().map(|database_path| {
|
||||
let hwbench = (!disable_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),
|
||||
SUBSTRATE_REFERENCE_HARDWARE.clone(),
|
||||
config.role.is_authority(),
|
||||
)
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
sc_sysinfo::gather_hwbench(Some(database_path))
|
||||
}))
|
||||
.flatten();
|
||||
|
||||
let sc_service::PartialComponents {
|
||||
client,
|
||||
@@ -403,6 +397,11 @@ pub fn new_full_base(
|
||||
|
||||
if let Some(hwbench) = hwbench {
|
||||
sc_sysinfo::print_hwbench(&hwbench);
|
||||
if !SUBSTRATE_REFERENCE_HARDWARE.check_hardware(&hwbench) && role.is_authority() {
|
||||
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