From d186d40f1ec37093ed27f3bb735a1216f7f4b271 Mon Sep 17 00:00:00 2001 From: Thomas Winant Date: Tue, 12 Jan 2021 12:24:25 +0100 Subject: [PATCH] Update dependencies Note that this does not incorporate the latest changes in cardano-ledger-specs. Notable changes: * https://github.com/input-output-hk/ouroboros-network/pull/2807 * https://github.com/input-output-hk/ouroboros-network/pull/2811 * https://github.com/input-output-hk/ouroboros-network/pull/2832 network tracers: moved ToObject TxSubmission instance network tracers: added ToObjcet TxSubmission2 instance Update cabal.project index-state value --- cabal.project | 18 ++-- .../src/Cardano/CLI/Shelley/Orphans.hs | 1 - .../src/Cardano/CLI/Shelley/Run/Query.hs | 2 +- .../src/Cardano/Node/Configuration/Logging.hs | 3 - .../src/Cardano/Node/Protocol/Cardano.hs | 3 +- cardano-node/src/Cardano/Node/Query.hs | 2 - cardano-node/src/Cardano/Tracing/Config.hs | 9 +- .../Tracing/OrphanInstances/Network.hs | 99 ++++++++++++------- cardano-node/src/Cardano/Tracing/Tracers.hs | 2 + nix/sources.json | 36 ++----- 10 files changed, 87 insertions(+), 88 deletions(-) diff --git a/cabal.project b/cabal.project index 6f485a76ee8..84e6fdaf7bb 100644 --- a/cabal.project +++ b/cabal.project @@ -1,4 +1,4 @@ -index-state: 2020-12-11T00:00:00Z +index-state: 2021-01-08T00:00:00Z packages: cardano-api @@ -91,8 +91,8 @@ package io-sim-classes source-repository-package type: git location: https://github.com/input-output-hk/cardano-base - tag: 6a6ea9695ee898dd7d4fd7a5d2cc639d7d5764f7 - --sha256: 1hkq5i9fjjr4picx3plq3s09isrmx6jifpqf57c7viqfdrwlhjnj + tag: 4251c0bb6e4f443f00231d28f5f70d42876da055 + --sha256: 02a61ymvx054pcdcgvg5qj9kpybiajg993nr22iqiya196jmgciv subdir: binary binary/test @@ -104,14 +104,14 @@ source-repository-package source-repository-package type: git location: https://github.com/input-output-hk/cardano-crypto - tag: 2547ad1e80aeabca2899951601079408becbc92c - --sha256: 1p2kg2w02q5w1cvqzhfhqmxviy4xrzada3mmb096j2n6hfr20kri + tag: f73079303f663e028288f9f4a9e08bcca39a923e + --sha256: 1n87i15x54s0cjkh3nsxs4r1x016cdw1fypwmr68936n3xxsjn6q source-repository-package type: git location: https://github.com/input-output-hk/cardano-ledger-specs - tag: a638b9fa854fced8b8165631885268e3814f2d90 - --sha256: 0jfdiha2xjjvqqi3dy410whzjiyhs3vxyic423ddlpbi1pdr3xdd + tag: cf3b01490a2cc7ebbb5ac6f7a4de79e8b1d5c70f + --sha256: 1v15xqy0qvb7ll4080pplrq2ygqgnf443kaq5i6mj0105941mcjc subdir: byron/chain/executable-spec byron/crypto @@ -159,8 +159,8 @@ source-repository-package source-repository-package type: git location: https://github.com/input-output-hk/ouroboros-network - tag: 4fdc309f855792ed30271c30dcd9159232404787 - --sha256: 1j03pzqw0n10m9af17q37b6l90x2qdajp30xjpv2247rwpgip31i + tag: 8b176d11ccf5946fc3f715623cc779c3c449dc8d + --sha256: 0bn9zgx4vrxizxw79ay2dskh8l1lywz6jb4h8h2ikipi7bvkxq7m subdir: io-sim io-sim-classes diff --git a/cardano-cli/src/Cardano/CLI/Shelley/Orphans.hs b/cardano-cli/src/Cardano/CLI/Shelley/Orphans.hs index 49738167872..94c577a856c 100644 --- a/cardano-cli/src/Cardano/CLI/Shelley/Orphans.hs +++ b/cardano-cli/src/Cardano/CLI/Shelley/Orphans.hs @@ -124,7 +124,6 @@ deriving newtype instance ToJSON (Ledger.Stake StandardCrypto) deriving anyclass instance ToJSON (Ledger.GenDelegs StandardCrypto) deriving anyclass instance ToJSON (Ledger.IndividualPoolStake StandardCrypto) -deriving anyclass instance ToJSON (Ledger.BlocksMade StandardCrypto) deriving anyclass instance ToJSON (Ledger.ProposedPPUpdates StandardShelley) deriving anyclass instance ToJSON (Ledger.PPUPState StandardShelley) diff --git a/cardano-cli/src/Cardano/CLI/Shelley/Run/Query.hs b/cardano-cli/src/Cardano/CLI/Shelley/Run/Query.hs index aed8b21f340..e57a370f0ab 100644 --- a/cardano-cli/src/Cardano/CLI/Shelley/Run/Query.hs +++ b/cardano-cli/src/Cardano/CLI/Shelley/Run/Query.hs @@ -606,7 +606,7 @@ queryStakeDistributionFromLocalState era connectInfo@LocalNodeConnectInfo{ queryLocalLedgerState :: forall era ledgerera mode block. ShelleyLedgerEra era ~ ledgerera - => Ledger.ShelleyBased ledgerera + => Consensus.ShelleyBasedEra ledgerera => ShelleyBasedEra era -> LocalNodeConnectInfo mode block -> ExceptT ShelleyQueryCmdLocalStateQueryError IO diff --git a/cardano-node/src/Cardano/Node/Configuration/Logging.hs b/cardano-node/src/Cardano/Node/Configuration/Logging.hs index f62709d1268..3aae3977a41 100644 --- a/cardano-node/src/Cardano/Node/Configuration/Logging.hs +++ b/cardano-node/src/Cardano/Node/Configuration/Logging.hs @@ -273,9 +273,6 @@ nodeBasicInfo nc p nodeStartTime' = do Consensus.ProtocolShelley {} -> let DegenLedgerConfig cfgShelley = Consensus.configLedger cfg in getGenesisValues "Shelley" cfgShelley - Consensus.ProtocolMary {} -> - let DegenLedgerConfig cfgMary = Consensus.configLedger cfg - in getGenesisValues "Mary" cfgMary Consensus.ProtocolCardano {} -> let CardanoLedgerConfig cfgByron cfgShelley cfgAllegra cfgMary = Consensus.configLedger cfg in getGenesisValuesByron cfg cfgByron diff --git a/cardano-node/src/Cardano/Node/Protocol/Cardano.hs b/cardano-node/src/Cardano/Node/Protocol/Cardano.hs index eb8c660f4b5..6f4828d2542 100644 --- a/cardano-node/src/Cardano/Node/Protocol/Cardano.hs +++ b/cardano-node/src/Cardano/Node/Protocol/Cardano.hs @@ -21,7 +21,6 @@ module Cardano.Node.Protocol.Cardano ) where import Prelude -import Cardano.Prelude (headMay) import Control.Monad.Trans.Except (ExceptT) import Control.Monad.Trans.Except.Extra (firstExceptT) @@ -168,7 +167,7 @@ mkConsensusProtocolCardano NodeByronProtocolConfiguration { shelleyBasedInitialNonce = Shelley.genesisHashToPraosNonce shelleyGenesisHash, shelleyBasedLeaderCredentials = - headMay shelleyLeaderCredentials + shelleyLeaderCredentials } Consensus.ProtocolParamsShelley { -- This is /not/ the Shelley protocol version. It is the protocol diff --git a/cardano-node/src/Cardano/Node/Query.hs b/cardano-node/src/Cardano/Node/Query.hs index 1dd061714c8..e795d87b1b2 100644 --- a/cardano-node/src/Cardano/Node/Query.hs +++ b/cardano-node/src/Cardano/Node/Query.hs @@ -73,8 +73,6 @@ answerQueryWithLedgerState protocol extLedgerState query = runIdentity $ byronQuery Consensus.ProtocolShelley {} -> shelleyBasedQuery - Consensus.ProtocolMary {} -> - shelleyBasedQuery Consensus.ProtocolCardano {} -> HF.forwardCompatQuery answerQueryHelper diff --git a/cardano-node/src/Cardano/Tracing/Config.hs b/cardano-node/src/Cardano/Tracing/Config.hs index 27fc8922b40..7769b4b752d 100644 --- a/cardano-node/src/Cardano/Tracing/Config.hs +++ b/cardano-node/src/Cardano/Tracing/Config.hs @@ -60,6 +60,7 @@ type TraceMux = ("TraceMux" :: Symbol) type TraceTxInbound = ("TraceTxInbound" :: Symbol) type TraceTxOutbound = ("TraceTxOutbound" :: Symbol) type TraceTxSubmissionProtocol = ("TraceTxSubmissionProtocol" :: Symbol) +type TraceTxSubmission2Protocol = ("TraceTxSubmission2Protocol" :: Symbol) newtype OnOff (name :: Symbol) = OnOff { isOn :: Bool } deriving (Eq, Show) @@ -107,6 +108,7 @@ data TraceSelection , traceTxInbound :: OnOff TraceTxInbound , traceTxOutbound :: OnOff TraceTxOutbound , traceTxSubmissionProtocol :: OnOff TraceTxSubmissionProtocol + , traceTxSubmission2Protocol :: OnOff TraceTxSubmission2Protocol } deriving (Eq, Show) @@ -175,7 +177,9 @@ traceConfigParser v = txOutbound :: OnOff TraceTxOutbound txOutbound = OnOff False txSubmissionProtocol :: OnOff TraceTxSubmissionProtocol - txSubmissionProtocol = OnOff False in + txSubmissionProtocol = OnOff False + txSubmission2Protocol :: OnOff TraceTxSubmission2Protocol + txSubmission2Protocol = OnOff False in TracingOn <$> (TraceSelection <$> v .:? "TracingVerbosity" .!= NormalVerbosity @@ -211,4 +215,5 @@ traceConfigParser v = <*> v .:? getName mux .!= mux <*> v .:? getName txInbound .!= txInbound <*> v .:? getName txOutbound .!= txOutbound - <*> v .:? getName txSubmissionProtocol .!= txSubmissionProtocol) + <*> v .:? getName txSubmissionProtocol .!= txSubmissionProtocol + <*> v .:? getName txSubmission2Protocol .!= txSubmission2Protocol) diff --git a/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs b/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs index 1ea08bdcfdf..dd706b6fc57 100644 --- a/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs +++ b/cardano-node/src/Cardano/Tracing/OrphanInstances/Network.hs @@ -33,7 +33,7 @@ import Ouroboros.Network.BlockFetch.ClientState (TraceFetchClientState TraceLabelPeer (..)) import qualified Ouroboros.Network.BlockFetch.ClientState as BlockFetch import Ouroboros.Network.BlockFetch.Decision (FetchDecision, FetchDecline (..)) -import Ouroboros.Network.Codec (AnyMessageAndAgency (..)) +import Ouroboros.Network.Codec (AnyMessageAndAgency (..), PeerHasAgency (..)) import Ouroboros.Network.DeltaQ (GSV (..), PeerGSV (..)) import Ouroboros.Network.KeepAlive (TraceKeepAliveClient (..)) import qualified Ouroboros.Network.NodeToClient as NtC @@ -48,6 +48,9 @@ import qualified Ouroboros.Network.Protocol.LocalStateQuery.Type as LocalStateQu import Ouroboros.Network.Protocol.LocalTxSubmission.Type (LocalTxSubmission) import qualified Ouroboros.Network.Protocol.LocalTxSubmission.Type as LocalTxSub import Ouroboros.Network.Protocol.TxSubmission.Type (Message (..), TxSubmission) +import Ouroboros.Network.Protocol.TxSubmission2.Type (TxSubmission2) +import Ouroboros.Network.Protocol.Trans.Hello.Type (Message (..), + ClientHasAgency (..), ServerHasAgency (..)) import Ouroboros.Network.Snocket (LocalAddress (..)) import Ouroboros.Network.Subscription (ConnectResult (..), DnsTrace (..), SubscriberError (..), SubscriptionTrace (..), WithDomainName (..), @@ -533,6 +536,63 @@ instance ToObject (AnyMessageAndAgency (ChainSync blk pt tip)) where , "agency" .= String (pack $ show stok) ] +instance (Show txid, Show tx) + => ToObject (AnyMessageAndAgency (TxSubmission txid tx)) where + toObject _verb (AnyMessageAndAgency stok (MsgRequestTxs txids)) = + mkObject + [ "kind" .= String "MsgRequestTxs" + , "agency" .= String (pack $ show stok) + , "txIds" .= String (pack $ show txids) + ] + toObject _verb (AnyMessageAndAgency stok (MsgReplyTxs txs)) = + mkObject + [ "kind" .= String "MsgReplyTxs" + , "agency" .= String (pack $ show stok) + , "txs" .= String (pack $ show txs) + ] + toObject _verb (AnyMessageAndAgency stok (MsgRequestTxIds _ _ _)) = + mkObject + [ "kind" .= String "MsgRequestTxIds" + , "agency" .= String (pack $ show stok) + ] + toObject _verb (AnyMessageAndAgency stok (MsgReplyTxIds _)) = + mkObject + [ "kind" .= String "MsgReplyTxIds" + , "agency" .= String (pack $ show stok) + ] + toObject _verb (AnyMessageAndAgency stok MsgDone) = + mkObject + [ "kind" .= String "MsgDone" + , "agency" .= String (pack $ show stok) + ] + --TODO: Can't use 'MsgKThxBye' because NodeToNodeV_2 is not introduced yet. + toObject _verb (AnyMessageAndAgency stok _) = + mkObject + [ "kind" .= String "MsgKThxBye" + , "agency" .= String (pack $ show stok) + ] + +instance (Show txid, Show tx) + => ToObject (AnyMessageAndAgency (TxSubmission2 txid tx)) where + toObject _verb (AnyMessageAndAgency + -- we need this pattern match for GHC to recognise this + -- function as total. + (stok@(ClientAgency TokHello)) + MsgHello) = + mkObject + [ "kind" .= String "MsgHello" + , "agency" .= String (pack $ show stok) + ] + toObject verb (AnyMessageAndAgency + (ClientAgency (TokClientTalk stok)) + (MsgTalk msg)) = + toObject verb (AnyMessageAndAgency (ClientAgency stok) msg) + toObject verb (AnyMessageAndAgency + (ServerAgency (TokServerTalk stok)) + (MsgTalk msg)) = + toObject verb (AnyMessageAndAgency (ServerAgency stok) msg) + + instance ToObject (FetchDecision [Point header]) where toObject _verb (Left decline) = mkObject [ "kind" .= String "FetchDecision declined" @@ -635,43 +695,6 @@ instance ToObject NtN.AcceptConnectionsPolicyTrace where ] -instance (Show txid, Show tx) - => ToObject (AnyMessageAndAgency (TxSubmission txid tx)) where - toObject _verb (AnyMessageAndAgency stok (MsgRequestTxs txids)) = - mkObject - [ "kind" .= String "MsgRequestTxs" - , "agency" .= String (pack $ show stok) - , "txIds" .= String (pack $ show txids) - ] - toObject _verb (AnyMessageAndAgency stok (MsgReplyTxs txs)) = - mkObject - [ "kind" .= String "MsgReplyTxs" - , "agency" .= String (pack $ show stok) - , "txs" .= String (pack $ show txs) - ] - toObject _verb (AnyMessageAndAgency stok (MsgRequestTxIds _ _ _)) = - mkObject - [ "kind" .= String "MsgRequestTxIds" - , "agency" .= String (pack $ show stok) - ] - toObject _verb (AnyMessageAndAgency stok (MsgReplyTxIds _)) = - mkObject - [ "kind" .= String "MsgReplyTxIds" - , "agency" .= String (pack $ show stok) - ] - toObject _verb (AnyMessageAndAgency stok MsgDone) = - mkObject - [ "kind" .= String "MsgDone" - , "agency" .= String (pack $ show stok) - ] - --TODO: Can't use 'MsgKThxBye' because NodeToNodeV_2 is not introduced yet. - toObject _verb (AnyMessageAndAgency stok _) = - mkObject - [ "kind" .= String "MsgKThxBye" - , "agency" .= String (pack $ show stok) - ] - - instance ConvertRawHash blk => ToObject (Point blk) where toObject _verb GenesisPoint = diff --git a/cardano-node/src/Cardano/Tracing/Tracers.hs b/cardano-node/src/Cardano/Tracing/Tracers.hs index fddaab6ef8f..7d12fc08e6f 100644 --- a/cardano-node/src/Cardano/Tracing/Tracers.hs +++ b/cardano-node/src/Cardano/Tracing/Tracers.hs @@ -327,6 +327,7 @@ mkTracers TracingOff _ _ = , NodeToNode.tBlockFetchTracer = nullTracer , NodeToNode.tBlockFetchSerialisedTracer = nullTracer , NodeToNode.tTxSubmissionTracer = nullTracer + , NodeToNode.tTxSubmission2Tracer = nullTracer } , ipSubscriptionTracer = nullTracer , dnsSubscriptionTracer= nullTracer @@ -865,6 +866,7 @@ nodeToNodeTracers' trSel verb tr = , NodeToNode.tBlockFetchTracer = tracerOnOff (traceBlockFetchProtocol trSel) verb "BlockFetchProtocol" tr , NodeToNode.tBlockFetchSerialisedTracer = showOnOff (traceBlockFetchProtocolSerialised trSel) "BlockFetchProtocolSerialised" tr , NodeToNode.tTxSubmissionTracer = tracerOnOff (traceTxSubmissionProtocol trSel) verb "TxSubmissionProtocol" tr + , NodeToNode.tTxSubmission2Tracer = tracerOnOff (traceTxSubmission2Protocol trSel) verb "TxSubmission2Protocol" tr } teeTraceBlockFetchDecision diff --git a/nix/sources.json b/nix/sources.json index 6a1fd2bf34c..6b1ca7337da 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -1,38 +1,14 @@ { - "cardano-byron-proxy": { - "branch": "master", - "description": "A bydirectional proxy between the Shelly and Byron versions of the Cardano network", - "homepage": null, - "owner": "input-output-hk", - "repo": "cardano-byron-proxy", - "rev": "85bfe9440a79de1ea663d993de8c795bba434acc", - "sha256": "0b0a0ayls9fdvz3846qg1c2s1b8lgbs0v6pmmc88dbcgfrl1mxpk", - "type": "tarball", - "url": "https://github.com/input-output-hk/cardano-byron-proxy/archive/85bfe9440a79de1ea663d993de8c795bba434acc.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, - "cardano-sl": { - "branch": "develop", - "description": "Cryptographic currency implementing Ouroboros PoS protocol", - "homepage": "", - "owner": "input-output-hk", - "repo": "cardano-sl", - "rev": "1499214d93767b703b9599369a431e67d83f10a2", - "sha256": "0d2v2nhigwyi30p3nn6xk21mm485xpa4y33rqsr69h6s9p8am660", - "type": "tarball", - "url": "https://github.com/input-output-hk/cardano-sl/archive/1499214d93767b703b9599369a431e67d83f10a2.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, "haskell.nix": { "branch": "master", "description": "Alternative Haskell Infrastructure for Nixpkgs", "homepage": "https://input-output-hk.github.io/haskell.nix", "owner": "input-output-hk", "repo": "haskell.nix", - "rev": "22de1b849a7c4137401acc81376fc722d97aafa8", - "sha256": "1qm7lki0xq5n5w4dcxxawzwkkww5lr9sv45kp2f1zh9rdc1jmf68", + "rev": "804981e6892c4e14b1de8ebcf5bef8ce9962e5f1", + "sha256": "15263sl1agi4dkyw2y3iv8nv2s83pdwfyvkixcsyfjc1379ln27j", "type": "tarball", - "url": "https://github.com/input-output-hk/haskell.nix/archive/22de1b849a7c4137401acc81376fc722d97aafa8.tar.gz", + "url": "https://github.com/input-output-hk/haskell.nix/archive/804981e6892c4e14b1de8ebcf5bef8ce9962e5f1.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "iohk-nix": { @@ -41,10 +17,10 @@ "homepage": null, "owner": "input-output-hk", "repo": "iohk-nix", - "rev": "62757227a2b3202ae30b807f2b2aa9a927d34e0e", - "sha256": "15pzi61whix3hzkbac924993dxzf2bx7jlrbg4mma3c1saaa7n1g", + "rev": "65d5b5eabf5252c7ece10efdc507f0a5c9b2aa8a", + "sha256": "1b2n1c3cygrczhgffq6px42hln0344l88cf0hgq78l7m5w7lysal", "type": "tarball", - "url": "https://github.com/input-output-hk/iohk-nix/archive/62757227a2b3202ae30b807f2b2aa9a927d34e0e.tar.gz", + "url": "https://github.com/input-output-hk/iohk-nix/archive/65d5b5eabf5252c7ece10efdc507f0a5c9b2aa8a.tar.gz", "url_template": "https://github.com///archive/.tar.gz" } }