Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add a work around for range sync issue during sim tests #6436

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading