ouroboros-consensus
ouroboros-consensus copied to clipboard
Genesis milestone 12 - Chain Sync Jumping
The main contribution of this PR is the implementation of ChainSync Jumping (78e16d0), a mechanism to avoid overloading the honest peers in the network when one or more peers connect to them for syncing. The details of ChainSync Jumping are discussed in the Jumping module.
A range of supporting commits are provided in addition.
More tests
- The time limited leashing attack test is configured and enabled in 923a8a0. This test is aimed at the GDD governor implemented in #1015.
- A test to show that a node can resume syncing after being disconnected for a while has been implemented in 58fa58b.
- There is a test checking that the GDD governor doesn't regret disconnecting nodes as more headers are known to it (119a1c2). This was included in the previous milestone but we discovered later it wasn't checking as much as we intended.
- In 7fcfefd and 6648739 there is a test for ChainSync Jumping that ensures that a syncing node downloads headers from at most one peer when there is no disagreement between the peers.
- There are various fixes to tests and documentation in 7064785, d056bab, 107d392, dfb161e, and df31999.
GDD refinement
The ability of the GDD governor to disconnect nodes has increased in 4c2bb1f. With respect to #1015, the GDD governor can now disconnect peers in the following scenarios:
- when a peer has a chain that can't be denser than another chain served by another peer (before, we would disconnect the peer only if there was a denser chain); or
- when a peer has a chain of density 0 and it claims to have more headers after the genesis window; or
- when a peer sent a header for the last slot of the genesis window or later, and loses the density comparison to another peer (before, we would disconnect the peer only after it loses the density comparison to a peer that sent more than k headers in the genesis window).
These changes help ChainSync Jumping make progress while downloading headers from only two disagreeing peers (even if both are adversarial).
Other changes
- A version of shrinking of honest schedules of messages has been implemented in 38b866e.
- 2f3f9f2 contains a fix to the implementation of Limit on Patience.
- 4d101dc implements a recording tracer that doesn't affect scheduling in IOSim.