Skip to content

Commit b34333f

Browse files
committed
Stealing tracers from #6333
1 parent 92c6ba7 commit b34333f

File tree

8 files changed

+272
-48
lines changed

8 files changed

+272
-48
lines changed

cabal.project

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,23 @@ allow-newer:
6767
source-repository-package
6868
type: git
6969
location: https://github.com/intersectmbo/cardano-cli.git
70-
tag: 7bd43cbdb9f6602d907d9390afec96cd2610dc28
71-
--sha256: 19ddnqkc1m1l9fcmr7jrx26qcgyidnddpkm9alfw33slvqsb2p4b
70+
tag: 31a971727615cc2a7b2606aea684941e09b13e63
71+
--sha256: sha256-ATAOoKnb4FuLOeIuqyz7V6yEV8kAqH9/dBauD9ep8U8=
7272
subdir: cardano-cli
7373

7474
source-repository-package
7575
type: git
7676
location: https://github.com/IntersectMBO/cardano-api
77-
tag: 7c4d6483f2eb49e4ce924333e55169cede3c9463
78-
--sha256: 04ns5irf78fp3q5qrw8i2mra411aa4d8mwnx3x5fv85cx4mn5gw7
77+
tag: eb3fd13407eb2b432b7f952c60c72326612c2381
78+
--sha256: sha256-OWmSpbb45Vox9spaPumJ01WPnHr/bPW7OOlaj7iErYQ=
7979
subdir:
8080
cardano-api
8181

8282
source-repository-package
8383
type: git
8484
location: https://github.com/IntersectMBO/ouroboros-consensus
85-
tag: d25313283097fc946ee4350c53155d3b7969c722
86-
--sha256: 1rhxi1zrpmgqdxg2vin0ll57c6x3lh0j6xbf6vricx7x5q9rn7wc
85+
tag: 39904b54069934756a9f36dc8ace9d0aff36c738
86+
--sha256: sha256-J7M7g8bPuEAI8zIP5KoHFbWTkm1IZIFYN8dtFAPIKg8=
8787
subdir:
8888
ouroboros-consensus
8989
ouroboros-consensus-cardano

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)