**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>
**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>
**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
**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.
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.
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>
- 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"
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
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>
**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>
**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>
**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
**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>
**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
**Motivation**
- #7280
**Description**
- Bun _does_ support imports, I was mistaken to say it didn't. The issue
I ran into was that the referenced file did not exist!
- Use the typescript directly
**Motivation**
Ensure that all spec tests are running for peerDas and fulu scopes.
Rename merkle.test.ts -> merkleProof.test.ts so it matches the other
file namings
---------
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
**Motivation**
- starting from fulu, we need to track number of peers per data column
subnet
**Description**
- track it in gossipsub
- also track peers and topics by fork boundary, not fork name
- will need to render this on the main Grafana dashboard after this PR
---------
Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
**Motivation**
- #7280
**Description**
- combined with #8448, `surpressTranspileTS: true` is needed for workers
to use typescript source directly without transpiling it (and
incorrectly loading it via a commonjs loader)
- avoid worker `resourceLimits` - Bun doesn't implement it, it throws if
you use it
- use `datastore-fs` instead of `datastore-level` for backing our libp2p
database -- Note this is changed unilaterally (affecting current nodejs
usage)
- use assemblyscript chacha20-poly1305 - bun doesn't support the native
crypto implementation
**Motivation**
- #7280
**Description**
- Add `"bun"` export to all packages that points to the _typescript
source_ rather than the transpiled javascript
- Allows for bun to use typescript directly
**Motivation**
- reflect the in-progress PeerDAS dashboard to our source code
**Description**
- PeerDAS dashboard was updated but we did not track it in our source
code, need to sync it now and review/revise later
Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
**Motivation**
Enable the organize import back which was disabled in #7982 to isolate
the changes for import ordering
**Description**
- Update the organize import config
- Fix all linting errors
**Steps to test or reproduce**
- Run all tests
---------
Co-authored-by: Cayman <caymannava@gmail.com>
**Motivation**
This PR schedules Fulu fork and BPO1 and BPO2 on remaining testnets
Sepolia and Hoodi.
**Description**
Updates network configs for Fulu fork
Includes BPO1 and BPO2 configs
For both Sepolia and Hoodi
As defined in Sepolia: https://github.com/eth-clients/sepolia/pull/111
As defined in Hoodi: https://github.com/eth-clients/hoodi/pull/21
Wait for confirmation of these remaining testnets configs before
merging.
**Motivation**
Use best of the linting capabilities to avoid any error slipped through.
**Description**
- Enable few promise based rules
- Restrict few imports from private paths
**Steps to test or reproduce**
- Run all tests
---------
Co-authored-by: Cayman <caymannava@gmail.com>
**Motivation**
Make sure the Lodestar starts running in Bun runtime.
**Description**
- Add subpath imports supported in Bun and NodeJS.
-
**Steps to test or reproduce**
Run all tests
**Note**
The CLI finally starts to run, next go with command by command to see
what's breaking, starting the `beacon` cmd.
```
bun run --bun bin/lodestar.js --help
🌟 Lodestar: TypeScript Implementation of the Ethereum Consensus Beacon Chain.
* Version: v1.33.0/nh/bun-wrappers/07d2010
* by ChainSafe Systems, 2018-2025
Commands:
beacon Run a beacon chain node
validator Run one or multiple validator clients
lightclient Run lightclient
dev Quickly bootstrap a beacon node and multiple validators. Use for
development and testing
bootnode Run a discv5 bootnode. This will NOT perform any beacon node func
tions, rather, it will run a discv5 service that allows nodes on
the network to discover one another.
Options:
--dataDir Lodestar root data directory[string]
--network Name of the Ethereum Consensus chain
network to join
[string] [choices: "mainnet", "gnosis", "sepolia", "holesky", "hoodi", "chiado
", "ephemery", "dev"] [default: mainnet]
--paramsFile Network configuration file [string]
--rcConfig RC file to supplement command line a
rgs, accepted formats: .yml, .yaml,
.json [string]
--supernode Subscribe to and custody all data co
lumn sidecar subnets [boolean]
--terminal-total-difficulty-override Terminal PoW block TTD override
[string]
--terminal-block-hash-override Terminal PoW block hash override
[string]
--terminal-block-hash-epoch-override Terminal PoW block hash override act
ivation epoch [string]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
📖 For more information, check the CLI reference:
* https://chainsafe.github.io/lodestar/reference/cli✍️ Give feedback and report issues on GitHub:
* https://github.com/ChainSafe/lodestar
```
**Motivation**
- we want to know more insight of ColumnReconstructionTracker
**Description**
- add logs to ColumnReconstructionTracker
- fix metrics of ColumnReconstructionTracker: centralize to 1 place and
make it better to render on Grafana
- remove unused error
Closes#8402
---------
Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
Co-authored-by: Cayman <caymannava@gmail.com>
The rate limiter currently only counts the number of blocks requested
but our quota is based on `MAX_REQUEST_DATA_COLUMN_SIDECARS`. We need to
account for the number of columns requested as otherwise we are
undercharging by a factor of up to 128.
**Motivation**
- got a case where all columns came timely while block came very late
and we did not trigger `incompleteBlockInput` event
**Description**
- trigger `incompleteBlockInput` in that case
Closes#8405
Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
**Motivation**
- we want to know the result of getBlobsV2 and how it helps our block
import
**Description**
- add logs and metrics to GetBlobsTracker
Closes#8401
---------
Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
**Motivation**
- when validating a gossip block and got a `PARENT_UNKNOWN` error, we
should emit `unknownParent` event instead of `incompleteBlockInput`
event
**Description**
- do that in gosssip handler
- add `ChainEvent.incompleteBlockInput` test to unknownBlockSync e2e
test
Closes#8415Closes#8417
Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
Noticed the type isn't correct as
[ExecutionPayloadV3](9a7b40cc08/src/engine/cancun.md (L41-L61))
doesn't contain `parentBeaconBlockRoot` as it's passed as part of
payload attributes.
## Summary
This PR implements the refactoring suggested in #7974 to make
`commonBlockBodyPromise` a required parameter when calling
`produceBlock` and `produceBlindedBlock` methods.
## Changes
- Made `commonBlockBodyPromise` required in the chain interface
(`IBeaconChain`)
- Updated chain implementation to reflect the required parameter
- Removed the TODO comment and optional parameter from
`produceBlockBody` function
- Removed fallback calls to `produceCommonBlockBody.call()` within
`produceBlockBody`
- Updated tests to provide the required `commonBlockBodyPromise`
parameter
## Rationale
As discussed in the original issue, making `commonBlockBodyPromise`
required ensures that the promise is always provided by callers,
eliminating the need for fallback logic inside `produceBlockBody`. This
simplifies the code and makes the dependency explicit.
## Testing
- ✅ All TypeScript type checks pass (`yarn check-types`)
- ✅ Linting passes (`yarn lint`)
- ✅ Updated affected tests to work with the new required parameter
Resolves#7974🤖 Generated with [Claude Code](https://claude.ai/code)
---------
Co-authored-by: Claude <noreply@anthropic.com>