Commit Graph

10929 Commits

Author SHA1 Message Date
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
twoeths
1ddbe5d870 chore: use index2pubkey of BeaconChain (#8674)
**Motivation**

- once we have `state-transition-z`, we're not able to get
`index2pubkey` from a light view of BeaconState in beacon-node

**Description**

- in `beacon-node`, use `index2pubkey` of BeaconChain instead as a
preparation for working with `state-transition-z`
- it's ok to use `state.epochCtx.index2pubkey` in `state-transition`
since it can access the full state there

part of #8652

---------

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-12-11 14:19:08 -05:00
Nazar Hussain
34d4b7352f chore: update publish workflow for rc an stan;e (#8686)
**Motivation**

Use npm trusted publishing.

**Description**

- Fix the workflows for the `rc` and `stable`.
2025-12-10 11:39:49 -05:00
Nazar Hussain
255e56fb68 chore: pass secrets to nested publish workflows (#8684)
**Motivation**

Pass the workflow secrets in scenario of nested workflows.

**Description**

- Use `secrets: inherit` in case of workflows.
2025-12-10 10:57:09 -05:00
Nazar Hussain
f231d7e8ff chore: use github runners for publish workflow (#8683)
**Motivation**

Provide npm provenance for published packages.

https://docs.npmjs.com/generating-provenance-statements

**Description**

- Use github runners for publish workflows to cover the error. 

```
Error verifying sigstore provenance bundle: Unsupported GitHub Actions runner environment: "self-hosted". Only "github-hosted" runners are supported when publishing with provenance.
```
2025-12-10 10:32:52 -05:00
Nazar Hussain
d5b1e44150 chore: update publish workflow to use job syntax instead of steps (#8682)
**Motivation**

Enable npm trusted publishing

**Description**

- Use job syntax and not the steps.
2025-12-10 16:15:34 +01:00
Nazar Hussain
fe261483ef chore: use npm trusted publishing (#8675)
**Motivation**

Use more secure way publish a release.

**Description**

- Use `npm` [trusted
publishing](https://docs.npmjs.com/trusted-publishers)

---------

Co-authored-by: Matthew Keil <me@matthewkeil.com>
2025-12-10 09:55:26 -04:00
Cayman
688d5584ea feat: use snappy-wasm (#6483) (#8647)
**Motivation**
- #6483 is back 😂 
- Benchmarks show `snappy-wasm` is faster at compressing and
uncompressing than `snappyjs`.

**Description**

- Use `snappy-wasm` for compressing / uncompressing gossip payloads
- Add more `snappy` vs `snappyjs` vs `snappy-wasm` benchmarks

**TODO**
- [x] deploy this branch on our test fleet - deployed on feat3

```
  network / gossip / snappy
    compress
      ✔ 100 bytes - compress - snappyjs                                     335566.9 ops/s    2.980032 us/op        -        685 runs   2.54 s
      ✔ 100 bytes - compress - snappy                                       388610.3 ops/s    2.573272 us/op        -        870 runs   2.74 s
      ✔ 100 bytes - compress - snappy-wasm                                  583254.0 ops/s    1.714519 us/op        -        476 runs   1.32 s
      ✔ 100 bytes - compress - snappy-wasm - prealloc                        1586695 ops/s    630.2410 ns/op        -        481 runs  0.804 s
      ✔ 200 bytes - compress - snappyjs                                     298272.8 ops/s    3.352636 us/op        -        213 runs   1.22 s
      ✔ 200 bytes - compress - snappy                                       419528.0 ops/s    2.383631 us/op        -        926 runs   2.71 s
      ✔ 200 bytes - compress - snappy-wasm                                  472468.5 ops/s    2.116543 us/op        -        577 runs   1.72 s
      ✔ 200 bytes - compress - snappy-wasm - prealloc                        1430445 ops/s    699.0830 ns/op        -        868 runs   1.11 s
      ✔ 300 bytes - compress - snappyjs                                     265124.9 ops/s    3.771807 us/op        -        137 runs   1.02 s
      ✔ 300 bytes - compress - snappy                                       361683.9 ops/s    2.764845 us/op        -       1332 runs   4.18 s
      ✔ 300 bytes - compress - snappy-wasm                                  443688.4 ops/s    2.253834 us/op        -        859 runs   2.44 s
      ✔ 300 bytes - compress - snappy-wasm - prealloc                        1213825 ops/s    823.8420 ns/op        -        370 runs  0.807 s
      ✔ 400 bytes - compress - snappyjs                                     262168.5 ops/s    3.814341 us/op        -        358 runs   1.87 s
      ✔ 400 bytes - compress - snappy                                       382494.9 ops/s    2.614414 us/op        -       1562 runs   4.58 s
      ✔ 400 bytes - compress - snappy-wasm                                  406373.2 ops/s    2.460792 us/op        -        797 runs   2.46 s
      ✔ 400 bytes - compress - snappy-wasm - prealloc                        1111715 ops/s    899.5110 ns/op        -        450 runs  0.906 s
      ✔ 500 bytes - compress - snappyjs                                     229213.1 ops/s    4.362753 us/op        -        359 runs   2.07 s
      ✔ 500 bytes - compress - snappy                                       373695.8 ops/s    2.675973 us/op        -       2050 runs   5.99 s
      ✔ 500 bytes - compress - snappy-wasm                                  714917.4 ops/s    1.398763 us/op        -        960 runs   1.84 s
      ✔ 500 bytes - compress - snappy-wasm - prealloc                        1054619 ops/s    948.2100 ns/op        -        427 runs  0.907 s
      ✔ 1000 bytes - compress - snappyjs                                    148702.3 ops/s    6.724847 us/op        -        171 runs   1.65 s
      ✔ 1000 bytes - compress - snappy                                      423688.1 ops/s    2.360227 us/op        -        525 runs   1.74 s
      ✔ 1000 bytes - compress - snappy-wasm                                 524350.6 ops/s    1.907121 us/op        -        273 runs   1.03 s
      ✔ 1000 bytes - compress - snappy-wasm - prealloc                      685191.5 ops/s    1.459446 us/op        -        349 runs   1.01 s
      ✔ 10000 bytes - compress - snappyjs                                   21716.92 ops/s    46.04704 us/op        -         16 runs   1.24 s
      ✔ 10000 bytes - compress - snappy                                     98051.32 ops/s    10.19874 us/op        -        184 runs   2.39 s
      ✔ 10000 bytes - compress - snappy-wasm                                114681.8 ops/s    8.719783 us/op        -         49 runs  0.937 s
      ✔ 10000 bytes - compress - snappy-wasm - prealloc                     111203.6 ops/s    8.992518 us/op        -         49 runs  0.953 s
      ✔ 100000 bytes - compress - snappyjs                                  2947.313 ops/s    339.2921 us/op        -         12 runs   4.74 s
      ✔ 100000 bytes - compress - snappy                                    14963.78 ops/s    66.82801 us/op        -         70 runs   5.19 s
      ✔ 100000 bytes - compress - snappy-wasm                               19868.33 ops/s    50.33136 us/op        -         14 runs   1.21 s
      ✔ 100000 bytes - compress - snappy-wasm - prealloc                    24579.34 ops/s    40.68457 us/op        -         13 runs   1.06 s
    uncompress
      ✔ 100 bytes - uncompress - snappyjs                                   589201.6 ops/s    1.697212 us/op        -        242 runs  0.911 s
      ✔ 100 bytes - uncompress - snappy                                     537424.1 ops/s    1.860728 us/op        -        220 runs  0.910 s
      ✔ 100 bytes - uncompress - snappy-wasm                                634966.2 ops/s    1.574887 us/op        -        194 runs  0.808 s
      ✔ 100 bytes - uncompress - snappy-wasm - prealloc                      1846964 ops/s    541.4290 ns/op        -        559 runs  0.804 s
      ✔ 200 bytes - uncompress - snappyjs                                   395141.8 ops/s    2.530737 us/op        -        281 runs   1.22 s
      ✔ 200 bytes - uncompress - snappy                                     536862.6 ops/s    1.862674 us/op        -        274 runs   1.01 s
      ✔ 200 bytes - uncompress - snappy-wasm                                420251.6 ops/s    2.379527 us/op        -        129 runs  0.810 s
      ✔ 200 bytes - uncompress - snappy-wasm - prealloc                      1746167 ops/s    572.6830 ns/op        -        529 runs  0.804 s
      ✔ 300 bytes - uncompress - snappyjs                                   441676.2 ops/s    2.264102 us/op        -        898 runs   2.53 s
      ✔ 300 bytes - uncompress - snappy                                     551313.2 ops/s    1.813851 us/op        -        336 runs   1.11 s
      ✔ 300 bytes - uncompress - snappy-wasm                                494773.0 ops/s    2.021129 us/op        -        203 runs  0.912 s
      ✔ 300 bytes - uncompress - snappy-wasm - prealloc                      1528680 ops/s    654.1590 ns/op        -        465 runs  0.805 s
      ✔ 400 bytes - uncompress - snappyjs                                   383746.1 ops/s    2.605890 us/op        -        235 runs   1.11 s
      ✔ 400 bytes - uncompress - snappy                                     515986.6 ops/s    1.938035 us/op        -        158 runs  0.809 s
      ✔ 400 bytes - uncompress - snappy-wasm                                392947.8 ops/s    2.544867 us/op        -        322 runs   1.32 s
      ✔ 400 bytes - uncompress - snappy-wasm - prealloc                      1425978 ops/s    701.2730 ns/op        -        721 runs   1.01 s
      ✔ 500 bytes - uncompress - snappyjs                                   330727.5 ops/s    3.023637 us/op        -        173 runs   1.02 s
      ✔ 500 bytes - uncompress - snappy                                     513874.1 ops/s    1.946002 us/op        -        157 runs  0.806 s
      ✔ 500 bytes - uncompress - snappy-wasm                                389263.0 ops/s    2.568957 us/op        -        161 runs  0.914 s
      ✔ 500 bytes - uncompress - snappy-wasm - prealloc                      1330936 ops/s    751.3510 ns/op        -        672 runs   1.01 s
      ✔ 1000 bytes - uncompress - snappyjs                                  241393.9 ops/s    4.142606 us/op        -        126 runs   1.03 s
      ✔ 1000 bytes - uncompress - snappy                                    491119.6 ops/s    2.036164 us/op        -        201 runs  0.911 s
      ✔ 1000 bytes - uncompress - snappy-wasm                               361794.5 ops/s    2.764000 us/op        -        148 runs  0.910 s
      ✔ 1000 bytes - uncompress - snappy-wasm - prealloc                    959026.5 ops/s    1.042724 us/op        -        390 runs  0.909 s
      ✔ 10000 bytes - uncompress - snappyjs                                 40519.03 ops/s    24.67976 us/op        -         16 runs  0.913 s
      ✔ 10000 bytes - uncompress - snappy                                   202537.6 ops/s    4.937355 us/op        -        796 runs   4.43 s
      ✔ 10000 bytes - uncompress - snappy-wasm                              165017.6 ops/s    6.059960 us/op        -         52 runs  0.822 s
      ✔ 10000 bytes - uncompress - snappy-wasm - prealloc                   175061.5 ops/s    5.712277 us/op        -        130 runs   1.25 s
      ✔ 100000 bytes - uncompress - snappyjs                                4030.391 ops/s    248.1149 us/op        -         12 runs   3.71 s
      ✔ 100000 bytes - uncompress - snappy                                  35459.43 ops/s    28.20124 us/op        -         41 runs   1.67 s
      ✔ 100000 bytes - uncompress - snappy-wasm                             22449.16 ops/s    44.54509 us/op        -         13 runs   1.11 s
      ✔ 100000 bytes - uncompress - snappy-wasm - prealloc                  27169.50 ops/s    36.80598 us/op        -         13 runs  0.997 s
```

Closes #4170

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
Co-authored-by: twoeths <10568965+twoeths@users.noreply.github.com>
Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-12-08 23:20:08 -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
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