@@ -70,6 +70,7 @@ import qualified Ouroboros.Consensus.Config as Consensus
70
70
import Ouroboros.Consensus.Config.SupportsNode (ConfigSupportsNode (.. ))
71
71
import Ouroboros.Consensus.Node (SnapshotPolicyArgs (.. ),
72
72
NodeDatabasePaths (.. ), RunNodeArgs (.. ), StdRunNodeArgs (.. ))
73
+ import Ouroboros.Consensus.Protocol.Praos.AgentClient (KESAgentClientTrace )
73
74
import Ouroboros.Consensus.Ledger.SupportsMempool (GenTxId )
74
75
import Ouroboros.Consensus.Node (RunNodeArgs (.. ),
75
76
SnapshotPolicyArgs (.. ), StdRunNodeArgs (.. ))
@@ -241,23 +242,20 @@ handleNodeWithTracers cmdPc nc p@(SomeConsensusProtocol blockType runP) = do
241
242
(getLast (pncConfigFile cmdPc))
242
243
case ncTraceConfig nc of
243
244
TraceDispatcher {} -> do
244
- -- TODO fix
245
- blockForging <- snd (Api. protocolInfo runP)
245
+ blockForging <- snd (Api. protocolInfo runP) nullTracer
246
246
tracers <-
247
247
initTraceDispatcher
248
248
nc
249
249
p
250
250
networkMagic
251
251
nodeKernelData
252
- -- TODO fix
253
252
(null blockForging)
254
253
255
254
startupInfo <- getStartupInfo nc p fp
256
255
mapM_ (traceWith $ startupTracer tracers) startupInfo
257
256
traceNodeStartupInfo (nodeStartupInfoTracer tracers) startupInfo
258
257
-- sends initial BlockForgingUpdate
259
258
let isNonProducing = ncStartAsNonProducingNode nc
260
- -- TODO fix
261
259
traceWith (startupTracer tracers)
262
260
(BlockForgingUpdate (if isNonProducing || null blockForging
263
261
then DisabledBlockForging
@@ -301,8 +299,7 @@ handleNodeWithTracers cmdPc nc p@(SomeConsensusProtocol blockType runP) = do
301
299
302
300
traceWith (nodeVersionTracer tracers) getNodeVersion
303
301
let isNonProducing = ncStartAsNonProducingNode nc
304
- -- TODO fix
305
- blockForging <- snd (Api. protocolInfo runP)
302
+ blockForging <- snd (Api. protocolInfo runP) nullTracer
306
303
traceWith (startupTracer tracers)
307
304
(BlockForgingUpdate (if isNonProducing || null blockForging
308
305
then DisabledBlockForging
@@ -472,8 +469,7 @@ handleSimpleNode blockType runP tracers nc onKernel = do
472
469
, rnProtocolInfo = pInfo
473
470
, rnNodeKernelHook = \ registry nodeKernel -> do
474
471
-- set the initial block forging
475
- -- TODO fix
476
- blockForging <- snd (Api. protocolInfo runP)
472
+ blockForging <- snd (Api. protocolInfo runP) (Consensus. kesAgentTracer $ consensusTracers tracers)
477
473
478
474
unless (ncStartAsNonProducingNode nc) $
479
475
setBlockForging nodeKernel blockForging
@@ -546,7 +542,7 @@ handleSimpleNode blockType runP tracers nc onKernel = do
546
542
nodeArgs {
547
543
rnNodeKernelHook = \ registry nodeKernel -> do
548
544
-- reinstall `SIGHUP` handler
549
- installSigHUPHandler (startupTracer tracers) blockType nc nodeKernel
545
+ installSigHUPHandler (startupTracer tracers) ( Consensus. kesAgentTracer $ consensusTracers tracers) blockType nc nodeKernel
550
546
localRootsVar publicRootsVar useLedgerVar useBootstrapVar
551
547
ledgerPeerSnapshotPathVar ledgerPeerSnapshotVar
552
548
rnNodeKernelHook nodeArgs registry nodeKernel
@@ -639,6 +635,7 @@ handleSimpleNode blockType runP tracers nc onKernel = do
639
635
-- | The P2P SIGHUP handler can update block forging & reconfigure network topology.
640
636
--
641
637
installSigHUPHandler :: Tracer IO (StartupTrace blk )
638
+ -> Tracer IO KESAgentClientTrace
642
639
-> Api. BlockType blk
643
640
-> NodeConfiguration
644
641
-> NodeKernel IO RemoteAddress (ConnectionId LocalAddress ) blk
@@ -650,14 +647,14 @@ installSigHUPHandler :: Tracer IO (StartupTrace blk)
650
647
-> StrictTVar IO (Maybe LedgerPeerSnapshot )
651
648
-> IO ()
652
649
#ifndef UNIX
653
- installSigHUPHandler _ _ _ _ _ _ _ _ _ _ = return ()
650
+ installSigHUPHandler _ _ _ _ _ _ _ _ _ _ _ = return ()
654
651
#else
655
- installSigHUPHandler startupTracer blockType nc nodeKernel localRootsVar publicRootsVar useLedgerVar
652
+ installSigHUPHandler startupTracer kesAgentTracer blockType nc nodeKernel localRootsVar publicRootsVar useLedgerVar
656
653
useBootstrapPeersVar ledgerPeerSnapshotPathVar ledgerPeerSnapshotVar =
657
654
void $ Signals. installHandler
658
655
Signals. sigHUP
659
656
(Signals. Catch $ do
660
- updateBlockForging startupTracer blockType nodeKernel nc
657
+ updateBlockForging startupTracer kesAgentTracer blockType nodeKernel nc
661
658
updateTopologyConfiguration startupTracer nc localRootsVar publicRootsVar
662
659
useLedgerVar useBootstrapPeersVar ledgerPeerSnapshotPathVar
663
660
void $ updateLedgerPeerSnapshot
@@ -673,11 +670,12 @@ installSigHUPHandler startupTracer blockType nc nodeKernel localRootsVar publicR
673
670
674
671
#ifdef UNIX
675
672
updateBlockForging :: Tracer IO (StartupTrace blk )
673
+ -> Tracer IO KESAgentClientTrace
676
674
-> Api. BlockType blk
677
675
-> NodeKernel IO RemoteAddress (ConnectionId LocalAddress ) blk
678
676
-> NodeConfiguration
679
677
-> IO ()
680
- updateBlockForging startupTracer blockType nodeKernel nc = do
678
+ updateBlockForging startupTracer kesAgentTracer blockType nodeKernel nc = do
681
679
eitherSomeProtocol <- runExceptT $ mkConsensusProtocol
682
680
(ncProtocolConfig nc)
683
681
(Just (ncProtocolFiles nc))
@@ -693,8 +691,7 @@ updateBlockForging startupTracer blockType nodeKernel nc = do
693
691
case Api. reflBlockType blockType blockType' of
694
692
Just Refl -> do
695
693
-- TODO: check if runP' has changed
696
- -- TODO fix
697
- blockForging <- snd (Api. protocolInfo runP')
694
+ blockForging <- snd (Api. protocolInfo runP') kesAgentTracer
698
695
traceWith startupTracer
699
696
(BlockForgingUpdate (if null blockForging
700
697
then DisabledBlockForging
0 commit comments