**Motivation**
Users reported in the v1.34.0 release that changes in the release
created an issue when ipv6 and ipv4 ports were the same:
```
✖ Error: Timeout: Did not receive an init message from worker after 300000ms. Make sure the worker calls expose().
```
**Description**
This PR bumps discv5 from 11.0.3 to 11.0.4 which includes the fix to
binding ipv4 and ipv6 on the same port in dual stack mode.
See: https://github.com/ChainSafe/discv5/pull/318
**Motivation**
Use the newer client versions to support only post-electra forks.
**Description**
- Update images versions
- Update the runner script
- Update tests
**Steps to test or reproduce**
- Run all tests
---------
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
**Motivation**
Use the more type aware version of Biome to get benefit from type safety
rules.
**Description**
- Keep the rules matching to previous behavior
- Add explanation to all ignore as it's required in new version
**Steps to test or reproduce**
Run all tests
---------
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
**Motivation**
Make the code transition for compatibility with the Bun.
**Description**
- The dependency `cpu-features` is not compatible with the `Bun`
- Removed the direct dependency
- Upgrade the `@chainsafe/persistent-merkle-tree` and `@chainsafe/ssz`
so the hasher detection is done implicitly.
- Latest commit for
[hahstree](e86a8b136a)
has the support for fallback, which is not used in the
`@chainsafe/persistent-merkle-tree`
**Steps to test or reproduce**
Run all tests
**Motivation**
This log is currently always emitted if a user starts the node for the
first time or when upgrading to next release since we now have
`persistNetworkIdentity` set to `true` by default. Hence I think a
warning is not the right log level here.
**Description**
Move peer id file error due to file not found to `debug`
~~Alternative could be to differentiate error, ie. still log errors
other than file not found (`ENOENT`) as warn but seems unlikely that if
file exists we will fail here.~~ went with this approach now
**Motivation**
- address
https://github.com/ChainSafe/lodestar/pull/6353#discussion_r2255325445
**Description**
Our block production and publishing data flow was messy. The data types
and utility functions are jumbled, duplicate functions, differences from
spec functions, etc. To that end, this refactors things that touch this
proposal data flow.
- Tweak the fork-agnostic `BlockContents` type to also include pre-deneb
`BeaconBlock`
- this allows us to remove `BlockOrContents` variables and types
- Remove `Contents` (It isn't actually needed)
- Collect all `produced*` caches into `blockProductionCache`
- make blinded block reconstruction more typesafe
- Separate blobs+proofs sanity validation from cells+proof sanity
validation
- Delete duplicated `BlobsBundle` type
- Remove duplicate spec function `computeDataColumnSidecars` in favor of
`getDataColumnSidecars*` functions
- Refactor `computeBlobSidecars` into `getBlobSidecars` from the spec
---------
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
**Motivation**
- Closes https://github.com/ChainSafe/lodestar/issues/7802
**Description**
- makes builder circuit breaker stricter, from previous 50% of blocks
missed down to 25%
- differentiate builder disabled due to failed status check vs. circuit
breaker activated
- updating wording in logs/errors `Execution builder` --> `External
builder`
**Motivation**
Sim test debug logs are way too verbose by default. We don't run mainnet
nodes with `DEBUG` set unless we wanna investigate a specific issue,
should take the same approach in sim tests.
**Description**
Disable `DEBUG` logs by default when running sim tests
**Motivation**
- https://github.com/ChainSafe/lodestar/issues/8097
- supersedes https://github.com/ChainSafe/lodestar/pull/8112
**Description**
- remove metrics from `CustodyConfig`. Instead, do metrics in
`BeaconChain` (set on initialization, set on update)
- add `initialCustodyGroupCount` opt that gets set at the CLI layer by
"doing the right thing" - comparing opts.supernode, the stored enr
value, and the config value.
- thread `initialCustodyGroupCount` thru the application
- update all `CustodyConfig` construction sites
This removes `NODE_CUSTODY_REQUIREMENT` config value as it doesn't seem
to be part of the spec. It seems like the purpose of this config right
now is to be able to pass down supernode requirements (ie. setting
requirement to 128) and potentially allow to override the custody
requirement for testing but this is a misuse how config should be
handled.
As discussed with @matthewkeil we don't need to manually set node
custody requirement or disable validator custody anymore and rather just
rely on `--supernode` flag to custody all groups or dynamic validator
custody.
**Motivation**
Noticed https://github.com/ChainSafe/lodestar/pull/7841 breaks kurtosis
runs as we check against mainnet genesis state root as it's the
`defaultNetwork`.
**Description**
Only check genesis state root if network is specified, since this isn't
really relevant for mainnet anyways and just new networks that are
launched it doesn't really make a difference as in those cases we
explicitly need to set `--network` and genesis state root check will be
done.
#**Motivation**
This PR adds validation of genesis state roots when initializing the
beacon node from a downloaded genesis state file. This helps ensure node
operators are working with the correct genesis state and can detect
potential tampering or misconfigurations. This validation is
particularly useful during testnet launches and provides an important
security check.
**Description**
Implements validation of genesis state root against expected values in
the network configuration.
Changes:
- Added `getGenesisStateRoot()` utility function to retrieve expected
roots for networks
- Added `genesisStateRoot` configuration property to all network files
(with initial value known only for hoodi testnet)
- Added validation logic that computes the hash tree root of downloaded
genesis state and compares against expected `genesisStateRoot`
Closes#7601
---------
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
**Motivation**
- `onlyConnect*` flags are not (and should not) used anymore so we
should remove it to reduce maintenance cost
cc @matthewkeil
Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
**Description**
Add two new options to persist orphaned blocks to disk:
- chain.persistOrphanedBlocks
- chain.persistOrphanedBlocksDir
Closes#4066
Please note that I couldn't test it because it requires running a node
receiving blocks that become orphaned after a while, and it's beyond my
current understanding of the repo.
---------
Co-authored-by: Cayman <caymannava@gmail.com>
**Motivation**
- kzg proof verification is expensive, shouldn't be hogging the main
thread
**Description**
- use https://github.com/crate-crypto/rust-eth-kzg instead of c-kzg
- update verification functions to async variants
**Motivation**
Discussions were previously ongoing to make our entire monorepo and
packages within Apache-2.0 license. The only remaining packages which
were previously under LGPL-v3 were the beacon node, cli, validator
packages.
**Description**
This PR marks the switch for all packages in the Lodestar monorepository
to be under one license, Apache-2.0 of which the majority of consensus
clients have adopted. This PR:
- Removes any instance of LGPLv3
- Switches all LICENSE to adopt Apache-2.0
- Removes CLA bot signing as part of our contribution.md
**Motivation**
- do not throw error for as-sha256 hasher, an addition to #7887
**Description**
- `log.warn` instead of throwing error
may want @KatyaRyazantseva to give it a try on her laptop
---------
Co-authored-by: Tuyen Nguyen <twoeths@users.noreply.github.com>
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
**Motivation**
A crash was reported by several parties running Lodestar on a VPS. The
problem was tracked down to no AVX support on the host which causes
OffchainLabs/hashtree to crash. The go binding do a similar check, at
the bindings level, and revert to a non-assembly SHA256 lib. This PR
does the same. Checks the hardware for the supported AVX types and
returns `as-sha256` hasher from the `hashtree` hasher so there is no
crash.
67979dccfc/src/hashtree.c (L53-L67)
**Motivation**
Get rid of dead code, improve code clarity, no more unused imports
**Description**
Add tsconfig to detect unused imports, variables, and functions
**Motivation**
Gnosis analysis shows that there is a lot of time spent on main thread
for running aggregateWithRandomness on main thread. Now that libp2p@v2
is more stable and so are some of the other conditions that triggered
our revert last time, looking to check this again to see what the
metrics look like for running not on main thread.
---------
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
**Motivation**
Based on concerns raised by @twoeths in
https://github.com/ChainSafe/lodestar/pull/7781#issuecomment-2849856198
we decided to put historical state regen (which triggers `loadState` in
certain cases) behind a feature flag as it may affect validator
performance and users should be aware of it when using the feature, the
primary use case for it anyways is for users that need a RPC node to
query this data, not operators that use Lodestar as their staking node
with attached validators.
**Description**
Make serving historical state opt-in
- adds new flag `--serveHistoricalState`
- only enables `HistoricalStateRegen` if flag is set
- throws error if data that requires historical state regen is fetched
**Open question:** do we want to add a check to each `loadState` call
specifically or inside `loadState` function itself? practically this
code path is only triggered if we return state as `Uint8Array` which
implies that it must be historically generated but this is no longer
possible without setting `--serveHistoricalState` flag after this PR.
d85e73aa12/packages/state-transition/src/util/loadState/loadState.ts (L20)