-
Notifications
You must be signed in to change notification settings - Fork 790
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
client: some skeleton improvements from observations on devnet syncs #3014
Conversation
Codecov Report
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple of small spelling nits on comments (for clarity's sake) but looks good so far. A few of the skeleton tests are now failing though I'm assuming this is due to the logic changes around backstepping and adjusting subchains.
packages/client/src/sync/skeleton.ts
Outdated
edited = true | ||
} | ||
// If the old subchain is an extension of the new one, merge the two | ||
// and let the skeleton syncer restart (to clean internal state) | ||
|
||
const subChain1Head = await this.getBlock(this.status.progress.subchains[1].head) | ||
// subchains are useful is subChain1Head is in skeleton only and its tail correct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// subchains are useful is subChain1Head is in skeleton only and its tail correct | |
// subchains are useful if subChain1Head is in skeleton only and its tail correct |
packages/client/src/sync/skeleton.ts
Outdated
subChain1Tail === undefined || | ||
!equalsBytes(subChain1Tail.header.parentHash, this.status.progress.subchains[1].next) | ||
) { | ||
// if subChain1Head is not in the skeleton that all previous subchains are not useful |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// if subChain1Head is not in the skeleton that all previous subchains are not useful | |
// if subChain1Head is not in the skeleton then all previous subchains are not useful |
This is still WIP, right? |
0bbcefb
to
e7fedfd
Compare
yes was buried into building a beacon sync sim test that i plan to extend to do beacon engine api updates along side snapsync (in a speparate PR) sim is mostly done, need to fix resolution of the synced promise to close out the test |
@@ -48,26 +51,30 @@ describe('simple mainnet test run', async () => { | |||
|
|||
const blockHashes: string[] = [] | |||
// ------------Sanity checks-------------------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest of the changes in this file are mostly because of formatting triggered by adding sim run timelimit
@@ -25,6 +25,9 @@ export async function runTx(data: string, to?: string, value?: bigint) { | |||
} | |||
|
|||
describe('simple mainnet test run', async () => { | |||
if (process.env.EXTRA_CL_PARAMS === undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shifted the genesis to run from shanghai, this does the same for CL
25dc17f
to
ad3d866
Compare
should be merge ready cc @holgerd77 @acolytec3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few suggestions/questions. The code looks good and working to get the new beacon sync test running now.
assert.fail('could not complete beacon sync in 8 minutes') | ||
} | ||
} else { | ||
assert.fail('ethereumjs client not setup properly for snap sync') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this error referencing? Is snap sync somehow being tested here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry copied over from snapsyncspec , will cleanup
packages/client/test/sim/simutils.ts
Outdated
|
||
import type { Common } from '@ethereumjs/common' | ||
import type { TransactionType, TxData, TxOptions } from '@ethereumjs/tx' | ||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// This function switches between the native web implementation and a nodejs implemnetation | |
// This function switches between the native web implementation and a nodejs implementation |
packages/client/test/sim/simutils.ts
Outdated
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions | ||
if (globalThis.EventSource) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why disable this and not just add gloablThis.EventSource !== undefined
? I know it's a nit but is there a good reason to fight the linter here?
packages/client/test/sim/simutils.ts
Outdated
eventSource.addEventListener(topics[0], (async (_event: MessageEvent) => { | ||
if (syncState === 'PAUSED') return | ||
try { | ||
// just fetch finalized updated, it has all relevant hashesh to fcU |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// just fetch finalized updated, it has all relevant hashesh to fcU | |
// just fetch finalized updated, it has all relevant hashes to fcU |
|
||
## Prerequisites | ||
|
||
1. Bash terminal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. Bash terminal | |
1. ZSH terminal |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be using get 1.11.6 or 1.12.2 like the test looks for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing. Nice work!
c755763
to
e6457eb
Compare
some improvements for more robust backfill + beacon sync sim