**Motivation**
- tracks #7048
-
[era](https://github.com/eth-clients/e2store-format-specs/blob/main/formats/era.md)
specs.
**Description**
- Adds functionality to read/write to
[e2s](613f4a9a50/docs/e2store.md (era-files))
files
```ts
import {open} from "node:fs/promises";
import {e2s} from "@lodestar/era";
const fh = await open("mainnet-xxxxxx-xxxxxxxx.era");
const entry = await e2s.readEntry(fh, 0);
entry.type == e2s.EntryType.Version
```
- Adds functionality to read/write era files
```ts
import {era} from "@lodestar/era";
import {config} from "@lodestar/config/default";
// open reader
const reader = await era.EraReader.open(config, "mainnet-xxxxx-xxxxxxxx.era");
// check number of groups
reader.groups.length === 1;
// read blocks
const slot = reader.groups[0].startSlot;
// return snappy-frame compressed, ssz-serialized block at slot or null if a skip slot
// throws if out of range
await reader.readCompressedBlock(slot);
// same, but for ssz-serialized block
await reader.readSerializedBlock(slot);
// same but for deserialized block
await reader.readBlock(slot);
// read state(s), one per group
// similar api to blocks, but with an _optional_ eraNumber param for specifying which group's state to read
await reader.readCompressedState();
await reader.readSerializedState();
await reader.readState();
// write era files
const writer = await era.EraWriter.create(config, "path/to/era");
// similar api to reader, can write compressed, serialized, or deserialized items
// first write all blocks for the era
await writer.writeBlock(block);
// ...
// then write the state
await writer.writeState(state);
// if applicable, continue writing eras of blocks and state (an era file can contain multiple eras, or "groups" as the spec states)
// when finished, must call `finish`, which will close the file handler and _rename_ the file to the spec-compliant name
await writer.finish();
```
- e2e test reads an era file, does all validation, writes an era fila,
does validation on that freshly created file
- requires the era file fixture to be downloaded (`cd packages/era/test
&& ./download_era_file.sh`)
- e2e test is skipped (`test:e2e` is not defined for the era package)
---------
Co-authored-by: Cayman <caymannava@gmail.com>
**Motivation**
The ValidatorMonitor should be moved out of metrics into the BeaconChain
object.
**Description**
- Move ValidatorMonitor from the Metrics to the BeaconChain Object.
- Delete `registerValidatorStatuses()` from the
BeaconStateTransitionMetrics type.
Closes#7624
**Steps to test or reproduce**
---------
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
* 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>
* Add support for run simulation env in child process
* Update the simulation node runner
* Add assertions placeholders
* Update assertions for single node
* Update simulation env for the multiple nodes
* Updaate the assertions for single node
* Updat asssertions for multiple nodes
* Add a simulation test for four nodes
* Add --dev option for testing environment
* Fix linting errors
* Update code as per feedback
* Update the execution.engineMock to be optional
* Add fork detection test
* Update forks tests
* Update the assertions to split in multiple files
* Add sim tests to the pipeline
* Fix lint error
* Update the simulation log format
* Add simulation tracker
* Skip the multi node test for now
* Updte the assertions style
* Update tests structure to run in sequence
* Fix the issues after rebase
* Update the export
* Improve the stats printing
* Update the logging for the sim tests
* Update the logs to hide rc config
* Update the usage of far future epoch value
* Update the fork tests to check the finality
* Add external signer support
* Skip the multi-node test
* Update the assertions style
* Update the node tests structure
* Update the nodes numbers
* Update the logging for childprocess
* Remove existing sim tests for same scenarios
* Update the logging for the process loading
* Remove duplicate sim tests
* Increase genesis delay to not miss slots on CI server
* Update simulation id
* Update acceptableParticipationRate to 70%
* Update the calculation for calcultating participation
* Update the event wait logic for multiple nodes
* Remove the extra log
* Fix forkchoice bug for low pivot slot
* Update the simulation env trackers
* Fix multi node key index
* Update simulations to use longer epochs
* Revert unused changes
* Update assertion messages
* Revert change for minimal param preset
* Update test description
* Remove unused code
* Adopt gitflow for Lodestar releases
* Apply feedback
* Replace most mentions of `master` with `unstable`
* Tweak various parts of RELEASE.md
* Update CI
* Tweak dev release version handling
* Tweak workflow names
* Replace `nightly` with `dev`
* Replace `beta` with `rc`
* Fix publish for rc release and stable release only
* Remove stray "beta"
* Add code examples to RELEASE.md
* Clarify publish process
* Collapse 'Alternatives considered' section
* Move 'Details' header up one level
* Clarify publishing a release
* Tweak headings
* Fix hotfix section
* More clarifications
* Update examples in RELEASE.md
* More clarifications
* Fix formatting
* Run RELEASE.md through grammarly
* Change script name to release:publish
* Add create_rc script
* Add workflow_dispatch for create RC
* Add placeholder for other scripts
* Update RELEASE.md
* Update release create rc script
* Update script instructions
* create_rc script must not be run in CI
* Update release flow
* Add publish-rc workflow
* Apply suggestions from code review
Co-authored-by: Afr Schoe <58883403+q9f@users.noreply.github.com>
Co-authored-by: Cayman <caymannava@gmail.com>
Co-authored-by: Afr Schoe <58883403+q9f@users.noreply.github.com>
* Basic range sync perf test
* Benchmark initial sync
* Add INFURA_ETH2_CREDENTIALS to benchmark GA
* Download test cache file from alternative source
* Re-org beforeValue and testCase helpers
* Break light-client - state-transition test dependency
* Revert adding downloadTestCacheFile
* Download files from a Github release
* Move spec tests to main lodestar package
* Use spec test mocha rc
* Fix specTestVersioning import
* Fix test types
* Fix spec tests path
* Fix relative location of spec test coverage
* WIP
* Refactor lightclient server db repositories
* WIP Lightclient refactor
* Lightclient tracking head
* Fix branch proof sorting
* Move lightclient code to package root
* Move LightclientServer code to module index
* Add e2e test and fix bugs
* Log sync committee periods
* Sync 3 periods
* Clean logging in LC
* Fix broken tests
* Rename getCommitteeUpdates route
* Use getStateV2 to download altair states
* Remove blockRoot from LightclientHeaderUpdate
* Polish lightclient
* Remove clock
* Remove beacon state transition dependency
* Add mock sync test
* Change getStateProof to GET
* Deprecate un-used db buckets
* Test fetching proofs on lightclient head state
* Test fetching proofs in sim test
* Test query serializtion
* Fix proof paths serdes in api
* Use Promise.all in storeSyncCommittee
* Rename finalizedHeader to checkpointHeader
* Remove genesisWitness
* Remove genesis proof dead code
* Rename lightclient_update to lightclient_header_update
* Pass only checkpoint root
* Use console levels in getLcLoggerConsole
* Remove stateProofPaths dead code
* Rename to initializeFromCheckpointRoot
* lightclient snapshot type has a single SyncCommittee
* Simplify tree position constants
* Log 'New sync committee period' message only once
* Add benchmark action
* Pass argument to script
* Pass option via CLI arg
* Bump benchmark
* Polish perf tests
* Add more data to test ids
* Fix id formating
* Speed-up perf test start-up time
* Cache interop pubkeys to disk
* Remove unnecessary promises
* Remove unused perf utils
* Minimize BLS opts in perf tests
* Use optimized state creation on all perf tests
* Add comment about sources