ouroboros-consensus-0.21.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellSafe-Inferred
LanguageHaskell2010

Ouroboros.Consensus.MiniProtocol.ChainSync.Client.InFutureCheck

Synopsis

Interface

data HeaderInFutureCheck m blk arrival judgment Source #

The interface a ChainSync client needs in order to check the arrival time of headers.

Instead of alphabetical, the fields are in the order in which the ChainSync client logic will invoke them for each header.

Constructors

HeaderInFutureCheck 

Fields

data SomeHeaderInFutureCheck m blk Source #

Constructors

∀ arrival judgment. SomeHeaderInFutureCheck (HeaderInFutureCheck m blk arrival judgment) 

Real Implementation

Clock skew

clockSkewInSecondsDoubleClockSkew Source #

Specify maximum clock skew in seconds

defaultClockSkewClockSkew Source #

Default maximum permissible clock skew

See ClockSkew for details. We allow for 5 seconds skew by default.

not exporting the constructor

data ClockSkew Source #

Maximum permissible clock skew

When running NTP, systems clocks will never be perfectly synchronized. The maximum clock skew records how much of a difference we consider acceptable.

For example. Suppose

  • Two nodes A and B
  • A's clock is 0.5 ahead of B's
  • A produces a block and sends it to B
  • When B translates the SlotNo of that block to a time, it may find that it is 0.5 seconds ahead of its current clock (worst case).

The maximum permissible clock skew decides if B will consider this block to be valid (even if it will not yet consider it for chain seleciton) or as invalid (and disconnect from A, since A is sending it invalid blocks).

Use defaultClockSkew when unsure.