Commit Graph

3780 Commits

Author SHA1 Message Date
Michael Sproul
12f5ab04f3 Load the state corresponding to head payload status yay 2026-03-26 16:03:55 +11:00
dapplion
ac5357532b Source head_payload_status from get_head, not hardcoded Pending
Thread head_payload_status from get_head() return through to
CanonicalHead::new(). In restore_from_store, call get_head() on the
loaded fork choice to get the correct status. Removes Pending defaults.
2026-03-25 23:19:54 -05:00
dapplion
ea1e99b2f7 Add TODO for head_payload_status initialization (re: #8998) 2026-03-25 23:09:11 -05:00
dapplion
c7670ede02 Cleanup and spec parity fixes
- Add missing payload attestation slot check: spec returns early when
  data.slot != block.slot (PTC votes only for assigned block)
- Remove dead ignored tests (need mock EL Gloas support to run)
- Remove unused new_with_gloas and inspect_queued_payload_attestations
- Remove gloas entries from bin.rs (not part of this PR)
- Collapse nested if in payload attestation error handling (clippy)
- Rename env -> envelope in load_parent
- Add TODO(gloas) for parent_head_hash in re-org path
- Remove head_payload_status from ForkchoiceUpdateParameters (lives on
  CachedHead, sourced from get_head return)
2026-03-25 23:07:45 -05:00
dapplion
e676c33c92 Merge sigp/unstable into gloas-walk-always 2026-03-25 22:02:08 -05:00
dapplion
93f987f3cf Remove head_payload_status from ForkchoiceUpdateParameters
head_payload_status is internal fork choice state, not an EL
forkchoiceUpdated parameter. It already lives on CachedHead — source
it directly from get_head() return in recompute_head_at_slot instead
of threading through ForkchoiceUpdateParameters.

Also add TODO(gloas) for parent_head_hash in re-org path (V29 nodes
don't carry execution_status).
2026-03-25 21:16:06 -05:00
Michael Sproul
bd34bb1430 Remove schema migrations for v28 and earlier (#9031)
With LH v8.1.3 supporting Fulu-on-Gnosis, we no longer need these DB migrations. All Lighthouse nodes running in prod will soon be updated to LH v8.0.0+ and schema v28+.

This PR helps with Gloas fork choice changes, by allowing us to avoid updating old schema migrations when adding V29 for Gloas:

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


  


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2026-03-26 02:10:34 +00:00
dapplion
f31a93697e Fix test review issues
- Remove wrong latest_message assertions from payload attestation test
  (on_payload_attestation writes to PTC bitfields, not vote tracker)
- Fix corrupted comment: "votes.gloas_enabled() to the genesis block"
  → "votes to the genesis block"
- Fix http_api test fallback string: "n/a" → "irrelevant" to match
  production code
- Add issue link to #[ignore] test
- Add comment explaining head_payload_status as u8 cast
2026-03-25 20:08:43 -05:00
dapplion
e7f027badd O(n) children index, fix load_parent for gloas blocks
- Build parent->children index once per find_head call, replacing O(n)
  scans in filter_block_tree and get_node_children with O(1) lookups.
- Skip zero block_hash in is_parent_block_full check — default/zero
  hashes don't indicate a real payload relationship.
- Fall back to block state_root for genesis when envelope not stored.
- Store execution payload envelope in EF test harness during
  on_execution_payload step.
2026-03-25 19:38:54 -05:00
Michael Sproul
9f1f68c3ee Add back AttestationFromBlock 2026-03-26 10:39:57 +11:00
dapplion
fdf2fd2267 Simplify reorg weight logic, TODO(gloas) for payload-aware version
Remove V17/V29 branching in beacon_chain reorg weight computation.
Use total weight for both pre and post-GLOAS, which is correct for
pre-GLOAS and conservative for post-GLOAS. The payload-aware version
will be needed when reorg logic is enabled for GLOAS.
2026-03-25 18:38:59 -05:00
Michael Sproul
e77651ac06 Revert changes in load_parent 2026-03-26 10:27:20 +11:00
Michael Sproul
2323b86ffa Merge remote-tracking branch 'origin/unstable' into gloas-walk-always 2026-03-26 10:07:46 +11:00
dapplion
93ef1e395c Include head_payload_status in ForkChoiceView comparison
The early exit check in recompute_head_at_slot compared only
head_block_root and checkpoints. When on_execution_payload changed
the payload status from Empty to Full without changing the head root,
the CachedHead was not updated. Add head_payload_status to
ForkChoiceView so the change is detected.
2026-03-25 17:47:49 -05:00
Eitan Seri-Levi
c7055b604f Gloas serve envelope rpc (#8896)
Serves envelope by range and by root requests. Added PayloadEnvelopeStreamer so that we dont need to alter upstream code when we introduce blinded payload envelopes.


  


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

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

Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
2026-03-25 06:45:24 +00:00
Michael Sproul
8b448864f0 Re-do head_payload_status 2026-03-25 14:05:11 +11:00
Alleysira
7ffc637eef fix(network): set ENR nfd to zero bytes when next fork is unknown (#9009)
Fixes #8996


  When no next fork is scheduled, the `nfd` field in the ENR was set to the current fork digest via
`.unwrap_or_else(|| ctx.fork_context.current_fork_digest())`.

According to the [spec](1baa05e711/specs/fulu/p2p-interface.md (L636-L637)), `nfd` should be zero-valued bytes when the next fork is unknown.


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

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

Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com>
2026-03-23 22:07:37 +00:00
hopinheimer
cb35ba6869 Merge branch 'unstable' of github.com:sigp/lighthouse into fix-gloas-ef-tests 2026-03-23 14:40:04 -04:00
Eitan Seri-Levi
b3d5185893 Carry forward withdrawals from the current BeaconState when a parent envelope is missed (#9014)
Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com>
2026-03-22 21:46:39 +00:00
hopinheimer
cc8466dfa5 fixing recursive calls with caching 2026-03-20 16:10:43 -04:00
Michael Sproul
06025228ae Gloas cold DB (#8991)
Closes:

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


  - Update the `HotColdStore` to handle storage of cold states.
- Update `BeaconSnapshot` to hold the execution envelope. This is required to make `chain_dump`-related checks sane, and will be generally useful (see: https://github.com/sigp/lighthouse/issues/8956).
- Bug fix in the `BlockReplayer` for the case where the starting state is already `Full` (we should not try to apply another payload). This happens on the cold DB path because we try to replay from the closest cached state (which is often full).
- Update `test_gloas_hot_state_hierarchy` to cover the cold DB migration.


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

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
2026-03-19 09:09:13 +00:00
Mac L
a965bfdf77 Remove lighthouse/analysis endpoints (#8968)
Some of our custom `lighthouse/analysis` endpoints will require maintenance for the Gloas hard fork. We have decided instead to remove those endpoints. We don't utilize them internally and they have pretty limited utility and so we feel they are not worth maintaining.


  Remove `lighthouse/analysis/attestation_performance` and `lighthouse/analysis/block_packing_efficiency` endpoints.


Co-Authored-By: Mac L <mjladson@pm.me>
2026-03-18 01:24:58 +00:00
Eitan Seri-Levi
17d183eb5b Unknown block for envelope (#8992)
Add a queue that allows us to reprocess an envelope when it arrives over gossip references a unknown block root. When the block is finally imported, we immediately reprocess the queued envelope.

Note that we don't trigger a block lookup sync. Incoming attestations for this block root will already trigger a lookup for us. I think thats good enough


  


Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com>
2026-03-17 07:35:05 +00:00
hopinheimer
5aa11925ac unstable merge 2026-03-17 02:44:31 -04:00
Michael Sproul
95b99ee724 Spec v1.7.0 alpha.3 (#8988)
Update spec code for compliance with spec v1.7.0-alpha.3: https://github.com/ethereum/consensus-specs/releases/tag/v1.7.0-alpha.3

The actual consensus changes are minimal. There are few more changes that are only relevant to fork choice or P2P validation that we will pick up in future PRs.

The change "Ignore beacon block if parent payload unknown" is currently covered in a hacky way by `load_parent` and can be improved once we have fork choice.

The change "Add parent_block_root to bid filtering key" is relevant to bid gossip validation, which we don't have at all in unstable yet.


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2026-03-16 11:40:22 +00:00
hopinheimer
916d9fb018 changes 2026-03-16 07:00:51 -04:00
hopinheimer
0df749f0a2 completing should_extend_payload implementation 2026-03-16 05:53:47 -04:00
hopinheimer
97d1b7bf3c Merge branch 'gloas-fc-proto' of github.com:hopinheimer/lighthouse into gloas-fc-proto 2026-03-16 02:30:47 -04:00
hopinheimer
f747696113 bitfield for PTC votes 2026-03-16 02:30:35 -04:00
hopinheimer
cf9e463981 Merge branch 'unstable' into gloas-fc-proto 2026-03-16 01:42:53 -04:00
Mac L
4eecca6da7 Update /rewards endpoints to match spec (#8967)
I believe one of our rewards endpoints is slightly out of spec. We do not return the `finalized` status for `post_beacon_rewards_attestations`.
Additionally, the `eth2` client doesn't expect the correct wrapper types for some other endpoints.


  - Update `post_beacon_rewards_attestations` server implementation to match spec.
- Update all three client functions in `eth2` to the correct wrapper type.
- Add missing tests for `http_api` to detect any regressions.


Co-Authored-By: Mac L <mjladson@pm.me>
2026-03-16 04:53:22 +00:00
ethDreamer
6ca610d918 Breakup RPCBlock into LookupBlock & RangeSyncBlock (#8860)
Co-Authored-By: Mark Mackey <mark@sigmaprime.io>
2026-03-13 19:22:29 +00:00
Akihito Nakano
53a711956e Fix flaky test_same_subnet_unsubscription (#8932)
Co-Authored-By: figtracer <1gusredo@gmail.com>

Co-Authored-By: ackintosh <sora.akatsuki@gmail.com>
2026-03-13 18:27:15 +00:00
Eitan Seri- Levi
6fbb9314d1 Merge branch 'unstable' of https://github.com/sigp/lighthouse into gloas-fc-proto 2026-03-13 04:52:21 -07:00
chonghe
e1e97e6df0 Fix proposer lookahead endpoint JSON return type (#8970)
Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io>
2026-03-12 01:11:37 +00:00
Michael Sproul
bff72a920d Update database and block replayer to handle payload envelopes (#8886)
Closes:

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


  - Update `BlockReplayer` to support replay of execution payload envelopes.
- Update `HotColdDB` to load payload envelopes and feed them to the `BlockReplayer` for both hot + cold states. However the cold DB code is not fully working yet (see: https://github.com/sigp/lighthouse/issues/8958).
- Add `StatePayloadStatus` to allow callers to specify whether they want a state with a payload applied, or not.
- Fix the state cache to key by `StatePayloadStatus`.
- Lots of fixes to block production and block processing regarding state management.
- Initial test harness support for producing+processing Gloas blocks+envelopes
- A few new tests to cover Gloas DB operations


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

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

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

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

Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
2026-03-11 23:06:25 +00:00
Lion - dapplion
6350a27031 Optionally check DB invariants at runtime (#8952)
Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
2026-03-11 06:20:02 +00:00
Mac L
815040dc3c Remove c-kzg (#8930)
#7330


  Removes `c-kzg` from our `kzg` crate and rely fully on the `rust_eth_kzg` crate.

This removes the old `Blob` type entirely and instead handles `rust_eth_kzg::KzgBlobRef`s directly which allows us to avoid some extra stack allocations . Similarly, we make `Bytes32` and `Bytes48` type aliases rather than structs as this fits better with the new `rust_eth_kzg` API.


Co-Authored-By: Mac L <mjladson@pm.me>
2026-03-11 05:43:26 +00:00
Romeo
906400ed34 Implement proposer lookahead endpoint (#8815)
closes #8809


  Implement GET /eth/v1/beacon/states/{state_id}/proposer_lookahead ([beacon-APIs#565](https://github.com/ethereum/beacon-APIs/pull/565)). Returns the proposer lookahead from Fulu+ states; 400 for pre-Fulu. Includes integration test.


Co-Authored-By: romeoscript <romeobourne211@gmail.com>

Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io>
2026-03-10 13:36:58 +00:00
Michael Sproul
081229b748 Implement proposer duties v2 endpoint (#8918)
Fix the issue with the `proposer_duties` endpoint using the wrong dependent root post-Fulu by implementing the new v2 endpoint:

- https://github.com/ethereum/beacon-APIs/pull/563

We need to add this in time for Gloas, and then we can we can deprecate and remove v1.


  - Add a new API handler for the v2 endpoint
- Add client code in the `eth2` crate
- Update existing tests and add some new ones to confirm the different behaviour of v1 and v2

There's a bit of test duplication with v1, but this will be resolved once v1 and its tests are deleted.


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

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

Co-Authored-By: chonghe <44791194+chong-he@users.noreply.github.com>
2026-03-10 07:57:51 +00:00
hopinheimer
ca1b3ebca5 Merge branch 'unstable' into gloas-fc-proto 2026-03-09 19:27:51 -04:00
Eitan Seri-Levi
7dab32dd16 Gloas payload envelope processing (#8806)
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 <michael@sigmaprime.io>

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
2026-03-09 05:23:34 +00:00
Michael Sproul
537c2ba8b3 Remove /lighthouse/analysis/block_rewards APIs (#8935)
Mark pointed out that these APIs will require updates for Gloas, so I figured we may as well get rid of them. As far as I know, blockprint was the only use case and it is now defunct. The consensus block value is included in getBlock API responses, so there's no reason for VCs to use the `POST` API, and there is now a standard API for the rewards of canonical blocks. The SSE event was non-standard, and likely only used by blockprint as well.


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2026-03-09 00:35:52 +00:00
Akihito Nakano
efe43f7699 Fix cargo-sort errors (#8945)
The `cargo-sort` job in CI is [failing](https://github.com/sigp/lighthouse/actions/runs/22781651620/job/66088700318?pr=8932) since [cargo-sort v2.1.1](https://github.com/DevinR528/cargo-sort/releases/tag/v2.1.1) has been released, which reports new errors for our Cargo.toml files.


  Ran `cargo-sort` formatter locally with the new version.


Co-Authored-By: ackintosh <sora.akatsuki@gmail.com>
2026-03-06 23:09:33 +00:00
Mac L
9c4715c251 Fix lints for Rust v1.94.0 (#8939)
Following the release of Rust v1.94.0 there are new Clippy lints which do not pass and are blocking CI (which pulls in the latest version of Rust)


  This is pretty much the minimum just to get CI running again. Most of the errors involve error types being too large. For now I've added allows but later it might be worth doing a refactor to `Box` or otherwise remove the problematic error types.


Co-Authored-By: Mac L <mjladson@pm.me>
2026-03-06 07:54:43 +00:00
hopinheimer
6f6da5b393 lint 2026-03-02 13:27:45 -05:00
hopinheimer
e68cc03114 vote sanity and genesis epoch fix 2026-03-02 13:25:03 -05:00
Michael Sproul
6194dddc5b Persist custody context more readily (#8921)
We received a bug report of a node restarting custody backfill unnecessarily after upgrading to Lighthouse v8.1.1. What happened is:

- User started LH v8.0.1 many months ago, CGC updated 0 -> N but the CGC was not eagerly persisted.
- LH experienced an unclean shutdown (not sure of what type).
- Upon restarting (still running v8.0.1), the custody context read from disk contains CGC=0: `DEBUG Loaded persisted custody context   custody_context: CustodyContext { validator_custody_count: 0, ...`).
- CGC updates again to N, retriggering custody backfill: `DEBUG Validator count at head updated   old_count: 0, new_count: N`.
- Custody backfill does a bunch of downloading for no gain: `DEBUG Imported historical data columns   epoch: Epoch(428433), total_imported: 0`
- While custody backfill is running user updated to v8.1.1, and we see logs for the CGC=N being peristed upon clean shutdown, and then correctly read on startup with v8.1.1.
- Custody backfill keeps running and downloading due to the CGC change still being considered in progress.


  - Call `persist_custody_context` inside the `register_validators` handler so that it is written to disk eagerly whenever it changes. The performance impact of this should be minimal as the amount of data is very small and this call can only happen at most ~128 times (once for each change) in the entire life of a beacon node.
- Call `persist_custody_context` inside `BeaconChainBuilder::build` so that changes caused by CLI flags are persisted (otherwise starting a node with `--semi-supernode` and no validators, then shutting it down uncleanly would cause use to forget the CGC).

These changes greatly reduce the timespan during which an unclean shutdown can create inconsistency. In the worst case, we only lose backfill progress that runs concurrently with the `register_validators` handler (should be extremely minimal, nigh impossible).


Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2026-03-02 06:43:51 +00:00
Michael Sproul
7e69f6ca1c Merge remote-tracking branch 'origin/release-v8.1' into back-merge-v8.1.1 2026-03-02 09:20:25 +11:00
hopinheimer
eb1b81063d fixing test 2026-02-26 04:38:45 -05:00