Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
crocodile-dentist committed Sep 27, 2024
1 parent 2959eaa commit 8d953dd
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cardano-node/src/Cardano/Node/Tracing/Era/Shelley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ instance LogFormatting (Set (Credential 'Staking StandardCrypto)) where
]

instance LogFormatting (NonEmpty.NonEmpty (KeyHash 'Staking StandardCrypto)) where
forMachine _dtal what = undefined
forMachine _dtal _what = undefined
-- mconcat [ "kind" .= String "StakeCreds"
-- , "stakeCreds" .= map toJSON (Set.toList creds)
-- ]
Expand Down
5 changes: 2 additions & 3 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module Cardano.Node.Tracing.Tracers.Consensus
) where


import Ouroboros.Consensus.Ledger.SupportsMempool
import Cardano.Logging
import Cardano.Node.Queries (HasKESInfo (..))
import Cardano.Node.Tracing.Era.Byron ()
Expand All @@ -41,7 +40,7 @@ import Ouroboros.Consensus.Cardano.Block
import Ouroboros.Consensus.Genesis.Governor (DensityBounds (..), TraceGDDEvent (..), GDDDebugInfo (..))
import Ouroboros.Consensus.Ledger.Inspect (LedgerEvent (..), LedgerUpdate, LedgerWarning)
import Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr, GenTxId, HasTxId,
LedgerSupportsMempool, txForgetValidated, txId, ByteSize32 (unByteSize32))
LedgerSupportsMempool, txForgetValidated, txId, ByteSize32 (..))
import Ouroboros.Consensus.Ledger.SupportsProtocol
import Ouroboros.Consensus.Mempool (MempoolSize (..), TraceEventMempool (..))
import Ouroboros.Consensus.MiniProtocol.BlockFetch.Server
Expand Down Expand Up @@ -922,7 +921,7 @@ instance ( LogFormatting peer
)
]

forMachine dtal (TraceGDDDisconnected peers) = undefined
forMachine _dtal (TraceGDDDisconnected _peers) = undefined

forHuman = forHumanOrMachine

Expand Down
1 change: 1 addition & 0 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/Startup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,7 @@ nodeToClientVersionToInt = \case
NodeToClientV_15 -> 15
NodeToClientV_16 -> 16
NodeToClientV_17 -> 17
NodeToClientV_18 -> 18

nodeToNodeVersionToInt :: NodeToNodeVersion -> Int
nodeToNodeVersionToInt = \case
Expand Down
8 changes: 3 additions & 5 deletions cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

module Cardano.Tracing.OrphanInstances.Consensus () where

import Ouroboros.Consensus.Ledger.SupportsMempool
import Cardano.Node.Tracing.Tracers.ConsensusStartupException
(ConsensusStartupException (..))
import Cardano.Prelude (maximumDef)
Expand All @@ -41,7 +40,7 @@ import Ouroboros.Consensus.Ledger.Extended
import Ouroboros.Consensus.Ledger.Inspect (InspectLedger, LedgerEvent (..), LedgerUpdate,
LedgerWarning)
import Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr, GenTx, GenTxId, HasTxId,
LedgerSupportsMempool, TxId, txForgetValidated, txId)
LedgerSupportsMempool, TxId, txForgetValidated, txId, ByteSize32 (..))
import Ouroboros.Consensus.Ledger.SupportsProtocol (LedgerSupportsProtocol)
import Ouroboros.Consensus.Mempool (MempoolSize (..), TraceEventMempool (..))
import Ouroboros.Consensus.MiniProtocol.BlockFetch.Server
Expand Down Expand Up @@ -79,7 +78,6 @@ import Ouroboros.Network.BlockFetch.ClientState (TraceLabelPeer (..))
import Ouroboros.Network.Point (withOrigin)
import Ouroboros.Network.SizeInBytes (SizeInBytes (..))

import Control.Monad (guard)
import Data.Aeson (Value (..))
import qualified Data.Aeson as Aeson
import Data.Data (Proxy (..))
Expand Down Expand Up @@ -590,7 +588,7 @@ instance ( ConvertRawHash blk
ChainDB.TraceLedgerReplayEvent ev -> case ev of
LedgerDB.ReplayFromGenesis _replayTo ->
"Replaying ledger from genesis"
LedgerDB.ReplayFromSnapshot _ tip' _ ->
LedgerDB.ReplayFromSnapshot _ _tip' _ ->
"Replaying ledger from snapshot at " <>
undefined -- renderRealPointAsPhrase undefined -- tip'
LedgerDB.ReplayedBlock pt _ledgerEvents (LedgerDB.ReplayStart replayFrom) (LedgerDB.ReplayGoal replayTo) ->
Expand Down Expand Up @@ -1706,7 +1704,7 @@ instance (ToObject peer, ConvertRawHash blk, GetHeader blk) => Transformable Tex

instance (ToObject peer, ConvertRawHash blk, GetHeader blk) => ToObject (TraceGDDEvent peer blk) where
-- toObject verb TraceGDDEvent {..} = mconcat $
toObject verb _aaa = undefined
toObject _verb _aaa = undefined
-- [ "kind" .= String "TraceGDDEvent"
-- , "losingPeers".= toJSON (map (toObject verb) losingPeers)
-- , "loeHead" .= toObject verb loeHead
Expand Down
5 changes: 5 additions & 0 deletions cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2198,6 +2198,8 @@ instance ToJSON NodeToClientVersion where
toJSON NodeToClientV_15 = Number 15
toJSON NodeToClientV_16 = Number 16
toJSON NodeToClientV_17 = Number 17
toJSON NodeToClientV_18 = Number 18
-- NB: When adding a new version here, update FromJSON below as well!

instance FromJSON NodeToClientVersion where
parseJSON (Number 9) = return NodeToClientV_9
Expand All @@ -2207,6 +2209,9 @@ instance FromJSON NodeToClientVersion where
parseJSON (Number 13) = return NodeToClientV_13
parseJSON (Number 14) = return NodeToClientV_14
parseJSON (Number 15) = return NodeToClientV_15
parseJSON (Number 16) = return NodeToClientV_16
parseJSON (Number 17) = return NodeToClientV_17
parseJSON (Number 18) = return NodeToClientV_18
parseJSON (Number x) = fail ("FromJSON.NodeToClientVersion: unsupported node-to-client protocol version " ++ show x)
parseJSON x = fail ("FromJSON.NodeToClientVersion: error parsing NodeToClientVersion: " ++ show x)

Expand Down
8 changes: 6 additions & 2 deletions cardano-node/src/Cardano/Tracing/OrphanInstances/Shelley.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

module Cardano.Tracing.OrphanInstances.Shelley () where

import qualified Data.List.NonEmpty as NonEmpty
import Cardano.Api (textShow)
import qualified Cardano.Api.Shelley as Api

Expand Down Expand Up @@ -229,7 +228,7 @@ instance ToObject (Set (Credential 'Staking StandardCrypto)) where
]

instance ToObject (NonEmpty.NonEmpty (KeyHash 'Staking StandardCrypto)) where
toObject _verb what =
toObject _verb _what =
mconcat [ "kind" .= String "what"
-- , "stakeCreds" .= toObject "what"
]
Expand Down Expand Up @@ -403,6 +402,11 @@ instance Ledger.EraPParams era => ToObject (Conway.ConwayGovPredFailure era) whe
, "votes" .= votes
]

toObject _ (Conway.ZeroTreasuryWithdrawals govAction) =
mconcat [ "kind" .= String "ZeroTreasuryWithdrawals"
, "govAction" .= govAction
]

instance
( Core.Crypto (Consensus.EraCrypto era)
, ToObject (PredicateFailure (Ledger.EraRule "CERT" era))
Expand Down
3 changes: 1 addition & 2 deletions cardano-node/src/Cardano/Tracing/Tracers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ module Cardano.Tracing.Tracers
, traceCounter
) where

import Ouroboros.Consensus.Ledger.SupportsMempool
import Cardano.BM.Data.Aggregated (Measurable (..))
import Cardano.BM.Data.Tracer (WithSeverity (..), annotateSeverity)
import Cardano.BM.Data.Transformers
Expand Down Expand Up @@ -72,7 +71,7 @@ import Ouroboros.Consensus.Ledger.Extended (ledgerState)
import Ouroboros.Consensus.Ledger.Inspect (InspectLedger, LedgerEvent)
import Ouroboros.Consensus.Ledger.Query (BlockQuery)
import Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr, GenTx, GenTxId, HasTxs,
LedgerSupportsMempool)
LedgerSupportsMempool, ByteSize32 (..))
import Ouroboros.Consensus.Ledger.SupportsProtocol (LedgerSupportsProtocol)
import Ouroboros.Consensus.Mempool (MempoolSize (..), TraceEventMempool (..))
import Ouroboros.Consensus.MiniProtocol.BlockFetch.Server
Expand Down

0 comments on commit 8d953dd

Please sign in to comment.