10951 Commits

Author SHA1 Message Date
Cayman
09716b423a chore: use typescript gc-stats import (#8455)
**Motivation**

- #7280 

**Description**

- Bun _does_ support imports, I was mistaken to say it didn't. The issue
I ran into was that the referenced file did not exist!
- Use the typescript directly
2025-09-23 14:38:32 -04:00
Matthew Keil
47c570ab76 chore: remove eip7594 from skipped spec tests and rename mekle.test.ts -> merkleProof.test.ts (#8452)
**Motivation**

Ensure that all spec tests are running for peerDas and fulu scopes.

Rename merkle.test.ts -> merkleProof.test.ts so it matches the other
file namings

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-09-23 16:34:21 +01:00
Nico Flaig
8b45b1e978 fix: emit blob/data column sidecar events when we receive them by root (#8445)
Part of https://github.com/ChainSafe/lodestar/issues/7995

---------

Co-authored-by: Matthew Keil <me@matthewkeil.com>
2025-09-23 12:15:51 +00:00
Nico Flaig
b8be78f7bb fix: use correct container and bump seq_number when updating syncnets (#8451) 2025-09-23 08:14:41 -04:00
twoeths
4efea5815e feat: track number of peers per data column subnet topic (#8442)
**Motivation**

- starting from fulu, we need to track number of peers per data column
subnet

**Description**

- track it in gossipsub
- also track peers and topics by fork boundary, not fork name
- will need to render this on the main Grafana dashboard after this PR

---------

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-09-23 19:08:33 +07:00
Nico Flaig
b42a298a7c fix: emit data column sidecar event when receive them from execution (#8446)
Part of https://github.com/ChainSafe/lodestar/issues/7995

---------

Co-authored-by: Matthew Keil <me@matthewkeil.com>
2025-09-23 12:05:56 +00:00
Cayman
cec9bef1db chore: various bun tweaks (#8449)
**Motivation**

- #7280 

**Description**

- combined with #8448, `surpressTranspileTS: true` is needed for workers
to use typescript source directly without transpiling it (and
incorrectly loading it via a commonjs loader)
- avoid worker `resourceLimits` - Bun doesn't implement it, it throws if
you use it
- use `datastore-fs` instead of `datastore-level` for backing our libp2p
database -- Note this is changed unilaterally (affecting current nodejs
usage)
- use assemblyscript chacha20-poly1305 - bun doesn't support the native
crypto implementation
2025-09-23 12:49:36 +01: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
Nico Flaig
c0078a16b5 fix: pass current time in seconds to seenTimestampSec of block input (#8444)
`Date.now()` returns current unit timestamp in milliseconds but we want
seconds here, ie. need to divide by 1000.
2025-09-22 11:44:17 -04:00
twoeths
092cc3954a chore: sync PeerDAS dashboard (#8443)
**Motivation**

- reflect the in-progress PeerDAS dashboard to our source code

**Description**

- PeerDAS dashboard was updated but we did not track it in our source
code, need to sync it now and review/revise later

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-09-22 07:18:06 -04: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
Nazar Hussain
83964b4452 chore: update few type safety rules for linting (#8391)
**Motivation**

Use best of the linting capabilities to avoid any error slipped through.

**Description**

- Enable few promise based rules
- Restrict few imports from private paths

**Steps to test or reproduce**

- Run all tests

---------

Co-authored-by: Cayman <caymannava@gmail.com>
2025-09-19 10:35:42 -04:00
Nazar Hussain
7a3b3a996e feat: add pattern for runtime specific package dependencies (#8320)
**Motivation**

Make sure the Lodestar starts running in Bun runtime. 

**Description**

- Add subpath imports supported in Bun and NodeJS. 
- 

**Steps to test or reproduce**

Run all tests 

**Note**

The CLI finally starts to run, next go with command by command to see
what's breaking, starting the `beacon` cmd.

```
bun run --bun bin/lodestar.js --help 
🌟 Lodestar: TypeScript Implementation of the Ethereum Consensus Beacon Chain.

 * Version: v1.33.0/nh/bun-wrappers/07d2010
  * by ChainSafe Systems, 2018-2025

Commands:
  beacon       Run a beacon chain node
  validator    Run one or multiple validator clients
  lightclient  Run lightclient
  dev          Quickly bootstrap a beacon node and multiple validators. Use for
               development and testing
  bootnode     Run a discv5 bootnode. This will NOT perform any beacon node func
               tions, rather, it will run a discv5 service that allows nodes on
               the network to discover one another.

Options:
      --dataDir                             Lodestar root data directory[string]
      --network                             Name of the Ethereum Consensus chain
                                             network to join
  [string] [choices: "mainnet", "gnosis", "sepolia", "holesky", "hoodi", "chiado
                                        ", "ephemery", "dev"] [default: mainnet]
      --paramsFile                          Network configuration file  [string]
      --rcConfig                            RC file to supplement command line a
                                            rgs, accepted formats: .yml, .yaml,
                                            .json                       [string]
      --supernode                           Subscribe to and custody all data co
                                            lumn sidecar subnets       [boolean]
      --terminal-total-difficulty-override  Terminal PoW block TTD override
                                                                        [string]
      --terminal-block-hash-override        Terminal PoW block hash override
                                                                        [string]
      --terminal-block-hash-epoch-override  Terminal PoW block hash override act
                                            ivation epoch               [string]
  -h, --help                                Show help                  [boolean]
  -v, --version                             Show version number        [boolean]

📖 For more information, check the CLI reference:
  * https://chainsafe.github.io/lodestar/reference/cli

✍️ Give feedback and report issues on GitHub:
  * https://github.com/ChainSafe/lodestar

```
2025-09-19 14:10:20 +00:00
twoeths
36a31f3a2f fix: add log and metrics to ColumnReconstructionTracker (#8433)
**Motivation**

- we want to know more insight of ColumnReconstructionTracker

**Description**

- add logs to ColumnReconstructionTracker
- fix metrics of ColumnReconstructionTracker: centralize to 1 place and
make it better to render on Grafana
- remove unused error

Closes #8402

---------

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
Co-authored-by: Cayman <caymannava@gmail.com>
2025-09-19 13:20:29 +00:00
Nico Flaig
af97dd977f fix: correctly count requested data column sidecars in rate limiter (#8436)
The rate limiter currently only counts the number of blocks requested
but our quota is based on `MAX_REQUEST_DATA_COLUMN_SIDECARS`. We need to
account for the number of columns requested as otherwise we are
undercharging by a factor of up to 128.
2025-09-19 09:11:24 -04:00
twoeths
5c65fa3b36 fix: wait for block and all data (#8430)
**Motivation**

- got a case where all columns came timely while block came very late
and we did not trigger `incompleteBlockInput` event

**Description**

- trigger `incompleteBlockInput` in that case

Closes #8405

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-09-19 08:59:40 -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
twoeths
c20158159f chore: add logs and metrics to GetBlobsTracker (#8432)
**Motivation**

- we want to know the result of getBlobsV2 and how it helps our block
import

**Description**

- add logs and metrics to GetBlobsTracker

Closes #8401

---------

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-09-19 08:56:14 -04:00
twoeths
200e2443d4 fix: emit unknownParent event (#8429)
**Motivation**

- when validating a gossip block and got a `PARENT_UNKNOWN` error, we
should emit `unknownParent` event instead of `incompleteBlockInput`
event

**Description**

- do that in gosssip handler
- add `ChainEvent.incompleteBlockInput` test to unknownBlockSync e2e
test

Closes #8415
Closes #8417

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-09-19 08:54:43 -04:00
twoeths
365e071d8c chore: track BlockInputSync metrics (#8431)
**Motivation**

- track metrics added since #8416 to Sync dashboard

<img width="1675" height="601" alt="Screenshot 2025-09-19 at 14 05 14"
src="https://github.com/user-attachments/assets/1168076a-c100-4976-a3b5-5ef26d7c322c"
/>

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-09-19 08:53:13 -04:00
Nico Flaig
5e2a80008e chore: remove parent beacon block root from execution payload rpc type (#8428)
Noticed the type isn't correct as
[ExecutionPayloadV3](9a7b40cc08/src/engine/cancun.md (L41-L61))
doesn't contain `parentBeaconBlockRoot` as it's passed as part of
payload attributes.
2025-09-18 17:09:56 -04:00
Nico Flaig
6e3c7ca8d0 refactor: make commonBlockBodyPromise a required parameter (#8273)
## Summary

This PR implements the refactoring suggested in #7974 to make
`commonBlockBodyPromise` a required parameter when calling
`produceBlock` and `produceBlindedBlock` methods.

## Changes

- Made `commonBlockBodyPromise` required in the chain interface
(`IBeaconChain`)
- Updated chain implementation to reflect the required parameter
- Removed the TODO comment and optional parameter from
`produceBlockBody` function
- Removed fallback calls to `produceCommonBlockBody.call()` within
`produceBlockBody`
- Updated tests to provide the required `commonBlockBodyPromise`
parameter

## Rationale

As discussed in the original issue, making `commonBlockBodyPromise`
required ensures that the promise is always provided by callers,
eliminating the need for fallback logic inside `produceBlockBody`. This
simplifies the code and makes the dependency explicit.

## Testing

-  All TypeScript type checks pass (`yarn check-types`)
-  Linting passes (`yarn lint`)
-  Updated affected tests to work with the new required parameter

Resolves #7974

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-18 15:52:14 -04:00
Nico Flaig
b7125d4704 feat: publish blobs we retrieve from execution engine to gossip (#8324)
**Motivation**

We are currently not following the spec
[here](cd92a897ac/specs/deneb/p2p-interface.md (L274-L281))
> When clients use the local execution layer to retrieve blobs, they
MUST behave
as if the corresponding `blob_sidecar` had been received via gossip. In
particular they MUST:
> - Publish the corresponding `blob_sidecar` on the
`blob_sidecar_{subnet_id}`
  subnet.
> - Update gossip rule related data structures (i.e. update the
anti-equivocation
  cache).

Publishing blocks we receive from execution engine can help with blob
propagation and as a added benefit could avoid some network traffic due
to `IDONTWANT`.


**Description**

Publish blobs we retrieve from execution engine to gossip.

**Note:** this excludes blobs we already received via gossip either
before calling `engine_getBlobsV1` or after receiving the response.
Overall it's a low percentage of blobs as shown below but it depends on
connectivity of the node and geolocation.

<img width="940" height="290" alt="image"
src="https://github.com/user-attachments/assets/8316d834-ad74-472e-ab5a-fb0f5a7d35c6"
/>
2025-09-18 15:50:46 -04:00
Cayman
c253bccb11 chore: bump @chainsafe/libp2p-gossipsub to v14.1.2 (#8425)
**Description**

- Bump one patch version
https://github.com/ChainSafe/js-libp2p-gossipsub/releases/tag/v14.1.2
2025-09-18 15:44:12 -04:00
Nico Flaig
8ea34e52ba chore: update gloas boilerplate code (#8427)
Just some changes we missed in
https://github.com/ChainSafe/lodestar/pull/8222 or copy pasted without
updating it.
2025-09-18 15:44:01 -04:00
Nazar Hussain
0c6f50771f chore: use latest TS module resolution (#8419)
**Motivation**

Use latest `module` and `moduleResolution` for TS.

**Description**

- To use [subpath
imports](https://nodejs.org/api/packages.html#subpath-imports) in the PR
#8320 we need to update the module solution strategy for TS.
- That requires to change the `module` for the TS as well. 
- Earlier tried to stay with `node18` or `node20`, but the `ts-node`
does not work with that.
- Maintaining different tsconfig for ts-node is more of hassle on wrong
run.
- So decided to stick with `nodenext` strategy for `moduleResolution` 

**Steps to test or reproduce**

Run all tests

---------

Co-authored-by: Cayman <caymannava@gmail.com>
2025-09-18 11:36:48 -04:00
Nico Flaig
955e9f89ed feat: use dual-stack by default (#8407)
**Motivation**

To further increase the number of IPv6 nodes on the network it would
help if we use dual-stack by default.

**Description**

Use dual-stack by default
- if no `listenAddress` is specified then enable IPv4 and IPv6
- if only `listenAddress` is configured then only enable IPv4
- if only `listenAddress6` is configured then only enable IPv6
- if both `listenAddress` and `listenAddress6` are configured enable
both

Information about other clients can be found here https://ipv6eth.info/
2025-09-18 08:48:05 -04:00
Matthew Keil
a70bac5bd3 feat: refactor block input (#8200)
**Motivation**

Implement new IBlockInput on `unstable` version of peer das code.

---------

Co-authored-by: Cayman <caymannava@gmail.com>
Co-authored-by: twoeths <10568965+twoeths@users.noreply.github.com>
Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Nazar Hussain <nazarhussain@gmail.com>
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-09-18 07:49:08 -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
Cayman
811265f1e2 fix: use proper check in computeColumnsForCustodyGroup (#8414)
**Description**

- classic index vs count off-by-one
2025-09-17 11:30:15 +01:00
Nazar Hussain
c88a6ed255 deps: upgrade typescript to 5.9 (#8412)
**Motivation**

Upgrade typescript to latest version. 

**Description**

- Upgrade typescript to latest version. 
- Need this version upgrade to be used in #8320 to allow `module:
node20>`

**Steps to test or reproduce**

Run all tests
2025-09-16 17:44:22 +00: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
Nico Flaig
e9dd48f165 chore: move single attestation errors to verbose log level (#8393)
- Closes https://github.com/ChainSafe/lodestar/issues/8386
2025-09-12 13:03:34 -04:00
Nico Flaig
8cacf063da fix: restore data column sidecars prune log (#8388)
**Motivation**

Looks like we accidentally got rid of `logger.verbose` and now just have
a unused expression instead of actually logging it. It's a bit sad that
biomejs doesn't catch this and I didn't find a rule similar to
`no-unused-expressions` in eslint.

**Description**

Restore data column sidecars prune log

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-09-12 09:52:53 -04:00
Nico Flaig
6953c24bc9 fix: don't log proposer boost reorg logs during sync (#8363)
**Motivation**

We currently print proposer boost reorg related logs `Strong block
detected ...` during sync but it's not relevant there as
`shouldOverrideForkChoiceUpdate` will never return true if `block.slot <
currentSlot`.

There is also an edge we currently don't handle since we only run
proposer reorg checks if block is received through gossip but in theory
(although unlikely in practice) we can also receive the block via
req/resp (close to 0% on mainnet).

**Description**

- only run proposer boost reorg check if `block.slot >= currentSlot`
- do not emit logs if no checks are run, eg. during sync there is no
reason to emit logs
- remove `isGossipBlock` flag to also check if receive block via
req/resp, this also means we run the checks if receive block from api
meaning we a previous proposer, we could additional check if we are
previous proposer cache if we wanna handle that case explicitly
2025-09-11 14:14:02 -07:00
Phil Ngo
658ac3472f docs: clarify ipv6 details in networking page (#8368)
**Motivation**

After resolving issues with the ipv6 dual stack port bug in v1.34.1, it
was noted that we should make it clear our default p2p port for both
IPv4 and IPv6 is now the same at port `9000`.

**Description**

When we introduced IPv6 support in #5758 , we used to default the port
of `9090`. When supporting dual stack option on the same port via #8190
, we should make it clear in documentation this is now by default also
on port `9000`.
2025-09-11 09:19:36 -04:00
Nazar Hussain
8644a83c62 deps: update the elliptic to fix a vulnerability (#8374)
**Motivation**

Keep the dependencies safe from all vulnerabilities. 

**Description**

- Fix a `critical` level vulnerability. 

https://github.com/advisories/GHSA-fc9h-whq2-v747

It's not critical for our beacon node or validator implementation but
used in `@lodestar/prover` package.

**Steps to test or reproduce**

Run all tests
2025-09-11 07:44:47 -04:00
Phil Ngo
c85be4e26c chore: merge v1.34.1 stable back to unstable (#8367) 2025-09-10 17:55:09 -04:00
Phil Ngo
9a5065a5ac chore: release 1.34.1 patch (#8366) v1.34.1 2025-09-10 17:49:36 -04:00
Phil Ngo
c4ab7f0100 fix: bump discv5 to 11.0.4 (#8365)
**Motivation**

Users reported in the v1.34.0 release that changes in the release
created an issue when ipv6 and ipv4 ports were the same:

```
✖ Error: Timeout: Did not receive an init message from worker after 300000ms. Make sure the worker calls expose().
```

**Description**

This PR bumps discv5 from 11.0.3 to 11.0.4 which includes the fix to
binding ipv4 and ipv6 on the same port in dual stack mode.
See: https://github.com/ChainSafe/discv5/pull/318
v1.34.1-rc.0
2025-09-10 16:35:24 -04:00
Phil Ngo
86490969b7 chore: bump package versions to 1.34.1 2025-09-10 16:34:42 -04:00
Phil Ngo
6dd6cec93a fix: bump discv5 to 11.0.4 (#8365)
**Motivation**

Users reported in the v1.34.0 release that changes in the release
created an issue when ipv6 and ipv4 ports were the same:

```
✖ Error: Timeout: Did not receive an init message from worker after 300000ms. Make sure the worker calls expose().
```

**Description**

This PR bumps discv5 from 11.0.3 to 11.0.4 which includes the fix to
binding ipv4 and ipv6 on the same port in dual stack mode.
See: https://github.com/ChainSafe/discv5/pull/318
2025-09-10 20:29:59 +00:00
Phil Ngo
f80d2d52da chore: merge v1.34.0 back to unstable (#8364) 2025-09-10 11:43:29 -04:00
Phil Ngo
b8da556259 chore: v1.34.0 release (#8344) v1.34.0 2025-09-10 11:33:17 -04:00
twoeths
1ec12b4788 chore: revise epoch transition metric bucket (#8361)
**Motivation**

- we want to know more details about the epoch transition time

**Description**

- revise metric bucket:
  - 0.01, 0.05, 0.1 is unrealistic even with state-transition-z
  - add more realistic buckets: 2, 2.5
- sync that with
`lodestar_precompute_next_epoch_transition_duration_seconds`
- also log epoch transition duration

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-09-10 06:50:25 -04:00
Nico Flaig
4a37a4b0b1 fix: properly handle fetching data columns from api if block has no blobs (#8336)
**Motivation**

Restores previous behavior before
https://github.com/ChainSafe/lodestar/pull/8251, if there is a block
that has no blobs we shouldn't throw an error and instead just return no
data columns. Only throw an error if there should be data columns in db
(by checking if block has kzg commitments) but we don't have them.

**Description**

Only query data columns from db if block has at least one
`blobKzgCommitments`
2025-09-09 12:37:17 -04:00
Nico Flaig
32681419fd fix: update logs if block not found while handling unavailable data columns (#8337)
**Motivation**

Don't spam the logs with uninformative errors


**Description**

Update logs if block not found while handling unavailable data columns
- move log from `error` to `verbose` as it's network related log and to
avoid spam
- make log actually useful by adding context like slot and block root

Closes https://github.com/ChainSafe/lodestar/issues/8333
2025-09-09 12:09:23 -04:00
Nazar Hussain
1817ab113d fix: min key for the archive data columns (#8345)
**Motivation**

Fix bucket boundary for the min the key for data column sidecars. 

**Description**

- Fix the bucket boundary issue for data column side cars.


**Steps to test or reproduce**

Run all tests 


**Note**

Level db have a builtin feature to define boundary for buckets called
`sublevel`, I didn't realize earlier we are not using that, instead we
have our own higher level logic for min/max key for the buckets. So
didn't provided that second condition to limit to bucket boundary.

---------

Co-authored-by: twoeths <10568965+twoeths@users.noreply.github.com>
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-09-09 12:04:23 -04:00