Skip to content
Snippets Groups Projects
Unverified Commit 216cc45d authored by Javier Viola's avatar Javier Viola Committed by GitHub
Browse files

fix(orchestrator): customize invulnerables (#131)

Call `add_collator_selection` to customize `invulnerables` for both
session and aura keys.
cc @pgherveou
parent 439a8dea
No related merge requests found
......@@ -342,15 +342,18 @@ impl ChainSpec {
);
} else {
add_aura_authorities(&pointer, &mut chain_spec_json, &validators, KeyType::Aura);
let invulnerables: Vec<&NodeSpec> = para
.collators
.iter()
.filter(|node| node.is_invulnerable)
.collect();
add_collator_selection(&pointer, &mut chain_spec_json, &invulnerables);
// await addParaCustom(chainSpecFullPathPlain, node);
};
// Add nodes to collator
let invulnerables: Vec<&NodeSpec> = para
.collators
.iter()
.filter(|node| node.is_invulnerable)
.collect();
add_collator_selection(&pointer, &mut chain_spec_json, &invulnerables);
// override `parachainInfo/parachainId`
override_parachain_info(&pointer, &mut chain_spec_json, para.id);
......@@ -821,11 +824,13 @@ fn add_collator_selection(
.clone()
})
.collect();
// collatorSelection.invulnerables
if let Some(invulnerables) = val.pointer_mut("collatorSelection/invulnerables") {
if let Some(invulnerables) = val.pointer_mut("/collatorSelection/invulnerables") {
*invulnerables = json!(keys);
} else {
// TODO: add a nice warning here.
println!("warn!! can't customize the invulnerables key");
}
} else {
unreachable!("pointer to runtime config should be valid!")
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment