922 Commits

Author SHA1 Message Date
Cayman
100ab480bb feat: allow multiple mnemonic index ranges in validator setup (#8731)
**Motivation**

- @philknows wants

**Description**

- allow multiple index ranges in validator
- this should only be used in testing and not in production
2026-01-08 14:10:36 -05:00
twoeths
b255111a20 refactor: pass validators pubkey-index map from cli (#8707)
**Motivation**

- we will not be able to access `pubkey2index` or `index2pubkey` once we
switch to a native state-transition so we need to be prepared for that

**Description**

- pass `pubkey2index`, `index2pubkey` from cli instead
- in the future, we should find a way to extract them given a
BeaconState so that we don't have to depend on any implementations of
BeaconStateView, see
https://github.com/ChainSafe/lodestar/issues/8706#issue-3741320691

Closes #8652

---------

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-12-22 13:16:12 +07:00
Chiemerie Ezechukwu
882891d89c chore: update bootnode ENR with correct IPV6 (#8705)
**Motivation**

<!-- Why does this PR exist? What are the goals of the pull request? -->

This PR is to fix https://github.com/eth-clients/mainnet/issues/13

Already created this as well
https://github.com/eth-clients/mainnet/pull/14

<!-- A clear and concise general description of the changes of this pull
request. -->

<!-- If applicable, add screenshots to help explain your solution -->

<!-- Link to issues: Resolves #111, Resolves #222 -->

Closes #issue_number

**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 -->
2025-12-18 17:59:39 -05:00
Nico Flaig
aceb5b7416 chore: remove eth1 related code (#8692)
**Motivation**

All networks are post-electra now and transition period is completed,
which means due to [EIP-6110](https://eips.ethereum.org/EIPS/eip-6110)
we no longer need to process deposits via eth1 bridge as those are now
processed by the execution layer.

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

**Description**

Removes all code related to eth1 bridge mechanism to include new
deposits

- removed all eth1 related code, we can no longer produce blocks with
deposits pre-electra (syncing blocks still works)
- building a genesis state from eth1 is no longer supported (only for
testing)
- removed various db repositories related to deposits/eth1 data
- removed various `lodestar_eth1_*` metrics and dashboard panels
- deprecated all `--eth1.*` flags (but kept for backward compatibility)
- moved shared utility functions from eth1 to execution engine module

Closes https://github.com/ChainSafe/lodestar/issues/7682
Closes https://github.com/ChainSafe/lodestar/issues/8654
2025-12-17 15:45:02 +07:00
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
Lion - dapplion
8475d71f09 test: remove testcontainers dependency for web3signer test (#4567)
**Motivation**

- PR https://github.com/ChainSafe/lodestar/pull/4502 introduced a dev
testcontainers since @dadepo was having issues with docker

I really want to start decreasing our dependencies exposure, not
increasing it unless required. We have rolled our docker runners in the
past and should continue to do so.

**Description**

- Use adhoc docker

@dadepo I've removed the use of --network=host. If you have to run this
tests locally try to understand the incompatibilities and fix them
together without 3rd party libraries

---------

Co-authored-by: Cayman <caymannava@gmail.com>
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-12-03 09:57:04 -05:00
philknows
2303b06a91 chore: bump package versions to 1.37.0 2025-11-28 10:17:20 -05:00
Nico Flaig
dcab62468a feat: add validator client option to disable skipping slots (#8631)
**Motivation**

We don't wanna skip slots if slot processing takes longer than slot
duration in a distributed setup as delays might get caused by hanging
HTTP requests due to DVT middleware not reaching the signature
threshold.

**Description**

Adds new flag `--clock.skipSlots` (default: `true`) to validator client
to allow disabling skipping slots by setting it to `false`.

**Note:** it will always be set to `false` if `--distributed` flag is
set as the behavior is not desired in a DVT cluster as assumptions about
beacon node change and skipping slots does more harm than good.

Related issue https://github.com/ChainSafe/lodestar/issues/5314
2025-11-28 02:57:47 +01:00
Nazar Hussain
ada2b2b0ea chore: remove bun:ffi usage across all packages (#8613)
**Motivation**

After discussion we decided to stick with `napi` bindings instead of
`bun:ffi` to reduce the risk of vendor lock-in.

**Description**

- Remove all usages of `@lodestar/bun`
- Remove all conditional `imports` for packages related to `bun:ffi`

**Steps to test or reproduce**

- Run all tests
2025-11-13 12:16:08 +01:00
Nazar Hussain
f0ce024c1a test: update to vitest 4 to use builtin bun support (#8599)
**Motivation**

Update the vitest to avoid using third party test pool. 

**Description**

- Use latest vitest
- Remove custom process pool which we developed to run our tests in Bun
runtime
- Migrate test configs to latest version
- Update types
- Switch to playwright from webdriverio for browser tests performance,
which was due for long.


**Steps to test or reproduce**

- Run all tests
2025-11-06 10:43:41 -05:00
philknows
6eb05a083a chore: bump package versions to 1.36.0 2025-11-04 12:28:29 -05:00
Nico Flaig
782dc5ee45 feat: include commit hash in network lodestar version (#8605)
We are already including the version (eg. `lodestar/v1.36.0`), there
doesn't seem to be much of a benefit in terms of security to not include
the commit hash as well and it helps debugging especially in early
testnets or release candidates as there the version number is the same
while it might run a different commit.

We do have the `--private` flag to avoid including any information about
the client on p2p.
2025-11-04 14:45:38 +00:00
Phil Ngo
698a315802 feat: increase default gas limit to 60M (#8600)
**Motivation**

Client teams have been instructed to increase default gas limits to 60M
for Fusaka.

**Description**

This will ensure that validators signal 60M by default and updates
docs/tests to work with the new 60M configuration.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-11-03 10:23:15 -05:00
Nico Flaig
13fb933e7e feat: add option to prune persisted cp states (#8582)
**Motivation**

Last change from https://github.com/ChainSafe/lodestar/pull/7501 which
we implemented because persisted checkpoint states are added each epoch
during non-finality and never pruned until the chain finalizes again. It
turns out this is not sustainable if we have multiple weeks of
non-finality since it takes up hundreds of GB of disk space and many
nodes don't have sufficient disk space to handle this.

The long term solution is to store states more efficiently but for now
we should at least have a option to enable pruning, there is also always
the options to clean up the `checkpoint_states` folder manually.

**Description**

This PR adds a new flag `--chain.maxCPStateEpochsOnDisk` to enable
pruning of persisted checkpoint states. By default we don't prune any
persistent checkpoint states as it's not safe to delete them during long
non-finality as we don't know the state of the chain and there could be
a deep (hundreds of epochs) reorg if there two competing chains with
similar weight but we wouldn't have a close enough state to pivot to
this chain and instead require a resync from last finalized checkpoint
state which could be very far in the past.


Previous PR https://github.com/ChainSafe/lodestar/pull/7510

---------

Co-authored-by: twoeths <10568965+twoeths@users.noreply.github.com>
2025-10-28 09:40:47 -04:00
Nico Flaig
b93e71d50d chore: unbreak lodestar dev command (#8577)
**Motivation**

```
> ./lodestar dev
file:///home/nico/projects/ethereum/lodestar/packages/params/lib/setPreset.js:27
        throw Error(`Lodestar preset is already frozen. You must call setActivePreset() at the top of your
              ^

Error: Lodestar preset is already frozen. You must call setActivePreset() at the top of your
application entry point, before importing @lodestar/params, or any library that may import it.


// index.ts
import {setActivePreset, PresetName} from "@lodestar/params/setPreset"
setActivePreset(PresetName.minimal)
// Now you can safely import from other paths and consume params
import {SLOTS_PER_EPOCH} from "@lodestar/params"
console.log({SLOTS_PER_EPOCH})


    at setActivePreset (file:///home/nico/projects/ethereum/lodestar/packages/params/lib/setPreset.js:27:15)
    at file:///home/nico/projects/ethereum/lodestar/packages/cli/lib/applyPreset.js:49:5
    at ModuleJob.run (node:internal/modules/esm/module_job:262:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:485:26)
    at async file:///home/nico/projects/ethereum/lodestar/packages/cli/bin/lodestar.js:3:1

Node.js v22.4.1

```

**Description**

We cannot import any lodestar packages that depend on `@lodestar/params`
into `packages/cli/src/util/file.ts` since this is loaded from
`packages/cli/src/applyPreset.ts` and we run in the error above.
2025-10-27 21:41:17 +00:00
Nico Flaig
277758e330 feat: add semi supernode flag (#8568)
**Motivation**

Enable more efficient data availability with lower bandwidth and storage
requirements compared to a supernode.

**Description**

Adds new `--semiSupernode` flag to subscribe to and custody half of the
data column sidecar subnets to support blob reconstruction. This change
in combination with https://github.com/ChainSafe/lodestar/pull/8567 will
make it a lot less resource intensive to run a blob serving node.

I went with the same flag name as Lighthouse currently uses for this
https://github.com/sigp/lighthouse/issues/8218 to make it easier for
users, even though I don't think this flag name is great. We can look
into other ways to reconstruct blobs later, like fetching missing
columns over req/resp, which will eventually become necessary if we want
to support home operators that need blobs with higher max blob counts.

**Note:** If the custody group count of the node was higher than 64
previously it will not be reduced. It is required to remove the ENR
either manually or by setting `--persistNetworkIdentity false` to reset
the custody requirements.
2025-10-27 08:40:49 -04:00
Nico Flaig
8b33937cc4 refactor: clean up supernode config (#8559)
It doesn't seem necessary to pass down `supernode` config into different
modules like chain or network, it's better to handle initial custody
config only in beacon handler and then use `initialCustodyGroupCount`
downstream.
2025-10-23 09:06:39 -04:00
Nico Flaig
7e3c18443f feat: sync from unfinalized checkpoint state (#8527)
**Motivation**

This was a feature we developed for [rescuing
Holesky](https://blog.chainsafe.io/lodestar-holesky-rescue-retrospective/)
as part of https://github.com/ChainSafe/lodestar/pull/7501 to quickly
sync nodes to head during a period of long non-finality (~3 weeks).
While it's unlikely we will have such a long period of non-finality on
mainnet, this feature is still useful to have for much shorter periods
and testing purposes on devnets.

It is now part of [Ethereum protocol
hardening](https://github.com/eth-clients/diamond) mitigations described
[here](https://github.com/eth-clients/diamond/blob/main/mitigations/nfin-checkpoint-001.md)
> Ordinary checkpoint sync begins from the latest finalized checkpoint
(block and/or state). As an escape hatch during non-finality, it is
useful to have the ability to checkpoint sync from an unfinalized
checkpoint. A client implementing this mitigation MUST support
checkpoint sync from an arbitrary non-finalized checkpoint state.

We will support this with the exception that our checkpoint state needs
to be an epoch boundary checkpoint.

**Description**

The main feature of this PR is to allow initializing a node from an
unfinalized checkpoint state either retrieved locally or from a remote
source.

This behavior is disabled by default but can be enabled by either adding
- the `--lastPersistedCheckpointState` flag to load from the last safe
persisted checkpoint state stored locally
- or `--unsafeCheckpointState` to provide a file path or url to an
unfinalized checkpoint state to start syncing from which can be used
with new endpoint `GET /eth/v1/lodestar/persisted_checkpoint_state` to
sync from a remote node or by sharing states from `checkpoint_states`
folder

Both of these options are not safe to use on a network that recently
finalized an epoch and must only be considered if syncing from last
finalized checkpoint state is unfeasible.

An unfinalized checkpoint state persisted locally is only considered to
be safe to boot if
- it's the only checkpoint in it's epoch to avoid ambiguity from forks
- its last processed block slot is at an epoch boundary or last slot of
previous epoch
- state slot is at an epoch boundary
- state slot is equal to `epoch * SLOTS_PER_EPOCH`

But even if these criteria are met, there is chance that the node will
end up on a minority chain as it will not be able to pivot to another
chain that conflicts with the checkpoint state it was initialized from.

Other existing flags (like `--checkpointState`) are unchanged by this PR
and will continue to expect a finalized checkpoint state.

Previous PRs https://github.com/ChainSafe/lodestar/pull/7509,
https://github.com/ChainSafe/lodestar/pull/7541,
https://github.com/ChainSafe/lodestar/pull/7542 not merged to unstable
are included.

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

cc @twoeths

---------

Co-authored-by: twoeths <10568965+twoeths@users.noreply.github.com>
Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-10-22 15:22:05 -04:00
Cayman
1fc092319a chore: update lodestar-bun (#8555)
**Motivation**

- #7280 

**Description**

- update lodestar-bun
- now properly builds release versions of zig dependencies
- functions/types exported in separate namespaces
2025-10-22 14:00:06 -04:00
Nico Flaig
e88fbeb6b6 chore: unhide prune history option (#8547)
Reverts https://github.com/ChainSafe/lodestar/pull/7448 to unhide prune
history option. I've been running this on mainnet for a while and it's
seems pretty stable with no noticable impact on performance. The feature
is already widely used even though it was hidden so might as well show
it in our docs.


Metrics from my node

<img width="1888" height="340" alt="image"
src="https://github.com/user-attachments/assets/223b7e6b-101e-4b4f-b06a-6d74f830bf96"
/>

I did a few tweaks to how we query keys but nothing really improved the
fetch keys duration.

Caveat still remains that it's quite slow on first startup if the
previous db is large but that's a one time operation.

Closes https://github.com/ChainSafe/lodestar/issues/7556
2025-10-20 09:12:27 -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
twoeths
793f92c091 fix: improve heap size limit log (#8516)
**Motivation**

- got "heap size limit too low" warn in our Bun instance but has no idea
what's the exact value of it

**Description**

- include `heapSizeLimit` in the log

---------

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-10-09 11:16:55 +01:00
philknows
825a186b76 chore: bump package versions to 1.35.0 2025-10-08 18:10:13 -04:00
Nico Flaig
29cdec0f0e fix: default port6 to ipv4 port if set explicitly (#8504)
Default `port6` to the `--port` (ipv4 port) if set explicitly and
`--port6` is not set.
2025-10-06 15:50:17 -04:00
guha-rahul
be3c5220f4 refactor: replace * value with other more bash friendly value (#8491)
**Motivation**

Using `*` as a CLI flag value is not bash-friendly 

**Description**

Add backward-compatible support for the bash-friendly value `all` as an
alternative to `*` for the following CLI flags:
- `--rest.namespace` - now accepts both `*` and `all` to enable all API
namespaces
  - `--rest.cors` - now accepts both `*` and `all` to allow all origins
- `--keymanager.cors` - now accepts both `*` and `all` to allow all
origins

Closes #5963
2025-10-03 15:51:23 +01:00
Cayman
fd1dac853d feat: use lodestar-bun hashtree (#8481)
**Motivation**

- #7280 

**Description**

- bump lodestar-bun
- leveldb uses snappy
- leveldb macos build fix
- use hashtree-bun hasher in bun
2025-09-30 17:29:30 -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
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
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
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
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
1a17514b02 chore: bump package versions to 1.34.0 2025-09-05 12:24:08 -04:00
Nazar Hussain
11ca515d52 test: upgrade sim tests to use post-electra images (#8303)
**Motivation**

Use the newer client versions to support only post-electra forks.

**Description**

- Update images versions
- Update the runner script
- Update tests


**Steps to test or reproduce**

- Run all tests

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-09-02 20:40:00 +01:00
Nazar Hussain
22a04f4543 chore: upgrade @biomejs/biome to newer type aware version (#7982)
**Motivation**

Use the more type aware version of Biome to get benefit from type safety
rules.

**Description**

- Keep the rules matching to previous behavior 
- Add explanation to all ignore as it's required in new version

**Steps to test or reproduce**

Run all tests

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-09-02 16:53:47 +02: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
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
c1c459466f chore: move peer id file error due to file not found to debug (#8230)
**Motivation**

This log is currently always emitted if a user starts the node for the
first time or when upgrading to next release since we now have
`persistNetworkIdentity` set to `true` by default. Hence I think a
warning is not the right log level here.

**Description**

Move peer id file error due to file not found to `debug`

~~Alternative could be to differentiate error, ie. still log errors
other than file not found (`ENOENT`) as warn but seems unlikely that if
file exists we will fail here.~~ went with this approach now
2025-08-21 07:42:46 -04:00
NC
d4bbdc590b test: error from sim test is swallowed in tableReporter (#8223)
Errors from sim tests are swallowed because `TableReporter.summary()` is
not working as intended eg.
https://github.com/ChainSafe/lodestar/actions/runs/17056864174/job/48356128796?pr=8091

`arrayGroupBy` will always output empty object because
`acc[predicate(value, index, array)]` is always undefined and the bucket
is never initialized.
2025-08-19 17:34:22 -04: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
Nico Flaig
7d02789d1b feat: stricter builder circuit breaker (#8205)
**Motivation**

- Closes https://github.com/ChainSafe/lodestar/issues/7802

**Description**

- makes builder circuit breaker stricter, from previous 50% of blocks
missed down to 25%
- differentiate builder disabled due to failed status check vs. circuit
breaker activated
- updating wording in logs/errors `Execution builder` --> `External
builder`
2025-08-14 12:11:51 -04:00
Cayman
b42f83b4e0 fix: support dual stack on same port (#8190)
**Motivation**

- Resolve https://github.com/ChainSafe/lodestar/issues/7116
- Resolve https://github.com/ChainSafe/lodestar/issues/6531

**Description**

- Update discv5 dependency
(https://github.com/ChainSafe/discv5/pull/316)
- default to using the same port for ipv4 and ipv6
2025-08-13 11:50:23 -04:00