From 6064d9e5fb6e0c448fcb7d2531985ec37f80eafb Mon Sep 17 00:00:00 2001 From: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com> Date: Thu, 2 Nov 2023 07:55:44 +0100 Subject: [PATCH 1/2] chainSpec: runtime genesis layout updated --- javascript/packages/orchestrator/src/chainSpec.ts | 3 ++- javascript/packages/orchestrator/src/paras.ts | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/javascript/packages/orchestrator/src/chainSpec.ts b/javascript/packages/orchestrator/src/chainSpec.ts index 41ddb10c8..17ddf8f9d 100644 --- a/javascript/packages/orchestrator/src/chainSpec.ts +++ b/javascript/packages/orchestrator/src/chainSpec.ts @@ -632,7 +632,8 @@ export function getRuntimeConfig(chainSpec: any) { // runtime_genesis_config is no longer in ChainSpec after rococo runtime rework (refer to: https://github.com/paritytech/polkadot-sdk/pull/1256) // ChainSpec may contain a RuntimeGenesisConfigPatch return ( - chainSpec.genesis.runtimeGenesisConfigPatch || + chainSpec.genesis.runtimeGenesis.config || + chainSpec.genesis.runtimeGenesis.patch || chainSpec.genesis.runtime?.runtime_genesis_config || chainSpec.genesis.runtime ); diff --git a/javascript/packages/orchestrator/src/paras.ts b/javascript/packages/orchestrator/src/paras.ts index a1de9a075..84bd2de5a 100644 --- a/javascript/packages/orchestrator/src/paras.ts +++ b/javascript/packages/orchestrator/src/paras.ts @@ -110,9 +110,14 @@ export async function generateParachainFiles( if (plainData.genesis.runtime?.parachainInfo?.parachainId) plainData.genesis.runtime.parachainInfo.parachainId = parachain.id; else if ( - plainData.genesis.runtimeGenesisConfigPatch?.parachainInfo?.parachainId + plainData.genesis.runtimeGenesis?.patch?.parachainInfo?.parachainId ) - plainData.genesis.runtimeGenesisConfigPatch.parachainInfo.parachainId = + plainData.genesis.runtimeGenesis.patch.parachainInfo.parachainId = + parachain.id; + else if ( + plainData.genesis.runtimeGenesis?.config?.parachainInfo?.parachainId + ) + plainData.genesis.runtimeGenesis.config.parachainInfo.parachainId = parachain.id; writeChainSpec(chainSpecFullPathPlain, plainData); From df998b6351373d537a28b535d342239e62d4e578 Mon Sep 17 00:00:00 2001 From: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com> Date: Thu, 2 Nov 2023 08:38:50 +0100 Subject: [PATCH 2/2] fix --- javascript/packages/orchestrator/src/chainSpec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/packages/orchestrator/src/chainSpec.ts b/javascript/packages/orchestrator/src/chainSpec.ts index 17ddf8f9d..cbe440b9c 100644 --- a/javascript/packages/orchestrator/src/chainSpec.ts +++ b/javascript/packages/orchestrator/src/chainSpec.ts @@ -632,8 +632,8 @@ export function getRuntimeConfig(chainSpec: any) { // runtime_genesis_config is no longer in ChainSpec after rococo runtime rework (refer to: https://github.com/paritytech/polkadot-sdk/pull/1256) // ChainSpec may contain a RuntimeGenesisConfigPatch return ( - chainSpec.genesis.runtimeGenesis.config || - chainSpec.genesis.runtimeGenesis.patch || + chainSpec.genesis.runtimeGenesis?.config || + chainSpec.genesis.runtimeGenesis?.patch || chainSpec.genesis.runtime?.runtime_genesis_config || chainSpec.genesis.runtime );