Skip to content

Commit

Permalink
WIP: Upgrade to ouroboros-network-0.3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
coot committed Nov 24, 2022
1 parent 2c24d1b commit 80f863d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repository cardano-haskell-packages
-- See CONTRIBUTING for information about these, including some Nix commands
-- you need to run if you change them
index-state: 2022-09-27T00:00:00Z
index-state: cardano-haskell-packages 2022-11-10T12:59:24Z
index-state: cardano-haskell-packages 2022-11-24T00:00:00Z

packages:
cardano-api
Expand Down
2 changes: 1 addition & 1 deletion cardano-api/cardano-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ library
, ouroboros-consensus-cardano
, ouroboros-consensus-protocol
, ouroboros-consensus-shelley
, ouroboros-network ^>= 0.2
, ouroboros-network ^>= 0.3
, ouroboros-network-framework ^>= 0.2
, parsec
, plutus-ledger-api
Expand Down
4 changes: 2 additions & 2 deletions cardano-node/cardano-node.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ library
, network-mux ^>= 0.2
, nothunks
, optparse-applicative-fork
, ouroboros-consensus ^>= 0.1.0.2
, ouroboros-consensus ^>= 0.1.0.3
, ouroboros-consensus-byron
, ouroboros-consensus-cardano
, ouroboros-consensus-protocol
, ouroboros-consensus-shelley
, ouroboros-network ^>= 0.2
, ouroboros-network ^>= 0.3
, ouroboros-network-framework ^>= 0.2
, psqueues
, safe-exceptions
Expand Down
3 changes: 2 additions & 1 deletion cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -561,11 +561,12 @@ instance (HasHeader header, ConvertRawHash header) =>
mconcat [ "kind" .= String "AddedFetchRequest" ]
forMachine _dtal BlockFetch.AcknowledgedFetchRequest {} =
mconcat [ "kind" .= String "AcknowledgedFetchRequest" ]
forMachine _dtal (BlockFetch.SendFetchRequest af) =
forMachine _dtal (BlockFetch.SendFetchRequest af gsv) =
mconcat [ "kind" .= String "SendFetchRequest"
, "head" .= String (renderChainHash
(renderHeaderHash (Proxy @header))
(AF.headHash af))
, "deltaq" .= toJSON gsv
, "length" .= toJSON (fragmentLength af)]
where
-- NOTE: this ignores the Byron era with its EBB complication:
Expand Down
16 changes: 15 additions & 1 deletion cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1098,17 +1098,31 @@ instance ToObject SlotNo where
mconcat [ "kind" .= String "SlotNo"
, "slot" .= toJSON (unSlotNo slot) ]

instance ToJSON PeerGSV where
toJSON PeerGSV { sampleTime, outboundGSV, inboundGSV } =
Aeson.object [ "time" .= String (pack . show $ sampleTime)
, "outboundGSV" .= toJSON outboundGSV
, "inboundGSV" .= toJSON inboundGSV
]

instance ToJSON GSV where
toJSON (GSV g _s _v) =
-- TODO: show v
Aeson.object [ "g" .= String (pack . show $ g)
]

instance (HasHeader header, ConvertRawHash header)
=> ToObject (TraceFetchClientState header) where
toObject _verb BlockFetch.AddedFetchRequest {} =
mconcat [ "kind" .= String "AddedFetchRequest" ]
toObject _verb BlockFetch.AcknowledgedFetchRequest {} =
mconcat [ "kind" .= String "AcknowledgedFetchRequest" ]
toObject _verb (BlockFetch.SendFetchRequest af) =
toObject _verb (BlockFetch.SendFetchRequest af gsv) =
mconcat [ "kind" .= String "SendFetchRequest"
, "head" .= String (renderChainHash
(renderHeaderHash (Proxy @header))
(AF.headHash af))
, "deltaq" .= toJSON gsv
, "length" .= toJSON (fragmentLength af)]
where
-- NOTE: this ignores the Byron era with its EBB complication:
Expand Down
2 changes: 1 addition & 1 deletion cardano-submit-api/cardano-submit-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ common mtl { build-depends: mtl
common network { build-depends: network >= 3.1.2.1 }
common optparse-applicative-fork { build-depends: optparse-applicative-fork >= 0.16.1.0 }
common ouroboros-consensus-cardano { build-depends: ouroboros-consensus-cardano >= 0.1.0.0 }
common ouroboros-network { build-depends: ouroboros-network >= 0.1.0.0 }
common ouroboros-network { build-depends: ouroboros-network >= 0.3.0.0 }
common prometheus { build-depends: prometheus >= 2.2.2 }
common protolude { build-depends: protolude >= 0.3.0 }
common servant { build-depends: servant >= 0.18.2 }
Expand Down

0 comments on commit 80f863d

Please sign in to comment.