Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
02c139b
feat(validator): check each beacon node's sync status before every sl…
MegaRedHand Nov 24, 2026
a65fcaf
fix(validator): keep a slot open for a synced node still answering it…
MegaRedHand Nov 25, 2026
3c95556
fix(validator): ask the ungated calls only of a node whose probe answ…
MegaRedHand Nov 25, 2026
cded590
feat(validator): rank beacon nodes by health and broadcast signed mes…
MegaRedHand Nov 25, 2026
c418811
fix(validator): rank a syncing node last inside its tier, send a blob…
MegaRedHand Nov 25, 2026
f92a870
fix(validator): stop a broadcast waiting on a hung node, keep the bar…
MegaRedHand Nov 25, 2026
dd613c2
feat(validator): make /health report whether the client can do its du…
MegaRedHand Nov 25, 2026
8d4e5bf
fix(validator): report unhealthy once the last duty schedule has run out
MegaRedHand Nov 25, 2026
0256e84
fix(validator): judge the health schedule check by the epochs actuall…
MegaRedHand Nov 25, 2026
0e4626e
fix(validator): keep a client with no resolved validator schedule-cur…
MegaRedHand Nov 25, 2026
3cc79bb
Merge remote-tracking branch 'origin/main' into feat/validator-per-sl…
MegaRedHand Nov 25, 2026
4a3b4b7
Merge branch 'feat/validator-per-slot-sync-check' into feat/validator…
MegaRedHand Nov 25, 2026
e28158a
Merge branch 'feat/validator-node-ranking' into feat/validator-health…
MegaRedHand Nov 25, 2026
7dd7430
test(validator): load a key in the sync-gate issue-case tests
pablodeymo Nov 25, 2026
db433ad
Merge remote-tracking branch 'origin/main' into feat/validator-per-sl…
pablodeymo Nov 25, 2026
37dd4b4
Merge remote-tracking branch 'origin/feat/validator-per-slot-sync-che…
pablodeymo Nov 25, 2026
69077e0
Merge branch 'feat/validator-node-ranking' into feat/validator-health…
pablodeymo Nov 25, 2026
f008f6b
Merge remote-tracking branch 'origin/main' into feat/validator-node-r…
pablodeymo Nov 25, 2026
e438896
Merge branch 'feat/validator-node-ranking' into feat/validator-health…
MegaRedHand Nov 25, 2026
fd499a0
fix(validator): don't rank a slow node failing after a broadcast cuts…
pablodeymo Nov 26, 2026
4993d76
Merge remote-tracking branch 'origin/main' into feat/validator-node-r…
pablodeymo Nov 26, 2026
6e5c922
Merge remote-tracking branch 'origin/main' into feat/validator-node-r…
pablodeymo Nov 26, 2026
42dcaa3
Merge branch 'feat/validator-node-ranking' into feat/validator-health…
MegaRedHand Nov 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -959,11 +959,16 @@ transitions are in `ethlambda-types`, per the section above. Nothing above
in `NodeHealth`, shared by the fallback): a slot in which every node that
answered is syncing or optimistic signs nothing and skips the epoch refresh,
only the fee recipient re-send going on (a node that did not answer does not
count, so the duty endpoints' 503 stays the backstop); requests try the
nodes that passed first, then the rest, each
in `--beacon-nodes` order; and the head root and PTC data are never asked of
a node whose last probe said syncing or optimistic, or got no answer. No rule reads the head's
age off the client's clock.
count, so the duty endpoints' 503 stays the backstop); requests walk the
nodes by `health::Tier` (synced; optimistic or `el_offline`; syncing or
`sync_distance` > 8; unprobed; failing), `--beacon-nodes` order breaking
ties, and a request that timed out or could not connect ranks its node
failing until a probe sent after it answers; and the head root and PTC data are
never asked of a node whose last probe said syncing or optimistic, or got
no answer. No rule that stops a duty reads the head's age. `--broadcast`
(`fallback::Broadcast`) sends attestations, blocks (envelopes producer
first) or sync committee messages to every node, failing-ranked nodes only
if none accepted.
It keeps EIP-3076 minimal-watermark slashing protection in
`--validators-dir/slashing_protection.json` (`crate::slashing_protection`),
durable before every block (blinded ones included) and attestation signature;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ beacon node.

| Flag | Meaning |
|---|---|
| `--beacon-nodes` | Base URLs of the beacon nodes to use, comma-separated or repeated. Each is asked whether it is syncing once a slot; the ones that said synced are tried first, then the rest, each in the order given, so the order is a preference. A slot in which every node that answered is syncing or on an optimistic head signs nothing |
| `--beacon-nodes` | Base URLs of the beacon nodes to use, comma-separated or repeated. Each is asked whether it is syncing once a slot and ranked by the answer (synced, then optimistic or with its execution client offline, then syncing or more than 8 slots behind, then failing), the order given breaking ties, so the order is a preference. A slot in which every node that answered is syncing or on an optimistic head signs nothing. `--broadcast` sends chosen signed messages to every node |
| `--validators-dir` | Directory of EIP-2335 keystores and `validator_definitions.yml`. Without that file, keystores in the Lighthouse layout (`<0xpubkey>/voting-keystore.json`) are discovered and the file is written |
| `--secrets-dir` | One password file per keystore, named after the validator's public key |
| `--suggested-fee-recipient` | Execution address for block rewards, `0x`-prefixed. Optional, but without it the beacon node picks an address that is not yours |
Expand Down
53 changes: 49 additions & 4 deletions bin/ethlambda/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use std::path::PathBuf;

use ethlambda_types::beacon::primitives::{Bytes32, ExecutionAddress, H160};
use ethlambda_validator::beacon_node::fallback::BroadcastTopic;
use ethlambda_validator::proposer_settings::{
DEFAULT_GAS_LIMIT, GRAFFITI_BYTES, graffiti_from_text,
};
Expand All @@ -24,13 +25,24 @@ pub(crate) struct ValidatorOptions {
/// Base URL(s) of the beacon node's HTTP API (e.g. http://localhost:5052).
///
/// Several may be supplied, comma-separated or by repeating the flag. Each
/// is asked whether it is syncing once a slot; the ones that are not are
/// tried first, then the rest, each in the order given, and the first that
/// answers is used, so the order is a preference, not a load-balancing
/// policy.
/// is asked whether it is syncing once a slot and ranked by the answer
/// (synced, then optimistic or with its execution client offline, then
/// syncing or more than 8 slots behind, then failing), the order given
/// breaking ties, and the first that answers is used, so the order is a
/// preference, not a load-balancing policy.
#[arg(long, value_delimiter = ',', required = true)]
pub(crate) beacon_nodes: Vec<String>,

/// Signed messages to send to every beacon node at once rather than to
/// the first that accepts them, comma-separated: `attestations`
/// (attestations, aggregates, payload attestations), `blocks` (blocks
/// and envelopes; never a blinded block), `sync-committee` (messages and
/// contributions), `subscriptions` (always sent to every node, accepted
/// for Lighthouse compatibility), `none` (also accepted for Lighthouse
/// compatibility, changing nothing). None by default.
#[arg(long, value_delimiter = ',')]
pub(crate) broadcast: Vec<BroadcastTopic>,

/// Directory holding the EIP-2335 keystores and `validator_definitions.yml`.
/// Without that file, keystores in the Lighthouse layout
/// (`<0xpubkey>/voting-keystore.json`, password in
Expand Down Expand Up @@ -348,6 +360,7 @@ async fn run_client(options: ValidatorOptions) -> eyre::Result<()> {
builder_min_bid: options.builder_min_bid,
init_slashing_protection: options.init_slashing_protection,
doppelganger_protection: options.enable_doppelganger_protection,
broadcast: options.broadcast.into_iter().collect(),
event_stream: !options.disable_event_stream,
};
ethlambda_validator::run(config, || stop.start())
Expand Down Expand Up @@ -477,6 +490,7 @@ mod tests {
fn options(graffiti: &str) -> ValidatorOptions {
ValidatorOptions {
beacon_nodes: vec!["http://localhost:5052".to_string()],
broadcast: Vec::new(),
validators_dir: PathBuf::from("/tmp/validators"),
secrets_dir: PathBuf::from("/tmp/secrets"),
http_address: "127.0.0.1".parse().expect("valid address"),
Expand Down Expand Up @@ -607,6 +621,37 @@ mod tests {
assert!(options.enable_doppelganger_protection);
}

/// Nothing is broadcast unless asked for, as in Lighthouse; topics are
/// comma-separated or repeated, and an unknown one is refused at startup.
#[test]
fn broadcast_topics_are_off_unless_named() {
use ethlambda_validator::beacon_node::fallback::Broadcast;

let topics =
|options: ValidatorOptions| -> Broadcast { options.broadcast.into_iter().collect() };
assert_eq!(topics(parse(&[]).expect("parses")), Broadcast::default());
let options = parse(&[
"--broadcast",
"attestations,blocks",
"--broadcast",
"sync-committee",
])
.expect("parses");
assert_eq!(
topics(options),
Broadcast {
attestations: true,
blocks: true,
sync_committee: true,
}
);
let options = parse(&["--broadcast", "subscriptions"]).expect("parses");
assert_eq!(topics(options), Broadcast::default());
let options = parse(&["--broadcast", "none"]).expect("parses");
assert_eq!(topics(options), Broadcast::default());
parse(&["--broadcast", "everything"]).expect_err("not a topic");
}

#[test]
fn builder_proposals_default_to_a_factor_of_100() {
let options = parse(&["--builder-proposals"]).expect("parses");
Expand Down
2 changes: 1 addition & 1 deletion crates/validator/src/beacon_node/dto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! |---|---|---|
//! | `AttesterDuty` | pubkey, validator_index, committee_index, committee_length, committees_at_slot, validator_committee_index, slot | all seven, all used |
//! | Genesis | genesis_time, genesis_validators_root, genesis_fork_version | the first two; the fork version comes from `/config/spec` |
//! | Syncing | head_slot, sync_distance, is_syncing, is_optimistic, el_offline | all five: is_syncing and is_optimistic gate signing; el_offline is logged; head_slot and sync_distance are recorded, and read leniently |
//! | Syncing | head_slot, sync_distance, is_syncing, is_optimistic, el_offline | all five: is_syncing and is_optimistic gate signing; el_offline and sync_distance rank the node, stopping nothing; head_slot is recorded; head_slot and sync_distance are read leniently |
//! | `ValidatorResponse` | index, balance, status, validator | index, status, validator.pubkey; the single-validator form also reads the activation, exit and withdrawable epochs |
//! | `ProposerDuty` | pubkey, validator_index, slot | all three, all used |
//! | `ProposerPreparation` | validator_index, fee_recipient | both, sent not read |
Expand Down
Loading
Loading