Commit Graph

10921 Commits

Author SHA1 Message Date
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
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
Nico Flaig
f61b8d9dad chore: display cgc in lodestar summary dashboard (#8668)
<img width="949" height="213" alt="image"
src="https://github.com/user-attachments/assets/a87dfba8-a8bf-48cf-9738-459e77ba1099"
/>

cc @wemeetagain
2025-12-04 09:41:02 -05: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
Nico Flaig
6938ce2049 fix: don't try to serve states for future slots (#8665)
**Motivation**

When requesting a future slot the node tries to dial the state from head
which allows to quite easily DoS the node as it's unbounded amount of
work if the slot is very far away from head.

We should not allow to request states that are in the future (> clock
slot) and return a 404 instead.

**Description**

In case state is request by slot, check if it's a slot from the future
based on clock slot and return 404 state not found error.

I didn't use `forkChoice.getHead().slot` because we should still be able
to serve the state if all slots between the requested slot and the head
slot are skipped.

Related [discord
discussion](https://discord.com/channels/593655374469660673/1387128551962050751/1445514034592878755),
thanks to @guha-rahul for catching and reporting this.
2025-12-03 09:59:02 -05:00
twoeths
1ad9c40143 chore: improve benchmark (#8664)
**Motivation**

- it takes so much time to run benchmark, a lot of them does not make
sense
- seeing OOM with NodeJS 24, see
https://github.com/ChainSafe/lodestar/pull/8645#issuecomment-3601327203

**Description**

- remove benchmarks for flow that's not used in prod
- remove some "minMs" option for some tests that causes a lot of time
- remote test that does not reflect the bottle neck of lodestar's
performance as of Dec 2025
- remote tests that's not part of lodestar code. It's only meaningful in
the scope of that PR only

this is based on the long running test I found in
https://github.com/ChainSafe/lodestar/actions/runs/19874295397/job/56957698411

```
packages/beacon-node/test/perf/chain/validation/attestation.test.ts
  validate gossip attestation
    ✔ batch validate gossip attestation - vc 640000 - chunk 32            8931.657 ops/s    111.9613 us/op   x0.918       7814 runs   30.0 s
    ✔ batch validate gossip attestation - vc 640000 - chunk 64            9972.473 ops/s    100.2760 us/op   x0.926       4321 runs   30.1 s
    ✔ batch validate gossip attestation - vc 640000 - chunk 128           10569.62 ops/s    94.61075 us/op   x0.921       2268 runs   30.0 s
    ✔ batch validate gossip attestation - vc 640000 - chunk 256           10069.74 ops/s    99.30746 us/op   x0.901       1154 runs   30.1 s

packages/fork-choice/test/perf/protoArray/computeDeltas.test.ts
  computeDeltas
    ✔ computeDeltas 1400000 validators 0% inactive                        73.51301 ops/s    13.60303 ms/op   x0.986        539 runs   10.0 s
    ✔ computeDeltas 1400000 validators 10% inactive                       78.91095 ops/s    12.67251 ms/op   x0.989        556 runs   10.0 s
    ✔ computeDeltas 1400000 validators 20% inactive                       86.73608 ops/s    11.52923 ms/op   x1.001        598 runs   10.0 s
    ✔ computeDeltas 1400000 validators 50% inactive                       114.8443 ops/s    8.707439 ms/op   x0.990        799 runs   10.0 s
    ✔ computeDeltas 2100000 validators 0% inactive                        48.69939 ops/s    20.53414 ms/op   x0.996        371 runs   10.0 s
    ✔ computeDeltas 2100000 validators 10% inactive                       53.13929 ops/s    18.81847 ms/op   x1.000        371 runs   10.0 s
    ✔ computeDeltas 2100000 validators 20% inactive                       60.11017 ops/s    16.63612 ms/op   x0.978        418 runs   10.0 s
    ✔ computeDeltas 2100000 validators 50% inactive                       79.46802 ops/s    12.58368 ms/op   x0.967        552 runs   10.0 s

packages/state-transition/test/perf/util/loadState/findModifiedValidators.test.ts
  find modified validators by different ways
    serialize validators then findModifiedValidators
      ✔ findModifiedValidators - 10000 modified validators                  1.382729 ops/s    723.2076 ms/op   x0.993         10 runs   9.21 s
      ✔ findModifiedValidators - 1000 modified validators                   1.298120 ops/s    770.3450 ms/op   x1.152         10 runs   8.68 s
      ✔ findModifiedValidators - 100 modified validators                    3.535168 ops/s    282.8720 ms/op   x1.329         10 runs   3.85 s
      ✔ findModifiedValidators - 10 modified validators                     4.648368 ops/s    215.1293 ms/op   x1.548         10 runs   3.13 s
      ✔ findModifiedValidators - 1 modified validators                      5.296754 ops/s    188.7949 ms/op   x1.187         10 runs   3.10 s
      ✔ findModifiedValidators - no difference                              3.873496 ops/s    258.1647 ms/op   x1.236         12 runs   3.88 s
    deserialize validators then compare validator ViewDUs
      ✔ compare ViewDUs                                                    0.1524038 ops/s    6.561514  s/op   x1.077          9 runs   65.7 s
    serialize each validator then compare Uin8Array
      ✔ compare each validator Uint8Array                                  0.8007866 ops/s    1.248772  s/op   x0.830         10 runs   13.7 s
    compare validator ViewDU to Uint8Array
      ✔ compare ViewDU to Uint8Array                                       0.9549799 ops/s    1.047143  s/op   x0.999         10 runs   11.5 s

packages/state-transition/test/perf/util/loadState/loadState.test.ts
  loadState
    ✔ migrate state 1000000 validators, 24 modified, 0 new               0.9790753 ops/s    1.021372  s/op   x1.147         57 runs   60.1 s
    ✔ migrate state 1000000 validators, 1700 modified, 1000 new          0.7290797 ops/s    1.371592  s/op   x0.942         43 runs   61.1 s
    ✔ migrate state 1000000 validators, 3400 modified, 2000 new          0.6307866 ops/s    1.585322  s/op   x0.883         37 runs   60.9 s
    ✔ migrate state 1500000 validators, 24 modified, 0 new               0.9393088 ops/s    1.064613  s/op   x0.911         55 runs   60.5 s
    ✔ migrate state 1500000 validators, 1700 modified, 1000 new          0.8235204 ops/s    1.214299  s/op   x0.785         48 runs   60.2 s
    ✔ migrate state 1500000 validators, 3400 modified, 2000 new          0.6997867 ops/s    1.429007  s/op   x0.720         41 runs   60.7 s


  ✔ naive computeProposerIndex 100000 validators                        21.29210 ops/s    46.96578 ms/op   x0.591         10 runs   51.8 s

  getNextSyncCommitteeIndices electra
    ✔ naiveGetNextSyncCommitteeIndices 1000 validators                   0.1319639 ops/s    7.577831  s/op   x0.675          8 runs   66.8 s
    ✔ getNextSyncCommitteeIndices 1000 validators                         9.444554 ops/s    105.8811 ms/op   x0.753         10 runs   1.60 s
    ✔ naiveGetNextSyncCommitteeIndices 10000 validators                  0.1280431 ops/s    7.809868  s/op   x0.766          7 runs   61.8 s
    ✔ getNextSyncCommitteeIndices 10000 validators                        9.244910 ops/s    108.1676 ms/op   x0.880         10 runs   1.62 s
    ✔ naiveGetNextSyncCommitteeIndices 100000 validators                 0.1295493 ops/s    7.719071  s/op   x0.814          7 runs   61.9 s
    ✔ getNextSyncCommitteeIndices 100000 validators                       9.279165 ops/s    107.7683 ms/op   x0.751         10 runs   1.62 s

  computeShuffledIndex
    ✔ naive computeShuffledIndex 100000 validators                      0.04376956 ops/s    22.84693  s/op   x0.719          2 runs   67.8 s
    ✔ cached computeShuffledIndex 100000 validators                       1.790556 ops/s    558.4858 ms/op   x0.973         10 runs   6.16 s
    ✔ naive computeShuffledIndex 2000000 validators                    0.002243157 ops/s    445.8003  s/op   x0.922          1 runs    931 s
    ✔ cached computeShuffledIndex 2000000 validators                    0.02947726 ops/s    33.92445  s/op   x0.810          1 runs   71.3 s

packages/state-transition/test/perf/util/signingRoot.test.ts
  computeSigningRoot
    ✔ computeSigningRoot for AttestationData                              51551.61 ops/s    19.39804 us/op   x0.905        491 runs   10.0 s
    ✔ hash AttestationData serialized data then Buffer.toString(base64    639269.7 ops/s    1.564285 us/op   x0.977       5818 runs   10.0 s
    ✔ toHexString serialized data                                         886487.9 ops/s    1.128047 us/op   x0.926       8417 runs   10.0 s
    ✔ Buffer.toString(base64)                                              6071166 ops/s    164.7130 ns/op   x0.974      50685 runs   10.1 s
```

---------

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-12-03 09:57:51 -05: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
Nico Flaig
bc1fed4d3d fix: avoid recomputing indexed attestations during block import (#8637)
**Motivation**

- https://github.com/ChainSafe/lodestar/issues/8625

**Description**

Store indexed attestations for each block during block/signature
verification to avoid recomputing them during import
- compute `indexedAttestationsByBlock` once during verification
- enhance `FullyVerifiedBlock` to include indexed attestations for block
import

Closes https://github.com/ChainSafe/lodestar/issues/8625
2025-12-03 14:49:20 +01:00
dependabot[bot]
548d7aa41e chore(deps): bump mdast-util-to-hast from 13.1.0 to 13.2.1 in /docs (#8649)
Bumps
[mdast-util-to-hast](https://github.com/syntax-tree/mdast-util-to-hast)
from 13.1.0 to 13.2.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/syntax-tree/mdast-util-to-hast/releases">mdast-util-to-hast's
releases</a>.</em></p>
<blockquote>
<h2>13.2.1</h2>
<h4>Fix</h4>
<ul>
<li>ab3a795 Fix support for spaces in class names</li>
</ul>
<h4>Types</h4>
<ul>
<li>efb5312 Refactor to use <code>@import</code>s</li>
<li>a5bc210 Add declaration maps</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/syntax-tree/mdast-util-to-hast/compare/13.2.0...13.2.1">https://github.com/syntax-tree/mdast-util-to-hast/compare/13.2.0...13.2.1</a></p>
<h2>13.2.0</h2>
<h4>Types</h4>
<ul>
<li>24f4576 Add type for <code>data.meta</code> on elements to hast</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/syntax-tree/mdast-util-to-hast/compare/13.1.0...13.2.0">https://github.com/syntax-tree/mdast-util-to-hast/compare/13.1.0...13.2.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="174795b21f"><code>174795b</code></a>
13.2.1</li>
<li><a
href="3d05b3a715"><code>3d05b3a</code></a>
Update Node in Actions</li>
<li><a
href="ab3a79570a"><code>ab3a795</code></a>
Fix support for spaces in class names</li>
<li><a
href="efb5312310"><code>efb5312</code></a>
Refactor to use <code>@import</code>s</li>
<li><a
href="a5bc210f1a"><code>a5bc210</code></a>
Add declaration maps</li>
<li><a
href="b54955d4e1"><code>b54955d</code></a>
Add <code>.tsbuildinfo</code> to <code>.gitignore</code></li>
<li><a
href="f511a93817"><code>f511a93</code></a>
13.2.0</li>
<li><a
href="24f4576508"><code>24f4576</code></a>
Add type for <code>data.meta</code> on elements to hast</li>
<li><a
href="feeec02562"><code>feeec02</code></a>
Update dev-dependencies</li>
<li>See full diff in <a
href="https://github.com/syntax-tree/mdast-util-to-hast/compare/13.1.0...13.2.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mdast-util-to-hast&package-manager=npm_and_yarn&previous-version=13.1.0&new-version=13.2.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/ChainSafe/lodestar/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-02 10:26:57 +01:00
Nico Flaig
a8c0c7a156 chore: fix test current file launch args (#8632)
Updates `Test Current File` launch config to work with vitest 4 (updated
in https://github.com/ChainSafe/lodestar/pull/8599).
2025-12-01 14:48:21 -05:00
guha-rahul
7dec9cd8fb docs: add ERA package to readme (#8644)
**Motivation**

- The era package was not mentioned in the readme.

**Description**

<!-- 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 -->


**AI Assistance Disclosure**

- [x] 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-01 10:51:51 -05:00
guha-rahul
8f113529e2 fix: skip genesis slot signature check when validating ERA files (#8642)
**Motivation**

- Era validation lacked genesis slot signature verification skip

**Description**

- Adds a check for genesis slot and skips signature verification for
slot 0 in ERA validation


**AI Assistance Disclosure**

- [x] 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.
No AI is used.
<!-- Insert any AI assistance disclosure here -->
2025-12-01 15:24:41 +00:00
Phil Ngo
68e0c78624 chore: merge v1.37.0 stable back to unstable (#8643) 2025-12-01 10:20:10 -05:00
Phil Ngo
eaf5bc974a chore: v1.37.0 release (#8640) v1.37.0 2025-12-01 09:18:48 -05:00
twoeths
0c3b3f119c feat: track DataTransform metrics (#8639)
**Motivation**

- we usually have to uncompress more messages than needed so it's good
to track it in DataTransform

**Description**

- track `compress` and `uncompress` times by topic type
- in this instance, this node only subscribe to 8 column subnets but we
usually have to uncompress 9 or up to 10/11 DataColumnSidecars per slot,
they will likely be duplicated in the end. See also
https://github.com/ChainSafe/js-libp2p-gossipsub/pull/536

part of #8629
<img width="1046" height="485" alt="Screenshot 2025-11-28 at 17 02 42"
src="https://github.com/user-attachments/assets/df190b29-6681-48de-a04e-cd79ab82858d"
/>

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-12-01 09:14:28 +07:00
philknows
2303b06a91 chore: bump package versions to 1.37.0 v1.37.0-rc.0 2025-11-28 10:17:20 -05:00
Nazar Hussain
c68bfb2ae3 refactor: introduce safe-block to fork-choice (#8618)
**Motivation**

There is a concept documented in the specs called
[safe-block](https://github.com/ethereum/consensus-specs/blob/master/fork_choice/safe-block.md).
Wanted to introduce that concept in our codebase so upcoming feature of
`fcr` have less invasive changes.

**Description**

- Expose functions `getSafeBeaconBlockRoot` and
`getSafeExecutionBlockHash` from `fork-choice` package.
- Update the usage of `safeBlock` to use those functions

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-11-28 15:48:06 +01: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
Nico Flaig
ac3059c9b9 test: update web3signer e2e tests to fulu (#8635)
**Motivation**

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

**Description**

- enable fulu signature tests
- update web3signer to version
[25.11.0](https://github.com/Consensys/web3signer/releases/tag/25.11.0)
2025-11-28 02:57:32 +01:00
Nico Flaig
2724822372 fix: compare signature bytes in proposer signature cache check (#8636)
**Motivation**

https://github.com/ChainSafe/lodestar/pull/8620#discussion_r2567993594

**Description**

Compare signature bytes in proposer signature cache check
2025-11-28 02:57:13 +01:00
dependabot[bot]
2d3601648b chore(deps): bump node-forge from 1.3.1 to 1.3.2 in /docs (#8633) 2025-11-27 11:47:03 +01:00
Cayman
c2cf1aac27 feat: cache serialized data column sidecars (#8627)
**Motivation**

- https://github.com/ChainSafe/lodestar/issues/8624

**Description**

- Cache serialized data column sidecars (from gossip and reqresp)
- Use serialized data column sidecars (if available) when persisting to
db (for engine, ~10 per slot, they will not be available, so they will
still be reserialized)
2025-11-22 14:23:20 -05:00
twoeths
3e80b7391e fix: verify proposer signatures once per slot (#8620)
**Motivation**

- I found we verify proposer signatures multiple times per slot. On
hoodi it takes 20ms to 40ms, if we receive all DataColumnSidecars by
gossip it would be a lot of time

<img width="1594" height="294" alt="Screenshot 2025-11-20 at 15 15 01"
src="https://github.com/user-attachments/assets/6797bb8b-e4a6-4b10-a939-30fc45658f45"
/>

proposer signatures are verified when we receive gossip block,
BlobSidecar or DataColumnSidecar

**Description**
- enhance `SeenBlockInput` with a map to cache verified proposer
signature by slot + root hex
- verify Block/Blob/DataColumnSidecar proposer signature on main thread
and cache. It will takes ~30ms to do that, and we only have to do it
once per slot

part of #8619

**Testing**
- [x] deployed to feat4
- [x] monitor result

---------

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-11-22 07:39:57 -05:00
Phil Ngo
194afd5582 chore: ai disclosure on PR template (#8614)
**Motivation**

We have been seeing too much AI slop from external contributors to this
repository. This PR aims to establish a norm of disclosure when any AI
assistance is used in a PR.

**Description**

This PR modifies the pull request template. This also removes an unused
section of the PR template which lists how to reproduce the solution.

This pull request closes #issue_number

**AI Assistance Disclosure**

- [x] 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.

I did not use any to create this PR.

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-11-15 17:16:52 -05: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
guha-rahul
4584616eeb feat: add Era File Reading and Writing (#8035)
**Motivation**

- tracks #7048 
-
[era](https://github.com/eth-clients/e2store-format-specs/blob/main/formats/era.md)
specs.

**Description**

- Adds functionality to read/write to
[e2s](613f4a9a50/docs/e2store.md (era-files))
files
```ts
import {open} from "node:fs/promises";
import {e2s} from "@lodestar/era";

const fh = await open("mainnet-xxxxxx-xxxxxxxx.era");
const entry = await e2s.readEntry(fh, 0);
entry.type == e2s.EntryType.Version
```
- Adds functionality to read/write era files
```ts
import {era} from "@lodestar/era";
import {config} from "@lodestar/config/default";
// open reader
const reader = await era.EraReader.open(config, "mainnet-xxxxx-xxxxxxxx.era");

// check number of groups
reader.groups.length === 1;

// read blocks
const slot = reader.groups[0].startSlot;

 // return snappy-frame compressed, ssz-serialized block at slot or null if a skip slot
 // throws if out of range
await reader.readCompressedBlock(slot);
// same, but for ssz-serialized block
await reader.readSerializedBlock(slot);
// same but for deserialized block
await reader.readBlock(slot);

// read state(s), one per group
// similar api to blocks, but with an _optional_ eraNumber param for specifying which group's state to read
await reader.readCompressedState(); 
await reader.readSerializedState();
await reader.readState();

// write era files
const writer = await era.EraWriter.create(config, "path/to/era");

// similar api to reader, can write compressed, serialized, or deserialized items
// first write all blocks for the era
await writer.writeBlock(block);
// ...
// then write the state
await writer.writeState(state);
// if applicable, continue writing eras of blocks and state (an era file can contain multiple eras, or "groups" as the spec states)
// when finished, must call `finish`, which will close the file handler and _rename_ the file to the spec-compliant name
await writer.finish();
```

- e2e test reads an era file, does all validation, writes an era fila,
does validation on that freshly created file
- requires the era file fixture to be downloaded (`cd packages/era/test
&& ./download_era_file.sh`)
  - e2e test is skipped (`test:e2e` is not defined for the era package)

---------

Co-authored-by: Cayman <caymannava@gmail.com>
2025-11-07 11:42:31 -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
Nazar Hussain
4131637eb3 test: improve type check performance (#8611)
**Motivation**

Improve type check performance. 

**Description**

- Improve the type check performance which was degraded in recent
changes. From `100s` to `8s` for `beacon-node` package.

```
time yarn check-types
yarn run v1.22.22
$ tsc
  Done in 105.85s.
yarn check-types  108.35s user 2.59s system 104% cpu 1:46.08 total
```

vs

```
time yarn check-types
yarn run v1.22.22
$ tsc
  Done in 8.46s.
yarn check-types  14.60s user 0.86s system 178% cpu 8.661 total
```

**Steps to test or reproduce**

- Run all jobs
2025-11-06 18:07:36 +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
Nico Flaig
983ef10850 feat: add proposer duties v2 endpoint (#8597)
Adds proposer duties v2 endpoint which works the same as v1 but uses
previous epoch to determine dependent root to account for deterministic
proposer lookahead changes in fulu.

https://github.com/ethereum/beacon-APIs/pull/563
2025-11-04 21:33:18 +00:00
Phil Ngo
6d7c41db1a chore: merge v1.36.0 back to unstable (#8608) 2025-11-04 13:36:26 -05:00
Phil Ngo
c5e987ff2b chore: release v1.36.0 (#8607) v1.36.0 2025-11-04 13:33:34 -05:00
philknows
6eb05a083a chore: bump package versions to 1.36.0 2025-11-04 12:28:29 -05:00
Matthew Keil
801b1f4f52 feat: log agent, version and peerid for batched gossip errors (#8604)
**Motivation**

Logs client meta for batch processed gossip errors
v1.36.0-rc.4
2025-11-04 09:51:03 -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
Nico Flaig
68f0ed9071 chore: include block slot in proposal signature errors (#8603)
Would be great to know for which slot this block was
2025-11-04 09:19:12 -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
Matthew Keil
6832b029e7 feat: log clientAgent and clientVersion for gossip errors (#8601)
**Motivation**
 
When gossip errors occur it will be helpful to see the client and
version sending the invalid gossip message
2025-11-03 13:57:13 -05:00
Matthew Keil
322b07c0ac fix: prevent columns that arrive after block import from getting processed (#8598)
**Motivation**

A bug was found on hoodi that needs to be rectified.
1) 1st column arrives via gossip
2) trigger getBlobsV2
3) many more columns (but not all) come via gossip
4) gossip block arrives
5) reqresp triggered via block arrival
6) get remaining data via reqresp
7) process blockInput 
8) delete cached blockInput
9) remaining columns arrive via gossip and get added to a new BlockInput
10) getBlobsV2 finishes and gossips "missing" columns not found on new
BlockInput
11) reqresp gets triggered again after timeout (from second batch of
gossip columns on second BlockInput)
12) second batch of columns and second block get reqresp downloaded and
second block Input goes for processing

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-11-03 17:44:56 +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
f1c85decbb chore: update gnosis preset (#8593) 2025-11-03 08:49:58 -05:00
Nico Flaig
faac5550fb chore: remove usage of prettyBytes in errors (#8589)
Closes https://github.com/ChainSafe/lodestar/issues/8566, this just
removes usage of `prettyBytes` as it's objectively bad to do that as it
doesn't allow external lookup.
2025-11-03 08:49:28 -05:00
Fatima Aminu
e6d0f574ee fix: resubscribe to beacon subnets on current epoch reorg (#8570)
**Motivation**

Not resubscribing to beacon subnets (prepareBeaconCommitteeSubnet) as
dependent root for current epoch changes. When this happens, previous
subscriptions are no longer valid

validator duties changed (slot, committee index, etc.)
is_aggregator results are different

**Description**

Added subnet resubscription logic to `handleAttesterDutiesReorg` that
fetches updated attester duties, rebuild beaconCommitteeSubscriptions
and resubscribe validators to the correct beacon subnets by calling the
prepareBeaconCommitteeSubnet api

Added test to handle: 
- resubscribe to beacon subnets when current epoch dependent root
changes,
- resubscribe when next epoch dependent root changes and
- not resubscribe when dependent root unchanged

There was intentional use of claude AI in writing the test.

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

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

Closes #6034

**Steps to test or reproduce**

<!--Steps to reproduce the behavior:
```sh
git checkout <feature_branch>
lodestar beacon --new-flag option1
```
-->

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-11-03 11:27:05 +00:00
kevaundray
5317389489 feat: update node-eth-kzg to 0.9.1 (#8594)
**Motivation**

This includes the update for the spec changes added here:
https://github.com/ethereum/consensus-specs/pull/4519

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-10-31 12:18:53 +00:00
NC
d8afb6dc39 chore: migrate to consensus-specs for spec tests (#8591)
[ethereum/consensus-spec-tests](https://github.com/ethereum/consensus-spec-tests)
are archived as of October 22.

We need to point to `ethereum/consensus-specs` for spec test vectors.
2025-10-31 09:46:43 +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
aec301c48f chore: downgrade enr without tcp multiaddr log to warning (#8586)
This happens if the node has ENRs without a tcp4 or tcp6 multiaddress
field and `--connectToDiscv5Bootnodes` flag is added. It's not really
critical so `warn` seems more appropriate than `error`.
2025-10-29 16:27:17 -04: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
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
twoeths
4dce14e7a1 chore: new BeaconChain dashboard (#8581)
**Motivation**

- track metrics introduced in #8530

**Description**

- as discussed, we create new BeaconChain dashboard to also store
untracked metrics:
  - seen cache
  - shuffling cache
  - buffer pool

<img width="1698" height="819" alt="Screenshot 2025-10-28 at 17 05 15"
src="https://github.com/user-attachments/assets/e6b4922f-bb02-4117-b809-7261a80d3e4f"
/>

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-10-28 09:38:35 -04:00