Commit Graph

590 Commits

Author SHA1 Message Date
Phil Ngo
be3da48d19 chore: bump package versions to 1.36.0 2025-10-31 15:26:18 -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
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
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
Cayman
ba92bd8a88 feat: add lodestar-bun and bun leveldb binding (#8462)
**Motivation**

- #7280 

**Description**

- update `@types/node` to the latest node v22 version
- add `@lodestar/bun` dependency using git+https (for now! so that we
don't have to republish a bazillion times)
- keep in mind that this requires a manual build/rebuild of the so (via
`cd node_modules/@lodestar/bun && zig build`)
- Add a bun-specific `LevelDbController` which uses
[`@lodestar/bun`](https://github.com/ChainSafe/lodestar-bun)
- Only expose the leveldb controller via a subpath export (and for
tests, as a custom import, like in #8320 )
- add bun bun global override types
2025-09-25 09:23:11 -04: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
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
7931b71e6d fix: stop verifying SECONDS_PER_ETH1_BLOCK on validator startup (#8397)
**Motivation**

See https://github.com/ChainSafe/lodestar/issues/8395 for rationale. 

**Description**

Stop verifying `SECONDS_PER_ETH1_BLOCK` on validator startup to avoid
potential interop issues with other clients.

Closes https://github.com/ChainSafe/lodestar/issues/8395
2025-09-15 09:26:44 -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
098ff4253f chore: remove per committee attestation routine (#8266)
**Motivation**

This code is no longer relevant for post-elecra and was previously only
used to be compatible with Charon DVT middleware, see previous PR
https://github.com/ChainSafe/lodestar/pull/5258 for reference.

**Description**

Remove per committee attestation routine

Closes https://github.com/ChainSafe/lodestar/issues/7981
2025-08-26 17:27:43 +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
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
Nico Flaig
e082a5188a feat: add warning log if slots are skipped by validator client (#8224)
**Motivation**


https://github.com/ChainSafe/lodestar/issues/5314#issuecomment-1799517901

**Description**

Add warning log if slots are skipped by the validator client

Closes https://github.com/ChainSafe/lodestar/issues/5314
2025-08-19 12:58:15 -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
ece38879ec refactor: block proposal cleanup (#8155)
**Motivation**

- address
https://github.com/ChainSafe/lodestar/pull/6353#discussion_r2255325445

**Description**

Our block production and publishing data flow was messy. The data types
and utility functions are jumbled, duplicate functions, differences from
spec functions, etc. To that end, this refactors things that touch this
proposal data flow.

- Tweak the fork-agnostic `BlockContents` type to also include pre-deneb
`BeaconBlock`
  - this allows us to remove `BlockOrContents` variables and types
- Remove `Contents` (It isn't actually needed)
- Collect all `produced*` caches into `blockProductionCache`
- make blinded block reconstruction more typesafe
- Separate blobs+proofs sanity validation from cells+proof sanity
validation
- Delete duplicated `BlobsBundle` type
- Remove duplicate spec function `computeDataColumnSidecars` in favor of
`getDataColumnSidecars*` functions
- Refactor `computeBlobSidecars` into `getBlobSidecars` from the spec

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-08-15 07:31:18 -04:00
Cayman
aac4d9d864 Merge branch 'peerDAS' into unstable 2025-08-11 13:40:27 -04:00
Matthew Keil
ae65362a22 test: peerdas fix interop config (#8145)
**Motivation**

Addressing peerDAS PR comment
https://github.com/ChainSafe/lodestar/pull/6353#discussion_r2257762516
2025-08-08 10:32:39 +01:00
Cayman
5b15233684 Merge branch 'unstable' into peerDAS 2025-08-05 15:26:39 -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
Nico Flaig
19574f87ad fix: don't send validator registrations pre-genesis (#8088)
**Motivation**

There was an [issue on fusaka-devnet-3 builder
flow](https://discord.com/channels/595666850260713488/1399324773758140426)
due to failed validator registrations. The problem was that we already
sent validator registrations pre-genesis and unless the registration
data (fee recipient and gas limit) changes we will keep sending the
cached registration data (as per
https://github.com/ChainSafe/lodestar/pull/4447) which reuses the
previous timestamp. Why this is problematic is because mev-relay will
reject those registrations if [timestamp is before genesis
time](344d5b67d5/services/api/service.go (L2903))
so it will keep rejecting them until we restart the validator client or
change registration data to clear the cache.

**Description**

Don't send validator registrations pre-genesis, ie. only start sending
and caching them once we are in epoch 0. This matches the behavior of
Prysm (see https://github.com/OffchainLabs/prysm/pull/12847) which has
been there for a while. The only downside I can see is that in epoch 0
we might not be able to produce builder blocks in the first few slots
but that is really only relevant for devnets or local kurtosis runs but
either way since mev-relay rejects the registrations anyways there is
not much we can do in that case.
2025-07-28 14:37:45 -04:00
Nico Flaig
e03bda542e Merge branch 'unstable' into peerDAS 2025-07-23 13:51:07 +01:00
Nazar Hussain
ce27087f34 test: setup unit tests for bun runtime (#7971)
**Motivation**

Make our codebase compatible with Bun runtime

**Description**

- Configure Vitest to work along Bun
- Add CI workflow to test Unit tests for Bun

**Steps to test or reproduce**

Run all tests
2025-07-21 13:35:25 +02: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
d9dc44442e feat: increase default gas limit to 45M (#8024)
**Motivation**

From https://x.com/vdWijden/status/1939234101631856969
> Over the last couple of days, all major
[@ethereum](https://x.com/ethereum) clients signalled that they consider
a move to 45M gas per block safe.

We should make it easy for users and just bump the default. 45M seems
like a reasonable increase for now.

**Description**

Increase default gas limit to 45M

Same as https://github.com/ChainSafe/lodestar/pull/7304
2025-07-01 10:55:03 -04:00
Nico Flaig
39890d5ea7 Merge branch 'unstable' into peerDAS 2025-06-13 13:57:47 +02:00
Kaloyan Tanev
0be30f63a9 fix: enable attestation grouping for DVs (#7958)
**Motivation**

Fix for DVs post-electra.

**Description**

Previously from Obol we have required to disable the optimization of
Lodestar that skipped asking for a `committee_index`, because we needed
it for DVs. However, post-electra the `committee_index` should be 0 per
the spec.
2025-06-13 00:52:38 +02:00
Nico Flaig
c530895658 Merge branch 'unstable' into peerDAS 2025-06-09 21:04:53 +01:00
Phil Ngo
672665e350 chore: change remaining package licenses from LGPL-v3 to Apache-2.0 (#7915)
**Motivation**

Discussions were previously ongoing to make our entire monorepo and
packages within Apache-2.0 license. The only remaining packages which
were previously under LGPL-v3 were the beacon node, cli, validator
packages.

**Description**

This PR marks the switch for all packages in the Lodestar monorepository
to be under one license, Apache-2.0 of which the majority of consensus
clients have adopted. This PR:

- Removes any instance of LGPLv3
- Switches all LICENSE to adopt Apache-2.0
- Removes CLA bot signing as part of our contribution.md
2025-06-05 08:13:18 -04:00
Phil Ngo
8847b4a92b chore: bump package versions to 1.31.0 2025-06-03 14:16:18 -04:00
matthewkeil
29ce8f9467 Merge branch 'unstable' into mkeil/merge-unstable-to-peerDAS-june3 2025-06-03 22:45:40 +07: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
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
4722be107d Merge branch 'unstable' into te/peerDAS_merge_unstable_may_14 2025-05-21 12:13:18 +01: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
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
0f30a6d7d6 chore: add tsconfig to detect unused imports, variables, and functions (#7759)
**Motivation**

Get rid of dead code, improve code clarity, no more unused imports

**Description**

Add tsconfig to detect unused imports, variables, and functions
2025-05-08 19:44:35 +01:00
Matthew Keil
9c538e3a8f feat: make aggregate with randomness async again (#7761)
**Motivation**

Gnosis analysis shows that there is a lot of time spent on main thread
for running aggregateWithRandomness on main thread. Now that libp2p@v2
is more stable and so are some of the other conditions that triggered
our revert last time, looking to check this again to see what the
metrics look like for running not on main thread.

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-05-08 13:08:58 -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
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