Skip to content

Commit f7ec359

Browse files
authored
Merge pull request #6621 from IntersectMBO/bladyjoker/leios-prototype/2026w29
Leios prototype 2026w29
2 parents 584c8da + 66736cf commit f7ec359

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

cabal.project

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ allow-newer:
8787
source-repository-package
8888
type: git
8989
location: https://github.com/IntersectMBO/ouroboros-consensus
90-
tag: e013c2003613af1bf675350572fa0b6752ae56ea
91-
--sha256: sha256-/oCh0+NNMtXnM+9BUkyquC/PsLMxV40Zoh++OE9fmek=
90+
tag: a7fa6b6f6888272e76e32a7aeb1f82776e1142ec
91+
--sha256: sha256-MiECfkFw7tjHuQsCQuWTXeLqodIrStjt3TY9rE/rHf8=
9292

9393
-- Points to ouroboros-ledger/leios-prototype
9494
source-repository-package

cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ import Network.TypedProtocol.Core
8787

8888
import LeiosDemoTypes (TraceLeiosKernel (..), TraceLeiosPeer (..),
8989
traceLeiosKernelToObject, traceLeiosPeerToObject)
90+
import LeiosUtils.CallTrace (SomeJsonCallTrace (..), callTraceToObject)
9091

9192
enclosingValue :: ToJSON a => Enclosing' a -> Value
9293
enclosingValue RisingEdge = object [ "edge" .= String "Starting" ]
@@ -1447,6 +1448,8 @@ instance ( tx ~ GenTx blk
14471448
(blockHash blk)
14481449
, "blockSize" .= toJSON (getSizeInBytes $ estimateBlockSize (getHeader blk))
14491450
]
1451+
forMachine _dtal (TraceCall (SomeJsonCallTrace ct)) =
1452+
callTraceToObject ct
14501453

14511454
forHuman (TraceStartLeadershipCheck slotNo) =
14521455
"Checking for leadership in slot " <> showT (unSlotNo slotNo)
@@ -1522,6 +1525,8 @@ instance ( tx ~ GenTx blk
15221525
"Adoption thread died in slot "
15231526
<> showT (unSlotNo slotNo)
15241527
<> ": " <> renderHeaderHash (Proxy @blk) (blockHash blk)
1528+
forHuman (TraceCall someJsonCallTrace) =
1529+
"Call trace: " <> showT someJsonCallTrace
15251530

15261531
asMetrics (TraceForgeStateUpdateError slot reason) =
15271532
IntM "Forge.StateUpdateError" (fromIntegral $ unSlotNo slot) :
@@ -1575,6 +1580,7 @@ instance ( tx ~ GenTx blk
15751580
[CounterM "Forge.adopted" Nothing]
15761581
asMetrics (TraceAdoptionThreadDied _slot _) =
15771582
[CounterM "Forge.adoption-thread-died" Nothing]
1583+
asMetrics (TraceCall _) = []
15781584

15791585
instance MetaTrace (TraceForgeEvent blk) where
15801586
namespaceFor TraceStartLeadershipCheck {} =
@@ -1615,6 +1621,8 @@ instance MetaTrace (TraceForgeEvent blk) where
16151621
Namespace [] ["AdoptedBlock"]
16161622
namespaceFor TraceAdoptionThreadDied {} =
16171623
Namespace [] ["AdoptionThreadDied"]
1624+
namespaceFor TraceCall {} =
1625+
Namespace [] ["Call"]
16181626

16191627
severityFor (Namespace _ ["StartLeadershipCheck"]) _ = Just Info
16201628
severityFor (Namespace _ ["SlotIsImmutable"]) _ = Just Error
@@ -1635,6 +1643,7 @@ instance MetaTrace (TraceForgeEvent blk) where
16351643
severityFor (Namespace _ ["ForgedInvalidBlock"]) _ = Just Error
16361644
severityFor (Namespace _ ["AdoptedBlock"]) _ = Just Info
16371645
severityFor (Namespace _ ["AdoptionThreadDied"]) _ = Just Error
1646+
severityFor (Namespace _ ["Call"]) _ = Just Debug
16381647
severityFor _ _ = Nothing
16391648

16401649
privacyFor (Namespace _ ["ForgeStateUpdateError"]) _ = Just Confidential
@@ -1818,6 +1827,10 @@ instance MetaTrace (TraceForgeEvent blk) where
18181827
]
18191828
documentFor (Namespace _ ["AdoptionThreadDied"]) = Just $ mconcat
18201829
[ "Block adoption thread died" ]
1830+
documentFor (Namespace _ ["Call"]) = Just $ mconcat
1831+
[ "A call/span trace event, recording the start or end (with duration and"
1832+
, " allocation measurements) of an instrumented call."
1833+
]
18211834
documentFor _ = Nothing
18221835

18231836
allNamespaces =
@@ -1840,6 +1853,7 @@ instance MetaTrace (TraceForgeEvent blk) where
18401853
, Namespace [] ["ForgedInvalidBlock"]
18411854
, Namespace [] ["AdoptedBlock"]
18421855
, Namespace [] ["AdoptionThreadDied"]
1856+
, Namespace [] ["Call"]
18431857
]
18441858

18451859
--------------------------------------------------------------------------------
@@ -2341,6 +2355,9 @@ instance LogFormatting TraceLeiosKernel where
23412355
"Leios not voted for " <> Text.pack (show ebPoint) <> ": " <> Text.pack (show reason)
23422356
TraceLeiosDbException e -> "Leios DB exception: " <> Text.pack (show e)
23432357
TraceLeiosDb ev -> "Leios DB event: " <> Text.pack (show ev)
2358+
TraceLeiosCertifiedAndAnnounced{atSlot, rbHash} ->
2359+
"Leios cert assembled and EB announced in RB " <> Text.pack (show rbHash)
2360+
<> " at slot " <> showT atSlot
23442361
asMetrics _ = []
23452362

23462363
instance MetaTrace TraceLeiosKernel where
@@ -2358,6 +2375,7 @@ instance MetaTrace TraceLeiosKernel where
23582375
namespaceFor TraceLeiosNotVoted{} = Namespace [] ["NotVoted"]
23592376
namespaceFor TraceLeiosDbException{} = Namespace [] ["DbException"]
23602377
namespaceFor TraceLeiosDb{} = Namespace [] ["Db"]
2378+
namespaceFor TraceLeiosCertifiedAndAnnounced{} = Namespace [] ["CertifiedAndAnnounced"]
23612379

23622380
severityFor (Namespace _ ["DbException"]) _ = Just Error
23632381
severityFor (Namespace _ ["BlockPointMissing"]) _ = Just Warning
@@ -2380,6 +2398,7 @@ instance MetaTrace TraceLeiosKernel where
23802398
, Namespace [] ["NotVoted"]
23812399
, Namespace [] ["DbException"]
23822400
, Namespace [] ["Db"]
2401+
, Namespace [] ["CertifiedAndAnnounced"]
23832402
]
23842403

23852404
instance LogFormatting TraceLeiosPeer where

0 commit comments

Comments
 (0)