Skip to content

Commit

Permalink
integration work
Browse files Browse the repository at this point in the history
  • Loading branch information
Jared Corduan authored and disassembler committed May 31, 2023
1 parent 43f9303 commit e6a5043
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
6 changes: 0 additions & 6 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/ChainDB.hs
Expand Up @@ -92,7 +92,6 @@ instance ( LogFormatting (Header blk)
forHuman (ChainDB.TraceLedgerReplayEvent v) = forHuman v
forHuman (ChainDB.TraceImmutableDBEvent v) = forHuman v
forHuman (ChainDB.TraceVolatileDBEvent v) = forHuman v
forHuman (ChainDB.TraceLedgerEvent v) = forHuman v

forMachine details (ChainDB.TraceAddBlockEvent v) =
forMachine details v
Expand All @@ -116,8 +115,6 @@ instance ( LogFormatting (Header blk)
forMachine details v
forMachine details (ChainDB.TraceVolatileDBEvent v) =
forMachine details v
forMachine details (ChainDB.TraceLedgerEvent v) =
forMachine details v

asMetrics (ChainDB.TraceAddBlockEvent v) = asMetrics v
asMetrics (ChainDB.TraceFollowerEvent v) = asMetrics v
Expand All @@ -130,7 +127,6 @@ instance ( LogFormatting (Header blk)
asMetrics (ChainDB.TraceLedgerReplayEvent v) = asMetrics v
asMetrics (ChainDB.TraceImmutableDBEvent v) = asMetrics v
asMetrics (ChainDB.TraceVolatileDBEvent v) = asMetrics v
asMetrics (ChainDB.TraceLedgerEvent v) = asMetrics v


instance MetaTrace (ChainDB.TraceEvent blk) where
Expand All @@ -156,8 +152,6 @@ instance MetaTrace (ChainDB.TraceEvent blk) where
nsPrependInner "ImmDbEvent" (namespaceFor ev)
namespaceFor (ChainDB.TraceVolatileDBEvent ev) =
nsPrependInner "VolatileDbEvent" (namespaceFor ev)
namespaceFor (ChainDB.TraceLedgerEvent ev) =
nsPrependInner "TraceLedgerEvent" (namespaceFor ev)

severityFor (Namespace out ("AddBlockEvent" : tl)) (Just (ChainDB.TraceAddBlockEvent ev')) =
severityFor (Namespace out tl) (Just ev')
Expand Down
2 changes: 2 additions & 0 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs
Expand Up @@ -406,6 +406,7 @@ nodeToClientVersionToInt = \case
NodeToClientV_13 -> 13
NodeToClientV_14 -> 14
NodeToClientV_15 -> 15
NodeToClientV_16 -> 16

nodeToNodeVersionToInt :: NodeToNodeVersion -> Int
nodeToNodeVersionToInt = \case
Expand All @@ -414,6 +415,7 @@ nodeToNodeVersionToInt = \case
NodeToNodeV_9 -> 9
NodeToNodeV_10 -> 10
NodeToNodeV_11 -> 11
NodeToNodeV_12 -> 12

-- | Pretty print 'StartupInfoTrace'
--
Expand Down
5 changes: 0 additions & 5 deletions cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs
Expand Up @@ -120,7 +120,6 @@ instance ConvertRawHash blk => ConvertRawHash (Header blk) where

instance HasPrivacyAnnotation (ChainDB.TraceEvent blk)
instance HasSeverityAnnotation (ChainDB.TraceEvent blk) where
getSeverityAnnotation (ChainDB.TraceLedgerEvent _ev) = Debug
getSeverityAnnotation (ChainDB.TraceAddBlockEvent ev) = case ev of
ChainDB.IgnoreBlockOlderThanK {} -> Info
ChainDB.IgnoreBlockAlreadyInVolatileDB {} -> Info
Expand Down Expand Up @@ -466,7 +465,6 @@ instance ( ConvertRawHash blk
, InspectLedger blk)
=> HasTextFormatter (ChainDB.TraceEvent blk) where
formatText tev _obj = case tev of
ChainDB.TraceLedgerEvent _ev -> "TraceLedgerEvent"
ChainDB.TraceAddBlockEvent ev -> case ev of
ChainDB.IgnoreBlockOlderThanK pt ->
"Ignoring block older than K: " <> renderRealPointAsPhrase pt
Expand Down Expand Up @@ -971,9 +969,6 @@ instance ( ConvertRawHash blk
chainLengthΔ :: AF.AnchoredFragment (Header blk) -> AF.AnchoredFragment (Header blk) -> Int
chainLengthΔ = on (-) (fromWithOrigin (-1) . fmap (fromIntegral . unBlockNo) . AF.headBlockNo)

toObject _verb (ChainDB.TraceLedgerEvent _ev) =
mconcat [ "kind" .= String "TraceLedgerEvent" ]

toObject MinimalVerbosity (ChainDB.TraceLedgerReplayEvent _ev) = mempty -- no output
toObject verb (ChainDB.TraceLedgerReplayEvent ev) = case ev of
LedgerDB.ReplayFromGenesis _replayTo ->
Expand Down
2 changes: 2 additions & 0 deletions cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs
Expand Up @@ -1776,6 +1776,7 @@ instance ToJSON NodeToNodeVersion where
toJSON NodeToNodeV_9 = Number 9
toJSON NodeToNodeV_10 = Number 10
toJSON NodeToNodeV_11 = Number 11
toJSON NodeToNodeV_12 = Number 12

instance FromJSON NodeToNodeVersion where
parseJSON (Number 7) = return NodeToNodeV_7
Expand All @@ -1794,6 +1795,7 @@ instance ToJSON NodeToClientVersion where
toJSON NodeToClientV_13 = Number 13
toJSON NodeToClientV_14 = Number 14
toJSON NodeToClientV_15 = Number 15
toJSON NodeToClientV_16 = Number 16

instance FromJSON NodeToClientVersion where
parseJSON (Number 9) = return NodeToClientV_9
Expand Down

0 comments on commit e6a5043

Please sign in to comment.