Safe Haskell | None |
---|---|
Language | Haskell2010 |
Test.Consensus.Genesis.Tests.LoE.CaughtUp
Description
This is a regression test for https://github.com/IntersectMBO/ouroboros-consensus/issues/1503.
Concretely, consider k = 1
(security parameter), and a syncing Genesis
enabled.
Now consider the following block tree:
G :> A >: C :> B
Suppose that we have two peers, Peer 1 and Peer 2:
- Peer 1 first sends A, then C, then rolls back to A, and then idles.
- Peer 2 sends B and then idles.
In any possible interleaving (tested using IOSimPOR), the node should in the end be caught-up and have selected C as it is the best chain.
To (somewhat) simplify the test setup boilerplate, we do not actually run ChainSync and BlockFetch, but rather simulate their behavior by modifying the ChainSync client state (eg candidate fragments) as well as adding blocks to the ChainDB.