Commit Graph

7552 Commits

Author SHA1 Message Date
dapplion
cf53309224 Enable Gloas fork choice compliance 2026-06-09 13:17:11 +02:00
dapplion
d3416ccc8a Fix fork choice compliance tests 2026-06-08 21:48:20 +02:00
dapplion
c1b60f1c80 Call core proto-array in compliance check 2026-06-08 15:40:34 +02:00
dapplion
2a938715eb Reuse fork-choice child traversal for compliance leaves 2026-06-08 15:34:16 +02:00
dapplion
0223d7ac43 Merge remote-tracking branch 'sigp/unstable' into 9295
# Conflicts:
#	testing/ef_tests/src/cases/fork_choice.rs
2026-06-08 13:31:46 +02:00
Lion - dapplion
8e4df4abab Simplify lookup sync da_checker oracle (#9428)
Implementing gloas lookup sync is currently incompatible with the `GossipBlockProcessResult` mechanism.

Today it's implemented such that if we receive a sucessful `GossipBlockProcessResult` we directly mark the lookup as Complete and delete it. In Gloas we can't delete a lookup after block import, as we may still have FULL child awaiting the payload.

IMO this `GossipBlockProcessResult` brings a lot of headache and edge cases that we can just live without. Also the `reset_request` business is nasty and can easily leave the lookup in a bad state.


  If we get rid of `GossipBlockProcessResult` we only pay the following performance penalty:

- Lookup is created exactly while the block's payload is being execution validated
- (new degradation) we download the block again
- send the block for processing but the duplicate cache prevents double execution

So in the worst case we spend a few KBs of extra download bandwidth. Remember each block is downloaded 8x times through gossip in the happy case.


Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>

Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com>
2026-06-05 23:52:45 +00:00
Jimmy Chen
65f1a832e4 Optimise slow block verification tests (#9274)
Reduce CI time for `block_verification` tests that exceed 120s on Fulu/Gloas forks.

- Cache the chain segment across tests using `LazyLock<OnceCell>` (was rebuilt 10+ times independently)
- Reduce chain length from 320 to 192 slots (10 epochs to 6 epochs)
- Reduce `BLOCK_INDICES` from 7 to 3
- Reduce `chain_segment_varying_chunk_size` from 5 to 3

AI assisted, self reviewed.

Before vs After comparison (1 sample only):

* **Before**: 19 tests exceeded the 120s slow threshold.
* **After**: zero exceed it. Overall: 1,890s down to 797s (-58%).

```
| Test                                                 |  Before |   After |  Change |
|------------------------------------------------------|---------|---------|---------|
| chain_segment_varying_chunk_size                     |   239s  |     98s |    -59% |
| invalid_signature_attester_slashing                  |   175s  |     64s |    -64% |
| invalid_signature_exit                               |   173s  |     62s |    -64% |
| invalid_signature_deposit                            |   170s  |     60s |    -65% |
| invalid_signature_attestation                        |   165s  |     62s |    -63% |
| invalid_signature_proposer_slashing                  |   161s  |     56s |    -66% |
| block_gossip_verification                            |   154s  |     91s |    -41% |
| invalid_signature_block_proposal                     |   151s  |     58s |    -61% |
| invalid_signature_randao_reveal                      |   149s  |     54s |    -64% |
| invalid_signature_gossip_block                       |   135s  |     46s |    -66% |
|------------------------------------------------------|---------|---------|---------|
| TOTAL                                                |  1890s  |    797s |    -58% |
```


  


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

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
2026-06-05 20:51:33 +00:00
Alleysira
abe7ca20a9 fix(network): clear ENR nfd field when no next fork is scheduled during runtime transitions (#9131)
No. But related to #9009 and #8996


  - Change the `ForkContext::next_fork_digest()` to return `[u8; 4]` (returning `[0u8; 4]` for "no next fork").
- Update the initialization path and runtime fork transition path accordingly.

Added tests:
- [x] `test_next_fork_digest` — existing test passes with non-Option return type
- [x] `test_next_fork_digest_returns_zero_when_no_next_fork` — init at last BPO fork returns `[0u8; 4]`
- [x] `test_next_fork_digest_zero_after_runtime_transition_to_last_fork` — simulates `update_current_fork` to last fork, then verifies zero


Co-Authored-By: alleysira <1367108378@qq.com>

Co-Authored-By: Alleysira <56925051+Alleysira@users.noreply.github.com>

Co-Authored-By: chonghe <44791194+chong-he@users.noreply.github.com>
2026-06-05 20:16:28 +00:00
Eitan Seri-Levi
42e678189c Update gloas api routes to match updated spec (#9418)
tldr the routes got pluralized
https://github.com/ethereum/beacon-APIs/pull/613


  


Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
2026-06-05 20:16:06 +00:00
Daniel Knopik
e78e1d38ba Update libp2p (#9331)
Update libp2p to benefit from recent improvements, including partial messages bugfixes.


  


Co-Authored-By: Daniel Knopik <daniel@dknopik.de>
2026-06-05 14:50:19 +00:00
Pawan Dhananjay
6698872f8a Improve error types for envelopes (#9414)
N/A


  Currently, we have `EnvelopeError` having a `ImportError` wrapping a `BlockError`. I feel this is extremely unintuitive because most of the envelope processing functions can simply return an `EnvelopeError` that makes sense in the function's context. It revealed further ugliness when implementing range sync in #9362

This PR does 2 main things:
1. Removes `ImportError(BlockError)` variant
2. Adds `EnvelopeError(EnvelopeError)` variant to a `BlockError`.

I feel this is more natural as there can be envelope errors when we try importing a Block but envelope errors can be contained to just envelope related errors.

The main blocker to doing this was `PayloadVerificationHandle` returning a `BlockError`. It uses a very small subset of `BlockError` which I extracted to its own error type which can be converted into both a BlockError and EnvelopeError.

This allows us to keep most of the pure envelope processing functions to just return EnvelopeErrors while we convert it to a `BlockError` only in import paths where we need to return a consolidated `BlockError`.


Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com>
2026-06-05 13:57:28 +00:00
Lion - dapplion
494b00a349 Fix O(n²) find_head and stack overflow in filter_block_tree (#9090)
Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
2026-06-05 01:24:49 +00:00
Eitan Seri-Levi
da42d37456 Ensure PTC votes accurately reflect data availability (#9412)
Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
2026-06-05 00:01:20 +00:00
Lion - dapplion
eeae8514b1 Remove unused spec field from AvailableBlock (#9411)
N/A


  Remove unused spec field from AvailableBlock


Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
2026-06-04 19:14:32 +00:00
Lion - dapplion
d98de9f8dd Reject importing Gloas block until parent's payload is imported (#9382)
Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2026-06-04 15:53:05 +00:00
Jimmy Chen
91456fb218 Regression test for range sync CGC race condition (#8039)
Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
2026-06-04 07:24:27 +00:00
Eitan Seri-Levi
d617c826fe Gloas data column reprocess queue (#9339)
When debugging ePBS with columns, we noticed that columns arriving before their block dont pass gossip verification checks and are dropped. This PR ensures that columns arriving before the block are sent to the reprocess queue. Once their block arrives, they are reprocessed.

This isn't an issue pre-gloas because we don't make block root checks for fulu data columns. This allows us to gossip verify the column and send it to the DA cache before the block arrives.

I think we also need to handle this edge case for partial data columns. Theres an existing TODO for that already.


  


Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
2026-06-03 16:07:41 +00:00
Lion - dapplion
eab5163d68 Remove RequestState trait from lookup sync (#9391)
Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
2026-06-03 15:29:04 +00:00
João Oliveira
c2ac519c69 Disable Mplex by default (#9365)
Co-Authored-By: João Oliveira <hello@jxs.pt>
2026-06-03 08:05:31 +00:00
Lion - dapplion
d7d56e6312 Delete unnecessary SyncMessage variants (#9379)
- Simplification from https://github.com/sigp/lighthouse/pull/9155

Lookup sync does not cache sidecars, so sending the full network object adds unnecessary complexity. Sync only needs to know: We have received a header that has an unknown parent.


  Replace `UnknownParentDataColumn` and `UnknownParentPartialDataColumn` for `UnknownParentSidecarHeader`


Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>

Co-Authored-By: Eitan Seri-Levi <eserilev@gmail.com>
2026-06-02 14:57:03 +00:00
Lion - dapplion
bbe7ead813 Move BlockProcessingResult match out of block lookups (#9327)
- https://github.com/sigp/lighthouse/pull/9155 remove the trait abstraction for processing block / blobs / columns / payloads

As a result we would have to duplicate x3 the big match on `BlockProcessingResult` we currently have in block lookups mod.rs

This PR moves the match of `BlockProcessingResult` to `sync_methods` to reduce the diff of https://github.com/sigp/lighthouse/pull/9155. There are some subtle changes that deserve dedicated attention, and may be drowned in the bigger diff of https://github.com/sigp/lighthouse/pull/9155 otherwise:

| Unstable | This PR / #9115 |
| - | - |
| Some error conditions immediately `Drop` the lookup (no retries). For example for "internal" errors like the BeaconChainError | Retries ALL errors 4 times. I believe assuming some errors are internal is risky as dropping a lookup drops all its children potentially forcing the node to resync a lot of blocks because of an internal timeout


  


Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
2026-06-02 02:50:56 +00:00
Lion - dapplion
b781227f1d Deprecate blob lookup sync (#9383)
- Extends https://github.com/sigp/lighthouse/pull/9126 to cover blob lookup sync

Lookup sync is only for unfinalized blocks, which will never contains blobs in any network we support.


  


Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>

Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
2026-06-01 12:10:47 +00:00
Eitan Seri-Levi
578b6a62c7 Add POST beacon/bid endpoint (#9347)
This endpoint is needed for buildoor (and eventually our builder client once its implemented)


  


Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
2026-06-01 12:10:40 +00:00
Lion - dapplion
cf259e7c50 Make proposer_score_boost non-optional in ChainSpec (#9386)
Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
2026-06-01 08:43:40 +00:00
Lion - dapplion
f0aaf65553 Use correct slot in custody request (#9380)
Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
2026-06-01 06:17:00 +00:00
Michael Sproul
74a5609ab1 Delete bogus InvalidBestNode error (#9364)
On Glamsterdam devnets we started seeing Lighthouse nodes unable to start with errors like:

> May 26 04:34:01.582 CRIT  Failed to start beacon node                   reason: "Unable to load fork choice from disk: ForkChoiceError(ProtoArrayStringError(\"find_head failed: InvalidBestNode(InvalidBestNodeInfo { current_slot: Slot(23550), start_root: 0x2c70b1641c29ec46360c99f9a8512f077862cbbc603e16f4a423007d210b0c5f, justified_checkpoint: Checkpoint { epoch: Epoch(712), root: 0x2c70b1641c29ec46360c99f9a8512f077862cbbc603e16f4a423007d210b0c5f }, finalized_checkpoint: Checkpoint { epoch: Epoch(710), root: 0xede5e0b09b51bdb5445ade3398e685bd193b845e0b0ffb827f0c3fec8277ea51 }, head_root: 0x2c70b1641c29ec46360c99f9a8512f077862cbbc603e16f4a423007d210b0c5f, head_justified_checkpoint: Checkpoint { epoch: Epoch(710), root: 0xede5e0b09b51bdb5445ade3398e685bd193b845e0b0ffb827f0c3fec8277ea51 }, head_finalized_checkpoint: Checkpoint { epoch: Epoch(709), root: 0xbb243eff616ff362c52b83113e7c536d0a68cb9ca3d6a1cb1055e732219d9736 } })\"))"

This error was the result of an overly-strict sanity check, based on assumptions that are not true under extreme network conditions.


  Completely remove the `InvalidBestNode` failure path: it is not compliant with the spec, and is actively harmful when triggered (it prevents Lighthouse from starting at all). The error was reachable in any situation where all leaf nodes of fork choice were ineligible to be the head. The payload invalidation tests show some examples of cases where this would happen, and the [newly-added regression test](9a5df1d982) shows a contrived case where it can happen on a Gloas network without _any_ slashings or invalid blocks. There are probably many more cases where it can happen.

We do not lose anything by removing it. The spec's implementation of `get_head` _always_ returns something (unless it crashes), and in these cases it is correct to return the starting node of the traversal: the justified checkpoint block. This is what we now do, and what the new test verifies.

I've also added some facilities to the harness for injecting attestations with fixed `payload_present` fields. @hopinheimer found himself needing something similar when messing with reorg tests, so I think these are probably useful. It might be possible to do without them by juggling the payload reveal timing in just the right way, but I think this approach is just way simpler.


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2026-06-01 00:46:58 +00:00
Eitan Seri-Levi
8396dc87d0 Deprecate gossip blobs (#9126)
#9124

Deprecate unneeded pre-Fulu blob features

- blob gossip
- blob lookup sync
- engine getBlobsV1

Also deprecates some tests and cleans up production code paths

I think this is blocked until gnosis forks to fulu?


  


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>

Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com>

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

Co-Authored-By: Daniel Knopik <daniel@dknopik.de>

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
2026-05-29 02:59:23 +00:00
Pawan Dhananjay
ba3abf943f Rust 1.96 lints (#9368)
N/A


  A rare single line lint update .


Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com>
2026-05-29 00:17:53 +00:00
Jimmy Chen
5636030b49 Add gossip validation spec tests for proposer/attester slashings (#9323)
Addresses #9232 partially. This PR covers two topics only.
* #9232

Wires up networking test vectors for `gossip_proposer_slashing` and `gossip_attester_slashing` topics.

The tests also revealed minor spec non-compliance where invalid slashings were ignored rather than rejected.


  - Refactor `process_gossip_proposer_slashing` and `process_gossip_attester_slashing` to return `MessageAcceptance`, so it can be verified in the tests
- Add `GossipValidation` test case, handler, and test entries
- Spec compliance fix: distinguish between internal errors and validation error - return `Reject` when the slashing is invalid and only penalise on invalid messages


Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
2026-05-28 00:27:16 +00:00
Michael Sproul
1d7eb3cc4d Bump compliance tests for alpha 8 spec 2026-05-25 16:12:50 +10:00
Michael Sproul
0a91b63c25 Merge remote-tracking branch 'origin/unstable' into fc-compliance 2026-05-25 15:42:29 +10:00
Michael Sproul
cc55c9ef5e Merge remote-tracking branch 'michael/payload-attestation-committee-cache' into fc-compliance 2026-05-25 15:35:03 +10:00
Eitan Seri-Levi
dfb259171a Ensure we can serve blocks and columns after head event is emitted (#9338)
See related issue: https://github.com/ethpandaops/dora/pull/713

When LH emits a `head` event the block isn't written to disk yet. Some upstream consumers may expect that after a `head` event that the block should be queryable via the beacon api. This PR falls back to fetching the block from the early attester cache if it wasn't found in the store. This should ensure that a block is always queryable immediately after a `head` event is emitted.

Additionally I noticed that when serving columns we always default to using the store. We already have `get_data_columns_checking_all_caches ` which tries the da cache, then the store and finally the early attester cache.


  


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

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2026-05-25 05:09:38 +00:00
Michael Sproul
4903fff430 Fix non-canonical payload attestation processing (#9305)
Breakout from:

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

We currently do not handle the verification of payload attestations on non-canonical side chains, we always attempt to use the head. The included regression test demonstrates this, and there is _also_ a fork choice compliance test in #9295 that triggers it.


  This PR is a bit opinionated, but I'll explain my judgements:

- We need a way to get the PTC for an arbitrary slot from an arbitrary state. This involves potential state advances, database lookups, etc. There is some fiddly logic required to check that states are in range/etc.
- We _already have_ a cache with the exact same lifecycle as the PTCs, namely the attester shuffling cache. Therefore, we can de-duplicate a lot of the complexity by storing the PTCs for a given epoch (and decision block) in this cache.

The other opinionated change is in the tests. The previous tests were set up kind of nicely to avoid instantiating a `BeaconChainHarness`. However they were not using mocking, which made testing the non-canonical chain case kind of infeasible. To remedy this, I've changed them to just use a beacon chain harness and create two chains using its relatively easy to use methods for doing this. The running time of the tests goes from something like 2.6s for 8 tests to 3.3s for 9 tests, which is only an increase of 0.04s/test. Negligible. Another plus to using the `BeaconChainHarness` is that it avoids a bunch of the cruft to create synthetic non-mocked beacon chain bits.

At the same time, I've made some attempt to improve modularity (and fit with the `GossipVerificationContext`) by pulling out the guts of `with_committee_cache` into a new function (`with_cached_shuffling`) that clearly shows its dependency surface.


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

Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
2026-05-25 05:06:27 +00:00
chonghe
9b961960c4 Deprecate some reorg-related CLI flags and read from spec (#9177)
- #9123


  


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

Co-Authored-By: chonghe <44791194+chong-he@users.noreply.github.com>
2026-05-25 02:11:27 +00:00
Daniel Knopik
b5d44bff36 Enable partial data columns by default on Hoodi and Sepolia (#9343)
Enable partial data columns by default on Hoodi and Sepolia.


Co-Authored-By: Daniel Knopik <daniel@dknopik.de>
2026-05-25 01:44:43 +00:00
Mac L
89ee020330 Add macro to simplify into_full_block implementations (#9294)
Use a macro to remove the repetitive fork variant boilerplate in `signed_beacon_block.rs` when implementing `into_full_block` for the various `SignedBeaconBlock` variants


Co-Authored-By: Mac L <mjladson@pm.me>
2026-05-25 01:29:34 +00:00
Mac L
b9a68ad2c6 Add support for jemalloc memory profiling (#9326)
Add a new feature flag to `lighthouse` which adds jemalloc profiling support.
We could manually add this during memory profiling but it is a nice QoL to have this built-in imo


Co-Authored-By: Mac L <mjladson@pm.me>
2026-05-25 01:21:26 +00:00
Eitan Seri-Levi
0565a01633 Gloas dont enforce peer column custody on block import (#9341)
Peers that advertise that they have imported a block may not have the columns for that slot available post-Gloas. Ensure that we dont penalize them.


  


Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
2026-05-25 00:21:17 +00:00
Michael Sproul
d7dcf58257 Merge remote-tracking branch 'origin/unstable' into payload-attestation-committee-cache 2026-05-24 22:01:42 +10:00
Eitan Seri-Levi
5045e8dd85 Custody backfill sync only penalize peers once per batch (#9340)
During custody backfill sync if a peer fails to serve columns for a batch don't penalize them more than once per batch


  


Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
2026-05-22 17:50:50 +00:00
Eitan Seri-Levi
5693d86002 Ensure we use the right fork when calculating payload attestation sig domain (#9342)
Using `state.fork` is a bit sketchy at the fork boundary. It's safer to just use the payload attestations slot


  


Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
2026-05-22 17:50:45 +00:00
Eitan Seri-Levi
60abd4b5b9 Gloas alpha spec 8 (#9315)
https://github.com/ethereum/consensus-specs/releases/tag/v1.7.0-alpha.8


  


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

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2026-05-22 06:21:20 +00:00
Daniel Knopik
b5d5644eeb Add getBlobsV3 to LIGHTHOUSE_CAPABILITIES (#9330)
Forgot to add `ENGINE_GET_BLOBS_V3` to `LIGHTHOUSE_CAPABILITIES`.


  Add `ENGINE_GET_BLOBS_V3` to `LIGHTHOUSE_CAPABILITIES`.


Co-Authored-By: Daniel Knopik <daniel@dknopik.de>
2026-05-21 20:00:16 +00:00
dapplion
7f43ba77b9 Centralise Gloas boundary skip in CachedPTCs::try_from_state
CachedPTCs::try_from_state now returns Result<Option<Self>, _> and
internalises the boundary rule (pre-Gloas state, Gloas shuffling epoch
=> Ok(None)). Callers (block import priming, state advance timer,
with_cached_shuffling miss path) just skip insertion on None instead
of duplicating the guard. The unit test exercises the three boundary
cases against a pre-Gloas state.
2026-05-21 21:02:45 +02:00
dapplion
60472329e9 Clean up shuffling cache leftovers from PR #9305
- Remove unused `BeaconChainError::MissingPtcForGloasShuffling` variant
  (no producers remained after the earlier cleanup).
- Drop the `Result<(), BeaconChainError>` return type from
  `ShufflingCache::insert_committee_cache`; both match arms are
  infallible. Update callers in `beacon_chain.rs`, `state_advance_timer.rs`,
  `shuffling_cache.rs` and the unit tests accordingly.
- Trim stale "Replace the committee if it's not present" comment in
  `insert_committee_cache`; the Committee arm is now a no-op so only
  the `Promise(_) | None` whimsy line remains.
2026-05-21 21:02:45 +02:00
dapplion
52115542c1 Merge remote-tracking branch 'sigp/unstable' into payload-attestation-committee-cache
# Conflicts:
#	beacon_node/beacon_chain/src/payload_attestation_verification/tests.rs
2026-05-21 21:02:34 +02:00
Lion - dapplion
1caaa10fa8 Drop unused EthSpec generic from Stores (#9281)
Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
2026-05-21 08:35:35 +00:00
Michael Sproul
93be133093 Ignore invalid message tests for now 2026-05-21 16:35:02 +10:00
Michael Sproul
ece4bc0fa8 Fix proto_array tests 2026-05-21 16:21:47 +10:00