diff --git a/bench/plutus-scripts-bench/plutus-scripts-bench.cabal b/bench/plutus-scripts-bench/plutus-scripts-bench.cabal index 169a3126ed8..85667b6991f 100644 --- a/bench/plutus-scripts-bench/plutus-scripts-bench.cabal +++ b/bench/plutus-scripts-bench/plutus-scripts-bench.cabal @@ -82,10 +82,10 @@ library -- IOG dependencies -------------------------- build-depends: - , cardano-api ^>=10.19 - , plutus-ledger-api ^>=1.53 - , plutus-tx ^>=1.53 - , plutus-tx-plugin ^>=1.53 + , cardano-api ^>=10.21 + , plutus-ledger-api ^>=1.56 + , plutus-tx ^>=1.56 + , plutus-tx-plugin ^>=1.56 ------------------------ -- Non-IOG dependencies diff --git a/bench/tx-generator/tx-generator.cabal b/bench/tx-generator/tx-generator.cabal index afaa52fd929..47d78179e65 100644 --- a/bench/tx-generator/tx-generator.cabal +++ b/bench/tx-generator/tx-generator.cabal @@ -111,9 +111,9 @@ library , attoparsec-aeson , base16-bytestring , bytestring - , cardano-api ^>= 10.19 + , cardano-api ^>= 10.21 , cardano-binary - , cardano-cli ^>= 10.13 + , cardano-cli ^>= 10.14 , cardano-crypto-class , cardano-crypto-wrapper , cardano-data diff --git a/cabal.project b/cabal.project index 3ef2447a9db..104b27085a0 100644 --- a/cabal.project +++ b/cabal.project @@ -13,8 +13,54 @@ repository cardano-haskell-packages -- See CONTRIBUTING for information about these, including some Nix commands -- you need to run if you change them index-state: - , hackage.haskell.org 2025-10-17T00:26:22Z - , cardano-haskell-packages 2025-11-20T19:55:27Z + , hackage.haskell.org 2026-01-23T16:01:56Z + , cardano-haskell-packages 2026-01-20T18:32:46Z + +-- BEGIN SRP STANZAS MANAGED BY STANZAMAN -- + +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-cli.git + tag: 89b1a5d06cc0f17443e45b5ecc592c695d059f99 + subdir: cardano-cli + --sha256: 0m4wf588irhdwwbiknin9988drfzb8yv3g8bfp0i7b68kb671hnl + +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-consensus.git + tag: bf92f58c70d1b794dcdd630f52201130b2d076f1 + subdir: ouroboros-consensus + --sha256: 0233dfw76wl220k83a6ly60061jz6q082lpj7z0nzhck64lgkzn4 + +source-repository-package + type: git + location: https://github.com/IntersectMBO/cardano-api.git + tag: c7b22699dc87e9efed6b6654ef91788bf609d43a + subdir: cardano-api + --sha256: 1hbfwbdz9by7wqn323mk4611n9vnjjz946ds456z5lpa2l8djzg9 + +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-consensus.git + tag: bf92f58c70d1b794dcdd630f52201130b2d076f1 + subdir: ouroboros-consensus-diffusion + --sha256: 0233dfw76wl220k83a6ly60061jz6q082lpj7z0nzhck64lgkzn4 + +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-consensus.git + tag: bf92f58c70d1b794dcdd630f52201130b2d076f1 + subdir: ouroboros-consensus-cardano + --sha256: 0233dfw76wl220k83a6ly60061jz6q082lpj7z0nzhck64lgkzn4 + +source-repository-package + type: git + location: https://github.com/IntersectMBO/ouroboros-consensus.git + tag: bf92f58c70d1b794dcdd630f52201130b2d076f1 + subdir: ouroboros-consensus-protocol + --sha256: 0233dfw76wl220k83a6ly60061jz6q082lpj7z0nzhck64lgkzn4 + +-- END SRP STANZAS MANAGED BY STANZAMAN -- packages: cardano-node diff --git a/cardano-node-chairman/cardano-node-chairman.cabal b/cardano-node-chairman/cardano-node-chairman.cabal index ed6faec2369..d8a96c5343b 100644 --- a/cardano-node-chairman/cardano-node-chairman.cabal +++ b/cardano-node-chairman/cardano-node-chairman.cabal @@ -88,5 +88,5 @@ test-suite chairman-tests ghc-options: -threaded -rtsopts "-with-rtsopts=-N -T" build-tool-depends: cardano-node:cardano-node - , cardano-cli:cardano-cli ^>= 10.13 + , cardano-cli:cardano-cli ^>= 10.14 , cardano-node-chairman:cardano-node-chairman diff --git a/cardano-node/cardano-node.cabal b/cardano-node/cardano-node.cabal index f6836d20bd6..443e038fed5 100644 --- a/cardano-node/cardano-node.cabal +++ b/cardano-node/cardano-node.cabal @@ -138,7 +138,7 @@ library , async , base16-bytestring , bytestring - , cardano-api ^>= 10.19 + , cardano-api ^>= 10.21 , cardano-crypto-class ^>=2.2.3.2 , cardano-crypto-wrapper , cardano-git-rev ^>=0.2.2 @@ -185,9 +185,9 @@ library , network-mux >= 0.8 , nothunks , optparse-applicative - , ouroboros-consensus ^>= 0.28 + , ouroboros-consensus ^>= 0.29 , ouroboros-consensus-cardano ^>= 0.26 - , ouroboros-consensus-diffusion ^>= 0.24 + , ouroboros-consensus-diffusion ^>= 0.25 , ouroboros-consensus-protocol , ouroboros-network-api ^>= 0.16 , ouroboros-network:{ouroboros-network, cardano-diffusion, orphan-instances} ^>= 0.22.4 diff --git a/cardano-node/src/Cardano/Node/Configuration/POM.hs b/cardano-node/src/Cardano/Node/Configuration/POM.hs index 4255c77d775..13f9052837d 100644 --- a/cardano-node/src/Cardano/Node/Configuration/POM.hs +++ b/cardano-node/src/Cardano/Node/Configuration/POM.hs @@ -140,6 +140,28 @@ data NodeConfiguration -- 'Ouroboros.Network.Protocol.ChainSync.Codec.ChainSyncTimeout' , ncChainSyncIdleTimeout :: TimeoutOverride + -- Mempool timeout configurations: + -- These configuration control a lightweight "defensive programming" + -- feature in the Mempool. + -- See documentation in @Ouroboros.Consensus.Mempool.API@ for more info + + -- | If the mempool takes longer than this to validate a tx, then it + -- discards the tx instead of adding it. + , ncMempoolTimeoutSoft :: DiffTime + + -- | If the mempool takes longer than this to validate a tx, then it + -- disconnects from the peer. + -- + -- WARNING: if this is less than 'mempoolTimeoutSoft', then + -- 'mempoolTimeoutSoft' is irrelevant. If it's equal or just barely larger, + -- then the soft/hard distinction will likely be unreliable. + , ncMempoolTimeoutHard :: DiffTime + + -- | If the mempool takes longer than this cumulatively to + -- validate when each entered the mempool, then the mempool is at + -- capacity, ie it's full, ie no tx can be added. + , ncMempoolTimeoutCapacity :: DiffTime + -- | Node AcceptedConnectionsLimit , ncAcceptedConnectionsLimit :: !AcceptedConnectionsLimit @@ -237,6 +259,11 @@ data PartialNodeConfiguration , pncChainSyncIdleTimeout :: !(Last DiffTime) + -- Mempool timeout configurations: + , pncMempoolTimeoutSoft :: !(Last DiffTime) + , pncMempoolTimeoutHard :: !(Last DiffTime) + , pncMempoolTimeoutCapacity :: !(Last DiffTime) + -- AcceptedConnectionsLimit , pncAcceptedConnectionsLimit :: !(Last AcceptedConnectionsLimit) @@ -370,6 +397,10 @@ instance FromJSON PartialNodeConfiguration where pncChainSyncIdleTimeout <- Last <$> v .:? "ChainSyncIdleTimeout" + pncMempoolTimeoutSoft <- Last <$> v .:? "MempoolTimeoutSoft" + pncMempoolTimeoutHard <- Last <$> v .:? "MempoolTimeoutHard" + pncMempoolTimeoutCapacity <- Last <$> v .:? "MempoolTimeoutCapacity" + -- Peer Sharing pncPeerSharing <- Last <$> v .:? "PeerSharing" @@ -404,6 +435,9 @@ instance FromJSON PartialNodeConfiguration where , pncProtocolIdleTimeout , pncTimeWaitTimeout , pncChainSyncIdleTimeout + , pncMempoolTimeoutSoft + , pncMempoolTimeoutHard + , pncMempoolTimeoutCapacity , pncEgressPollInterval , pncAcceptedConnectionsLimit , pncDeadlineTargetOfRootPeers @@ -658,6 +692,9 @@ defaultPartialNodeConfiguration = , pncAcceptedConnectionsLimit = Last (Just Ouroboros.defaultAcceptedConnectionsLimit) -- https://ouroboros-network.cardano.intersectmbo.org/ouroboros-network/Ouroboros-Network-Diffusion-Configuration.html#v:defaultAcceptedConnectionsLimit , pncChainSyncIdleTimeout = mempty + , pncMempoolTimeoutSoft = mempty + , pncMempoolTimeoutHard = mempty + , pncMempoolTimeoutCapacity = mempty -- these targets are set properly in makeNodeConfiguration below , pncDeadlineTargetOfRootPeers = mempty @@ -780,6 +817,16 @@ makeNodeConfiguration pnc = do $ getLast $ pncChainSyncIdleTimeout pnc + let mempoolTimeouts = ( getLast (pncMempoolTimeoutSoft pnc) + , getLast (pncMempoolTimeoutHard pnc) + , getLast (pncMempoolTimeoutCapacity pnc) + ) + (ncMempoolTimeoutSoft, ncMempoolTimeoutHard, ncMempoolTimeoutCapacity) <- + case mempoolTimeouts of + (Just s, Just h, Just c) -> pure (s, h, c) + (Nothing, Nothing, Nothing) -> pure (1, 1.5, 5) + _ -> Left "Mempool timeouts must be either all set or all unset" + let ncPeerSharing = case pncPeerSharing pnc of Last Nothing -> @@ -851,6 +898,9 @@ makeNodeConfiguration pnc = do , ncProtocolIdleTimeout , ncTimeWaitTimeout , ncChainSyncIdleTimeout + , ncMempoolTimeoutSoft + , ncMempoolTimeoutHard + , ncMempoolTimeoutCapacity , ncEgressPollInterval , ncAcceptedConnectionsLimit , ncDeadlineTargetOfRootPeers diff --git a/cardano-node/src/Cardano/Node/Parsers.hs b/cardano-node/src/Cardano/Node/Parsers.hs index 077e9675b62..b6ec0c7441b 100644 --- a/cardano-node/src/Cardano/Node/Parsers.hs +++ b/cardano-node/src/Cardano/Node/Parsers.hs @@ -121,6 +121,9 @@ nodeRunParser = do , pncTimeWaitTimeout = mempty , pncEgressPollInterval = mempty , pncChainSyncIdleTimeout = mempty + , pncMempoolTimeoutSoft = mempty + , pncMempoolTimeoutHard = mempty + , pncMempoolTimeoutCapacity = mempty , pncAcceptedConnectionsLimit = mempty , pncDeadlineTargetOfRootPeers = mempty , pncDeadlineTargetOfKnownPeers = mempty diff --git a/cardano-node/src/Cardano/Node/Run.hs b/cardano-node/src/Cardano/Node/Run.hs index 2c87c34956f..edc43f58078 100644 --- a/cardano-node/src/Cardano/Node/Run.hs +++ b/cardano-node/src/Cardano/Node/Run.hs @@ -166,6 +166,7 @@ import System.Win32.File import Paths_cardano_node (version) import Paths_cardano_node (version) +import Ouroboros.Consensus.Mempool (MempoolTimeoutConfig(..)) {- HLINT ignore "Fuse concatMap/map" -} {- HLINT ignore "Redundant <$>" -} @@ -466,6 +467,11 @@ handleSimpleNode blockType runP tracers nc onKernel = do , rnTraceNTN = nodeToNodeTracers tracers , rnTraceNTC = nodeToClientTracers tracers , rnProtocolInfo = pInfo + , rnMempoolTimeoutConfig = Just $ MempoolTimeoutConfig + { mempoolTimeoutSoft = ncMempoolTimeoutSoft nc + , mempoolTimeoutHard = ncMempoolTimeoutHard nc + , mempoolTimeoutCapacity = ncMempoolTimeoutCapacity nc + } , rnNodeKernelHook = \registry nodeKernel -> do -- set the initial block forging blockForging <- snd (Api.protocolInfo runP) (Consensus.kesAgentTracer $ consensusTracers tracers) diff --git a/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs b/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs index fa4e08f3da6..76c75c7904c 100644 --- a/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs +++ b/cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs @@ -1520,7 +1520,7 @@ instance ( tx ~ GenTx blk , "mempoolHash" .= String (renderChainHash @blk (renderHeaderHash (Proxy @blk)) mpHash) , "mempoolSlot" .= toJSON (unSlotNo mpSlot) ] - forMachine _dtal (TraceForgedBlock slotNo _ blk _) = + forMachine _dtal (TraceForgedBlock slotNo _ blk _ _) = mconcat [ "kind" .= String "TraceForgedBlock" , "slot" .= toJSON (unSlotNo slotNo) @@ -1632,7 +1632,7 @@ instance ( tx ~ GenTx blk <> renderChainHash @blk (renderHeaderHash (Proxy @blk)) mpHash <> " ticked to slot " <> showT (unSlotNo mpSlot) - forHuman (TraceForgedBlock slotNo _ _ _) = + forHuman (TraceForgedBlock slotNo _ _ _ _) = "Forged block in slot " <> showT (unSlotNo slotNo) forHuman (TraceDidntAdoptBlock slotNo _) = "Didn't adopt forged block in slot " <> showT (unSlotNo slotNo) @@ -1690,7 +1690,7 @@ instance ( tx ~ GenTx blk [CounterM "Forge.node-is-leader" Nothing] asMetrics TraceForgeTickedLedgerState {} = [] asMetrics TraceForgingMempoolSnapshot {} = [] - asMetrics (TraceForgedBlock slot _ _ _) = + asMetrics (TraceForgedBlock slot _ _ _ _) = [IntM "forgedSlotLast" (fromIntegral $ unSlotNo slot), CounterM "Forge.forged" Nothing] asMetrics (TraceDidntAdoptBlock _slot _) = diff --git a/cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs b/cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs index e22cf83c3b7..47884cdc778 100644 --- a/cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs +++ b/cardano-node/src/Cardano/Tracing/OrphanInstances/Consensus.hs @@ -479,7 +479,7 @@ instance ( tx ~ GenTx blk <> renderChainHash (Text.decodeLatin1 . toRawHash (Proxy @blk)) mpHash <> " ticked to slot " <> showT (unSlotNo mpSlot) - TraceForgedBlock slotNo _ _ _ -> const $ + TraceForgedBlock slotNo _ _ _ _ -> const $ "Forged block in slot " <> showT (unSlotNo slotNo) TraceDidntAdoptBlock slotNo _ -> const $ "Didn't adopt forged block in slot " <> showT (unSlotNo slotNo) @@ -1698,7 +1698,7 @@ instance ( RunNode blk , "mempoolHash" .= String (renderChainHash @blk (renderHeaderHash (Proxy @blk)) mpHash) , "mempoolSlot" .= toJSON (unSlotNo mpSlot) ] - toObject _verb (TraceForgedBlock slotNo _ blk _) = + toObject _verb (TraceForgedBlock slotNo _ blk _ _) = mconcat [ "kind" .= String "TraceForgedBlock" , "slot" .= toJSON (unSlotNo slotNo) diff --git a/cardano-node/src/Cardano/Tracing/Tracers.hs b/cardano-node/src/Cardano/Tracing/Tracers.hs index 7aaf9b03cb4..82f57cbee00 100644 --- a/cardano-node/src/Cardano/Tracing/Tracers.hs +++ b/cardano-node/src/Cardano/Tracing/Tracers.hs @@ -1140,7 +1140,7 @@ teeForge' tr = LogValue "forgeTickedLedgerState" $ PureI $ fromIntegral $ unSlotNo slot Consensus.TraceForgingMempoolSnapshot slot _prevPt _mpHash _mpSlotNo -> LogValue "forgingMempoolSnapshot" $ PureI $ fromIntegral $ unSlotNo slot - Consensus.TraceForgedBlock slot _ _ _ -> + Consensus.TraceForgedBlock slot _ _ _ _ -> LogValue "forgedSlotLast" $ PureI $ fromIntegral $ unSlotNo slot Consensus.TraceDidntAdoptBlock slot _ -> LogValue "notAdoptedSlotLast" $ PureI $ fromIntegral $ unSlotNo slot diff --git a/cardano-node/test/Test/Cardano/Node/POM.hs b/cardano-node/test/Test/Cardano/Node/POM.hs index cfe7fd8be2a..d4de440fbd7 100644 --- a/cardano-node/test/Test/Cardano/Node/POM.hs +++ b/cardano-node/test/Test/Cardano/Node/POM.hs @@ -149,6 +149,9 @@ testPartialYamlConfig = , pncProtocolIdleTimeout = mempty , pncTimeWaitTimeout = mempty , pncChainSyncIdleTimeout = mempty + , pncMempoolTimeoutSoft = mempty + , pncMempoolTimeoutHard = mempty + , pncMempoolTimeoutCapacity = mempty , pncAcceptedConnectionsLimit = mempty , pncDeadlineTargetOfRootPeers = mempty , pncDeadlineTargetOfKnownPeers = mempty @@ -199,6 +202,9 @@ testPartialCliConfig = , pncProtocolIdleTimeout = mempty , pncTimeWaitTimeout = mempty , pncChainSyncIdleTimeout = mempty + , pncMempoolTimeoutSoft = mempty + , pncMempoolTimeoutHard = mempty + , pncMempoolTimeoutCapacity = mempty , pncAcceptedConnectionsLimit = mempty , pncDeadlineTargetOfRootPeers = mempty , pncDeadlineTargetOfKnownPeers = mempty @@ -251,6 +257,9 @@ eExpectedConfig = do , ncProtocolIdleTimeout = 5 , ncTimeWaitTimeout = 60 , ncChainSyncIdleTimeout = NoTimeoutOverride + , ncMempoolTimeoutSoft = 1.0 + , ncMempoolTimeoutHard = 1.5 + , ncMempoolTimeoutCapacity = 5.0 , ncAcceptedConnectionsLimit = AcceptedConnectionsLimit { acceptedConnectionsHardLimit = 512 diff --git a/cardano-submit-api/cardano-submit-api.cabal b/cardano-submit-api/cardano-submit-api.cabal index 866ca526430..248564ae3ba 100644 --- a/cardano-submit-api/cardano-submit-api.cabal +++ b/cardano-submit-api/cardano-submit-api.cabal @@ -39,9 +39,9 @@ library , aeson , async , bytestring - , cardano-api ^>= 10.19 + , cardano-api ^>= 10.21 , cardano-binary - , cardano-cli ^>= 10.13 + , cardano-cli ^>= 10.14 , cardano-crypto-class ^>=2.2.3.2 , containers , ekg-core diff --git a/cardano-testnet/cardano-testnet.cabal b/cardano-testnet/cardano-testnet.cabal index d9ad3e1840a..81364453082 100644 --- a/cardano-testnet/cardano-testnet.cabal +++ b/cardano-testnet/cardano-testnet.cabal @@ -41,8 +41,8 @@ library , annotated-exception , ansi-terminal , bytestring - , cardano-api ^>= 10.19 - , cardano-cli:{cardano-cli, cardano-cli-test-lib} ^>= 10.13 + , cardano-api ^>= 10.21 + , cardano-cli:{cardano-cli, cardano-cli-test-lib} ^>= 10.14 , cardano-crypto-class ^>=2.2.3.2 , cardano-crypto-wrapper , cardano-git-rev ^>= 0.2.2 diff --git a/flake.lock b/flake.lock index 4d13bd65fc0..5553fb78b4c 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "CHaP": { "flake": false, "locked": { - "lastModified": 1764072073, - "narHash": "sha256-ZLlhdnWO8bP5gsbmUKg6U+3oxBX66vZUO6jyirAhgHo=", + "lastModified": 1768935557, + "narHash": "sha256-yJQ9f7lLutDFJzuAksbmrkl1AnZCGwaYmQAisHSHVgU=", "owner": "intersectmbo", "repo": "cardano-haskell-packages", - "rev": "be9725d16fb590998020914e0b71f41a23c50ec2", + "rev": "711fad586776f3a71b7922e0bf2abcc6c2bc2fdb", "type": "github" }, "original": { @@ -306,11 +306,11 @@ "hackageNix_2": { "flake": false, "locked": { - "lastModified": 1761265459, - "narHash": "sha256-7tsC/ZcNBJR1pXWdKsRoh/qlVDhCxb1Ukr7PVd2zieE=", + "lastModified": 1769184843, + "narHash": "sha256-jQ64H8jCGAX1ZDuHmJfWSYojZUuduIUU9RMLQVl0SkI=", "owner": "input-output-hk", "repo": "hackage.nix", - "rev": "eb8e4d02528b4973cd09450bb62cf34997777226", + "rev": "4ea5205ba96ff9071cc490f34d1bdd101181e40a", "type": "github" }, "original": {