Skip to content

Commit

Permalink
test: add a work around for range sync issue during sim tests (#6436)
Browse files Browse the repository at this point in the history
* Fix a work around for range sync

* Update packages/cli/test/sim/multi_fork.test.ts

Co-authored-by: Nico Flaig <nflaig@protonmail.com>

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
  • Loading branch information
nazarhussain and nflaig committed Feb 16, 2024
1 parent 0cee060 commit d01c542
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion packages/cli/test/sim/multi_fork.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
// 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();
// 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();
Expand Down

0 comments on commit d01c542

Please sign in to comment.