Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bench/plutus-scripts-bench/plutus-scripts-bench.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bench/tx-generator/tx-generator.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
50 changes: 48 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cardano-node-chairman/cardano-node-chairman.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions cardano-node/cardano-node.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
50 changes: 50 additions & 0 deletions cardano-node/src/Cardano/Node/Configuration/POM.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -404,6 +435,9 @@ instance FromJSON PartialNodeConfiguration where
, pncProtocolIdleTimeout
, pncTimeWaitTimeout
, pncChainSyncIdleTimeout
, pncMempoolTimeoutSoft
, pncMempoolTimeoutHard
, pncMempoolTimeoutCapacity
, pncEgressPollInterval
, pncAcceptedConnectionsLimit
, pncDeadlineTargetOfRootPeers
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ->
Expand Down Expand Up @@ -851,6 +898,9 @@ makeNodeConfiguration pnc = do
, ncProtocolIdleTimeout
, ncTimeWaitTimeout
, ncChainSyncIdleTimeout
, ncMempoolTimeoutSoft
, ncMempoolTimeoutHard
, ncMempoolTimeoutCapacity
, ncEgressPollInterval
, ncAcceptedConnectionsLimit
, ncDeadlineTargetOfRootPeers
Expand Down
3 changes: 3 additions & 0 deletions cardano-node/src/Cardano/Node/Parsers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ nodeRunParser = do
, pncTimeWaitTimeout = mempty
, pncEgressPollInterval = mempty
, pncChainSyncIdleTimeout = mempty
, pncMempoolTimeoutSoft = mempty
, pncMempoolTimeoutHard = mempty
, pncMempoolTimeoutCapacity = mempty
, pncAcceptedConnectionsLimit = mempty
, pncDeadlineTargetOfRootPeers = mempty
, pncDeadlineTargetOfKnownPeers = mempty
Expand Down
6 changes: 6 additions & 0 deletions cardano-node/src/Cardano/Node/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <$>" -}
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions cardano-node/src/Cardano/Node/Tracing/Tracers/Consensus.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 _) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cardano-node/src/Cardano/Tracing/Tracers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions cardano-node/test/Test/Cardano/Node/POM.hs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ testPartialYamlConfig =
, pncProtocolIdleTimeout = mempty
, pncTimeWaitTimeout = mempty
, pncChainSyncIdleTimeout = mempty
, pncMempoolTimeoutSoft = mempty
, pncMempoolTimeoutHard = mempty
, pncMempoolTimeoutCapacity = mempty
, pncAcceptedConnectionsLimit = mempty
, pncDeadlineTargetOfRootPeers = mempty
, pncDeadlineTargetOfKnownPeers = mempty
Expand Down Expand Up @@ -199,6 +202,9 @@ testPartialCliConfig =
, pncProtocolIdleTimeout = mempty
, pncTimeWaitTimeout = mempty
, pncChainSyncIdleTimeout = mempty
, pncMempoolTimeoutSoft = mempty
, pncMempoolTimeoutHard = mempty
, pncMempoolTimeoutCapacity = mempty
, pncAcceptedConnectionsLimit = mempty
, pncDeadlineTargetOfRootPeers = mempty
, pncDeadlineTargetOfKnownPeers = mempty
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cardano-submit-api/cardano-submit-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions cardano-testnet/cardano-testnet.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading