From 3cda6f46aebea89a18f783607c2f0ed4c93e182d Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Tue, 22 Nov 2022 11:22:05 +0100 Subject: [PATCH] Upgrade to ouroboros-network-0.3.0.0 --- cabal.project | 22 ++++++++++++++++++- cardano-api/cardano-api.cabal | 2 +- cardano-node/cardano-node.cabal | 4 ++-- .../Cardano/Node/Tracing/Tracers/Consensus.hs | 3 ++- .../Tracing/OrphanInstances/Network.hs | 9 +++++++- cardano-submit-api/cardano-submit-api.cabal | 2 +- flake.lock | 6 ++--- 7 files changed, 38 insertions(+), 10 deletions(-) diff --git a/cabal.project b/cabal.project index aa52a5ec84e..9661dd412d2 100644 --- a/cabal.project +++ b/cabal.project @@ -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 @@ -109,6 +109,26 @@ constraints: , io-classes == 0.3.0.0 , typed-protocols == 0.1.0.1 , typed-protocols-examples == 0.1.0.1 + , cardano-ledger-alonzo == 0.1.0.0 + , cardano-ledger-babbage == 0.1.0.0 + , cardano-ledger-byron == 0.1.0.0 + , cardano-ledger-byron-test == 1.3.0 + , cardano-ledger-conway == 0.1.0.0 + , cardano-ledger-core == 0.1.0.0 + , cardano-ledger-pretty == 0.1.0.0 + , cardano-ledger-shelley == 0.1.0.0 + , cardano-ledger-shelley-ma == 0.1.0.0 + , cardano-ledger-shelley-test == 0.1.0.0 + , cardano-crypto-test == 1.3.0 + , cardano-crypto-wrapper == 1.3.0 + , byron-spec-chain == 0.1.0.0 + , byron-spec-ledger == 0.1.0.0 + , set-algebra == 0.1.0.0 + , small-steps == 0.1.0.0 + , small-steps-test == 0.1.0.0 + , vector-map == 0.1.0.0 + , cardano-data == 0.1.0.0 + extra-packages: ouroboros-consensus-cardano-tools == 0.1.0.1 diff --git a/cardano-api/cardano-api.cabal b/cardano-api/cardano-api.cabal index a45fafe19a5..3d7d3c288b3 100644 --- a/cardano-api/cardano-api.cabal +++ b/cardano-api/cardano-api.cabal @@ -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 diff --git a/cardano-node/cardano-node.cabal b/cardano-node/cardano-node.cabal index 5ce1f7c41c9..647e4a29375 100644 --- a/cardano-node/cardano-node.cabal +++ b/cardano-node/cardano-node.cabal @@ -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 diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs index c90b0fad693..68ad2322a22 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs @@ -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: diff --git a/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs b/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs index 2e9dc9e4353..2dce97a9383 100644 --- a/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs +++ b/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs @@ -1098,17 +1098,24 @@ instance ToObject SlotNo where mconcat [ "kind" .= String "SlotNo" , "slot" .= toJSON (unSlotNo slot) ] +instance ToJSON PeerGSV where + toJSON PeerGSV { outboundGSV = GSV outboundG _ _ + , inboundGSV = GSV inboundG _ _ + } = + Aeson.object ["G" .= (realToFrac (outboundG + inboundG) :: Double)] + 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: diff --git a/cardano-submit-api/cardano-submit-api.cabal b/cardano-submit-api/cardano-submit-api.cabal index 9e9412a5831..ecd736dc5b6 100644 --- a/cardano-submit-api/cardano-submit-api.cabal +++ b/cardano-submit-api/cardano-submit-api.cabal @@ -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 } diff --git a/flake.lock b/flake.lock index 63bd4f30e2d..9ff0eb8ee1d 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1666962180, - "narHash": "sha256-4KKdmTO9vjUtLN30dPwkWF+6265crSG979HhB/oA3l4=", + "lastModified": 1669289866, + "narHash": "sha256-dnRYWjYZQuNJLXsn5PdcMBPaReDYVARqc8a2grokVZ0=", "owner": "input-output-hk", "repo": "cardano-haskell-packages", - "rev": "cf9503f9592fa26294df728400a4430e508b5774", + "rev": "c3cebaddd8b60c0b5bcef6d895adb30a79f495a8", "type": "github" }, "original": {