From 5a6cb869545d9de656f73c15ac3a9a1f18d61f4e Mon Sep 17 00:00:00 2001 From: girazoki Date: Sun, 23 Jun 2024 11:35:36 +0200 Subject: [PATCH] Reinitialize should allow to override existing config in collationGeneration (#4833) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently the `Initialize` and `Reinitialize` messages in the collationGeneration subsystem fail if: - `Initialize` if there exists already another configuration and - `Reinitialize` if another configuration does not exist I propose to instead change the behaviour of `Reinitialize` to always set the config regardless of whether one exists or not. --------- Co-authored-by: Bastian Köcher Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com> --- polkadot/node/collation-generation/src/lib.rs | 6 +----- prdoc/pr_4833.prdoc | 12 ++++++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 prdoc/pr_4833.prdoc diff --git a/polkadot/node/collation-generation/src/lib.rs b/polkadot/node/collation-generation/src/lib.rs index 0c2f8ee14a580..d38516a4ff713 100644 --- a/polkadot/node/collation-generation/src/lib.rs +++ b/polkadot/node/collation-generation/src/lib.rs @@ -147,11 +147,7 @@ impl CollationGenerationSubsystem { Ok(FromOrchestra::Communication { msg: CollationGenerationMessage::Reinitialize(config), }) => { - if self.config.is_none() { - gum::error!(target: LOG_TARGET, "no initial initialization"); - } else { - self.config = Some(Arc::new(config)); - } + self.config = Some(Arc::new(config)); false }, Ok(FromOrchestra::Communication { diff --git a/prdoc/pr_4833.prdoc b/prdoc/pr_4833.prdoc new file mode 100644 index 0000000000000..a5cf853696eee --- /dev/null +++ b/prdoc/pr_4833.prdoc @@ -0,0 +1,12 @@ +title: "Reinitialize should allow to override existing config in collationGeneration" + +doc: + - audience: Node Dev + description: | + The Reinitialize collationGeneration subsystem message currently fails if no other config is already set. + As it is difficult to query the collationGeneration subsystem to check when to call Initialize or Reinitialize, this PR + proposes that Reinitialize overrides the configuration regardless if there was one already set. + +crates: + - name: polkadot-node-collation-generation + bump: minor