May 26, 6-7 PM (7)
May 26, 7-8 PM (16)
May 26, 8-9 PM (5)
May 26, 9-10 PM (17)
May 26, 10-11 PM (9)
May 26, 11-12 AM (11)
May 27, 12-1 AM (5)
May 27, 1-2 AM (10)
May 27, 2-3 AM (2)
May 27, 3-4 AM (16)
May 27, 4-5 AM (11)
May 27, 5-6 AM (35)
May 27, 6-7 AM (9)
May 27, 7-8 AM (25)
May 27, 8-9 AM (30)
May 27, 9-10 AM (29)
May 27, 10-11 AM (47)
May 27, 11-12 PM (19)
May 27, 12-1 PM (35)
May 27, 1-2 PM (29)
May 27, 2-3 PM (10)
May 27, 3-4 PM (8)
May 27, 4-5 PM (17)
May 27, 5-6 PM (15)
May 27, 6-7 PM (13)
May 27, 7-8 PM (22)
May 27, 8-9 PM (13)
May 27, 9-10 PM (4)
May 27, 10-11 PM (11)
May 27, 11-12 AM (10)
May 28, 12-1 AM (15)
May 28, 1-2 AM (23)
May 28, 2-3 AM (7)
May 28, 3-4 AM (10)
May 28, 4-5 AM (21)
May 28, 5-6 AM (28)
May 28, 6-7 AM (37)
May 28, 7-8 AM (15)
May 28, 8-9 AM (29)
May 28, 9-10 AM (20)
May 28, 10-11 AM (18)
May 28, 11-12 PM (44)
May 28, 12-1 PM (33)
May 28, 1-2 PM (49)
May 28, 2-3 PM (32)
May 28, 3-4 PM (15)
May 28, 4-5 PM (28)
May 28, 5-6 PM (6)
May 28, 6-7 PM (21)
May 28, 7-8 PM (13)
May 28, 8-9 PM (55)
May 28, 9-10 PM (15)
May 28, 10-11 PM (20)
May 28, 11-12 AM (9)
May 29, 12-1 AM (12)
May 29, 1-2 AM (2)
May 29, 2-3 AM (7)
May 29, 3-4 AM (2)
May 29, 4-5 AM (16)
May 29, 5-6 AM (11)
May 29, 6-7 AM (31)
May 29, 7-8 AM (24)
May 29, 8-9 AM (17)
May 29, 9-10 AM (22)
May 29, 10-11 AM (26)
May 29, 11-12 PM (26)
May 29, 12-1 PM (20)
May 29, 1-2 PM (20)
May 29, 2-3 PM (27)
May 29, 3-4 PM (19)
May 29, 4-5 PM (13)
May 29, 5-6 PM (20)
May 29, 6-7 PM (13)
May 29, 7-8 PM (9)
May 29, 8-9 PM (9)
May 29, 9-10 PM (9)
May 29, 10-11 PM (8)
May 29, 11-12 AM (5)
May 30, 12-1 AM (15)
May 30, 1-2 AM (0)
May 30, 2-3 AM (1)
May 30, 3-4 AM (0)
May 30, 4-5 AM (0)
May 30, 5-6 AM (1)
May 30, 6-7 AM (2)
May 30, 7-8 AM (5)
May 30, 8-9 AM (3)
May 30, 9-10 AM (37)
May 30, 10-11 AM (4)
May 30, 11-12 PM (10)
May 30, 12-1 PM (3)
May 30, 1-2 PM (7)
May 30, 2-3 PM (31)
May 30, 3-4 PM (35)
May 30, 4-5 PM (2)
May 30, 5-6 PM (1)
May 30, 6-7 PM (3)
May 30, 7-8 PM (4)
May 30, 8-9 PM (0)
May 30, 9-10 PM (0)
May 30, 10-11 PM (0)
May 30, 11-12 AM (3)
May 31, 12-1 AM (5)
May 31, 1-2 AM (1)
May 31, 2-3 AM (10)
May 31, 3-4 AM (0)
May 31, 4-5 AM (0)
May 31, 5-6 AM (1)
May 31, 6-7 AM (1)
May 31, 7-8 AM (1)
May 31, 8-9 AM (3)
May 31, 9-10 AM (9)
May 31, 10-11 AM (3)
May 31, 11-12 PM (0)
May 31, 12-1 PM (5)
May 31, 1-2 PM (5)
May 31, 2-3 PM (0)
May 31, 3-4 PM (5)
May 31, 4-5 PM (1)
May 31, 5-6 PM (0)
May 31, 6-7 PM (1)
May 31, 7-8 PM (0)
May 31, 8-9 PM (1)
May 31, 9-10 PM (0)
May 31, 10-11 PM (1)
May 31, 11-12 AM (4)
Jun 01, 12-1 AM (5)
Jun 01, 1-2 AM (7)
Jun 01, 2-3 AM (0)
Jun 01, 3-4 AM (4)
Jun 01, 4-5 AM (4)
Jun 01, 5-6 AM (8)
Jun 01, 6-7 AM (19)
Jun 01, 7-8 AM (12)
Jun 01, 8-9 AM (29)
Jun 01, 9-10 AM (29)
Jun 01, 10-11 AM (19)
Jun 01, 11-12 PM (25)
Jun 01, 12-1 PM (14)
Jun 01, 1-2 PM (19)
Jun 01, 2-3 PM (35)
Jun 01, 3-4 PM (5)
Jun 01, 4-5 PM (7)
Jun 01, 5-6 PM (14)
Jun 01, 6-7 PM (5)
Jun 01, 7-8 PM (14)
Jun 01, 8-9 PM (17)
Jun 01, 9-10 PM (8)
Jun 01, 10-11 PM (1)
Jun 01, 11-12 AM (7)
Jun 02, 12-1 AM (9)
Jun 02, 1-2 AM (3)
Jun 02, 2-3 AM (2)
Jun 02, 3-4 AM (4)
Jun 02, 4-5 AM (5)
Jun 02, 5-6 AM (13)
Jun 02, 6-7 AM (27)
Jun 02, 7-8 AM (25)
Jun 02, 8-9 AM (29)
Jun 02, 9-10 AM (20)
Jun 02, 10-11 AM (28)
Jun 02, 11-12 PM (13)
Jun 02, 12-1 PM (17)
Jun 02, 1-2 PM (32)
Jun 02, 2-3 PM (13)
Jun 02, 3-4 PM (12)
Jun 02, 4-5 PM (24)
Jun 02, 5-6 PM (7)
Jun 02, 6-7 PM (2)
2,231 commits this week May 26, 2020 - Jun 02, 2020

test-infra: replace WrappedClock with OracularClock

This removes the recently added LogicalClock from ThreadNet infrastructure. So instead of using a mock SystemTime that only jumps forward an an entire slot length whenever the underlying logical clock ticks, it exposes the “real” io-sim clock like it used to. Using both a mock clock and also some oracular elements became confusing. Morever, we don’t have to mock up the BlockchainTime, we can use the real system to derive it from our SystemTime; we’re mocking less. So I think this is both simpler and less artificial. io-sim already mocks time, so I don’t think we have much to gain by introducing another layer of mock.

The oracular clock is used in two ways.

  • The general simplifying rule in the tests is that an error causes the node to “sleep” until the next slot onset, for various meanings of “sleep”. So the infrastructure that manages (ie imitates a node operator with really fast fingers) that needs to know the duration until that onset. In particular, when the ledger is too far behind for the node to know the current slot number, the node must rely on the oracle in order to sleep until the next slot onset. (See BackoffDelay.)

  • Again for simplicity, all schedules that are generated for the test configuration are specified in terms of slots, so the infrastructure needs always know the current slot in order to realize those schedules. (EG When a node joins.)

  • As long as there is no Common Prefix violation, then our ledger rules are designed so that the immutable common prefix determines the time. Thus all nodes indeed respect the same timeline. So having one oracle is sensible.

  • We have plans to revisit the slot-alignment of schedules etc, but that’s not yet prioritized. Removing that may simplify this clock-related infrastructure, but it will have to complicate and/or weaken the properties’ expectations.

There were a few impedance mismatches in the Network.hs infrastructure that the oracular clock forced us to address.

  • When the test is over, the SystemTime now blocks. This prevents nodes from doing particularly problematic things while the infrastructure is “racing” to cancel them. So our SystemTime is only very slightly mocked: it becomes unresponsive by blocking forever once the test is over.

  • The hardForkBlockchainTime function in the Ouroboros.Consensus.BlockchainTime.WallClock.HardFork module uses threadDelay and then reads the clock. Because of our “simplifying” rule that requires nodes to sleep for exactly one slot, this means we require t2 >= t1 + d in the following.

    do t1 <- now; threadDelay (nominalDelay d); t2 <- now

    When the SystemTime was mocked via LogicalClock, a race condition could cause t2 == t1 here, since that mocking and threadDelay were independent. Using a real SystemTime resolves this, since systemTimeCurrent wins the race against simultaneous threads waking in io-sim, in the absence of clock fudgery like backjumps.

  • We had to jiggle some of the per-slot behaviors in the infra-structure: reading the chain’s block number at the onset of the slot and persistently adding crucial txs.