Skip to content

Commit

Permalink
Merge #1600
Browse files Browse the repository at this point in the history
1600: Add ProtocolTracers parameter to Ouroboros.Consensus.Node.run r=intricate a=intricate

Requirement for IntersectMBO/cardano-node#527.

Specifically:

>We also need to trace at the default log level for the outbound side of tx submission:
>* when a remote peer has requested a tx id, and we do send the tx to them, then we should log that the txid was requested and sent

Co-authored-by: Luke Nadur <[email protected]>
  • Loading branch information
iohk-bors[bot] and intricate authored Feb 11, 2020
2 parents c0f1e1c + 177ac9b commit 578147a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions ouroboros-consensus/src/Ouroboros/Consensus/Node.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module Ouroboros.Consensus.Node
, mkNodeArgs
) where

import Codec.Serialise (DeserialiseFailure)
import Control.Tracer (Tracer)
import Crypto.Random
import Data.ByteString.Lazy (ByteString)
Expand Down Expand Up @@ -90,7 +91,9 @@ run
:: forall blk.
RunNode blk
=> Tracers IO ConnectionId blk -- ^ Consensus tracers
-> Tracer IO (ChainDB.TraceEvent blk) -- ^ ChainDB tracer
-> ProtocolTracers IO ConnectionId blk DeserialiseFailure
-- ^ Protocol tracers
-> Tracer IO (ChainDB.TraceEvent blk) -- ^ ChainDB tracer
-> DiffusionTracers -- ^ Diffusion tracers
-> DiffusionArguments -- ^ Diffusion arguments
-> NetworkMagic
Expand All @@ -105,9 +108,9 @@ run
-- ^ Called on the 'NodeKernel' after creating it, but before the network
-- layer is initialised.
-> IO ()
run tracers chainDbTracer diffusionTracers diffusionArguments networkMagic
dbPath pInfo isProducer customiseChainDbArgs customiseNodeArgs
onNodeKernel = do
run tracers protocolTracers chainDbTracer diffusionTracers diffusionArguments
networkMagic dbPath pInfo isProducer customiseChainDbArgs
customiseNodeArgs onNodeKernel = do
let mountPoint = MountPoint dbPath
either throwM return =<< checkDbMarker
(ioHasFS mountPoint)
Expand Down Expand Up @@ -145,7 +148,7 @@ run tracers chainDbTracer diffusionTracers diffusionArguments networkMagic
()
networkApps = consensusNetworkApps
nodeKernel
nullProtocolTracers
protocolTracers
(protocolCodecs (getNodeConfig nodeKernel))
(protocolHandlers nodeArgs nodeKernel)

Expand Down

0 comments on commit 578147a

Please sign in to comment.