Currently, running `cargo check -p validator_manager` fails due to missing features. Although the `validator_manager` will almost always be called through the Lighthouse binary which will enable the required features, it is still good hygiene to ensure all workspace crates can compile standalone.
Add the `lighthouse` feature to the `eth2` dependency in `validator_manager`
Co-Authored-By: Mac L <mjladson@pm.me>
#6689
Inspired by the initial implementation of #9108, credit to @chong-he.
This adds an extension trait to `Hash256` and add a `short` method to provide smaller formatted hashes for logging.
Co-Authored-By: Mac L <mjladson@pm.me>
PR #8415 added Gloas-only payload-timeliness-committee assertions to
test_get_validator_duties_early but kept the test using
ApiTester::new() (default mainnet spec). With FORK_NAME=gloas this
produces a phase0 chain, so post_validator_duties_ptc returns 500
with BeaconStateError(IncorrectStateVariant).
Two issues fixed:
1. Switch the test wrapper to ApiTester::new_with_hard_forks() so the
chain is actually at Gloas under FORK_NAME=gloas. This is the same
pattern already used by get_validator_duties_ptc and
get_validator_payload_attestation_data.
2. Compute dependent_root using
ChainSpec::proposer_shuffling_decision_slot rather than the
hardcoded "(current_epoch - 1).end_slot()" formula. Post-Fulu the
proposer shuffling decision slot moved to the end of epoch N - 2,
so the cache is now keyed by that root. The old formula matched
the legacy cache key and silently passed on phase0 chains.
Verified locally with FORK_NAME=gloas (195/195) and FORK_NAME=fulu
(195/195).
Two tests fail under FORK_NAME=gloas; only the first surfaces in CI
because nextest aborts on the first failure.
1. status_tests::node_health_el_online_and_not_synced
The test simulates "EL online but not synced" via
mock_el.server.all_payloads_syncing(true), expecting the head to
become optimistic so the endpoint returns 206. In Gloas, blocks
don't carry execution payloads — the payload arrives via an
envelope, so newPayload is never called during block import and
the head is never marked optimistic. The endpoint correctly
returns 200. Skip the test for Gloas, matching the existing
pattern on el_error_on_new_payload.
2. tests::get_validator_payload_attestation_data
Two issues stacked:
- The test used ApiTester::new() (default phase0 spec) so the
chain wasn't actually at the Gloas fork even with
FORK_NAME=gloas. Switch to new_with_hard_forks(), which uses
test_spec() and respects FORK_NAME.
- produce_payload_attestation_data requires
head.slot == request_slot, but the harness leaves the slot
clock at head_slot + 1 with no block produced for that slot.
Rewind the slot clock to the head slot in the test helper.
Full Gloas http-api suite: 193 tests run: 193 passed.
For gloas `attestation.data.index` should be set to 1 if we are attesting to a block whose slot is not the attestation duty slot and slot payload_status is `FULL`
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>
We had a bug when performing batch builder exit signature verification. The EF spec tests cover this case, but the EF tests only calls individual signature verification (which is a separate code path). This PR unifies the two code paths. We should probably spend some time reviewing EF test code coverage and make sure we don't have separate code paths that do similar things.
Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
N/A
Do not make the AI agent always fmt and lint. This takes way too long and the agents I work with take this too literally sometimes and run lint after incomplete changes just wasting time.
I feel its not a big ask to run fmt and lint yourself and/or run it in some local configs instead of global ones.
Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com>
When producing a block at the fork, treat parent payload status as full
I've been testing on kurtosis and this fixes an issue where we cant propose a block at the fork.
This is a screenshot of the fix. The envelope shows missing because we are missing an SSE event, but the envelope is in fact being imported and the chain is progressing just fine
<img width="652" height="748" alt="image" src="https://github.com/user-attachments/assets/7764a68c-33fb-4987-a691-0af71f0bea02" />
Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
Just a little naming cleanup (no semantic changes) to remove mentions of pending and full states that were still lurking.
This hopefully helps Claude forget about the concept (it defaults to naming variables `pending_state`s without this change).
Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
This reverts commit 2749e18d0e, from:
- #9092
We no longer need those changes since the abolition of pending/full states.
Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
Fix a vulnerability in the slasher whereby it would OOM upon processing an invalid attestation with an artificially high `validator_index`. This fix has already been made available to affected users on the `slasher-fix` branch.
- Prevent attestations from being passed to the slasher prior to signature verification. This was unnecessary, as they would later be passed on successful validation as well.
- Add a defensive cap on the maximum validator index processable by the slasher. The cap is high enough that it shouldn't be reached for several years, and will quickly result in warning logs if forgotten.
- Add a regression test that confirms that the issue is fixed.
Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
Fix a **consensus fault** in `PreEpochCache` 🙀
Fortunately it's only reachable on a network with `total_active_balance=0`, i.e. a network that's already completely dead. As such this PR is not time-sensitive in any way.
Add the floor on `total_effective_balance` when converting from `PreEpochCache` to `EpochCache`. An alternative would be to add the floor inside `PreEpochCache::get_total_active_balance`, however that would be redundant, as the only place this function is called outside this file is in single-pass epoch processing:
176cce585c/consensus/state_processing/src/per_epoch_processing/single_pass.rs (L461-L462)
The `set_total_active_balance` call already handles the floor.
A regression test is included.
Co-Authored-By: Michael Sproul <michael@sigmaprime.io>
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>
The tracing exporter uses a `PrefixBasedSampler` that only samples root spans whose name starts with `lh_`. Rename the VC root spans to include the prefix so their traces are exported.
Thanks @lmnzx for pointing this out!
Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com>
New audit failure from `RUSTSEC-2026-0098`
Bump `rustls-webpki` to an unaffected version, add an ignore for the old version used by `warp` 0.3
Co-Authored-By: Mac L <mjladson@pm.me>
Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com>
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>
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>
- #6689
The intention is to only modify the INFO logs that's emitted regularly to reduce the verbosity. But I understand that this change will affect other display in the logs too that uses the `ExecutionBlockHash` display. So would love some feedbacks about the change.
Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io>
Co-Authored-By: Mac L <mjladson@pm.me>
#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>
Addresses #5403
- Added `check_fee_recipient()` method to validate individual validators
- Added `check_all_fee_recipients()` to validate all validators on startup
- Validator client now fails to start if any enabled validator lacks a fee recipient and no global flag is used.
- Added Clear error messages to guide users on how to fix the issue
- Added unit tests
Co-Authored-By: AbolareRoheemah <roheemahabo@gmail.com>
#8926
Add a step to CI which runs `cargo check` across all combinations of features for certain crates using `cargo-hack`
Co-Authored-By: Mac L <mjladson@pm.me>