Skip to content
Permalink
Browse files

Explicit conensus traces

This adds block fetch tracers to `NodeParams`.  This gives the power to
the user to instantiate the traces.  This is useful for debuging block
fetch logic.
  • Loading branch information...
coot committed Jul 11, 2019
1 parent adc7ea8 commit fa3b5ebbd40f3b87aad4732c1286c75f95c6a982
@@ -117,6 +117,8 @@ data NodeCallbacks m blk = NodeCallbacks {
data NodeParams m peer blk = NodeParams {
tracer :: Tracer m String
, mempoolTracer :: Tracer m (TraceEventMempool blk)
, decisionTracer :: Tracer m [TraceLabelPeer peer (FetchDecision [Point (Header blk)])]
, fetchClientTracer :: Tracer m (TraceLabelPeer peer (TraceFetchClientState (Header blk)))
, threadRegistry :: ThreadRegistry m
, maxClockSkew :: ClockSkew
, cfg :: NodeConfig (BlockProtocol blk)
@@ -140,7 +142,7 @@ nodeKernel
)
=> NodeParams m peer blk
-> m (NodeKernel m peer blk)
nodeKernel params@NodeParams { threadRegistry, cfg } = do
nodeKernel params@NodeParams { threadRegistry, cfg, decisionTracer, fetchClientTracer } = do
st <- initInternalState params

forkBlockProduction st
@@ -151,8 +153,8 @@ nodeKernel params@NodeParams { threadRegistry, cfg } = do
-- Run the block fetch logic in the background. This will call
-- 'addFetchedBlock' whenever a new block is downloaded.
void $ forkLinked threadRegistry $ blockFetchLogic
nullTracer -- fetch decision tracer
nullTracer -- fetch client state tracer
decisionTracer
fetchClientTracer
blockFetchInterface
fetchClientRegistry

@@ -230,6 +230,8 @@ broadcastNetwork registry btime numCoreNodes pInfo initRNG numSlots = do
let nodeParams = NodeParams
{ tracer = nullTracer
, mempoolTracer = nullTracer
, decisionTracer = nullTracer
, fetchClientTracer = nullTracer
, threadRegistry = registry
, maxClockSkew = ClockSkew 1
, cfg = pInfoConfig

0 comments on commit fa3b5eb

Please sign in to comment.
You can’t perform that action at this time.