aboutsummaryrefslogtreecommitdiffstats
path: root/src/config/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-31 06:53:00 +0100
committertv <tv@krebsco.de>2026-10-31 06:53:00 +0100
commit1cb2ef3f00e695a414de87acfec090dfde749934 (patch)
treebfb67dd536741f6d1e1c09a79c114953dc5c3530 /src/config/mod.rs
parent88160e8aa273090c55103e7a92eeae9a8bdac9ed (diff)
add peer clock skew warning
Diffstat (limited to 'src/config/mod.rs')
-rw-r--r--src/config/mod.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs
index 37c3ce6..2dfefcf 100644
--- a/src/config/mod.rs
+++ b/src/config/mod.rs
@@ -250,6 +250,13 @@ pub(crate) const OPTIONS: &[OptionSpec] = &[
"Members that renewed their alive stamp within this time vote on remakes (a majority of them must agree). Matters on the node that coordinates a remake.",
),
option(
+ "clock-skew-warn",
+ Kind::Duration,
+ "DURATION",
+ Some("2s"),
+ "Warn in the log when this node's clock differs from most of its peers' by more than this, for sure (beyond half the round trip it was measured over, from their PONGs); 0: never.",
+ ),
+ option(
"blob-chunk",
Kind::Size,
"SIZE",
@@ -467,6 +474,11 @@ pub(crate) struct Settings {
with = "crate::units::duration_option"
)]
pub(crate) electorate_window: Duration,
+ #[serde(
+ default = "default_clock_skew_warn",
+ with = "crate::units::duration_option"
+ )]
+ pub(crate) clock_skew_warn: Duration,
/// In bytes.
#[serde(default = "default_blob_chunk", with = "crate::units::size_option")]
pub(crate) blob_chunk: u64,
@@ -539,6 +551,9 @@ fn default_neighbours() -> usize {
fn default_electorate_window() -> Duration {
Duration::from_secs(7 * 24 * 3600)
}
+fn default_clock_skew_warn() -> Duration {
+ Duration::from_secs(2)
+}
fn default_blob_chunk() -> u64 {
64 * 1024
}