From 56ad1962ddfbe1947e1603366a935cc8149d8e19 Mon Sep 17 00:00:00 2001 From: Nazar Hussain Date: Fri, 16 Feb 2024 10:31:31 +0100 Subject: [PATCH 1/2] Fix a work around for range sync --- packages/cli/test/sim/multi_fork.test.ts | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/cli/test/sim/multi_fork.test.ts b/packages/cli/test/sim/multi_fork.test.ts index e15f8b01fe90..17edbdfcd49f 100644 --- a/packages/cli/test/sim/multi_fork.test.ts +++ b/packages/cli/test/sim/multi_fork.test.ts @@ -7,6 +7,8 @@ import {SimulationEnvironment} from "../utils/simulation/SimulationEnvironment.j import {defineSimTestConfig, logFilesDir} from "../utils/simulation/utils/index.js"; import { connectAllNodes, + connectNewCLNode, + connectNewELNode, connectNewNode, waitForHead, waitForNodeSync, @@ -172,9 +174,27 @@ const checkpointSync = await env.createNodePair({ keysCount: 0, }); +// TODO: A workaround for this issue for sim tests only +// 1. Start the execution node and let it connect to network +// 2. Wait for few seconds +// 2. And later start the beacon node and connect to network +// 3. With this delay the execution node would be synced before the beacon node starts +// https://github.com/ChainSafe/lodestar/issues/6435 +// Revert to following code once the issue is fixed +// await rangeSync.execution.job.start(); +// await rangeSync.beacon.job.start(); +// await connectNewNode(rangeSync, env.nodes); await rangeSync.execution.job.start(); +await connectNewELNode( + rangeSync.execution, + env.nodes.map((node) => node.execution) +); +await sleep(4000); await rangeSync.beacon.job.start(); -await connectNewNode(rangeSync, env.nodes); +await connectNewCLNode( + rangeSync.beacon, + env.nodes.map((node) => node.beacon) +); await checkpointSync.execution.job.start(); await checkpointSync.beacon.job.start(); From 2925ed658d6c69191a1c43798f41e79e895dd07a Mon Sep 17 00:00:00 2001 From: Nazar Hussain Date: Fri, 16 Feb 2024 11:23:27 +0100 Subject: [PATCH 2/2] Update packages/cli/test/sim/multi_fork.test.ts Co-authored-by: Nico Flaig --- packages/cli/test/sim/multi_fork.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/test/sim/multi_fork.test.ts b/packages/cli/test/sim/multi_fork.test.ts index 17edbdfcd49f..1302ad98bc82 100644 --- a/packages/cli/test/sim/multi_fork.test.ts +++ b/packages/cli/test/sim/multi_fork.test.ts @@ -177,8 +177,8 @@ const checkpointSync = await env.createNodePair({ // TODO: A workaround for this issue for sim tests only // 1. Start the execution node and let it connect to network // 2. Wait for few seconds -// 2. And later start the beacon node and connect to network -// 3. With this delay the execution node would be synced before the beacon node starts +// 3. And later start the beacon node and connect to network +// 4. With this delay the execution node would be synced before the beacon node starts // https://github.com/ChainSafe/lodestar/issues/6435 // Revert to following code once the issue is fixed // await rangeSync.execution.job.start();