Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1554: Detect clock changes r=edsko a=edsko Closes #759. Code is tested using mock time; result of the test labelling: ``` # cabal run test-consensus -- -p delayClockShift --quickcheck-replay=680184 --quickcheck-tests 10000 Up to date ouroboros-consensus WallClock delayClockShift: OK (18.51s) +++ OK, passed 10000 tests. schedule goes back (10000 in total): 63.07% False 36.93% True schedule length (10000 in total): 81.03% R_Gt 20 9.26% R_Btwn (10,20) 4.08% R_Btwn (5,10) 1.04% R_Btwn (4,5) 1.03% R_Eq 1 0.96% R_Eq 2 0.94% R_Eq 4 0.87% R_Eq 0 0.79% R_Eq 3 schedule skips (10000 in total): 38.66% R_Btwn (10,20) 24.96% R_Btwn (5,10) 5.59% R_Eq 0 5.43% R_Eq 2 5.27% R_Btwn (4,5) 5.12% R_Eq 1 5.08% R_Eq 3 4.99% R_Eq 4 4.90% R_Gt 20 All 1 tests passed (18.52s) ``` I also verified that the exception bubbles up to the node. Ran the latest node with this PR, set my clock back an hour, and got ``` cardano-node: ExceptionInLinkedThread "ThreadId 20" (SystemClockMovedBack 2020-01-31 11:15:31.00184141 UTC (SlotNo {unSlotNo = 3713312}) (SlotNo {unSlotNo = 3713132})) ``` There is no need to define a custom error policy for this due to #1553 , nor a custom exit failure due to #1551 (comment) . Co-authored-by: Edsko de Vries <edsko@well-typed.com>
- Loading branch information
Showing
2 changed files
with
69 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters