From e12a75c1355ddf06237c83805e02120e56043f54 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Wed, 6 Sep 2023 15:45:59 +0200 Subject: [PATCH 1/4] Enable mixed client sim tests --- .github/workflows/test-sim.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-sim.yml b/.github/workflows/test-sim.yml index 6494acc3923d..9663e7253a2a 100644 --- a/.github/workflows/test-sim.yml +++ b/.github/workflows/test-sim.yml @@ -68,11 +68,9 @@ jobs: run: yarn test:sim:backup_eth_provider working-directory: packages/cli - # Enable these tests after fixing the following issue - # https://github.com/ChainSafe/lodestar/issues/5553 - # - name: Sim tests multi client - # run: DEBUG='${{github.event.inputs.debug}}' yarn test:sim:multiclient - # working-directory: packages/cli + - name: Sim tests multi client + run: DEBUG='${{github.event.inputs.debug}}' yarn test:sim:multiclient + working-directory: packages/cli - name: Upload debug log test files for "packages/cli" if: ${{ always() }} From 5da9a5e38d6d7a3c187e201564dc89bea6f0b3ca Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Wed, 6 Sep 2023 17:38:28 +0200 Subject: [PATCH 2/4] Add host.docker.internal as host --- packages/cli/test/utils/simulation/runner/DockerRunner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/test/utils/simulation/runner/DockerRunner.ts b/packages/cli/test/utils/simulation/runner/DockerRunner.ts index 91dcb492c3eb..7658e198a738 100644 --- a/packages/cli/test/utils/simulation/runner/DockerRunner.ts +++ b/packages/cli/test/utils/simulation/runner/DockerRunner.ts @@ -55,7 +55,7 @@ export class DockerRunner implements RunnerEnv { } create(jobOption: Omit, "children">): Job { - const jobArgs = ["run", "--rm", "--name", jobOption.id]; + const jobArgs = ["run", "--rm", "--name", jobOption.id, "--add-host", "host.docker.internal:host-gateway"]; if (jobOption.options.dockerNetworkIp) { jobArgs.push("--network", dockerNetworkName); From 16da7240f7b34206a737fde3ef0e195d394b3bc7 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Wed, 6 Sep 2023 18:30:06 +0200 Subject: [PATCH 3/4] Fix typo in lodestar --- packages/cli/test/utils/simulation/interfaces.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/test/utils/simulation/interfaces.ts b/packages/cli/test/utils/simulation/interfaces.ts index b18d92ac55ed..d87ca35f4a78 100644 --- a/packages/cli/test/utils/simulation/interfaces.ts +++ b/packages/cli/test/utils/simulation/interfaces.ts @@ -29,12 +29,12 @@ export type SimulationOptions = { }; export enum BeaconClient { - Lodestar = "beacon_loadstar", + Lodestar = "beacon_lodestar", Lighthouse = "beacon_lighthouse", } export enum ValidatorClient { - Lodestar = "validator_loadstar", + Lodestar = "validator_lodestar", Lighthouse = "validator_lighthouse", } From 74ee2216677f9fd26697851ae56d67165b3dee30 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Wed, 6 Sep 2023 18:30:56 +0200 Subject: [PATCH 4/4] Rename multi client to mixed client sim tests --- .github/workflows/test-sim.yml | 4 ++-- packages/cli/package.json | 2 +- .../test/sim/{multi_client.test.ts => mixed_client.test.ts} | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename packages/cli/test/sim/{multi_client.test.ts => mixed_client.test.ts} (96%) diff --git a/.github/workflows/test-sim.yml b/.github/workflows/test-sim.yml index 9663e7253a2a..9fea85cd94af 100644 --- a/.github/workflows/test-sim.yml +++ b/.github/workflows/test-sim.yml @@ -68,8 +68,8 @@ jobs: run: yarn test:sim:backup_eth_provider working-directory: packages/cli - - name: Sim tests multi client - run: DEBUG='${{github.event.inputs.debug}}' yarn test:sim:multiclient + - name: Sim tests mixed client + run: DEBUG='${{github.event.inputs.debug}}' yarn test:sim:mixedclient working-directory: packages/cli - name: Upload debug log test files for "packages/cli" diff --git a/packages/cli/package.json b/packages/cli/package.json index e0420d4a21a9..91cde94d7291 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -34,7 +34,7 @@ "test:unit": "nyc --cache-dir .nyc_output/.cache -e .ts mocha 'test/unit/**/*.test.ts'", "test:e2e": "mocha --timeout 30000 'test/e2e/**/*.test.ts'", "test:sim:multifork": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/multi_fork.test.ts", - "test:sim:multiclient": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/multi_client.test.ts", + "test:sim:mixedclient": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/mixed_client.test.ts", "test:sim:endpoints": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/endpoints.test.ts", "test:sim:deneb": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/deneb.test.ts", "test:sim:backup_eth_provider": "LODESTAR_PRESET=minimal node --loader ts-node/esm test/sim/backup_eth_provider.test.ts", diff --git a/packages/cli/test/sim/multi_client.test.ts b/packages/cli/test/sim/mixed_client.test.ts similarity index 96% rename from packages/cli/test/sim/multi_client.test.ts rename to packages/cli/test/sim/mixed_client.test.ts index d9004044a3f3..ccb498865bae 100644 --- a/packages/cli/test/sim/multi_client.test.ts +++ b/packages/cli/test/sim/mixed_client.test.ts @@ -35,8 +35,8 @@ const ttd = getEstimatedTTD({ const env = await SimulationEnvironment.initWithDefaults( { - id: "multi-clients", - logsDir: path.join(logFilesDir, "multi-clients"), + id: "mixed-clients", + logsDir: path.join(logFilesDir, "mixed-clients"), chainConfig: { ALTAIR_FORK_EPOCH: altairForkEpoch, BELLATRIX_FORK_EPOCH: bellatrixForkEpoch,