Lockstep drift-free clock-synchronization model and time-shift indistinguishability #
This module defines a deterministic synchronous lockstep, drift-free (hardwareClock c p t = t + c p) full-information R-round clock-synchronization model (LockstepProtocol P K R) on the
complete network of processes P—an intermediate step towards
Lundelius and Lynch, rather than that paper's general asynchronous
event-driven message-passing model (tracked in
#7202).
Each process p : P has a unit-rate, drift-free hardware clock whose reading at real time t : K
is hardwareClock c p t = t + c p, where c : P → K is an unknown initial offset vector.
Processes have no direct access to real time t: in each lockstep round r < R, process p
schedules outgoing messages to every q : P at chosen local hardware clock readings τ and
records its own local hardware clock reading upon receiving each incoming round-r message. When
p sends a message at local reading τ and the message experiences transit delay δ r p q, it
arrives at q at local reading arrivalReading c δ r p q τ = τ + δ r p q + c q - c p.
Within fixed-R-round lockstep all-to-all broadcast, passing full local observation histories
(LocalView P K r) represents arbitrary deterministic local states and message payloads;
asynchronous event-driven protocols where message sends are triggered dynamically outside fixed
lockstep rounds remain open in #7202.
The key structural property proved in this lockstep drift-free model is time-shift
indistinguishability (localView_shift_eq, adj_shift_eq): shifting hardware offsets to
shiftOffsets c s p = c p + s p and transit delays to shiftDelays δ s r p q = δ r p q + s p - s q
leaves every arrival reading and hence every process's LocalView and computed adjustment adj
identically unchanged, while shifting each synchronized clock offset syncOffset by + s p
(syncOffset_shift_eq).
This file also provides the midpoint-delay offset estimator estDiff and its error bound
abs_add_estDiff_sub_le, shared by the lockstep fault-free averaging step in
CslibFrontier.Computability.Distributed.ClockSync.LundeliusLynch and the lockstep drift-free
Byzantine trimmed-midpoint step in
CslibFrontier.Computability.Distributed.ClockSync.ByzantineSync.
Main definitions #
Cslib.Distributed.ClockSync.hardwareClock: drift-free hardware clock readingt + c p.Cslib.Distributed.ClockSync.arrivalReading: local clock reading atqwhen a message sent bypat local readingτarrives after transit delayδ r p q.Cslib.Distributed.ClockSync.ValidDelays: transit delays lie in[d_min, d_max].Cslib.Distributed.ClockSync.LocalView: full local observation history afterrlockstep rounds.Cslib.Distributed.ClockSync.LockstepProtocol: deterministicR-round lockstep drift-free clock synchronization protocols.Cslib.Distributed.ClockSync.LockstepProtocol.localView,LockstepProtocol.adj,LockstepProtocol.syncOffset: protocol execution, local clock adjustment, and synchronized clock offsetc p + adj p.Cslib.Distributed.ClockSync.AchievesLockstepSkew: worst-case synchronized skew at mostγacross all hardware offsetscand valid delays in[d_min, d_max]in the lockstep drift-free model.Cslib.Distributed.ClockSync.shiftOffsets,shiftDelays: real-time shift transformation on hardware offsets and message transit delays.Cslib.Distributed.ClockSync.estDiff: midpoint-delay estimator ofc q - c pfrom arrival timestamps of local-time-0broadcasts.
Main results #
Cslib.Distributed.ClockSync.localView_shift_eq: lockstepR-round time-shift indistinguishability of local views across allr ≤ Rrounds.Cslib.Distributed.ClockSync.adj_shift_eq: lockstepR-round time-shift invariance of protocol adjustments.Cslib.Distributed.ClockSync.abs_add_estDiff_sub_le: midpoint-delay estimation approximates each sender's hardware offset within(d_max - d_min) / 2on drift-free clocks.
References #
The local reading t + c p of process p's unit-rate, drift-free hardware clock at real time
t under initial hardware clock offsets c : P → K.
The local hardware clock reading observed at recipient q on a drift-free clock when a
round-r message sent by p at p's local clock reading τ arrives after real-time transit
delay δ r p q.
If p sends a message at real time t when its drift-free hardware clock reads τ, and the
message has transit delay δ r p q, then q's hardware clock at arrival time t + δ r p q reads
arrivalReading c δ r p q τ.
The full local observation history of a process after r lockstep message-passing rounds.
Before communication begins (init), a process has observed no arrival timestamps. After lockstep
round r + 1 (step prev arrival relayed), a process retains its prior view prev, records for
each sender q : P its own local clock reading arrival q upon receiving q's round-r message,
and receives q's relayed prior view relayed q.
LocalView.lastArrival returns the arrival vector of the most recent round.
Decidable equality on LocalView P K r over finite process sets P.
A deterministic R-round lockstep full-information clock-synchronization protocol on the
complete network of processes P with drift-free clock values in K (a synchronous lockstep step
towards Lundelius and Lynch; asynchronous event-driven protocols are tracked
in #7202).
In each lockstep round r : Fin R, process p with local history v : LocalView P K r sends its
round-r message to q when p's local hardware clock reads sendTime r p v q. After R
rounds, process p with final history v : LocalView P K R shifts its hardware clock by
adjust p v.
Local hardware clock reading at which
psends its round-rmessage toq.- adjust : P → LocalView P K R → K
Local clock adjustment computed by
pafterRlockstep rounds.
Process p's local observation history after r ≤ R lockstep rounds under drift-free hardware
clock offsets c and message transit delays δ.
The local clock adjustment vector computed by π after all R lockstep rounds.
Process p's synchronized clock offset c p + π.adj c δ p after π finishes: at real time
t, p's adjusted drift-free clock reads t + π.syncOffset c δ p.
Lockstep protocol π achieves worst-case synchronized clock skew at most γ across all
initial drift-free hardware clock offsets c and all message transit delays δ in
[d_min, d_max] (a synchronous lockstep step after Lundelius and Lynch;
asynchronous event-driven clock synchronization is tracked in #7202).
Achieving lockstep clock skew γ implies achieving any larger skew bound γ' ≥ γ.
Time-shift indistinguishability #
Shift each process p's hardware clock offset by s p, corresponding to advancing events at
p by s p units of real time while keeping p's local clock readings unchanged.
Shift transit delays consistently with shiftOffsets c s: when p's events occur s p
earlier and q's events occur s q earlier, a message from p to q is in transit for
δ r p q + s p - s q.
Shifting drift-free hardware offsets by s and transit delays by s p - s q preserves every
local arrival clock reading identically.
A synchronous lockstep, drift-free R-round step towards the execution-shift
indistinguishability lemma of Lundelius and Lynch, and not the cited
asynchronous event-driven result (#7202): shifting hardware offsets to shiftOffsets c s and
transit delays to shiftDelays δ s leaves every process's LocalView unchanged at every round
r ≤ R.
A synchronous lockstep, drift-free R-round step towards
Lundelius and Lynch, and not the cited asynchronous event-driven result
(#7202): every deterministic R-round LockstepProtocol computes the exact same clock
adjustment vector under (shiftOffsets c s, shiftDelays δ s) as under (c, δ).
Under a real-time shift s, process p's synchronized offset in LockstepProtocol translates
by + s p.
Midpoint-delay estimator of c q - c p: given p's local arrival readings recv : P → K for
messages broadcast at local reading 0, estimates 0 for q = p and
(d_min + d_max) / 2 - recv q for q ≠ p.
On drift-free clocks, adding p's hardware offset c p to estDiff d_min d_max p recv q
approximates sender q's hardware offset c q within (d_max - d_min) / 2 whenever q ≠ p
arrived with delay d ∈ [d_min, d_max].