From 9a4899a84e6815f6e040a00e9c36aab4d57096a6 Mon Sep 17 00:00:00 2001 From: Andronik Date: Fri, 24 Mar 2023 14:00:47 +0100 Subject: [PATCH 1/2] malus: don't panic if can't fetch validation data --- node/malus/src/variants/suggest_garbage_candidate.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/node/malus/src/variants/suggest_garbage_candidate.rs b/node/malus/src/variants/suggest_garbage_candidate.rs index 7e1a9246bc4f..009f81f65d6a 100644 --- a/node/malus/src/variants/suggest_garbage_candidate.rs +++ b/node/malus/src/variants/suggest_garbage_candidate.rs @@ -122,17 +122,22 @@ where { Ok(Some((validation_data, validation_code))) => { sender - .send((validation_data, validation_code, n_validators)) + .send(Some(( + validation_data, + validation_code, + n_validators, + ))) .expect("channel is still open"); }, _ => { - panic!("Unable to fetch validation data"); + sender.send(None).expect("channel is still open"); }, } }), ); - let (validation_data, validation_code, n_validators) = receiver.recv().unwrap(); + let (validation_data, validation_code, n_validators) = + receiver.recv().unwrap()?; let validation_data_hash = validation_data.hash(); let validation_code_hash = validation_code.hash(); From 01b7a53d58f9f78df710126333d91b96f9987044 Mon Sep 17 00:00:00 2001 From: Andronik Date: Fri, 24 Mar 2023 14:01:14 +0100 Subject: [PATCH 2/2] malus: add fast-runtime feature --- node/malus/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/node/malus/Cargo.toml b/node/malus/Cargo.toml index c783693ca527..97752af8d71d 100644 --- a/node/malus/Cargo.toml +++ b/node/malus/Cargo.toml @@ -37,6 +37,7 @@ rand = "0.8.5" [features] default = [] +fast-runtime = ["polkadot-cli/fast-runtime"] [dev-dependencies] polkadot-node-subsystem-test-helpers = { path = "../subsystem-test-helpers" }