Commit Graph

1250 Commits

Author SHA1 Message Date
chonghe
8d77b1c08d Remove test_logger feature (#9125)
- #9107


  Remove all instances of `test_logger` in the code


Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io>
2026-04-30 04:57:47 +00:00
dapplion
ce00ae2dc7 Use stable if matches! instead of if let match guard
`if let` guards are nightly-only (rust-lang/rust#51114), causing
`error[E0658]` and a CI `check-code` failure. Replace with the stable
`if matches!(...)` form suggested by rustc.
2026-04-30 00:08:35 +02:00
Daniel Knopik
e742d0b4f1 fix tests 2026-04-29 23:18:36 +02:00
Daniel Knopik
c5ca824ec3 merge from unstable 2026-04-29 23:00:51 +02:00
Daniel Knopik
7cf76ac7af clean up 2026-04-29 17:38:49 +02:00
Daniel Knopik
2d3354551e error handling and wiring up 2026-04-29 17:38:48 +02:00
Daniel Knopik
d7f5e24ede nuke router 2026-04-29 14:24:25 +02:00
jking-aus
16132a3694 Spec v1.7.0-alpha.6 and Gloas genesis (#9190)
Co-Authored-By: Josh King <josh@sigmaprime.io>

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

Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
2026-04-29 08:23:24 +00:00
Eitan Seri-Levi
93293ee8e8 Merge branch 'unstable' of https://github.com/sigp/lighthouse into gloas-range-sync 2026-04-29 09:47:15 +02:00
Daniel Knopik
c76eb3e4c5 merge from unstable 2026-04-29 09:33:34 +02:00
Eitan Seri-Levi
e8c865dcc6 Gossip reprocessed payload envelopes that are timely (#9210)
Payloads from the reprocess queue should be gossiped after import if they are still timely. In devnets this happens frequently since there are many cases where the envelope arrives before the block


  


Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
2026-04-28 21:50:07 +00:00
Daniel Knopik
60e1ded4c3 Merge branch 'unstable' into gloas-payload-cache 2026-04-28 22:00:19 +02:00
Eitan Seri-Levi
46c9f313e3 tests 2026-04-28 21:12:22 +02:00
Daniel Knopik
a03906d4c0 fix remaining errors 2026-04-28 17:39:43 +02:00
Eitan Seri-Levi
d5ad1d8178 fix 2026-04-28 17:32:42 +02:00
Eitan Seri-Levi
802f77f700 Range sync 2026-04-28 17:25:53 +02:00
Daniel Knopik
4535753c9b starting to cell-ize 2026-04-28 17:09:42 +02:00
Daniel Knopik
3a5492fba7 initial straightforward merge changes 2026-04-28 17:09:41 +02:00
Eitan Seri-Levi
1de9d40b7e merge conflicts 2026-04-28 16:38:11 +02:00
Eitan Seri-Levi
7e68707213 Merge branch 'unstable' of https://github.com/sigp/lighthouse into gloas-parent-envelope-unknown-lookup 2026-04-28 16:33:52 +02:00
dapplion
11684b0da0 Complete envelope-lookup functionality and tests
Implementation:
- payload_envelope_verification: implement the AvailabilityPending branch
  in the envelope import flow. Previously returned
  InternalError("Pending payload envelope not yet implemented") for any
  envelope whose data columns hadn't yet been received, blocking the
  end-to-end RPC import path. New `import_pending_execution_payload_envelope`
  marks the payload as received in fork choice and persists the envelope to
  the store; columns are still expected to arrive separately (gossip /
  engineGetBlobs / reconstruction) and persist their own ops.

- sync manager: short-circuit `handle_unknown_parent_envelope` when the
  parent's payload was received between gossip-verification and the trigger
  reaching sync. No lookup is created; the trigger is treated as a no-op.

- gossip→sync hook: when a Gloas envelope is imported via the gossip path,
  emit `SyncMessage::GossipEnvelopeImported { block_root }` so any lookups
  awaiting that parent envelope unblock without depending on the in-flight
  RPC response landing first. Closes the review-flagged race where a
  gossip-imported envelope left child lookups pinned.

Tests (3 new):
- envelope_already_received_skips_lookup — trigger after envelope already
  in fork choice creates zero lookups.
- happy_path_unknown_parent_envelope — end-to-end RPC import path: lookups
  complete, head advances to the gossip block.
- happy_path_unknown_parent_envelope_via_gossip — pending envelope-only
  lookup unblocked by a concurrent gossip import via the new sync hook.

Existing tests updated:
- bad_peer_envelope_rpc_failure / bad_peer_wrong_envelope_response now
  expect the lookup to retry and succeed (mirroring `bad_peer_*` tests for
  blocks/blobs/columns), reflecting the now-working import path.
2026-04-28 15:49:29 +02:00
dapplion
7e50d47082 Add bad-peer and crypto-fail envelope-lookup tests
- bad_peer_wrong_envelope_response — peer responds with a different block_root
  than requested; request items raise UnrequestedBlockRoot, both lookups drop.
- crypto_on_fail_with_bad_envelope_signature — signature corruption rejected
  in gossip verification, peer scored with lookup_envelope_processing_failure.

Rename the four already-landed tests to match the existing happy_path /
bad_peer / envelope_* / crypto_on_fail_with_* naming.
2026-04-28 15:25:17 +02:00
dapplion
4dc34c6854 Add gloas parent-envelope-unknown lookup tests
Wires the lookup test rig for Gloas:
- Capture per-block execution payload envelopes from the external harness
  and serve them to peers via a new `network_envelopes_by_root` map.
- Handle `RequestType::PayloadEnvelopesByRoot` in `simulate_on_request` and
  `Work::RpcPayloadEnvelope` in the simulator processor branch.
- Allow `TestRig` callers to override the genesis validator count and
  bump initial balances to `max_effective_balance_electra` post-Electra,
  which Gloas committee-selection requires for genesis init to converge.

Adds four tests for the parent-envelope-unknown flow (each verified
red/green by stubbing the corresponding source path):

- `creates_envelope_and_child_lookups` — `UnknownParentEnvelope` produces
  exactly one envelope-only lookup for the parent root and one child
  lookup awaiting that envelope.
- `idempotent_triggers` — repeated triggers for the same parent merge
  into the existing envelope lookup; no duplicate lookups are created.
- `issues_payload_envelopes_by_root_rpc` — the envelope-only lookup
  dispatches a `PayloadEnvelopesByRoot` RPC for the parent block_root.
- `drops_cascade_on_rpc_error` — when the envelope RPC errors, the
  envelope lookup is dropped and the awaiting child cascades with it.

The end-to-end happy path (envelope arrives → child unblocks → block
imports → head advances) is gated on
`process_execution_payload_envelope` supporting `AvailabilityPending`,
which today returns `InternalError("Pending payload envelope not yet
implemented")`. That gap is independent of this PR's lookup machinery.
2026-04-28 14:59:06 +02:00
dapplion
f44c9e6b84 Simplify reconstruction test assertion
Replace `assert_event_journal_contains_at_least_ordered` helper with an
inline drain that just counts the gossip + reconstruction events. The
helper was carrying around `WORKER_FREED` bookkeeping and a strict
prefix-match for one caller; counting the two relevant work types until
both thresholds are met is the same check with much less code.
2026-04-28 14:59:06 +02:00
dapplion
aaf3f1d5f9 Fix beacon-chain and network test failures under FORK_NAME=gloas/fulu
- block_verification: skip ParentEnvelopeUnknown check when parent is the
  proto-array anchor. The anchor's `payload_received` is intentionally
  false per spec (never added to `store.payloads`), but no envelope is
  expected for it; without this exception the check rejects every
  post-anchor gloas block.

- network tests: disable `engineGetBlobs` in the TestRig harness. Under
  real crypto the mock EL's blob fetch raced the gossip path, importing
  via a spawned task that the test didn't await -- leaving `head_root()`
  unchanged when the assertion ran. The tests are designed to exercise
  the gossip + data-column path; the engine fetch was incidental.

- network tests: relax `data_column_reconstruction_at_deadline` to allow
  trailing duplicate reconstruction work items. The reprocess queue
  removes its dedup entry on dispatch, so a column processed during an
  in-flight reconstruction can dispatch a second one. The second is a
  no-op via `reconstruction_started`, so accept >= 1 trailing event.
2026-04-28 14:59:06 +02:00
Jimmy Chen
d8790f6677 Add payload attestation to op pool and pack into block (#9180)
Store gossip-verified `PayloadAttestationMessage`s in the operation pool and pack them into the block body at during block production.

Built on top of #9145.


  


Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
2026-04-28 10:49:28 +00:00
Eitan Seri-Levi
c61b512bc4 Merge branch 'unstable' into gloas-parent-envelope-unknown-lookup 2026-04-28 00:09:59 +02:00
hopinheimer
6ab48a76f0 Gloas PayloadAttestation gossip verification (#9145)
Co-Authored-By: hopinheimer <knmanas6@gmail.com>

Co-Authored-By: hopinheimer <48147533+hopinheimer@users.noreply.github.com>

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

Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
2026-04-27 09:51:20 +00:00
Eitan Seri-Levi
269e474f49 Resolve merge conflicts 2026-04-25 17:14:57 +09:00
Daniel Knopik
8a384ff445 Cell Dissemination (Partial messages) (#8314)
- https://github.com/ethereum/consensus-specs/pull/4558
- https://eips.ethereum.org/EIPS/eip-8136


  


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

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

Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
2026-04-23 18:52:28 +00:00
Eitan Seri-Levi
ca59cf453e Merge conflicts' 2026-04-23 02:34:34 +09:00
Eitan Seri-Levi
755b8d8510 resolve merge conlfict 2026-04-23 02:15:26 +09:00
Michael Sproul
cf3d5e285e Gloas spec v1.7.0-alpha.5 and beacon_chain tests (#8998)
Fix database pruning post-Gloas


  - Fix DB pruning logic (and state summaries DAG)
- Get the `beacon_chain` tests running with `FORK_NAME=gloas` 🎉


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

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

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

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

Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
2026-04-21 06:29:15 +00:00
Pawan Dhananjay
4cb3ffed8d Rust 1.95 lints (#9142)
N/A


  Adds lints for rust 1.95. Mostly cosmetic.
1. .zip(a.into_iter()) -> .zip(a) . Also a few more places where into_iter is not required
2. replace sort_by with sort_by_key
3. move if statements inside match block.
4. use checked_div instead of if statements. I think this is debatable in terms of being better, happy to remove it if others also feel its unnecessary


Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com>
2026-04-16 23:50:20 +00:00
YoungWoo Yang
d3c13c4cf0 Gloas: envelope peer penalties and REJECT/IGNORE mapping (#8981)
Closes #8949


  Implements peer penalties and REJECT/IGNORE message propagation for `SignedExecutionPayloadEnvelope` gossip handling, completing follow-up work from #8806.

Feedback on the error classification would be appreciated.

### Key Implementation Details

- Maps all 15 `EnvelopeError` variants to REJECT/IGNORE based on [Gloas p2p spec](https://github.com/ethereum/consensus-specs/blob/master/specs/gloas/p2p-interface.md#execution_payload)
- Follows `ExecutionPayloadError` handling pattern from block gossip (`penalize_peer()` method)
- Uses explicit variant matching (rather than catch-all `_`) for type safety
- Applies `LowToleranceError` penalty for protocol violations (invalid signatures, mismatches, etc.)
- Ignores without penalty for spec-defined cases (unknown block root, prior to finalization) and internal errors


Co-Authored-By: 0u-Y <yyw1000@naver.com>

Co-Authored-By: Eitan Seri-Levi <eserilev@gmail.com>
2026-04-14 16:41:56 +00:00
Eitan Seri-Levi
b40a178111 Gloas bid and preference verification (#9036)
Gossip verify and cache bids and proposer preferences. This PR also ensures we subscribe to new fork topics one epoch early instead of two slots early. This is required for proposer preferences.


  


Co-Authored-By: Eitan Seri- Levi <eserilev@gmail.com>
2026-04-14 16:39:59 +00:00
Mac L
7c2dcfc0d6 Refactor timestamp_now (#9094)
#9077


  Where possible replaces all instances of `validator_monitor::timestamp_now` with `chain.slot_clock.now_duration().unwrap_or_default()`.
Where chain/slot_clock is not available, instead replace it with a convenience function `slot_clock::timestamp_now`.
Remove the `validator_monitor::timestamp_now` function.


Co-Authored-By: Mac L <mjladson@pm.me>
2026-04-09 08:41:02 +00:00
Eitan Seri- Levi
2ed5e0f6fb merge conflicts 2026-04-03 09:26:40 -07:00
Eitan Seri- Levi
b333841229 update 2026-04-03 01:04:34 -07:00
Eitan Seri- Levi
f897215684 refactor awaiting_parent field and some metrics 2026-04-03 01:02:57 -07:00
Eitan Seri- Levi
214e3ce9f0 Cleanup 2026-04-03 00:02:24 -07:00
Eitan Seri- Levi
1cd4d57204 Fixes 2026-04-02 19:37:51 -07:00
Eitan Seri- Levi
3523804515 cleanup 2026-04-02 19:30:12 -07:00
Eitan Seri- Levi
86ddd0d88d Add EnvelopeRequestState logic 2026-04-02 19:09:56 -07:00
Eitan Seri- Levi
1eefef610e Resolve merge conflicts 2026-03-31 11:04:23 -07:00
Lion - dapplion
bc5d8c9f90 Add range sync tests (#8989)
Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
2026-03-31 05:07:22 +00:00
Eitan Seri- Levi
09e9a54314 When a block comes in whose parent is unkown, queue the block for processing and lookup the parent envelope 2026-03-26 23:40:35 -07: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
Eitan Seri- Levi
3e3e55250b Merge branch 'unstable' of https://github.com/sigp/lighthouse into gloas-data-availability-checker 2026-03-18 00:08:36 -07: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