From c755763ff39d3a25aa25640bc4a6a1068b9ebeb7 Mon Sep 17 00:00:00 2001 From: harkamal Date: Wed, 13 Sep 2023 20:06:27 +0530 Subject: [PATCH] apply feeback --- packages/client/test/sim/beaconsync.md | 4 ++-- packages/client/test/sim/beaconsync.spec.ts | 4 ++-- packages/client/test/sim/simutils.ts | 7 +++---- packages/client/test/sim/snapsync.md | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/client/test/sim/beaconsync.md b/packages/client/test/sim/beaconsync.md index b0782c7c668..cdaaaadc995 100644 --- a/packages/client/test/sim/beaconsync.md +++ b/packages/client/test/sim/beaconsync.md @@ -2,12 +2,12 @@ ## Prerequisites -1. Bash terminal +1. ZSH terminal 2. Docker (without sudo) 3. `jq` & `curl` installed 4. `ethereumjs-monorepo` codebase build via `npm i` (for e.g. at `/usr/app/ethereumjs`) -You may pre-download docker images for lodestar (`docker pull chainsafe/lodestar:latest`) and geth (`docker pull ethereum/client-go:v1.11.6`) to avoid any test timeout issues. +You may pre-download docker images for lodestar (`docker pull chainsafe/lodestar:latest`) and geth (`docker pull ethereum/client-go:v1.12.2`) to avoid any test timeout issues. Note: All commands should be run from the `client` package directory root (so something like `/usr/app/ethereumjs/packages/client`) diff --git a/packages/client/test/sim/beaconsync.spec.ts b/packages/client/test/sim/beaconsync.spec.ts index 07bde665380..d108db0b984 100644 --- a/packages/client/test/sim/beaconsync.spec.ts +++ b/packages/client/test/sim/beaconsync.spec.ts @@ -169,7 +169,7 @@ describe('simple mainnet test run', async () => { assert.fail('could not complete beacon sync in 8 minutes') } } else { - assert.fail('ethereumjs client not setup properly for snap sync') + assert.fail('ethereumjs client not setup properly for beacon sync') } }, 10 * 60_000 @@ -193,7 +193,7 @@ async function createBeaconSyncClient( datadir: any ) { // Turn on `debug` logs, defaults to all client logging - debug.enable(process.env.DEBUG_SNAP ?? '') + debug.enable(process.env.DEBUG_SYNC ?? '') const logger = getLogger({ logLevel: 'debug' }) const config = new Config({ common, diff --git a/packages/client/test/sim/simutils.ts b/packages/client/test/sim/simutils.ts index 7b229378cdd..8356db1258b 100644 --- a/packages/client/test/sim/simutils.ts +++ b/packages/client/test/sim/simutils.ts @@ -30,10 +30,9 @@ import type { ChildProcessWithoutNullStreams } from 'child_process' import type { Client } from 'jayson/promise' export const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms)) -// This function switches between the native web implementation and a nodejs implemnetation +// This function switches between the native web implementation and a nodejs implementation export async function getEventSource(): Promise { - // eslint-disable-next-line @typescript-eslint/strict-boolean-expressions - if (globalThis.EventSource) { + if (globalThis.EventSource !== undefined) { return EventSource } else { return (await import('eventsource')).default as unknown as typeof EventSource @@ -528,7 +527,7 @@ export async function setupEngineUpdateRelay(client: EthereumClient, peerBeaconU eventSource.addEventListener(topics[0], (async (_event: MessageEvent) => { if (syncState === 'PAUSED') return try { - // just fetch finalized updated, it has all relevant hashesh to fcU + // just fetch finalized updated, it has all relevant hashes for fcU const beaconFinalized = await ( await fetch(`${peerBeaconUrl}/eth/v1/beacon/light_client/finality_update`) ).json() diff --git a/packages/client/test/sim/snapsync.md b/packages/client/test/sim/snapsync.md index ea2f9659356..75ca68b420c 100644 --- a/packages/client/test/sim/snapsync.md +++ b/packages/client/test/sim/snapsync.md @@ -7,7 +7,7 @@ 3. `jq` & `curl` installed 4. `ethereumjs-monorepo` codebase build via `npm i` (for e.g. at `/usr/app/ethereumjs`) -You may pre-download docker images for lodestar (`docker pull chainsafe/lodestar:latest`) and geth (`docker pull ethereum/client-go:v1.11.6`) to avoid any test timeout issues. +You may pre-download docker images for lodestar (`docker pull chainsafe/lodestar:latest`) and geth (`docker pull ethereum/client-go:v1.12.2`) to avoid any test timeout issues. Note: All commands should be run from the `client` package directory root (so something like `/usr/app/ethereumjs/packages/client`)