356 Commits

Author SHA1 Message Date
Phil Ngo
3bf4734ba9 chore: merge v1.38.0 stable back to unstable (#8694) 2025-12-15 11:08:40 -05:00
Nico Flaig
889b1c4475 chore: remove merge transition code (#8680)
**Motiviation**

All networks have completed the merge transition and most execution
clients no longer support pre-merge so it's not even possible anymore to
run a network from a genesis before bellatrix, unless you keep it to
phase0/altair only, which still works after this PR is merged.

This code is effectively tech debt, no longer exercised and just gets in
the way when doing refactors.

**Description**

Removes all code related to performing the merge transition. Running the
node pre-merge (CL only mode) is still possible and syncing still works.
Also removed a few CLI flags we added for the merge specifically, those
shouldn't be used anymore. Spec constants like
`TERMINAL_TOTAL_DIFFICULTY` are kept for spec compliance and ssz types
(like `PowBlock`) as well. I had to disable a few spec tests related to
handling the merge block since those code paths are removed.

Closes https://github.com/ChainSafe/lodestar/issues/8661
2025-12-12 10:18:23 +07:00
philknows
62d3e49f28 chore: bump package versions to 1.38.0 2025-12-10 11:44:00 -05:00
Progress Ochuko Eyaadah
868300d7ae chore: remove holesky configs and update tests to hoodi (#8622)
**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.
2025-12-08 15:44:36 +01:00
philknows
2303b06a91 chore: bump package versions to 1.37.0 2025-11-28 10:17:20 -05:00
philknows
6eb05a083a chore: bump package versions to 1.36.0 2025-11-04 12:28:29 -05:00
Matthew Keil
f3703b7882 feat: signature verification for reqresp DA (#8580)
**Motivation**

Spec will be updated to have check of signatures via reqresp. Proacative
fix inline with Lighthouse and Prysm

https://github.com/sigp/lighthouse/issues/7650
2025-11-03 21:36:47 +00:00
Nico Flaig
d4044b6621 feat: schedule fulu and BPOs on mainnet (#8590)
- https://github.com/ethereum/consensus-specs/pull/4689
2025-10-30 16:41:31 -07:00
Nico Flaig
9f2bb12ea7 feat: activate fulu on ephemery (#8587)
**Motivation**

Our config is stale and we cannot join the network anymore via
`--network ephemery` flag

**Description**

Update Ephemery config to start from Fulu genesis

Includes changes from
https://github.com/ephemery-testnet/ephemery-genesis/pull/61 and
https://github.com/ephemery-testnet/ephemery-genesis/pull/71

**Steps to test or reproduce**

```bash
./lodestar beacon --network ephemery --dataDir ~/data/ephemery --execution.engineMock --eth1 false
```
2025-10-29 16:26:16 -04:00
Nazar Hussain
a0d00ac6dc chore: cleanup types exports for all packages (#8434)
**Motivation**

Make the types exports consistent for all packages. 

All modern runtimes support [conditional
exports](https://nodejs.org/api/packages.html#conditional-exports) and
there are caveats when we have both conditional exports and normal
exports present in a package.json. This PR tend to make all exports
follow same consistent and modern pattern.

**Description**

- We were using subpath exports for some packages and module exports for
other
- Keep all the types export consistent as subpath exports.
- Remove "types" and "exports` directive from package.json 
- Remove `typesVersions`, this is useful only if we have different
version of types for different versions of Typescript. Or having
different types files for different file paths.


**Steps to test or reproduce**

- Run all CI
2025-10-20 09:03:08 -04:00
Nico Flaig
598c1ec54e feat: update networking config to match CL spec (#8510)
**Motivation**

Conform to CL spec

**Description**

- move networking constants to config
- remove constants no longer part of spec
- enable "p2p-interface.md" in config test

Closes https://github.com/ChainSafe/lodestar/issues/6351
Closes https://github.com/ChainSafe/lodestar/issues/7529
2025-10-13 14:44:41 +01:00
philknows
825a186b76 chore: bump package versions to 1.35.0 2025-10-08 18:10:13 -04:00
Nico Flaig
643707ecd3 fix: update gnosis slot duration ms to 5000 (#8512) 2025-10-08 23:03:16 +01:00
Nico Flaig
901d719660 chore: add gloas fork constants to unscheduled networks (#8484)
This avoids an issue we had previously where configs that extend mainnet
preset would inherit wrong parameters. This just ensures this cannot
happen in case we those will be forked after mainnet.

similar to https://github.com/ChainSafe/lodestar/pull/7401
2025-09-30 23:31:07 +08:00
Nico Flaig
47470aab65 chore: remove remaining usage of SECONDS_PER_SLOT (#8476)
Follow up on https://github.com/ChainSafe/lodestar/pull/8091 to clean up
remaining usage of `SECONDS_PER_SLOT`.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-09-26 19:45:55 +01:00
Nico Flaig
c1880f6940 chore: add gloas timings to slot time functions (#8474) 2025-09-26 09:06:57 -04:00
NC
39be8f0882 feat: use bps instead of INTERVALS_PER_SLOT for deadlines (#8091)
Closes #8013

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-09-25 19:01:20 -07:00
Nazar Hussain
8689cc3545 chore: add src to the package to have working source map (#8460)
**Motivation**

Add `src` directory to package sources along with the `lib` files to
have working source map.

**Description**

- Add `src` to the files.


**Steps to test or reproduce**

- Run all tests
2025-09-25 07:23:58 -04:00
Cayman
6494939cd0 chore: add bun exports to packages (#8448)
**Motivation**

- #7280 

**Description**

- Add `"bun"` export to all packages that points to the _typescript
source_ rather than the transpiled javascript
- Allows for bun to use typescript directly
2025-09-23 12:19:11 +01:00
NC
e18102ed8c feat: add presets and configs for ePBS (#8440)
Part of #8439
2025-09-23 11:48:46 +01:00
Nazar Hussain
feed916580 chore: enable organize imports for linting (#8410)
**Motivation**

Enable the organize import back which was disabled in #7982 to isolate
the changes for import ordering

**Description**

- Update the organize import config 
- Fix all linting errors

**Steps to test or reproduce**

- Run all tests

---------

Co-authored-by: Cayman <caymannava@gmail.com>
2025-09-19 19:59:28 -04:00
Phil Ngo
3d8b04e1a0 feat: schedule fulu and BPOs on sepolia and hoodi (#8437)
**Motivation**

This PR schedules Fulu fork and BPO1 and BPO2 on remaining testnets
Sepolia and Hoodi.

**Description**

Updates network configs for Fulu fork
Includes BPO1 and BPO2 configs
For both Sepolia and Hoodi

As defined in Sepolia: https://github.com/eth-clients/sepolia/pull/111
As defined in Hoodi: https://github.com/eth-clients/hoodi/pull/21

Wait for confirmation of these remaining testnets configs before
merging.
2025-09-19 14:30:48 -07:00
Nico Flaig
48a8beea92 feat: schedule fulu and BPOs on holesky (#8435)
See https://github.com/eth-clients/holesky/pull/132
2025-09-19 08:58:47 -04:00
Nico Flaig
56313c7299 chore: remove getMaxRequestBlobSidecars helper from config object (#8418)
The `getMaxRequestBlobSidecars` helper is only relevant for deneb and
electra and we no longer will have to update the conditional. It
shouldn't be part of config object as it will be legacy code once fulu
is activated.
2025-09-17 07:49:25 -04:00
Phil Ngo
86490969b7 chore: bump package versions to 1.34.1 2025-09-10 16:34:42 -04:00
Phil Ngo
1a17514b02 chore: bump package versions to 1.34.0 2025-09-05 12:24:08 -04:00
Nico Flaig
d9fc7bb103 fix: move MAX_REQUEST_BLOCKS constants to config (#8262)
**Motivation**

Follow CL spec

**Description**

Move `MAX_REQUEST_BLOCKS` and `MAX_REQUEST_BLOCKS_DENEB` constants to
config

Closes https://github.com/ChainSafe/lodestar/issues/8249
2025-08-26 10:22:53 +01:00
Nazar Hussain
b9950594aa refactor: remove cpu features direct dependency (#8261)
**Motivation**

Make the code transition for compatibility with the Bun. 

**Description**

- The dependency `cpu-features` is not compatible with the `Bun`
- Removed the direct dependency
- Upgrade the `@chainsafe/persistent-merkle-tree` and `@chainsafe/ssz`
so the hasher detection is done implicitly.
- Latest commit for
[hahstree](e86a8b136a)
has the support for fallback, which is not used in the
`@chainsafe/persistent-merkle-tree`


**Steps to test or reproduce**

Run all tests
2025-08-25 17:22:23 -04:00
NC
8d743ffafc feat: add gloas fork definition (#8222)
Add boilerplate code for gloas
2025-08-19 09:57:04 +01:00
Nico Flaig
1968319c71 fix: move fulu constants to preset/config to be spec compliant (#8217)
**Motivation**

We are missing a few spec constants from our config. This causes issues
with Dora as noted in https://github.com/ChainSafe/lodestar/pull/8053
and also means it is not possible to configure the values of those
constants at runtime.

**Description**

Move constants to preset/config to be spec compliant

Closes https://github.com/ChainSafe/lodestar/issues/8109
2025-08-18 09:43:14 -04:00
Cayman
aac4d9d864 Merge branch 'peerDAS' into unstable 2025-08-11 13:40:27 -04:00
Nico Flaig
5bc821a090 fix: remove node custody requirement (#8099)
This removes `NODE_CUSTODY_REQUIREMENT` config value as it doesn't seem
to be part of the spec. It seems like the purpose of this config right
now is to be able to pass down supernode requirements (ie. setting
requirement to 128) and potentially allow to override the custody
requirement for testing but this is a misuse how config should be
handled.

As discussed with @matthewkeil we don't need to manually set node
custody requirement or disable validator custody anymore and rather just
rely on `--supernode` flag to custody all groups or dynamic validator
custody.
2025-08-04 02:32:32 -04:00
Phil Ngo
7afce97ce3 chore: bump package versions to 1.33.0 2025-07-31 15:05:32 -04:00
Phil Ngo
36dbfb2cfe chore: bump package versions to 1.32.0 2025-07-09 14:35:57 -04:00
Nico Flaig
48f2ff71ae feat: modify fork digest to distinguish BPO forks (#8022)
**Motivation**

- https://github.com/ethereum/consensus-specs/pull/4354

**Description**

- add concept of fork boundaries (`ForkBoundary`) which include both
normal hard-forks (phase0, altair, etc.) and Blob Parameter Only (BPO)
forks and are used to un-/subscribe to gossip topics and compute the
fork digest primarily for domain separation on the p2p layer
- mix in blob parameters (`BlobParameters`) when computing fork digest
(`computeForkDigest`) post-fulu
- update ENR fork id (`ENRForkID`) to consider fork boundaries (next
fork digest (`nfd`) will be updated in
https://github.com/ChainSafe/lodestar/pull/8023)
- cache pre-computed fork digests by epoch instead of fork name in
genesis config cache

---------

Co-authored-by: NC <17676176+ensi321@users.noreply.github.com>
2025-07-08 08:55:39 -07:00
NC
6fa9960988 feat: validate blob schedule on startup (#7942)
We should validate the correctness of blob schedule in addition to its
format when parsing it.


Relevant spec ethereum/consensus-specs#4370

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-06-11 09:25:11 +02:00
Nico Flaig
b4d490c7e7 chore: remove stale comment about default max blobs limit (#7907)
**Motivation**

We are no longer backporting the blob schedule to deneb/electra which
means once we reach fulu we will default to
`MAX_BLOBS_PER_BLOCK_ELECTRA` if there is no blob schedule entry for the
fulu fork epoch which is very likely as we wanna bump blobs a bit later,
hence the comment that default / fallback is only used during testing is
no longer true.

**Description**

Remove stale comment about default max blobs limit
2025-06-04 16:47:20 +02:00
Phil Ngo
8847b4a92b chore: bump package versions to 1.31.0 2025-06-03 14:16:18 -04:00
Cayman
b819263288 chore: bump ssz to v1.2.1 (#7894)
**Motivation**

- chainsafe/ssz#489

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-05-30 16:03:33 +00:00
Nico Flaig
3c7d6d1687 chore: remove deneb/electra entries from blob schedule (#7888)
**Motivation**

The PR to backport blob schedule to deneb/electra
(https://github.com/ethereum/consensus-specs/pull/4313) has been closed
and the entries for deneb/electra have been removed from CL spec as well
since https://github.com/ethereum/consensus-specs/pull/4341.

**Description**

- Remove blob schedule entries for deneb/electra
- Update `getMaxBlobsPerBlock` to default to electra limit
- Only return `BLOB_SCHEDULE` from `GET /eth/v1/config/spec` api if fulu
is scheduled
2025-05-28 15:21:52 -07:00
Nico Flaig
33ca09539b fix: add special handling for blob schedule when asserting equal params (#7859)
**Motivation**

Follow up to https://github.com/ChainSafe/lodestar/pull/7729, we need to
handle blob schedule separately from generic string comparison of
values, otherwise what we compare are shallow stringified arrays. It
does not validate the object properties and on length mismatch we just
get the following error

```
✖ Error: Local and remote configs are different
BLOB_SCHEDULE different value: [object object] != [object object],[object object]
```

**Description**

Add special handling for blob schedule when asserting equal params
- deserialize and sort blob schedules
- compare length of local and remote blob schedule
- then check each entry by comparing `EPOCH` and `MAX_BLOBS_PER_BLOCK`
2025-05-27 14:16:44 +01:00
Nico Flaig
2b54941538 chore: add blob schedule to each network config (#7858)
**Motivation**

Follow up to https://github.com/ChainSafe/lodestar/pull/7729, we need to
configure blob schedule for each network. This will become relevant once
we fully backport blob schedule to deneb and electra.

**Description**

Add blob schedule to each network config
2025-05-22 13:11:25 -07:00
NC
011a0c4b89 feat: implement BPO EIP-7892 (#7729)
Relevant spec ethereum/consensus-specs#4277 and
https://github.com/ethereum/beacon-APIs/pull/529

Implement EIP-7892 as laid out in v1.6.0-alpha.0 for fusaka devnet-0.
Any open spec PR which is not within the scope of devnet-0 will be
implemented in a follow up PR

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-05-21 11:27:28 +01:00
Phil Ngo
123eb2d9fb chore: bump package versions to 1.30.0 2025-05-09 12:15:00 -04:00
Phil Ngo
3ebe983765 chore: update beacon api and consensus spec refs post electra (#7804)
**Motivation**

This PR is to update specification references for new Beacon APIs
(v3.1.0) and Consensus specs (v2.5.0) released post-Electra.

**Description**

Closes https://github.com/ChainSafe/lodestar/issues/7463
2025-05-07 15:16:48 -04:00
Nico Flaig
fa898bb319 chore: restructure tests (#7793)
Follow up to https://github.com/ChainSafe/lodestar/pull/7610 with a few
restructuring suggestions, see comments below for detailed changes,
revives constants tests we are no longer running in CI and makes each
package executable separately again, ie. `cd packages/<package-name>`
into `yarn test:unit` works for all packages again.

One major change is that unit tests default should be written with
`mainnet` preset in mind as I noticed that makes a lot more sense for a
bunch of existing tests, eg. we have tests that depend on external
fixtures, like api spec tests for events and those are not compatible
with `minimal` preset. Also there doesn't seem to be much downside in
most cases for unit tests to use `mainnet` preset as it does not run
through all the epoch, like for example a e2e or sim test does. So
overall, it allows us to use mainnet fixtures / more "real world" data
which seems better with little to no downside.


Time comparison running unit tests on `unstable` vs. this branch

**unstable**

![image](https://github.com/user-attachments/assets/ba9c8e68-ec1a-4cb7-90fc-eb00cedae4bf)

**nflaig/restructure-tests**

![image](https://github.com/user-attachments/assets/0ffab5a4-4a71-42e1-a26e-32fc5627b873)

There is just a difference of 2 seconds (might be a fluke) in a 6 minute
run, this seems acceptable to me considering the benefits of using
`mainnet` preset noted above.
2025-05-07 18:21:12 +01:00
Cayman
986551d3a2 feat: fulu types (#7774)
**Motivation**

- prep for block input refactor
- 
**Description**

- pull fulu types out of `peerDAS` branch

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
Co-authored-by: Matthew Keil <me@matthewkeil.com>
2025-05-04 12:56:45 -04:00
Nico Flaig
185bc833d0 chore: update gnosis MAX_BLOBS_PER_BLOCK to match upstream config (#7785)
**Motivation**

This can cause interop issues if Lodestar is used with other clients
(https://github.com/ChainSafe/lodestar/issues/7764). It's not an actual
problem otherwise anymore. This value was never correct but the problem
was not that we didn't update it correctly but rather Gnosis team
decided to change this value on the fly while the hard fork (Deneb) was
already live on the network but due to the fact that blob count is
limited by EL as well this was never an issue and won't be now because
we use `MAX_BLOBS_PER_BLOCK_ELECTRA` but in theory this could have
caused a consensus split if clients use different values (which they
did).

**Description**

Update gnosis `MAX_BLOBS_PER_BLOCK` to [match upstream
config](d447a94bbe/mainnet/config.yaml (L140))

Closes https://github.com/ChainSafe/lodestar/issues/7765
2025-05-02 19:30:26 +01:00
Nazar Hussain
c91cd9c141 test: use vitest workspace to run all tests (#7610)
**Motivation**

Vitest workspaces is feature to mimic the package manager workspaces for
the tests only.

It provides following benefits:

1. Minimize the need the bunch of config files at every package root 
2. Consolidate vitest configuration in project groups
3. Use consistent test configuration for all projects in the monorepo
4. Providing consistent test environment for all packages
5. Speed up visual interaction with tests in the IDEs (e.g. Visual
Studio Code)

**Description**

- Remove all unnecessary config files
- Update package json scripts to use `--project` flag

Closes #7603


Now we have following test directories. 

| Directory | Description | CurrentPreset | Old Preset | 
|---|---|---|---|
| test/unit | Unit tests | minimal | Default export from `params`
package |
| test/unit-mainnet | Unit tests | mainnet | mainnet | 
| test/e2e | End-to-End Tests | minimal | Default export from `params`
package |
| test/e2e-mainnet | End-to-End Tests | mainnet | Never existed before,
mixed up pattern in different packages |
| test/spec | Spec tests | minimal | Default export from `params`
package, but common perception among team was that it's running with
`minimal` |
| test/spec-mainnet` | Spec tests | mainnet | Never existed as
directory, but mixed up among packages |
| test/browser | Symlink to `unit` for packages which supports browsers
| minimal | Default export from `params` package |
| test/types | Types test | minimal | Default export from `params`
package |


**Steps to test or reproduce**

Run all tests
2025-04-22 11:33:36 +02:00
Nico Flaig
51613f0fb0 chore: bump package versions to 1.29.0 2025-04-19 16:27:49 +01:00