Skip to content

Commit 52d5770

Browse files
committed
Stealing tracers from #6333
1 parent 4f9ebef commit 52d5770

File tree

7 files changed

+266
-42
lines changed

7 files changed

+266
-42
lines changed

cardano-node/src/Cardano/Node/TraceConstraints.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr, HasTxId
2323
import Ouroboros.Consensus.Node.NetworkProtocolVersion
2424
(HasNetworkProtocolVersion (BlockNodeToClientVersion, BlockNodeToNodeVersion))
2525
import Ouroboros.Consensus.Node.Run (RunNode, SerialiseNodeToNodeConstraints)
26+
import Ouroboros.Consensus.Peras.SelectView
2627
import Ouroboros.Consensus.Protocol.Abstract (SelectView, ValidationErr)
2728
import Ouroboros.Consensus.Shelley.Ledger.Mempool (GenTx, TxId)
2829
import Ouroboros.Network.Block (Serialised)
@@ -51,7 +52,7 @@ type TraceConstraints blk =
5152
, ToObject (LedgerError blk)
5253
, ToObject (LedgerEvent blk)
5354
, ToObject (OtherHeaderEnvelopeError blk)
54-
, ToObject (SelectView (BlockProtocol blk))
55+
, ToObject (WeightedSelectView (BlockProtocol blk))
5556
, ToObject (ValidationErr (BlockProtocol blk))
5657
, ToObject (CannotForge blk)
5758
, ToObject (ForgeStateUpdateError blk)
@@ -66,7 +67,7 @@ type TraceConstraints blk =
6667
, LogFormatting (LedgerUpdate blk)
6768
, LogFormatting (LedgerWarning blk)
6869
, LogFormatting (OtherHeaderEnvelopeError blk)
69-
, LogFormatting (SelectView (BlockProtocol blk))
70+
, LogFormatting (WeightedSelectView (BlockProtocol blk))
7071
, LogFormatting (ValidationErr (BlockProtocol blk))
7172
, LogFormatting (CannotForge blk)
7273
, LogFormatting (ForgeStateUpdateError blk)

cardano-node/src/Cardano/Node/Tracing/Era/HardFork.hs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import Cardano.Logging
1919
import Cardano.Slotting.Slot (EpochSize (..))
2020
import Cardano.Tracing.OrphanInstances.HardFork ()
2121
import Ouroboros.Consensus.Block (BlockProtocol, CannotForge, ForgeStateInfo,
22-
ForgeStateUpdateError)
22+
ForgeStateUpdateError, PerasWeight (..))
2323
import Ouroboros.Consensus.BlockchainTime (getSlotLength)
2424
import Ouroboros.Consensus.Cardano.Condense ()
2525
import Ouroboros.Consensus.HardFork.Combinator
@@ -36,7 +36,8 @@ import Ouroboros.Consensus.HeaderValidation (OtherHeaderEnvelopeError)
3636
import Ouroboros.Consensus.Ledger.Abstract (LedgerError)
3737
import Ouroboros.Consensus.Ledger.Inspect (LedgerUpdate, LedgerWarning)
3838
import Ouroboros.Consensus.Ledger.SupportsMempool (ApplyTxErr)
39-
import Ouroboros.Consensus.Protocol.Abstract (ValidationErr, TiebreakerView, SelectView(..))
39+
import Ouroboros.Consensus.Peras.SelectView
40+
import Ouroboros.Consensus.Protocol.Abstract (TiebreakerView, ValidationErr)
4041
import Ouroboros.Consensus.TypeFamilyWrappers
4142
import Ouroboros.Consensus.Util.Condense (Condense (..))
4243

@@ -352,10 +353,11 @@ instance LogFormatting (ForgeStateUpdateError blk) => LogFormatting (WrapForgeSt
352353
instance All (LogFormatting `Compose` WrapTiebreakerView) xs => LogFormatting (HardForkTiebreakerView xs) where
353354
forMachine dtal = forMachine dtal . getHardForkTiebreakerView
354355

355-
instance LogFormatting (TiebreakerView protocol) => LogFormatting (SelectView protocol) where
356+
instance LogFormatting (TiebreakerView protocol) => LogFormatting (WeightedSelectView protocol) where
356357
forMachine dtal sv = mconcat
357-
[ "blockNo" .= svBlockNo sv
358-
, forMachine dtal (svTiebreakerView sv)
358+
[ "blockNo" .= wsvBlockNo sv
359+
, "weightBoost" .= unPerasWeight (wsvWeightBoost sv)
360+
, forMachine dtal (wsvTiebreaker sv)
359361
]
360362

361363
instance All (LogFormatting `Compose` WrapTiebreakerView) xs => LogFormatting (OneEraTiebreakerView xs) where

0 commit comments

Comments
 (0)