Skip to content

Commit

Permalink
Merge #3822
Browse files Browse the repository at this point in the history
3822: cardano-node: Remove unused constraints from TraceConstraints r=jutaro a=jutaro



Co-authored-by: Yupanqui <[email protected]>
  • Loading branch information
iohk-bors[bot] and jutaro authored May 3, 2022
2 parents 567ee70 + 0e2c3a6 commit 4ef56ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
26 changes: 3 additions & 23 deletions cardano-node/src/Cardano/Node/TraceConstraints.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{-# LANGUAGE FlexibleContexts #-}
module Cardano.Node.TraceConstraints (TraceConstraints) where

import Prelude (Show)

import Data.Aeson

Expand All @@ -12,22 +11,14 @@ import Cardano.Logging (LogFormatting)
import Cardano.Node.Queries (ConvertTxId, GetKESInfo (..), HasKESInfo (..),
HasKESMetricsData (..), LedgerQueries)

import Cardano.Ledger.Alonzo (AlonzoEra)
import Cardano.Ledger.Alonzo.Rules.Bbody (AlonzoBbodyPredFail)
import Cardano.Ledger.Alonzo.Rules.Utxo (UtxoPredicateFailure)
import Cardano.Ledger.Alonzo.Rules.Utxow (UtxowPredicateFail)
import Cardano.Ledger.Crypto (StandardCrypto)

import Ouroboros.Consensus.Block (BlockProtocol, CannotForge, ConvertRawHash,
import Ouroboros.Consensus.Block (BlockProtocol, CannotForge,
ForgeStateUpdateError, Header)
import Ouroboros.Consensus.HeaderValidation (OtherHeaderEnvelopeError)
import Ouroboros.Consensus.Ledger.Abstract (LedgerError)
import Ouroboros.Consensus.Ledger.Inspect (LedgerEvent, LedgerUpdate, LedgerWarning)
import Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr, HasTxId, HasTxs (..))
import Ouroboros.Consensus.Protocol.Abstract (ValidationErr)
import Ouroboros.Consensus.Shelley.Ledger.Mempool (GenTx, TxId)
import qualified Ouroboros.Consensus.Storage.ChainDB as ChainDB
import Ouroboros.Network.Block (StandardHash)


-- | Tracing-related constraints for monitoring purposes.
Expand All @@ -36,14 +27,10 @@ type TraceConstraints blk =
, HasTxs blk
, HasTxId (GenTx blk)
, LedgerQueries blk
, StandardHash blk
, ToJSON (TxId (GenTx blk))
, HasKESMetricsData blk
, HasKESInfo blk
, ConvertRawHash blk
, GetKESInfo blk
, Show blk
, Show (Header blk)

, ToObject (ApplyTxErr blk)
, ToObject (GenTx blk)
Expand All @@ -54,22 +41,15 @@ type TraceConstraints blk =
, ToObject (ValidationErr (BlockProtocol blk))
, ToObject (CannotForge blk)
, ToObject (ForgeStateUpdateError blk)
, ToObject (UtxoPredicateFailure (AlonzoEra StandardCrypto))
, ToObject (AlonzoBbodyPredFail (AlonzoEra StandardCrypto))
, ToObject (UtxowPredicateFail (AlonzoEra StandardCrypto))

, LogFormatting (LedgerUpdate blk)
, LogFormatting (LedgerWarning blk)
, LogFormatting (ApplyTxErr blk)
, LogFormatting (GenTx blk)
, LogFormatting (Header blk)
, LogFormatting (ChainDB.InvalidBlockReason blk)
, LogFormatting (LedgerError blk)
, LogFormatting (LedgerUpdate blk)
, LogFormatting (LedgerWarning blk)
, LogFormatting (OtherHeaderEnvelopeError blk)
, LogFormatting (ValidationErr (BlockProtocol blk))
, LogFormatting (CannotForge blk)
, LogFormatting (ForgeStateUpdateError blk)
, LogFormatting (UtxoPredicateFailure (AlonzoEra StandardCrypto))
, LogFormatting (AlonzoBbodyPredFail (AlonzoEra StandardCrypto))
, LogFormatting (UtxowPredicateFail (AlonzoEra StandardCrypto))
)
2 changes: 1 addition & 1 deletion cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ namesForChainSyncClientEvent' TraceException {} =
namesForChainSyncClientEvent' TraceTermination {} =
["Termination"]

instance (Show (Header blk), ConvertRawHash blk, LedgerSupportsProtocol blk)
instance (ConvertRawHash blk, LedgerSupportsProtocol blk)
=> LogFormatting (TraceChainSyncClientEvent blk) where
forHuman (TraceDownloadedHeader pt) =
"While following a candidate chain, we rolled forward by downloading a\
Expand Down

0 comments on commit 4ef56ae

Please sign in to comment.