Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Query Results to LedgerMetrics Periodical Tracer #6076

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4e78f00
Use cardano-ledger-conway 1.17.3
crocodile-dentist Nov 26, 2024
de3c809
cardanoProtocolVersion and CHaP bump
crocodile-dentist Nov 26, 2024
36871ba
Merge pull request #6043 from IntersectMBO/mwojtowicz/10.1.3
crocodile-dentist Nov 27, 2024
3bc5842
Bump CHaP
neilmayhew Jan 2, 2025
3cde9b9
Use cardano-ledger-conway 1.17.4
neilmayhew Jan 2, 2025
d330c68
Increase cardano-node version to 10.1.4
neilmayhew Jan 3, 2025
5a25e2c
Merge pull request #6063 from IntersectMBO/release/10.1.4
neilmayhew Jan 6, 2025
b1637f4
Increase protocol minor version
neilmayhew Jan 6, 2025
1f63dbf
Merge pull request #6065 from IntersectMBO/neilmayhew/protocol-version
neilmayhew Jan 6, 2025
f7af271
cardano-node: Started LedgerQuery tracer replaces StartLeadershipPlus
jutaro Jan 9, 2025
9c5499b
cardano-node: ledger metrics tracer
jutaro Jan 14, 2025
84af3a9
trace-dispatcher: ledger metrics frequency
jutaro Jan 14, 2025
68841d7
cardano-node: consistency and documentation
jutaro Jan 15, 2025
34e18a9
bench: empty config value
jutaro Jan 15, 2025
4edb757
workbench: adopt config
jutaro Jan 15, 2025
b52f960
trace-dispatcher: config value
jutaro Jan 15, 2025
ff562dc
trace-dispatcher: test fixes
jutaro Jan 15, 2025
24e523f
fix changed cabal.project
jutaro Jan 15, 2025
ee34ea0
cardano-node: Fix for ghc 9
jutaro Jan 15, 2025
727c3c3
cardano-node: Next try to fix
jutaro Jan 15, 2025
5741bbb
s-r-p for o-c
mgmeier Jan 16, 2025
77c3e42
try: ledger metrics 700ms after slot start
mgmeier Jan 16, 2025
bab3516
locli: backport GC improvement
mgmeier Jan 20, 2025
5cfbeb2
cardano-node: ledgerDRepCount & ledgerDRepMapSize
jutaro Jan 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bench/locli/locli.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ executable locli
ghc-options: -threaded
-Wall
-rtsopts
"-with-rtsopts=-T -N7 -A2m -qb -H64m"
"-with-rtsopts=-T -N7 -A2m -c -H64m"

build-depends: aeson
, cardano-prelude
Expand Down
1 change: 1 addition & 0 deletions bench/tx-generator/src/Cardano/Benchmarking/Tracer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ initialTraceConfig = TraceConfig {
, tcPeerFrequency = Just 2000 -- Every 2 seconds
, tcResourceFrequency = Just 1000 -- Every second
, tcMetricsPrefix = Nothing
, tcLedgerMetricsFrequency = Nothing
}
where
setMaxDetail :: Text -> ([Text], [ConfigOption])
Expand Down
16 changes: 15 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repository cardano-haskell-packages
-- you need to run if you change them
index-state:
, hackage.haskell.org 2024-10-10T00:52:24Z
, cardano-haskell-packages 2024-10-30T10:23:17Z
, cardano-haskell-packages 2025-01-02T21:54:55Z

packages:
cardano-node
Expand Down Expand Up @@ -68,3 +68,17 @@ allow-newer:
-- IMPORTANT
-- Do NOT add more source-repository-package stanzas here unless they are strictly
-- temporary! Please read the section in CONTRIBUTING about updating dependencies.

-- exposes getBlockchainTime in NodeKernel
source-repository-package
type: git
location: https://github.com/mgmeier/ouroboros-consensus.git
tag: 509bf8eafcf8ec7e28a1abe587d8913ed8838404
--sha256: 1klx7x85bkzl83gmjpc2jhihjcvy3vcm75k5f0rxivgwxg4gh3k2
subdir:
ouroboros-consensus
ouroboros-consensus-cardano
ouroboros-consensus-diffusion
ouroboros-consensus-protocol
sop-extras
strict-sop-core
6 changes: 3 additions & 3 deletions cardano-node/cardano-node.cabal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cabal-version: 3.0

name: cardano-node
version: 10.1.2
version: 10.1.4
synopsis: The cardano full node
description: The cardano full node.
category: Cardano,
Expand Down Expand Up @@ -111,6 +111,7 @@ library
Cardano.Node.Tracing.Tracers.Diffusion
Cardano.Node.Tracing.Tracers.ForgingThreadStats
Cardano.Node.Tracing.Tracers.KESInfo
Cardano.Node.Tracing.Tracers.LedgerMetrics
Cardano.Node.Tracing.Tracers.NodeToClient
Cardano.Node.Tracing.Tracers.NodeToNode
Cardano.Node.Tracing.Tracers.NodeVersion
Expand All @@ -119,7 +120,6 @@ library
Cardano.Node.Tracing.Tracers.Peer
Cardano.Node.Tracing.Tracers.Resources
Cardano.Node.Tracing.Tracers.Shutdown
Cardano.Node.Tracing.Tracers.StartLeadershipCheck
Cardano.Node.Tracing.Tracers.Startup
Cardano.Node.Types
Cardano.Tracing.Config
Expand Down Expand Up @@ -156,7 +156,7 @@ library
, cardano-ledger-binary
, cardano-ledger-byron
-- TODO: remove constraint at next ledger bump
, cardano-ledger-conway ^>= 1.17.2
, cardano-ledger-conway ^>= 1.17.4
, cardano-ledger-core
, cardano-ledger-shelley
, cardano-prelude
Expand Down
2 changes: 1 addition & 1 deletion cardano-node/src/Cardano/Node/Protocol/Cardano.hs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ mkSomeConsensusProtocolCardano NodeByronProtocolConfiguration {
shelleyGenesisHash,
shelleyBasedLeaderCredentials = shelleyLeaderCredentials
}
, Consensus.cardanoProtocolVersion = ProtVer (natVersion @10) 0
, Consensus.cardanoProtocolVersion = ProtVer (natVersion @10) 2
-- The remaining arguments specify the parameters needed to transition between two eras
, Consensus.cardanoLedgerTransitionConfig =
Ledger.mkLatestTransitionConfig
Expand Down
5 changes: 3 additions & 2 deletions cardano-node/src/Cardano/Node/Tracing.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import Cardano.Node.Startup (NodeInfo, NodeStartupInfo, StartupTrace (
import Cardano.Node.Tracing.StateRep (NodeState)
import Cardano.Node.Tracing.Tracers.ConsensusStartupException
(ConsensusStartupException (..))
import Cardano.Node.Tracing.Tracers.Peer (PeerT)
import Cardano.Node.Tracing.Tracers.LedgerMetrics (LedgerMetrics)
import Cardano.Node.Tracing.Tracers.NodeVersion (NodeVersionTrace)

import Cardano.Node.Tracing.Tracers.Peer (PeerT)
import qualified Ouroboros.Consensus.Network.NodeToClient as NodeToClient
import qualified Ouroboros.Consensus.Network.NodeToNode as NodeToNode
import qualified Ouroboros.Consensus.Node.Tracers as Consensus
Expand Down Expand Up @@ -55,4 +55,5 @@ data Tracers peer localPeer blk p2p = Tracers
, nodeStateTracer :: !(Tracer IO NodeState)
, resourcesTracer :: !(Tracer IO ResourceStats)
, peersTracer :: !(Tracer IO [PeerT blk])
, ledgerMetricsTracer :: !(Tracer IO LedgerMetrics)
}
6 changes: 6 additions & 0 deletions cardano-node/src/Cardano/Node/Tracing/API.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import Cardano.Node.Tracing
import Cardano.Node.Tracing.DefaultTraceConfig (defaultCardanoConfig)
import Cardano.Node.Tracing.StateRep (NodeState (..))
import Cardano.Node.Tracing.Tracers
import Cardano.Node.Tracing.Tracers.LedgerMetrics
import Cardano.Node.Tracing.Tracers.Peer (startPeerTracer)
import Cardano.Node.Tracing.Tracers.Resources (startResourceTracer)
import Cardano.Node.Types
Expand Down Expand Up @@ -69,6 +70,11 @@ initTraceDispatcher nc p networkMagic nodeKernel p2pMode = do
(resourcesTracer tracers)
(fromMaybe 1000 (tcResourceFrequency trConfig))

startLedgerMetricsTracer
(ledgerMetricsTracer tracers)
(fromMaybe 1000 (tcLedgerMetricsFrequency trConfig))
nodeKernel

startPeerTracer
(peersTracer tracers)
nodeKernel
Expand Down
9 changes: 6 additions & 3 deletions cardano-node/src/Cardano/Node/Tracing/Consistency.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@ import Cardano.Node.Tracing.Documentation (docTracersFirstPhase)
import Cardano.Node.Tracing.Formatting ()
import qualified Cardano.Node.Tracing.StateRep as SR
import Cardano.Node.Tracing.Tracers.BlockReplayProgress
import Cardano.Node.Tracing.Tracers.Consensus
import Cardano.Node.Tracing.Tracers.Diffusion ()
import Cardano.Node.Tracing.Tracers.KESInfo ()
import Cardano.Node.Tracing.Tracers.LedgerMetrics (LedgerMetrics)
import Cardano.Node.Tracing.Tracers.NodeToClient ()
import Cardano.Node.Tracing.Tracers.NodeToNode ()
import Cardano.Node.Tracing.Tracers.NodeVersion (NodeVersionTrace)

import Cardano.Node.Tracing.Tracers.NonP2P ()
import Cardano.Node.Tracing.Tracers.P2P ()
import Cardano.Node.Tracing.Tracers.Peer
Expand All @@ -46,6 +45,7 @@ import Ouroboros.Consensus.MiniProtocol.ChainSync.Client (TraceChainSy
import Ouroboros.Consensus.MiniProtocol.ChainSync.Server (TraceChainSyncServerEvent)
import Ouroboros.Consensus.MiniProtocol.LocalTxSubmission.Server
(TraceLocalTxSubmissionServerEvent (..))
import Ouroboros.Consensus.Node.Tracers (TraceForgeEvent)
import qualified Ouroboros.Consensus.Protocol.Ledger.HotKey as HotKey
import qualified Ouroboros.Consensus.Storage.ChainDB as ChainDB
import Ouroboros.Network.Block (Point (..), SlotNo, Tip)
Expand Down Expand Up @@ -128,6 +128,8 @@ getAllNamespaces =
(allNamespaces :: [Namespace [PeerT blk]])
resourcesNS = map nsGetTuple
(allNamespaces :: [Namespace ResourceStats])
ledgerMetricsNS = map nsGetTuple
(allNamespaces :: [Namespace LedgerMetrics])
startupNS = map (nsGetTuple . nsReplacePrefix ["Startup"])
(allNamespaces :: [Namespace (StartupTrace blk)])
shutdownNS = map (nsGetTuple . nsReplacePrefix ["Shutdown"])
Expand Down Expand Up @@ -180,7 +182,7 @@ getAllNamespaces =
mempoolNS = map (nsGetTuple . nsReplacePrefix ["Mempool"])
(allNamespaces :: [Namespace (TraceEventMempool blk)])
forgeNS = map (nsGetTuple . nsReplacePrefix ["Forge", "Loop"])
(allNamespaces :: [Namespace (ForgeTracerType blk)])
(allNamespaces :: [Namespace (TraceForgeEvent blk)])

blockchainTimeNS = map (nsGetTuple . nsReplacePrefix ["BlockchainTime"])
(allNamespaces :: [Namespace (TraceBlockchainTimeEvent RelativeTime)])
Expand Down Expand Up @@ -371,6 +373,7 @@ getAllNamespaces =
stateNS
<> peersNS
<> resourcesNS
<> ledgerMetricsNS
<> startupNS
<> shutdownNS
<> nodeVersionNS
Expand Down
11 changes: 9 additions & 2 deletions cardano-node/src/Cardano/Node/Tracing/Documentation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import Cardano.Node.Tracing.Tracers.Consensus
import Cardano.Node.Tracing.Tracers.Diffusion ()
import Cardano.Node.Tracing.Tracers.ForgingThreadStats (ForgeThreadStats)
import Cardano.Node.Tracing.Tracers.KESInfo ()
import Cardano.Node.Tracing.Tracers.LedgerMetrics (LedgerMetrics)
import Cardano.Node.Tracing.Tracers.NodeToClient ()
import Cardano.Node.Tracing.Tracers.NodeToNode ()
import Cardano.Node.Tracing.Tracers.NodeVersion (NodeVersionTrace)
Expand Down Expand Up @@ -231,6 +232,10 @@ docTracersFirstPhase condConfigFileName = do
configureTracers configReflection trConfig [resourcesTr]
resourcesTrDoc <- documentTracer (resourcesTr :: Trace IO ResourceStats)

ledgerMetricsTr <- mkCardanoTracer trBase trForward mbTrEKG []
configureTracers configReflection trConfig [ledgerMetricsTr]
ledgerMetricsTrDoc <- documentTracer (ledgerMetricsTr :: Trace IO LedgerMetrics)

-- Startup tracer
startupTr <- mkCardanoTracer
trBase trForward mbTrEKG
Expand Down Expand Up @@ -360,8 +365,7 @@ docTracersFirstPhase condConfigFileName = do
["Forge", "Loop"]
configureTracers configReflection trConfig [forgeTr]
forgeTrDoc <- documentTracer (forgeTr ::
Trace IO (ForgeTracerType blk))

Trace IO (Consensus.TraceForgeEvent blk))

forgeTr' <- mkCardanoTracer
trBase trForward mbTrEKG
Expand All @@ -377,6 +381,8 @@ docTracersFirstPhase condConfigFileName = do
blockchainTimeTrDoc <- documentTracer (blockchainTimeTr ::
Trace IO (TraceBlockchainTimeEvent RelativeTime))



-- Node to client

keepAliveClientTr <- mkCardanoTracer
Expand Down Expand Up @@ -699,6 +705,7 @@ docTracersFirstPhase condConfigFileName = do
<> nodeStartupInfoDpDoc
<> stateTrDoc
<> resourcesTrDoc
<> ledgerMetricsTrDoc
<> startupTrDoc
<> shutdownTrDoc
<> nodeVersionDoc
Expand Down
14 changes: 9 additions & 5 deletions cardano-node/src/Cardano/Node/Tracing/Tracers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import Cardano.Node.Tracing.Tracers.Consensus
import Cardano.Node.Tracing.Tracers.Diffusion ()
import Cardano.Node.Tracing.Tracers.ForgingThreadStats (forgeThreadStats)
import Cardano.Node.Tracing.Tracers.KESInfo
import Cardano.Node.Tracing.Tracers.LedgerMetrics ()
import Cardano.Node.Tracing.Tracers.NodeToClient ()
import Cardano.Node.Tracing.Tracers.NodeToNode ()
import Cardano.Node.Tracing.Tracers.NodeVersion (getNodeVersion)
Expand Down Expand Up @@ -117,6 +118,9 @@ mkDispatchTracers nodeKernel trBase trForward mbTrEKG trDataPoint trConfig enabl
!resourcesTr <- mkCardanoTracer trBase trForward mbTrEKG []
configureTracers configReflection trConfig [resourcesTr]

!ledgerMetricsTr <- mkCardanoTracer trBase trForward mbTrEKG []
configureTracers configReflection trConfig [ledgerMetricsTr]

!startupTr <- mkCardanoTracer trBase trForward mbTrEKG ["Startup"]
configureTracers configReflection trConfig [startupTr]

Expand Down Expand Up @@ -199,6 +203,7 @@ mkDispatchTracers nodeKernel trBase trForward mbTrEKG trDataPoint trConfig enabl
, resourcesTracer = Tracer (traceWith resourcesTr)
, peersTracer = Tracer (traceWith peersTr)
<> Tracer (traceNodePeers nodePeersDP)
, ledgerMetricsTracer = Tracer (traceWith ledgerMetricsTr)
}

mkConsensusTracers :: forall blk.
Expand All @@ -217,7 +222,7 @@ mkConsensusTracers :: forall blk.
-> TraceConfig
-> NodeKernelData blk
-> IO (Consensus.Tracers IO (ConnectionId RemoteAddress) (ConnectionId LocalAddress) blk)
mkConsensusTracers configReflection trBase trForward mbTrEKG _trDataPoint trConfig nodeKernel = do
mkConsensusTracers configReflection trBase trForward mbTrEKG _trDataPoint trConfig _nodeKernel = do
!chainSyncClientTr <- mkCardanoTracer
trBase trForward mbTrEKG
["ChainSync", "Client"]
Expand Down Expand Up @@ -301,10 +306,9 @@ mkConsensusTracers configReflection trBase trForward mbTrEKG _trDataPoint trConf
["Mempool"]
configureTracers configReflection trConfig [mempoolTr]

!forgeTr <- mkCardanoTracer'
!forgeTr <- mkCardanoTracer
trBase trForward mbTrEKG
["Forge", "Loop"]
(forgeTracerTransform nodeKernel)
configureTracers configReflection trConfig [forgeTr]

!forgeThreadStatsTr <- mkCardanoTracer'
Expand Down Expand Up @@ -363,9 +367,9 @@ mkConsensusTracers configReflection trBase trForward mbTrEKG _trDataPoint trConf
, Consensus.mempoolTracer = Tracer $
traceWith mempoolTr
, Consensus.forgeTracer =
Tracer (\(Consensus.TraceLabelCreds _ x) -> traceWith (contramap Left forgeTr) x)
Tracer (\(Consensus.TraceLabelCreds _ x) -> traceWith forgeTr x)
<>
Tracer (\(Consensus.TraceLabelCreds _ x) -> traceWith (contramap Left forgeThreadStatsTr) x)
Tracer (\(Consensus.TraceLabelCreds _ x) -> traceWith forgeThreadStatsTr x)
, Consensus.blockchainTimeTracer = Tracer $
traceWith blockchainTimeTr
, Consensus.keepAliveClientTracer = Tracer $
Expand Down
1 change: 1 addition & 0 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/ChainDB.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

module Cardano.Node.Tracing.Tracers.ChainDB
( withAddedToCurrentChainEmptyLimited
, fragmentChainDensity
) where

import Cardano.Logging
Expand Down
Loading
Loading