361 Commits

Author SHA1 Message Date
Jimmy Chen
95f12d0927 Bump version to v8.1.1 (#8853) 2026-02-27 16:48:56 +11:00
Jimmy Chen
8cf6ffac4b Update yanked keccak 0.1.5 to 0.1.6 (#8900)
Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
2026-02-27 16:22:19 +11:00
Jimmy Chen
edba56b9a6 Release v8.1.0 (#8749)
Closes #8681


  


Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
2026-02-05 04:40:20 +00:00
Jimmy Chen
c25a975929 Bump bytes to 1.11.1 to fix RUSTSEC-2026-0007 (#8743) 2026-02-04 12:09:05 +11:00
Jimmy Chen
7f065009a7 Implement custom OpenTelemetry sampler to filter uninstrumented traces (#8647)
Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
2026-01-22 05:11:26 +00:00
João Oliveira
33e41d3f44 update libp2p dependency to upstream (#8200)
Co-Authored-By: João Oliveira <hello@jxs.pt>
2026-01-20 19:45:48 +00:00
Mac L
3662e1ab7f Remove duplicated crypto dependencies (#8605)
#8547


  This unifies the following `crypto` dependencies to a single version each:

- `sha2`
- `hmac`
- `pbkdf2`
- `aes`
- `cipher`
- `ctr`
- `scrypt`
- `digest`


Co-Authored-By: Mac L <mjladson@pm.me>
2026-01-07 19:38:31 +00:00
Mac L
32f7615cc8 Update syn to 2.0.110 (#8563)
#8547


  We are currently using an older version of `syn` in `test_random_derive`. Updating this removes one of the sources of `syn` `1.0.109` in our dependency tree.


Co-Authored-By: Mac L <mjladson@pm.me>

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
2025-12-15 03:20:12 +00:00
Mac L
6a3a32515f Update strum to 0.27 (#8564)
#8547


  Update our `strum` dependency to `0.27`. This unifies our strum dependencies and removes our duplication of `strum` (and by extension, `strum_macros`).


Co-Authored-By: Mac L <mjladson@pm.me>

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
2025-12-15 03:20:10 +00:00
Mac L
f3fd1f210b Remove consensus/types re-exports (#8540)
There are certain crates which we re-export within `types` which creates a fragmented DevEx, where there are various ways to import the same crates.

```rust
// consensus/types/src/lib.rs
pub use bls::{
AggregatePublicKey, AggregateSignature, Error as BlsError, Keypair, PUBLIC_KEY_BYTES_LEN,
PublicKey, PublicKeyBytes, SIGNATURE_BYTES_LEN, SecretKey, Signature, SignatureBytes,
get_withdrawal_credentials,
};
pub use context_deserialize::{ContextDeserialize, context_deserialize};
pub use fixed_bytes::FixedBytesExtended;
pub use milhouse::{self, List, Vector};
pub use ssz_types::{BitList, BitVector, FixedVector, VariableList, typenum, typenum::Unsigned};
pub use superstruct::superstruct;
```

This PR removes these re-exports and makes it explicit that these types are imported from a non-`consensus/types` crate.


Co-Authored-By: Mac L <mjladson@pm.me>
2025-12-09 07:13:41 +00:00
Mac L
77d58437da Clarify alloy dependencies (#8550)
Previously, we had a pinned version of `alloy` to fix some crate compatibility issues we encountered during the migration away from `ethers`. Now that the migration is complete we should remove the pin. This also updates alloy crates to their latest versions.


Co-Authored-By: Mac L <mjladson@pm.me>
2025-12-09 06:03:02 +00:00
Mac L
4e958a92d3 Refactor consensus/types (#7827)
Organize and categorize `consensus/types` into modules based on their relation to key consensus structures/concepts.
This is a precursor to a sensible public interface.

While this refactor is very opinionated, I am open to suggestions on module names, or type groupings if my current ones are inappropriate.


Co-Authored-By: Mac L <mjladson@pm.me>
2025-12-04 09:28:52 +00:00
Moe Mahhouk
713e477912 feat: Add reproducible builds release workflows and push images to DockerHub (#7614)
This pull request introduces workflows and updates to ensure reproducible builds for the Lighthouse project. It adds two GitHub Actions workflows for building and testing reproducible Docker images and binaries, updates the `Makefile` to streamline reproducible build configurations, and modifies the `Dockerfile.reproducible` to align with the new build process. Additionally, it removes the `reproducible` profile from `Cargo.toml`.


  ### New GitHub Actions Workflows:

* [`.github/workflows/docker-reproducible.yml`](diffhunk://#diff-222af23bee616920b04f5b92a83eb5106fce08abd885cd3a3b15b8beb5e789c3R1-R145): Adds a workflow to build and push reproducible multi-architecture Docker images for releases, including support for dry runs without pushing an image.

### Build Configuration Updates:

* [`Makefile`](diffhunk://#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52L85-R143): Refactors reproducible build targets, centralizes environment variables for reproducibility, and updates Docker build arguments for `x86_64` and `aarch64` architectures.
* [`Dockerfile.reproducible`](diffhunk://#diff-587298ff141278ce3be7c54a559f9f31472cc5b384e285e2105b3dee319ba31dL1-R24): Updates the base Rust image to version 1.86, removes hardcoded reproducibility settings, and delegates build logic to the `Makefile`.
* Switch to using jemalloc-sys from Debian repos instead of building it from source. A Debian version is [reproducible](https://tests.reproducible-builds.org/debian/rb-pkg/trixie/amd64/jemalloc.html) which is [hard to achieve](https://github.com/NixOS/nixpkgs/issues/380852) if you build it from source.

### Profile Removal:

* [`Cargo.toml`](diffhunk://#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542L289-L295): Removes the `reproducible` profile, simplifying build configurations and relying on external tooling for reproducibility.


Co-Authored-By: Moe Mahhouk <mohammed-mahhouk@hotmail.com>

Co-Authored-By: chonghe <44791194+chong-he@users.noreply.github.com>

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
2025-11-27 23:06:31 +00:00
Mac L
847fa3f034 Remove context_deserialize and import from crates.io (#8172)
Use the recently published `context_deserialize` and remove it from Lighthouse


Co-Authored-By: Mac L <mjladson@pm.me>

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2025-11-27 21:53:46 +00:00
Michael Sproul
070e395714 Remove quickcheck in favour of proptest (#8471)
Consolidate our property-testing around `proptest`. This PR was written with Copilot and manually tweaked.


Co-Authored-By: Michael Sproul <michael@sproul.xyz>

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2025-11-27 05:53:55 +00:00
Michael Sproul
bdfade8e3d Consolidate reqwest versions (#8452)
Update `reqwest` to 0.12 so we only depend on a single version. This should slightly improve compile times and reduce binary bloat.


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2025-11-24 22:39:40 +00:00
Michael Sproul
261322c3e3 Merge remote-tracking branch 'origin/stable' into unstable 2025-11-20 13:04:32 +11:00
Mac L
fff248d41b Migrate execution_engine_integration to alloy (#8140)
#6022


  Migrate the `execution_engine_integration`  tests to the `alloy` ecosystem. This removes the last remaining `ethers` dependencies


Co-Authored-By: Mac L <mjladson@pm.me>
2025-11-12 04:43:19 +00:00
Mac L
93b8f4686d Remove ethers-core from execution_layer (#8149)
#6022


  Use `alloy_rpc_types::Transaction` to replace the `ethers_core::Transaction` inside the execution block generator.


Co-Authored-By: Mac L <mjladson@pm.me>
2025-11-10 06:25:59 +00:00
Javier Chávarri
2c1f1c1605 Migrate derivative to educe (#8125)
Fixes #7001.


  Mostly mechanical replacement of `derivative` attributes with `educe` ones.

### **Attribute Syntax Changes**

```rust
// Bounds: = "..." → (...)
#[derivative(Hash(bound = "E: EthSpec"))]
#[educe(Hash(bound(E: EthSpec)))]

// Ignore: = "ignore" → (ignore)
#[derivative(PartialEq = "ignore")]
#[educe(PartialEq(ignore))]

// Default values: value = "..." → expression = ...
#[derivative(Default(value = "ForkName::Base"))]
#[educe(Default(expression = ForkName::Base))]

// Methods: format_with/compare_with = "..." → method(...)
#[derivative(Debug(format_with = "fmt_peer_set_as_len"))]
#[educe(Debug(method(fmt_peer_set_as_len)))]

// Empty bounds: removed entirely, educe can infer appropriate bounds
#[derivative(Default(bound = ""))]
#[educe(Default)]

// Transparent debug: manual implementation (educe doesn't support it)
#[derivative(Debug = "transparent")]
// Replaced with manual Debug impl that delegates to inner field
```

**Note**: Some bounds use strings (`bound("E: EthSpec")`) for superstruct compatibility (`expected ','` errors).


Co-Authored-By: Javier Chávarri <javier.chavarri@gmail.com>

Co-Authored-By: Mac L <mjladson@pm.me>
2025-11-06 14:13:57 +00:00
Mac L
0090b35ee0 Remove sensitive_url and import from crates.io (#8377)
Use the recently published `sensitive_url` and remove it from Lighthouse


Co-Authored-By: Mac L <mjladson@pm.me>
2025-11-06 04:17:45 +00:00
Mac L
3066f0bef2 Prepare sensitive_url for crates.io (#8223)
Another good candidate for publishing separately from Lighthouse is `sensitive_url` as it's a general utility crate and not related to Ethereum. This PR prepares it to be spun out into its own crate.


  I've made the `full` field on `SensitiveUrl` private and instead provided an explicit getter called `.expose_full()`. It's a bit ugly for the diff but I prefer the explicit nature of the getter.
I've also added some extra tests and doc strings along with feature gating `Serialize` and `Deserialize` implementations behind the `serde` feature.


Co-Authored-By: Mac L <mjladson@pm.me>
2025-11-05 07:46:32 +00:00
Michael Sproul
0507eca7b4 Merge remote-tracking branch 'origin/stable' into unstable-merge-v8 2025-11-04 16:08:34 +11:00
Mac L
2c9b670f5d Rework lighthouse_version to reduce spurious recompilation (#8336)
#8311


  Removes the `git_version` crate from `lighthouse_version` and implements git `HEAD` tracking manually.
This removes the (mostly) broken dirty tracking but prevents spurious recompilation of the `lighthouse_version` crate.

This also reworks the way crate versions are handled by utilizing workspace version inheritance and Cargo environment variables.
This means the _only_ place where Lighthouse's version is defined is in the top level `Cargo.toml` for the workspace. All relevant binaries then inherit this version. This largely makes the  `change_version.sh` script useless so I've removed it, although we could keep a version which just alters the workspace version (if we need to maintain compatibility with certain build/release tooling.

### When is a Rebuild Triggered?

1. When the build.rs file is changed.
2. When the HEAD commit changes (added, removed, rebased, etc)
3. When the branch changes (this includes changing to the current branch, and creating a detached HEAD)

Note that working/staged changes will not trigger a recompile of `lighthouse_version`.


Co-Authored-By: Mac L <mjladson@pm.me>

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2025-11-03 02:46:31 +00:00
Mac L
f4b1bb46b5 Remove compare_fields and import from crates.io (#8189)
Use the recently published `compare_fields` and remove it from Lighthouse
https://crates.io/crates/compare_fields


Co-Authored-By: Mac L <mjladson@pm.me>
2025-10-28 05:49:47 +00:00
Mac L
f5809aff87 Bump ssz_types to v0.12.2 (#8032)
https://github.com/sigp/lighthouse/issues/8012


  Replace all instances of `VariableList::from` and `FixedVector::from` to their `try_from` variants.

While I tried to use proper error handling in most cases, there were certain situations where adding an `expect` for situations where `try_from` can trivially never fail avoided adding a lot of extra complexity.


Co-Authored-By: Mac L <mjladson@pm.me>

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2025-10-28 04:01:09 +00:00
Mac L
f13d0615fd Add eip_3076 crate (#8206)
#7894


  Moves the `Interchange` format from `slashing_protection` and thus removes the dependency on `slashing_protection` from `eth2` which can now just depend on the slimmer `eip_3076` crate.


Co-Authored-By: Mac L <mjladson@pm.me>
2025-10-16 16:10:42 +00:00
Mac L
345faf52cb Remove safe_arith and import from crates.io (#8191)
Use the recently published `safe_arith` and remove it from Lighthouse
https://crates.io/crates/safe_arith


Co-Authored-By: Mac L <mjladson@pm.me>
2025-10-15 06:03:46 +00:00
Pawan Dhananjay
8e382ceed9 Bump kzg library versions (#8174)
N/A


  Update c-kzg and rust-eth-kzg to their latest versions. Also removes the patch version hardcoding in Cargo.toml.


Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com>
2025-10-09 01:47:05 +00:00
Mac L
af5cbfbd44 Bump superstruct to 0.10.0 (#8133)
Bump `superstruct` to the latest release `0.10.0`.
This version uses a later version of `darling` which is helpful for https://github.com/sigp/lighthouse/pull/8125


Co-Authored-By: Mac L <mjladson@pm.me>
2025-09-30 07:42:27 +00:00
Antonio Viggiano
d80c0ff5b5 Use HTTPS for xdelta3 in Cargo.toml (#8094)
No issue


  Use HTTPS for dependency


Co-Authored-By: Antonio Viggiano <agfviggiano@gmail.com>
2025-09-24 01:20:10 +00:00
jking-aus
191570e4a1 chore: Bump discv5 and remove generic DefaultProtocolId in metrics (#8056)
Bump discv5 version


Co-Authored-By: Josh King <josh@sigmaprime.io>
2025-09-16 18:27:37 +00:00
Daniel Knopik
ee1b6bc81b Create network_utils crate (#7761)
Anchor currently depends on `lighthouse_network` for a few types and utilities that live within. As we use our own libp2p behaviours, we actually do not use the core logic in that crate. This makes us transitively depend on a bunch of unneeded crates (even a whole separate libp2p if the versions mismatch!)


  Move things we require into it's own lightweight crate.


Co-Authored-By: Daniel Knopik <daniel@dknopik.de>
2025-09-10 12:59:24 +00:00
Jimmy Chen
10e72df331 Add tls-roots feature to opentelemetry_otlp to support exporting traces over https (#7987) 2025-09-03 08:05:09 +00:00
Eitan Seri-Levi
c7492f1c27 Update to 1.6.0 alpha.6 spec (#7967)
Upgrade `rust_eth_kzg` library to `0.9` to support the new cell index sorting tests in `recover_cells_and_kzg_proofs`

https://github.com/ethereum/consensus-specs/releases
https://github.com/crate-crypto/rust-eth-kzg/compare/v0.8.1...v0.9.0
2025-09-01 08:56:25 +00:00
João Oliveira
cee30d8ca5 Update lighthouse to the latest upstream libp2p and gossipsub (#7828) 2025-08-21 07:57:46 +00:00
Jimmy Chen
f19d4f6af1 Implement tracing spans for data columm RPC requests and responses (#7831)
#7830
2025-08-20 23:35:51 +00:00
Jimmy Chen
aa8cba3741 Upgrade rust-eth-kzg to 0.8.0 (#7870)
#7864

The main breaking change in v0.8.0 is the `TrustedSetup` initialisation - it now requires a json string via `PeerDASTrustedSetup::from_json`.
2025-08-18 02:52:39 +00:00
Michael Sproul
42f6d7b02d Yeet env_logger into the sun (#7872)
- Remove explicit `env_logger` usage from `state_processing` tests and `lcli`.
- Set up tracing correctly for `lcli` (I've checked that we can see logs after this change).
- I didn't do anything to set up logging for the `state_processing` tests, as these are rarely run manually (they never fail). We could add `test_logger` in there on an as-needed basis.
2025-08-15 03:17:26 +00:00
chonghe
522bd9e9c6 Update Rust Edition to 2024 (#7766)
* #7749

Thanks @dknopik and @michaelsproul for your help!
2025-08-13 03:04:31 +00:00
Mac L
152f2bb2e4 Re-export context_deserialize_derive inside context_deserialize (#7852)
Re-export `context_deserialize_derive` inside of `context_deserialize` so they are both available from the same interface, which matches how popular crates (like `serde`) handle this.

This also nests both crates inside a new `context_deserialize` directory which will make it easier to eventually spin out into a different repo (if/when) we decide to do that (plus I prefer it aesthetically).
2025-08-12 05:16:19 +00:00
Jimmy Chen
40c2fd5ff4 Instrument tracing spans for block processing and import (#7816)
#7815

- removes all existing spans, so some span fields that appear in logs like `service_name` may be lost.
- instruments a few key code paths in the beacon node, starting from **root spans** named below:

* Gossip block and blobs
* `process_gossip_data_column_sidecar`
* `process_gossip_blob`
* `process_gossip_block`
* Rpc block and blobs
* `process_rpc_block`
* `process_rpc_blobs`
* `process_rpc_custody_columns`
* Rpc blocks (range and backfill)
* `process_chain_segment`
* `PendingComponents` lifecycle
* `pending_components`

To test locally:
* Run Grafana and Tempo with https://github.com/sigp/lighthouse-metrics/pull/57
* Run Lighthouse BN with `--telemetry-collector-url http://localhost:4317`

Some captured traces can be found here: https://hackmd.io/@jimmygchen/r1sLOxPPeg

Removing the old spans seem to have reduced the memory usage quite a lot - i think we were using them on long running tasks and too excessively:
<img width="910" height="495" alt="image" src="https://github.com/user-attachments/assets/5208bbe4-53b2-4ead-bc71-0b782c788669" />
2025-08-08 05:32:22 +00:00
Eric Tu
9911f348bc Feature gate arbitrary crate in the consensus types crate (#7743)
Which issue # does this PR address?


  Puts the `arbitrary` crate behind a feature flag in the `types` crate.
2025-07-23 16:55:02 +00:00
Michael Sproul
4a3e248b7e Add heaptrack support (#7764)
Although we're working on jemalloc profiler support in https://github.com/sigp/lighthouse/pull/7746, heaptrack seems to be producing more sensible results.

This PR adds a heaptrack profile and a heaptrack feature so that we no longer need to patch the code in order to use heaptrack. This may prove complementary to jemalloc profiling, so I think there is no harm in having both.
2025-07-21 02:11:27 +00:00
cakevm
734ad90dd8 Upgrade to c-kzg 2.1.0 and alloy-primitives 1.0 (#7271)
Update `c-kzg` from `v1` to `v2`. My motivation here is that `alloy-consensus` now uses `c-kzg` in `v2` and this results in a conflict when using lighthouse in combination with latest alloy. I tried also to disable the `czkg` feature in alloy, but the conflict persisted.

See here for the alloy update to `c-kzg v2`:  https://github.com/alloy-rs/alloy/pull/2240

Error:
```
error: failed to select a version for `c-kzg`.
...
versions that meet the requirements `^1` are: 1.0.3, 1.0.2, 1.0.0

the package `c-kzg` links to the native library `ckzg`, but it conflicts with a previous package which links to `ckzg` as well:
package `c-kzg v2.1.0`
... which satisfies dependency `c-kzg = "^2.1"` of package `alloy-consensus v0.13.0`
... which satisfies dependency `alloy-consensus = "^0.13.0"` of package ...
...
```


  - Upgrade `alloy-consensus` to `0.14.0` and disable all default features
- Upgrade `c-kzg` to `v2.1.0`
- Upgrade `alloy-primitives` to `1.0.0`
- Adapt the code to the new API `c-kzg`
- There is now `NO_PRECOMPUTE` as my understand from https://github.com/ethereum/c-kzg-4844/pull/545/files we should use `0` here as `new_from_trusted_setup_no_precomp` does not precomp. But maybe it is misleading. For all other places I used `RECOMMENDED_PRECOMP_WIDTH` because `8` is matching the recommendation.
- `BYTES_PER_G1_POINT` and `BYTES_PER_G2_POINT` are no longer public in `c-kzg`
- I adapted two tests that checking for the `Attestation`  bitfield size. But I could not pinpoint to what has changed and why now 8 bytes less. I would be happy about any hint, and if this is correct. I found related a PR here: https://github.com/sigp/lighthouse/pull/6915
- Use same fields names, in json, as well as `c-kzg` and `rust_eth_kzg` for `g1_monomial`, `g1_lagrange`, and `g2_monomial`
2025-07-09 05:02:41 +00:00
Pawan Dhananjay
11bcccb353 Remove all prod eth1 related code (#7133)
N/A


  After the electra fork which includes EIP 6110, the beacon node no longer needs the eth1 bridging mechanism to include new deposits as they are provided by the EL as a `deposit_request`. So after electra + a transition period where the finalized bridge deposits pre-fork are included through the old mechanism, we no longer need the elaborate machinery we had to get deposit contract data from the execution layer.

Since holesky has already forked to electra and completed the transition period, this PR basically checks to see if removing all the eth1 related logic leads to any surprises.
2025-06-23 03:00:07 +00:00
Jimmy Chen
38a5f338fa Add console-subscriber feature for debugging (#7529)
Add `console-subscriber` feature for debugging tokio async tasks.

Supersedes #7420 to work with `unstable`.

Usage:
- Build Lighthouse with `RUSTFLAGS=--cfg tokio_unstable` and `--features console-subscriber`, e.g.:
```
RUSTFLAGS=-"-cfg=tokio_unstable --remap-path-prefix=$(pwd)=." FEATURES=console-subscriber make
```
- Run the Lighthouse binary.
- Install `tokio-console` and run it in a terminal.
2025-05-30 14:15:54 +00:00
Jimmy Chen
f01dc556d1 Update engine_getBlobsV2 response type and add getBlobsV2 tests (#7505)
Update `engine_getBlobsV2` response type to `Option<Vec<BlobsAndProofV2>>`. See recent spec change [here](https://github.com/ethereum/execution-apis/pull/630).

Added some tests to cover basic fetch blob scenarios.
2025-05-26 04:33:34 +00:00
Akihito Nakano
a2797d4bbd Fix formatting errors from cargo-sort (#7512)
[cargo-sort is currently failing on CI](https://github.com/sigp/lighthouse/actions/runs/15198128212/job/42746931918?pr=7025), likely due to new checks introduced in version [2.0.0](https://github.com/DevinR528/cargo-sort/releases/tag/v2.0.0).


  Fixed the errors by running cargo-sort with formatting enabled.
2025-05-23 05:25:56 +00:00
Mac L
ce8d0814ad Ensure logfile permissions are maintained after rotation (#7246)
Update our `logroller` dependency to the new version which supports permission control. See -> https://github.com/trayvonpan/logroller/pull/6
2025-05-22 02:51:28 +00:00