Skip to content

Commit 59fb73f

Browse files
Niolsneilmayhew
authored andcommitted
Add a TraceDrainingThePipe event
1 parent c6c2e18 commit 59fb73f

File tree

2 files changed

+7
-7
lines changed
  • ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/PeerSimulator
  • ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/MiniProtocol/ChainSync

2 files changed

+7
-7
lines changed

ouroboros-consensus-diffusion/test/consensus-test/Test/Consensus/PeerSimulator/Trace.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,8 @@ traceChainSyncClientEventTestBlockWith pid tracer = \case
419419
trace "Waiting for next instruction from the jumping governor"
420420
TraceJumpingInstructionIs instr ->
421421
trace $ "Received instruction: " ++ showInstr instr
422+
TraceDrainingThePipe n ->
423+
trace $ "Draining the pipe, remaining messages: " ++ show n
422424
where
423425
trace = traceUnitWith tracer ("ChainSyncClient " ++ condense pid)
424426

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/MiniProtocol/ChainSync/Client.hs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,9 @@ chainSyncClient cfgEnv dynEnv =
917917
Nat n'
918918
-> s
919919
-> m (Consensus (ClientPipelinedStIdle n') blk m)
920-
go n s = case n of
920+
go n s = do
921+
traceWith tracer $ TraceDrainingThePipe n
922+
case n of
921923
Zero -> continueWithState s m
922924
Succ n' -> return $ CollectResponse Nothing $ ClientStNext {
923925
recvMsgRollForward = \_hdr _tip -> go n' s
@@ -2334,12 +2336,8 @@ data TraceChainSyncClientEvent blk =
23342336
|
23352337
TraceJumpingInstructionIs (Jumping.Instruction blk)
23362338
-- ^ ChainSync Jumping -- the ChainSync client got its next instruction.
2337-
2338-
deriving instance
2339-
( BlockSupportsProtocol blk
2340-
, Eq (Header blk)
2341-
)
2342-
=> Eq (TraceChainSyncClientEvent blk)
2339+
|
2340+
forall n. TraceDrainingThePipe (Nat n)
23432341

23442342
deriving instance
23452343
( BlockSupportsProtocol blk

0 commit comments

Comments
 (0)