Documentation

CslibFrontier.Computability.Distributed.ClockSync.ByzantineSync

Lockstep drift-free Byzantine trimmed-midpoint resynchronization step #

This module proves a separated lockstep-round, drift-free (hardwareClock c p t = t + c p, zero clock drift) step after Welch and Lynch, and is not the cited paper's asynchronous local-timer-triggered periodic resynchronization result under nonzero bounded hardware clock drift (which remains open in #7202).

When up to t processes with 3 * t < Fintype.card P suffer Byzantine clock faults—reporting arbitrary, recipient-dependent timestamps to different honest processes—averaging all offset estimates (lockstepClockAvg) can be skewed arbitrarily by a single faulty clock. Reusing the kernel-reducible trimmed-extremes midpoint operator Cslib.Distributed.ApproxAgreement.multisetMidTrim from CslibFrontier.Computability.Distributed.ApproxAgreement.TrimmedMidpoint, each process forms its n = Fintype.card P midpoint-delay offset estimates (estDiff), discards the t smallest and t largest values, and adjusts its clock by the midpoint of the surviving extremes (lockstepByzantineClockStep).

By clamping honest offset estimates within ± (d_max - d_min) / 2 onto the common honest offset vector c and applying translation equivariance and pointwise monotonicity of multisetMidTrim, this module reduces lockstep drift-free Byzantine clock resynchronization directly to ApproxAgreement.multisetMidTrim_map_mem_Icc and ApproxAgreement.abs_multisetMidTrim_map_sub_le:

Main definitions #

Main results #

References #

Translation equivariance and pointwise monotonicity of multisetMidTrim #

1-round and R-round lockstep drift-free Byzantine clock resynchronization #

def Cslib.Distributed.ClockSync.lockstepByzantineClockStep {P : Type u} [Fintype P] [DecidableEq P] {K : Type v} [Field K] [LinearOrder K] (t : ℕ) (d_min d_max : K) (p : P) (recv : P → K) :
K

1-round lockstep Byzantine-resilient trimmed-midpoint clock adjustment step (a separated lockstep-round, drift-free step after Welch and Lynch, #7202): process p forms estDiff d_min d_max p recv j from its observed arrival readings recv : P → K across all senders j : P, discards the t smallest and t largest estimates via ApproxAgreement.multisetMidTrim, and outputs the midpoint of the surviving range.

def Cslib.Distributed.ClockSync.lockstepByzantineArrival {P : Type u} [DecidableEq P] {K : Type v} [AddCommGroup K] (F : Finset P) (adv : P → P → K) (c : P → K) (δ : P → P → K) (j p : P) :
K

Arrival reading observed at p from sender j in a 1-round lockstep synchronization broadcast on drift-free clocks with faulty processes F and equivocating adversary adv: a faulty clock j ∈ F induces an arbitrary recipient-dependent timestamp adv j p, whereas an honest clock j ∉ F sends at local reading 0 and arrives at arrivalReading c (fun _ => δ) 0 j p 0.

def Cslib.Distributed.ClockSync.lockstepDriftFreeByzantineOffset {P : Type u} [Fintype P] [DecidableEq P] {K : Type v} [Field K] [LinearOrder K] (t : ℕ) (d_min d_max : K) (F : Finset P) (adv : P → P → K) (c : P → K) (δ : P → P → K) (p : P) :
K

Process p's updated synchronized clock offset after one separated lockstep round of lockstepByzantineClockStep on drift-free clocks under faulty set F, equivocating adversary adv, initial offsets c, and transit delays δ (#7202).

def Cslib.Distributed.ClockSync.lockstepDriftFreeByzantineOffsetIter {P : Type u} [Fintype P] [DecidableEq P] {K : Type v} [Field K] [LinearOrder K] (t : ℕ) (d_min d_max : K) (F : Finset P) (adv : ℕ → P → P → K) (c : P → K) (δ : ℕ → P → P → K) :
ℕ → P → K

Updated clock offsets after R separated lockstep drift-free resynchronization rounds against round-indexed equivocating adversaries adv : ℕ → P → P → K and round transit delays δ : ℕ → P → P → K (#7202).

theorem Cslib.Distributed.ClockSync.lockstepDriftFreeByzantineOffset_mem_Icc {P : Type u} [Fintype P] [DecidableEq P] {K : Type v} [Field K] [LinearOrder K] [IsStrictOrderedRing K] {t : ℕ} (ht : 2 * t < Fintype.card P) {F : Finset P} (hF : F.card ≤ t) {d_min d_max lo hi : K} (adv : P → P → K) (c : P → K) (δ : P → P → K) (hc : ∀ j ∉ F, lo ≤ c j ∧ c j ≤ hi) (hδ : ∀ j ∉ F, ∀ p ∉ F, d_min ≤ δ j p ∧ δ j p ≤ d_max) {p : P} (hp : p ∉ F) :
lo - (d_max - d_min) / 2 ≤ lockstepDriftFreeByzantineOffset t d_min d_max F adv c δ p ∧ lockstepDriftFreeByzantineOffset t d_min d_max F adv c δ p ≤ hi + (d_max - d_min) / 2

A separated lockstep-round, drift-free step after Welch and Lynch, and not the cited asynchronous nonzero-drift resynchronization theorem (#7202): when 2 * t < Fintype.card P, F.card ≤ t, every honest process's initial offset lies in [lo, hi], and honest-to-honest transit delays lie in [d_min, d_max], every honest process's updated offset lies in [lo - (d_max - d_min) / 2, hi + (d_max - d_min) / 2].

theorem Cslib.Distributed.ClockSync.lockstepDriftFreeByzantineOffset_abs_sub_le {P : Type u} [Fintype P] [DecidableEq P] {K : Type v} [Field K] [LinearOrder K] [IsStrictOrderedRing K] {t : ℕ} (ht : 3 * t < Fintype.card P) {F : Finset P} (hF : F.card ≤ t) {d_min d_max δ₀ : K} (adv : P → P → K) (c : P → K) (δ : P → P → K) (hc : ∀ p ∉ F, ∀ q ∉ F, |c p - c q| ≤ δ₀) (hδ : ∀ j ∉ F, ∀ p ∉ F, d_min ≤ δ j p ∧ δ j p ≤ d_max) {p q : P} (hp : p ∉ F) (hq : q ∉ F) :
|lockstepDriftFreeByzantineOffset t d_min d_max F adv c δ p - lockstepDriftFreeByzantineOffset t d_min d_max F adv c δ q| ≤ δ₀ / 2 + (d_max - d_min)

A separated lockstep-round, drift-free step after Welch and Lynch, and not the cited asynchronous nonzero-drift resynchronization theorem (#7202): when 3 * t < Fintype.card P, F.card ≤ t, initial honest offsets have skew at most δ₀, and honest message delays lie in [d_min, d_max], one lockstep round of lockstepByzantineClockStep on drift-free clocks contracts the skew between any two honest processes p, q ∉ F to at most δ₀ / 2 + (d_max - d_min).

theorem Cslib.Distributed.ClockSync.lockstepDriftFreeByzantineOffsetIter_abs_sub_le {P : Type u} [Fintype P] [DecidableEq P] {K : Type v} [Field K] [LinearOrder K] [IsStrictOrderedRing K] {t : ℕ} (ht : 3 * t < Fintype.card P) {F : Finset P} (hF : F.card ≤ t) {d_min d_max δ₀ : K} (adv : ℕ → P → P → K) (c : P → K) (δ : ℕ → P → P → K) (hc : ∀ p ∉ F, ∀ q ∉ F, |c p - c q| ≤ δ₀) (hδ : ∀ (r : ℕ), ∀ j ∉ F, ∀ p ∉ F, d_min ≤ δ r j p ∧ δ r j p ≤ d_max) (R : ℕ) {p q : P} :
p ∉ F → q ∉ F → |lockstepDriftFreeByzantineOffsetIter t d_min d_max F adv c δ R p - lockstepDriftFreeByzantineOffsetIter t d_min d_max F adv c δ R q| ≤ δ₀ / 2 ^ R + 2 * (1 - 1 / 2 ^ R) * (d_max - d_min)

A separated lockstep-round, drift-free R-round step after Welch and Lynch, and not the cited asynchronous nonzero-drift resynchronization theorem (#7202): iterating R separated lockstep rounds of lockstepByzantineClockStep on drift-free clocks with 3 * t < Fintype.card P and F.card ≤ t contracts initial honest skew δ₀ geometrically to δ₀ / 2 ^ R + 2 * (1 - 1 / 2 ^ R) * (d_max - d_min).