From 2554aefa2ad65477f0b22c9557165601c9d25d75 Mon Sep 17 00:00:00 2001 From: "Bernardo A. Rodrigues" Date: Wed, 14 Dec 2022 13:44:33 -0300 Subject: [PATCH 1/3] improve ocw validator/collator CLI description --- client/cli/src/arg_enums.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/cli/src/arg_enums.rs b/client/cli/src/arg_enums.rs index 20f68bc7fb55e..a975956327be8 100644 --- a/client/cli/src/arg_enums.rs +++ b/client/cli/src/arg_enums.rs @@ -232,7 +232,7 @@ pub enum OffchainWorkerEnabled { Always, /// Never enable the offchain worker. Never, - /// Only enable the offchain worker when running as validator. + /// Only enable the offchain worker when running as a validator (or collator, if this is a parachain node). WhenValidating, } From 4dd6073e12bb42440244db57791036f68b95cc1e Mon Sep 17 00:00:00 2001 From: "Bernardo A. Rodrigues" Date: Wed, 14 Dec 2022 19:30:09 -0300 Subject: [PATCH 2/3] rename WhenValidating to WhenAuthoring --- client/cli/src/arg_enums.rs | 2 +- client/cli/src/params/offchain_worker_params.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/client/cli/src/arg_enums.rs b/client/cli/src/arg_enums.rs index a975956327be8..b7c7af999a2d7 100644 --- a/client/cli/src/arg_enums.rs +++ b/client/cli/src/arg_enums.rs @@ -233,7 +233,7 @@ pub enum OffchainWorkerEnabled { /// Never enable the offchain worker. Never, /// Only enable the offchain worker when running as a validator (or collator, if this is a parachain node). - WhenValidating, + WhenAuthority, } /// Syncing mode. diff --git a/client/cli/src/params/offchain_worker_params.rs b/client/cli/src/params/offchain_worker_params.rs index a660320fde255..b18e036c06de5 100644 --- a/client/cli/src/params/offchain_worker_params.rs +++ b/client/cli/src/params/offchain_worker_params.rs @@ -40,7 +40,7 @@ pub struct OffchainWorkerParams { value_name = "ENABLED", value_enum, ignore_case = true, - default_value_t = OffchainWorkerEnabled::WhenValidating + default_value_t = OffchainWorkerEnabled::WhenAuthority )] pub enabled: OffchainWorkerEnabled, @@ -56,10 +56,10 @@ impl OffchainWorkerParams { /// Load spec to `Configuration` from `OffchainWorkerParams` and spec factory. pub fn offchain_worker(&self, role: &Role) -> error::Result { let enabled = match (&self.enabled, role) { - (OffchainWorkerEnabled::WhenValidating, Role::Authority { .. }) => true, + (OffchainWorkerEnabled::WhenAuthority, Role::Authority { .. }) => true, (OffchainWorkerEnabled::Always, _) => true, (OffchainWorkerEnabled::Never, _) => false, - (OffchainWorkerEnabled::WhenValidating, _) => false, + (OffchainWorkerEnabled::WhenAuthority, _) => false, }; let indexing_enabled = self.indexing_enabled; From 8a779126f969aa337c5dcfb9c2f900a7bde1c49d Mon Sep 17 00:00:00 2001 From: bernardo Date: Thu, 15 Dec 2022 17:06:11 -0300 Subject: [PATCH 3/3] Update client/cli/src/arg_enums.rs Co-authored-by: Alexandru Vasile <60601340+lexnv@users.noreply.github.com> --- client/cli/src/arg_enums.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/cli/src/arg_enums.rs b/client/cli/src/arg_enums.rs index b7c7af999a2d7..372e8645e30cc 100644 --- a/client/cli/src/arg_enums.rs +++ b/client/cli/src/arg_enums.rs @@ -232,7 +232,8 @@ pub enum OffchainWorkerEnabled { Always, /// Never enable the offchain worker. Never, - /// Only enable the offchain worker when running as a validator (or collator, if this is a parachain node). + /// Only enable the offchain worker when running as a validator (or collator, if this is a + /// parachain node). WhenAuthority, }