Skip to content

Commit

Permalink
apply feeback
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Sep 13, 2023
1 parent b039920 commit c755763
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions packages/client/test/sim/beaconsync.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)

Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/sim/beaconsync.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
7 changes: 3 additions & 4 deletions packages/client/test/sim/simutils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof EventSource> {
// 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
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/sim/snapsync.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)

Expand Down

0 comments on commit c755763

Please sign in to comment.