Commit Graph

788 Commits

Author SHA1 Message Date
chonghe
b5260db5e6 Add extra data in /eth/v1/debug/fork_choice (#7845)
* #7829


  


Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io>

Co-Authored-By: chonghe <44791194+chong-he@users.noreply.github.com>
2025-11-12 07:01:52 +00:00
Mac L
11d1f60753 Migrate the deposit_contract crate to alloy (#8139)
https://github.com/sigp/lighthouse/issues/6022


  Switches the `deposit_contract` crate to use the `alloy` ecosystem and removes the dependency on `ethabi`


Co-Authored-By: Mac L <mjladson@pm.me>
2025-11-11 06:52:46 +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
Jimmy Chen
e3ee7febce Release v8.0.0 (#8352)
N/A

Includes the following unmerged PRs:
- #8344
- #8335
- #8339

This PR should be merged after all above PRs are merged.


  


Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>

Co-Authored-By: Jimmy Chen <jimmy@sigmaprime.io>
2025-11-04 00:34:47 +00:00
Eitan Seri-Levi
5d0f8a083a Ensure custody backfill sync couples all responses before importing (#8339)
Custody backfill sync has a bug when we request columns from more than one peer per batch. The fix here ensures we wait for all requests to be completed before performing verification and importing the responses.

I've also added an endpoint `lighthouse/custody/backfill` that resets a nodes earliest available data column to the current epoch so that custody backfill can be triggered. This endpoint is needed to rescue any nodes that may have missing columns due to the custody backfill sync bug without requiring a full re-sync.


  


Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com>

Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>

Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
2025-11-03 08:06:06 +00:00
Eitan Seri-Levi
25832e5862 Add mainnet configs (#8344)
#8135

mainnet config PR: https://github.com/eth-clients/mainnet/pull/11


  


Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>

Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io>
2025-11-03 06:53:13 +00: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
Michael Sproul
c46cb0b5b0 Merge remote-tracking branch 'origin/release-v8.0' into unstable 2025-11-03 09:28:48 +11:00
Eitan Seri-Levi
55588f7789 Rust 1.91 lints (#8340)
Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com>
2025-10-31 08:08:37 +00:00
chonghe
af9cae4d3e Add version to the response of beacon API client side (#8326)
Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io>
2025-10-30 16:47:27 +00:00
hopinheimer
341eeeabe3 Extracting the Error impl from the monolith eth2 (#7878)
Currently the `eth2` crate lib file is a large monolith of almost 3000 lines of code. As part of the bosun migration we are trying to increase code readability and modularity in the lighthouse crates initially, which then can be transferred to bosun


Co-Authored-By: hopinheimer <knmanas6@gmail.com>

Co-Authored-By: hopinheimer <48147533+hopinheimer@users.noreply.github.com>
2025-10-28 07:02:02 +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
Michael Sproul
d67ae92112 Implement /lighthouse/custody/info API (#8276)
Closes:

- https://github.com/sigp/lighthouse/issues/8249


  New `/lighthouse/custody` API including:

- [x] Earliest custodied data column slot
- [x] Node CGC
- [x] Custodied columns


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2025-10-27 08:48:12 +00:00
Jimmy Chen
b59feb042c Release v8.0.0 rc.2 (#8255)
Open PRs to include for the release
- #7907
- #8247
- #8251
- #8253
- #8254
- #8265
- #8269
- #8266


  


Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>

Co-Authored-By: Jimmy Chen <jimmy@sigmaprime.io>
2025-10-23 07:05:49 +00:00
Eitan Seri-Levi
33e21634cb Custody backfill sync (#7907)
#7603


  #### Custody backfill sync service
Similar in many ways to the current backfill service. There may be ways to unify the two services. The difficulty there is that the current backfill service tightly couples blocks and their associated blobs/data columns. Any attempts to unify the two services should be left to a separate PR in my opinion.

#### `SyncNeworkContext`
`SyncNetworkContext` manages custody sync data columns by range requests separetly from other sync RPC requests. I think this is a nice separation considering that custody backfill is its own service.

#### Data column import logic
The import logic verifies KZG committments and that the data columns block root matches the block root in the nodes store before importing columns

#### New channel to send messages to `SyncManager`
Now external services can communicate with the `SyncManager`. In this PR this channel is used to trigger a custody sync. Alternatively we may be able to use the existing `mpsc` channel that the `SyncNetworkContext` uses to communicate with the `SyncManager`. I will spend some time reviewing this.


Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>

Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com>

Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
2025-10-22 03:51:34 +00:00
chonghe
040d992132 Add version to the response of beacon API getPendingConsolidations (#8251)
* #7440


  


Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io>
2025-10-21 13:58:10 +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
Jimmy Chen
1fb94ce432 Release v8.0.0-rc.1 (#8185) 2025-10-13 20:32:43 +11:00
Jimmy Chen
178df7a7d6 Fix duplicate fields being logged when the field exists in both the span and the event (#8183)
Closes #7995.

Fix duplicate fields being logged when the field exists in both the span and the event. Prefer event fields when this happens.

```
Sep 15 08:13:46.339 WARN State cache missed state_root: 0xc34826ff7794de63a553832b7aff13572d1c716b9e03d5ef7b29649adf98abe2, block_root: 0xf16d3f5b4cc6ec876b7faeccd9f2d4102dc56ed32e828754b62601637910ec1f, state_root: 0xc34826ff7794de63a553832b7aff13572d1c716b9e03d5ef7b29649adf98abe2, block_root: 0xf16d3f5b4cc6ec876b7faeccd9f2d4102dc56ed32e828754b62601637910ec1f
```

becomes

```
Sep 15 08:13:46.339 WARN State cache missed state_root: 0xc34826ff7794de63a553832b7aff13572d1c716b9e03d5ef7b29649adf98abe2, block_root: 0xf16d3f5b4cc6ec876b7faeccd9f2d4102dc56ed32e828754b62601637910ec1f
```


  


Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
2025-10-13 01:12:46 +00:00
chonghe
3110ca325b Implement /eth/v1/beacon/blobs endpoint (#8103)
* #8085


  


Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io>

Co-Authored-By: chonghe <44791194+chong-he@users.noreply.github.com>
2025-10-09 05:01:30 +00:00
Jimmy Chen
e5b4983d6b Release v8.0.0 rc.0 (#8127)
Testnet release for the upcoming Fusaka fork.


  


Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>

Co-Authored-By: Jimmy Chen <jimmy@sigmaprime.io>
2025-09-29 02:17:30 +00:00
Eitan Seri-Levi
20c6ce4553 Fulu testnet configs (#8117)
Holesky - #8096
Hoodi - #8097
Sepolia - #8099


  Testnet configs for Holesky, Hoodi and Sepolia

Holesky - https://github.com/eth-clients/holesky/pull/132
Hoodi - https://github.com/eth-clients/hoodi/pull/21
Sepolia - https://github.com/eth-clients/sepolia/pull/111


Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com>
2025-09-26 09:12:47 +00:00
Eitan Seri-Levi
af274029e8 Run reconstruction inside a scoped rayon pool (#8075)
Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>

Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com>

Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
2025-09-24 06:37:34 +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
Michael Sproul
87ae301d09 Remove unused logging metrics (#7997)
@chong-he noticed that the INFO/WARN/ERRO log counts on our dashboards had stopped working. Since switching to `tracing` we are now tracking total events _per crate_, and the global counters are unused.

Per-crate metrics are here:

cfb1f73310/common/logging/src/tracing_metrics_layer.rs (L61-L63)


  Delete the unused global counters from the source.

We can sum across the per-crate metric in our dashboards to restore the previous functionality.


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2025-09-12 02:48:49 +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
hopinheimer
38205192ca Fix http api tests ci (#7943)
Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>

Co-Authored-By: Michael Sproul <micsproul@gmail.com>

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>

Co-Authored-By: hopinheimer <knmanas6@gmail.com>
2025-09-10 06:46:48 +00:00
Odinson
2b22903fba fix: extra fields in logs (#8009)
Potentially fixes #7995


  changed `span_data` to a `HashMap` and added a new check to remove span fields whose base names are already present on the event.


Co-Authored-By: PoulavBhowmick03 <bpoulav@gmail.com>

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2025-09-09 08:09:03 +00:00
chonghe
a93cafee08 Implement selections Beacon API endpoints to support DVT middleware (#7016)
* #6610


  - [x] Add `beacon_committee_selections` endpoint
- [x] Test beacon committee aggregator and confirmed working
- [x] Add `sync_committee_selections` endpoint
- [x] Test sync committee aggregator and confirmed working
2025-09-03 03:50:41 +00:00
Sam Wilson
477c534cd7 Remove dependency on target_info. (#7964)
Remove dependency on target_info, use standard library instead.
2025-09-01 06:03:55 +00:00
Mac L
e438691683 Add Gloas boilerplate (#7728)
Adds the required boilerplate code for the Gloas (Glamsterdam) hard fork. This allows PRs testing Gloas-candidate features to test fork transition.

This also includes de-duplication of post-Bellatrix readiness notifiers from #6797 (credit to @dapplion)
2025-08-26 02:49:48 +00:00
Jimmy Chen
b4704eab4a Fulu update to spec v1.6.0-alpha.4 (#7890)
Fulu update to spec [v1.6.0-alpha.4](https://github.com/ethereum/consensus-specs/releases/tag/v1.6.0-alpha.4).
- Make `number_of_columns` a preset
- Optimise `get_custody_groups` to avoid computing if cgc = 128
- Add support for additional typenum values in type_dispatch macro
2025-08-20 02:05:04 +00:00
Daniel Knopik
1fd7ead010 Do not filter validators by status if filter is an empty list (#7884)
69d2feb12a/apis/beacon/states/validators.yaml (L128-L130) says we need to not filter if the filter is an empty list.


  Add a check for `statuses.is_empty()`.
2025-08-18 07:46:37 +00:00
Michael Sproul
317dc0f56c Fix malloc_utils features (sysmalloc) (#7770)
Follow-up to:

- https://github.com/sigp/lighthouse/pull/7764

The `heaptrack` feature added in my previous PR was ineffective, because the jemalloc feature was turned on by the Linux target-specific dependency.

This PR tweaks the features such that:

- The jemalloc feature is just used to control whether jemalloc is compiled in. It is enabled on Linux by the target-specific dependency (see `lighthouse/Cargo.toml`), and completely disabled on Windows.
- If the `sysmalloc` feature is set on Linux then it overrides jemalloc when selecting an allocator, _even if_ the jemalloc feature is enabled (and the jemalloc dep was compiled).
2025-08-15 03:46:38 +00:00
Eitan Seri-Levi
90fa7c216e Fix ssz formatting for /light_client/updates beacon API endpoint (#7806)
#7759


  We were incorrectly encoding the full response from `/light_client/updates` instead of only encoding the light client update
2025-08-15 03:17:29 +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
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
Jimmy Chen
1a6eeb228c Bump Rust version to 1.88 (#7787)
In #7743, rust version was bumped:
- msrv to 1.87
- `Dockerfile` to 1.88

We also need to bump the other docker images as well, and might as well keep them all consistent at 1.88.
2025-07-25 05:52:51 +00:00
Mac L
e6089fe7db Control span data through tracing Extensions (#7239)
#7234


  Removes the `Arc<Mutex<_>` which was used to store and manage span data and replaces it with the inbuilt `Extension` for managing span-specific data. This also avoids an `unwrap` which was used when acquiring the lock over the mutex'd span data.
2025-07-22 14:22:03 +00:00
Michael Sproul
cfb1f73310 Release v7.1.0 (#7609)
Post-Pectra release for tree-states hot 🎉

Already merged to `release-v7.1.0`:

- https://github.com/sigp/lighthouse/pull/7444
- https://github.com/sigp/lighthouse/pull/6750
- https://github.com/sigp/lighthouse/pull/7437
- https://github.com/sigp/lighthouse/pull/7133
- https://github.com/sigp/lighthouse/pull/7620
- https://github.com/sigp/lighthouse/pull/7663
2025-07-10 01:44:46 +00:00
Jimmy Chen
fcc602a787 Update fulu network configs and add MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS (#7646)
- #6240
- Bring built-in network configs up to date with latest consensus-spec PeerDAS configs.
- Add `MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS` and use it to determine data availability window after the Fulu fork.
2025-07-02 02:38:25 +00:00
Eitan Seri-Levi
56b2d4b525 Remove instrumenting log level (#7636)
https://github.com/sigp/lighthouse/issues/7155


  Theres some additional places we set instrumenting log levels that wasn't covered in #7620
2025-06-24 06:29:10 +00:00
chonghe
cef04ee2ee Implement validator_identities Beacon API endpoint (#7462)
* #7442
2025-06-23 08:37:49 +00:00
Mac L
e34a9a0c65 Allow the --beacon-nodes list to be updated at runtime (#6551)
Adds a new `/lighthouse` API call to the VC which allows the list of beacon nodes to be updated dynamically at runtime.

An entirely new beacon node list is provided to the VC so it effectively adds, removes or reorders nodes to match the new list.

This can then be used in Siren, which will enable a "drag to reorder" system along with adding and removing beacon nodes while the VC is on. This will make it unnecessary to reboot the VC when users want to simply add or remove a BN from the list.
2025-06-23 03:59:34 +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
Age Manning
d50924677a Remove instrumenting log level (#7620)
I think this should resolve #7155


This removes the level field from the instrumenting we were doing across a range of functions. The level will now default to the level of the log.
2025-06-20 07:44:59 +00:00