mirror of
https://github.com/ChainSafe/lodestar.git
synced 2026-01-10 08:08:16 -05:00
**Motivation** Replace deprecated Holesky network support with Hoodi testnet configuration. Hoodi is a new Ethereum testnet that will serve as a replacement testnet, and this change updates Lodestar to support the new network configuration. **Description** This PR removes Holesky network configuration and replaces all references with Hoodi testnet support. Changes include: - Removed `packages/cli/src/networks/holesky.ts` network file - Removed `packages/config/src/chainConfig/networks/holesky.ts` chain config - Updated all network references from "holesky" to "hoodi" across CLI, config, and test files - Added Hoodi network configuration with proper chain parameters, genesis data, and bootnodes - Updated default environment configuration - Updated unit tests to reflect the network change <!-- Link to issues: https://github.com/ChainSafe/lodestar/issues/8595 --> Closes #https://github.com/ChainSafe/lodestar/pull/8615 **AI Assistance Disclosure** - [ ] External Contributors: I have read the [contributor guidelines](https://github.com/ChainSafe/lodestar/blob/unstable/CONTRIBUTING.md#ai-assistance-notice) and disclosed my usage of AI below. <!-- Insert any AI assistance disclosure here --> -PR content was developed using Cursor for code updates and explanations; I reviewed and verified all changes manually.
@lodestar/era
This package is part of ChainSafe's Lodestar project
Usage
This package provides functionality to read and write era files, which are based on the e2store format.
Reading/Writing e2s files
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;
Reading era files
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].blocksIndex?.startSlot ?? 0;
// 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();
Writing era files
import {era} from "@lodestar/era";
import {config} from "@lodestar/config/default";
import {SignedBeaconBlock, BeaconState} from "@lodestar/types";
const writer = await era.EraWriter.create(config, "path/to/era", 0);
// similar api to reader, can write compressed, serialized, or deserialized items
// first write all blocks for the era
// Assuming `block` is a SignedBeaconBlock
declare const block: SignedBeaconBlock;
await writer.writeBlock(block);
// ...
// then write the state
// Assuming `state` is a BeaconState
declare const state: BeaconState;
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();
License
Apache-2.0 ChainSafe Systems