10951 Commits

Author SHA1 Message Date
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
8ff2023892 test: fix broken spec tests for merkle proofs (#8469)
**Motivation**

Make sure all specs passes.

**Description**

- Fix the broken spec tests 
- Add condition to fix the types used for deserialization. 

Closes #7839 

**Steps to test or reproduce**

Run all tests

---------

Co-authored-by: Cayman <caymannava@gmail.com>
2025-10-20 09:05:07 -04:00
Nazar Hussain
a0d00ac6dc chore: cleanup types exports for all packages (#8434)
**Motivation**

Make the types exports consistent for all packages. 

All modern runtimes support [conditional
exports](https://nodejs.org/api/packages.html#conditional-exports) and
there are caveats when we have both conditional exports and normal
exports present in a package.json. This PR tend to make all exports
follow same consistent and modern pattern.

**Description**

- We were using subpath exports for some packages and module exports for
other
- Keep all the types export consistent as subpath exports.
- Remove "types" and "exports` directive from package.json 
- Remove `typesVersions`, this is useful only if we have different
version of types for different versions of Typescript. Or having
different types files for different file paths.


**Steps to test or reproduce**

- Run all CI
2025-10-20 09:03:08 -04:00
Nico Flaig
f259361847 fix: ignore already known data column sidecars (#8542)
**Motivation**

This was brought up in the Fusaka bug bounty, when we receive a already
known data column sidecar with the same block header and column index,
the gossip message is accepted and rebroadcast without any additional
verification.

This allows a malicious peer to send a data column sidecar with the same
block header and column index but an invalid block header signature
which we would accept and rebroadcast and get downscored by our peers.

**Description**

Ignore already known data column sidecars (based on block header and
column index). We could also consider to run
`validateGossipDataColumnSidecar` on those sidecars to penalize the node
sending us the data but it's just additional work for us and
`GossipAction.IGNORE` seems sufficient.
2025-10-17 07:22:19 +01:00
twoeths
fe5f423da3 chore: more logs for maybeArchiveState() (#8541)
**Motivation**

- this task runs once per epoch so there should be no issue being more
verbose on the log

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-10-16 11:05:20 +01:00
Cayman
43f2c7cbbd fix: respect reverse and limit in bun leveldb controller (#8529)
**Motivation**

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

**Description**

- In #8526 it was discovered that the leveldb controller did not respect
`reverse`
- Visual review of the code shows it doesn't respect `reverse` nor
`limit`
- Add support for both `reverse` and `limit`
2025-10-16 09:42:04 +07:00
Nico Flaig
b53af9d0a5 fix: only trigger get blobs and data column reconstruction if missing data (#8536)
We check for both block and all data
[here](f069a45d1f/packages/beacon-node/src/network/processor/gossipHandlers.ts (L559))
but if for some reason we already have all data at this point we don't
wanna trigger get blobs or data column reconstruction if just the block
is missing.
2025-10-15 16:36:14 +01:00
twoeths
d42eb95bf0 chore: track computeDeltas() metrics on Grafana (#8539)
**Motivation**

- a follow up of #8531

**Description**
- track `computeDeltas()` metrics on "Block processor" dashboard

<img width="1686" height="616" alt="Screenshot 2025-10-15 at 11 22 05"
src="https://github.com/user-attachments/assets/cc942c0f-9f65-4730-aeec-f7de2070f81a"
/>

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-10-15 10:48:27 -04:00
Nico Flaig
131ab2dcbe chore: simplify start epoch in head chain range sync (#8535)
This simplifies the calculation of `startEpoch` in head chain range
sync.

We check the remote finalized epoch against ours here


d9cc6b90f7/packages/beacon-node/src/sync/utils/remoteSyncType.ts (L33)

This means `remote.finalizedEpoch == local.finalizedEpoch` in this case
and local head epoch should always be >= finalized epoch which means we
can simplify use epoch of `local.headSlot` here.

cc @twoeths
2025-10-14 20:50:11 +01:00
Nico Flaig
f069a45d1f fix: ensure data column sidecars respect blob limit (#8534)
**Motivation**

See https://github.com/ethereum/consensus-specs/pull/4650

**Description**

Ensure data column sidecars respect blob limit by checking that
`kzgCommitments.length` of each data column sidecar does not exceed
`getMaxBlobsPerBlock(epoch)`.
2025-10-14 09:50:43 -04:00
twoeths
6d67a79656 feat: track computeDeltas metrics (#8531)
**Motivation**

- track/maintain computeDeltas() metrics

**Description**

- track computeDeltas() duration, number of 0 deltas,
equivocatingValidators, oldInactiveValidators, newInactiveValidators,
unchangedVoteValidators, newVoteValidators
- as part of investigation of #8519 we want to make sure metrics are the
same with Bun

part of #8519

**Metrics collected**
- hoodi

<img width="1020" height="609" alt="Screenshot 2025-10-14 at 15 08 29"
src="https://github.com/user-attachments/assets/4b0ab871-ce04-43c9-8b79-73c13a843f4a"
/>

- mainnet
<img width="958" height="617" alt="Screenshot 2025-10-14 at 15 08 54"
src="https://github.com/user-attachments/assets/bc264eb1-905d-4f90-bd17-39fb58068608"
/>

- updateHead() is actually ~5ms increase

<img width="842" height="308" alt="Screenshot 2025-10-14 at 15 09 50"
src="https://github.com/user-attachments/assets/ec082257-c7c0-4ca3-9908-cd006d23e1de"
/>

- but it's worth to have more details of `computeDeltas`, we saved ~25ms
after #8525

<img width="1461" height="358" alt="Screenshot 2025-10-14 at 15 11 29"
src="https://github.com/user-attachments/assets/4cffee0e-d0c0-4f74-a647-59f69af0fd99"
/>

---------

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-10-14 09:47:45 -04:00
twoeths
b739d2d697 feat: track performance of processFinalizedCheckpoint() (#8530)
**Motivation**

- investigate and maintain the performance of
`processFinalizedCheckpoint()`
- this is part of #8526

**Description**

- track duration of `processFinalizedCheckpoint()` by tasks, the result
on a hoodi node, it shows that `FrequencyStateArchiveStrategy` takes the
most time

<img width="941" height="297" alt="Screenshot 2025-10-14 at 13 45 38"
src="https://github.com/user-attachments/assets/ef440399-538b-4a4a-a63c-e775745b25e6"
/>


- track different steps of `FrequencyStateArchiveStrategy`, the result
shows that the mainthread is blocked by different db queries cc
@wemeetagain

<img width="1291" height="657" alt="Screenshot 2025-10-14 at 13 46 36"
src="https://github.com/user-attachments/assets/3b19f008-c7d8-49a4-9dc5-e68b1a5ba2a5"
/>

part of #8526

---------

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-10-14 09:28:12 -04:00
Nico Flaig
c7f3e8d129 fix: do not create default cache entry for unknown proposers (#8532)
**Motivation**

If we don't have the proposer index in cache when having to build a
block, we create a default entry
[here](d9cc6b90f7/packages/beacon-node/src/chain/produceBlock/produceBlockBody.ts (L196)).
This shouldn't happen in normal circumstances as proposers are
registered beforehand, however if you produce a block each slot for
testing purposes this affects the custody of the node as it will have up
to 32 validators in proposer cache (assuming a block each slot) and
since we never reduce the cgc it will stay at that value.

Logs from Ethpandaops from a node without attached validators but that's
producing a block each slot
```
Oct-14 09:12:00.005[chain]         verbose: Updated target custody group count finalizedEpoch=272653, validatorCount=32, targetCustodyGroupCount=33
```
```
Oct-14 09:12:00.008[network]         debug: Updated cgc field in ENR custodyGroupCount=33
```

**Description**

Do not create default cache entry for unknown proposers by using normal
`Map` and just fall back to `suggestedFeeRecipient` if there isn't any
value. The behavior from a caller perspective stays the same but we no
longer create a proposer cache entry for unknown proposers.
2025-10-14 09:18:00 -04:00
Fatima Aminu
d9cc6b90f7 feat: add more specific error codes to voluntary exit error (#8486)
**Motivation**

Voluntary exit validation previously returned only a boolean, which
gives a vague error codes and may cause harder debugging.
This PR aims to improve debuggability by providing clearer error message
and feedback during validator exits.

**Description**

<!-- A clear and concise general description of the changes of this PR
commits -->
This PR introduces the VoluntaryExitValidity enum to provide granular
reasons for voluntary exit validation failures.
It refactors processVoluntaryExit and getVoluntaryExitValidity to return
specific validity states, rather than a simple boolean.
Beacon node validation logic now maps these validity results to error
codes (VoluntaryExitErrorCode) for clearer gossip and API handling.
This improves debuggability and aligns exit validation with consensus
spec requirements.

Closes #6330 

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-10-13 16:58:36 +01:00
Nico Flaig
598c1ec54e feat: update networking config to match CL spec (#8510)
**Motivation**

Conform to CL spec

**Description**

- move networking constants to config
- remove constants no longer part of spec
- enable "p2p-interface.md" in config test

Closes https://github.com/ChainSafe/lodestar/issues/6351
Closes https://github.com/ChainSafe/lodestar/issues/7529
2025-10-13 14:44:41 +01:00
Nico Flaig
6604fa5719 fix: avoid emitting stale light client updates (#8522)
- Closes https://github.com/ChainSafe/lodestar/issues/7476
2025-10-13 09:07:20 -04:00
twoeths
4fe86ae0ee fix: avoid Set.has() in computeDeltas() (#8525)
**Motivation**

- while investigating #8519 I found a performance issue with
`computeDeltas()` where we check for `Set.has()` for every item in the
big validator index loop

**Description**

- sort the `equivocatingIndices` set then track
equivocatingValidatorIndex to avoid `Set.has()` there
- fix perf test to include some equivocating indices


**Benchmark on my local environment**

- NodeJS: it's 1.53x faster

before
```
  computeDeltas
    ✔ computeDeltas 1400000 validators 300 proto nodes                    73.65370 ops/s    13.57705 ms/op        -        931 runs   30.1 s
    ✔ computeDeltas 1400000 validators 1200 proto nodes                   73.44709 ops/s    13.61524 ms/op        -        922 runs   30.0 s
    ✔ computeDeltas 1400000 validators 7200 proto nodes                   73.59195 ops/s    13.58844 ms/op        -        937 runs   30.0 s
    ✔ computeDeltas 2100000 validators 300 proto nodes                    49.27426 ops/s    20.29457 ms/op        -        623 runs   30.1 s
    ✔ computeDeltas 2100000 validators 1200 proto nodes                   49.11422 ops/s    20.36070 ms/op        -        614 runs   30.1 s
    ✔ computeDeltas 2100000 validators 7200 proto nodes                   48.75805 ops/s    20.50943 ms/op        -        619 runs   30.1 s

```

after
```
  computeDeltas
    ✔ computeDeltas 1400000 validators 300 proto nodes                    113.6256 ops/s    8.800830 ms/op        -       1076 runs   30.1 s
    ✔ computeDeltas 1400000 validators 1200 proto nodes                   112.0909 ops/s    8.921329 ms/op        -       1079 runs   30.0 s
    ✔ computeDeltas 1400000 validators 7200 proto nodes                   111.5792 ops/s    8.962247 ms/op        -       1068 runs   30.1 s
    ✔ computeDeltas 2100000 validators 300 proto nodes                    75.48259 ops/s    13.24809 ms/op        -        727 runs   30.1 s
    ✔ computeDeltas 2100000 validators 1200 proto nodes                   74.93052 ops/s    13.34570 ms/op        -        707 runs   30.1 s
    ✔ computeDeltas 2100000 validators 7200 proto nodes                   74.82280 ops/s    13.36491 ms/op        -        751 runs   30.0 s

```

- Bun: it's 3.88x faster
before
```
  computeDeltas
    ✔ computeDeltas 1400000 validators 300 proto nodes                    103.6817 ops/s    9.644905 ms/op   x1.578       1791 runs   30.0 s
    ✔ computeDeltas 1400000 validators 1200 proto nodes                   103.4132 ops/s    9.669949 ms/op   x1.580       1800 runs   30.1 s
    ✔ computeDeltas 1400000 validators 7200 proto nodes                   103.7312 ops/s    9.640297 ms/op   x1.578       1745 runs   30.1 s
    ✔ computeDeltas 2100000 validators 300 proto nodes                    68.86443 ops/s    14.52128 ms/op   x1.583       1188 runs   30.0 s
    ✔ computeDeltas 2100000 validators 1200 proto nodes                   68.66082 ops/s    14.56435 ms/op   x1.585       1195 runs   30.1 s
    ✔ computeDeltas 2100000 validators 7200 proto nodes                   68.49115 ops/s    14.60043 ms/op   x1.592       1194 runs   30.1 s
```

after
```
  computeDeltas
    ✔ computeDeltas 1400000 validators 300 proto nodes                    407.0697 ops/s    2.456582 ms/op   x0.255       3117 runs   30.1 s
    ✔ computeDeltas 1400000 validators 1200 proto nodes                   402.2402 ops/s    2.486077 ms/op   x0.257       2838 runs   30.0 s
    ✔ computeDeltas 1400000 validators 7200 proto nodes                   401.5803 ops/s    2.490162 ms/op   x0.258       2852 runs   30.0 s
    ✔ computeDeltas 2100000 validators 300 proto nodes                    265.5509 ops/s    3.765757 ms/op   x0.259       1988 runs   30.1 s
    ✔ computeDeltas 2100000 validators 1200 proto nodes                   267.6306 ops/s    3.736494 ms/op   x0.257       2026 runs   30.0 s
    ✔ computeDeltas 2100000 validators 7200 proto nodes                   266.0949 ops/s    3.758058 ms/op   x0.257       2035 runs   30.1 s
```

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-10-13 09:05:52 -04:00
Nico Flaig
a2a22d66ef chore: remove listener of blob sidecars chain event on close (#8520) 2025-10-13 09:58:54 +01: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
Phil Ngo
f657221d88 chore: merge v1.35.0 back to unstable (#8514) 2025-10-08 18:54:55 -04:00
Phil Ngo
a8e30898c4 chore: v1.35.0 release (#8513) v1.35.0 2025-10-08 18:29:41 -04:00
philknows
825a186b76 chore: bump package versions to 1.35.0 2025-10-08 18:10:13 -04:00
Nico Flaig
643707ecd3 fix: update gnosis slot duration ms to 5000 (#8512) 2025-10-08 23:03:16 +01:00
Nico Flaig
7a240d3631 feat: support serving blob sidecars post fulu (#8506)
**Motivation**

To make transition to `getBlobs` api smoother and make Lodestar work
with v0.29.0 release of checkpointz
https://github.com/ethpandaops/checkpointz/issues/215, we should be
serving blob sidecars even post fulu from `getBlobSidecars` api.

**Description**

Instead of throwing an error, we do the following now post fulu
- fetch data column sidecars for block from db (if we custody at least
64 columns)
- reconstruct blobs from data column sidecars
- reconstruct blob sidecars from blobs (recompute kzg proof and
inclusion proof)
2025-10-07 10:01:42 -04:00
Cayman
497d67cb8a fix: use datastore-level by default (#8503)
**Motivation**

- Review of #8468 metrics
- In https://github.com/ChainSafe/lodestar/pull/8449, use of
`datastore-level` was unilaterally removed in favor of the bun-supported
`datastore-fs`
- This caused a regression

**Description**
- use `datastore-level` by default, only use `datastore-fs` in bun

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-10-06 15:51:17 -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
Phil Ngo
f2a741bbe4 docs: update contributing.md to include AI disclosure (#8498)
**Motivation**

Recently, we have been experiencing many instances of AI generated slop
submitted by first time contributors and a policy rework is needed to
ensure our time is respected whilst allowing an external contributor
freely contribute to further enhancing this project. This proposal
ensures that new contributors self-disclose any use of AI technologies
as part of their submission to minimize time waste and allow issues to
be resolved with thorough understanding of the output at hand.

**Description**

This PR:
- Adds an AI Assistance Notice to contribution.md
- Moves important context for first time contributors to the top of the
document
- Corrects minor grammar

Additional credit to @nflaig and [Ghostly's
policy](https://github.com/ghostty-org/ghostty/blob/main/CONTRIBUTING.md#ai-assistance-notice)
to approach minimizing this problem.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-10-06 14:47:52 -04:00
Nico Flaig
f45a2be721 fix: unsubscribe from blob_sidecar topics during fulu fork transition (#8497) 2025-10-06 11:04:02 +01:00
Nico Flaig
894daf8b44 fix: return spec constants starting with 0x as hex strings instead of decimal (#8495)
- Closes https://github.com/ChainSafe/lodestar/issues/7710

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-10-06 15:44:37 +08: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
Nico Flaig
c9deb9b59f fix: use previous slot to get sync aggregate for block (#8494)
**Motivation**

Since https://github.com/ChainSafe/lodestar/pull/7927 we started to use
parent slot (the slot of parent block) to get sync aggregate for block
but this can cause `BLOCK_ERROR_INVALID_SIGNATURE` during fork
transition as might include sync aggregates into our block that are
older than block slot - 1 which is used to compute domain during
signature verification.


8961b06c11/packages/state-transition/src/block/processSyncCommittee.ts (L81)

This means we will reject our own block due to invalid signature if
there are missed slots during the epoch transition.


> we currently hard code parent slot as producedSlot - 1 which is
incorrect in reorg scenario

This was the motivation from the previous change but this doesn't seem
right, sync committee messages are produced at latest 4 seconds into the
slot so if we re-org the block due to it being weak/late then sync
committee votes will also be for parent block root of that block and not
the block itself.

So irrespective of block being reorged or not we should always include
sync committee messages from previous slot.

**Description**

Use previous slot to get sync aggregate for block to avoid
`BLOCK_ERROR_INVALID_SIGNATURE` in case there are missed slots.
2025-10-03 11:32:34 +01:00
Nico Flaig
8961b06c11 chore: ignore local tsbuildinfo files in docker builds (#8492)
Local docker builds (with existing build artifacts) no longer work since
https://github.com/ChainSafe/lodestar/pull/8481 because the file
`packages/cli/tsconfig.build.tsbuildinfo` is copied to docker build
which causes typescript to skip the build, but we are not copying the
`lib` which means the whole build is missing (and not rebuilt). The
tsbuildinfo is usually part of `lib` which is why this was no issue
before.

I believe this happens because `"rootDir": "src"` was added to tsconfig,
there might be a different way to fix this but in general we don't want
to copy tsbuildinfo files into docker builds.
2025-10-02 06:59:41 -04:00
NC
287e63792e feat: wire in gloas containers (#8485)
Update gloas types in `packages/types/src/types.ts` to use the
containers defined in #8464 and fix all type error that come along with
it

---------

Co-authored-by: Nico Flaig <nflaig@protonmail.com>
2025-10-02 08:44:56 +00:00
Cayman
792fcea33a fix: update regen caller for data column (#8487)
## Motivation

Saw this metric after holesky fusaka fork and was really confused
<img width="957" height="309" alt="Screenshot from 2025-10-01 08-46-08"
src="https://github.com/user-attachments/assets/d8fc7d96-ec48-4709-9ee9-30b69dd94eee"
/>
2025-10-01 13:06:26 +00: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
Ragnar
51e1ede62c docs: add comprehensive usage documentation to docker-compose.local.yml (#8441)
- Replace TODO comment with detailed usage instructions 
- Add step-by-step guide for local monitoring setup
- Include port information and service URLs
- Explain host.docker.internal configuration"
2025-09-30 17:22:00 -04:00
Nico Flaig
901d719660 chore: add gloas fork constants to unscheduled networks (#8484)
This avoids an issue we had previously where configs that extend mainnet
preset would inherit wrong parameters. This just ensures this cannot
happen in case we those will be forked after mainnet.

similar to https://github.com/ChainSafe/lodestar/pull/7401
2025-09-30 23:31:07 +08:00
Nico Flaig
248b252a94 chore: update error response for validator publish endpoints (#8480)
**Motivation**

Same as https://github.com/ChainSafe/lodestar/pull/7113

**Description**

Update error response for validator publish endpoints
- throw `IndexedError` to return individual failures
- move individual items error logs to `verbose`
2025-09-29 09:33:22 -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
fcf8d024ea feat: add gloas containers (#8464)
Add gloas containers and minimal change to gloas type. 

All remaining gloas type update will be in the next PR

Part of #8439
2025-09-26 17:02:42 +01:00
Nico Flaig
c1880f6940 chore: add gloas timings to slot time functions (#8474) 2025-09-26 09:06:57 -04:00
twoeths
549f58dd39 fix: not throw error in removeEagerlyPersistedBlockInputs (#8472)
**Motivation**

- when we remove an eagerly persisted block input, it's very normal that
we did not have any columns persisted
- but right now it threw this error as shown in #8457

```
Sep-23 19:16:55.002[chain]            �[33mwarn�[39m: Error pruning eagerly imported block inputs, DB may grow in size if this error happens frequently slot=30 - Invalid dataColumnSidecars=0 for custody expected custodyColumnsLen=128
Error: Invalid dataColumnSidecars=0 for custody expected custodyColumnsLen=128
```

**Description**

- do not throw error in this case

part of #8457

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-09-26 08:53:33 -04:00
twoeths
91dadf81de fix: hasAllData in createFromColumn() api (#8473)
**Motivation**

- when investigating #8457 I found that we did not set `hashAllColumn()`
correctly at the 1st time

**Description**

- correct `hasAllData` when creating IBlockInput from column
- nice to have: in `verifyBlocksDataAvailability`, only wait for all
data if not has all data. This is to make it consistent to
`writeBlockInputToDb()` where the error did not happen, see
https://github.com/ChainSafe/lodestar/issues/8457#issuecomment-3337347372

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-09-26 08:52:24 -04: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
Nico Flaig
21ba2777a9 chore: add git to Dockerfile (#8470)
**Motivation**

The docker build no longer works since
https://github.com/ChainSafe/lodestar/pull/8462


see [most recent job
run](https://github.com/ChainSafe/lodestar/actions/runs/18008927165/job/51241364972)
```
#13 [linux/amd64 build_src 5/6] RUN yarn install --non-interactive --frozen-lockfile &&   yarn build &&   yarn install --non-interactive --frozen-lockfile --production
#13 ERROR: process "/bin/sh -c yarn install --non-interactive --frozen-lockfile &&   yarn build &&   yarn install --non-interactive --frozen-lockfile --production" did not complete successfully: exit code: 1

#15 [linux/arm64 build_deps 3/6] RUN apt-get update && apt-get install -y g++ make python3 python3-setuptools && apt-get clean && rm -rf /var/lib/apt/lists/*
#15 67.27 Preparing to unpack .../54-libfreetype6_2.12.1+dfsg-5+deb12u4_arm64.deb ...
#15 67.27 Unpacking libfreetype6:arm64 (2.12.1+dfsg-5+deb12u4) ...
#15 CANCELED
------
 > [linux/amd64 build_src 5/6] RUN yarn install --non-interactive --frozen-lockfile &&   yarn build &&   yarn install --non-interactive --frozen-lockfile --production:
0.219 yarn install v1.22.22
0.317 [1/5] Validating package.json...
0.336 [2/5] Resolving packages...
0.646 [3/5] Fetching packages...
28.83 error Couldn't find the binary git
28.83 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
------
Dockerfile:11
--------------------
  10 |     
  11 | >>> RUN yarn install --non-interactive --frozen-lockfile && \
  12 | >>>   yarn build && \
  13 | >>>   yarn install --non-interactive --frozen-lockfile --production
  14 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c yarn install --non-interactive --frozen-lockfile &&   yarn build &&   yarn install --non-interactive --frozen-lockfile --production" did not complete successfully: exit code: 1
Error: Process completed with exit code 1.
```

We need to add `git` to be able to install `@lodestar/bun`

**Description**

Add `git` to Dockerfile to be able to install dependencies that
reference a github repository

eg. `@lodestar/bun`
```jsonc
"@lodestar/bun": "git+https://github.com/ChainSafe/lodestar-bun.git
```
2025-09-25 14:49:03 +00: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
twoeths
98d359db41 fix: untrusted slot in network processor (#8466)
**Motivation**

- we see different slots for the same root in `BlockInputSync` logs,
this causes confusion
- this was added last week in #8416

**Description**

- the [root, slot] is not trusted in network processor because messages
could be originated from an out-of-sync node
- we actually don't need the slot in BlockInputSync, it's just a nice to
have but caused confusion. So I reverted that part: do not emit slot to
`BlockInputSync` from network processor
- log the full root hex

Closes #8465

---------

Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
2025-09-25 07:29:19 -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
NC
643a1132ec fix: sort cell indices before calling recoverCellsAndKzgProofs (#8450)
For context please view
https://discord.com/channels/593655374469660673/1229813597501395028/1419794786121945141
.

The latest spec requires cell indices to be sorted in
[`recover_cells_and_kzg_proofs
`](340d23358a/specs/fulu/polynomial-commitments-sampling.md (L805))
so we need to sort them before passing it to kzg.
2025-09-24 10:58:50 -07:00
Matthew Keil
83de5b8dea chore: move PR comments from #7947 that got closed (#8456)
**Motivation**

closes #8196 

Need to move over some comment fixes from #7947 that got closed and the
work was merged via separate PR.

Comments addressed are:
https://github.com/ChainSafe/lodestar/pull/7947#discussion_r2139589329
https://github.com/ChainSafe/lodestar/pull/7947#discussion_r2139595483
2025-09-23 20:40:09 +00:00