Commit Graph

7522 Commits

Author SHA1 Message Date
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
Daniel Knopik
a9637c1650 Partial columns cleanup (#9321)
#8314 left a few ugly potentially panicking location behind - all of them believed to be unreachable, but this PR fixes them regardless for good hygiene.


  Update to `ethereum_ssz 0.10.4` for two new helpers: `not_inplace` and `clone_zeroed`.

Remove remaining `expect` and `todo!` in favour of these helpers and one new fallible (but practically infallible) method.


Co-Authored-By: Daniel Knopik <daniel@dknopik.de>
2026-05-21 03:25:02 +00:00
Lion - dapplion
2c76ee5b6b Gloas lookup sync boilerplate (#9322)
Implements the boring boilerplate to send envelopes by root requests and process them. Pre-step to

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


  


Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
2026-05-20 12:56:49 +00:00
Michael Sproul
db6cb5ac32 Simplify/cleanup 2026-05-20 12:14:37 +10:00
Michael Sproul
8a3ac10fbc Ignore impossible attestation tests
See: https://github.com/ethereum/consensus-specs/issues/5271
2026-05-20 11:52:44 +10:00
Michael Sproul
b7920318e7 Revert botched attestation changes 2026-05-19 17:54:06 +10:00
Michael Sproul
9fe6f3f68c Merge branch 'payload-attestation-committee-cache' into fc-compliance 2026-05-19 16:53:43 +10:00
Michael Sproul
c30dd6f9c3 Update comment 2026-05-19 15:53:16 +10:00
Michael Sproul
9929ea0da9 Remove outdated Pending/Full comment 2026-05-19 15:50:41 +10:00
Michael Sproul
dc4c4d31dc Update cache size comment 2026-05-19 15:49:40 +10:00
Michael Sproul
b5a093d2ed Merge remote-tracking branch 'origin/unstable' into payload-attestation-committee-cache 2026-05-19 15:43:12 +10:00
Lion - dapplion
398efc3acc Use dedicated cache for HTTP API route (#9318)
- PR https://github.com/sigp/lighthouse/pull/9305 wants to store PTCs in the committee cache.

BUT the http API route wants to use the committee cache and insert historical committees (i.e. given state at epoch 1000, compute and store the committee for epoch 900).

If we want a single cache to serve both use cases we need to:
- Have entries in the committee cache that have no PTC: Makes reading PTCs from the cache not deterministic
- Compute historical PTC: A bunch of complicated code that's useless

Instead we can add a separate cache for the API, very simple one, that caches committees only. And have the one in the beacon chain compute and cache PTCs always.

### Performance impact

Slightly additional memory cost for users of the `beacon/states/committees` route. Caching is almost equivalent, except for queries of recent committees that may already exist in the beacon chain's committee cache.

### AI disclousure

This PR was written by hand 90%. Claude fixed some warp type issues


  


Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
2026-05-19 05:12:17 +00:00
Michael Sproul
fd0852a8e5 Remove outdated SPRP hint (#9312)
While working on this code in another branch I noticed we had this messy, complicated and incorrect code about SPRP (slots-per-restore-point), which is no longer a relevant concept since the introduction of hot state diffs.

In the name of simplicity, I've removed any kind of hinting here in favour of a simple out of bounds error. The benefit of adding complex hinting code (which is not tested) to such a function is not worth it IMO. Users will work it out (or ask) if we just tell them their request is out of bounds.


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2026-05-19 01:35:31 +00:00
Michael Sproul
a3bf75e9a1 Improve error handling 2026-05-19 10:58:26 +10:00
dapplion
8ec0c4fe7e Check that PTCs exist when inserting into the cache 2026-05-19 10:28:32 +10:00
Michael Sproul
4f2b393edb Remove future slot rejection 2026-05-18 13:53:14 +10:00
Michael Sproul
26098446db Merge branch 'payload-attestation-committee-cache' into fc-compliance 2026-05-18 12:57:19 +10:00
Michael Sproul
0fa823af1b Rename func for clarity 2026-05-18 12:09:48 +10:00
Michael Sproul
bd1a9ea2df Handle Gloas fork boundary epoch 2026-05-18 12:06:04 +10:00
Michael Sproul
9a0c3f859d Add basic test for fork boundary case 2026-05-18 09:53:37 +10:00
Michael Sproul
fd56cc81c6 Restore whimsy 2026-05-14 22:49:52 +10:00
Michael Sproul
c03c045f8b Fix non-canonical payload attestation processing 2026-05-14 22:30:24 +10:00
Michael Sproul
c65ed44d50 Clean up 2026-05-14 14:55:54 +10:00
Michael Sproul
d4eb6e4727 Refactor WIP 2026-05-14 14:37:24 +10:00
Michael Sproul
c87522411c Pass make lint-full 2026-05-14 13:24:01 +10:00
Michael Sproul
90fcc51216 Update committee cache to carry PTC 2026-05-14 13:23:51 +10:00
Michael Sproul
a795451cf9 Revert changes to payload attestation verif 2026-05-14 12:45:32 +10:00
Daniel Knopik
1a68631180 Gloas payload cache (#9209)
In Gloas, beacon blocks are imported into fork choice immediately - the payload envelope and data columns arrive
separately. KZG commitments moved from the column sidecar into the execution payload bid, so the existing
`DataAvailabilityChecker` (which assumes block and data are coupled) can't be used for Gloas.


  * Introduced `PendingPayloadCache` to keep track of payload and data columns per block root.
* Added gossip column verification
* Added support for Gloas data column reconstruction
* Payload envelope verification simplified: removed `MaybeAvailableEnvelope`, `ExecutedEnvelope`, `EnvelopeImportData`

Not yet implemented (tracked with TODOs):
- Proper lookup sync for Gloas columns arriving before blocks
- Partial column merging for Gloas
- Moving `load_gloas_payload_bid` disk reads off the async runtime
- Backfill/range sync for Gloas

Based on @eserilev's PR and work in progress. See also #9202 for verification.


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

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

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

Co-Authored-By: Daniel Knopik <107140945+dknopik@users.noreply.github.com>

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

Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
2026-05-13 07:03:34 +00:00
Eitan Seri-Levi
9101ddc69d ignore-ws-check flag doesnt allow the node to start outside the weak subjectivity period (#9290)
Using the `ignore-ws-check` doesn't actually let you start up a node thats outside the weak subjectivity period


  


Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
2026-05-13 04:20:08 +00:00
Michael Sproul
715d6bfa0c All tests bar invalid_message passing, changes might be dubious 2026-05-13 09:26:27 +10:00
hopinheimer
757873200b Fix stale beacon_state_root in test helpers (#9289)
Test helpers `add_attested_block_at_slot` and `add_attested_blocks_at_slot` accepted `state_root` argument which was computed before applying the block.


  


Co-Authored-By: hopinheimer <knmanas6@gmail.com>
2026-05-12 06:24:18 +00:00