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

cardano-node: Remove unused constraints from TraceConstraints #3822

Merged
merged 1 commit into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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))
)
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