Skip to content

Commit 97554bd

Browse files
authored
NodeKernel: expose getBlockchainTime (#1367)
# Description This PR exposes the blockchain time in the node kernel. This tiny change is a requirement for the "periodic metrics tracer" feature (cf. IntersectMBO/cardano-node#6076), which has already shown promising performance improvements in benchmarks.
2 parents 388194c + 4efdfb6 commit 97554bd

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Non-Breaking
2+
3+
- Expose blockchain time as `getBlockchainTime :: BlockchainTime m` in the `NodeKernel`.

ouroboros-consensus-diffusion/src/ouroboros-consensus-diffusion/Ouroboros/Consensus/NodeKernel.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ data NodeKernel m addrNTN addrNTC blk = NodeKernel {
166166
:: StrictTVar m OutboundConnectionsState
167167
, getDiffusionPipeliningSupport
168168
:: DiffusionPipeliningSupport
169+
, getBlockchainTime :: BlockchainTime m
169170
}
170171

171172
-- | Arguments required when initializing a node
@@ -208,6 +209,7 @@ initNodeKernel ::
208209
initNodeKernel args@NodeKernelArgs { registry, cfg, tracers
209210
, chainDB, initChainDB
210211
, blockFetchConfiguration
212+
, btime
211213
, gsmArgs
212214
, peerSharingRng
213215
, publicPeerSelectionStateVar
@@ -333,6 +335,7 @@ initNodeKernel args@NodeKernelArgs { registry, cfg, tracers
333335
, getOutboundConnectionsState
334336
= varOutboundConnectionsState
335337
, getDiffusionPipeliningSupport
338+
, getBlockchainTime = btime
336339
}
337340
where
338341
blockForgingController :: InternalState m remotePeer localPeer blk

0 commit comments

Comments
 (0)