-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
chore: update the naming conventions used in sim tests #6805
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #6805 +/- ##
============================================
- Coverage 62.20% 62.20% -0.01%
============================================
Files 570 570
Lines 59987 59987
Branches 1975 1972 -3
============================================
- Hits 37317 37316 -1
- Misses 22627 22628 +1
Partials 43 43 |
Performance Report✔️ no performance regression detected Full benchmark results
|
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.
How do you feel about moving this out to the packages
folder so it lives in its own package. Will be easier to test that its isolated and will also make it easier to publish. Eventually we can move it to its own repo if there is community adoption.
@@ -1,11 +1,11 @@ | |||
/* eslint-disable @typescript-eslint/naming-convention */ | |||
import path from "node:path"; | |||
import {activePreset} from "@lodestar/params"; | |||
import {SimulationEnvironment} from "../utils/simulation/simulationEnvironment.js"; | |||
import {nodeAssertion} from "../utils/simulation/assertions/nodeAssertion.js"; |
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.
I lean towards keeping assertion
vs scenario
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.
Assertion is one step of the whole process that involves in it, capturing data, asserting logic, dumping raw data for debugging.
So why I tend to use a broader term 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.
Scenario to me is like "range syncing" or similar.... doesn't speak to "collecting information and asserting against it"
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.
Yes you can implement same "range syncing" with this, but to implement this scenario you need some flow, some structure to capture key points and then decide if the range sync was successful or not, if not then dump the raw data for debugging.
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.
as in "a scenario" is the "range syncing scenario".... and within a scenario there are a number of data points that are collected and asserted against. the collection and asserting is "an assertion" to me, not "a scenario". like there are assertions that happen at the slot, there are assertions that happen at the epoch. not there are scenarios that happen at the slot and scenarios that happen at the epoch... i think "scenario" is the wrong work for this construct and prefer it the way it was before the change. I think the wording "Assertion" was more descriptive before.
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.
Agreed, def should let others weigh in on the semantics. I think the whole flow of collect data, check assertion and store result is an "assertion"..... for merge it would be a MergeAssertion
for blobs it would be a BlobAssertion
. Like a blob assertion in my mind is the hook to send the blob transaction, to wait scheduling for the blob to be propagated, the calling of the API to get the blobs from the CL and then the assert statement to check the blob that was received is the same as the blob that was sent... That whole workflow is an "assertion". I suppose "Test" would also be appropriate because the test can contain several "assertions". But a "scenario" is more something the talks about the flow or conditions of the simulation as a whole.
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.
That whole flow usually referred as AAA Pattern and assertion is one part of it.
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.
I agree with @matthewkeil. Open to other ideas, but between those two, assertion is more helpful 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.
mergeScenario vs mergeAssertion
Looking at this in the code, this is definitely an assertion as it asserts that the merge transition was successful. A "merge scenario" sounds like a configuration you would pass to the simulation framework to test the merge as a whole.
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.
So be it assertion then.
Yes I would love that, but step by step. Some inner refactoring now and then try to strip down dependencies as much possible before moving to it's own package. |
4843c6e
to
30ed190
Compare
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.
Looks great! I really likeMatch
! Good idea 🎸
* chore: n-historical state - track state persist count per epoch (#6699) * feat: add lodestar binaries to release (#6666) * feat: added binaries creation support * feat: added sanity checks * chore: define reusable workflow * chore: fix sanity check,; disable arm64 * chore: added workflow_dispatch * fix: needs cleanup * chore: update old space size Co-authored-by: Nico Flaig <nflaig@protonmail.com> * chore: address comments * chore: address comments * chore: fixed typo * chore: typo Co-authored-by: Nico Flaig <nflaig@protonmail.com> * chore: address comments * chore: wording Co-authored-by: Nico Flaig <nflaig@protonmail.com> * chore: use frozen lock file Co-authored-by: Nico Flaig <nflaig@protonmail.com> --------- Co-authored-by: Nico Flaig <nflaig@protonmail.com> * feat: switch bls to napi rebuild (#6616) * chore: update package.json deps and run yarn * feat: remove unused blst config from vitest.browser.*.config.ts * test: move G2@INF test to base blst repo. No longer exported. * fix: add Uint8Array.from for Buffer return value in unit test so type matches for toEqual * refactor: update imports of CoordType to use bls instead of blst * feat: add blsAddVerificationRandomness cli option * feat: add randomBytesNonZero to utils * feat: implement verification randomness for same message * feat: implement napi blst and switch to libuv worker pool * chore: lint * fix: update comments for availableParallelism * feat: set UV_THREADPOOL_SIZE for perf tests * feat: set UV_THREADPOOL_SIZE=$(nproc) in lodestar entrance script * feat: remove case for serialized PublicKey in deserializeSet * feat: add back workBusy count logic to canAcceptWork * feat: automatically set threadpool size in beaconHandler * refactor: rename flag to disableSameMessageVerificationRandomness * fix: remove UV_THREADPOOL_SIZE from ./lodestar * docs: add TODO about updating metrics * fix: make benchmark multi threading cross-compatible * chore: add bls@8.0.0 * feat: default to added randomness * feat: add warning for no same message randomness * fix: passing to updated bls functions * feat: add blst peerDep * fix: default to same message randomness * chore: update yarn.lock * chore: remove unused function to clear lint * feat: break out setThreadPoolSize * docs: update packages/cli/src/cmds/beacon/setThreadPoolSize.ts Co-authored-by: Nico Flaig <nflaig@protonmail.com> * chore: update location for blst dep * chore: run lint again * fix: remove peerDep from light-client * test: fix browser based tests * fix: bad relative imports * docs: add note to readme about switchable bls * docs: typo * chore: lint readme * fix: light-client unit tests * fix: light-client e2e test * feat: remove disableSameMessageVerificationRandomness * refactor: remove unused type * docs: update wordlist * fix: e2e tests * Lint package.json * Revert "fix: e2e tests" This reverts commit f71acd7. * Revert "fix: light-client e2e test" This reverts commit 23c11f0. * Revert "fix: light-client unit tests" This reverts commit fa7893e. * Revert "test: fix browser based tests" This reverts commit 98d04ab. * docs: update readme to remove switchable bls argument * fix: replace optimizeDeps in vitest.browser.config * chore: updated to bls 8.1.0 * feat: move setting threadpool size and warnings to applyPreset.ts * fix: remove setThreadpoolSize from beacon handler * feat: move libuv size logging into handler to use logger * refactor: rename applyPreset to preInitialization * refactor: logging about pool size * Update packages/cli/src/options/globalOptions.ts Co-authored-by: Nico Flaig <nflaig@protonmail.com> * refactor: rename prover applyPreset * docs: change comment in cli/index * fix: update logging for * fix: throw error for invalid uvThreadpoolSize * Update packages/cli/src/preInitialization.ts Co-authored-by: Nico Flaig <nflaig@protonmail.com> * Fix lint issues * Remove unused import * refactor: move bls pool logging back to multithread.ts * fix: log of threadcount --------- Co-authored-by: Nico Flaig <nflaig@protonmail.com> * chore: update references to consensus spec to v1.4.0 (#6704) * chore: update references to consensus spec to v1.4.0 * Remove unintended formatting changes * chore: update consensus spec version in README (#6705) * docs: correct plausible url (#6709) fix: correct plausible url * docs: incorrect scripts location (#6710) fix: incorrect scripts location * docs: no more broken images (#6708) * fix: no more broken images * fix: incorrect paths * feat: check aggregationBits length of `SignedAggregateAndProof` in gossip validation (#6700) * Add unit test * Update packages/beacon-node/src/chain/validation/aggregateAndProof.ts Co-authored-by: Nico Flaig <nflaig@protonmail.com> --------- Co-authored-by: Nico Flaig <nflaig@protonmail.com> * feat: add and track blob source for metrics (#6628) * feat: add and track blob source for metrics * adding blobsSource for blobsPromise * address feedback * apply feedback * updates * only allow non blobspromise blocks to be imported * feat: add support for browser bundle for lightclient (#6673) * Reorganize the code so it is accessible from one package * Add support for browser build for lightclient * Update the build config * Improve the bls vite plugin * Restructure the vite and vitest scripts * Simplify vite config * Remove unused polyfill * Fix the doc lint error * Add support for bundle test * Update the package json files * Add dist build to default build task * Fix spelling in the docs * Fix the lint error * Fix type error * Disable eslint errors * Increase the timeout for bundle test * Fix eslint bundle * Fix lint warning * Remove the unused config * Add the default export to bundle * Enable compression on th build * Update packages/light-client/README.md Co-authored-by: Nico Flaig <nflaig@protonmail.com> * Increase timeout for one test * Optimize package build task * Update the readme --------- Co-authored-by: Nico Flaig <nflaig@protonmail.com> * docs: fix plausible domain (#6712) * ci: add paths-ignore to workflows (#6713) * chore: added paths-ignore * chore: address comments * feat: add arm64 binary support (#6707) * feat: add arm64 binary support * chore: workaround yarn * chore: add comment * chore: workaround runner limitations * ci: publish binaries for release candidates (#6714) * feat: add types support to esm bundle for lightclient (#6685) * Add vite dts plugin * Restructure types export * Update vite build config * Remove unused file * Update the build process * Fix doc formatting * Build the dist for type tests * chore: update vitest (#6718) Update vitest * chore: do not build all binaries atomically (#6719) * feat: update libp2p deps (#6711) * feat: update libp2p deps * chore: fix linter/type errors * chore(deps): bump ejs from 3.1.9 to 3.1.10 (#6721) Bumps [ejs](https://github.com/mde/ejs) from 3.1.9 to 3.1.10. - [Release notes](https://github.com/mde/ejs/releases) - [Commits](mde/ejs@v3.1.9...v3.1.10) --- updated-dependencies: - dependency-name: ejs dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore: revert "ci: add paths-ignore to workflows (#6713)" (#6730) Revert "ci: add paths-ignore to workflows (#6713)" This reverts commit e460bb1. * docs: restore docs pages lost during docusaurus migration (#6725) * ci: fix incorrect build caching (#6731) fix: incorrect build caching * fix: build error log during esm bundle build (#6737) Fix build error * chore: update fastify to v4.27.0 (#6740) * deps: upgrade vitest minor version (#6745) Upgrade vitest * chore: warn when heap limit is too low (#6722) * chore: warn when heap limit is too low * chore: units Co-authored-by: Nico Flaig <nflaig@protonmail.com> * chore: address comments * chore: added faq element * chore: address comments Co-authored-by: Nico Flaig <nflaig@protonmail.com> * chore: address comments Co-authored-by: Nico Flaig <nflaig@protonmail.com> * chore: address comments --------- Co-authored-by: Nico Flaig <nflaig@protonmail.com> * feat: disable flood publish (#6755) * feat: disable flood publish * feat: add network.disableFloodPublish cli flag * chore: address PR comments * test: allow compact diff for test failures (#6783) * Allow the compact diff for tests * Update the doc * Update docs/pages/contribution/testing/index.md Co-authored-by: Julien <jeluard@users.noreply.github.com> * Fix linting on docs * Fix linting --------- Co-authored-by: Julien <jeluard@users.noreply.github.com> * chore: upgrade classic-level (#6793) * chore: upgrade classic-level * chore: address comments * feat(prover): support non-mutated verification provider in prover (#6727) * Restructure the assertions * Add an inspector to run the logic to detect providers * Update web3 provdier logic to use inspetor * Fix the types for proxy * Make the default type for mutation * Rename elrpc to elrpcprovider * Apply suggestions from code review Co-authored-by: Julien <jeluard@users.noreply.github.com> * Fix build error * Update the readme doc * Apply suggestions from code review Co-authored-by: Julien <jeluard@users.noreply.github.com> * Fix the docs linting * Add missing words --------- Co-authored-by: Julien <jeluard@users.noreply.github.com> * docs: added debugging section (#6743) * docs: added debugging section * chore: spell checks * chore: added extra docs * chore: address comments * chore: added extra configuration * chore: updated docs * chore: added extra configuration * chore: fix lint * chore: fix typos * chore: .gitignore * chore: address comments * chore: address comments * chore: review debugging section PR (#6807) * chore: update the naming conventions used in sim tests (#6805) * Rename simulation test to crucible * Rename SimulationEnvironment to Simulation * Use consistent function names * Update readme * Rename interfaces for consistent pattern * Fix lint error * feat: recognize grandine from agentVersion (#6808) * Add grandine * add grandine to wordlist * chore: refactor event loop interactions (#6806) * chore: refactor sleep(0) usage * chore: refactor setTimeout * chore: address comments * chore: cleanup * Apply suggestions from code review --------- Co-authored-by: Cayman <caymannava@gmail.com> * chore: fix broken docker (#6813) * chore: log newPayload engine api (#6810) * chore: add `get_proposer_head` check in fork choice spec test (#6814) * Check get_proposer_head * Fix enum typo * lint * chore: consolidate classic-level usage (#6795) * chore: do not rely on leveldown * chore: replace level with classic-level * chore: added docker support for osx (#6696) * chore: added docker support for osx * chore: address comments * chore: address comments * Update docker-compose.yml Co-authored-by: Nico Flaig <nflaig@protonmail.com> * chore: address comments --------- Co-authored-by: Nico Flaig <nflaig@protonmail.com> * chore: fix vitest performance with spec tests artifacts in place (#6817) Fix vitest performance with spec tests in place * chore: clean up yarn lockfile (#6816) * feat: disable flood publish by default (#6815) * feat: use @chainsafe/blst directly (#6706) * feat: use @chainsafe/blst directly * chore: update to blst@1.0.1 * refactor: remove randomBytesNonZero and user blst exported version * chore: update blst references * test: catch invalid deserialization in spec tests and return false * feat: create signatureFromBytes and signatureFromBytesNoCheck in utils package * feat: implement signatureFromBytes from utils package * feat: implement signatureFromBytes everywhere * fix: light-client empty module for blst --------- Co-authored-by: matthewkeil <me@matthewkeil.com> * fix: avoid Buffer.from copies (#6723) * fix: avoid Buffer.from copies * chore: simplify shuffling * fix: use subarray instead of slice in shuffling * chore: remove unnecessary devDependencies * chore: rely on fastify 4.x behavior * chore: avoid copy in verifyMerkleBranch * use toBase64 * relax assertions in shuffle function * Update packages/state-transition/src/util/shuffle.ts Co-authored-by: twoeths <tuyen@chainsafe.io> --------- Co-authored-by: twoeths <tuyen@chainsafe.io> * chore: update nodejs to latest 22 (#6729) * Upgrade node js version to 22 * Update node types * Revert action config * Add package from git hash * Fix the build error * Update the docs for node-22 * Update docker version for Nodejs to 22 * Update package.json * Update package.json Co-authored-by: Nico Flaig <nflaig@protonmail.com> * Update readme docs * Add word in dictionary * Add word in dictionary --------- Co-authored-by: Cayman <caymannava@gmail.com> Co-authored-by: Nico Flaig <nflaig@protonmail.com> * deps: update systeminformation to 5.22.9 (#6823) * chore: add distutils to build phase of Dockerfile (#6845) * test: increase timeout of keystore tests (#6846) * test: increase timeout of keystore cache tests * Increase hook timeout * Consistent number formatting * chore: only log warning if media type is not supported (415) (#6847) * fix: revert napi bls (#6853) * Revert "feat: use @chainsafe/blst directly (#6706)" This reverts commit 66fe753. * Revert "feat: switch bls to napi rebuild (#6616)" This reverts commit 97d9aa8. * chore: bump package versions to 1.19.0 * chore: bump @chainsafe/blst to v0.2.11 (#6856) * fix: arm64 binaries creation issue (#6858) --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: tuyennhv <tuyen@chainsafe.io> Co-authored-by: Julien <jeluard@users.noreply.github.com> Co-authored-by: Nico Flaig <nflaig@protonmail.com> Co-authored-by: Matthew Keil <me@matthewkeil.com> Co-authored-by: NC <adrninistrator1@protonmail.com> Co-authored-by: g11tech <develop@g11tech.io> Co-authored-by: Nazar Hussain <nazarhussain@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
🎉 This PR is included in v1.19.0 🎉 |
Motivation
Wanted to publish the simulation framework as public package. So this naming refactor will make it easier to understand.
Description
simulation framework
tocrucible
SimulationEnvironment
toSimulation
Steps to test or reproduce