diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0eaa1be2..a6bd7069 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - ghc: ["9.6", "9.12"] + ghc: ["9.6", "9.12", "9.14"] os: [ubuntu-latest] env: diff --git a/cabal.project b/cabal.project index 8d023658..c7878de7 100644 --- a/cabal.project +++ b/cabal.project @@ -15,10 +15,10 @@ repository cardano-haskell-packages -- repeat the index-state for hackage to work around haskell.nix parsing limitation index-state: -- Bump this if you need newer packages from Hackage - , hackage.haskell.org 2026-06-29T22:49:53Z + , hackage.haskell.org 2026-07-30T07:30:12Z -- Bump this if you need newer packages from CHaP - , cardano-haskell-packages 2026-07-02T10:10:00Z + , cardano-haskell-packages 2026-07-30T16:22:40Z packages: ./dmq-node @@ -33,70 +33,43 @@ if(os(windows)) constraints: bitvec -simd -if impl(ghc >= 9.12.0) - allow-newer: *:time, - *:nothunks, - --- rejecting: cardano-crypto-class-2.3.1.0 (conflict: cardano-crypto-tests => cardano-crypto-class>=2.2.2 && <2.2.4) --- allow-newer: cardano-crypto-tests:cardano-crypto-class - -source-repository-package - type: git - location: https://github.com/IntersectMBO/ouroboros-network.git - tag: 9e45c79049bd5f20e3de308ee8203c201aa61f9e - --sha256: sha256-dK8taHnenl4D18bOxepXstO0hq7RWj2jnaxECPOT+ew= - subdir: - cardano-diffusion - network-mux - ouroboros-network - acts-generic - -source-repository-package - type: git - location: https://github.com/IntersectMBO/ouroboros-consensus.git - tag: e37ba209ffdbdcb3cc8e7a9cb0fb6d6fa7cce8a3 - --sha256: sha256-srdli4YUIo3HtdWwpk2Tq5okk4GQ5Fpn/ipFO8eykVU= - subdir: - . - -source-repository-package - type: git - location: https://github.com/IntersectMBO/cardano-ledger.git - tag: 245e63dcd335e3ca29823609e4aaa8f5f096a425 - --sha256: sha256-chsapfNnY/V7y1snBzjP0LSVnYl/Axt6GjahTPNOKj0= - subdir: - eras/allegra/impl - eras/alonzo/impl - eras/babbage/impl - eras/byron/chain/executable-spec - eras/byron/crypto - eras/byron/ledger/executable-spec - eras/byron/ledger/impl - eras/conway/impl - eras/dijkstra/impl - eras/mary/impl - eras/shelley-ma/test-suite - eras/shelley/impl - eras/shelley/test-suite - libs/cardano-data - libs/cardano-ledger-api - libs/cardano-ledger-binary - libs/cardano-ledger-core - libs/cardano-protocol-tpraos - libs/non-integral - libs/small-steps - libs/vector-map - -source-repository-package - type: git - location: https://github.com/f-f/kes-agent.git - tag: 32c1ed675d22a30735d9f22f7afa436a3ef3e64a - --sha256: sha256-o7hFX1JnraS6Xq0WoXQwd9Z8GsPPv0Ls2DWvZ08o0ZU= - subdir: - kes-agent - kes-agent-crypto - -constraints: semialign >= 1.4, - validation >= 1.2 && < 2.0 -allow-newer: hedgehog-quickcheck:QuickCheck, - monoidal-containers:semialign +if impl(ghc >= 9.14.0) + allow-newer: + -- https://github.com/well-typed/canonical-json/issues/12 + , canonical-json:containers + + -- https://github.com/well-typed/cborg/issues/373 + , cborg:base + , cborg:containers + , cborg-json:base + + -- https://github.com/well-typed/cborg/issues/373 + , serialise:base + , serialise:containers + + -- https://github.com/IntersectMBO/ouroboros-network/issues/5407 + , serialise:time + , directory:time + + -- https://github.com/phadej/tdigest/issues/50 + , tdigest:base + + -- https://github.com/serokell/haskell-with-utf8/issues/41 + , with-utf8:base + + -- https://github.com/ezyang/compact/issues/24 + , compact:base + + -- https://github.com/amesgen/safe-wild-cards/issues/5 + , safe-wild-cards:template-haskell + + , serdoc-core:template-haskell + + -- https://github.com/JonasDuregard/dictionary-sharing/issues/4 + , dictionary-sharing:containers + + -- https://github.com/obsidiansystems/dependent-map/issues/59 + , dependent-map:containers + + -- https://github.com/dmwit/ordered-containers/issues/33 + , ordered-containers:containers diff --git a/dmq-node/CHANGELOG.md b/dmq-node/CHANGELOG.md index d0b79e95..c55e35e0 100644 --- a/dmq-node/CHANGELOG.md +++ b/dmq-node/CHANGELOG.md @@ -3,10 +3,19 @@ -## 0.7.0.0 -- 2026-07-03 +## 0.7.0.0 -- 2026-07-31 ### Breaking +- Added PeerSelectionPolicy's rng to `NodeKernel`. This allowed to create the + policy in `diffusionApplications` rather than in the `main` module. + +- Using `tx-submission` undecision logic: + - `NodeKernel` data type changed to adapt to the new tx-submission logic + - `SigMempoolResult` is provided by `DMQ.Diffusion.PeerSelection.PeerMetric` module. + - `sigSubmissionLogicPeerTracer` was removed from `DMQTracers` + - `sigDecisionPolicy :: TxDecisionPolicy` was adapted to the new tx-submission logic + - Using `KeepAliveRegistry` instead of `FetchClientRegistry` introduced in a recent `ouroboros-network` PR. The `fetchClientRegistry` field of `NodeKernel` was replaced with `keepAliveRegistry` field. @@ -15,6 +24,16 @@ ### Non-Breaking +- Peer sharing delays and timeouts in `PeerSelectionPolicy` +- Explicit cborg error in local-msg-notification protocol +- Added tracers for NtC connection with `cardano-node`: + - hanshake mini-protocol tracer + - mux tracer + - mux channel tracer + - mux bearer tracer + +- Integrated with `trace-dispatcher ^>= 2.13.0` and `contra-tracer >= 0.2.1.0` + - Added `PrettyShow` instances for - `NodeToNodeVersion` - `NodeToNodeVersionData` diff --git a/dmq-node/changelog.d/20260707_092212_coot_dmq_changes.md b/dmq-node/changelog.d/20260707_092212_coot_dmq_changes.md deleted file mode 100644 index 556129b8..00000000 --- a/dmq-node/changelog.d/20260707_092212_coot_dmq_changes.md +++ /dev/null @@ -1,28 +0,0 @@ - - -### Breaking - -- Added PeerSelectionPolicy's rng to `NodeKernel`. This allowed to create the - policy in `diffusionApplications` rather than in the `main` module. - -### Non-Breaking - -- Peer sharing delays and timeouts in `PeerSelectionPolicy` -- Explicit cborg error in local-msg-notification protocol -- Added tracers for NtC connection with `cardano-node`: - - hanshake mini-protocol tracer - - mux tracer - - mux channel tracer - - mux bearer tracer - - diff --git a/dmq-node/changelog.d/20260710_092801_coot_prepare_11_1.md b/dmq-node/changelog.d/20260710_092801_coot_prepare_11_1.md deleted file mode 100644 index 6163a356..00000000 --- a/dmq-node/changelog.d/20260710_092801_coot_prepare_11_1.md +++ /dev/null @@ -1,25 +0,0 @@ - - -### Breaking - -- Using `tx-submission` undecision logic: - - `NodeKernel` data type changed to adapt to the new tx-submission logic - - `SigMempoolResult` is provided by `DMQ.Diffusion.PeerSelection.PeerMetric` module. - - `sigSubmissionLogicPeerTracer` was removed from `DMQTracers` - - `sigDecisionPolicy :: TxDecisionPolicy` was adapted to the new tx-submission logic - -### Non-Breaking - -- Integrated with `trace-dispatcher ^>= 2.13.0` and `contra-tracer >= 0.2.1.0` - - diff --git a/dmq-node/dmq-node.cabal b/dmq-node/dmq-node.cabal index 4c632eb9..011da391 100644 --- a/dmq-node/dmq-node.cabal +++ b/dmq-node/dmq-node.cabal @@ -117,7 +117,7 @@ library cardano-slotting, cardano-strict-containers, cborg >=0.2.1 && <0.3, - containers >=0.5 && <0.8, + containers >=0.5 && <0.9, contra-tracer >=0.1 && <0.3, deepseq >=1.0 && <1.6, directory, @@ -131,17 +131,17 @@ library mmap, mtl, network ^>=3.2.7, - network-mux ^>=0.10, + network-mux ^>=0.11, nothunks, optparse-applicative >=0.18 && <0.20, - ouroboros-consensus:{ouroboros-consensus, cardano, diffusion}, - ouroboros-network:{ouroboros-network, api, framework, orphan-instances, protocols, tracing} ^>=1.1.0.0, + ouroboros-consensus:{ouroboros-consensus, cardano, diffusion} ^>=4.0, + ouroboros-network:{ouroboros-network, api, framework, orphan-instances, protocols, tracing} ^>=1.2, psqueues, quiet, random ^>=1.3, singletons, text >=1.2.4 && <2.2, - time >=1.12 && <1.15, + time >=1.12 && <1.17, trace-dispatcher ^>=2.13.0, transformers, transformers-except, @@ -211,6 +211,7 @@ test-suite dmq-tests QuickCheck, base >=4.14 && <4.23, bytestring, + cardano-binary, cardano-crypto-class:{cardano-crypto-class, testlib}, cardano-ledger-api, cardano-ledger-core, diff --git a/dmq-node/src/DMQ/Protocol/SigSubmission/Codec.hs b/dmq-node/src/DMQ/Protocol/SigSubmission/Codec.hs index a12d7a05..bbe87434 100644 --- a/dmq-node/src/DMQ/Protocol/SigSubmission/Codec.hs +++ b/dmq-node/src/DMQ/Protocol/SigSubmission/Codec.hs @@ -37,9 +37,7 @@ import Cardano.Crypto.Hash.Class (hashFromBytes, hashToBytesShort) import Network.TypedProtocol.Codec.CBOR import Cardano.Binary (FromCBOR (..), ToCBOR (..)) -import Cardano.Crypto.DSIGN.Class (decodeSignedDSIGN, decodeVerKeyDSIGN, - encodeSignedDSIGN) -import Cardano.Crypto.KES.Class (decodeSigKES, decodeVerKeyKES, encodeVerKeyKES) +import Cardano.Binary.FixedSizeCodec (decodeFixedSized, encodeFixedSized) import Cardano.KESAgent.KES.Crypto (Crypto (..)) import Cardano.KESAgent.KES.OCert (OCert (..)) @@ -119,10 +117,10 @@ encodeSigOpCertificate :: Crypto crypto => SigOpCertificate crypto -> CBOR.Encoding encodeSigOpCertificate (SigOpCertificate ocert) = CBOR.encodeListLen 4 - <> encodeVerKeyKES (ocertVkHot ocert) + <> encodeFixedSized (ocertVkHot ocert) <> toCBOR (ocertN ocert) <> toCBOR (ocertKESPeriod ocert) - <> encodeSignedDSIGN (ocertSigma ocert) + <> encodeFixedSized (ocertSigma ocert) decodeSigOpCertificate :: forall s crypto. Crypto crypto @@ -130,10 +128,10 @@ decodeSigOpCertificate :: forall s crypto. Crypto crypto decodeSigOpCertificate = do len <- CBOR.decodeListLen when (len /= 4) $ fail (printf "decodeSigOpCertificate: unexpected number of parameters %d" len) - ocertVkHot <- decodeVerKeyKES + ocertVkHot <- decodeFixedSized ocertN <- fromCBOR ocertKESPeriod <- fromCBOR - ocertSigma <- decodeSignedDSIGN + ocertSigma <- decodeFixedSized return $ SigOpCertificate $ OCert { ocertVkHot, ocertN, @@ -175,9 +173,9 @@ decodeSig = do endOffset <- CBOR.peekByteOffset -- end of signed data - sigRawKESSignature <- SigKESSignature <$> decodeSigKES + sigRawKESSignature <- SigKESSignature <$> decodeFixedSized sigRawOpCertificate <- decodeSigOpCertificate - sigRawColdKey <- SigColdKey <$> decodeVerKeyDSIGN + sigRawColdKey <- SigColdKey <$> decodeFixedSized return $ \bytes -- ^ full bytes of the message, not just the sig part -> SigRawWithSignedBytes { sigRawSignedBytes = Utils.bytesBetweenOffsets startOffset endOffset bytes, diff --git a/dmq-node/src/DMQ/Protocol/SigSubmission/Type.hs b/dmq-node/src/DMQ/Protocol/SigSubmission/Type.hs index 77b1b32a..d6e1dc9d 100644 --- a/dmq-node/src/DMQ/Protocol/SigSubmission/Type.hs +++ b/dmq-node/src/DMQ/Protocol/SigSubmission/Type.hs @@ -149,8 +149,7 @@ deriving instance ( DSIGNAlgorithm (KES.DSIGN crypto) ) => Eq (SigRaw crypto) -instance Crypto crypto - => ToJSON (SigRaw crypto) where +instance ToJSON (SigRaw crypto) where toJSON SigRaw { sigRawId , sigRawKESPeriod , sigRawExpiresAt @@ -207,8 +206,7 @@ deriving instance ( DSIGNAlgorithm (KES.DSIGN crypto) ) => Eq (SigRawWithSignedBytes crypto) -instance Crypto crypto - => ToJSON (SigRawWithSignedBytes crypto) where +instance ToJSON (SigRawWithSignedBytes crypto) where toJSON SigRawWithSignedBytes {sigRaw} = toJSON sigRaw instance Crypto crypto @@ -247,8 +245,7 @@ deriving instance ( DSIGNAlgorithm (KES.DSIGN crypto) ) => Eq (Sig crypto) -instance Crypto crypto - => ToJSON (Sig crypto) where +instance ToJSON (Sig crypto) where toJSON SigWithBytes {sigRawWithSignedBytes} = toJSON sigRawWithSignedBytes instance Crypto crypto diff --git a/dmq-node/test/DMQ/Protocol/SigSubmission/Test.hs b/dmq-node/test/DMQ/Protocol/SigSubmission/Test.hs index 3cd142a7..fd84107e 100644 --- a/dmq-node/test/DMQ/Protocol/SigSubmission/Test.hs +++ b/dmq-node/test/DMQ/Protocol/SigSubmission/Test.hs @@ -46,13 +46,14 @@ import System.IO.Unsafe (unsafePerformIO) import Network.TypedProtocol.Codec import Network.TypedProtocol.Codec.Properties hiding (prop_codec) +import Cardano.Binary.FixedSizeCodec (encodeFixedSized) import Cardano.Crypto.DSIGN.Class (DSIGNAlgorithm, SignKeyDSIGN, - deriveVerKeyDSIGN, encodeVerKeyDSIGN) + deriveVerKeyDSIGN) import Cardano.Crypto.DSIGN.Class qualified as DSIGN import Cardano.Crypto.Hash.Blake2b (Blake2b_256) import Cardano.Crypto.Hash.Class (Hash, castHash, hashFromBytes, hashSize, hashWith) -import Cardano.Crypto.KES.Class (KESAlgorithm (..), VerKeyKES, encodeSigKES) +import Cardano.Crypto.KES.Class (KESAlgorithm (..), VerKeyKES) import Cardano.Crypto.KES.Class qualified as KES import Cardano.Crypto.PinnedSizedBytes (PinnedSizedBytes, psbToByteString) import Cardano.Crypto.Seed (mkSeedFromBytes) @@ -540,9 +541,9 @@ encodeSigRaw sigRaw@SigRaw { sigRawId, sigRawKESSignature, sigRawOpCertificate, CBOR.encodeListLen 5 <> encodeSigId sigRawId <> encodeSigPayload sigRaw - <> encodeSigKES (getSigKESSignature sigRawKESSignature) + <> encodeFixedSized (getSigKESSignature sigRawKESSignature) <> encodeSigOpCertificate sigRawOpCertificate - <> encodeVerKeyDSIGN (getSigColdKey sigRawColdKey) + <> encodeFixedSized (getSigColdKey sigRawColdKey) -- note: KES signature is updated by updateSigFn shrinkSigFn :: forall crypto. diff --git a/dmq-node/test/Test/DMQ/SigSubmission/App.hs b/dmq-node/test/Test/DMQ/SigSubmission/App.hs index 9bc73547..eb33bb31 100644 --- a/dmq-node/test/Test/DMQ/SigSubmission/App.hs +++ b/dmq-node/test/Test/DMQ/SigSubmission/App.hs @@ -47,7 +47,6 @@ import Ouroboros.Network.ControlMessage (ControlMessage (..), ControlMessageSTM) import Ouroboros.Network.Driver import Ouroboros.Network.Protocol.TxSubmission2.Type (NumTxIdsToReq (..)) import Ouroboros.Network.TxSubmission.Inbound.V2 -import Ouroboros.Network.Util.ShowProxy import DMQ.Diffusion.PeerSelection.PeerMetric (PeerMetricState (..), TraceLabelPeer (..), announcinessImpl, peerMetricVar) @@ -253,8 +252,6 @@ runSigSubmissionV2 , MonadTime m , MonadTimer m , MonadTraceSTM m - , ShowProxy sigid - , Typeable sigid , Show peeraddr , Ord peeraddr , Typeable peeraddr diff --git a/flake.lock b/flake.lock index 1fb641fd..b4b28b28 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1783608062, - "narHash": "sha256-b7vCPkrTeKFDfJ3x9TMB9pwUm0eqrR28mxvunZMi/0c=", + "lastModified": 1785429959, + "narHash": "sha256-11V+x8LMNOl1k3n5SlL6EJhXOADdqBI21UmAl5HNSVY=", "owner": "IntersectMBO", "repo": "cardano-haskell-packages", - "rev": "28088c447cffe5dce9816c3a1ea5df693b350dba", + "rev": "7ce63459d3adbf8ed6b505b627ea75ce77701f39", "type": "github" }, "original": { @@ -155,11 +155,11 @@ "hackage": { "flake": false, "locked": { - "lastModified": 1782826502, - "narHash": "sha256-G6bt7DeWkDXJWI/fHME467V/SOaUdfG6hk7bTRuWyKg=", + "lastModified": 1785489447, + "narHash": "sha256-6vS3h7om2nEWN6XipTCi+jpyEb244bDbR0r8T/TdW5k=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "6a87e2657c145eb81d5f0f53702d4f26c08f9cbf", + "rev": "2a80853e0f81c586fbea20184e9035237cb4a6ad", "type": "github" }, "original": {