Skip to content

Commit

Permalink
Reinitialize should allow to override existing config in collationGen…
Browse files Browse the repository at this point in the history
…eration (#4833)

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 <[email protected]>
Co-authored-by: Andrei Sandu <[email protected]>
  • Loading branch information
3 people authored Jun 23, 2024
1 parent 25a648d commit f8feebc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 1 addition & 5 deletions polkadot/node/collation-generation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 12 additions & 0 deletions prdoc/pr_4833.prdoc
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f8feebc

Please sign in to comment.