|
77 | 77 | -- Interactions with the BlockFetch logic |
78 | 78 | -- -------------------------------------- |
79 | 79 | -- |
80 | | --- When syncing, the BlockFetch logic will fetch blocks from the dynamo. If the |
81 | | --- dynamo is responding too slowly, the BlockFetch logic can ask to change the |
82 | | --- dynamo with a call to 'rotateDynamo'. |
| 80 | +-- When syncing, the BlockFetch logic might request to change the dynamo with |
| 81 | +-- a call to 'rotateDynamo'. This is because the choice of dynamo influences |
| 82 | +-- which peer is selected to download blocks. See the note "Interactions with |
| 83 | +-- ChainSync Jumping" in "Ouroboros.Network.BlockFetch.Decision.BulkSync". |
83 | 84 | -- |
84 | 85 | -- Interactions with the Limit on Patience |
85 | 86 | -- --------------------------------------- |
|
155 | 156 | -- (j|k). |
156 | 157 | -- |
157 | 158 | -- The BlockFetch logic can ask to change the dynamo if it is not serving blocks |
158 | | --- fast enough. If there are other non-disengaged peers the dynamo is demoted to |
159 | | --- a jumper (l) and a new dynamo is elected. |
| 159 | +-- fast enough. If there are other non-disengaged peers, the dynamo (and the |
| 160 | +-- objector if there is one) is demoted to a jumper (l+g) and a new dynamo is |
| 161 | +-- elected. |
160 | 162 | -- |
161 | 163 | module Ouroboros.Consensus.MiniProtocol.ChainSync.Client.Jumping ( |
162 | 164 | Context |
@@ -275,9 +277,9 @@ mkJumping peerContext = Jumping |
275 | 277 | -- |
276 | 278 | -- Invariants: |
277 | 279 | -- |
278 | | --- - If 'handlesCol is not empty, then there is exactly one dynamo in it. |
279 | | --- - There is at most one objector in 'handlesCol. |
280 | | --- - If there exist 'FoundIntersection' jumpers in 'handlesCol, then there |
| 280 | +-- - If 'handlesCol' is not empty, then there is exactly one dynamo in it. |
| 281 | +-- - There is at most one objector in 'handlesCol'. |
| 282 | +-- - If there exist 'FoundIntersection' jumpers in 'handlesCol', then there |
281 | 283 | -- is an objector and the intersection of the objector with the dynamo is |
282 | 284 | -- at least as old as the oldest intersection of the `FoundIntersection` jumpers |
283 | 285 | -- with the dynamo. |
@@ -763,8 +765,9 @@ unregisterClient context = do |
763 | 765 | Objector{} -> electNewObjector context' |
764 | 766 | Dynamo{} -> void $ electNewDynamo context' |
765 | 767 |
|
766 | | --- | Elects a new dynamo by demoting the given dynamo to a jumper, moving the |
767 | | --- peer to the end of the queue of chain sync handles and electing a new dynamo. |
| 768 | +-- | Elects a new dynamo by demoting the given dynamo (and the objector if there |
| 769 | +-- is one) to a jumper, moving the peer to the end of the queue of chain sync |
| 770 | +-- handles and electing a new dynamo. |
768 | 771 | -- |
769 | 772 | -- It does nothing if there is no other engaged peer to elect or if the given |
770 | 773 | -- peer is not the dynamo. |
|
0 commit comments