Skip to content

Commit

Permalink
NodeKernel: expose getBlockchainTime (#1367)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
jasagredo authored Jan 24, 2025
2 parents 388194c + 4efdfb6 commit 97554bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Non-Breaking

- Expose blockchain time as `getBlockchainTime :: BlockchainTime m` in the `NodeKernel`.
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ data NodeKernel m addrNTN addrNTC blk = NodeKernel {
:: StrictTVar m OutboundConnectionsState
, getDiffusionPipeliningSupport
:: DiffusionPipeliningSupport
, getBlockchainTime :: BlockchainTime m
}

-- | Arguments required when initializing a node
Expand Down Expand Up @@ -208,6 +209,7 @@ initNodeKernel ::
initNodeKernel args@NodeKernelArgs { registry, cfg, tracers
, chainDB, initChainDB
, blockFetchConfiguration
, btime
, gsmArgs
, peerSharingRng
, publicPeerSelectionStateVar
Expand Down Expand Up @@ -333,6 +335,7 @@ initNodeKernel args@NodeKernelArgs { registry, cfg, tracers
, getOutboundConnectionsState
= varOutboundConnectionsState
, getDiffusionPipeliningSupport
, getBlockchainTime = btime
}
where
blockForgingController :: InternalState m remotePeer localPeer blk
Expand Down

0 comments on commit 97554bd

Please sign in to comment.