341 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
NC
1f2a3a4524 feat: implement epbs state transition (#8507)
Implement epbs state transition function.

Passes all operations, epoch_transition and rewards spec tests on v1.6.1

Part of #8439

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-12-04 08:35:47 -08:00
Cayman
362bd5ea5d feat: support and test node 24 (#8645)
**Motivation**

- Support the latest LTS

**Description**

- support node 24

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-12-03 13:32:11 -05:00
philknows
2303b06a91 chore: bump package versions to 1.37.0 2025-11-28 10:17:20 -05:00
NC
d048e9aee4 feat: enable gloas spec tests (#8609)
Enable gloas spec test and skip any non-ssz_static gloas tests.

Also skipping `ForkChoiceNode` because it is not necessary. See
https://discord.com/channels/595666850260713488/874767108809031740/1420966514709889084

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-11-06 14:40:13 -08:00
philknows
6eb05a083a chore: bump package versions to 1.36.0 2025-11-04 12:28:29 -05:00
Nico Flaig
f1c85decbb chore: update gnosis preset (#8593) 2025-11-03 08:49:58 -05: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
894daf8b44 fix: return spec constants starting with 0x as hex strings instead of decimal (#8495)
- Closes https://github.com/ChainSafe/lodestar/issues/7710

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-10-06 15:44:37 +08:00
NC
fcf8d024ea feat: add gloas containers (#8464)
Add gloas containers and minimal change to gloas type. 

All remaining gloas type update will be in the next PR

Part of #8439
2025-09-26 17:02:42 +01: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
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
Barnabas Busa
7f2271a1e2 chore: update minimal_config to latest spec (#8232)
**Motivation**

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

**Description**

Update minimal preset to latest spec

Closes https://github.com/ChainSafe/lodestar/issues/8226

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-09-02 21:33:14 +01: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
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
Nico Flaig
1244f930ff chore: post-merge peerDAS branch review (#8187)
Did another sanity check of peerDAS changes after merging it, few minor
things I picked up and fixed.
2025-08-12 15:35:45 +01:00
Cayman
aac4d9d864 Merge branch 'peerDAS' into unstable 2025-08-11 13:40:27 -04:00
Nico Flaig
c6f84eea57 chore: restore isForkBlobs fork guard alias for isForkPostDeneb (#8135)
Follow up on https://github.com/ChainSafe/lodestar/pull/8125 to restore
alias
2025-08-07 15:20:53 +01:00
Matthew Keil
3e833908c8 fix: fulu fork guards (#8125)
**Motivation**

Address peerDAS PR comments
https://github.com/ChainSafe/lodestar/pull/6353#discussion_r2257781772
https://github.com/ChainSafe/lodestar/pull/6353#discussion_r2255212093
https://github.com/ChainSafe/lodestar/pull/6353#discussion_r2255234191
2025-08-07 09:23:31 -04:00
Phil Ngo
7afce97ce3 chore: bump package versions to 1.33.0 2025-07-31 15:05:32 -04:00
Nico Flaig
5a2cffc7e5 Merge branch 'unstable' into nflaig/merge-unstable-jul17 2025-07-17 12:18:45 +01:00
Phil Ngo
36dbfb2cfe chore: bump package versions to 1.32.0 2025-07-09 14:35:57 -04:00
Nico Flaig
9f30766ff4 Merge branch 'unstable' into nflaig/peerDAS-merge-unstable-23-june 2025-06-23 16:22:30 +02:00
Chad
42e678f502 refactor: add types for representing LC Merkle branches (#7889)
[ticket](https://github.com/ChainSafe/lodestar/issues/6324#event-17867515895)

Should be good, lmk if changes needed 

Closes https://github.com/ChainSafe/lodestar/issues/6324

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-06-19 12:03:55 +00:00
Nico Flaig
c530895658 Merge branch 'unstable' into peerDAS 2025-06-09 21:04:53 +01:00
NC
b2b1a6dcb2 feat: add EIP-7917 deterministic proposer lookahead (#7902)
This is the first implementation of EIP-7917. 

We will want to have a plan deprecate proposer caches in `EpochCache`
since Fulu beacon state will carry those information. This will be
addressed in a later PR.

Pending spec release for spec test

Spec PR ethereum/consensus-specs#4190

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-06-09 20:55:38 +01:00
Phil Ngo
8847b4a92b chore: bump package versions to 1.31.0 2025-06-03 14:16:18 -04:00
Nico Flaig
4722be107d Merge branch 'unstable' into te/peerDAS_merge_unstable_may_14 2025-05-21 12:13:18 +01:00
Tuyen Nguyen
d4d0bc5b47 Merge remote-tracking branch 'origin/unstable' into te/peerDAS_merge_unstable_may_14 2025-05-14 16:54:21 +07:00
Phil Ngo
123eb2d9fb chore: bump package versions to 1.30.0 2025-05-09 12:15:00 -04:00
Nico Flaig
4a9c1b124b chore: make *_REQUESTS_PER_PAYLOAD the same for mainnet/minimal (#7768)
- Closes https://github.com/ChainSafe/lodestar/issues/7767
- Bump CL spec tests to
[v1.5.0](https://github.com/ethereum/consensus-specs/releases/tag/v1.5.0)
2025-05-07 16:53:15 -07: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
Nazar Hussain
2ff1784005 chore: remove unused eslint directives (#7803)
**Motivation**

Remove any unused or inactive codebase.

**Description**

Remove all unused eslint directives as we are using `biome` now. 

**Steps to test or reproduce**

Run lint rules and all tests
2025-05-07 17:25:34 +02:00
Nazar Hussain
0eb947d0d0 test: fix few e2e flaky tests (#7762)
**Motivation**

Make our tests more stable on CI. 

**Description**

Fix following flaky tests 

- `packages/beacon-node/test/e2e/network/reqresp.test.ts` 
- [AxiosError: Request failed with status code
429](https://github.com/ChainSafe/lodestar/actions/runs/14731164867/job/41349996153?pr=7762#step:6:10755)


Partially Closes #6358

**Steps to test or reproduce**

- Run all tests on CI
2025-05-07 14:20:08 +02: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
Hugh Cunningham
90611fa923 feat: offload cell proof computation from beacon node (#7686)
**Motivation**

Uses cell proofs from EL `getPayloadsV5` to offload cell proof
construction

Refer to [EIP-7594
spec](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7594.md#networking)
for more on requiring blob transaction senders to compute cell proofs.

[Pending spec
changes](cad4194e3f/src/engine/osaka.md (engine_getpayloadv5))
define updates for `getPayloadsV5` in the execution engine API

**Description**

* add engine_getPayloadV5 to engine API
* avoid computing cell proofs in computeDataColumnSidecars
* rename CELLS_PER_BLOB to CELLS_PER_EXT_BLOB to match spec
* update sszTypes for Fulu BlockContents, SignedBlockContents

Closes #7669

**Other notes**

* implement blobsBundle validation

I've added a validation function for validating `BlobsBundleV2` by
computing cells and batch verifying the cell proofs, but don't currently
call this function. We could validate this data on receiving responses
from the EL or when producing the block body, but we might consider data
from the EL trustworthy and skip costly verification.

---------

Co-authored-by: Matthew Keil <github@mail.matthewkeil.com>
Co-authored-by: matthewkeil <me@matthewkeil.com>
2025-04-29 07:30:34 -04:00
Derek Guenther
f90f622140 feat: validate data column sidecars according to spec (#7719)
**Motivation**

The data column sidecar gossip validation didn't match the spec, so
updated it to cover all cases:
https://github.com/ethereum/consensus-specs/blob/dev/specs/fulu/p2p-interface.md#data_column_sidecar_subnet_id

**Description**

* Also renamed `index` to `subnet` when used for gossip topics, to
distinguish between that and column indexes.

---------

Co-authored-by: matthewkeil <me@matthewkeil.com>
2025-04-25 06:41:52 -04:00
Hugh Cunningham
008adb8ef0 feat: prune expired data column sidecars (#7717)
**Motivation**

implement the same pruning logic used for blob sidecars for data column
sidecars

**Description**

update archiveBlocks to delete data column sidecar data the the node has
stored longer than the minimum required epochs

add config field MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS
2025-04-22 06:19:50 -04: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