Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
ea45814
using events api for eager start attestation tasks
hopinheimer Aug 18, 2025
6f20083
merge `origin/unstable` into `hopinheimer/eager-send-attestation`
hopinheimer Aug 18, 2025
46fe220
minor nits
hopinheimer Aug 18, 2025
de7226f
clippy chill vibes
hopinheimer Aug 18, 2025
5f2a101
missed something
hopinheimer Aug 18, 2025
ae16705
linty
hopinheimer Aug 18, 2025
c13d0c3
implemented head monitoring service
hopinheimer Sep 19, 2025
8405f01
Merge branch 'unstable' of github.com:sigp/lighthouse into eager-send…
hopinheimer Sep 19, 2025
65e04fb
merge from feature branch
hopinheimer Sep 19, 2025
a1d36e6
fixing some linting issues
hopinheimer Sep 19, 2025
a489d32
comments and removing unwanted code
hopinheimer Sep 20, 2025
2b974db
clippy change
hopinheimer Sep 20, 2025
5600aef
Merge branch 'unstable' into eager-send-attestation
hopinheimer Oct 15, 2025
b65fc30
same data attestation bug solved
hopinheimer Oct 16, 2025
9024931
Merge branch 'unstable' into eager-send-attestation
hopinheimer Oct 20, 2025
b25703f
fixing dangling conditions and amaking head_monitor_service optional
hopinheimer Oct 20, 2025
e68548b
Merge branch 'eager-send-attestation' of github.com:hopinheimer/light…
hopinheimer Oct 20, 2025
c4d851c
fmt
hopinheimer Oct 20, 2025
daf5b2e
update comment
hopinheimer Oct 20, 2025
c49b8eb
Merge branch 'unstable' into eager-send-attestation
hopinheimer Oct 25, 2025
0e35ee5
massive refact
hopinheimer Oct 28, 2025
29867d2
fixes and linting
hopinheimer Oct 29, 2025
fd43876
remove unused code
hopinheimer Oct 31, 2025
b054a10
changes
hopinheimer Nov 1, 2025
eb057d0
Merge branch 'unstable' into eager-send-attestation
hopinheimer Nov 2, 2025
91e5980
Merge branch 'unstable' into eager-send-attestation
hopinheimer Nov 5, 2025
2e0c78c
Merge branch 'unstable' into eager-send-attestation
hopinheimer Nov 10, 2025
32eed9a
addressing comments
hopinheimer Nov 10, 2025
dac9f00
removing unwanted logs
hopinheimer Nov 11, 2025
bf1471c
fmt
hopinheimer Nov 11, 2025
9794737
Merge branch 'unstable' into eager-send-attestation
hopinheimer Nov 11, 2025
b20ded5
Merge branch 'unstable' into eager-send-attestation
hopinheimer Nov 12, 2025
39b9a58
fixing a unwanted service starting bug
hopinheimer Nov 14, 2025
2e6a8f9
Merge branch 'unstable' into eager-send-attestation
hopinheimer Nov 26, 2025
07d9a12
making the service feature flagged
hopinheimer Nov 26, 2025
a82960b
cleaned up some logic
hopinheimer Nov 26, 2025
6bddeeb
fix
hopinheimer Nov 26, 2025
409d937
updating docs
hopinheimer Nov 26, 2025
0d8160f
addressing comments
hopinheimer Nov 27, 2025
4ea159b
Resolve merge conflicts
eserilev Dec 1, 2025
70e6d18
testsss
hopinheimer Dec 1, 2025
84c8291
fmt
hopinheimer Dec 1, 2025
f174615
Merge branch 'eager-send-attestation' of github.com:hopinheimer/light…
hopinheimer Dec 1, 2025
468fe8a
Merge branch 'unstable' of https://github.com/sigp/lighthouse into ea…
eserilev Dec 1, 2025
bdf62d9
Merge branch 'eager-send-attestation' of https://github.com/hopinheim…
eserilev Dec 3, 2025
94af503
Resolve merge conflicts
eserilev Dec 3, 2025
8b45d57
addressing comments
hopinheimer Dec 17, 2025
ce91eca
Merge branch 'unstable' into eager-send-attestation
hopinheimer Dec 17, 2025
eabbdd4
resolving unstable changes
hopinheimer Dec 17, 2025
dfe2935
clippy
hopinheimer Dec 17, 2025
7b7ab09
update cli docs for default behaviour
hopinheimer Dec 17, 2025
435a93c
Merge branch 'unstable' into eager-send-attestation
eserilev Jan 14, 2026
00962ea
Merge remote-tracking branch 'origin/unstable' into eager-send-attest…
michaelsproul Jan 15, 2026
c2092eb
Small tweaks
michaelsproul Jan 15, 2026
b388efe
Flip flag polarity and make it work
michaelsproul Jan 15, 2026
4bfafc1
Update book
michaelsproul Jan 15, 2026
face04f
Add eth2 events feature
michaelsproul Jan 15, 2026
b30d710
addressing comments
hopinheimer Jan 15, 2026
28dbe33
linting
hopinheimer Jan 15, 2026
8cfa532
Merge branch 'unstable' of github.com:sigp/lighthouse into eager-send…
hopinheimer Jan 16, 2026
516ccd7
fixing unfavorable condition
hopinheimer Jan 19, 2026
3d4dfe0
Merge branch 'unstable' into eager-send-attestation
hopinheimer Jan 19, 2026
4b4d0d1
Merge branch 'unstable' into eager-send-attestation
hopinheimer Jan 21, 2026
c1b155e
Merge remote-tracking branch 'origin/unstable' into eager-send-attest…
michaelsproul Jan 27, 2026
6ee9c1d
Use Display for Slot
michaelsproul Jan 28, 2026
93e2407
Add more debug logs and ignore optimistic heads fully
michaelsproul Jan 28, 2026
f3b8b14
Use stream::select_all instead of join_all and other refactors
michaelsproul Jan 29, 2026
585f958
using configured client instead of `EventSource::default`
hopinheimer Jan 30, 2026
f92df34
Merge branch 'unstable' into eager-send-attestation
michaelsproul Feb 1, 2026
c6ac1a6
Lengthen SSE timeout beyond 12s
michaelsproul Feb 2, 2026
b3804f3
Better error message
michaelsproul Feb 2, 2026
a985826
Try `sseer`
michaelsproul Feb 2, 2026
4197d0f
Disable nginx cache/buffering
michaelsproul Feb 2, 2026
80c5d73
Revert "Try `sseer`"
michaelsproul Feb 2, 2026
3ee6f7a
More nginx headers (X-Accel-Expires)
michaelsproul Feb 2, 2026
7e0d151
merge with unstable
hopinheimer Feb 2, 2026
5b5f03f
Merge branch 'unstable' into eager-send-attestation
hopinheimer Feb 3, 2026
8547f21
addressing comments
hopinheimer Feb 3, 2026
b2cc703
Make events timeout configurable
michaelsproul Feb 3, 2026
1752ef5
checking block_root before starting attestation
hopinheimer Feb 3, 2026
b8a7afe
Merge branch 'eager-send-attestation' of github.com:hopinheimer/light…
hopinheimer Feb 3, 2026
10a6ec8
Restore duration to next slot logic
michaelsproul Feb 3, 2026
43fafe7
Minor formatting tweaks
michaelsproul Feb 3, 2026
0e9dab3
Fall back to all BNs at 4s if first head-event BN fails
michaelsproul Feb 3, 2026
4b53433
Merge of #7892
mergify[bot] Feb 4, 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
14 changes: 13 additions & 1 deletion beacon_node/http_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3226,7 +3226,19 @@ pub fn serve<T: BeaconChainTypes>(

let s = futures::stream::select_all(receivers);

Ok(warp::sse::reply(warp::sse::keep_alive().stream(s)))
let response = warp::sse::reply(warp::sse::keep_alive().stream(s));

// Set headers to bypass nginx caching and buffering, which breaks realtime
// delivery.
let response = warp::reply::with_header(response, "X-Accel-Buffering", "no");
let response = warp::reply::with_header(response, "X-Accel-Expires", "0");
let response = warp::reply::with_header(
response,
"Cache-Control",
"no-cache, no-store, must-revalidate",
);

Ok(response)
})
},
);
Expand Down
6 changes: 6 additions & 0 deletions book/src/help_vc.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ Flags:
If present, do not attempt to discover new validators in the
validators-dir. Validators will need to be manually added to the
validator_definitions.yml file.
--disable-beacon-head-monitor
Disable the beacon head monitor which tries to attest as soon as any
of the configured beacon nodes sends a head event. Leaving the service
enabled is recommended, but disabling it can lead to reduced bandwidth
and more predictable usage of the primary beacon node (rather than the
fastest BN).
--disable-latency-measurement-service
Disables the service that periodically attempts to measure latency to
BNs.
Expand Down
3 changes: 3 additions & 0 deletions common/eth2/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ pub enum Error {
#[cfg(feature = "events")]
/// The `reqwest_eventsource` client raised an error.
SseClient(Box<reqwest_eventsource::Error>),
#[cfg(feature = "events")]
SseEventSource(reqwest_eventsource::CannotCloneRequestError),
/// The server returned an error message where the body was able to be parsed.
ServerMessage(ErrorMessage),
/// The server returned an error message with an array of errors.
Expand Down Expand Up @@ -100,6 +102,7 @@ impl Error {
None
}
}
Error::SseEventSource(_) => None,
Error::ServerMessage(msg) => StatusCode::try_from(msg.code).ok(),
Error::ServerIndexedMessage(msg) => StatusCode::try_from(msg.code).ok(),
Error::StatusCode(status) => Some(*status),
Expand Down
14 changes: 12 additions & 2 deletions common/eth2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use reqwest::{
header::{HeaderMap, HeaderValue},
};
#[cfg(feature = "events")]
use reqwest_eventsource::{Event, EventSource};
use reqwest_eventsource::{Event, RequestBuilderExt};
use serde::{Serialize, de::DeserializeOwned};
use ssz::Encode;
use std::fmt;
Expand Down Expand Up @@ -76,6 +76,8 @@ const HTTP_GET_BEACON_BLOCK_SSZ_TIMEOUT_QUOTIENT: u32 = 4;
const HTTP_GET_DEBUG_BEACON_STATE_QUOTIENT: u32 = 4;
const HTTP_GET_DEPOSIT_SNAPSHOT_QUOTIENT: u32 = 4;
const HTTP_GET_VALIDATOR_BLOCK_TIMEOUT_QUOTIENT: u32 = 4;
// Generally the timeout for events should be longer than a slot.
const HTTP_GET_EVENTS_TIMEOUT_MULTIPLIER: u32 = 50;
const HTTP_DEFAULT_TIMEOUT_QUOTIENT: u32 = 4;

/// A struct to define a variety of different timeouts for different validator tasks to ensure
Expand All @@ -96,6 +98,7 @@ pub struct Timeouts {
pub get_debug_beacon_states: Duration,
pub get_deposit_snapshot: Duration,
pub get_validator_block: Duration,
pub events: Duration,
pub default: Duration,
}

Expand All @@ -116,6 +119,7 @@ impl Timeouts {
get_debug_beacon_states: timeout,
get_deposit_snapshot: timeout,
get_validator_block: timeout,
events: HTTP_GET_EVENTS_TIMEOUT_MULTIPLIER * timeout,
default: timeout,
}
}
Expand All @@ -138,6 +142,7 @@ impl Timeouts {
get_debug_beacon_states: base_timeout / HTTP_GET_DEBUG_BEACON_STATE_QUOTIENT,
get_deposit_snapshot: base_timeout / HTTP_GET_DEPOSIT_SNAPSHOT_QUOTIENT,
get_validator_block: base_timeout / HTTP_GET_VALIDATOR_BLOCK_TIMEOUT_QUOTIENT,
events: HTTP_GET_EVENTS_TIMEOUT_MULTIPLIER * base_timeout,
default: base_timeout / HTTP_DEFAULT_TIMEOUT_QUOTIENT,
}
}
Expand Down Expand Up @@ -2800,7 +2805,12 @@ impl BeaconNodeHttpClient {
.join(",");
path.query_pairs_mut().append_pair("topics", &topic_string);

let mut es = EventSource::get(path);
let mut es = self
.client
.get(path)
.timeout(self.timeouts.events)
.eventsource()
.map_err(Error::SseEventSource)?;
// If we don't await `Event::Open` here, then the consumer
// will not get any Message events until they start awaiting the stream.
// This is a way to register the stream with the sse server before
Expand Down
18 changes: 18 additions & 0 deletions lighthouse/tests/validator_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -758,3 +758,21 @@ fn validator_proposer_nodes() {
);
});
}

// Head monitor is enabled by default.
#[test]
fn head_monitor_default() {
CommandLineTest::new().run().with_config(|config| {
assert!(config.enable_beacon_head_monitor);
});
}

#[test]
fn head_monitor_disabled() {
CommandLineTest::new()
.flag("disable-beacon-head-monitor", None)
.run()
.with_config(|config| {
assert!(!config.enable_beacon_head_monitor);
});
}
2 changes: 1 addition & 1 deletion validator_client/beacon_node_fallback/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ path = "src/lib.rs"
[dependencies]
bls = { workspace = true }
clap = { workspace = true }
eth2 = { workspace = true }
eth2 = { workspace = true, features = ["events"] }
futures = { workspace = true }
itertools = { workspace = true }
sensitive_url = { workspace = true }
Expand Down
Loading