Commit Graph

6965 Commits

Author SHA1 Message Date
Pawan Dhananjay
076f3f0984 Clarify network limits (#7175)
Resolves #6811


  Rename `GOSSIP_MAX_SIZE` to `MAX_PAYLOAD_SIZE` and remove `MAX_CHUNK_SIZE` in accordance with the spec.

The spec also "clarifies"  the message size limits at different levels. The rpc limits are equivalent to what we had before imo.
The gossip limits have additional checks.

I have gotten rid of the `is_bellatrix_enabled`  checks that used a lower limit (1mb) pre-merge. Since all networks we run start from the merge, I don't think this will break any setups.
2025-04-09 02:50:45 +00:00
Eitan Seri-Levi
d24a4ffe30 Fix builder API electra json response (#7285)
#7277


Implement `ForkVersionDeserialize` for `ExecutionPayloadAndBlobs` so we get fork hinting when deserializing
2025-04-09 02:00:55 +00:00
Eitan Seri-Levi
863c19863f Mainnet Electra fork epoch (#7275)
#6918

See https://github.com/eth-clients/mainnet/pull/4
2025-04-08 08:10:17 +00:00
Jimmy Chen
759b0612b3 Offloading KZG Proof Computation from the beacon node (#7117)
Addresses #7108

- Add EL integration for `getPayloadV5` and `getBlobsV2`
- Offload proof computation and use proofs from EL RPC APIs
2025-04-08 07:37:16 +00:00
Jimmy Chen
e924264e17 Fullnodes to publish data columns from EL getBlobs (#7258)
Previously only supernode contributes to data column publishing in Lighthouse.

Recently we've [updated the spec](https://github.com/ethereum/consensus-specs/pull/4183) to have full nodes publishing data columns as well, to ensure all nodes contributes to propagation.

This also prevents already imported data columns from being imported again (because we don't "observe" them), and ensures columns that are observed in the [gossip seen cache](d60c24ef1c/beacon_node/beacon_chain/src/data_column_verification.rs (L492)) are forwarded to its peers, rather than being ignored.
2025-04-08 03:20:31 +00:00
Michael Sproul
47a85cd118 Bump version to v7.1.0-beta.0 (not a release) (#7269)
Having merged the drop-headtracker PR we now have a DB schema change in `unstable` compared to `release-v7.0.0`:

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

There is a DB downgrade available, however this needs to be applied manually and it's usually a bit of a hassle.

This PR bumps the version on `unstable` to `v7.1.0-beta.0` _without_ actually cutting a `v7.1.0-beta.0` release, so that we can tell at a glance which schema version a node is using.
2025-04-07 06:01:20 +00:00
Lion - dapplion
70850fe58d Drop head tracker for summaries DAG (#6744)
The head tracker is a persisted piece of state that must be kept in sync with the fork-choice. It has been a source of pruning issues in the past, so we want to remove it
- see https://github.com/sigp/lighthouse/issues/1785

When implementing tree-states in the hot DB we have to change the pruning routine (more details below) so we want to do those changes first in isolation.
- see https://github.com/sigp/lighthouse/issues/6580
- If you want to see the full feature of tree-states hot https://github.com/dapplion/lighthouse/pull/39

Closes https://github.com/sigp/lighthouse/issues/1785


  **Current DB migration routine**

- Locate abandoned heads with head tracker
- Use a roots iterator to collect the ancestors of those heads can be pruned
- Delete those abandoned blocks / states
- Migrate the newly finalized chain to the freezer

In summary, it computes what it has to delete and keeps the rest. Then it migrates data to the freezer. If the abandoned forks routine has a bug it can break the freezer migration.

**Proposed migration routine (this PR)**

- Migrate the newly finalized chain to the freezer
- Load all state summaries from disk
- From those, just knowing the head and finalized block compute two sets: (1) descendants of finalized (2) newly finalized chain
- Iterate all summaries, if a summary does not belong to set (1) or (2), delete

This strategy is more sound as it just checks what's there in the hot DB, computes what it has to keep and deletes the rest. Because it does not rely and 3rd pieces of data we can drop the head tracker and pruning checkpoint. Since the DB migration happens **first** now, as long as the computation of the sets to keep is correct we won't have pruning issues.
2025-04-07 04:23:52 +00:00
Pawan Dhananjay
091e292c99 Return eth1_data early post transition (#7248)
N/A


  Return state.eth1_data() early if we have passed the transition period post electra. Even if we don't return early, the function would still return state.eth1_data() based on the current conditions. However, doing this explicitly here to match the spec. This covers setting the right eth1_data in our block.

The other thing we need to ensure is that the deposits returned by the eth1_chain is empty post transition.

The only way we get non-empty deposits post the transition is if `state.eth1_deposit_index` in the below code is less than `min(deposit_requests_start_index, state.eth1_data().deposit_count)`.
0850bcfb89/beacon_node/beacon_chain/src/eth1_chain.rs (L543-L579)

This can never happen because state.eth1_deposit_index will be equal to state.eth1_data.deposit count and cannot exceed the value.

@michaelsproul @ethDreamer please double check the logic for deposits being empty post transition. Following the logic in the spec makes my head hurt.
2025-04-07 03:16:48 +00:00
Lion - dapplion
d511ca0494 Compute roots for unfinalized by_range requests with fork-choice (#7098)
Includes PRs

- https://github.com/sigp/lighthouse/pull/7058
- https://github.com/sigp/lighthouse/pull/7066

Cleaner for the `release-v7.0.0` branch
2025-04-07 03:16:41 +00:00
ThreeHrSleep
b5d40e3db0 Align logs (#7256)
https://github.com/sigp/lighthouse/issues/7249
2025-04-07 01:38:15 +00:00
Michael Sproul
e77fb01a06 Remove CLI conflict for secrets-dir and datadir (#7265)
Redo this PR:

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

After a regression during the switch to `clap_derive`.

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


  - Remove `conflicts_with`
- Add test to prevent future regression
2025-04-06 09:08:59 +00:00
Mac L
591fb7df14 Merge branch 'release-v7.0.0' into backmerge-for-openssl 2025-04-06 00:03:52 +11:00
Mac L
5dd998a616 Bump openssl to fix cargo audit failure (#7263)
`cargo audit` failure -> https://rustsec.org/advisories/RUSTSEC-2025-0022


  Bump `openssl` version
2025-04-05 10:37:42 +00:00
Jimmy Chen
7cc64cab83 Add missing error log and remove redundant id field from lookup logs (#6990)
Partially #6989.

This PR adds the missing error log when a batch fails due to issues with converting the response into `RpcBlock`. See the above linked issue for more details.

Adding this log reveals that we're completing range requests with missing columns, hence causing the batch to fail. It looks like we've hit the case where we've received enough stream terminations, but not all columns are returned.

```
Feb 12 06:12:16.558 DEBG Failed to convert range block components into RpcBlock, error: No column for block 0xc5b6c7fa02f5ef603d45819c08c6519f1dba661fd5d44a2fc849d3e7028b6007 index 18, id: 3456/RangeSync/116/3432, service: sync, module: network::sync::network_context:488
```

I've also removed some redundant `id` logging, as the `id` debug representation is difficult to read, and is now being logged as part of `req_id` in a more succinct format (relevant PR: #6914)
2025-04-04 09:01:42 +00:00
Jimmy Chen
6a75f24ab1 Fix the getBlobs metric and ensure it is recorded promptly to prevent miscounts (#7188)
From testing conducted by Sunnyside Labs, they noticed that the "expected blobs" are quite low on bandwidth constrained nodes. This observation revealed that we don't record the `beacon_blobs_from_el_expected_total` metric at all if the EL doesn't return any response. The fetch blobs function returns without recording the metric.

To fix this, I've moved `BLOBS_FROM_EL_EXPECTED_TOTAL` and `BLOBS_FROM_EL_RECEIVED_TOTAL` to as early as possible, to make the metric more accurate.
2025-04-04 09:01:39 +00:00
Mac L
57abffcd99 Disable log color when running in non-interactive mode (#7240)
#7226


  Checks whether the application is running in a terminal, or in non-interactive mode (e.g. using systemd). It will then set the value of `--log-color` to `false` when running non-interactively.
2025-04-04 06:14:04 +00:00
Mac L
0e6da0fcaf Merge branch 'release-v7.0.0' into v7-backmerge 2025-04-04 13:32:58 +11:00
Mac L
82d1674455 Rust 1.86.0 lints (#7254)
Implement lints for the new Rust compiler version 1.86.0.
2025-04-04 02:30:22 +00:00
Age Manning
d6cd049a45 RPC RequestId Cleanup (#7238)
I've been working at updating another library to latest Lighthouse and got very confused with RPC request Ids.

There were types that had fields called `request_id` and `id`. And interchangeably could have types `PeerRequestId`, `rpc::RequestId`, `AppRequestId`, `api_types::RequestId` or even `Request.id`.

I couldn't keep track of which Id was linked to what and what each type meant.

So this PR mainly does a few things:
- Changes the field naming to match the actual type. So any field that has an  `AppRequestId` will be named `app_request_id` rather than `id` or `request_id` for example.
- I simplified the types. I removed the two different `RequestId` types (one in Lighthouse_network the other in the rpc) and grouped them into one. It has one downside tho. I had to add a few unreachable lines of code in the beacon processor, which the extra type would prevent, but I feel like it might be worth it. Happy to add an extra type to avoid those few lines.
- I also removed the concept of `PeerRequestId` which sometimes went alongside a `request_id`. There were times were had a `PeerRequest` and a `Request` being returned, both of which contain a `RequestId` so we had redundant information. I've simplified the logic by removing `PeerRequestId` and made a `ResponseId`. I think if you look at the code changes, it simplifies things a bit and removes the redundant extra info.

I think with this PR things are a little bit easier to reasonable about what is going on with all these RPC Ids.

NOTE: I did this with the help of AI, so probably should be checked
2025-04-03 10:10:15 +00:00
Jimmy Chen
80626e58d2 Attempt to fix flaky network tests (#7244) 2025-04-03 04:01:34 +00:00
Varun Doshi
0850bcfb89 feat: add more bootnodes for Hoodi and Sepolia (#7222)
Closes #7218


  Add more bootnodes for Sepolia and Hoodi
2025-04-02 02:32:08 +00:00
Pawan Dhananjay
33e41f7249 Consensus spec tests beta4 (#7231)
N/A


  Run latest consensus spec tests on CI https://github.com/ethereum/consensus-specs/releases/tag/v1.5.0-beta.4
2025-04-01 23:24:07 +00:00
Michael Sproul
578db67755 Merge remote-tracking branch 'origin/release-v7.0.0' into backmerge-apr-2 2025-04-02 09:57:42 +11:00
Mac L
4839ed620f Tracing cleanup (#7168)
#7153
#7146
#7147
#7148 -> Thanks to @ackintosh


  This PR does the following:
1. Disable logging to file when using either `--logfile-max-number 0` or `--logfile-max-size 0`. Note that disabling the log file in this way will also disable `discv5` and `libp2p` logging.
1.  `discv5` and `libp2p` logging will be disabled by default unless running `beacon_node` or `boot_node`. This also should fix the VC panic we were seeing.
1. Removes log rotation and compression from `libp2p` and `discv5` logs. It is now limited to 1 file and will rotate based on the value of the `--logfile-max-size` flag. We could potentially add flags specifically to control the size/number of these, however I felt a single log file was sufficient. Perhaps @AgeManning has opinions about this?
1. Removes all dependency logging and references to `dep_log`.
1.  Introduces workspace filtering to file and stdout. This explicitly allows logs from members of the Lighthouse workspace, disallowing all others. It uses a proc macro which pulls the member list from cargo metadata at compile time. This might be over-engineered but my hope is that this list will not require maintenance.
1. Unifies file and stdout JSON format. With slog, the formats were slightly different. @threehrsleep worked to maintain that format difference, to ensure there was no breaking changes. If these format differences are actually problematic we can restore it, however I felt the added complexity wasn't worth it.
1. General code improvements and cleanup.
2025-04-01 10:51:09 +00:00
antondlr
fb7ec0d151 Change genesis-state-url-timeout (#7112)
Timeouts sometimes occur on downloading the Holeksy genesis state from AWS, we've had reputable outside reports on this.
It's around 200MB and hosted in APAC, it makes sense to bump the default, at least for Holesky.


  Bump default timeout from 180 to 300 secs
2025-04-01 08:30:39 +00:00
Michael Sproul
9bc0d5161e Disable LevelDB snappy feature (#7235)
Disable the `snappy` feature of LevelDB to prevent compilation issues with CMake 4.0, e.g.

https://github.com/sigp/lighthouse/actions/runs/14182783816/job/39732457274?pr=7231

We do not use Snappy compression in LevelDB, and do not need to compile this. This might also shave a few seconds off compilation!
2025-04-01 07:56:06 +00:00
Michael Sproul
bde0f1ef0b Merge remote-tracking branch 'origin/release-v7.0.0' into unstable 2025-03-29 13:01:58 +11:00
Pawan Dhananjay
54aef2d043 Admin add/remove peer (#7198)
N/A


  Adds endpoints to add and remove trusted peers from the http api. The added peers are trusted peers so they won't be disconnected for bad scores. We try to maintain a connection to the peer in case they disconnect from us by trying to dial it every heartbeat.
2025-03-28 12:59:09 +00:00
Eitan Seri-Levi
a5ea05ce2a Top-up pubkey cache on startup (#7217)
This is a workaround for #7216


  In the case of gaps between the in-memory pub key cache and its on-disk representation, use the head state on startup to "top-up" the cache/db w/ any missing validators
2025-03-28 08:29:19 +00:00
Michael Sproul
6d5a2be7f9 Release v7.0.0-beta.5 (#7210)
New release for Pectra-enabled networks.
v7.0.0-beta.5
2025-03-27 03:42:34 +00:00
Michael Sproul
7d792e615c Fix xdelta3 output buffer issue (#7174)
* Fix xdelta3 output buffer issue

* Fix buckets

* Update commit hash to `main`

* Tag TODO(hdiff)

* Update cargo lock
2025-03-27 13:25:50 +11:00
Michael Sproul
0875326cb6 Prevent duplicate effective balance processing (#7209) 2025-03-27 12:53:38 +11:00
ThreeHrSleep
ca8eaea116 Remove crit as an option from the CLI entirely (#7169)
https://github.com/sigp/lighthouse/issues/7165
2025-03-27 01:26:03 +00:00
Lion - dapplion
6f31d44343 Remove CGC from data_availability checker (#7033)
- Part of https://github.com/sigp/lighthouse/issues/6767

Validator custody makes the CGC and set of sampling columns dynamic. Right now this information is stored twice:
- in the data availability checker
- in the network globals

If that state becomes dynamic we must make sure it is in sync updating it twice, or guarding it behind a mutex. However, I noted that we don't really have to keep the CGC inside the data availability checker. All consumers can actually read it from the network globals, and we can update `make_available` to read the expected count of data columns from the block.
2025-03-26 05:19:51 +00:00
Ruud van Asseldonk
9dce729cb6 Ensure sqlite and rusqlite are optional in consensus/types (#7182)
Even though the `consensus/types` crate has a feature named `sqlite`, it unconditionally depends on the `rusqlite` crate, which then depends on the `sqlite` crate — even when the feature is disabled. When the feature is disabled, the code that imports from `rusqlite` is disabled, so this dependency is not needed when the feature is disabled.

This is not a problem for Lighthouse itself, but I’m interested in using the types defined here in a different Rust project, which depends on a conflicting version of the `sqlite` crate.


  Ensure that the dependency on `rusqlite` is only present when the `sqlite` feature is enabled.
2025-03-25 13:50:10 +00:00
chonghe
3f6c11db0e Some updates to Lighthouse book (#6995)
* #6447


  - Move some deprecated pages to a new section under `Archived`

- Remove fallback log in mev as the log will not be present after VC using `/eth/v3/validator/blocks` endpoint by default
- Add warning against using Btrfs file system (thank you @ChosunOne for the report)
- Add data shared by @mcdee  on tree states API queries time
- Rename partial withdrawals to validator sweep to differentiate it from the upcoming execution layer partial withdrawals
- Update NAT API response
- Update docs on IPv6

- Rename .md files to follow a standard prefix section name, e.g., installation_*.md, advanced_*.md
- Standardise .md files using underscore `_` instead of hyphen `-` to be consistent with other files naming conventions.
2025-03-24 02:30:20 +00:00
Eitan Seri-Levi
2f37bf4de5 Fix more merge conflicts between unstable and release-v7.0.0 2025-03-24 09:13:28 +11:00
Eitan Seri-Levi
cbf1c04a14 resolve merge conflicts between untstable and release-v7.0.0 2025-03-23 11:09:02 -06:00
Jimmy Chen
d323699fde Add missing osaka-time lcli param (#7183)
Getting this when running lcli with `--osaka-time`:

```
error: unexpected argument '--osaka-time' found

tip: a similar argument exists: '--shanghai-time'
```

This PR adds the missing `--osaka-time` option to `lcli`.
2025-03-21 05:36:24 +00:00
Lion - dapplion
ca237652f1 Track request IDs in RangeBlockComponentsRequest (#6998)
Part of
- https://github.com/sigp/lighthouse/issues/6258


  `RangeBlockComponentsRequest` handles a set of by_range requests. It's quite lose on these requests, not tracking them by ID. We want to implement individual request retries, so we must make `RangeBlockComponentsRequest` aware of its requests IDs. We don't want the result of a prior by_range request to affect the state of a future retry. Lookup sync uses this mechanism.

Now `RangeBlockComponentsRequest` tracks:

```rust
pub struct RangeBlockComponentsRequest<E: EthSpec> {
blocks_request: ByRangeRequest<BlocksByRangeRequestId, Vec<Arc<SignedBeaconBlock<E>>>>,
block_data_request: RangeBlockDataRequest<E>,
}

enum RangeBlockDataRequest<E: EthSpec> {
NoData,
Blobs(ByRangeRequest<BlobsByRangeRequestId, Vec<Arc<BlobSidecar<E>>>>),
DataColumns {
requests: HashMap<
DataColumnsByRangeRequestId,
ByRangeRequest<DataColumnsByRangeRequestId, DataColumnSidecarList<E>>,
>,
expected_custody_columns: Vec<ColumnIndex>,
},
}

enum ByRangeRequest<I: PartialEq + std::fmt::Display, T> {
Active(I),
Complete(T),
}
```

I have merged `is_finished` and `Into_responses` into the same function. Otherwise, we need to duplicate the logic to figure out if the requests are done.
2025-03-21 04:07:30 +00:00
Michael Sproul
04868027a6 Release v7.0.0-beta.4 (#7162)
New release for Hoodi testnet including clean versions of fixes from `holesky-rescue`.
v7.0.0-beta.4
2025-03-20 05:12:19 +00:00
Michael Sproul
76d8984f8f Update ring to 0.17.14 to fix build compat (#7164)
Cross builds were failing since:

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

This seems to have been due to a regression upstream in `ring` which is noted in the v0.17.14 release notes. I'm hoping that updating remedies it.

> Compatibility with GNU binutils 2.29 (used on Amazon Linux 2), and probably even earlier versions, was restored. It is expected that ring 0.17.14 will build on all the systems that 0.17.12 would build on.

https://github.com/briansmith/ring/blob/main/RELEASES.md#version-01714-2025-03-11
2025-03-19 15:38:27 +00:00
Eitan Seri-Levi
e4c9805438 Reject attestations to blocks prior to the split (#7084) 2025-03-19 13:39:28 +00:00
Eitan Seri-Levi
ed1b7689ae Manual compaction endpoint backport (#7104)
Backports:
- https://github.com/sigp/lighthouse/pull/7072

To:
- https://github.com/sigp/lighthouse/issues/7039

#7103 should be merged first


  This PR introduces an endpoint that allows users to manually trigger background compaction.
2025-03-18 06:29:12 +00:00
Eitan Seri-Levi
27aabe8159 Pseudo finalization endpoint (#7103)
This is a backport of:
-  https://github.com/sigp/lighthouse/pull/7059
- https://github.com/sigp/lighthouse/pull/7071

For:
- https://github.com/sigp/lighthouse/issues/7039


  Introduce a new lighthouse endpoint that allows a user to force a pseudo finalization. This migrates data to the freezer db and prunes sidechains which may help reduce disk space issues on non finalized networks like Holesky

We also ban peers that send us blocks that conflict with the manually finalized checkpoint.

There were some CI fixes in https://github.com/sigp/lighthouse/pull/7071 that I tried including here

Co-authored with: @jimmygchen  @pawanjay176 @michaelsproul
2025-03-18 05:21:05 +00:00
Michael Sproul
58482586f5 Support Hoodi testnet (#7145)
Hardcode config for the upcoming `hoodi` testnet so we can run with `--network hoodi`.
2025-03-18 02:10:24 +00:00
Michael Sproul
4de062626b State cache tweaks (#7095)
Backport of:

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

For:

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


  - Prevent writing to state cache when migrating the database
- Add `state-cache-headroom` flag to control pruning
- Prune old epoch boundary states ahead of mid-epoch states
- Never prune head block's state
- Avoid caching ancestor states unless they are on an epoch boundary
- Log when states enter/exit the cache

Co-authored-by: Eitan Seri-Levi <eserilev@ucsc.edu>
2025-03-18 02:10:21 +00:00
Eitan Seri-Levi
8ce9edc584 Add block ban flag --invalid-block-roots (#7042) 2025-03-17 13:18:22 +00:00
Mac L
a1b1d7ae58 Remove discv5 logs from logfile output (#7150)
#7146


  Set `dep_logs` to false when building the `file_logging_layer`. This will remove both `discv5` and `libp2p` logs from the output.
2025-03-17 07:27:38 +00:00
Mac L
d96123b028 Remove unnecessary filter_layer in logger builder (#7149)
https://github.com/sigp/lighthouse/issues/7146


  Removes `filter_layer` from the builder as this was acting as a "global minimum". We don't actually need this, since we are using more granular control in `stdout_logging_layer` and `file_logging_layer`. Removing this restores control of the logfiles level back to the `--logfile-debug-level` flag (and defaults to debug).
2025-03-17 05:55:41 +00:00